Copy from 72246 to trunk
[mono.git] / mcs / mcs / ChangeLog
1 2007-02-20  Marek Safar  <marek.safar@gmail.com>
2
3         * class.cs, report.cs: Capture more details when things go wrong.
4
5 2007-02-20  Marek Safar  <marek.safar@gmail.com>
6
7         A fix for bug #80650
8         * cs-parser.jay: Anonymous container starts at constructor declaration
9         and not at block beginning because it has to be usable in constructor
10         initializer.
11
12         * statement.cs: Use context location and not block one for error reporting.
13
14 2007-02-18  Marek Safar  <marek.safar@gmail.com>
15
16         A fix for bug #78712
17         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
18         too.
19
20 2007-02-18  Marek Safar  <marek.safar@gmail.com>
21
22         A fix for bug #80493 by Atsushi Enomoto
23         * cs-parser.jay: Ignore invalid attribute target.
24
25 2007-02-18  Marek Safar  <marek.safar@gmail.com>
26  
27         * cs-tokenizer.cs: Ignore '\0' as white space character.
28
29 2007-02-17  Miguel de Icaza  <miguel@novell.com>
30
31         * cs-parser.jay: Add support for lambda expressions to the mcs
32         compiler as well.
33
34         * lambda.cs: Only clone when we are probing, not on the final call
35         (Compatible is the final call). 
36
37         * statement.cs (CloneContext): Introduce class to provide block
38         remapping during clone.
39
40         All statements Clone themselves now.
41
42         (Clone): special handling for blocks, when we clone a block, we
43         register the block inside this routine, as children of the block
44         might trigger a lookup. 
45         
46         * expression.cs: Add support for CloneContext in all expressions. 
47         
48 2007-02-17  Marek Safar  <marek.safar@gmail.com>
49  
50         A fix for bug #80493
51         * statement.cs: Report ambiguous warning when interfaces are not related.
52
53 2007-02-15  Marek Safar  <marek.safar@gmail.com>
54
55         C# 3.0 extension methods.
56
57         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
58         cannot be used directly.
59
60         * class.cs (Class.Emit): Emit extension attribute if any class method
61         is extension method.
62         (Method.Define): Add basic extension method validation conditions.
63         (Method.Emit): Emit extension attribute for method.
64
65         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
66         extension method exists. Currently we follow same approach as Microsoft
67         does, emit even if a method or a class are private but this can change
68         later.
69
70         * cs-parser.jay: Add handling of `this' keyword in method parameters
71         context.
72
73         * decl.cs (DeclSpace.IsStaticClass): New property.
74         (MemberCache.FindExtensionMethods): Looks for extension methods with
75         defined name and extension type.
76
77         * doc.cs: Updated after OverloadResolve changes.
78
79         * driver.cs: Add new soft reference to System.Core.dll.
80
81         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
82         (ExtensionMethodGroupExpr): Represents group of extension methods.
83
84         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
85         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
86         to MethodGroupExpr and made non-static for easier customization.
87         (Invocation.DoResolve): Add extension method lookup when no standard
88         method was found.
89         (MemberAccess.DoResolve): Try extension methods if no member exists.
90
91         * modifiers.cs: Add METHOD_EXTENSION modifier.
92
93         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
94         as well as candidate extension type.
95         (ComputeNamespaces): When assembly constains extension methods registers
96         them.
97         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
98         extension method lookup.
99         (Namespace.LookupExtensionMethod): Looks for extension method in this
100         namespace.
101         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
102         find a method which matches name and extensionType.
103
104         * parameter.cs (Parameter): Add This modifer.
105         (HasExtensionMethodModifier): New property.
106         (Resolve): Add extension parameter check.
107         (ModFlags): turned to property to exclude this modifier as it is not real
108         parameter modifier.
109         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
110
111         * support.cs (ParameterData): Add ExtensionMethodType.
112         (ReflectionParameters): Implemented ExtensionMethodType interface property.
113
114         * typemanager.cs: Add type and ctor extension attribute type.
115
116 2007-02-15  Miguel de Icaza  <miguel@novell.com>
117
118         * report.cs (DisableErrors, EnableErrors): used to prevent error
119         output when we are "trying" to compile various methods with
120         different types. 
121
122         * ecore.cs (Expression): Add Clone method that calls the virtual
123         CloneTo method.  The current CloneTo method in Expression throws
124         an exception so we can track down all the places where this must
125         be implemented (not using abstract, because that would be a lot of
126         up-front-work before we can start testing the implementation
127         idea). 
128
129         Important: we only need Clone capabilities for expressions created
130         by the parser, as the expressions we will be cloning are
131         expressions in the pre-resolved state.   This vastly simplifies
132         the work required. 
133         
134         (SimpleName): Add CloneTo that does nothing.
135         (EmptyCast): Add CloneTo.
136         
137         * expression.cs (Binary): Implement CloneTo.
138         (Invocation.IsApplicable): Store the current ec in
139         EmitContext.TempEc and restore it on return.  This is used so we
140         do not have to sprinkle hundres of methods with an extra
141         EmitContext, we know that the only user is the lambda expression
142         ImplicitConversionExists code. 
143         
144         (Argument): Add Cloning capabilities.
145         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
146         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
147         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
148         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
149         IndexerAccess): Add Clone capability.
150
151         (LocalVariableReference, This): TODO: needs cloned Block mapping.
152
153         (Argument): Add cloning capability.
154
155         * assign.cs (Assign): Implement CloneTo.
156
157         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
158         
159         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
160         version by calling Convert with the EmitContext (that we are
161         currently storing in ec, this is not great, but will do for now,
162         to avoid passing EmitContext parameters to hundreds of functions
163         that do not need them now).
164
165         (SetExpression): Remove, it is not needed.
166         
167         (ContextualReturn): Implement CloneTo.
168
169         * statement.cs (Statement): Implement cloning infrastructure,
170         similar to expressions.
171
172         (Block): Partial implementation of Clone for statements.
173
174         (Return): Implement clone.
175         
176         * constant.cs (Constant.CloneTo): New method, does nothing.
177
178         * codegen.cs (TempEc): Add a static EmitContext as a temporary
179         solution, until we decide how to exactly do this.  
180         
181 2007-02-14  Marek Safar  <marek.safar@gmail.com>
182  
183         A fix for bug #80493
184         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
185         a property is override we need to use second accessor.
186
187 2007-02-13  Marek Safar  <marek.safar@gmail.com>
188  
189         A fix for bug #80418
190         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
191         methods.
192
193 2007-02-13  Marek Safar  <marek.safar@gmail.com>
194
195         Another fix for bug #80749
196         * pending.cs: Abstract class has priority over interfaces.
197
198 2007-02-13  Marek Safar  <marek.safar@gmail.com>
199
200         Another fix for bug #80749
201         * pending.cs: Abstract class has priority over interfaces.
202
203 2007-02-13  Marek Safar  <marek.safar@gmail.com>
204
205         Another fix for bug #80749
206         * pending.cs: Abstract class has priority over interfaces.
207
208 2007-02-13  Marek Safar  <marek.safar@gmail.com>
209
210         Another fix for bug #80749
211         * pending.cs: Abstract class has priority over interfaces.
212
213 2007-02-13  Marek Safar  <marek.safar@gmail.com>
214
215         * class.cs Better error message.
216
217         * driver.cs: Add shorter versions of -optimize option.
218
219 2007-02-13  Martin Baulig  <martin@ximian.com>
220
221         * class.cs (Constructor.Emit): Check the return value of
222         ec.ResolveTopBlock() and return on error.
223
224 2007-02-13  Raja R Harinath  <rharinath@novell.com>
225
226         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
227         message to fix error message regression.
228
229 2007-02-12  Marek Safar  <marek.safar@gmail.com>
230
231         * delegate.cs: Delegate creation expression cannot be of Nullable type.
232
233 2007-02-12  Marek Safar  <marek.safar@gmail.com>
234
235         A fix for bug #80749
236         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
237         its parent container.
238
239         * class.cs (DefineFieldInitializers): Each initializer can has different
240         resolve context.
241
242         * const.cs: Updated.
243
244 2007-02-11  Miguel de Icaza  <miguel@novell.com>
245
246         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
247         now all the heavy lifting to check that embedded statements or
248         expressions have the right form is done in the ContextualReturn.
249
250         (ContextualReturn): New class.  
251
252         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
253         method that can be invoked to report 201, so we do not replicate
254         this everywhere.
255
256         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
257         
258         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
259         treating tabs as spaces. 
260
261 2007-02-09  Marek Safar  <marek.safar@gmail.com>
262
263         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
264         * assign.cs: Use full implicit conversion for right side check.
265
266 2007-02-09  Marek Safar  <marek.safar@gmail.com>
267
268         * statement.cs (Switch): Switch over boolean type is not standardized.
269
270 2007-02-08  Marek Safar  <marek.safar@gmail.com>
271
272         A fix for bug #80755
273         * decl.cs (FindBaseEvent): Don't use method cache for events.
274
275 2007-02-07  Marek Safar  <marek.safar@gmail.com>
276
277         * cs-parser.jay: Better syntax error handling.
278
279         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
280         instead of underlying type value.
281
282 2007-02-06  Marek Safar  <marek.safar@gmail.com>
283
284         * driver.cs: Check define identifier before is registered.
285
286         * namespace.cs: Use existing error message.
287
288         * report.cs: New warning.
289
290 2007-02-06  Marek Safar  <marek.safar@gmail.com>
291
292         A fix for bug #80742
293         * expression.cs: Delegate Invoke method can be called directly.
294
295 2007-02-06  Marek Safar  <marek.safar@gmail.com>
296
297         A fix for bug #80676
298         * class.cs (IsEntryPoint): The Main method can have params modifier.
299
300 2007-02-04  Miguel de Icaza  <miguel@novell.com>
301
302         * parameter.cs (Parameter, Parameters): Add Clone method.
303
304         * anonymous.cs (Compatible): Turn method into virtual method, so
305         LambdaExpression can implement a different behavior.
306
307         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
308         out the basic checking here, so it can be used by
309         LambdaExpressions.
310         
311         * lambda.cs: Introduce "Compatible" function that will do the
312         heavy lifting.
313
314 2007-02-02  Marek Safar  <marek.safar@gmail.com>
315
316         * attribute.cs: Unified one error message.
317
318         * class.cs (Class): Use type attributes and not properties to test static
319         class.
320         (IsEntryPoint): Don's pass local variable.
321
322         * convert.cs: Removed duplicate check.
323
324         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
325
326         * driver.cs: Don't crash when soft reference does not exist.
327
328         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
329         (UsingEntry): Removed redundant allocation.
330
331         * parameter.cs: Add fast path for type parameters.
332
333         * support.cs: Don't allocate attribute when it's not used.
334
335 2007-01-30  Miguel de Icaza  <miguel@novell.com>
336
337         * anonymous.cs
338         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
339         this into a virtual method, so we can override it in LambdaExpression.
340
341         * driver.cs: Improve diagnostics in case of failure. 
342
343         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
344         write a function that is slightly more complex and that parses:
345
346         type identifier [, type identifier]* )
347
348         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
349         this expression:
350
351                 (canEmpty ? i >= 0 : i > 0)
352
353 2007-01-30  Raja R Harinath  <rharinath@novell.com>
354
355         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
356         exception on possibly valid code.
357
358 2007-01-29  Raja R Harinath  <rharinath@novell.com>
359
360         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
361         Push/PopPosition.
362         (parse_opt_type_arguments): Remove.  It's almost the same as
363         parse_less_than.
364         (parse_namespace_or_typename): Use parse_less_than.
365
366 2007-01-28  Miguel de Icaza  <miguel@novell.com>
367
368         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
369         this bug took a few hours to find, because the state saved and
370         restored by PushPosition and PopPosition was ignoring the state of
371         parse_generic_less_than.
372
373         I can also now remove the handling of OP_LT and OP_GT, this solves
374         the big mistery.
375         
376         * cs-tokenizer.cs: store the location for the ARROW token, we use
377         that in the parser.
378
379         (PushPosition, PopPosition): save/restore also `current_token',
380         restore `parse_generic_less_than' (was missing).
381
382         (parse_opt_type_arguments): use parse_type, not
383         parse_namespace_or_typename to parse types.
384
385         * lambda.cs: Empty new file, will eventually have the lambda
386         expression implementation.
387
388         * lambda.test: used to test the internal tokenizer. 
389
390         * report.cs (FeatureIsNotISO1): Rename from
391         FeatureIsNotStandardized, because it was about the language level
392         (1 vs 2) it was not about standarization.
393
394         (FeatureRequiresLINQ): New.
395
396         * support.cs (SeekableStreamReader): Only require that the reader
397         is a TextReader, not a StreamReader, so we can plug StringReader. 
398
399         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
400         given position in the input stream the following tokens can be
401         parsed as a type followed by an identifier.
402
403         (is_punct): after a '(' if parse_type_and_parameter returns true,
404         then return a special token OPEN_PARENS_LAMBDA which is used to
405         avoid reduce/reduce errors in the grammar for the
406         lambda_expression rules.
407
408         (parse_type): implement a type parser inside the
409         tokenizer, the parser only returns true or false depending on
410         whether the input at a given position can be parsed as a type.
411
412         (peek_token): new method used during type parsing.
413
414 2007-01-28  Raja R Harinath  <rharinath@novell.com>
415
416         Fix #80531
417         * anonymous.cs (ScopeInfo.InflateParameters): New.
418         (AnonymousContainer.Resolve): Use it to redirect types of
419         delegate parameters.
420
421 2007-01-27  Raja R Harinath  <rharinath@novell.com>
422
423         Fix #80530
424         * expression.cs (Error_InvalidArguments): Don't use two different
425         messages for CS1503.  Use ExtraInformation and
426         SymbolRelatedToPreviousError instead.
427
428         Fix #80358
429         * decl.cs (DeclSpace.initialize_type_params): Don't access
430         'type_params' of a partial class directly.
431
432 2007-01-26  Miguel de Icaza  <miguel@novell.com>
433
434         * constant.cs: Removed a handful of out-of-range checks that were
435         not necessary. 
436
437 2007-01-25  Marek Safar  <marek.safar@gmail.com>
438
439         * expression.cs (CheckUselessComparison): Add additional check for char
440         constants.
441
442         * namespace.cs: Fixed typo.
443
444 2007-01-23  Miguel de Icaza  <miguel@novell.com>
445
446         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
447         gone, instead we inline the test, preventing the needless casts to
448         longs, ulongs and doubles for the parameters, avoiding calls to
449         methods that overchecked stuff, and instead inlined things
450         nicely. 
451
452 2007-01-20  Marek Safar  <marek.safar@gmail.com>
453
454         * cs-parser.jay: Better parameter error handling.
455
456 2007-01-17  Marek Safar  <marek.safar@gmail.com>
457
458         A fix for bug #80368, #80522
459         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
460         whether array initializer contains constants only.
461         (ArrayCreation.Emit): Use better formula to decide when
462         are array initializers for static initialization.
463         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
464         have to emit even constants otherwise they are pre-initialized.
465
466 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
467             Raja R Harinath  <rharinath@novell.com>
468
469         Fix emit order of 'get' vs. 'set'.
470         * support.cs (Accessors): New.
471         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
472         Note the order in which accessors are declared in the source.
473         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
474         Refactored from Property.Define and Indexer.Define.
475         (PropertyBase.DefineAccessors): New helper that calls the above in
476         appropriate order as noted by the parser.
477         (Property.Define, Indexer.Define): Update to changes.
478         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
479
480 2007-01-17  Raja R Harinath  <rharinath@novell.com>
481
482         Fix cs0029-6.cs and gcs0029-2.cs (regression)
483         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
484         there's an implicit conversion from the current type to the target
485         type before converting the underlying constant.
486
487 2007-01-16  Marek Safar  <marek.safar@gmail.com>
488
489         * const.cs (ResolveValue): Updated after constant conversion was made more
490         generic.
491
492         * constant.cs (GetAttributableValue): constant to object conversion is
493         used for attributes only.
494         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
495         constant conversions.
496         (LongConstant.ConvertImplicitly): Ditto.
497
498         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
499         (ImplicitConversionStandard): Handle constant conversion as extra step.
500         It solves the issue when constant conversion was called indirectly like
501         inside array initializer and constant folding was skipped.
502
503         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
504         this change.
505
506         * statement.cs(ImplicitConversionStandard): Updated after constant
507         conversion was made more generic.
508
509 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
510
511         * expression.cs (As.DoResolve): Use GenericConstraints instead of
512         Constraints, solves the problem where the compiler incorrectly
513         reported that a type parameter was not constrained to a class (Bug
514         80518)
515
516 2007-01-14  Marek Habersack  <grendello@gmail.com>
517
518         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
519
520 2007-01-14  Marek Safar  <marek.safar@gmail.com>
521
522         A fix for bug #80368
523         * assign.cs (FieldInitializer): New class implements field
524         initializer statement.
525
526         * attribute.cs: Update after FieldMember rename.
527
528         * class.cs (PropertyBasedMember): New common class for property based
529         types.
530         (InterfaceMemberBase): New base class for all members which can be used as
531         an interface members.
532         (MethodCore): Moved really common code to InterfaceMemberBase.
533         (Method.Define): Equal and GetHasCode detection is relevant for methods
534         only.
535         (MethodData.Define): Don't assume that public event implements an
536         interface automatically.
537         (MethodData.DefineMethodBuilder): Issue an error even if only extern
538         modifier is used.
539         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
540         (FieldMember): Merged with FieldBase.
541         (EventProperty.AEventPropertyAccessor): New specialization to check whether
542         event extern modifier can be used.
543         (EventField.EventFieldAccessor): Moved event field specific code here.
544         (Event.AllowedModifiers): Even event can be extern.
545         (Event.FindOutBaseMethod): New override specific to events.
546         (Indexer.parameters): Reintroduce parameters because base class holds
547         only properties common data.
548         (Indexer.CheckForDuplications): Indexers are threated as methods so we
549         need do extra parameters check.
550
551         * const.cs: Update after FieldMember rename.
552
553         * decl.cs (MemberCache.FindBaseEvent): New method.
554
555         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
556         to reflect that indexer is now derived from PropertyBased.
557
558         * ecore.cs (GetMemberType): Made public.
559         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
560         obsolete event.
561
562         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
563         
564         * typemanager.cs (CSharpSignature): Correctly print event accessors.
565         (RegisterEvent): Removed.
566         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
567         (GetPrivateFieldOfEvent): Renamed to GetEventField.
568
569 2007-01-11  Raja R Harinath  <rharinath@novell.com>
570
571         Fix #80249
572         * statement.cs (CollectionForeach.TryType): Prefer generic
573         GetEnumerator over non-generic variant.  Fix code to follow comments.
574
575 2007-01-09  Raja R Harinath  <rharinath@novell.com>
576
577         Fix #80446
578         * support.cs (ReflectionParameter): Don't use an invalid index on
579         the generic parameter data.
580
581 2007-01-08  Miguel de Icaza  <miguel@novell.com>
582
583         * driver.cs: Just add a tiny bit of infrastructure.
584
585 2007-01-02  Marek Safar  <marek.safar@gmail.com>
586
587         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
588         where field type is struct from current assembly.
589         
590         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
591         it is possible.
592
593 2007-01-02  Marek Safar  <marek.safar@gmail.com>
594
595         A fix for bug #80381
596         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
597         the core types.
598
599         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
600         messages.
601         (Namespace.LookupType): Always use core types from corlib when speficied.
602
603         * report.cs: A new warning.
604
605         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
606         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
607         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
608
609         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
610         (InitCoreTypes): Set expression type of object_type and value_type
611         immediately after lookup.
612
613 2007-01-01  Miguel de Icaza  <miguel@novell.com>
614
615         * cs-tokenizer.cs: Accept Pc class characters (Connector
616         Punctuation) as valid identifiers.  Fixes #78259
617
618         * expression.cs (Invocation.DoResolve): Moved the check for the
619         use of `this' for doing method calls to the Invocation resolution
620         step, after overload resolution has taken place instead of doing
621         the check at the low-level `This.DoResolve' level.
622
623         The `This.DoResolve' happens before overload resolution, so it has
624         no way of knowing if the method that will be called will be
625         instace or static, triggering an erroneous report for cs0188 (Bug
626         78113).
627
628         We now do the check for instance method invocations after we know
629         what method will be called.
630
631         (This.CheckThisUsage): Move the actual use of this structure
632         checking into its own method and expose it. 
633
634         * Everywhere that called Error_ValueCannotBeConverted: pass a new
635         EmitContext.
636
637         Exceptions: Null.ConvertImplicitly,
638         Constant.ImplicitConversionRequired as there are too many call
639         sites for passing the ec. 
640
641         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
642         EmitContext, if the value is null, then we do not try to provide
643         the extra information from the error (If a userdefined conversion
644         exists, as UserDefinedConversion requires a non null-EmitContext).
645
646         Fixes: #80347
647
648 2006-12-30  Raja R Harinath  <rharinath@novell.com>
649
650         * flowanalysis.cs (MyBitVector): Document some invariants.
651         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
652         introduced below, and add a couple of others, 
653
654 2006-12-30  Marek Safar  <marek.safar@gmail.com>
655
656         * attribute.cs (GetMethodObsoleteAttribute): Uses new
657         GetPropertyFromAccessor and GetEventFromAccessor.
658         
659         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
660         overrides non-obsolete one.
661         (Indexer.Define): Error message has been moved to the parser.
662
663         * cs-parser.jay: Better syntax errors handling.
664
665         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
666         when an invocation has no arguments.
667
668         * ecore.cs: Removed not used caching.
669
670         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
671         implementation.
672
673         * report.cs: Add a new warning.
674
675         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
676
677         * typemanager.cs (enumeration_type): Removed.
678         (CSharpSignature): Reuses IsSpecialMethod.
679         (IsEqual): Hack for MS BCL.
680         (GetPropertyFromAccessor): New method.
681         (GetEventFromAccessor): New method.
682         (IsSpecialMethod): Fixed to handle more cases.
683
684 2006-12-30  Marek Safar  <marek.safar@gmail.com>
685
686         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
687         Made white spaces array static.
688
689         * ecore.cs (RemoveGenericArity): Optimized.
690
691         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
692         10 times faster).
693         (MyBitVector.initialize_vector): Simplified.
694
695 2006-12-22  Miguel de Icaza  <miguel@novell.com>
696
697         * ecore.cs: Am not entirely happy with this hack, but it seems to
698         address the issue in 80257 (a small test case for
699         CreativeDocs.NET). 
700
701         I set the MethodGroupExpr.Type to an internal compiler type
702         (itself in this case) to force the resolution to take place.   Why
703         it does not take place with a null is beyond me.
704
705 2006-12-20  Marek Safar  <marek.safar@gmail.com>
706
707         A fix for bug #80288
708         * expression.cs (ResolveOperator): Consider user defined conversion for
709         logical and operator too.
710         (EmitBranchable): Optimization for logical and when full constant folding
711         could not be applied but one operand is constant.
712
713 2006-12-19  Marek Safar  <marek.safar@gmail.com>
714
715         * class.cs (GetClassBases): Write 5 times every day, will never use
716         FullName for error reporting.
717
718         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
719
720 2006-12-19  Martin Baulig  <martin@ximian.com>
721
722         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
723         the symbol file info here.
724
725 2006-12-18  Marek Safar  <marek.safar@gmail.com>
726
727         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
728         of `elseif' is taking then following sections are not taking.
729         Fixes an issue reported on mono mailing list.
730
731 2006-12-18  Marek Safar  <marek.safar@gmail.com>
732
733         A fix for bug #80300
734         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
735         a caller is not taking.
736
737 2006-12-18  Raja R Harinath  <rharinath@novell.com>
738
739         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
740         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
741         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
742         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
743         * class.cs: Update to changes.
744
745 2006-12-17  Marek Safar  <marek.safar@gmail.com>
746
747         A fix for bug #79934
748         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
749         partial container.
750
751         * class.cs (ResolveMembers): Register an iterator in current container and
752         not in shared one.
753
754 2006-12-16  Raja R Harinath  <rharinath@novell.com>
755
756         Fix test-543.cs
757         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
758         satisfy a params annotated parameter.
759
760 2006-12-16  Marek Safar  <marek.safar@gmail.com>
761
762         A fix for bug #77014
763         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
764         paramters correctly and not rely on hacks in Parameters class.
765         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
766         at any possition.
767         (Invocation.VerifyArgumentsCompat): Ditto.
768         (Invocation.EmitArguments): Changed to correctly emit params arguments at
769         any possition.
770
771         * parameter.cs (HasParams): Don't assume that params is the last one.
772
773         * support.cs (ReflectionParameters.ctor): Look for params attribute
774         correctly.
775         (ReflectionParameters.ParameterType): Removed hack when we returned last
776         parameter for out of range parameters.
777         (ParameterName, ParameterModifier): Ditto.
778
779 2006-12-14  Marek Safar  <marek.safar@gmail.com>
780
781         A fix for bug #79987
782         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
783         when assembly is not CLS compliant but type is. I have no idea why is this
784         allowed.
785
786         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
787
788 2006-12-13  Miguel de Icaza  <miguel@novell.com>
789
790         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
791         in struct constructors, they are basically no-ops.
792
793 2006-12-12  Marek Safar  <marek.safar@gmail.com>
794
795         * cs-tokenizer.cs (Position): Save preprocessor status too.
796
797 2006-12-12  Marek Safar  <marek.safar@gmail.com>
798
799         A fix for bug #77794
800         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
801
802 2006-12-12  Marek Safar  <marek.safar@gmail.com>
803
804         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
805         Fixes #69299.
806         (pp_expr): Report error for an invalid expression.
807         (handle_preprocessing_directive): Simplified; add more error checking.
808
809 2006-12-11  Marek Safar  <marek.safar@gmail.com>
810
811         A fix for bug #74939
812         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
813         directives handling.
814
815 2006-12-10  Marek Safar  <marek.safar@gmail.com>
816
817         A fix for bugs #80093, and #75984
818         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
819         logic, it seems to me as it worked before "by coincidence".
820         (xtoken): Simplified to use reworked handle_preprocessing_directive.
821         (cleanup): Enabled endif check.
822
823 2006-12-09  Marek Safar  <marek.safar@gmail.com>
824
825         A fix for bug #80162
826         * statement.cs (CollectionForeach.TryType): Generics and non-generics
827         enumerators are never ambiguous.
828
829 2006-12-08  Raja R Harinath  <rharinath@novell.com>
830
831         Fix #80060
832         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
833
834 2006-12-06  Marek Safar  <marek.safar@gmail.com>
835
836         A fix for bug #80144
837         * class.cs (EventProperty.Define): Explicit implementation means
838         that an even is used.
839
840 2006-12-06  Marek Safar  <marek.safar@gmail.com>
841
842         Fixes the operators implementation (part II)
843
844         * cfold.cs (DoConstantNumericPromotions): Renamed to
845         DoBinaryNumericPromotions and simplified.
846         (BinaryFold): Couple of conversion fixes; simplified.
847
848         * constant.cs, ecore.cs, literal.cs
849         (ToType): Renamed to ConvertImplicitly.
850         (Reduce): Renamed to ConvertExplicitly.
851
852         * class.cs, convert.cs: Updated.
853
854         * expression.cs: TryReduce doesn't throw an exception.
855
856 2006-12-01  Marek Safar  <marek.safar@gmail.com>
857
858         A fix for bug #80108
859         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
860         compatible.
861
862 2006-11-30  Marek Safar  <marek.safar@gmail.com>
863
864         Fixes unary operators implementation (part I)
865         Also fixes #80026
866
867         * cfold.cs (Error_CompileTimeOverflow): Made internal
868
869         * const.cs (IConstant): Changed to use reference to constant and
870         not constant itself.
871         Updated IConstant implementations.
872
873         * constant.cs (CreateConstant): New factory method.
874         Updated IConstant implementation.
875
876         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
877
878         * ecore.cs: Updated to use CreateConstantReference.
879
880         * enum.cs: Reflects IConstant changes.
881
882         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
883
884         * literal.cs (NullConstant): Change to be independently usable.
885
886 2006-11-29  Martin Baulig  <martin@ximian.com>
887
888         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
889         we need to emit the scope initializer before calling the base .ctor.
890
891         * anonymous.cs: Merged back from the new anonymous methods branch.
892         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
893
894         * expression.cs (ParameterReference.DoResolveBase): Create a
895         "normal" ScopeInfo when capturing parameters rather than using the
896         root scope; this makes things work with anonymous methods having
897         parameters.
898
899         * statement.cs
900         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
901
902 2006-11-22  Marek Safar  <marek.safar@gmail.com>
903
904         A fix for bug #79987
905         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
906         check to a base class.
907         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
908         only when assembly has missing attribute.
909         * report.cs: Update.
910
911 2006-11-21  Marek Safar  <marek.safar@gmail.com>
912
913         * cs-tokenizer.cs: Merged with gmcs version.
914
915 2006-11-20  Marek Safar  <marek.safar@gmail.com>
916
917         * cs-tokenizer.cs,
918         * cs-parser.jay: Better error message when partial keyword is misplaced.
919
920 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
921
922         A fix for bug #79810
923         report.cs: CS1058 only applies to 2.0 profile (gmcs).
924         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
925         a RuntimeWrappedException by default.
926
927 2006-11-18  Marek Safar  <marek.safar@gmail.com>
928
929         A fix for bug #79843
930         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
931         implementation.
932         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
933
934 2006-11-18  Marek Safar  <marek.safar@gmail.com>
935
936         * driver.cs, namespace.cs: Uses faster IndexOf version.
937
938 2006-11-17  Marek Safar  <marek.safar@gmail.com>
939
940         A fix for bug #79941
941         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
942         operators.
943         (Operator.Define): Implicit/Explicit operator of same type is duplicate
944         even if internal name is different.
945         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
946         (UserDefinedConversion): Simplified as the operators cannot be internal.
947         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
948         conversions.
949         (MethodLookup): Replaced EmitContext with parentType.
950         * expression.cs: Updated.
951
952 2006-11-09  Raja R Harinath  <rharinath@novell.com>
953
954         * driver.cs (BadAssembly): Handle all the ugliness of
955         DefineDynamicAssembly.
956
957 2006-11-08  Raja R Harinath  <rharinath@novell.com>
958
959         Address parts of #58244 -- most of what's left is in the runtime
960         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
961         CS1509 error checks, and handle them for all assembly loads, not
962         just the first invocation.
963         (LoadModule): Likewise.  Move handling of 'adder_method' ...
964         * codegen.cs (AssemblyClass.AddModule): ... here.
965
966 2006-11-02  Marek Safar  <marek.safar@gmail.com>
967
968         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
969         IEnumerable<T> is ambiguous.
970
971 2006-10-31  Marek Safar  <marek.safar@gmail.com>
972
973         A fix for bug #67689
974         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
975         GetEnumerator is ambiguous.
976
977         * report.cs: Add new warning.
978
979 2006-10-29  Marek Safar  <marek.safar@gmail.com>
980
981         A fix for bug #78602
982         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
983         to protected member can be nested type.
984
985 2006-10-28  Marek Safar  <marek.safar@gmail.com>
986
987         A fix for bug #78965
988         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
989         to protected member must derive from current type.
990
991 2006-10-27  Marek Safar  <marek.safar@gmail.com>
992
993         assign.cs: Reuses error method.
994
995         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
996         instead of type for constants.
997         (Expression.Error_ValueAssignment): Common error method.
998
999         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
1000         for any assignment.
1001
1002 2006-10-27  Marek Safar  <marek.safar@gmail.com>
1003
1004         A fix for bug #79081
1005         * expression.cs (MemberAccess.DoResolve): Check nested type
1006         accessibility.
1007
1008 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
1009
1010         * doc.cs : nested delegates were not handled. Fixed bug #79754.
1011
1012 2006-10-26  Marek Safar  <marek.safar@gmail.com>
1013
1014         A fix for bug #76591
1015         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
1016
1017 2006-10-26  Marek Safar  <marek.safar@gmail.com>
1018
1019         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
1020         type forwarder of the same type multiple times.
1021
1022 2006-10-26  Raja R Harinath  <rharinath@novell.com>
1023
1024         Fix #78820
1025         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
1026         instance as an rvalue, even when we later resolve as an lvalue.
1027
1028 2006-10-25  Martin Baulig  <martin@ximian.com>
1029
1030         * anonymous.cs: Fix #79673.
1031
1032 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
1033
1034         A fix for bug #79666
1035         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
1036         ignored when is optimized (= default value) as its value is already set.
1037
1038 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
1039
1040         A fix for bug #79724
1041         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
1042         TypeContainer for type lookup.
1043
1044 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
1045
1046         A fix for bug #79231
1047         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
1048         * expression.cs (OverloadResolve): Always convert type name for
1049         an error message.
1050         (ResolveNamespaceOrType): Don't confuse a nested type with any 
1051         other member.
1052
1053 2006-10-18  Martin Baulig <martin@ximian.com>
1054
1055         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
1056
1057 2006-10-17  Miguel de Icaza  <miguel@novell.com>
1058
1059         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
1060         an int32, but requesting an int64 from the conversion
1061
1062 2006-10-12  Martin Baulig  <martin@ximian.com>
1063
1064         * anonymous.cs
1065         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
1066         
1067 2006-10-12  Martin Baulig  <martin@ximian.com>
1068
1069         * statement.cs
1070         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
1071
1072 2006-10-11  Miguel de Icaza  <miguel@novell.com>
1073
1074         * convert.cs: Remove broken code: I was doing the "Existance"
1075         tests for Implicit conversions.
1076
1077 2006-10-10  Miguel de Icaza  <miguel@novell.com>
1078
1079         * convert.cs: Added one missing case in
1080         ImplicitStandardConversionExists uint64 to intptr.
1081
1082         Fixes #59800
1083         
1084         * typemanager.cs (uintptr_type): another core known type.   
1085
1086         * ecore.cs (OperatorCast): routine used to do cast operations that
1087         depend on op_Explicit.  We could change some of the Decimal
1088         conversions to use this.
1089
1090         This one has a probe mechanism that checks both types for an op_
1091         which it coudl be used to eliminate two classes: CastToDecimal
1092         and CastFromDecimal.
1093
1094         * convert.cs: Implement the conversions documented in #59800
1095         
1096 2006-10-10  Martin Baulig  <martin@ximian.com>
1097
1098         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
1099         before RootScope.ResolveMembers().
1100
1101         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
1102         `CurrentType' if appropriate.
1103
1104 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
1105
1106         A fix for bug #78568
1107         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
1108         when contains binary operators.
1109         * cs-parser.jay: Updated.
1110
1111 2006-10-09  Martin Baulig  <martin@ximian.com>
1112
1113         * delegate.cs
1114         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
1115         moved that into Define() and also do the other type parameter
1116         checks there.  Fixes #79094.  Added gtest-292.cs.
1117
1118         * expression.cs
1119         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
1120         since that doesn't include type parameters; don't use `Ldelema'
1121         for type parameters.  Fixes #78980.  Added gtest-293.cs.
1122
1123 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
1124
1125         A fix for #77796
1126         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
1127         conversion is allowed.
1128
1129 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
1130
1131         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
1132         error reporting when no error occurs.
1133
1134 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
1135
1136         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
1137         does not exist.
1138
1139 2006-10-06  Raja R Harinath  <rharinath@novell.com>
1140
1141         Fix #79584
1142         * class.cs (DefineTypeBuilder): Check circular dependencies before
1143         setting the parent of the TypeBuilder.
1144         (CheckRecursiveDefinition): Don't use 'BaseType', since
1145         it may not be valid until after DefineTypeBuilder.  Use
1146         'base_type' instead.
1147
1148 2006-10-04  Martin Baulig  <martin@ximian.com>
1149
1150         Merged the Anonymous Methods patch.
1151
1152         * anonymous.cs, iterators.cs: The new anonymous methods code.
1153
1154         * statement.cs (Variable): New public abstract class.
1155         (LocalInfo.Variable): New public property.
1156         (LocalInfo.ResolveVariable): New public method.
1157         (Block.Flags): Add `IsIterator'.
1158         (Block.AddVariable): Improved the CS0136 check.
1159         (Block.AnonymousChildren): New public property.
1160         (Block.AddAnonymousChild): New public method.
1161         (ToplevelBlock): Update to use the new anonymous method framework.
1162         (ToplevelBlock.ctor): `container' is now a `Block' and not a
1163         `ToplevelBlock'; this is required to correctly implement the
1164         CS0136 check.
1165         (Fixed, Using): Use `TemporaryVariable' instead of directly
1166         creating the `LocalBuilder'.
1167
1168         * parameter.cs (Parameter.ResolveVariable): New public method.
1169         (Parameters.ResolveVariable): Likewise.
1170
1171         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
1172
1173         * class.cs (TypeContainer): Replaced the `iterators' list and
1174         corresponding methods with a list of `CompilerGeneratedClass'es.
1175         (TypeContainer.ResolveMembers): New public method.
1176         (Method): `IIteratorContainer' has been replaced by
1177         `IAnonymousHost'.
1178
1179         * expression.cs (VariableReference): New public abstract base
1180         class for `LocalVariableReference', `ParameterReference' and
1181         `This'.
1182
1183         * codegen.cs (EmitContext): Removed `capture_context',
1184         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
1185         (EmitContext.EmitThis): Removed.
1186
1187         * cs-parser.jay: Replace `iterator_container' with
1188         `anonymous_host'.       
1189
1190 2006-10-04  Martin Baulig  <martin@ximian.com>
1191
1192         * generic.cs (GenericMethod): Don't make this abstract.
1193         (Constraints.Clone): Added dummy implementation.
1194
1195 2006-10-04  Raja R Harinath  <harinath@gmail.com>
1196
1197         Fix #79577
1198         * namespace.cs (LookForAnyGenericType): Avoid nullref on
1199         'declspaces'.  Avoid allocating arrays willy-nilly.
1200
1201         Fix #79553
1202         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
1203         cases out of the switch.
1204
1205 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
1206
1207         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
1208         message when non-generic type is used with the type arguments.
1209         * expression.cs: Updated.
1210
1211 2006-09-28  Raja R Harinath  <rharinath@novell.com>
1212
1213         Fix #79013
1214         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
1215         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1216         Change semantics slightly.  Don't insist on having only one
1217         temporary EmptyExpression -- just throttle the creation of new ones.
1218
1219         Fix #79451
1220         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
1221         non-interfaces too.  If no methods are found, don't try to create
1222         a MethodGroupExpr.
1223
1224 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
1225
1226         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
1227         generic type.
1228
1229         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
1230         us produce better error message.
1231
1232 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
1233
1234         * expression.cs (Binary.ResolveOperator): Warn about a side effect
1235         of the `|' operator.
1236
1237         * report.cs: A new warning added.
1238
1239 2006-09-27  Martin Baulig  <martin@ximian.com>
1240
1241         * generic.cs (GenericMethod): Don't make this abstract.
1242
1243 2006-09-27  Martin Baulig  <martin@ximian.com>
1244
1245         * report.cs
1246         (InternalErrorException): Added overloaded ctor taking a params array.
1247
1248 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
1249
1250         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
1251         Fixed the cases when same error was reported twice.
1252
1253         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
1254         now report symbol information.
1255
1256 2006-09-25  Martin Baulig  <martin@ximian.com>
1257
1258         * class.cs: Completely unified with the gmcs version.
1259
1260 2006-09-25  Martin Baulig  <martin@ximian.com>
1261
1262         * typemanager.cs (TypeManager.IsNullableType): New public function.
1263         (TypeManager.IsNullableTypeOf): Likewise.
1264         (TypeManager.IsNullableValueType): Likewise.
1265
1266         * class.cs (MethodCore): Added the `GenericMethod' argument from
1267         gmcs and also unified all classes derived from `MethodCore' with gmcs.
1268
1269 2006-09-24  Raja R Harinath  <harinath@gmail.com>
1270
1271         * convert.cs: Unify with gmcs version.
1272
1273 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
1274
1275         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
1276         verify them as well.
1277
1278         * report.cs: New warning.
1279
1280 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
1281
1282         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
1283         for anonymous block with out argument.
1284
1285 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
1286
1287         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
1288         not used private events only.
1289
1290 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
1291
1292         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
1293
1294         * const.cs (Const.Define): Check for constant type.
1295         (Const.IsConstantTypeValid): Looks for valid constant types.
1296
1297         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
1298
1299         * ecore.cs (EmptyConstantCast): New common class for all constant based
1300         EmptyCast(s).
1301
1302         * expression.cs (Is.DoResolve): Handle null constant especially.
1303         (New.DoResolve): Check for new void().
1304         (MemberAccess.DoResolve): Cope with all kind of nulls.
1305
1306         * literal.cs (NullConstant): Uses EmptyConstantCast.
1307         (NullDefault): Based on EmptyConstantCast.
1308         (NullLiteral): Uses EmptyConstantCast.
1309
1310         * statement.cs (Block.ResolveMeta): Check for constant type.
1311
1312 2006-09-22  Martin Baulig  <martin@ximian.com>
1313
1314         * delegate.cs, attribute.cs: Merged with the gmcs versions.
1315
1316 2006-09-22  Raja R Harinath  <rharinath@novell.com>
1317
1318         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
1319         not the null type.
1320
1321         Fix part of #79451
1322         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
1323         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
1324         code slightly.
1325
1326 2006-09-22  Martin Baulig  <martin@ximian.com>
1327
1328         * ecore.cs: Merged with the gmcs version.
1329
1330         * generic.cs (ConstructedType): New dummy class.
1331         (TypeArguments): Don't make this abstract.
1332
1333         * typemanager.cs
1334         (TypeManager.IsGenericTypeDefinition): New method.
1335         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
1336
1337 2006-09-22  Raja R Harinath  <rharinath@novell.com>
1338
1339         * expression.cs (ComposedCast): Check for arrays of TypedReference
1340         before creating the type, not after.
1341
1342 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
1343
1344         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
1345         after ToType change.
1346
1347         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
1348         when constant must be implicitly convertible.
1349
1350         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
1351
1352         * ecore.cs (NullCast): Derives from NullConstant.
1353
1354         * expression.cs (Is.DoResolve): Removed useless variables.
1355         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
1356         (New.Constantify): Add enum support.
1357         (MemberAccess.DoResolve): Add warning when accessing null constant or
1358         variable.
1359
1360         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
1361         property.
1362
1363         * literal.cs (NullConstant): New abstract class with common
1364         functionality for all null specializations.
1365         (NullDefault): Represents default(X) when result can be
1366         reduced to null.
1367         (NullLiteral): Updated.
1368
1369         * report.cs: Add new warning.
1370
1371 2006-09-21  Martin Baulig  <martin@ximian.com>
1372
1373         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
1374
1375 2006-09-21  Martin Baulig  <martin@ximian.com>
1376
1377         * generic.cs (GenericConstraints): New dummy class.
1378         (Constraints): Likewise.
1379         (TypeParameter): Likewise.
1380         (TypeParameterName): Likewise.
1381         (GenericMethod): Likewise.
1382
1383         * typemanager.cs (TypeManager.GetGenericArguments): New method.
1384
1385         * decl.cs: Merged with the gmcs version.
1386
1387 2006-09-21  Raja R Harinath  <rharinath@novell.com>
1388
1389         * generic.cs (TypeParameter): Implement IMemberContainer.
1390         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
1391
1392         * rootcontext.cs: Unify with gmcs version.
1393
1394         * report.cs: Unify with gmcs version.
1395         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
1396         from gmcs/generics.cs.
1397         * generics.cs (TypeParameter): New dummy class.
1398
1399         * support.cs: Unify with gmcs version.
1400
1401 2006-09-20  Raja R Harinath  <rharinath@novell.com>
1402
1403         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
1404         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
1405
1406         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
1407         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
1408         * mcs.exe.sources: Add generic.cs.
1409
1410         * codegen.cs: Unify with gmcs version.
1411
1412         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
1413         (EmitContext): Add GenericDeclContainer implementation.
1414         * decl.cs (MemberCore, DeclSpace): Likewise.
1415         * namespace.cs: Remove #ifdef GMCS_SOURCE.
1416
1417         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
1418         MCS TypeManager has a corresponding dummy method.
1419
1420 2006-09-19  Martin Baulig  <martin@ximian.com>
1421
1422         * expression.cs: Completely merged with the gmcs version.
1423
1424 2006-09-19  Martin Baulig  <martin@ximian.com>
1425
1426         * expression.cs (Invocation): Merged with the gmcs version.
1427         (ArrayAccess.GetStoreOpcode): Likewise.
1428
1429 2006-09-19  Martin Baulig  <martin@ximian.com>
1430
1431         * typemanager.cs
1432         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
1433         (TypeManager.IsGenericMethodDefinition): Likewise.
1434
1435 2006-09-19  Martin Baulig  <martin@ximian.com>
1436
1437         * typemanager.cs
1438         (TypeManager.IsEqual): Moved the gmcs implementation here.
1439         (TypeManager.DropGenericTypeArguments): Likewise.
1440         (TypeManager.DropGenericMethodArguments): Likewise.
1441         (TypeManager.GetTypeArguments): Moved here from gmcs.
1442         (TypeManager.HasGenericArguments): Likewise.
1443
1444 2006-09-19  Martin Baulig  <martin@ximian.com>
1445
1446         * expression.cs (Binary): Merged with the gmcs version.
1447
1448 2006-09-19  Martin Baulig  <martin@ximian.com>
1449
1450         * expression.cs (Probe, As, Is): Merged with the gmcs version.
1451
1452 2006-09-19  Martin Baulig  <martin@ximian.com>
1453
1454         * typemanager.cs: Merged with the gmcs version.
1455
1456 2006-09-16  Raja R Harinath  <rharinath@novell.com>
1457
1458         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
1459         * driver.cs: Likewise.
1460
1461 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
1462
1463         A fix for #79401
1464         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
1465         only if parent type is class.
1466         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
1467         update.
1468
1469 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
1470
1471         * cs-parser.jay,
1472         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
1473         keywords are used.
1474         * typemanager.cs(CSharpName): Converts NullType to null.
1475
1476 2006-09-15  Martin Baulig  <martin@ximian.com>
1477
1478         * typemanager.cs
1479         (TypeManager.GetMethodName): Added mcs implementation.
1480         (TypeManager.IsEqual): Likewise.
1481
1482         * ecore.cs
1483         (SimpleName.RemoveGenericArity): Added dummy implementation.
1484
1485         * pending.cs: Merged with the gmcs version.     
1486
1487 2006-09-15  Martin Baulig  <martin@ximian.com>
1488
1489         * statement.cs: Merge with the gmcs version.
1490
1491 2006-09-15  Martin Baulig  <martin@ximian.com>
1492
1493         * statement.cs (Switch): Merge with the gmcs implementation
1494         (without nullables), which is newer.
1495
1496 2006-09-15  Martin Baulig  <martin@ximian.com>
1497
1498         * statement.cs (Block.Variables): Make this public.
1499         (ToplevelBlock.Parameters): Make this a property.
1500         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
1501
1502 2006-09-15  Martin Baulig  <martin@ximian.com>
1503
1504         * namespace.cs: Merge with the gmcs version.
1505
1506 2006-09-15  Martin Baulig  <martin@ximian.com>
1507
1508         * decl.cs (MemberName): Minor code cleanups.
1509
1510 2006-09-15  Martin Baulig  <martin@ximian.com>
1511
1512         * parameter.cs: Merge with the gmcs version.
1513
1514 2006-09-15  Martin Baulig  <martin@ximian.com>
1515
1516         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
1517         and an error in mcs.
1518
1519 2006-09-15  Martin Baulig  <martin@ximian.com>
1520
1521         * flowanalysis.cs: Merged from GMCS; added the generics code into
1522         a `GMCS_SOURCE' conditional so we can share this file.
1523
1524 2006-09-08  Martin Baulig  <martin@ximian.com>
1525
1526         * typemanager.cs (TypeManager.interlocked_type): New public field.
1527         (TypeManager.int_interlocked_compare-exchange): New public field.
1528         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
1529         enumerator types here and call InitGenericCoreTypes().
1530         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
1531         after calling InitEnumUnderlyingTypes().
1532
1533         * rootcontext.cs
1534         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
1535         `classes_second_stage'. 
1536
1537 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
1538
1539         * assign.cs, ecore.cs, expression.cs: Share error message text.
1540         * class.cs (FieldMember.Define): Check for varible of static type.
1541         * driver.cs (LoadAssembly): Uses error output for errors.
1542         * statement.cs: Updated.
1543
1544 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
1545
1546         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
1547         type instance.
1548
1549 2006-09-07  Martin Baulig  <martin@ximian.com>
1550
1551         * driver.cs
1552         (MainDriver): Revert r62663 from Marek; see #70506 for details.
1553
1554 2006-08-29  Miguel de Icaza  <miguel@novell.com>
1555
1556         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
1557         
1558 2006-08-17  Miguel de Icaza  <miguel@novell.com>
1559
1560         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
1561         #52019 and #79064, the use of the \uXXXX sequence in source code
1562         to represent unicode characters.
1563
1564 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
1565
1566         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
1567         support.
1568         * class.cs, ecore.cs, statement.cs: Merged to one error message.
1569
1570 2006-08-13  Miguel de Icaza  <miguel@novell.com>
1571
1572         * assign.cs: Catch attempts to assign to a method groups in += and
1573         report as 1656
1574
1575 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
1576
1577         A fix for #79056
1578         * cs-parser.jay: Don't destroy current array type by typeof of array's.
1579
1580 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
1581
1582         * class.cs (Method.Define): Issue a warning when generic method looks like
1583         an entry point.
1584         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
1585         as well.
1586
1587 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
1588  
1589         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
1590         looking for ctor.
1591         * decl.cs (MemberCache.FindMembers): When container is interface we need to
1592         search all base interfaces as a member can be ambiguous.
1593         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
1594         Constructor member type filter. 
1595         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
1596         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
1597         reporting for returned memberinfos.
1598         * report.cs: Updated.
1599         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
1600         version to work on all runtimes.
1601         (TypeManager.RealMemberLookup): Removed members filtering.
1602
1603 2006-08-08  Raja R Harinath  <rharinath@novell.com>
1604
1605         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
1606         (PropertyExpr.EmitAssign): Likewise.
1607         * expression.cs (Indirection.EmitAssign): Likewise.
1608         (LocalVariableReference.EmitAssign): Likewise.
1609         (ParameterReference.EmitAssign): Likewise.
1610         (Invocation.EmitArguments): Likewise.
1611         (ArrayAccess.EmitAssign): Likewise.
1612         (IndexerAccess.EmitAssign): Likewise.
1613         (This.EmitAssign): Likewise.
1614         (ConditionalLogicalOperator.Emit): Likewise.
1615
1616         Fix #79026
1617         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
1618         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
1619         leave it in after returning it.
1620         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
1621
1622 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
1623
1624         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
1625         message.
1626
1627 2006-08-03  Raja R Harinath  <rharinath@novell.com>
1628
1629         Fix cs0146-3.cs and cs0146-4.cs.
1630         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
1631         enclosing types don't depend on the current type.
1632
1633 2006-08-02  Raja R Harinath  <rharinath@novell.com>
1634
1635         Fix #77963
1636         * class.cs (TypeContainer.DoDefineMembers): Use
1637         FindBaseMemberWithSameName on Parent, since we're interested in
1638         whether we hide inherited members or not.
1639         (FindBaseMemberWithSameName): Make slightly more robust.
1640
1641         Fix the non-generic testcase from #77396
1642         * decl.cs (DeclSpace.DeclContainer): Remove override.
1643
1644         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
1645         declspaces for doppelgangers too.
1646         (UsingEntry): Implement IResolveContext.
1647         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
1648         'this' as the resolve context.
1649         (LocalAliasEntry): Likewise.
1650
1651         Implement parts of #77403
1652         * roottypes.cs (RootDeclSpace): New.  Used to represent the
1653         toplevel declaration space.  Each namespace declaration introduces
1654         a "partial" root declaretion space.
1655         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
1656         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
1657         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
1658         from 'current_namespace.SlaveDeclSpace'.
1659         (namespace_declaration): Likewise.
1660         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
1661         check.  It can't happen now.
1662         * decl.cs (DeclSpace.LookupType): Likewise.
1663         * driver.cs (MainDriver): Sanity check.
1664
1665 2006-08-01  Raja R Harinath  <rharinath@novell.com>
1666
1667         * decl.cs (DeclSpace.FindNestedType): Remove.
1668         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
1669         LookupTypeContainer to get the container of the nested type.
1670         * class.cs (TypeContainer.FindNestedType): Make non-override.
1671
1672 2006-07-31  Raja R Harinath  <rharinath@novell.com>
1673
1674         * decl.cs (DeclSpace.PartialContainer): Move field from ...
1675         * class.cs (TypeContainer.PartialContainer): ... here.
1676         (TypeContainer.AddBasesForPart): New helper.
1677         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
1678         instead.
1679         * cs-parser.jay (current_class): Convert to DeclSpace.
1680         (struct_declaration, interface_declaration, class_declaration):
1681         Use AddBasesForPart instead of .Bases directly.
1682         * const.cs, iterators.cs: Update to changes.
1683
1684 2006-07-28  Raja R Harinath  <rharinath@novell.com>
1685
1686         * class.cs (TypeContainer.AddMemberType): Rename from
1687         AddToTypeContainer.
1688         (TypeContainer.AddMember): Rename from AddToMemberContainer.
1689         (AddTypeContainer): New.  Combine AddClassOrStruct and
1690         AddInterface.
1691         (AddPartial): Update.  Add 'is_partial' argument.
1692         * roottypes.cs: Update to changes.
1693         * cs-parser.jay (push_current_class): New helper for handling
1694         current_container and current_class.
1695         (struct_declaration, interface_declaration, class_declaration):
1696         Use it.
1697
1698 2006-07-26  Raja R Harinath  <rharinath@novell.com>
1699
1700         * roottypes.cs: Rename from tree.cs.
1701
1702         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
1703         * tree.cs (Tree, ITreeDump): Remove types.
1704         * rootcontext.cs (tree, Tree): Remove fields.
1705         (root, ToplevelTypes): New.
1706         * *.cs: Update to rename.
1707
1708         * tree.cs (Tree.RecordDecl): Remove.
1709         (RootTypes.AddToTypeContainer): Record the toplevel type in its
1710         namespace here.
1711         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
1712
1713 2006-07-23  Raja R Harinath  <harinath@gmail.com>
1714
1715         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
1716         DoFlowAnalysis and OmitStructFlowAnalysis here.
1717         (ec.With): Rename from WithUnsafe and generalize.
1718         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
1719         (ec.WithFlowAnalyis): New.
1720         * ecore.cs, expression.cs, statement.cs: Update.
1721
1722 2006-07-22  Raja R Harinath  <harinath@gmail.com>
1723
1724         * statement.cs (Block.ResolveMeta): Simplify slightly.
1725
1726         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
1727         multiple boolean fields.  Convert InUnsafe, constant_check_state,
1728         check_state to flags.
1729         (CheckState, ConstantCheckState): Update.
1730         (InUnsafe): New read-only property.
1731         (FlagsHandle): Rename from CheckStateHandle and convert to handle
1732         arbitrary flags.
1733         (WithUnsafe): New helper similar to WithCheckState.
1734         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
1735         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
1736
1737 2006-07-21  Raja R Harinath  <rharinath@novell.com>
1738
1739         Make comparisons use the same IL irrespective of whether they're
1740         in a 'checked' or 'unchecked' context: one of the issues in #78899
1741         * codegen.cs (EmitContext.CheckState): Make read-only property.
1742         (EmitContext.ConstantCheckState): Likewise.
1743         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
1744         helper that implement a save/restore stack for CheckState
1745         values.  This is the only way to change check-state.
1746         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
1747         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
1748         (CheckedExpr.EmitBranchable): New forwarding method.
1749         (UnCheckedExpr): Likewise.
1750         * statement.cs (Block.ResolveMeta): Use WithCheckState.
1751         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
1752         (Checked.Resolve, checked.DoEmit): Likewise.
1753
1754 2006-07-20  Miguel de Icaza  <miguel@novell.com>
1755
1756         * anonymous.cs: Cache the resolved anonymous delegate, and return
1757         this so that the ResolveTopBlock is only triggered once, not
1758         twice.
1759
1760         Currently we trigger ResolvetopBlock twice due to a first pass of
1761         argument check compatibility, and a second pass that does the
1762         actual resolution.   
1763         
1764 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
1765
1766         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
1767         modifiers.
1768         * rootcontext.cs (Reset): Add helper_classes.
1769
1770 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
1771
1772         A fix for #78860
1773         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
1774         correctly.
1775
1776 2006-07-13  Miguel de Icaza  <miguel@novell.com>
1777
1778         * statement.cs (Lock): Handle expressions of type
1779         TypeManager.null_type specially.  Fixes #78770
1780
1781 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
1782
1783         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
1784         to an event.
1785
1786 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
1787
1788         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
1789         for accessors as well.
1790         * ecore.cs (EventExpr): Add AccessorTable.
1791
1792 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
1793
1794         A fix for #78738
1795         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
1796         for CS0122 where appropriate.
1797         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
1798         level attributes.
1799         (Filter): Assembly can be null in the case of top level attributes.
1800
1801 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
1802
1803         A fix for #78690
1804
1805         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
1806         is done at global level.
1807
1808 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
1809
1810         A fix for #77002, Implemented TypeForwarder support.
1811
1812         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
1813         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
1814         * typemanager.cs (): Add type_forwarder_attr_type.
1815
1816 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
1817
1818         * report.cs: Add CS0469 warning.
1819
1820 2006-06-21  Martin Baulig  <martin@ximian.com>
1821
1822         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
1823         the `try'-block, so we also report CS0016 etc. there.
1824
1825 2006-06-21  Martin Baulig  <martin@ximian.com>
1826
1827         * delegate.cs
1828         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
1829
1830 2006-06-21  Martin Baulig  <martin@ximian.com>
1831
1832         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
1833         also report CS1686 for parameters.
1834
1835 2006-06-21  Martin Baulig  <martin@ximian.com>
1836
1837         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
1838         instead of an error if the value is not implicitly convertible to
1839         the switch types; fixes #77964.
1840
1841 2006-06-21  Raja R Harinath  <rharinath@novell.com>
1842
1843         Fix #78673
1844         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
1845         FieldBuilder is null.
1846
1847         Fix #78662
1848         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
1849         'left' and 'right' before error-checking.
1850
1851 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
1852
1853         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
1854         Fixed bug #78601.
1855         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
1856         (FieldExpr.DoResolve): likewise.
1857         (PropertyExpr.InstanceResolve): likewise.
1858         (EventExpr.InstanceResolve): likewise. 
1859
1860 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
1861
1862         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
1863         attribute applicable tests for attribute argument.
1864
1865 2006-06-02  Raja R Harinath  <rharinath@novell.com>
1866
1867         Fix #78079
1868         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
1869         (Binary.OverloadResolve_PredefinedIntegral): New.
1870         (Binary.OverloadResolve_PredefinedFloating): New.
1871         (Binary.OverloadResolve_PredefinedString): New.
1872         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
1873         Follow the standard more closely, and treat numeric promotions in
1874         terms of overload resolution.
1875         (Binary.CheckShiftArguments): Simplify.
1876
1877 2006-06-01  Raja R Harinath  <rharinath@novell.com>
1878
1879         * flowanalysis.cs (MyBitVector): Simplify representation.
1880         (MyBitVector.Clone): Avoid allocating BitArray.
1881         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
1882         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
1883         (*): Update.  Change all references to MyBitVector.And and
1884         MyBitVector.Or to &= and |=.
1885
1886 2006-05-29  Raja R Harinath  <rharinath@novell.com>
1887
1888         Fix cs0231-[34].cs.
1889         * cs-parser.jay (formal_parameter_list): Extend the pattern below
1890         to param arguments too.
1891
1892 2006-05-26  Miguel de Icaza  <miguel@novell.com>
1893
1894         * cs-parser.jay: Catch another parsing form for arglist being
1895         followed by other arguments.  Fixes #78313.
1896
1897 2006-05-24  Raja R Harinath  <rharinath@novell.com>
1898
1899         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
1900         checking of out parameters to ...
1901         (FlowBranchingToplevel.Merge): ... here.
1902         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
1903         set, propagate the origin upward, and only complain if there was
1904         no other error.
1905         (FlowBranchingException.AddContinueOrigin): Likewise.
1906         (FlowBranchingException.AddReturnOrigin): Likewise.
1907         (FlowBranchingException.AddGotoOrigin): Likewise.       
1908
1909 2006-05-23  Raja R Harinath  <rharinath@novell.com>
1910
1911         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
1912         unreachable, skip it.
1913         (FlowBranchingException.Merge): Always propagate jumps, even if
1914         the finally block renders subsequent code unreachable.
1915
1916 2006-05-18  Raja R Harinath  <rharinath@novell.com>
1917
1918         Fix #77601
1919         * statement.cs (Goto.Resolve): Move responsibility for resolving
1920         'goto' to FlowBranching.AddGotoOrigin.
1921         (Goto.SetResolvedTarget): New.  Callback to set the
1922         LabeledStatement that's the target of the goto.
1923         (Goto.DoEmit): Use Leave instead of Br when crossing an
1924         unwind-protect boundary.
1925         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
1926         LookupLabel and adjust to new semantics.
1927         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
1928         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
1929         Goto.SetResolvedTarget to update target.
1930         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
1931         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
1932         AddBreakOrigin & co.  Delay propagation until ...
1933         (FlowBranchingException.Merge): ... this.
1934
1935         * statement.cs (Block.Resolve): Always depend on flow-branching to
1936         determine unreachability.  Kill workaround that originally emitted
1937         only one statement after an "unreachable" label (see infloop in
1938         test-515.cs).
1939
1940         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
1941         This is still "wrong", but anything better would probably need a
1942         multi-pass algorithm.
1943         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
1944         usage vector.  Force current usage vector to be reachable, to
1945         optimistically signify backward jumps.
1946         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
1947         detected.
1948         (FlowBranchingLabeled.Merge): New.  If no backward jump was
1949         detected, return the original salted-away usage vector instead,
1950         updated with appropriate changes.  Print unreachable warning if
1951         necessary.
1952         * statement.cs (Block.Resolve): Don't print unreachable warning on
1953         a labeled statement.
1954
1955 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
1956
1957         * driver.cs: Pass filename without path to AssemblyBuilder's 
1958         AddResourceFile. Fixes bug #78407.
1959
1960 2006-05-17  Raja R Harinath  <rharinath@novell.com>
1961
1962         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
1963         * flowanalysis.cs (FlowBranchingLabeled): ... here.
1964         (FlowBranching.MergeChild): Overwrite
1965         reachability information from Labeled branchings too.
1966
1967 2006-05-16  Raja R Harinath  <rharinath@novell.com>
1968
1969         * statement.cs (Goto.Resolve): Merge jump origins here ...
1970         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
1971
1972         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
1973         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
1974         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
1975         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
1976         here, ...
1977         * statement.cs (Goto.Resolve): ... not here.
1978         (Goto.Emit): Remove CS1632 check.
1979
1980 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
1981
1982         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
1983         error message.
1984
1985 2006-05-11  Raja R Harinath  <rharinath@novell.com>
1986
1987         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
1988         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
1989         (FlowBranchingException.Label): Likewise.
1990
1991         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
1992         given value.
1993         (MyBitVector.Or): Use it to avoid losing information (Count).
1994         (FlowBranching.MergeOrigins): Likewise.
1995
1996         * flowanalysis.cs (UsageVector.IsDirty): Remove.
1997         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
1998         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
1999         (UsageVector.ToString): Simplify.
2000         (UsageVector.MergeSiblings): Move here from ...
2001         (FlowBranching.Merge): ... here.
2002         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
2003         not a MyBitVector.
2004
2005 2006-05-10  Raja R Harinath  <rharinath@novell.com>
2006
2007         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
2008         null bitvector is treated as all-true.
2009
2010         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
2011         (MyBitVector): Rationalize invariants.  'vector != null' implies
2012         that we have our own copy of the bitvector.  Otherwise,
2013         'InheritsFrom == null' implies all inherited bits are true.
2014
2015 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
2016
2017         * statement.cs (LocalInfo): Add IsConstant.
2018         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
2019         local variable for constants.
2020
2021 2006-05-09  Raja R Harinath  <rharinath@novell.com>
2022
2023         * flowanalysis.cs (MyBitVector.Empty): New.
2024         (MyBitVector): Don't allow InheritedFrom to be null.
2025         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
2026         (UsageVector, FlowBranching): Update to changes.
2027
2028         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
2029         recursion.  The 'Parent == null' condition isn't sufficient for
2030         anonymous methods.
2031         (FlowBranching.AddBreakOrigin): Likewise.
2032         (FlowBranching.AddContinueOrigin): Likewise.
2033         (FlowBranching.AddReturnOrigin): Likewise.
2034         (FlowBranching.StealFinallyClauses): Likewise.
2035         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
2036         (FlowBranching.CheckOutParameters): Likewise.
2037         (FlowBranchingToplevel): Terminate all the above recursions here.
2038         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
2039         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
2040
2041         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
2042         toplevel block.
2043         (FlowBranchingToplevel): New.  Empty for now.
2044         (FlowBranching.MergeTopBlock): Update.
2045         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
2046         branching for the anonymous delegate.
2047         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
2048
2049         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
2050         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
2051         information at the start of the merge.  Reorganize.
2052
2053 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
2054
2055         * class.cs (MethodData.Define): Method cannot implement interface accessor.
2056
2057 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
2058
2059         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
2060         to newly introduced ctor.
2061
2062         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
2063         message to one place.
2064         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
2065         global namespace.
2066
2067 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
2068
2069         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
2070
2071         * ecore.cs (Expression.ResolveAsConstant): Updated.
2072
2073         * statement.cs (ResolveMeta): Updated.
2074
2075 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
2076
2077         * cs-parser.jay: __arglist cannot be used in initializer.
2078
2079 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
2080
2081         A fix for #77879
2082         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
2083         private types.
2084
2085 2006-05-05  Raja R Harinath  <rharinath@novell.com>
2086
2087         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
2088         (LabeledStatement): Add 'name' parameter.
2089         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
2090         (Block.AddLabel): Update to changes.
2091         * cs-parser.jay (labeled_statement): Likewise.
2092
2093         * flowanalysis.cs (BranchingType.Labeled): New.
2094         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
2095         (FlowBranchingLabeled): New.  Does nothing for now, but will
2096         eventually handle 'goto' flows.
2097         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
2098         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
2099         that's terminated ...
2100         (Block.Resolve): ... here.
2101
2102         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
2103         (UsageVector.MergeFinallyOrigins): Likewise.
2104         (FlowBranching.InTryOrCatch): Likewise.
2105         (FlowBranching.AddFinallyVector): Likewise.
2106         (FlowBranchingException): Update to changes.
2107
2108         Fix #78290
2109         * statement.cs (Return.Resolve): Move error checking to ...
2110         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
2111         (FlowBranchingException): Handle return origins like break and
2112         continue origins.
2113         (FlowBranching.UsageVector.CheckOutParameters): Remove.
2114
2115 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
2116
2117         A fix for #76122
2118         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
2119         filter.
2120
2121 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
2122
2123         A fix for #77543
2124         * class.cs (MethodData.Define): Do public accessor check only when method
2125         implements an interface.
2126
2127 2006-05-04  Raja R Harinath  <rharinath@novell.com>
2128
2129         Remove special handling of 'break'
2130         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
2131         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
2132         (UsageVector.Break): Remove.
2133         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
2134         reachability.
2135         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
2136
2137         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
2138         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
2139
2140 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
2141
2142         A fix for #75726
2143         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
2144         be the interface member.
2145
2146 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
2147
2148         A fix for #60069
2149         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
2150         for emitting small (int) values.
2151
2152 2006-05-03  Raja R Harinath  <rharinath@novell.com>
2153
2154         Fix #59427
2155         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
2156         control-flow passes through the 'finally' after merging-in all the
2157         control-flows from 'try' and the 'catch' clauses.
2158
2159         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
2160         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
2161         always true at the only non-recursive entry point.
2162         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
2163         FlowBranchingBreakable.
2164         (FlowBranchingLoop): Remove.
2165         * statement.cs (Return.DoResolve): Update to changes.
2166
2167         Fix #76471, #76665
2168         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
2169         (FlowBranching.CreateBranching): Handle it: create a
2170         FlowBranchingContinuable.
2171         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
2172         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
2173         except that it handles the 'continue' command.
2174         (FlowBranching.UsageVector.MergeOrigins): Rename from
2175         MergeBreakOrigins.
2176         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
2177         except that it overrides AddContinueOrigin.
2178         (FlowBranchingException): Override AddContinueOrigin, similar to
2179         AddBreakOrigin.
2180         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
2181         Create a new branching around the embedded statement.
2182         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
2183         control flow after the embedded statement.
2184         (Continue.Resolve): Move all error checking to AddContinueOrigin.
2185
2186         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
2187         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
2188         FlowBranchingBreakable.
2189         (FlowBranchingSwitch): Remove.
2190
2191         Fix test-503.cs
2192         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
2193         error reporting to ...
2194         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
2195         Rename from 'AddBreakVector'.  Add new location argument.  Return
2196         a bool indicating whether the 'break' crosses an unwind-protect.
2197         (FlowBranchingException.AddBreakOrigin): Add.
2198         (FlowBranchingException.Merge): Propagate 'break's to surrounding
2199         flowbranching after updating with the effects of the 'finally'
2200         clause.
2201         (FlowBranchingBreakable): New common base class for
2202         FlowBranchingLoop and FlowBranchingSwitch.
2203
2204         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
2205         embedded statement.
2206         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
2207
2208 2006-05-02  Raja R Harinath  <rharinath@novell.com>
2209
2210         * statement.cs (Do.Resolve): If the loop is infinite, set the
2211         barrier.
2212         (While.Resolve, For.Resolve): Set a barrier after the embedded
2213         statement.  There's no direct control flow that goes from the end
2214         of the embedded statement to the end of the loop.
2215         * flowanalysis.cs (FlowBranching.Infinite): Remove.
2216         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
2217         above ensure that the reachability is correctly computed.
2218
2219         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
2220         (UsageVector.MergeBreakOrigins): If the current path is
2221         unreachable, treat it as if all parameters/locals are initialized.
2222         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
2223         infinite loops before merging-in break origins.
2224
2225         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
2226         (Reachability.Reachable): Split part into ...
2227         (Reachability.Unreachable): ... this.  Simplify.
2228         (Reachability.IsUnreachable): Use 'Unreachable' instead.
2229
2230         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
2231         (Reachability.SetThrowsSometimes): Likewise.
2232         (FlowBranchingBlock.MergeTopBlock): Don't compare against
2233         TriState.Always, use corresponding property.
2234         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
2235         (Block.Resolve): Likewise.  Remove some redundant checks.
2236
2237 2006-05-02  Raja R Harinath  <harinath@gmail.com>
2238
2239         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
2240         (Reachability.Meet): Don't bother checking AlwaysThrows --
2241         barrier is always set.
2242         (FlowBranchingBlock.Merge): Likewise.
2243
2244 2006-05-01  Raja R Harinath  <harinath@gmail.com>
2245
2246         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
2247         checks for unreachable.
2248
2249 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
2250
2251         A fix for #77980
2252         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
2253
2254         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
2255         whether field is really assigned.
2256
2257 2006-04-30  Raja R Harinath  <harinath@gmail.com>
2258
2259         * flowanalysis.cs (Reachability): Make 4-argument constructor
2260         private.
2261         (Reachability.Meet): Rename from 'And'.  Remove static variant.
2262         (Reachability.Always): Rename from the highly misleading
2263         'Reachability.Never'.
2264         (FlowBranching.Merge): Update to changes.  Mark an impossible
2265         situation with a 'throw'.
2266         (*): Update to changes.
2267
2268 2006-04-29  Raja R Harinath  <harinath@gmail.com>
2269
2270         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
2271         Remove 'Undefined'.
2272         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
2273         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
2274         (*): Update to changes.
2275         * statement.cs: Update to changes.
2276
2277 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
2278
2279         A fix for #78049
2280         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
2281
2282 2006-04-28  Raja R Harinath  <harinath@gmail.com>
2283
2284         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
2285         dummy UsageVector.
2286
2287         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
2288         argument to two arguments: an usage-vector and a bool.  Move call
2289         to FlowBranching.Merge () ...
2290         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
2291
2292         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
2293         handling of loop and switch reachability to ...
2294         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
2295
2296 2006-04-27  Raja R Harinath  <harinath@gmail.com>
2297
2298         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
2299         handling to FlowBranchingLoop.InLoop.
2300         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
2301
2302 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
2303
2304         A fix for #78115
2305         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
2306         anonymous method is allowed from AnonymousContainer here.
2307
2308         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
2309
2310 2006-04-24  Raja R Harinath  <rharinath@novell.com>
2311
2312         Fix #78156
2313         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
2314
2315 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
2316
2317         A fix for #49011.
2318         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
2319         (DoubleConstant.Reduce): Ditto.
2320
2321 2006-04-23  Raja R Harinath  <rharinath@novell.com>
2322
2323         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
2324         Remove 'lvalue_right_side' argument.  Move parts to ...
2325         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
2326         (LocalVariable.DoResolveLValue): ... these.
2327
2328 2006-04-21  Raja R Harinath  <rharinath@novell.com>
2329
2330         Fix cs1655.cs
2331         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
2332         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
2333         (LocalVariableReference.DoResolveBase): Use it to implement new
2334         CS1655 check.
2335         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
2336         (Argument.Resolve): Simplify.  Move CS1510 check ...
2337         * ecore.cs (Expression.ResolveLValue): ... here.
2338         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
2339         (PropertyExpr.DoResolveLValue): Likewise.
2340         (FieldExpr.Report_AssignToReadonly): Likewise.
2341         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
2342         LValueMemberAccess or LValueMemberOutAccess on instance depending
2343         on it.
2344         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
2345         DoResolve as appropriate.
2346
2347 2006-04-20  Raja R Harinath  <rharinath@novell.com>
2348
2349         Fix #75800
2350         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
2351         implicit conversions on 'out' and 'ref' arguments.
2352
2353         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
2354         improve clarity.  Remove dead code.
2355
2356         Fix #66031
2357         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
2358         (Catch.Resolve): Resolve VarBlock if it exists.
2359
2360 2006-04-19  Miguel de Icaza  <miguel@novell.com>
2361
2362         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
2363         twice, this was some residual code, the enumerator was emitted
2364         properly in the two branche of if later.
2365
2366 2006-04-19  Raja R Harinath  <rharinath@novell.com>
2367
2368         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
2369         cast is never an lvalue.
2370         (Cast.DoResolve, Cast.ResolveRest): Combine.
2371         (Argument.Emit): Simplify slightly.  Move 'Expr is
2372         IMemoryLocation' check ...
2373         (Argument.Resolve): ... here.
2374         (Argument.Error_LValueRequired): Remove.  Inline into only user.
2375
2376         Simplifications.  Fix cs0191-2.cs
2377         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
2378         CS1649 and CS1651 to ...
2379         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
2380         the actual selection of the error code and message to a lookup
2381         table.  Add a dummy return value to simplify callsites.
2382         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
2383         readonly fields of other instances of the same type.  Move CS0197
2384         warning from ...
2385         * expression.cs (Argument.Resolve): ... here.  Simplify code.
2386         Ensure that ec.InRefOutArgumentResolving is only set during LValue
2387         resolution of an out or ref argument.  The code simplification
2388         above uses this invariant.
2389
2390 2006-04-18  Raja R Harinath  <rharinath@novell.com>
2391
2392         Possibly fix #77752.  Fix cs1690-[4-7].cs.
2393         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
2394         CheckMarshallByRefAccess.  Drop parameter.
2395         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
2396         warning.
2397         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
2398         InstanceExpression.
2399         * report.cs (AllWarnings): Add CS1690.
2400         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
2401         for ref access too.
2402         (LocalVariableReference.DoResolveBase): Update.
2403
2404 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
2405
2406         * class.cs (MethodOrOperator): Moved common parts from method class.
2407         detect obsolete attributes.
2408         (Method.Define): Simplified as it reuses code from base.
2409         (Constructor.ValidAttributeTargets): Fixed issue found during
2410         refactoring.
2411         (Destructor.ValidAttributeTargets): Fixed issue found during
2412         refactoring.
2413         (Operator): Finished refactoring set off by #78020. Operator class is now
2414         ordinary method class.
2415
2416         * anonymous.cs: Updated.
2417
2418         * decl.cs (DeclSpace): Add IsGeneric
2419
2420 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
2421
2422         * class.cs (Constructor.Emit): Don't emit the attributes twice.
2423
2424 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
2425
2426         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
2427         detect obsolete attributes.
2428         (Method.CreateEmitContext): Moved to MethodOrOperator.
2429
2430 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
2431
2432         A fix for #78048.
2433         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
2434         customized exception to make crash detection easier.
2435         (MethodOrOperator): Started to work on new base class for methods and
2436         operators.
2437         (Method): Derives from MethodOrOperator.
2438         (Constructor.Emit): Emits its own attributes.
2439         (AbstractPropertyEventMethod.Emit): Ditto.
2440         (Operator): Derives from MethodOrOperator, will refactor fully in extra
2441         patch.
2442         (Operator.Emit): It's temporary more tricky than should be.
2443         
2444         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
2445
2446         * report.cs (InternalErrorException): Add ctor with inner exception.
2447
2448 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
2449
2450         A fix for #76744.
2451         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
2452         only not visible.
2453
2454 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
2455
2456         A fix for #77916.
2457         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
2458         array.
2459
2460 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
2461
2462         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
2463         attribute is present and Guid not.
2464         (Interface.ApplyAttributeBuilder): Ditto.
2465
2466         * attribute.cs: Add error message.
2467
2468 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
2469
2470         A fix for #78020.
2471
2472         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
2473         sources (it's composite) so hold them in extra array as they are used in
2474         Emit phase only. It worked in the previous versions by mistake.
2475         (Attribute.Emit): Emit attribute for more owners when exist.
2476
2477         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
2478         it has now different behaviour.
2479
2480 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
2481
2482         * constant.cs (Constant.IsDefaultInitializer): New method.
2483
2484         * class.cs: Updated.
2485
2486         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
2487         re-initialize default values. It saves KBs almost for every assembly.
2488         Thanks Zoltan for the idea.
2489         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
2490         (ArrayCreation.DoResolve): Resolve only once.
2491         (ArrayCreation.Emit): Emit static initializer only when it is faster.
2492         (ArrayCreation.GetAttributableValue): Cope with optimized values.
2493
2494 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
2495
2496         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
2497         From #77961.
2498
2499 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
2500
2501         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
2502         in an embedded statement too.
2503
2504 2006-04-01  Raja R Harinath  <rharinath@novell.com>
2505
2506         Fix #77958
2507         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
2508
2509 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
2510
2511         A fix for #77966.
2512
2513         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
2514         was not specified.
2515
2516         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
2517
2518 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
2519
2520         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
2521         phase.
2522
2523         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
2524         LocalTemporary change.
2525
2526         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
2527         TypeContainer.
2528         (ClassOrStruct.DefineFieldInitializers): Implemented static field
2529         initializers optimization.
2530         (ClassOrStruct.TypeAttr): Moved from modifiers.
2531         (Constructor.CheckBase): Don't crash when static ctor has parameters.
2532         (FieldBase.ResolveInitializer): Resolves initializer.
2533         (FieldBase.HasDefaultInitializer): New property.
2534
2535         * cs-parser.jay: Removed message.
2536
2537         * expression.cs (CompilerGeneratedThis): New specialization.
2538
2539         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
2540
2541 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
2542
2543         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
2544
2545 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
2546
2547         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
2548         be now EnumConstants only.
2549
2550 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
2551
2552         * attribute.cs, driver.cs: Reset more caches.
2553
2554 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
2555
2556         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
2557
2558 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
2559
2560         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
2561         for easier reuse. Updated all overrides.
2562         (IntegralConstant): New base class for all integral constants.
2563         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
2564         of the constant range, report custom error.
2565         (UIntConstant.Reduce): Fixed uint conversion.
2566
2567         * ecore.cs, literal.cs: Reduce updates.
2568
2569 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
2570
2571         A fix for #75813.
2572
2573         * class.cs (Constructor.Define): Removed extra if for default ctors.
2574         A patch from Atsushi Enomoto.
2575
2576 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
2577
2578         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
2579         GetAttributableValue.
2580
2581         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
2582         when required.
2583
2584         * convert.cs (ImplicitConversionRequired): Error message moved to
2585         DoubleLiteral.
2586
2587         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
2588         automatic implicit conversion of an output value.
2589         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
2590
2591         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
2592         conversion.
2593         (TypeOf.GetAttributableValue): Add extra handling for object type.
2594
2595         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
2596         special error message.
2597
2598 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
2599
2600         * class.cs (Constructor.Emit): Don't crash when struct ctor is
2601         InternalCall.
2602         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
2603         compatible with MS runtime.
2604
2605 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
2606
2607         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
2608         attribute arguments here.
2609
2610         * class.cs (Indexer.Define): The check was moved to attribute class.
2611
2612 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
2613
2614         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
2615         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
2616         easier.
2617
2618 2006-03-22  Raja R Harinath  <rharinath@novell.com>
2619
2620         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
2621         mcs to keep code differences small.
2622         * attribute.cs (Attribute.GetParameterDefaultValue): New.
2623         * typemanager.cs (parameter_default_value_attribute_type): New.
2624         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
2625         CS1908 check.
2626
2627 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
2628
2629         * expression.cs (StringConcat.Append): Reverted back to no warning state.
2630
2631 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
2632
2633         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
2634
2635         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
2636         the blocks too.
2637
2638 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
2639
2640         * doc-bootstrap.cs : fix build.
2641
2642 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
2643
2644         * expression.cs (StringConcat.Append): Issue a warning when empty string
2645         is going to append.
2646
2647 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
2648
2649         * assign.cs (CompoundAssign.ResolveSource): Removed.
2650
2651         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
2652         clean up.
2653
2654         * class.cs (TypeContainer.FindMethods): Removed.
2655         (TypeContainer.CheckMemberUsage): Made static.
2656
2657         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
2658
2659         * constant.cs (CheckRange): Removed unused type argument.
2660         (CheckUnsigned): Removed unused type argument.
2661
2662         * cs-parser.jay: Updated after MemberAccess clean up.
2663         Uses Length for empty string test.
2664
2665         * cs-tokenizer.cs: Uses Length for empty string test.
2666         (IsCastToken): Made static.
2667         (is_hex): Made static.
2668         (real_type_suffix): Made static.
2669
2670         * decl.cs (SetupCache): Made static.
2671         (OnGenerateDocComment): Removed unused ds argument.
2672
2673         * delegate.cs (VerifyDelegate): Removed unused argument.
2674
2675         * doc.cs: Uses Length for empty string test.
2676
2677         * driver.cs: Uses Length for empty string test.
2678
2679         * enum.cs (IsValidEnumType): Made static
2680
2681         * expression.cs (EnumLiftUp): Removed unused argument.
2682         (ResolveMethodGroup): Ditto.
2683         (BetterConversion): Ditto.
2684         (GetVarargsTypes): Ditto.
2685         (UpdateIndices): Ditto.
2686         (ValidateInitializers): Ditto.
2687         (MemberAccess.ctor): Ditto.
2688         (GetIndexersForType): Ditto.
2689
2690         * flowanalysis.cs: (MergeFinally): Removed unused argument.
2691
2692         * iterators.cs: Updated after MemberAccess clean up.
2693
2694         * location.cs: Uses Length for empty string test.
2695
2696         * namespace.cs: Uses Length for empty string test.
2697
2698          * report.cs (CheckWarningCode): Made static.
2699
2700         * statement.cs (LabeledStatement): Removed unused argument.
2701
2702         * typemanager.cs (FilterNone): Removed.
2703
2704 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
2705
2706         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
2707         obsolete.
2708
2709         * class.cs: Updated.
2710
2711 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
2712
2713         * cs-parser.jay.cs: __arglist is not allowed for delegates.
2714
2715 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
2716
2717         A fix for #77822.
2718
2719         * expression.cs (VerifyArgumentsCompat): Reverted to double error
2720         reporting, it's more tricky than I thought.
2721
2722 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
2723
2724         A fix for #77816.
2725
2726         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
2727         host container.
2728         (AnonymousMethod.ImplicitStandardConversionExists): New method.
2729         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
2730         Add more error reporting; Fixed issue with params.
2731
2732         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
2733
2734         * cs-parser.jay: AnonymousMethod requires host container.
2735
2736         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
2737
2738 2006-03-18  Raja R Harinath  <harinath@gmail.com>
2739
2740         * class.cs: Change 'TypeContainer ds' constructor argument to
2741         'DeclSpace parent'.  Some classes were missed below due to
2742         different naming convention.
2743
2744         * class.cs (MemberCore.Parent): Delete.  This makes the
2745         ParentContainer changes below enforceable by the compiler.
2746
2747         Treat pointers to enclosing declaration space as 'DeclSpace', not
2748         'TypeContainer'.
2749         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
2750         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
2751
2752         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
2753         of TypeContainer.
2754         (Block.AddThisVariable): Likewise.
2755         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
2756         (AbstractPropertyEventMethod.Emit): Likewise.
2757         (AbstractPropertyEventMethod.EmitMethod): Likewise.
2758         (GetMethod.Define, SetMethod.Define): Likewise.
2759         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
2760         (DelegateMethod.EmitMethod): Likewise.
2761
2762         Fix regression test-partial-13.cs.
2763         Rationalize use of PartialContainer.  Ensure that the partial
2764         class semantics can be tied to type-correctness, i.e., any
2765         violation will cause a compile error.
2766         * class.cs, const.cs: Access all fields that belong to class
2767         TypeContainer via ParentContainer.  Arguments of EmitContexts and
2768         Resolve()-like functions still use 'Parent'.
2769
2770         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
2771         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
2772         (PropertyMethod.CheckModifiers): Remove unused argument.
2773         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
2774         DeclSpace.
2775
2776 2006-03-17  Raja R Harinath  <harinath@gmail.com>
2777
2778         Make semantics of PartialContainer simpler.
2779         * decl.cs (DeclSpace.IsPartial): Remove.
2780         * class.cs (TypeContainer.IsPartial): Likewise.
2781         (TypeContainer..ctor): Set PartialContainer to point to self.
2782         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
2783         (TypeContainer.FindNestedType): Likewise.
2784         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
2785
2786 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
2787
2788         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
2789
2790 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
2791
2792         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
2793         classes.
2794
2795 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
2796
2797         * class.cs (Operator.Define): An error for base conversion was not
2798         reported correctly.
2799
2800 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
2801
2802         * iterator.cs : yield break is allowed in try statement which has
2803           catch clauses. Fixed bug #77767.
2804
2805 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
2806
2807         A fix for #77593, #77574.
2808
2809         * class.cs (MethodCore.CheckBase): Another if for operator.
2810
2811 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
2812
2813         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
2814         were not resolved
2815
2816         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
2817         (DelegateCreation.ImplicitStandardConversionExists): New method for just
2818         conversion test.
2819         
2820         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
2821         not needed.
2822
2823         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
2824         Updated after another emitcontext usage was clean up. It should help us to
2825         synchronize with gmcs easier.
2826
2827 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
2828
2829         A fix for #77353.
2830
2831         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
2832         (Event.Define): ditto
2833         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
2834
2835         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
2836         Removed redundant code and set NewSlot for Invoke method too.
2837
2838         * parameter.cs (Parameters.ctor): Add custom, type ctor.
2839         (Parameters.MergeGenerated): New method. Use this method when you merge
2840         compiler generated argument with user arguments.
2841
2842 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
2843
2844         * attribute.cs (ResolveAsTypeTerminal): Removed.
2845
2846         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
2847         specialization for predefined types; 30% speed up.
2848         Finally placed obsolete check to right place.
2849         (Expression.ResolveType): Removed.
2850
2851         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
2852         Updated after ResolveType was removed.
2853
2854         * expression.cs (Cast.ctor): Check void cast.
2855         (Binary.ResolveAsTypeTerminal): Is never type.
2856         (Conditional.ResolveAsTypeTerminal): Is never type.
2857
2858         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
2859
2860 2006-03-01  Raja R Harinath  <rharinath@novell.com>
2861
2862         Fix #77679.
2863         * expression.cs (ParameterReference.DoResolveBase): Change return
2864         type to bool.
2865         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
2866         Update.
2867
2868         Fix #77628.
2869         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
2870
2871         Fix #77642.
2872         * typemanager.cs (GetFullNameSignature): Don't nullref on
2873         protected accessors.
2874
2875 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
2876
2877         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
2878         these two separated members to simplify the code.
2879         (Attribute.Resolve): Refactored to use new fields and methods.
2880         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
2881         implemented obsolete attribute checking.
2882         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
2883         implemented obsolete checking again. It look line never ending quest ;-)
2884         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
2885
2886         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
2887
2888         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
2889
2890         *class.cs (Property.Define): Add RegisterProperty call.
2891
2892         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
2893         argument groups (only 2).
2894
2895         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
2896         encoding expression to arguments.
2897         (Expression.ExprClassToResolveFlags): Just turned to property.
2898
2899         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
2900         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
2901         optimized as well as implemented support for zero-length attributes.
2902
2903         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
2904         Add caching of PropertyInfo's.
2905
2906 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
2907
2908         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
2909         error multiple times.
2910
2911 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
2912
2913         New partial class implementation.
2914         A fix for #77027, #77029, #77403
2915
2916         * attribute.cs (Attributable): Made attributes protected.
2917
2918         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
2919         the replacements of ClassPart and PartialContainer.
2920         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
2921         (TypeContainer.AddInterface): Ditto.
2922         (TypeContainer.AddPartial): The main method for partial classes. It checks
2923         for errors and merges ModFlags and attributes. At the end class is added to
2924         partial_parts list.
2925         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
2926         required here.
2927         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
2928         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
2929         from the rest of partial classes.
2930         (TypeContainer.GetClassBases): Simplified.
2931         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
2932         DefineType.
2933         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
2934         (TypeContainer.HasExplicitLayout): Uses Flags now.
2935         (PartialContainer): Removed.
2936         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
2937         (StaticClass): Was merged with Class.
2938         (Class.GetClassBases): class and static class bases are verified here.
2939         (Class.TypeAttr): Added static attributes when class is static.
2940         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
2941         (MemberBase): In some cases we need to call parent container for partial
2942         class. It should be eliminated but it's not easy now.
2943
2944         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
2945
2946         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
2947         partial classed to accumulate class comments.
2948         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
2949
2950         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
2951
2952         * driver.cs (MainDriver): Tree.GetDecl was removed.
2953
2954         * modifiers.cs (Modifiers): Add partial modifier.
2955
2956         * tree.cs (Tree.decl): Removed.
2957         (RootTypes): Started to use this class more often for root types
2958         specializations.
2959
2960 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
2961
2962         A fix for #77615
2963
2964         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
2965         external interface does not have an attribute.
2966
2967 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
2968
2969         Another prerequisites for new partial classs implementation.
2970         
2971         * attribute.cs (Attribute.Equal): Implemented.
2972         (Attribute.Emit): Changed as attributes can be applied more than twice.
2973         (Attributes.Emit): Check for duplicate attributes here.
2974
2975         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
2976         as a parameter, clean-up.
2977
2978 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
2979
2980         A fix for #77485
2981
2982         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
2983         contains obsolete attribute check which can in some cases look for base
2984         type of current class which is not initialized yet.
2985         (TypeContainer.BaseType): Replacement of ptype.
2986
2987         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
2988
2989 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
2990
2991         First of prerequisites for new partial classs implemention.
2992         
2993         * attribute.cs (Attributable): Extended by ResolveContext;
2994         Attributes finally have correct context for resolving in all cases.
2995         (AttachTo): Attribute owner is assigned here.
2996
2997         * codegen.cs (IResolveContext): Introduce new interface to hold
2998         all information needed in resolving phase.
2999         (EmitContext): Implements IResolveContext; more clean-up needed here.
3000         
3001         * decl.cs (MemberCore): Implemented IResolveContext.
3002
3003         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
3004         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
3005         parameter.cs, statement.cs, tree.cs, typemanager.cs:
3006         Refactored to use new IResolveContext instead of EmitContext; cleanup
3007
3008 2006-02-06  Miguel de Icaza  <miguel@novell.com>
3009
3010         * codegen.cs (EmitScopeInitFromBlock): check here the
3011         capture_context, there is no need to make two calls to the
3012         EmitContext. 
3013
3014         * anonymous.cs: Add some debugging messages that might help me
3015         track other instances of this problem in the future (the
3016         regression of test 467).
3017
3018         * cs-parser.jay: track the variable block, as we need to initalize
3019         any captured variables declared in this block for the "catch"
3020         portion of the "Try" statement.
3021
3022         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
3023         scope initialization for captured variables. 
3024
3025         Also, move the emit for the variables after the block location has
3026         been marked.
3027
3028 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
3029
3030         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
3031
3032 2006-02-02  Miguel de Icaza  <miguel@novell.com>
3033
3034         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
3035         commit yesterday, the initialization for the roots is necessary.
3036         What is not necessary is the scope activation.
3037
3038 2006-02-02  Raja R Harinath  <rharinath@novell.com>
3039
3040         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
3041         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
3042         CS0206 checks.
3043         (Argument.Resolve): Remove CS0206 checks.
3044
3045 2006-02-01  Miguel de Icaza  <miguel@novell.com>
3046
3047         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
3048         scopes for all the roots, the scopes will now be emitted when the
3049         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
3050
3051         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
3052         code.  This reduces a lot of existing cruft.
3053         
3054         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
3055         that the ScopeInfo is generated as we enter the scope, not at the
3056         time of use, which is what we used to do before.
3057
3058         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
3059         every time a Block is about to be emitted if we have a
3060         CaptureContext. 
3061
3062 2006-02-01  Raja R Harinath  <rharinath@novell.com>
3063
3064         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
3065         (Reset): Update.
3066         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
3067
3068         * typemanager.cs (cons_param_array_attribute): Make private.
3069         (Reset): Set it to null.
3070         (InitCoreHelpers): Don't initialize it.
3071         (ConsParamArrayAttribute): New.  Initialize it as needed.
3072         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
3073
3074 2006-01-31  Miguel de Icaza  <miguel@novell.com>
3075
3076         * expression.cs: There might be errors reported during the
3077         selection of applicable methods.  If there are errors, do not
3078         continue execution as it will lead the compiler to crash.
3079
3080 2006-01-30  Miguel de Icaza  <miguel@novell.com>
3081
3082         * expression.cs: Member access is not allowed on anonymous
3083         methods.  Fixes #77402.
3084
3085 2006-01-30  Raja R Harinath  <rharinath@novell.com>
3086
3087         Fix #77401
3088         * cs-parser.jay (VariableDeclaration): Don't set
3089         current_array_type to null.
3090         (field_declaration, event_declaration, declaration_statement):
3091         Set it to null here.
3092
3093 2006-01-28  Raja R Harinath  <harinath@gmail.com>
3094
3095         * typemanager.cs (GenericParameterPosition): New.
3096         * doc.cs: Use it.
3097
3098 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
3099
3100         * doc.cs : To process "include" elements, first we should create
3101           another list than XmlNodeList, because it could result in node
3102           removal, which could result in that the XmlNodeList gives up
3103           yielding next node.
3104
3105           (Also made code identical to gmcs again.)
3106
3107 2006-01-25  Miguel de Icaza  <miguel@novell.com>
3108
3109         * ecore.cs: Introduce an error report that we were not catching
3110         before, if not silent, we must report the error.  Gonzalo ran into
3111         it.
3112
3113 2006-01-23  Miguel de Icaza  <miguel@novell.com>
3114
3115         A fix for bug: #76957
3116         
3117         * iterators.cs (MoveNextMethod.CreateMethodHost): call
3118         ComputeMethodHost before creating the method, this is a new
3119         requirement. 
3120
3121         * anonymous.cs (AnonymousContainer): Now we track all the scopes
3122         that this method references (RegisterScope).  The actual scope
3123         where the method is hosted is computed with the ComputeMethodHost
3124         before we create the method.
3125
3126         Moved the Deepest routine here.
3127
3128         (AnonymousContainer.ComputeMethodHost): New routine used to
3129         compute the proper ScopeInfo that will host the anonymous method.
3130
3131         (ScopeInfo): Deal with multiple roots.  The problem was that we
3132         did not have a unique root where all ScopeInfos could be hanged
3133         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
3134         of roots.  
3135
3136         Remove AdjustMethodScope which is now computed at the end.  Remove
3137         LinkScope which did a partial link, instead link all ScopeInfos
3138         before code generation from the new "LinkScopes" routine. 
3139
3140         Simplify all the Add* routines as they no longer need to maintain
3141         the tree, they just need to record that they are using variables
3142         from a ScopeInfo.
3143
3144         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
3145         routines to produce the forest of ScopeInfo trees.
3146
3147         * class.cs (TypeContainer.AppendMethod): This is just like
3148         AddMethod, but ensures that an interface implementation method
3149         (IEnumerable.XXX) is not inserted at the beginning of the queue of
3150         methods, but at the end.
3151
3152         We use this functionality to ensure that the generated MoveNext
3153         method in the iterator class is resolved/emitted before the
3154         enumerator methods created.   
3155
3156         This is required because the MoveNext method computes the right
3157         ScopeInfo for the method.  And the other methods will eventually
3158         need to resolve and fetch information computed from the anonymous
3159         method. 
3160
3161 2006-01-21  Raja R Harinath  <harinath@gmail.com>
3162             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
3163
3164         Fix rest of #76995.
3165         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
3166         the 'aliases' hash.
3167         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
3168         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
3169
3170 2006-01-18  Raja R Harinath  <rharinath@novell.com>
3171
3172         Fix #76656, cs0231-2.cs.
3173         * cs-parser.jay (formal_parameter_list): Make error case catch
3174         more issues.
3175         (parenthesized_expression_0): Add CS1026 check.
3176         (invocation_expression): Remove unused { $$ = lexer.Location }.
3177
3178 2006-01-17  Raja R Harinath  <rharinath@novell.com>
3179
3180         Fix #76824.
3181         * cs-parser.jay (statement_expression): Don't list out the
3182         individual statement-expressions.  Convert syntax error into
3183         CS0201 check.
3184
3185 2006-01-16  Raja R Harinath  <rharinath@novell.com>
3186
3187         Fix #76874.
3188         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
3189         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
3190         CheckIntermediateModification.
3191         (FieldExpr.DoResolve): Add new two-argument version that
3192         allows us to resolve the InstanceExpression as an lvalue.
3193         The one-argument variant is now just a wrapper.
3194         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
3195         Resolve the lhs as an lvalue if the it has a value type.
3196         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
3197         from Assign.DoResolve.
3198         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
3199         resolved as an lvalue.
3200         (PropertyExpr.DoResolve): Update.
3201         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
3202         has a value type.  Move CS1612 check here from
3203         CheckIntermediateModification.
3204         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
3205         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
3206         'right_side' of a ResolveLValue on an 'out' argument.
3207         (EmptyExpression.LValueMemberAccess): New.  Used as the
3208         'right_side' of a propagated ResolveLValue on a value type.
3209         (LocalVariableReference.DoResolveBase): Recognize
3210         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
3211         Add CS1654 check.
3212         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
3213         EmptyExpression.Null.
3214
3215 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
3216
3217         * typemanager.cs : added IsGenericParameter(). In mcs it always
3218           return false.
3219         * doc.cs : for generic parameters, use GenericParameterPosition,
3220           not FullName.
3221
3222 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
3223
3224         * expression.cs: Fix Console.WriteLine ((this = x).foo);
3225
3226 2006-01-12  Miguel de Icaza  <miguel@novell.com>
3227
3228         This fixes the problem where we used ldfld instead of ldflda to
3229         load the "THIS" pointer on captured parameters, when THIS is a
3230         value type.  See bug #77205.
3231         
3232         * iterators.cs (CapturedThisReference.Emit): Pass false to
3233         EmitThis (we do not need the address).
3234
3235         * codegen.cs (EmitThis): it needs to know whether we need the
3236         address of `this' or not.  This is used by value types.  
3237
3238         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
3239         every other call passes false.
3240
3241 2006-01-12  Raja R Harinath  <rharinath@novell.com>
3242
3243         Fix #77221.
3244         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
3245         GetOverride.
3246         * expression.cs (Invocation.OverloadResolve): Update.
3247         (Invocation.DoResolve): Avoid double resolution of invocation.
3248
3249 2006-01-11  Raja R Harinath  <rharinath@novell.com>
3250
3251         Fix #77180.
3252         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
3253         unary negation of floating point types as 0-expr; negation cannot
3254         overflow in floating point types.
3255
3256         Fix #77204.
3257         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
3258         on operands of 'void' type.
3259
3260         Fix #77200.
3261         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
3262         and ExclusiveOr for boolean constants too.
3263
3264 2006-01-09  Raja R Harinath  <rharinath@novell.com>
3265
3266         Fix #75636.
3267         * expression.cs (Invocation.OverloadResolve): Replace reflected
3268         override methods with their base virtual methods, rather than
3269         skipping over them.
3270         * typemanager.cs (TypeManager.GetOverride): New.
3271
3272 2006-01-05  Jb Evain  <jbevain@gmail.com>
3273
3274         * class.cs (Property.Define, Indexer.Define): do not tag the
3275         properties as SpecialName | RTSpecialName.
3276
3277 2006-01-04  Miguel de Icaza  <miguel@novell.com>
3278
3279         * class.cs (MethodCore.IsDuplicateImplementation): This method was
3280         doing a low-level comparission of parameter types.  It was lacking
3281         a check for __argslist. 
3282
3283 2005-12-30  Miguel de Icaza  <miguel@novell.com>
3284
3285         * expression.cs (ParameterReference.DoResolveBase): Allow
3286         reference parameters if they are local to this block. 
3287
3288         This allows the ref and out parameters of a delegate to be used in
3289         an anonymous method, for example:
3290
3291         delegate void set (out int x);
3292
3293         set s = delegate (out int x){
3294                 x = 0;
3295         };
3296
3297         This is used by functionality introduced late in the C# language.
3298         
3299         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
3300         method that take ref and out parameters. 
3301
3302         Fixes #77119 which was a late change in the spec.
3303
3304 2005-12-23  Miguel de Icaza  <miguel@novell.com>
3305
3306         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
3307         parent if its the same scope.  Fixes #77060.
3308
3309 2005-12-21  Miguel de Icaza  <miguel@novell.com>
3310
3311         * driver.cs: Report the case of no source files and no -out:
3312         argument provided.
3313
3314 2005-12-20  Raja R Harinath  <rharinath@novell.com>
3315
3316         Fix #77035.
3317         * expression.cs (ComposedCast.GetSignatureForError): Define.
3318
3319 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3320
3321         Fix #76995
3322
3323         * namespace.cs (NamespaceEntry): Add extern_aliases as a
3324         ListDictionary, to contain the ExternAliasEntry entries (in
3325         addition to the NamespaceEntry.aliases hashtable). This field is
3326         shared between the original entry and its doppelganger (bodyless 
3327         copy of it).
3328         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
3329         extern_aliases field.
3330         (NamespaceEntry.Lookup): Move the IsImplicit check after the
3331         lookup in extern_aliases.
3332
3333 2005-12-16  Raja R Harinath  <rharinath@novell.com>
3334
3335         Fix #77006.
3336         * class.cs (TypeContainer.Mark_HasEquals): New.
3337         (TypeContainer.Mark_HasGetHashCode): New.
3338         (ClassPart): Override them.
3339         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
3340
3341         Fix #77008.
3342         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
3343         'parent' argument to the base constructor.
3344
3345         Remove all mention of TypeContainer from decl.cs.
3346         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
3347         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
3348         (DeclSpace.DeclSpace): Likewise.
3349         (DeclSpace.DefineMembers): Remove unused argument.
3350         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
3351         debugging check -- we don't care if the debug code throws an
3352         InvalidCastException instead of an InternalErrorException.
3353         * class.cs (TypeContainer.DefineMembers): Update to changes.
3354         (TypeContainer.DoDefineMembers): Likewise.
3355         (TypeContainer.GetMethods): Likewise.
3356         (PropertyMember.Define): Likewise.
3357         (MemberBase.Parent): New property that forwards to
3358         MemberCore.Parent, but ensures that we get a TypeContainer.
3359         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
3360         (RootContext.PopulateTypes): Likewise.  Remove special case code
3361         for !RootContext.StdLib: DefineMembers is idempotent.
3362
3363 2005-12-14  Miguel de Icaza  <miguel@novell.com>
3364
3365         * convert.cs (ExplicitConversionCore): Check the return value from
3366         ExplicitConversionCore which can return null on failure.  Fixes #76914
3367
3368 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
3369
3370         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
3371
3372 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
3373
3374         * doc.cs : The search for referenced namespace was insufficient to
3375           get global one as it used to do. Fixed bug #76965.
3376
3377 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
3378
3379         * doc.cs : check name in cref in the last phase that whether it is
3380           namespace or not.
3381
3382 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
3383
3384         * cs-tokenizer.cs : reverted the latest change: it somehow broke
3385           Mono.C5.
3386
3387 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
3388
3389         * doc.cs : so it turned out that we cannot skip override check for 
3390           interface members. Fixed bug #76954.
3391
3392 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
3393
3394         * cs-tokenizer.cs : fixed bug #75984:
3395           - #warning and #error should not be handled when the source line
3396             is disabled.
3397           - #line is not checked strictly when the source line is disabled.
3398           - #define and #undef is on the other hand checked strictly at any
3399             state.
3400
3401 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
3402
3403         * cs-tokenizer.cs : missing Location (actually, filename) in one of
3404           CS1027 report.
3405
3406 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
3407
3408         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
3409
3410         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
3411         event initializers.
3412         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
3413         (FieldBase.Initializer): Initializer is now optional.
3414         (EventField.Define): Only event field can have initializer.
3415
3416         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
3417
3418         * const.cs (Const): Reuse initializer.
3419
3420         * cs-parser.jay: Updated after FieldBase changes.
3421         Added current_array_type to simplify array initializers.
3422
3423         * ecore.cs (NullCast.IsDefaultValue): Implemented.
3424
3425         * expression.cs, iterators.cs: Updated.
3426
3427         * namespace.cs (NamespaceEntry): Made UsingFound private.
3428
3429 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
3430
3431         * parameterCollection.cs: Obsolete, removed.
3432         * parser.cs: Obsolete, removed.
3433
3434 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
3435
3436         Fix #76849.
3437         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
3438
3439         * enum.cs (Enum.Define): Set obsolete context here.
3440
3441 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
3442
3443         * doc.cs :
3444           - FindDocumentedMember() now expects 1) paramList as null
3445             when "we don't have to check the number of parameters" and
3446             2) Type.EmptyTypes when "there is no arguments".
3447           - Introduced FoundMember struct to hold the exact type which was
3448             used to find the documented member (the above change broke
3449             test-xml-044; it might be better just to use DeclaringType than
3450             what MS does, like this change does, but it depends on usage.)
3451
3452 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
3453
3454         * doc.cs : documented member might be from DeclaringType for nested
3455           types. Fixed bug #76782.
3456
3457 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
3458
3459         * anonymous.cs: Have the param code handle leaving copies on the
3460         stack etc. Allows anonymous params to take part in the assignment
3461         code (++, +=, etc). Fixes bug #76550
3462
3463         * expression.cs: Handle the prepare_for_load/leave_copy by passing
3464         it down to the anon code.
3465
3466         * iterators.cs: Use dummy var here
3467
3468         * codegen.cs: Handle new vars
3469
3470 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
3471
3472         Fix #76849.
3473         * class.cs (MethodData.Define): Set proper Obsolete context.
3474
3475         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
3476         obsolete context.
3477         (FieldExpr.DoResolve): Ditto.
3478
3479 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
3480
3481         Fix #76849.
3482         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
3483         parent is not obsolete.
3484
3485 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
3486
3487         * doc.cs : (FindDocumentedMember) find parameterless members first
3488           and get CS0419 in the early stage. Fixed first case of bug #76727.
3489
3490 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
3491
3492         Fix #76859.
3493         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
3494         no error was reported.
3495
3496         *expression.cs (Binary.DoResolve): left can be null.
3497
3498 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
3499
3500         Fix #76783.
3501         * class.cs (MethodData.Emit): Parameters should be labeled first.
3502
3503 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
3504
3505         Fix #76761.
3506         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
3507
3508 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
3509
3510         * attribute.cs (AreParametersCompliant): Moved to Parameter.
3511
3512         * class.cs (MethodCore): Parameter clean up.
3513         (IMethodData): Added ParameterInfo.
3514         (MethodData): Parameter clean up.
3515         (Indexer.Define): Parameter clean up.
3516
3517         * anonymous.cs,
3518         * codegen.cs,
3519         * cs-parser.jay,
3520         * decl.cs,
3521         * doc.cs,
3522         * ecore.cs,
3523         * flowanalysis.cs,
3524         * iterators.cs,
3525         * pending.cs,
3526         * statement.cs,
3527         * typemanager.cs: Parameter clean up.
3528
3529         * delegate.cs (Define): Get rid of duplicated code.
3530
3531         * expression.cs (ParameterReference): Removed useless parameters
3532         and simplified.
3533         (Invocation): Ditto.
3534
3535         * parameter.cs (ParamsParameter): New class, params specialization.
3536         (ArglistParameter): Attemp to separate arglist.
3537         (Parameter): Refactored to be reusable and faster.
3538         (Parameter.Modifier): Made understandable.
3539         (Parameters): Changed to be used as a class for `this' assembly
3540         parameters. Refactored to use new specialized classes.
3541
3542         * support.cs (ParameterData): Added Types property.
3543         (InternalParameters): Deleted.
3544
3545 2005-08-20  Martin Baulig  <martin@ximian.com>
3546
3547         Merging this patch from GMCS to fix #75867.
3548
3549         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3550         scope if we don't already have it.
3551
3552 2005-11-17  Martin Baulig  <martin@ximian.com>
3553
3554         * anonymous.cs
3555         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
3556         inherit the scope from our parent.  Fixes #76653.
3557
3558 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
3559
3560         * doc.cs : the previous patch does not actually fix the bug.
3561           PropertyInfo override check is now implemented and really fixed it.
3562         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
3563
3564 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
3565
3566         * doc.cs : apply "override filter" also to properties.
3567           Fixed bug #76730.
3568
3569 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
3570
3571         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
3572           no need to check overrides. For classes, omit those results from 
3573           interfaces since they must exist in the class. Fixed bug #76726.
3574
3575 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
3576
3577         * typemanager.cs : (GetFullNameSignature) differentiate indexers
3578           with different parameters. Fixed the second problem in #76685.
3579
3580 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
3581
3582         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
3583           get expected 'protected' access in CheckValidFamilyAccess()).
3584           Fixed bug #76692.
3585
3586 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
3587
3588         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
3589           Fixed bug #76705.  CS1569 was incorrectly commented out.
3590
3591 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
3592
3593         * doc.cs : use Invocation.IsOverride() to do real override check.
3594         * expression.cs : made Invocation.IsOverride() internal.
3595
3596 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
3597
3598         * doc.cs : use TypeManager.FindMembers() instead of (possible)
3599           TypeBuilder.FindMembers() and filter overriden base members out.
3600           Fixed bug #76990.
3601
3602 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3603
3604         * doc.cs : ref/out parameters are represented as '@' (instead of
3605           '&' in type FullName). Fixed bug #76630 (additionally crefs).
3606
3607 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3608
3609         * doc.cs : when there was no '.' in cref to methods in doc comment,
3610           then parameters were missing in the output. Fixed bug #76691.
3611
3612 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3613
3614         * driver.cs : don't output docs when there is an error.
3615           Fixed bug #76693.
3616
3617 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3618
3619         * doc.cs :
3620           Now it should detect indexers. Fixed primary concern in bug #76685.
3621           Fixed CS0419 message to not show the identical member signature in
3622           the message.
3623
3624 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3625
3626         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
3627           instead of Type.FindMembers() since it does not handle events.
3628           Fixed bug #71604.
3629
3630 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
3631
3632         * codegen.cs: Fixed typo (speficied -> specified).
3633
3634 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
3635
3636         Fix #76369.
3637         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
3638
3639 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
3640
3641         * attribute.cs: Changed error message.
3642
3643         * cs-tokenizer.cs: One more check.
3644
3645 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
3646
3647         * statement.cs (Block.Resolve): Ignore empty statement.
3648
3649 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
3650
3651         * report.cs: Made error/warning methods more strict to avoid
3652         their misuse.
3653
3654         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
3655         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
3656         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
3657         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
3658
3659 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
3660
3661         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
3662         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
3663
3664         * class.cs (TypeContainer.IsComImport): New property.
3665         (Constructor.Define): Create proper ctor for ComImport types.
3666
3667         * expression.cs (New.CheckComImport): Fixed.
3668
3669 2005-11-07  Miguel de Icaza  <miguel@novell.com>
3670
3671         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
3672         that a parameter has been captured does not mean that we do not
3673         have to do the rest of the processing.  This fixes the second part
3674         of #76592.  If there was another anonymous method capturing
3675         values in the past, the Scope would never be set for the second
3676         method that captured the same parameter.
3677
3678         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
3679         properly manipulate the stack.   Second part of fix for #76592.
3680
3681         * expression.cs (New): Add support for invoking "new" on
3682         interfaces that have been flagged with the ComImport attribute and
3683         the CoClass.  Fixes #76637 
3684
3685         * statement.cs (Try.DoEmit): When a variable is captured, do not
3686         try to emit the vi.LocalBuilder variable as it has been captured.
3687         Create a temporary variable and store the results on the
3688         FieldBuilder.  Fixes #76642
3689
3690 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3691
3692         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
3693
3694         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
3695
3696         * expression.cs (Binary.DoResolve): Added && optimalization.
3697     
3698         * typemanager.cs (AddUserType): Removed useless argument.
3699
3700 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
3701
3702         * statement.cs (Block.variables): Uses ListDictionary.
3703
3704 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
3705
3706         Fix #75969.
3707         * class.cs (PartialContainer.EmitType): Customized to emit
3708         security attributes.
3709         (ClassPart.ApplyAttributeBuilder): Transform security attribute
3710         for partial classes.
3711
3712 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
3713
3714         Fix #76599.
3715         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
3716         access has to be fixed.
3717         
3718         * typemanager.cs (IsUnmanagedType): Wrong common field type.
3719
3720 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
3721
3722         Fix #76590.
3723         * ecore.cs (NullCast.Reduce): Implemented.
3724
3725         * expression.cs (ArrayCreation.CheckIndices): Correcly check
3726         constant type.
3727         
3728         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
3729         properly.
3730         (Foreach.Resolve): Catch null properly.
3731
3732 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
3733  
3734         * cs-tokenizer.cs: Warning text fix.
3735
3736         * driver.cs: AllWarningNumbers exposed on public interface.
3737
3738         * report.cs (): Reviewed warning numbers.
3739         (IsValidWarning): Use binary search.
3740
3741 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
3742  
3743         * driver.cs: Implemeted resource visibility.
3744         (Resources): New class for code sharing between /res: and
3745         /linkres:
3746  
3747 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
3748
3749         Fix #76568.
3750         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
3751         folding.
3752         
3753         * convert (Convert.ImplicitReferenceConversion): NullCast holds
3754         contants only.
3755         
3756         * ecore.cs (NullCast): Child is contant only.
3757         
3758         * literal.cs (NullLiteral.Reduce): null can be converted to any
3759         reference type.
3760
3761 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
3762
3763         * driver.cs: Use Encoding.Default as default code page instead
3764           of ISO-28591.
3765
3766 2005-10-27  Raja R Harinath  <rharinath@novell.com>
3767
3768         Fix #76085.
3769         * expression.cs (Invocation.Error_InvalidArguments): Handle
3770         __arglist parameters.
3771         (Invocation.VerifyArgumentsCompat): Likewise.
3772         * support.cs (ReflectionParameters.GetSignatureForError): Print
3773         __arglist parameters.
3774         (InternalParamters.GetSignatureForError): Likewise.
3775         * parameter.cs (Parameters.GetSignatureForError): Likewise.
3776
3777 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
3778
3779         * attribute.cs (GetPropertyValue): Made public.
3780
3781         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
3782         Resolve.
3783         Add new property WrapNonExceptionThrows to handle 2.0 assembly
3784         attribute.
3785         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
3786         is not defined.
3787         
3788         * driver.cs: Reflect method name change.
3789         
3790         * statement.cs (Try.Resolve): Warn when try has both general
3791         exception handlers.
3792         
3793         * typemanager.cs: runtime_compatibility_attr_type new predefined
3794         type.
3795
3796 2005-10-26  Raja R Harinath  <harinath@gmail.com>
3797
3798         Fix #76419.
3799         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
3800         treat it as an empty parameter list.
3801
3802 2005-10-26  Raja R Harinath  <rharinath@novell.com>
3803
3804         Fix #76271.     
3805         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
3806         ResolveAsTypeStep silent.
3807         * statement.cs (Block.AddConstant): Mark block as used.
3808         (Block.ResolveMeta): Avoid piling on error messages
3809         if a constant initializer resolution fails.
3810
3811 2005-10-25  Raja R Harinath  <rharinath@novell.com>
3812
3813         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
3814         Remove.
3815         (NamespaceEntry.VerifyAllUsing): New.
3816         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
3817         behaviour.  Delegates actual resolution of alias to ...
3818         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
3819         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
3820         Update.
3821         * driver.cs (Driver.MainDriver): Update.
3822         
3823         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
3824         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
3825         property.
3826         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
3827         Remove.
3828         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
3829         RootNamespace.DefineNamespacesForAll.
3830
3831 2005-10-24  Raja R Harinath  <harinath@gmail.com>
3832
3833         * typemanager.cs (assemblies, external_aliases, modules)
3834         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
3835         (ComputeNamespaces, GetRootNamespace): Remove extra staging
3836         overhead.  Move resposibility ...
3837         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
3838         * driver.cs, attribute.cs, codegen.cs: Update to changes.
3839
3840 2005-10-23  Raja R Harinath  <harinath@gmail.com>
3841
3842         * namespace.cs (RootNamespace.all_namespaces): Renamed from
3843         cached_namespaces.  Improve usage.
3844         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
3845         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
3846         Move from GlobalRootNamespace and simplify.
3847         (RootNamespace.Global): Make instance variable.
3848         (RootNamespace.RootNamespace): Add "alias name" parameter.
3849         (GlobalRootNamespace): Simplify drastically.
3850         (Namespace.Lookup): Don't use GetNamespace.
3851         * typemanager.cs (GetRootNamespace): Rename from
3852         ComputeNamespaceForAlias.
3853         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
3854
3855 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3856
3857         * anonymous.cs (AnonymousContainer): Don't crash when container
3858         doesn't exist.
3859
3860 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3861
3862         * expression.cs (Binary.DoResolve): Warn when comparing same
3863         values.
3864
3865 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3866
3867         Fix #76486.
3868         * expression.cs (Binary.DoResolve): It looks like there are no
3869         convetsion rules in enum context.
3870
3871 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3872
3873         Add support for extern alias qualifiers.
3874         * typemanager.cs: Move some LookupTypeReflection code
3875         to namespace.cs, to have cleaner code. Added some methods
3876         to help us keep track of the extern aliased references.
3877         * driver.cs: Add suport for extern alias assemblies on command
3878         line and check for their warnings/errors. Also keep track of the
3879         extern aliased assemblies.
3880         * namespace.cs: Move the global functionality of Namespace
3881         to GlobalRootNamespace/RootNamespace. Now the global namespace
3882         is GlobalRootNamespace.Globa. Also the code moved from 
3883         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
3884         Finally added LocalAliasEntry (AliasEntry before) and
3885         ExternAliasEntry, to handle alias statements.
3886         * cs-parser.jay: Add support in the grammar for extern alias
3887         statement.
3888         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
3889         Update callings to Namespace (now in GlobalRootNamespace).
3890
3891 2005-10-18  Raja R Harinath  <rharinath@novell.com>
3892
3893         Fix #76371.
3894         * class.cs (TypeContainer.DefineType): Move updating of
3895         topological sort earlier in the code.
3896         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
3897
3898 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
3899
3900         Fix #76273.
3901         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
3902         
3903         * constant.cs (Constant.TryReduce): Moved from Cast class.
3904         (Reduce): Made little bit more OO and fixed missing conversions.
3905         
3906         * ecore.cs (Reduce): Implemented.
3907         (Binary.EnumLiftUp): New method to upgrade values to enum values.
3908         
3909         * literal.cs (Reduce): Implemented.
3910         
3911         * class.cs: Reverted Miguel's wrong commit.
3912
3913 2005-10-14  Miguel de Icaza  <miguel@novell.com>
3914
3915         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
3916
3917 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
3918
3919         * cs-parser.jay, expression.cs : CS0214 was missing error location
3920           for constants. Fixed bug #76404.
3921
3922 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
3923
3924         Fix #76370.
3925         * convert.cs (ExplicitConversionCore): Fixed object->enum
3926         conversion.
3927
3928 2005-10-10  Raja R Harinath  <rharinath@novell.com>
3929
3930         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
3931         InstanceExpression.
3932         (PropertyExpr.EmitCall): Likewise.
3933         * expression.cs (Invocation.EmitArguments): Handle case where
3934         arguments == null.
3935         (Invocation.EmitCall): Avoid allocating temporary variable if
3936         there are no arguments.
3937
3938 2005-10-07  Raja R Harinath  <rharinath@novell.com>
3939
3940         Fix #76323.
3941         * convert.cs (ImplicitConversionStandard): Move conversion of
3942         void* to arbitrary pointer types ...
3943         (ExplicitConversionStandard): .. here.
3944         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
3945         error to always print typenames.
3946
3947 2005-10-07  Raja R Harinath  <rharinath@novell.com>
3948
3949         * convert.cs (GetConversionOperator): Rename from
3950         GetConversionOperators.  Move operator selection code from ...
3951         (UserDefinedConversion): ... here.
3952
3953 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
3954
3955         * convert.cs (ExplicitConversionCore): Removed duplicate enum
3956         conversion.
3957
3958 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
3959
3960         * assign.cs (Assign.DoResolve): Error method changed.
3961
3962         * cfold.cs (DoConstantNumericPromotions): Error method changed.
3963         
3964         * const.cs (ResolveValue): Reset in_transit immediately.
3965         
3966         * constant.cs: Error method changed.
3967         
3968         * convert.cs: Removed useless location parameter.
3969         (ExplicitNumericConversion): Don't do double enum check.
3970         (ExplicitConversionCore): Renamed from ExplicitConversion.
3971         (ExplicitUnsafe): Extracted from ExplicitConversion.
3972         (ExplicitConversion): Uses for error reporting.
3973         
3974         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
3975         error messages.
3976         (ResolveBoolean): Uses common error method.
3977         (CastToDecimal): Get rid of ec.
3978         (CastFromDecimal): Optimized.
3979         (ConvCast): Get rid of ec.
3980         
3981         * enum.cs (ResolveValue): Reset in_transit immediately.
3982         (Emit): Return after first error.
3983         
3984         * expression.cs: Convert changes.
3985         
3986         * literal.cs: Error method changed.
3987         
3988         * statement.cs: Error method changed.
3989
3990 2005-10-03  Raja R Harinath  <rharinath@novell.com>
3991
3992         * support.cs (SeekableStreamReader.Position): Don't error out when
3993         the requested position is just beyond the end of the current
3994         buffered data.
3995
3996 2005-09-28  Raja R Harinath  <rharinath@novell.com>
3997
3998         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
3999         try to keep in sync with the byte count of the underlying Stream.
4000         However, this limits us to a window size of 2048 characters: i.e.,
4001         the maximum lookahead of our lexer/parser can be 2048 characters.
4002
4003 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
4004
4005         Fix #76255.
4006         * driver.cs: Fix compilation files with full root path.
4007
4008 2005-09-25  Miguel de Icaza  <miguel@novell.com>
4009
4010         * report.cs (SymbolRelatedToPreviousError): Format the output so
4011         it does not use an open parenthesis that is never closed. 
4012
4013         * driver.cs: Follow coding guidelines
4014
4015 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
4016
4017         Fix #72930.
4018         * const.cs (Const.ResolveValue): Check for assigning non-null
4019         value to reference type.
4020
4021 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
4022
4023         * anonymous.cs: Implemented ExprClassName.
4024         
4025         * assign.cs (Assign.DoResolve): Don't chrash when type is not
4026         delegate.
4027         
4028         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
4029         check.
4030         
4031         * class.cs (StaticClass.DefineContainerMembers): Report protected
4032         members as error.
4033         
4034         * codegen.cs: if(ed) PRODUCTION.
4035         
4036         * convert.cs (Error_CannotImplicitConversion): Better error
4037         distinction.
4038         
4039         * cs-parser.jay: More error checks.
4040         
4041         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
4042         
4043         * driver.cs (CSCParseOption): Enabled wrong option check.
4044         
4045         * ecore.cs (Expression.ExprClassName): Turned to property.
4046         (MemberExpr.CheckIntermediateModification): For checking boxed
4047         value types     modification.
4048         
4049         * statement.cs (Fixed.Resolve): Expression type must be
4050         convertible to fixed type.
4051         (CollectionForeach.GetEnumeratorFilter,TryType):
4052         Small refactoring for easier error checking.
4053
4054 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
4055
4056         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
4057         attributes.
4058         
4059         * class.cs (GeneratedBaseInitializer): New class for customization
4060         compiler generated initializers.
4061         (MemberBase.DoDefine): Check Obsolete attribute here.
4062         (FieldMember.DoDefine): Ditto.
4063         
4064         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
4065         constants.
4066         
4067         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
4068         (MemberCore.GetObsoleteAttribute): Removed argument.
4069         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
4070         (MemberCore.CheckObsoleteType): New helper.
4071         
4072         * delegate.cs,
4073         * enum.cs,
4074         * statement.cs: Updates after MemberCore changes.
4075         
4076         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
4077         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
4078         
4079         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
4080         obsolete attribute for compiler construct.
4081         (As.DoResolve): Cache result.
4082         
4083         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
4084
4085 2005-09-26  Raja R Harinath  <rharinath@novell.com>
4086
4087         Fix #76133.
4088         * expression.cs (This.VerifyFixed): In a value type T, the type of
4089         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
4090         value type R, 'this' is treated as a value parameter.
4091
4092 2005-09-22  Miguel de Icaza  <miguel@novell.com>
4093
4094         * statement.cs (Lock): Use the TemporaryVariable class instead of
4095         manually using local variables as those do not work when variables
4096         are captured.
4097
4098         * ecore.cs: Moved the TemporaryVariable class from being a nested
4099         class inside Foreach to be a public class that can be employed in
4100         other places. 
4101
4102 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
4103
4104         * cs-parser.jay: interface_accessors replaced by
4105         accessor_declarations.
4106
4107         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
4108         location.
4109         
4110         * statement.cs (GotoCase.Resolve): Convert null constant to
4111         null case.
4112         (SwitchLabel.ResolveAndReduce): Ditto.
4113         (SwitchLabel.NullStringCase): Custom null stamp.
4114         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
4115         
4116         typemanager.cs (CSharpSignature): Don't skip first argument
4117         for full names.
4118
4119 2005-09-18  Miguel de Icaza  <miguel@novell.com>
4120
4121         * driver.cs: Set InEmacs based on the environment variable EMACS. 
4122
4123         * location.cs (InEmacs): in this mode, do not report column
4124         location as it confuses Emacs.
4125
4126 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
4127
4128         * cfold.cs, constant.cs, convert.cs, ecore.cs,
4129         expression.cs, iterators.cs, literal.cs: Store constants and
4130         literals location.
4131         
4132         * class.cs (MemberBase.ShortName): Pass location.
4133         
4134         * cs-parser.jay: Some location fixes.
4135         
4136         * ecore.cs (Expression.Location): Made virtual.
4137
4138 2005-09-05  Miguel de Icaza  <miguel@novell.com>
4139
4140         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
4141         if the underlying types are the same, otherwise we need to produce
4142         code that will do the proper cast.
4143
4144         This was exposed by Marek's constant rewrite which produced
4145         invalid code for the call site:
4146
4147         enum X : long { a }
4148         void Method (X v) {}
4149
4150         Method ((X) 5)
4151
4152         This fixes test-49.cs
4153
4154 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
4155
4156         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
4157           Type/Object should be allowed as well. Fixed bug #75968.
4158
4159 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
4160
4161         * expression.cs : (Binary.DoResolve): when one is enum constant and
4162           another is constant 0, then return enum one *as enum type*.
4163           Fixed bug 74846.
4164
4165 2005-09-02  Raja R Harinath  <rharinath@novell.com>
4166
4167         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
4168         internal.
4169
4170         Fix #75941.
4171         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
4172         flow-branching for LocalVariableReferences in case we were invoked
4173         from a MemberAccess.
4174         * expression.cs (LocalVariableReference.VerifyAssigned): New.
4175         Carved out of ...
4176         (LocalVariableReference.DoResolveBase): ... this.
4177         (MemberAccess.Resolve): Do the check that was disabled during
4178         SimpleNameResolve.
4179
4180 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
4181
4182         * class.cs :
4183           (PartialContainer.Create): check abstract/sealed/static strictly
4184           but abstract/sealed can exist only at one side. Fixed bug #75883.
4185
4186 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
4187
4188         Fix #75945.
4189         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
4190         specified, don't default to UnmanagedType.I4.
4191
4192 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
4193
4194         * expression.cs : conditional operator should check possibly
4195           incorrect assign expression. Fixed bug #75946.
4196
4197 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
4198
4199         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
4200           Reverting the change. gmcs is much complex than mcs on this matter.
4201
4202 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
4203
4204         * cs-tokenizer.cs : To read another token ahead of the actual 
4205           consumption, use new SavedToken and cache token instead of moving
4206           back the stream with SeekableStreamReader (it seemed problematic).
4207         * cs-parser.jay,
4208           driver.cs : Thus use StreamReader directly.
4209         * support.cs : Thus removed SeekableStreamReader.
4210
4211 2005-08-30  Raja R Harinath  <rharinath@novell.com>
4212
4213         Fix #75934.
4214         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
4215         (ScopeInfo.EmitScopeType): Use it to construct field names from
4216         names of captured locals.
4217
4218         Fix #75929.
4219         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
4220         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
4221         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
4222         (ExplicitConversion): Remove enum cases already handled by
4223         implicit conversion.  Move implicit conversion check to the beginning.
4224         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
4225         * expression.cs (ArrayCreation.EmitDynamicInitializers):
4226         Don't treat System.Enum as a struct.
4227
4228 2005-08-30  Jb Evain  <jbevain@gmail.com>
4229
4230         * attribute.cs: handles as expression in parameters.
4231
4232 2005-08-30  Raja R Harinath  <rharinath@novell.com>
4233
4234         Fix #75802.
4235         * class.cs (TypeContainer.VerifyClsName): Don't use a
4236         PartialContainer when verifying CLS compliance.
4237         (AbstractPropertyEventMethod): Set Parent here, ...
4238         (PropertyMethod): ... not here.
4239
4240 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
4241
4242         * attribute.cs : escaped attribute name should not be allowed to be
4243           resolved (e.g. @class as classAttribute). Fixed bug #75930.
4244
4245 2005-08-29  Raja R Harinath  <rharinath@novell.com>
4246
4247         Fix #75927.
4248         * convert.cs (ImplicitStandardConversionExists): Allow zero also
4249         when converting a long constant to unsigned long.
4250         * expression.cs (Invocation.OverloadResolve): Add sanity check to
4251         detect where IsApplicable and VerifyArgumentsCompat disagree.
4252
4253 2005-08-29  Raja R Harinath  <rharinath@novell.com>
4254         and Carlos Alberto Cortez  <carlos@unixmexico.org>
4255
4256         Fix #75848.
4257         * class.cs (TypeContainer.CanElideInitializer): New helper.
4258         (TypeContainer.EmitFieldInitializers): Use it to determine if we
4259         can safely emitting the initializer of a field.
4260
4261 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4262
4263         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
4264           allowed inside a switch (without loop). Fixed bug #75433.
4265
4266 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
4267
4268         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
4269         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
4270
4271 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4272
4273         * driver.cs : kinda reverting the default encoding changes (not exact 
4274           revert since I noticed that "codepage:reset" might not work fine).
4275
4276 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4277
4278         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
4279           Location. Now getter and setter store location correctly.
4280           (errors/cs0111-12.cs now reports the expected location.)
4281
4282 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4283
4284         * driver.cs : Use default encoding on the environment.
4285           Removed (now that) extra parameter for SeekableStreamReader.
4286         * support.cs : (SeekableStreamReader) third .ctor() argument for
4287           StreamReader is not required (always true). preamble size could
4288           be acquired in simpler and safe way.
4289
4290 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
4291
4292         * cs-parser.jay: report CS0642 at warning level 3
4293           and report CS0642 for an if else statement also
4294           fixes bug #74745. Patch by John Luke (and a bit
4295           modified by me).
4296           Removed extra CS0642 warning check for "while",
4297           "for" and "fixed".
4298         * statement.cs: In Block.Resolve(), CS0642 check
4299           is reimplemented to check a sequence of an empty
4300           statement and a block.
4301
4302           Both fix bug #66777.
4303
4304 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
4305
4306         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
4307         detection until I fix it.
4308         
4309         * cs-tokenizer.cs: Changed error message.
4310         
4311         * cs-parser.jay: Fixed 2 error locations.
4312         
4313         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
4314         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
4315         properties.
4316         
4317         * enum.cs (GetSignatureForError): Fixed.
4318         
4319         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
4320         method detection.
4321         
4322         * class.cs,
4323         * typemanager.cs (RegisterProperty): Removed.
4324         
4325         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
4326
4327 2005-08-24  Raja R Harinath  <rharinath@novell.com>
4328
4329         Fix #75874.
4330         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
4331         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
4332
4333 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4334
4335         * expression.cs : tiny fix is required for not warning positive ulong.
4336           See test-441.cs.
4337
4338 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4339
4340         * expression.cs : add CS0652 check for constant and integral
4341           expression. Fixed bug #53974.
4342
4343 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4344
4345         * expression.cs : in DoNumericPromotions(), check if there is implicit
4346           conversion overload for string (to check CS0034). Fixed bug #52492.
4347
4348 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4349
4350         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
4351
4352 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4353
4354         * ecore.cs : report location when it is *not* Null.
4355
4356 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4357
4358         * codegen.cs,
4359           ecore.cs,
4360           flowanalysis.cs,
4361           expression.cs:
4362           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
4363           correctly. Fixed bug #75721.
4364
4365 2005-08-23  Raja R Harinath  <rharinath@novell.com>
4366
4367         * support.cs (SeekableStreamReader.Position): Avoid an expensive
4368         loop that performs 'min (pos, char_count)'.
4369
4370         Fix #75862.
4371         * expression.cs (Unary.ResolveOperator): Don't discard implicit
4372         converted value in Operator.OnesComplement.
4373
4374 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
4375
4376         * anonymous.cs: If the anon method is pulled into a helper class,
4377         it needs to be `internal' not `private'. Fixes runtime behavior on
4378         msft. bug #75704
4379
4380 2005-08-20  Martin Baulig  <martin@ximian.com>
4381
4382         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4383         scope if we don't already have it.
4384
4385         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
4386         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
4387         fixes #75867.
4388
4389 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
4390
4391         Fix #75803
4392         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
4393         is a partial class.
4394
4395 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
4396
4397         The big constants rewrite
4398         Fix #75746, #75685 and more
4399         As a side effect saved 1MB for MWF ;-)
4400         
4401         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
4402         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
4403         enum based for corlib compilation.
4404         
4405         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
4406         subtractions.
4407         
4408         * class.cs (FixedField.Define): Use ResolveAsConstant.
4409         
4410         * const.cs (IConstant): Interface constants and enums.
4411         (Const.ResolveValue): New method for constant resolvning.
4412         (ExternalConstant): Constants from imported assemblies.
4413         
4414         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
4415         conversion; like enums.
4416         (Constant.ToType): Converts this constant to different type.
4417         (Constant.Increment): Adds 1.
4418         
4419         * convert.cs (ImplicitConversionRequired): Simplified.
4420         
4421         * cs-parser.jay: Create EnumMember directly.
4422         
4423         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
4424         
4425         * doc.cs (GenerateEnumDocComment): Removed.
4426         
4427         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
4428         (ConvertIntLiteral): Removed.
4429         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
4430         
4431         * enum.cs (EnumMember): Implement IConstant.
4432         (Enum.IsValidEnumConstant): Removed.
4433         (Enum.GetNextDefaultValue): Removed.
4434         (Enum.FindMembers): Updated.
4435         (Enum.GenerateDocComment): Iterate enum members.
4436         
4437         * expression.cs (Cast.TryReduce): Handle enums correctly.
4438         (New.Constantify): Made public.
4439         (MemberAccess.DoResolve): Removed contant specific if(s).
4440         
4441         * literal.cs (NullLiteral): Implement new abstract methods.
4442         
4443         * statement.cs (GotoCase.Resolve): Use new constant methods.
4444         (SwitchLabel.ResolveAndReduce): Use new constant methods.
4445         
4446         * typemanager.cs (LookupEnum): Removed.
4447         (IsEnumType): Fixed to work with corlib.
4448         (RegisterConstant): Removed.
4449         (LookupConstant): Removed.
4450         (GetConstant): Changed to work with IConstant.
4451
4452 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
4453
4454         * location.cs : Fixed overflown (>255) column number.
4455
4456 2005-08-03  Raja R Harinath  <rharinath@novell.com>
4457
4458         First cut of the qualified-alias-member feature.
4459         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
4460         token.
4461         * cs-parser.jay (DOUBLE_COLON): New token.
4462         (namespace_or_type_name): Add rule for recognizing
4463         qualified-alias-members.
4464         (primary_expression): Likewise.
4465         (element_access): Allow QualifiedAliasMember as a possible
4466         type-bearing expression.
4467         (local_variable_type, local_variable_pointer_type): Likewise.
4468         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
4469         aliases in the current and enclosing namespace declarations.
4470         (NamespaceEntry.UsingAlias): Add CS0440 warning.
4471         * decl.cs (MemberName.is_double_colon): New.
4472         (MemberName.MemberName): Add new constructor for alias-member.
4473         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
4474         * expression.cs (QualifiedAliasMember): New expression type.
4475
4476 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4477
4478         * location.cs : it borked when no argument was specified.
4479
4480 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4481
4482         * location.cs : tiny ToString() format fix.
4483
4484 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4485
4486         * statement.cs : oops, it was missing.
4487
4488 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4489
4490         A set of fixes for precise line/column location.
4491
4492         * location.cs :
4493           "token" field now holds a file/line "delta", a line number offset 
4494           from the segment, and a column number. See also:
4495           http://lists.ximian.com/pipermail/mono-devel-list/2004-
4496           December/009508.html
4497           Removed static IsNull. Use instance IsNull property instead.
4498         * cs-tokenizer.cs :
4499           For some tokens it stores Location. For Identifier it stores
4500           LocatedToken which is a pair of string name and location.
4501           Column numbers are adjusted only at getChar().
4502         * report.cs :
4503           Use Location.ToString() for reporting (it now contains column).
4504         * cs-parser.jay :
4505           Largely modified to use LocatedToken instead of
4506           string (IDENTIFIER), and to acquire Location from some tokens.
4507         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
4508           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
4509           codegen.cs :
4510           Now MemberName holds Location. DeclSpace.ctor() receives Location
4511           as a parameter. Removed extra parameters to all derived classes.
4512           Replaced Location.IsNull() with instance property.
4513         * assign.cs, expression.cs :
4514           Added .ctor() overload that omits Location.
4515         * attribute.cs :
4516           Added "nameEscaped" flag that indicates the identifier was escaped
4517           in the source file. This fixes bug #57047.
4518
4519 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
4520
4521         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
4522         New method, looking for lo-case imported cls type.
4523
4524         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
4525         here.
4526
4527         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
4528
4529         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
4530
4531         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
4532         all_imported_types.
4533         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
4534
4535         Optimized to save 3.5 MB for SWF compilation.
4536
4537 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
4538
4539         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
4540         (PartialContainer.Create): Moved logic AddToContainer.
4541         (PartialContainer.MarkForDuplicationCheck): Shares name.
4542         
4543         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
4544         place.
4545         
4546         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
4547         initialization.
4548         (Namespace.GetSignatureForError): New method.
4549         
4550         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
4551         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
4552
4553 2005-08-01  Raja R Harinath  <rharinath@novell.com>
4554
4555         Fix #75669.
4556         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
4557         member lookup rather than qualifier_type, since qualifier_type can
4558         be null.
4559
4560 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
4561
4562         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
4563         enum member.
4564
4565 2005-07-31  Miguel de Icaza  <miguel@novell.com>
4566
4567         * statement.cs: Copy the local exception into the exception
4568         captured local.  Fixes 75674
4569
4570 2005-07-31  Raja R Harinath  <harinath@gmail.com>
4571
4572         Fix #75658.
4573         * expression.cs (Invocation.OverloadResolve): Don't report error
4574         CS1501 if error CS1502 has been reported.
4575         (New.DoResolve): Delegate CS1501 reporting to
4576         Invocation.OverloadResolve.
4577
4578         Fix #75656.
4579         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
4580         invariant-meaning-in-block property in an enclosing block if
4581         necessary.
4582
4583 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
4584
4585         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
4586         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
4587         (Switch.CheckSwitch): Just save 50kb for SWF.
4588
4589 2005-07-27  Martin Baulig  <martin@ximian.com>
4590
4591         * anonymous.cs (CaptureContext.AddField): Added
4592         `AnonymousContainer am' argument; compute its toplevel scope if
4593         it's not already computed.  Fixes #75649.
4594
4595 2005-07-26  Raja R Harinath  <rharinath@novell.com>
4596
4597         Fix #75628.
4598         * class.cs (Constructor.Emit): Reset block to null if the block
4599         resolve fails.
4600
4601 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
4602
4603         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
4604
4605 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
4606
4607         * class.cs (MethodData.Define): Check whether accessor implementing
4608         interface is public.
4609
4610         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
4611
4612 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
4613
4614         Fix #57245
4615         * namespace.cs (LookupType): Moved same type check to...
4616         
4617         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
4618         with the same name.
4619
4620 2005-07-21  Raja R Harinath  <rharinath@novell.com>
4621
4622         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
4623         already found a typebuilder.
4624         * class.cs (MethodCore.IsDuplicateImplementation): Compare
4625         MemberNames, not strings.
4626
4627         * const.cs (Error_ExpressionMustBeConst): 
4628         Rename from Error_EpressionMustBeConst.
4629         * const.cs, class.cs, statement.cd: Update.
4630
4631 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
4632
4633         Fix #65573
4634
4635         * const.cs (Const.LookupConstantValue): Report missing contant expression
4636         everytime.
4637         (Error_EpressionMustBeConstant): Only one error method.
4638
4639         * class.cs, statement.c: Updated.
4640
4641 2005-07-20  Raja R Harinath  <rharinath@novell.com>
4642
4643         * statement.cs (Block.Flags): Add back HasVarargs.
4644         (Block.flags): Make protected.
4645         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
4646
4647         * typemanager.cs (types, typecontainers, user_types): Remove.
4648         (UserTypes, TypeContainers): Likewise.
4649         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
4650         (CleanUp, Reset): Update.
4651         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
4652         (GetNestedType): Use Type.GetNestedType.
4653         (CoreLookupType): Take two arguments, the namespace and the
4654         basename of the type.  Update to use the Namespace.Lookup
4655         mechanism.
4656         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
4657         (RealMemberLookup): Use IsNestedChildOf instead of playing with
4658         string concatenation and substring matches.
4659         * class.cs, enum.cs, delegate.cs: Update to changes.
4660
4661 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
4662
4663         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
4664         Expression and made virtual.
4665
4666         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
4667         (ImplicitStandardConversionExists): Fixed `byte' typo ?
4668
4669         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
4670
4671         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
4672         error message.
4673
4674         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
4675         change.
4676
4677 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
4678
4679         Fix #57707
4680         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
4681         AssemblyCultureAttribute is not used on executable.
4682
4683         * rootcontext.cs,
4684         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
4685
4686 2005-07-16  Raja R Harinath  <rharinath@novell.com>
4687
4688         Fix #60638.
4689         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
4690         New.  Reports CS0252/CS0253.
4691         Mostly taken from preliminary patch by Duncak Mak.
4692         (Binary.DoResolveOperator): Store results of operator lookup.
4693         Use them to detect if we need to warn about unintended reference
4694         comparisons.
4695
4696 2005-07-15  Raja R Harinath  <rharinath@novell.com>
4697
4698         Fix #72969.
4699         * namespace.cs (Namespace.Lookup): Add back location parameter.
4700         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
4701         * delegate.cs, ecore.cs, expression.cs: Update to changes.
4702
4703         * codegen.cs (EmitContext.DeclSpace): Make readonly.
4704         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
4705         (Namespace.LookupType): ... this.
4706         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
4707         of namespaces.
4708         * typemanager.cs (LookupTypeReflection): Remove buggy code that
4709         purported to handle pointers.
4710         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
4711         CoreLookupType.
4712
4713 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
4714
4715         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4716         type as namespace.
4717
4718 2005-07-15  Raja R Harinath  <rharinath@novell.com>
4719
4720         * namespace.cs (Namespace.Lookup): Drop location parameter.
4721         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
4722         (NamespaceEntry.Lookup): ... this.
4723         (NamespaceEntry.Error_AmbiguousTypeReference):
4724         Move here from DeclSpace.
4725         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
4726         names ...
4727         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
4728         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
4729         Move to NamespaceEntry.
4730         * delegate.cs, expression.cs: Update to changes.
4731
4732 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
4733
4734         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
4735         CheckAttributeType and refactored.
4736         (Attribute.ResolvePossibleAttributeType): Changed to reuse
4737         ResolveAsTypeTerminal error handling.
4738         (ResolveAsTypeTerminal): Introduced because of global attributes extra
4739         handling.
4740         (GetSignatureForError): Print errors in same way.
4741
4742         * class.cs,
4743         * codegen.cs: Reflect attribute GetSignatureForError change.
4744
4745         * ecore.cs,
4746         * expression.cs: Add silent parameter to ResolveAsTypeStep.
4747
4748         * namespace.cs (UsingEntry): Refactored to make fields private.
4749
4750         * assign.cs,
4751         statement.cs: Error_UnexpectedKind has extra parameter.
4752
4753 2005-07-14  Raja R Harinath  <rharinath@novell.com>
4754
4755         * ecore.cs (IAlias): Remove.
4756         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
4757         that implement the interface.
4758         * namespace.cs (Namespace): Likewise.
4759         (Namespace.declspaces): Renamed from 'defined_names'.
4760         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
4761         DeclSpace instead of an IAlias.
4762         * tree.cs (Tree.AddDecl): Update.
4763
4764 2005-07-12  Raja R Harinath  <rharinath@novell.com>
4765
4766         * statement.cs (Block.Flags); Remove HasVarargs.
4767         (Block.HasVarargs): Move to ToplevelBlock.
4768         (Block.ThisVariable, Block.AddThisVariable): Likewise.
4769         (Block.Variables): Make protected.  Initialize variable hashtable
4770         if necessary.
4771         (Block.AddVariable): Update.
4772         (Block.Resolve): Update to changes.
4773         (ToplevelBlock.HasVarargs): New boolean.
4774         (ToplevelBlock.ThisVariable): Move here from Block.
4775         (ToplevelBlock.AddThisVariable): Likewise.
4776         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
4777         * expression.cs (This.ResolveBase): Update to changes.
4778         (ArglistAccess.DoResolve): Likewise.
4779
4780 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
4781
4782         Fix #75321
4783         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
4784
4785         * class.cs (TypeContainer.VerifyMembers): Distinguish between
4786         not used and not used & assigned.
4787         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
4788
4789 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
4790
4791         Fix #75053
4792         * expression.cs (Is.DoResolve): null is never provided type.
4793
4794 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
4795
4796         Fix #52496
4797         * cs-parser.jay: Less strict event error rule to catch more errors.
4798
4799 2005-07-08  Martin Baulig  <martin@ximian.com>
4800
4801         Fix test-iter-10.cs - distinguish whether we `yield' in a property
4802         gettter (allowed) or setter (not allowed).
4803
4804         * class.cs (Accessor): Implement IIteratorContainer.
4805         (Accessor.Yields): New public field.
4806         (PropertyBase.PropertyMethod.Define): Handle iterators on a
4807         per-accessor basis.
4808
4809         * cs-parser.jay
4810         (get_accessor_declaration, set_accessor_declaration): Set the
4811         `yields' flag on the accessor, not the property.
4812         (property_declaration): Do the iterators check on a per-accessor
4813         basis and not for the whole property.
4814
4815 2005-07-08  Martin Baulig  <martin@ximian.com>
4816
4817         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
4818         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
4819
4820 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
4821
4822         Fix #74975
4823         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
4824         (ExtractSecurityPermissionSet): Cope with self referencing security
4825         attributes properly.
4826
4827         * driver.cs (SetOutputFile): Made public property OutputFile.
4828
4829 2005-07-07  Raja R Harinath  <rharinath@novell.com>
4830
4831         Fix #75486.
4832         * class.cs (TypeContainer.first_nonstatic_field): Rename from
4833         has_nonstatic_fields.  Make into a FieldBase pointer.
4834         (TypeContainer.AddField): Add CS0282 check.
4835         (TypeContainer.EmitType): Update.
4836
4837 2005-07-06  Miguel de Icaza  <miguel@novell.com>
4838
4839         * cs-tokenizer.cs (consume_identifier): Do not create strings to
4840         compare if they start with __.
4841
4842 2005-07-06  Raja R Harinath  <rharinath@novell.com>
4843
4844         * statement.cs (Switch.SwitchGoverningType): Only look at
4845         UserCasts that don't need implicit standard conversions to one of
4846         the allowed switch types (Fixes test-322.cs).
4847         (LocalInfo.Resolve): Re-enable sanity-test.
4848
4849 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
4850
4851         * cs-tokenizer.cs (consume_identifier): Detect double undescores
4852         
4853         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
4854         
4855         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
4856
4857 2005-07-06  Raja R Harinath  <rharinath@novell.com>
4858
4859         Fix #75472.
4860         * ecore.cs (SimpleName.GetSignatureForError): Add.
4861         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
4862         (MemberAccess.GetSignatureForError): Add.
4863
4864 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
4865  
4866         The big error and warning messages review.
4867         
4868         * anonymous.cs,
4869         * assign.cs,
4870         * attribute.cs,
4871         * class.cs,
4872         * codegen.cs,
4873         * convert.cs,
4874         * cs-parser.jay,
4875         * cs-tokenizer.cs,
4876         * decl.cs,
4877         * delegate.cs,
4878         * doc.cs,
4879         * driver.cs,
4880         * ecore.cs,
4881         * enum.cs,
4882         * expression.cs,
4883         * flowanalysis.cs,
4884         * iterators.cs,
4885         * literal.cs,
4886         * location.cs,
4887         * modifiers.cs,
4888         * namespace.cs,
4889         * parameter.cs,
4890         * pending.cs,
4891         * report.cs,
4892         * rootcontext.cs,
4893         * statement.cs,
4894         * support.cs,
4895         * tree.cs,
4896         * typemanager.cs: Updated.
4897         
4898         * class.cs: (MethodCore.SetYields): Moved here to share.
4899         (PropertyMethod.Define): Moved iterator setup here.
4900         
4901         * iterators.cs: Add orig_method to have full access to parent
4902         container.
4903
4904 2005-07-05  Raja R Harinath  <rharinath@novell.com>
4905
4906         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
4907         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
4908         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
4909         variable of struct type.
4910         * expression.cs (Unary.ResolveOperator): Update to change.
4911         (Indirection.VerifyFixed): Likewise.
4912         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
4913         (ParameterReference.VerifyFixed): Value parameters are fixed.
4914         (This.VerifyFixed): Treat 'this' as a value parameter.
4915         * statement.cs (LocalInfo.IsFixed): Remove.
4916
4917 2005-07-01  Martin Baulig  <martin@ximian.com>
4918
4919         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4920         `ec.EmitThis ()' to get the correct scope.
4921
4922 2005-07-01  Martin Baulig  <martin@ximian.com>
4923
4924         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
4925         instance is a ParameterReference; fixes #75299.
4926
4927 2005-07-01  Martin Baulig  <martin@ximian.com>
4928
4929         Reverted Marek's latest patch (r46725):
4930         - it contains structural changes which are neither mentioned in
4931           the ChangeLog nor explained anywhere; for example the additional
4932           argument of EmitContext's and Iterator's .ctor's and the
4933           TypeContainer.DefineMembers() change.
4934         - structural changes like this should go in in seperate patches
4935           and not be hidden in a huge patch which just seems to affect
4936           warnings and errors.
4937           a big and hard to understand patch.
4938         - it breaks iterators and causes regressions, for instance in
4939           test-iter-03.cs.      
4940
4941 2005-06-30  Raja R Harinath  <rharinath@novell.com>
4942
4943         Fix #75412.
4944         * expression.cs (Indexers.map): Remove.
4945         (Indexers.Append): Filter out inaccessible setters and getters.
4946         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
4947
4948         Fix #75283.
4949         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
4950         Refactored from ...
4951         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
4952         (FieldExpr.Emit, PropertyExpr.Emit): Update.
4953         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
4954         * expression.cs (Invocation.EmitCall): Add CS0120 check.
4955
4956 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
4957
4958         Fix #75322
4959         * class.cs (FieldBase.GetInitializerExpression): One more field
4960         for backup.
4961
4962 2005-06-28  Miguel de Icaza  <miguel@novell.com>
4963
4964         * pending.cs: Do not define a proxy if the base method is virtual,
4965         it will be picked up by the runtime (bug 75270).
4966
4967 2005-06-08  Martin Baulig  <martin@ximian.com>
4968
4969         The big Iterators rewrite :-)
4970
4971         * iterators.cs: Rewrite this to use the anonymous methods framework.
4972
4973         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
4974         before the TypeContainers; see 2test-21.cs.
4975
4976         * class.cs
4977         (TypeContainer.DefineType): Don't create a new EmitContext if we
4978         already have one (this only happens if we're an Iterator).
4979         (TypeContainer.Define): Also call Define() on all our iterators.
4980         (Method.CreateEmitContext): Added support for iterators.
4981
4982         * anonymous.cs
4983         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
4984         (AnonymousContainer.CreateMethodHost): Moved here from
4985         AnonymousMethod and made abstract.
4986         (AnonymousContainer.CreateScopeType): New abstract method.
4987         (AnonymousContainer.IsIterator): New public property.
4988         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
4989         get the ScopeTypeBuilder rather than manually defining it here. 
4990         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
4991         iterators here.
4992
4993         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
4994         before RootContext.DefineTypes().
4995
4996         * codegen.cs (EmitContext.RemapToProxy): Removed.
4997         (EmitContext.CurrentAnonymousMethod): Changed type from
4998         AnonymousMethod -> AnonymousContainer.
4999         (EmitContext.ResolveTopBlock): Protect from being called twice.
5000         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
5001         (EmitContext.EmitThis): Removed the iterators hacks; use the
5002         anonymous methods framework for that.
5003
5004         * statement.cs
5005         (ToplevelBlock.Container): Make this a property, not a field.
5006         (ToplevelBlock.ReParent): New public method; move the
5007         ToplevelBlock into a new container.
5008         (Foreach.TemporaryVariable): Simplify.
5009
5010 2005-06-05  Martin Baulig  <martin@ximian.com>
5011
5012         * statement.cs (LocalInfo.CompilerGenerated): New flag.
5013         (Block.AddTemporaryVariable): New public method; creates a new
5014         `LocalInfo' for a temporary variable.
5015         (Block.EmitMeta): Create the LocalBuilders for all the temporary
5016         variables here.
5017         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
5018         non-iterator variables.
5019
5020 2005-06-05  Martin Baulig  <martin@ximian.com>
5021
5022         * statement.cs (Foreach.TemporaryVariable): Create the
5023         LocalBuilder in the Emit phase and not in Resolve since in some
5024         situations, we don't have an ILGenerator during Resolve; see
5025         2test-19.cs for an example.
5026
5027 2005-06-04  Martin Baulig  <martin@ximian.com>
5028
5029         **** Merged r45395 from GCS ****
5030
5031         The big Foreach rewrite - Part II.
5032
5033         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
5034         with `PropertyInfo ienumerator_getcurrent'.
5035
5036         * codegen.cs (VariableStorage): Removed.
5037
5038         * statement.cs
5039         (Foreach): Derive from Statement, not ExceptionStatement.
5040         (Foreach.CollectionForeach): New nested class.  Moved all the code
5041         dealing with collection foreach here.
5042         (Foreach.ForeachHelperMethods): Removed.
5043         (Foreach.TemporaryVariable): Implement IMemoryLocation.
5044
5045 2005-05-23  Martin Baulig  <martin@ximian.com>
5046
5047         * statement.cs (Try.DoResolve): Don't create a `finally' if we
5048         don't need to.  Fix #75014.
5049
5050 2005-05-20  Martin Baulig  <martin@ximian.com>
5051
5052         Merged r44808 from GMCS.
5053
5054         * class.cs (TypeContainer.CircularDepException): Removed.
5055         (TypeContainer.DefineType): Removed the `InTransit' stuff.
5056         (TypeContainer.CheckRecursiveDefinition): Check for circular class
5057         (CS0146) and interface (CS0529) dependencies here.
5058
5059 2005-06-21  Raja R Harinath  <rharinath@novell.com>
5060
5061         * expression.cs (Invocation.EmitCall): Fix initialization
5062         'this_call' to reflect current behaviour.  Fix indentation.
5063
5064         * convert.cs (FindMostEncompassedType): Add two trivial special
5065         cases (number_of_types == 0 || number_of_types == 1).
5066         (FindMostEncompasingType): Likewise.
5067
5068 2005-06-17  Raja R Harinath  <rharinath@novell.com>
5069
5070         Some cleanups preparing for the fix of #75283.
5071         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
5072         error testing.
5073         (EventExpr.InstanceResolve): Likewise.
5074         (EventExpr.DoResolve): Remove redundant checks.
5075
5076 2005-06-10  Duncan Mak  <duncan@novell.com>
5077
5078         * cs-tokenizer.cs (process_directives): New flag for controlling
5079         the processing of preprocessor directives.
5080         (x_token): After seeing a '#', return Token.NONE instead of going
5081         to handle_preprocessing_directive() when not processing
5082         directives. This avoids unnecessary processing during the token peek in
5083         is_punct().
5084
5085         This fixes #74939.
5086
5087         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
5088         the existing error reporting methods instead of Report.Error.
5089
5090         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
5091         after Raja's rewrite.
5092
5093 2005-06-08  Miguel de Icaza  <miguel@novell.com>
5094
5095         * class.cs: Small fix.
5096
5097 2005-06-08  Raja R Harinath  <rharinath@novell.com>
5098
5099         Fix #75160.
5100         * class.cs (GetPartialBases): Fix return value check of
5101         part.GetClassBases.
5102
5103 2005-06-07  Raja R Harinath  <rharinath@novell.com>
5104
5105         Ensure that partial classes are registered in their enclosing
5106         namespace.  Initial part of fix of #75160.
5107         * tree.cs (Tree.RecordDecl): Add new namespace argument.
5108         Register declspace with namespace here, not in
5109         DeclSpace.RecordDecl.
5110         * cs-parser.jay: Pass namespace to RecordDecl.
5111         * class.cs (PartialContainer.Create): Likewise.
5112         (ClassPart.DefineType): New sanity-check.  Throws an exception if
5113         called.
5114         * decl.cs (Declspace.RecordDecl): Remove.
5115         * namespace.cs (NamespaceEntry.DefineName): Remove.
5116
5117 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
5118
5119         * rootcontext.cs: Reset TargetExt as well.
5120
5121 2005-06-03  Raja R Harinath  <rharinath@novell.com>
5122
5123         * ecore.cs (Expression.Resolve): Emit CS0654 error when
5124         -langversion:ISO-1.
5125
5126 2005-06-02  Raja R Harinath  <rharinath@novell.com>
5127
5128         Fix #75080, cs0119.cs.
5129         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
5130         of ...
5131         (Expression.Resolve): ... this.  Use it.  Remove bogus code
5132         allowing ExprClass.Type and ExprClass.Namespace for
5133         ResolveFlags.VariableOrValue.
5134         (Expression.Resolve) [1-argument variant]: Change default resolve
5135         flags based on language version.
5136         (Expression.Error_UnexpectedKind): Use a simple string array
5137         rather than an ArrayList.
5138         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
5139         not ExprClass.Type.
5140         (TypeOfVoid.DoResolve): Likewise.
5141         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
5142         flags argument -- it always has the same value.
5143
5144 2005-05-31  Raja R Harinath  <rharinath@novell.com>
5145
5146         Fix #75081.
5147         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
5148         Use it in the error message.
5149         * assign.cs, expression.cs, statement.cs: Update.
5150
5151 2005-05-30  Raja R Harinath  <rharinath@novell.com>
5152
5153         Fix #75088.
5154         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
5155         the "almostMatchedMember" case too.
5156         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
5157         that failed the accessibility checks to 'almost_match'.
5158
5159 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
5160
5161         * attribute.cs: Use internal MethodBuilder methods to set
5162         ExactSpelling and SetLastError on PInvoke methods, instead
5163         of passing them via charset.  Fixes #75060.
5164
5165 2005-05-27  Raja R Harinath  <rharinath@novell.com>
5166
5167         * parameter.cs (Parameter): Remove TODO comment.
5168         (Parameter.DefineParameter): Remove Location parameter.
5169         (Parameters.LabelParameters): Likewise.
5170         * class.cs (Constructor.Emit): Update to change.
5171         (MethodData.Emit): Likewise.
5172         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
5173         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
5174
5175 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
5176
5177         * parameter.cs,
5178           Removed Parameters.Location and added Parameter.Location instead.
5179           Removed Location parameter from Emit() and GetSignature().
5180         * anonymous.cs,
5181           class.cs,
5182           cs-parser.jay,
5183           delegate.cs,
5184           iterators.cs,
5185           statement.cs :
5186           Modified all related calls.
5187
5188 2005-05-26  Raja R Harinath  <rharinath@novell.com>
5189
5190         Improve user-defined conversion handling.
5191         * convert.cs (GetConversionOperators): Rewrite.  Return only the
5192         applicable operators.
5193         (AddConversionOperators): New.  Helper for GetConversionOperators.
5194         (FindMostEncompassedType, FindMostEncompassingType): Verify that
5195         there is only one most encompassed/encompassing type.
5196         (FindMostSpecificSource, FindMostSpecificTarget): Remove
5197         "applicable operator" handling.
5198         (UserConversion): Move cache here from GetConversionOperators.
5199         Directly cache the chosen operator, rather than the whole
5200         MethodGroup.
5201         (ExplicitNumericConversion): Fix buggy implementation of Decimal
5202         case.  Allow conversion of decimal to sbyte and byte too.
5203         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
5204         New static methods.  Used to avoid allocating EmptyExpressions in
5205         convert.cs.
5206
5207 2005-05-24  Duncan Mak  <duncan@novell.com>
5208
5209         * ecore.cs (CastFromDecimal): New class for casting a decimal to
5210         another class, used in Convert.ExplicitNumericConversion.
5211         (CastToDecimal): New class, similar to above, but casts to
5212         System.Decimal, used in Convert.ImplicitNumericConversion and also
5213         in explicit convesion from double/float to decimal.
5214
5215         * convert.cs (ImplicitNumericConversion): Handle implicit
5216         conversions to System.Decimal.
5217         (ExplicitNumericConversion): handle explicit conversions to
5218         System.Decimal.
5219
5220         This fixes #68711.
5221         
5222 2005-05-20  Miguel de Icaza  <miguel@novell.com>
5223
5224         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
5225         know the type at this stage, just break through.   Fixes #75008 
5226
5227 2005-05-19  Martin Baulig  <martin@ximian.com>
5228
5229         * delegate.cs
5230         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
5231         to disable error reporting.
5232
5233         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
5234         here since we don't want to report an error; see the new test-336.cs.
5235
5236 2005-05-19  Raja R Harinath  <rharinath@novell.com>
5237
5238         * statement.cs (ToplevelBlock.GetParameterReference)
5239         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
5240         Move here from class Block.
5241         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
5242         * expression.cs (ParameterReference.DoResolveBase): Likewise.
5243
5244 2005-05-18  Martin Baulig  <martin@ximian.com>
5245
5246         Fix #74978.
5247
5248         * flowanalysis.cs
5249         (FlowBranching.Reachability): Add non-static public And() and Or()
5250         methods.
5251         (FlowBranchingSwitch): New class; do the `break_origins' thing
5252         like in FlowBranchingLoop.
5253         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
5254         reachability, not just locals and parameters.
5255         (FlowBranching.MergeChild): Remove some of the hacks for loop and
5256         switch; MergeBreakOrigins() now takes care of that.
5257
5258 2005-05-18  Martin Baulig  <martin@ximian.com>
5259
5260         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5261         a loop and may leave it, reset the barrier; fixes #74974.
5262
5263 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
5264         
5265         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
5266         is back.
5267         
5268         * cs-parser.jay: Catch more lexical errors.
5269         
5270         * report.cs: Add one more Error method.
5271         
5272         * rootcontext.cs,
5273         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
5274
5275 2005-05-17  Martin Baulig  <martin@ximian.com>
5276
5277         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
5278         #70970. 
5279
5280 2005-05-16  Raja R Harinath  <rharinath@novell.com>
5281
5282         Fix test-382.cs.  Emit values of decimal constants.
5283         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
5284         Carved out of ...
5285         (TypeContainer.AddField): ... this.
5286         (TypeContainer.EmitFieldInitializers): Allow the list of fields
5287         with initializers to include 'Const's.
5288         (ClassPart.RegisterFieldForInitialization): Forward to
5289         PartialContainer.
5290         * const.cs (Const.Const): Pass initializer to base class.
5291         (Const.Define): In case of decimal constants, register them for
5292         initialization in a static constructor.
5293
5294 2005-05-14  Martin Baulig  <martin@ximian.com>
5295
5296         * statement.cs (Block.Resolve): Correctly handle unreachable code;
5297         do not call ResolveUnreachable() on unreachable statements in
5298         here, see the comment in the source code.
5299
5300 2005-05-13  Raja R Harinath  <rharinath@novell.com>
5301
5302         Fix #74934.
5303         * expression.cs (BinaryResolveOperator): If one of the operands of
5304         an equality comparison is 'null' and the other is a pointer type,
5305         convert the null to a NullPointer.
5306         * convert.cs (ImplicitReferenceConversion): If the expression is a
5307         NullLiteral and the target type is a pointer type, return a
5308         NullPointer instead.
5309         (ImplicitConversionStandard): Likewise.
5310
5311 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
5312         
5313         * cs-parser.jay: Set readonly context based on special constructs.
5314         
5315         * expression.cs (LocalVariableReference.DoResolveBase): Improved
5316         readonly variable error handling.
5317         
5318         * rootcontext.cs (EmitCode): Don't verify members when error
5319         occurred.
5320         
5321         * statement.cs (LocalInfo): Add reaodnly context information.
5322         (SetReadOnlyContext, GetReadOnlyContext): New methods.
5323
5324 2005-05-13  Raja R Harinath  <rharinath@novell.com>
5325
5326         * statement.cs (Block.Resolve): Revert change below.  Modify fix
5327         for #74041 to initialize 'resolved' to false only for explicit
5328         blocks.  Fixes #74873.
5329
5330 2005-05-12  Raja R Harinath  <harinath@gmail.com>
5331
5332         Fix #74920.
5333         * typemanager.cs (unmanaged_enclosing_types): New.
5334         (IsUnmanagedType): Avoid infloops by using
5335         'unmanaged_enclosing_types' to talk with recursive invocations.
5336
5337 2005-05-13  Martin Baulig  <martin@ximian.com>
5338
5339         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
5340         instance variable, not a local.  Fix #74873.
5341         (Block.ResolveUnreachable): Set it to true here.
5342
5343 2005-05-11  Duncan Mak  <duncan@novell.com>
5344
5345         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
5346         continuing to process for 'arg'.
5347         (handle_preprocessing_directive): Check the argument of the #endif
5348         directive and report error CS1025 if there are any trailing
5349         characters.
5350
5351         According to the C# spec, having even whitespace after the #endif
5352         directive is illegal; however, because we call arg.TrimEnd ()
5353         beforehand, we have the same behavior as csc, allowing whitespace
5354         after the directive.
5355
5356         Fixes #74892.
5357
5358 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
5359
5360         Fix #74863.
5361         
5362         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
5363         (Constructor.GetObsoleteAttribute): Implemented correctly.
5364
5365 2005-05-10  Martin Baulig  <martin@ximian.com>
5366
5367         * support.cs (ReflectionParameters.ParameterModifier): Use
5368         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
5369         and `ParameterAttributes.In'.  Fixes #74884.
5370
5371 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
5372
5373         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
5374         
5375         * expression.cs (Argument.GetParameterModifier): Turned to property.
5376         (Invocation.Error_InvalidArguments): Add more descriptive errors.
5377         
5378         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
5379         its C# equivalent.
5380         
5381 2005-05-09  Raja R Harinath  <rharinath@novell.com>
5382
5383         Fix #74852.
5384         * decl.cs (MemberCache.AddMethods): Register override methods,
5385         rather than non-override methods.
5386         * typemanager.cs (RegisterOverride): New.
5387         (IsOverride): Update.
5388
5389 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
5390
5391         Fix #73105.
5392         
5393         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
5394         recursive declaration.
5395         
5396         * statement.cs (Block.ResolveMeta): Report any error in resolving.
5397         
5398 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
5399
5400         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
5401         
5402         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
5403
5404 2005-05-05  Raja R Harinath  <rharinath@novell.com>
5405
5406         Fix #74797.
5407         * decl.cs (DeclSpace.FamilyAccessible): 
5408         Use TypeManager.IsNestedFamilyAccessible.
5409
5410         Fix reopened #64812.
5411         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
5412         internal'.
5413
5414 2005-05-04  Raja R Harinath  <rharinath@novell.com>
5415             Abin Thomas  <projectmonokochi@rediffmail.com>
5416             Anoob V E  <projectmonokochi@rediffmail.com>
5417             Harilal P R  <projectmonokochi@rediffmail.com>
5418
5419         Fix #64812.
5420         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
5421         allow access to all static members.
5422
5423 2005-05-04  Martin Baulig  <martin@ximian.com>
5424
5425         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
5426
5427 2005-05-04  Martin Baulig  <martin@ximian.com>
5428
5429         Fix #74655.
5430
5431         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
5432         section at the end; make things work if `default' is not the last
5433         section.        
5434
5435 2005-05-04  Martin Baulig  <martin@ximian.com>
5436
5437         Fix #70400.
5438
5439         * statement.cs (Switch): Replaced the `got_default' field with a
5440         `default_section' one.
5441         (Switch.CheckSwitch): Set `default_section' here.
5442         (Switch.Resolve): If we're a constant switch and the constant is
5443         not found, use the default section.
5444
5445 2005-05-03  Martin Baulig  <martin@ximian.com>
5446
5447         * expression.cs (ArrayAccess.EmitGetLength): New public method.
5448
5449         * statement.cs (Foreach.ArrayForeach): New nested class.
5450         (Foreach.TemporaryVariable): New nested class.
5451         (Foreach.EmitArrayForeach): Removed; this is now in the new
5452         ArrayForeach class.
5453
5454 2005-05-03  Raja R Harinath  <rharinath@novell.com>
5455
5456         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
5457         more conservative.
5458         (VerifyPendingMethods): Revert change below.
5459
5460         * typemanager.cs (IsOverride, RegisterNonOverride): New.
5461         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
5462         that used to trigger warning -28.  Remove warning -28.
5463         * expression.cs (Invocation.OverloadResolve): Use
5464         TypeManager.IsOverride to distinguish override methods.
5465
5466         Fix #74773.
5467         * pending.cs (VerifyPendingMethods): If a base type implements the
5468         requested interface, don't bother checking individual methods of
5469         the base type.  As a side-effect, this prevents the creation of
5470         unnecessary proxies.
5471
5472 2005-05-02  Martin Baulig  <martin@ximian.com>
5473
5474         Fix #70182.
5475
5476         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5477         Also `And' the locals if the old vector is null.
5478         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
5479         null; in this case we basically reset all the variables.        
5480
5481 2005-05-02  Martin Baulig  <martin@ximian.com>
5482
5483         Fix #74529.
5484
5485         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
5486         Added `FlowBranching branching' argument; always `and' the
5487         variables instead of `or'ing them unless we're an infinite loop.
5488
5489         * statement.cs (While.Resolve): Create a new sibling unless we're
5490         infinite.       
5491
5492 2005-05-02  Martin Baulig  <martin@ximian.com>
5493
5494         Fix #70140.
5495
5496         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
5497         arguments; use it instead of creating a new TopLevelBlock.
5498         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
5499         our ConstructorInitializer.
5500
5501         * statement.cs
5502         (TopLevelBlock.TopLevelBranching): New public property.
5503         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
5504         and create our `TopLevelBranching'.
5505
5506         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
5507         anonymous method host, use `block.TopLevelBranching' rather than
5508         creating a new branching.
5509
5510 2005-04-20  Miguel de Icaza  <miguel@novell.com>
5511
5512         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
5513         a ScopeInfo, if any of the current children is a child of the new
5514         entry, move those children there.
5515
5516 2005-04-30  Martin Baulig  <martin@ximian.com>
5517
5518         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
5519         at the beginning of a SwitchSection.  Fix #73335.
5520
5521 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
5522
5523         Fix #74378
5524         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
5525         
5526         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
5527         (FieldExpr.DoResolve): Obsolete members are ignored for field
5528         initializers.
5529         
5530 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
5531
5532         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
5533         of arrays detection.
5534
5535         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
5536         verification.
5537         (Field.VerifyClsCompliance): Volatile fields are not compliant.
5538
5539         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
5540         arrays report.
5541
5542 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
5543
5544         * cs-parser.jay: Use the prefered version of -unsafe in error
5545         message.
5546
5547 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
5548
5549         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
5550         circumstances.
5551
5552 2005-04-20  John Luke  <john.luke@gmail.com>
5553
5554         * driver.cs: fix typo in error message, --outout to --output
5555
5556 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
5557
5558         * codegen.cs (InRefOutArgumentResolving): New field.
5559         
5560         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
5561         fields outside contructor.
5562         
5563         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
5564         
5565 2005-04-19  Miguel de Icaza  <miguel@novell.com>
5566
5567         * anonymous.cs (CaptureContext.EmitParameterInstance): The
5568         parameter code was not completed ever, so it was not as up-to-date
5569         as local variables.  Must finish it.
5570
5571         The bug fix was to compare the Toplevel of the block, not the
5572         current block.  Thanks for Ben for pointing this out. 
5573
5574 2005-04-19  Raja R Harinath  <rharinath@novell.com>
5575
5576         * decl.cs (AddMethods): Use the declaring type of the problem
5577         method to determine if we want to squash a warning.
5578
5579 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
5580
5581         * attribute.cs: Removed debug output.
5582
5583         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
5584         
5585         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
5586         Report.Stderr.
5587         
5588 2005-04-18  Raja R Harinath  <rharinath@novell.com>
5589
5590         Fix #74481.
5591         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
5592         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
5593         all null comparisons against reference types.
5594
5595 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
5596
5597         Fix# 74565
5598         * class.cs (TypeContainer.CircularDepException) New nested
5599         exception class.
5600         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
5601         (TypeContainer.DefineType): Removed error, reset InTransit before
5602         exit.
5603         (Class.DefineType): Throw exception when is in Transit.
5604         Catch exception and report error.
5605         (Struct.DefineType): Throw exception when is in Transit.
5606         Catch exception and report error.
5607         (Interface.DefineType): Throw exception when is in Transit.
5608         Catch exception and report error.
5609
5610         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
5611         handle nested exception handlers.
5612
5613         * flowanalysis.cs (InTryWithCatch): New method, search for try with
5614         a catch.
5615
5616         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
5617         InFinally and InCatch storage.
5618
5619         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
5620         (Catch.Resolve): Set and Restore ec.InCatch.
5621         (Try.Resolve): Set and Restore ec.InFinally.
5622         (Try.HasCatch): True when try has catch.
5623
5624 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
5625
5626         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
5627           for the same event member, so exclude such cases from warning 419.
5628           Fixed bug #74633.
5629
5630 2005-04-16  Miguel de Icaza  <miguel@novell.com>
5631
5632         * expression.cs (Binary.ResolveOperator): Apply patch from John
5633         Luke to fix bug 59864: operators &, | and ^ on enumerations
5634         require that the same enum type on both sides.
5635
5636         * driver.cs: Add warnings to old flag usage, this is to assist
5637         people who produce Makefiles and hope that the Makefiles will be
5638         used on Windows.
5639
5640         * class.cs (TypeContainer.EmitType): Moved the definition of the
5641         special $PRIVATE$ field from the resolve phase to the Emit phase.
5642         During resolve we do not know if we are a struct with
5643         HasExplicitLayout, we know this only after the attributes for the
5644         type are emitted.
5645
5646         Set the FieldOffset to zero on the dummy field that we create for
5647         the class.   Fixes 74590.
5648
5649 2005-04-16  Raja R Harinath  <rharinath@novell.com>
5650
5651         Fix #73834.
5652         * ecore.cs (PropertyExpr.resolved): New.
5653         (DoResolve): Use it to handle a case of double resolution here.
5654         Handle a case of identical-name-and-type-name.
5655         * expression.cs (ArrayCreation.CheckIndices): Avoid double
5656         resolution by storing the results of expression resolution back
5657         into the "probes" array.
5658
5659 2005-04-15  Raja R Harinath  <rharinath@novell.com>
5660
5661         Fix cs0208-7.cs and cs0208-8.cs.
5662         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
5663         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
5664         error reporting to point out the reason a struct is not unmanaged.
5665
5666 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5667
5668         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
5669           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
5670
5671 2005-04-13  Raja R Harinath  <rharinath@novell.com>
5672
5673         Fix #74528.
5674         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
5675         IdenticalNameAndTypeName here.
5676         (EventExpr.InstanceResolve): Likewise.
5677
5678 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
5679
5680         C# 2.0 DefaultCharSetAttribute implementation
5681         
5682         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
5683         which allows us to set GlobalNamespace for every resolve.
5684         (Attribute.ResolveArguments): Cut from Resolve.
5685         (Attribute.GetCharSetValue): Returns CharSet named argument.
5686         (Attribute.DefinePInvokeMethod): Gets default charset from
5687         module settings.
5688         (GlobalAttribute.ResolveAsTypeStep): Override.
5689         (GlobalAttribute.ResolveArguments): Override.
5690         
5691         * class.cs (TypeAttr): Is protected.
5692         
5693         * codegen.cs (ModuleClass.DefaultCharSet): New member.
5694         (ModuleClass.DefaultCharSetType): New memeber.
5695         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
5696         
5697         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
5698         charset from module.
5699         
5700         * delegate.cs (TypeAttr): Override.
5701         (Delegate.DefineType): Use this TypeAttr.
5702         
5703         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
5704         at very early stage (before types are defined) to resolve model
5705         module attributes. It will probably not work with corlib but it
5706         should be ok.
5707         
5708         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
5709         charset from module.
5710         
5711         * typemanager.cs (default_charset_type): New type.
5712
5713 2005-04-13  Raja R Harinath  <rharinath@novell.com>
5714
5715         * decl.cs (MemberCache.AddMethods): Don't warn if
5716         System.Object.Finalize has buggy MethodAttributes.
5717
5718         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
5719         removed below.
5720
5721 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5722
5723         * doc.cs : detect ambiguous reference to overloaded members.
5724           Fixed bug #71603. MS 1.1 csc does not detect it.
5725
5726 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5727
5728         * doc.cs : delegates must not be referenced with parameters.
5729           Fixed bug #71605.
5730
5731 2005-04-12  Miguel de Icaza  <miguel@novell.com>
5732
5733         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
5734
5735 2005-04-10  Miguel de Icaza  <miguel@novell.com>
5736
5737         * driver.cs (MainDriver): Stop processing if the CLS stage found
5738         errors. 
5739
5740         (CompilerCallableEntryPoint.InvokeCompiler): Always
5741         reset after execution;   Take a TextWriter argument for the
5742         output.
5743
5744         * report.cs: Use the error stream instead of hardcoding stderr. 
5745
5746 2005-04-09  Miguel de Icaza  <miguel@novell.com>
5747
5748         * class.cs: Reduce code paths to test, too small of an
5749         optimization to make it worth the extra testing.  Always perform
5750         it. 
5751
5752 2005-04-08  Raja R Harinath  <rharinath@novell.com>
5753
5754         Fix #74510.
5755         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
5756         operators that had errors reported on them.
5757
5758 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
5759
5760         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
5761         argument types.
5762         (Attribute.Resolve): Add named argument type checking.
5763         
5764         * class.cs (FixedField.Define): Use IsPrimitiveType
5765         
5766         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
5767         
5768         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
5769         unsafe parameter types.
5770         
5771         * statement.cs (Using.ResolveExpression): Add better error description.
5772         
5773         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
5774         
5775 2005-04-08  Raja R Harinath  <rharinath@novell.com>
5776
5777         Fix #74484.
5778         * attribute.cs (Attribute.GetAttributeUsage): Resolve
5779         AttributeUsageAttribute in the emitcontext of the attribute class,
5780         not in the emitcontext of the attributable entity it was attached to.
5781         * cs-parser.jay: Use 'current_class', not 'current_container',
5782         when creating a GlobalAttribute.
5783
5784 2005-04-08  Alp Toker  <alp@atoker.com>
5785
5786         * pending.cs: The fix to #58413 failed to compile methods implementing
5787         interfaces with/without params modifiers and vice versa, even though
5788         params modifiers aren't part of the signature. Make the modifier check
5789         less strict as in csc.
5790
5791 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
5792             Anoob V E  <projectmonokochi@rediffmail.com>
5793             Harilal P R  <projectmonokochi@rediffmail.com>
5794
5795         Fix #58413.
5796         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
5797         modifiers of pending methods.
5798         (PendingImplementation.PendingImplementation): Initialize it.
5799         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
5800         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
5801         with ParameterData.  Add check for modifiers.
5802         * class.cs (MethodData.Define): Update to changes.
5803
5804 2005-04-07  Raja R Harinath  <rharinath@novell.com>
5805
5806         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
5807
5808 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
5809
5810         * class.cs (PropertyMethod.Define): Check private accessor in abstract
5811         property.
5812         
5813         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
5814         
5815         * rootcontext.cs,
5816         * typemanager.cs: Registered RequiredAttributeAttribute.
5817         
5818 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
5819
5820         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
5821         Warning CS0169 is back at level 3.
5822         (IMethodData.SetMemberIsUsed): New method.
5823         
5824         * decl.cs (IsUsed): New value; moved from FieldBase.Status
5825         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
5826         
5827         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
5828
5829         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
5830         contants.
5831         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
5832         is used.
5833         
5834         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
5835         is used.
5836         
5837         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
5838         to avoid the problems with nested types.
5839
5840 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
5841             Anoob V.E  <projectmonokochi@rediffmail.com>
5842             Harilal P.R  <projectmonokochi@rediffmail.com>
5843             Raja R Harinath  <rharinath@novell.com>
5844
5845         Fix #73820.
5846         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
5847         attribute.
5848         * typemanager (GetConstructor): Make public.
5849
5850 2005-04-05  John Luke  <john.luke@gmail.com>
5851             Raja R Harinath  <rharinath@novell.com>
5852
5853         Fix #62232.
5854         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
5855         struct too.  Return false quicker in a few cases.
5856         (VerifyUnManaged): Use it.
5857
5858 2005-04-05  Raja R Harinath  <rharinath@novell.com>
5859
5860         Fix #74041.
5861         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
5862         not 'unreachable_seen'.
5863
5864 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
5865
5866         * attribute.cs (Attribute.GetValue): Removed unused.
5867         
5868         * codegen.cs (CodeGen.TrimExt): Removed unused.
5869         
5870         * cs-parser.jay (output): Removed unused.
5871         
5872         * cs-tokenizer.cs (hex_digits): Removed unused.
5873         
5874         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
5875         
5876         * expression.cs (Indirection.LoadExprValue): Removed unused.
5877         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
5878         
5879         * iterators.cs (Iterator.param_types): Removed unused.
5880         
5881         * statement.cs (Goto.block): Removed unused.
5882         (ToplevelBlock.did): Removed unused.
5883         (Switch.ResolveConstantSwitch): Removed unused.
5884
5885 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
5886
5887         * rootcontext.cs: Allow mcs to bootstrap with the compilation
5888         resetting thingy.
5889
5890 2005-04-01  Raja R Harinath  <rharinath@novell.com>
5891
5892         Fix #74232 and cs0208-3.cs.
5893         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
5894         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
5895         unmanaged type.  Don't use FieldBuilders when 't' is a
5896         TypeBuilder.  Use ModFlags and MemberType fields.
5897         * class.cs (MemberBase.member_type): Rename from MemberType.
5898         (MemberBase.MemberType): New property.  Determines member_type on
5899         demand.
5900         (MemberBase.DoDefine): Don't initialize MemberType here.
5901         (FieldMember.Define): Likewise.
5902
5903 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
5904
5905         Fix #74241
5906         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
5907         Attributes are emitted there.
5908         
5909 2005-04-01  Raja R Harinath  <rharinath@novell.com>
5910
5911         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
5912         keyword in 'partial enum' too.
5913         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
5914         is not allowed).
5915         Report from Kamil Skalski <nazgul@omega.pl>.
5916
5917         Fix #74309.
5918         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
5919         have partial containers too.
5920
5921         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
5922         in block' checks to Block.CheckInvariantMeaningInBlock.
5923         * statement.cs (Block.GetKnownVariableInfo): Make private.
5924         (Block.IsVariableUsedInChildBlock): Remove.
5925         (Block.IsVariableUsedInBlock): Likewise.
5926         (Block.CheckInvariantMeaningInBlock): New.  Show location of
5927         conflicting declaration.
5928         (Block.AddVariable): Make error messages less long-winded and more
5929         specific.  Show location of conflicting declaration.
5930         * parameter.cs (Parameters.Location): New readonly property.
5931
5932 2005-03-31  Raja R Harinath  <rharinath@novell.com>
5933
5934         Clean up semantics of invoking ResolveMemberAccess.
5935         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
5936         can have an instance, ensure that we pass in a non-TypeExpression
5937         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
5938         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
5939         argument.  Update to changes and simplify.
5940         (FieldExpr.Emitinstance): Remove CS0120 check.
5941         (PropertyExpr.EmitInstance): Likewise.
5942         * expression.cs (Argument.Resolve): Likewise.
5943         (Invocation.DoResolve): Update to changes in semantics of
5944         InstanceExpression.
5945
5946 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
5947
5948         Fix #74241
5949         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
5950         customization.
5951         
5952         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
5953
5954 2005-03-31  Raja R Harinath  <rharinath@novell.com>
5955
5956         Fix difference in behaviour with commandline invocation.
5957         * driver.cs (Driver.Reset): New.
5958         (CompilerCallableEntryPoint): Call it.
5959
5960         * statement.cs (If.Resolve): Avoid spurious "uninitialized
5961         variable" warnings if the boolean expression failed to resolve.
5962
5963 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
5964
5965         * attribute.cs: Fix the union of several permissions when some of them
5966         are unrestricted (so the result isn't an unrestricted permission set).
5967         Fix #74036.
5968
5969 2005-03-30  Raja R Harinath  <rharinath@novell.com>
5970
5971         * ecore.cs (MemberExpr): New class.  Convert from interface
5972         IMemberExpr.
5973         (MemberExpr.ResolveMemberAccess): Refactor and move here from
5974         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
5975         error checks.
5976         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
5977         (MethodGroupExpr.IsExplicitImpl): Remove.
5978         (Expression.GetFieldFromEvent): Remove.
5979         (SimpleName.MemberStaticCheck): Remove.
5980         (SimpleName.DoSimpleNameResolve): Update to changes.
5981         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
5982         (MemberAccess.IdenticalNameAndTypeName): Remove.
5983         (MemberAccess.error176): Move to MemberExpr.
5984         (MemberAccess.DoResolve): Update to changes.
5985         (BaseAccess.DoResolve): Likewise.
5986
5987 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
5988
5989         C# 2.0 Conditional attribute class implementation
5990         
5991         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
5992         Analyzes class whether it has attribute which has ConditionalAttribute
5993         and its condition is not defined.
5994         
5995         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
5996         (Class.IsExcluded): New method. Search for at least one defined
5997         condition in ConditionalAttribute of attribute class.
5998
5999 2005-03-30  Raja R Harinath  <rharinath@novell.com>
6000
6001         * ecore.cs (PropertyExpr): Derive from Expression, not
6002         ExpressionStatement.
6003         (PropertyExpr.EmitStatement): Remove.
6004
6005 2005-03-29  Raja R Harinath  <rharinath@novell.com>
6006
6007         Fix #74060.
6008         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
6009         internal field "value__" of an enum be private.  The examples for
6010         "value__" that I found on MSDN all used FieldAttributes.Private.
6011
6012         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
6013         Don't mention IL method attribute names.
6014
6015         Fix #47991.  Remove a TODO.
6016         * statement.cs (Block.Toplevel): Make into a field.
6017         (Block.Parameters): Move into ToplevelBlock.
6018         (Block.known_variables): Rename from child_variable_names.
6019         (Block.Block): Remove variants that take Parameters.  Initialize
6020         'Toplevel' with the immediately surrounding toplevel block.
6021         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
6022         LocalInfo parameter.
6023         (Block.GetKnownVariableInfo): New.
6024         (Block.IsVariableNameUsedInChildBlock): Update.
6025         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
6026         the block, even though it may not be in scope.
6027         (Block.AddVariable): Remove Parameters parameter.  Use
6028         Toplevel.Parameters instead.
6029         (Block.AddConstant): Remove Parameters parameter.
6030         (Block.GetParameterReference): Update to use Toplevel.Parameters.
6031         (Block.IsParamaterReference): Likewise.
6032         (Block.IsLocalParameter): Likewise.  Simplify a lot.
6033         (ToplevelBlock.Parameters): New.  Moved from Block.
6034         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
6035         initialize Parameters to a non-null value.
6036         * cs-parser.jay: Update to changes.
6037         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
6038         simple names that mean different things in the same block.  Use
6039         Block.IsVariableNameUsedInBlock.
6040
6041 2005-03-28  Raja R Harinath  <rharinath@novell.com>
6042
6043         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
6044         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
6045         GetTypeHandle.  It is possible for a reflected type to derive from
6046         a TypeBuilder (e.g., int[] derives from the TypeBuilder
6047         System.Array during mscorlib compilation).
6048         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
6049         contain a method_hash, don't create one either.  Don't create a
6050         deep copy of the base cache's method_hash.
6051         (MemberCache.SetupCache): Rename back from DeepCopy.
6052         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
6053         already initialized.  If we see an override function, add its
6054         underlying base virtual function to the member_hash too.
6055
6056         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
6057
6058 2005-03-26  Raja R Harinath  <harinath@acm.org>
6059
6060         Fix #73038.
6061         * assign.cs (Assign.DoResolve): When the RHS of an assignment
6062         fails to resolve, ensure that the LHS is still resolved as an
6063         lvalue.
6064
6065 2005-03-25  Raja R Harinath  <harinath@acm.org>
6066
6067         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
6068         ec.ContainerType.
6069         (Enum.current_ec): Remove.
6070         (Enum.LookupEnumValue): Remove EmitContext argument.
6071         Just uses the one created during DefineType.
6072         (Enum.FindMembers): Update.
6073         * expression.cs (MemberAccess.DoResolve): Update.
6074
6075 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
6076
6077         * assign.cs (Assign.DoResolve): Check for CS1717 when
6078         source and target are same (uses Equals).
6079
6080         * expression.cs (LocalVariableReference, ParameterReference,
6081         This): Implemented Equals, GetHashCode.
6082
6083         * statement.cs (Block.GetParameterReference): Removed useless
6084         local variable.
6085
6086 2005-03-22  Raja R Harinath  <rharinath@novell.com>
6087
6088         Fix cs0128.cs
6089         * statement.cs (Block.AddVariable): Ensure that we skip implicit
6090         blocks before deciding whether the error is cs0136 or cs0128.
6091
6092         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
6093         (using_alias_directive, using_namespace_directive): Pass
6094         MemberName, not an expression to Namespace.UsingAlias and
6095         Namespace.Using.
6096         (MakeName): Use the MemberName of the namespace.
6097         * namespace.cs (Namespace.MemberName): New.
6098         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
6099         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
6100         Likewise.
6101         * decl.cs (MemberName.Name): Make readonly.
6102         (MemberName.FromDotted): New "constructor".
6103         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
6104         (MemberCore.Name): Compute from MemberName on demand.
6105         (MemberCore.SetMemberName): Provide a way to change the
6106         MemberName.
6107         (MemberCore.AddToContainer): Don't take a fullname parameter.
6108         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
6109         fully qualified name of the container to the member name.
6110         (TypeContainer.AddToTypeContainer): Use a fully qualified name
6111         only if the type is a member of the root container.
6112         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
6113         MemberName.Left rather than searching for an embedded ".".
6114         (PartialContainer.CreatePart): Update to changes in RootContext.
6115         (MemberBase.ShortName): Turn into a property.  Use
6116         MemberCore.SetMemberName.
6117         (MemberBase.ExplicitInterfaceName): Remove.
6118         (MemberBase.UpdateMemberName): Remove.
6119         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
6120         (PropertyBase.SetMemberName): New override.
6121         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
6122         (Tree.GetDecl): New.
6123         (Tree.AllDecls): Rename from Decls.
6124         * attribute.cs, enum.cs, report.cs: Update to changes.
6125         * driver.cs (MainDriver): Use MemberName.FromDotted on
6126         RootContext.MainClass.
6127
6128 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
6129
6130         * class.cs (FixedField.Define): Check for CS1664 and more sanity
6131         checks.
6132
6133         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
6134
6135 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
6136
6137         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
6138         property accessor modifiers.
6139
6140         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
6141         fixed buffer attribute (CS1716).
6142         (PropertyMethod.HasCustomAccessModifier): When property accessor
6143         has custom modifier.
6144
6145         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
6146         modifiers.
6147         (PropertyExpr.DoResolveLValue): Add CS0272.
6148
6149 2005-03-17  Miguel de Icaza  <miguel@novell.com>
6150
6151         * convert.cs: When converting to a pointer, use the proper Conv.U
6152         or Conv.I depending on the source data type.
6153
6154         * cs-tokenizer.cs: Make the size for large decimal constants,
6155         fixes #72957.
6156
6157 2005-03-17  Martin Baulig  <martin@ximian.com>
6158
6159         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6160         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
6161
6162 2005-03-17  Martin Baulig  <martin@ximian.com>
6163
6164         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6165         to bool so we can return an error condition.
6166         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6167         returned an error.
6168
6169 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
6170
6171         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
6172         attributes.
6173
6174 2005-03-16  Raja R Harinath  <rharinath@novell.com>
6175
6176         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
6177         Refactor to avoid traversing the list of assemblies, and to avoid
6178         string concatenation.
6179         * typemanager.cs (guid_attr_type): Remove.
6180         (negative_hits, pointers, references): Remove hashes.
6181         (type_hash): New.
6182         (GetConstructedType): New.  Uses type_hash to handle constructed
6183         types (arrays, references, pointers).
6184         (GetReferenceType, GetPointerType): Use it.
6185         (GetNestedType): New.  Uses type_hash to handle nested types of
6186         reflected types.
6187         (LookupType, LookupTypeDirect): Remove.
6188         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
6189         'types' hash and LookupTypeReflection directly.
6190         (params_string, params_object): Use GetConstructedType.
6191         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
6192         top-level types.
6193         (Namespace.Lookup): Use cached_types.
6194         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
6195         provided by old TypeManager.LookupType.
6196         * rootcontext.cs (MakeFQN): Remove.
6197         * decl.cs (DeclSpace.MakeFQN): Likewise.
6198         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
6199         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
6200         TypeManager.GetConstructedType.
6201         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
6202
6203 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
6204
6205         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
6206         indexers.
6207
6208         * cs-parser.jay: Reports CS1527 for any namespace element.
6209
6210         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
6211         Added CS0407.
6212
6213         * expression.cs (ParameterReference.IsAssigned): Changed error to
6214         CS0269.
6215         (Error_WrongNumArguments): Moved CS0245 detection here.
6216
6217         * statement.cs (Return.Resolve): Add CS1622 report.
6218
6219 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
6220
6221         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
6222
6223 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
6224
6225         * attribute.cs expression.cs: Get rid of some allocations.
6226
6227 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
6228
6229         * doc.cs : just eliminate the latest change.
6230
6231 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6232
6233         * doc.cs : commented out the latest change. It breaks xml-030.cs
6234
6235 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6236
6237         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
6238           fail. So invoke CreateType() in FindDocumentedType().
6239
6240 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6241
6242         * cs-tokenizer.cs : added IsKeyword().
6243         * doc.cs : Detect keyword incorrectly used as identifier.
6244           Allow identifiers prefixed by @.
6245
6246 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
6247
6248         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
6249         It caused exception in namespace resolving (again!).
6250         
6251         * class.cs (Class.ctor): Removed exit.
6252         (PropertyMethod.ctor): ditto.
6253         
6254         * codegen.cs (Codegen.Reset): Reset static data.
6255         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
6256         
6257         * cs-tokenizer.cs (Cleanup): Removed.
6258         
6259         * driver.cs (GetSystemDir): Rewrote to one line command.
6260         It caused problem with unloaded dynamic modules.
6261         (UnixParseOption): Removed Exit.
6262         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
6263         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
6264         Now can be mcs used as library.
6265         
6266         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
6267         empty location.
6268         
6269         * location.cs (Reset): Reset static data.
6270         
6271         * namespace.cs (Reset): Reset static data.
6272         
6273         * report.cs (Report.Reset): Reset static data.
6274         
6275         * rootcontext.cs (RootContext.Reset): Reset static data.
6276         
6277         * tree.cs (RootTypes.ctor): Use Location.Null
6278         
6279         * typemanager.cs (TypeManager.Reset): Reset static data.
6280         (CoreLookupType): Removed Exit.
6281         (TypeHandle.Reset): Reset static data.
6282         
6283 2005-03-10  Raja R Harinath  <rharinath@novell.com>
6284
6285         Fix #73516.
6286         * typemanager.cs (ComputeNamespaces): Import namespaces from
6287         referenced modules too.
6288
6289 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6290
6291         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
6292         than '.'.
6293
6294 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6295
6296         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
6297         enclosing DeclSpace.  This ensures that a name-lookup populates
6298         more caches and there are fewer 'TypeExpression's.  Carve out
6299         nested type lookup into ...
6300         (LookupNestedTypeInHierarchy): ... this.
6301
6302 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6303
6304         Clean up a few partial-class semantics.  
6305         Fixes test-357.cs and cs1618-2.cs.
6306         * cs-parser.jay (struct_declaration): Use 'current_class' as
6307         parent of newly-created struct.  Remove call to Register ().
6308         Use 'pop_current_class' to complete handing the current struct.
6309         (interface_declaration): Likewise.
6310         (class_declaration): Likewise.
6311         (enum_declaration): Use 'current_class' as parent of newly created
6312         enum.
6313         (delegate_declaration): Likewise.
6314         (pop_current_class): New function.  This is used to handle closing
6315         up the 'current_class' and 'current_container', and pointing them
6316         to the enclosing class/container.
6317         (CSharpParser): Initialize 'current_class' too.
6318         * decl.cs (MemberCore): Add check for invariant: a partial
6319         container is not a parsed entity, and thus does not enclose any
6320         parsed members.
6321         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
6322         (DeclSpace.BaseTypeExpr): Use it.
6323         (DeclSpace.LookupType): Add check for invariant.
6324         * class.cs (TypeContainer): Add check for invariant: a nested
6325         class should have the same NamespaceEntry as its enclosing class.
6326         (TypeContainer.EmitFieldInitializers): Make virtual.
6327         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
6328         MemberCore.
6329         (TypeContainer.Register): Remove.
6330         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
6331         null.  Use TypeResolveEmitContext for resolving base types and
6332         interfaces.  Move initialization of Parts.TypeBuilder here from
6333         ...
6334         (TypeContainer.DefineNestedTypes): ... here.
6335         (PartialContainer): Take a Namespace not a NamespaceEntry.
6336         (PartialContainer.Create): Don't use Register.  Call the
6337         appropriate Add... function directly.
6338         (ClassPart): Take both the PartialContainer and the enclosing
6339         class as constructor arguments.
6340         (ClassPart.EmitFieldInitializers): Override.
6341         (ClassPart.PartFindNestedTypes): Remove.
6342         (FieldBase.GetInitializerExpression): Resolve the initializer
6343         expression in the emit context of the enclosing class.
6344         * tree.cs (RootTypes): Remove Register ().
6345         
6346 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
6347
6348         * cs-parser.jay: Removed CS0134.
6349         
6350         * driver.cs: Removed CS1901.
6351         
6352         * expression.cs (SizeOf.DoResolve): Don't report CS0233
6353         for predefined types.
6354
6355 2005-03-07  Duncan Mak  <duncan@novell.com>
6356
6357         * codegen.cs (Save):  Catch UnauthorizedAccessException as
6358         well. Fixes bug #73454.
6359
6360 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
6361
6362         * cs-tokenizer.cs (xtoken): Add CS1035.
6363         
6364         * class.cs (MethodData.Define): Add CS0683.
6365         (FieldMember.ctor): Add CS0681.
6366
6367 2005-03-07  Raja R Harinath  <rharinath@novell.com>
6368
6369         * ecore.cs (SimpleName.DoResolve): Rename from
6370         SimpleName.DoResolveAllowStatic.
6371         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
6372         Pass 'intermediate' flag to MemberStaticCheck.
6373         (SimpleName.MemberStaticCheck): Skip "static check" only in case
6374         of "intermediate" lookups via MemberAccess.
6375         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
6376         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
6377
6378 2005-03-07  Raja R Harinath  <rharinath@novell.com>
6379
6380         Fix #73394.
6381         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
6382         slipped in because of variable names that are identical to a
6383         builtin type's BCL equivalent ('string String;', 'int Int32;').
6384         (PropertyExpr.EmitInstance): Likewise.
6385
6386 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
6387
6388         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
6389         
6390         * report.cs (warning_ignore_table): Made public.
6391
6392 2005-03-04  Raja R Harinath  <rharinath@novell.com>
6393
6394         Fix #73282.
6395         * class.cs (MethodData.Emit): Pass 'container' to
6396         container.GetObsoleteAttribute instead of 'container.Parent'.
6397
6398 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
6399
6400         * cs-parser.jay: Add 1534 error test.
6401
6402         * iterators.cs (Yield.CheckContext): Add error 1629.
6403         (Iterator.ctor): Save unsafe modifier.
6404         (MoveNextMethod.DoEmit): Restore unsafe context.
6405
6406         * namespace.cs (UsingAlias): Better error message.
6407
6408 2005-03-03  Dan Winship  <danw@novell.com>
6409
6410         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
6411         the warning message [#73219]
6412
6413 2005-03-03  Raja R Harinath  <rharinath@novell.com>
6414
6415         Fix compile with MCS 1.0.0.0.
6416         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
6417         w_restore to not depend on string constant folding.
6418
6419 2005-03-03  Raja R Harinath  <rharinath@novell.com>
6420
6421         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
6422         CS0246 check to users who passed 'silent = false'.
6423         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
6424         check.
6425         (SimpleName.SimpleNameResolve): Update.
6426         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
6427         (MemberAccess.IdenticalNameAndTypeName): Update.
6428         * doc.cs (FindDocumentedTypeNonArray): Update.
6429
6430 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
6431
6432         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
6433         * parameters.cs (ComputeAndDefineParameters): Remove.
6434         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
6435         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
6436         Use GetParameterInfo.
6437
6438 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
6439
6440         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
6441
6442 2005-03-02  Raja R Harinath  <rharinath@novell.com>
6443
6444         Unify DeclSpace.LookupType and DeclSpace.FindType.
6445         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
6446         is in charge of defining nested types on demand.
6447         (DeclSpace.LookupType): Use it when the current_type is a
6448         TypeBuilder.  Use LookupTypeDirect for reflected types.
6449         (DeclSpace.FindType): Remove.
6450         (DeclSpace.LookupInterfaceOrClass): Likewise.
6451         (DeclSpace.DefineTypeAndParents): Likewise.
6452         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
6453         DeclSpace.LookupType.
6454         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
6455         * typemanager.cs (LookupType): Simplify.
6456         (AddUserType): Remove type from negative_hits.
6457         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
6458         * class.cs (TypeContainer.FindMembers): Move handling of nested
6459         types ...
6460         (TypeContainer.FindMembers_NestedTypes): ... here.
6461         (TypeContainer.FindNestedType): Implement override.
6462         (ClassPart.FindNestedType): Delegate to PartialContainer.
6463         (ClassPart.PartFindNestedType): Looks up the nested types of the
6464         part alone.
6465
6466 2005-03-02  Martin Baulig  <martin@ximian.com>
6467
6468         * class.cs (TypeContainer.DoDefineMembers): We also need a default
6469         static constructor in static classes.
6470
6471 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
6472
6473         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
6474         sizeParamIndex is not specified.
6475
6476 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
6477
6478         Fix #73117
6479         * report.cs (WarningMessage.IsEnabled): Missing null check.
6480
6481 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6482
6483         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
6484         in the fields and not in the properties.
6485
6486 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
6487
6488         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
6489         fields as well.
6490
6491 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6492
6493         * attribute.cs: Small refactoring (improved robustness).
6494         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
6495         (ValidateGuid): Removed.
6496         (Resolve): Removed referenced to above mentioned.
6497         (GetAttributeUsage): Made private and changed to work without
6498         class assistance.
6499         (GetIndexerAttributeValue): Don't crash.
6500         (GetConditionalAttributeValue): Ditto.
6501         (GetClsCompliantAttributeValue): Ditto.
6502         (ExtractSecurityPermissionSet): All attributes exceptions are
6503         error 648.
6504         (GetPropertyValue): New helper.
6505         (GetMethodImplOptions): New method.
6506         (DefinePInvokeMethod): Reuse common code. Implemented handling of
6507         some missing properties.
6508         
6509         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
6510         (Method.ApplyAttributeBuilder): Updated.
6511         
6512         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
6513         exception.
6514
6515 2005-02-28  Raja R Harinath  <rharinath@novell.com>
6516
6517         Fix #73052.
6518         * report.cs (Report.SymbolRelatedToPreviousError): Handle
6519         non-simple types (array, pointer, reference).
6520
6521 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6522
6523         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
6524
6525         * class.cs (MethodCore.IsDuplicateImplementation): Special error
6526         for operators.
6527         (Method.CheckBase): Catch wrong destructor here.
6528         (MethodData.Define): Add errors 550, 668.
6529
6530         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
6531
6532         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
6533
6534         * pending.cs (VerifyPendingMethods): Add error 551.
6535
6536         * typemanager.cs (CSharpName): Next error report helper.
6537
6538 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
6539
6540         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
6541         attributes. Removed useless attribute double check.
6542         It saves almost 2MBs for corlib.
6543
6544 2005-02-25  Raja R Harinath  <rharinath@novell.com>
6545
6546         Fix #72924.
6547         * statement.cs (ExpressionStatement.Resolve): Make robust to being
6548         called twice in case of error.
6549
6550 2005-02-23  Chris Toshok  <toshok@ximian.com>
6551
6552         Fix compiler portions of #72827.
6553         * statement.cs (Block.Emit): call Begin/EndScope on the
6554         EmitContext instead of the ILGenerator.
6555
6556         * codegen.cs (EmitContext.BeginScope): new method, call
6557         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
6558         we have one.)
6559         (EmitContext.BeginScope): same, but EndScope and CloseScope
6560
6561         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
6562         offset and call the superclass's OpenScope(int) with it.
6563         (SymbolWriter.CloseScope): get the current il
6564         offset and call superclass's CloseScope(int) with it.
6565
6566 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
6567
6568         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
6569         CS1677 for out and ref as well.
6570
6571         * class.cs (Method.Define): Add error CS1599 detection.
6572         
6573         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
6574         
6575         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
6576         
6577         * delegate.cs (Delegate.Define): Add error CS1599 detection.
6578         
6579         * support.cs.cs (ModifierDesc): New helper method.
6580
6581 2005-02-23  Raja R Harinath  <rharinath@novell.com>
6582             Abin Thomas  <projectmonokochi@rediffmail.com>
6583             Anoob V E  <projectmonokochi@rediffmail.com>
6584             Harilal P R  <projectmonokochi@rediffmail.com>
6585
6586         Fix #57851, #72718.
6587         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
6588         MemberLookup (used for error reporting) actually returns a result.
6589         Fix error report number (122, not 112).
6590
6591 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
6592             Anoob V E  <projectmonokochi@rediffmail.com>
6593             Harilal P R  <projectmonokochi@rediffmail.com>
6594
6595         Fix #71134.
6596         * pending.cs (PendingImplementation.GetAbstractMethods):
6597         Find NonPublic members too.
6598
6599 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
6600
6601         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
6602         Fixed error 217.
6603         
6604         * class.cs (MethodCore.CheckMethodAgainstBase):
6605         Add error 239 report.
6606
6607 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6608
6609         Fix #68955.
6610         * expression.cs (Invocation.IsApplicable): Make public.
6611         (Invocation.IsParamsMethodApplicable): Likewise.
6612         * delegate.cs (Delegate.VerifyApplicability): Don't use
6613         Invocation.VerifyArgumentCompat for parameter applicability
6614         testing.  Use Invocation.IsApplicable and
6615         Invocation.IsParamsMethodApplicable.
6616
6617 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6618
6619         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6620         
6621         * class.cs (Operator.Define): Add error 217 report.
6622         
6623 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6624
6625         * namespace.cs (UsingEntry.Resolve): Undo change below.
6626
6627 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6628
6629         Fix #72756.
6630         * ecore.cs (Expression.MemberLookupFailed): Add argument to
6631         disable the error message when the extended MemberLookup also
6632         fails.
6633         (Expression.MemberLookupFinal): Update.
6634         (SimpleName.DoSimpleNameResolve): Update.
6635         * expression.cs (MemberAccess.ResolveNamespaceOrType):
6636         Don't use MemberLookupFinal.
6637         (New.DoResolve): Update.
6638         (BaseAccess.CommonResolve): Update.
6639
6640 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6641
6642         Fix #72732.
6643         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
6644         occured previously, don't resolve again.
6645
6646 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6647
6648         Fix #69949
6649         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
6650         argument. Call ResolveAttributeUsage for unresolved.
6651         when types doesn't match ctor arguments.
6652         
6653         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
6654         for nested attribute classes.
6655         (Class.attribute_usage): Removed.
6656         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
6657         for attribute class.
6658         
6659         * ecore.cs (IsAttribute): Removed.
6660         
6661         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
6662         
6663         * rootcontext.cs (RegisterAttribute): Removed, attributes are
6664         now normal types.
6665         (attribute_types): Removed.
6666         (EmitCode): Global attributes are emited as the latest.
6667
6668 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
6669
6670         * class.cs (EmitFieldInitializers): Don't emit field initializer
6671         for default values when optimilization is on.
6672         
6673         * constant.cs (Constant.IsDefaultValue): New property.
6674         
6675         * driver.cs: Add /optimize handling.
6676         
6677         * constant.cs,
6678         * ecore.cs,
6679         * literal.cs: Implement new IsDefaultValue property.
6680         
6681         * rootcontext.cs (Optimize): New field, holds /optimize option.
6682
6683 2005-02-18  Raja R Harinath  <rharinath@novell.com>
6684
6685         Fix crasher in re-opened #72347.
6686         * namespace.cs (Namespace.Lookup): Return null if
6687         DeclSpace.DefineType returns null.
6688
6689         Fix #72678.
6690         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
6691
6692 2005-02-18  Raja R Harinath  <rharinath@novell.com>
6693
6694         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
6695         now returns null if it cannot resolve to an lvalue.
6696         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
6697         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
6698         returned null.  Remove check for SimpleName.
6699         (EventExpr.DoResolveLValue): New.
6700         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
6701         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
6702         error from ...
6703         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
6704         avoid CS0131 error.
6705         (Unary.ResolveOperator): Move CS0211 check ...
6706         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
6707         CS0131 error.
6708         (Unary.DoResolveLValue): Simplify.
6709         (AddressOf.DoResolveLValue): New.
6710         (ArrayAccess.DoResolveLValue): New.
6711
6712 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
6713
6714         * attribute.cs (Attribute.Resolve): Add arguments casting for
6715         when types doesn't match ctor arguments.
6716
6717 2005-02-16  Raja R Harinath  <rharinath@novell.com>
6718
6719         Fix parts of #63202.
6720         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
6721         lookup of operator in base type.  Ensure that all checks happen
6722         when the operator resolves to an "op_..." method.
6723
6724 2005-02-15  Raja R Harinath  <rharinath@novell.com>
6725
6726         Fix #71992.
6727         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
6728         'ignore_cs0104' parameter.  Pass it to ...
6729         (NamespaceEntry.Lookup): ... this.
6730         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
6731         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
6732         (TypeLookupExpression.DoResolveAsTypeStep): Update.
6733         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
6734         Update.  Request that cs0104 errors be ignored.
6735         (ComposedCast.ResolveAsTypeStep): Update.
6736
6737 2005-02-14  Raja R Harinath  <rharinath@novell.com>
6738
6739         Fix #59209.
6740         * expression.cs (Invocation.BetterFunction): Remove support for
6741         comparing virtual functions and their overrides.
6742         (Invocation.IsOverride): New.
6743         (Invocation.OverloadResolve): Don't consider 'override' functions
6744         during candidate selection.  Store them in a lookaside list.
6745         If the selected method is a 'virtual' function, use the list to
6746         find any overrides that are closer to the LHS type.
6747
6748 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
6749
6750         * expression.cs (New.DoResolve): Add complex core type reduction.
6751         (New.Constantify): Converts complex core type syntax like 'new int ()'
6752         to simple constant.
6753         
6754 2005-02-14  Raja R Harinath  <rharinath@novell.com>
6755
6756         * decl.cs (EntryType.EntryType): New constructor to create an
6757         updated copy of a cache entry.
6758         (MemberCache.AddMethods): Use it.
6759         (MemberCache.ClearDeclaredOnly): Remove.
6760         (MemberCache.MemberCache): Update.
6761
6762 2005-02-11  Miguel de Icaza  <miguel@novell.com>
6763
6764         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
6765         variable.  This one is represents the actual low-level declaration
6766         of the method, as opposed to the semantic level `IsStatic'.   
6767
6768         An anonymous method which is hosted into a static method might be
6769         actually an instance method.  IsStatic would reflect the
6770         container, while MethodIsStatic represents the actual code
6771         generated.
6772
6773         * expression.cs (ParameterReference): Use the new MethodIsStatic
6774         instead of IsStatic.
6775
6776         * anonymous.cs (AnonymousMethod.Compatible): Pass the
6777         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
6778         set on the current EmitContext. 
6779
6780         * expression.cs (Cast): Overload DoResolveLValue so we can pass
6781         resolve our casted expression as an LValue.  This triggers the
6782         proper LValue processing that is later required by Assign.
6783
6784         This fixes 72347.
6785
6786         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
6787
6788 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
6789
6790         C# 2.0 Fixed buffer implementation
6791
6792         * anonymous.cs: Update after RegisterHelperClass renaming.
6793
6794         * attribute.cs (AttributeTester.fixed_buffer_cache):
6795         Cache of external fixed buffers.
6796         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
6797         implementation if field is fixed buffer else null.
6798
6799         * class.cs
6800         (TypeContainer.AddField): Accept FieldMember instead of Field.
6801         (FieldBase.IsFieldClsCompliant): Extracted code from
6802         VerifyClsCompliance descendant customization.
6803         (FixedField): New class handles fixed buffer fields.
6804         (FixedFieldExternal): Keeps information about imported fixed
6805         buffer.
6806         (IFixedField): Make access to internal or external fixed buffer
6807         same.
6808
6809         * cs-parser.jay: Add fixed buffer parsing.
6810
6811         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
6812         buffer.
6813
6814         * expression.cs (Indirection): Extended implementation to accept
6815         fixed buffer field.
6816         (PointerArithmetic.Emit): Get element from fixed buffer as well.
6817         (ElementAccess.MakePointerAccess): Get type as parameter.
6818         (DoResolve): Add fixed buffer field expression conversion.
6819         (DoResolveLValue): Ditto.
6820         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
6821         (ArrayPtr): Derives from FixedBufferPtr.
6822         (ArrayPtr.Emit): Add extra emit for array elements.
6823
6824         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
6825
6826         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
6827         for compiler generated types.
6828         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
6829
6830         * statement.cs (Fixed): Refactored to be easier add fixed buffer
6831         and consume less memory.
6832         (Fixed.Resolve): Add fixed buffer case.
6833
6834         * typemanager.cs (compiler_generated_attr_ctor,
6835         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
6836         (HasElementType): Add our own implementation to work on every
6837         runtime.
6838
6839 2005-02-11  Miguel de Icaza  <miguel@novell.com>
6840
6841         * anonymous.cs (CaptureContext): Track whether `this' has been
6842         referenced.   
6843
6844         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
6845         only captured `this' if it was implicitly done (instance
6846         methods/variables were used). 
6847
6848         * codegen.cs (EmitContext.CaptureThis): New method to flag that
6849         `this' must be captured.
6850
6851 2005-01-30  Miguel de Icaza  <miguel@novell.com>
6852  
6853         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
6854         is null it means that there has been no need to capture anything,
6855         so we just create a sibling.
6856
6857         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
6858
6859         Just a partial fix.  The other half is fairly elusive.
6860         
6861 2005-02-10  Raja R Harinath  <rharinath@novell.com>
6862
6863         Fix #52586, cs0121-4.cs.
6864         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
6865         and return a hashtable.
6866         (MemberCache.ClearDeclaredOnly): New.
6867         (MemberCache.MemberCache): Update to change.  Make a deep copy of
6868         the method_hash of a base type too.
6869         (MemberCache.AddMethods): Adapt to having a deep copy of the base
6870         type methods.  Overwrite entries with the same MethodHandle so
6871         that the ReflectedType is correct.  The process leaves in base
6872         virtual functions and their overrides as distinct entries.
6873         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
6874         matters since it was boxed in a ArrayList before.
6875         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
6876         modifier.
6877         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
6878         case of a virtual function and its override (choose the overload
6879         as better).
6880         (Invocation.OverloadResolve): Avoid 'override' members during
6881         'applicable_type' calculation.
6882
6883 2005-02-09  Raja R Harinath  <rharinath@novell.com>
6884
6885         Combine two near-redundant caches.
6886         * typemanager.cs (method_params): Rename from method_internal_params.
6887         (TypeManager.GetParameterData): New.  Replace
6888         Invocation.GetParameterData.
6889         (TypeManager.LookupParametersByBuilder): Remove.
6890         * expression.cs (Invocation.method_parameter_cache): Remove.
6891         (Invocation.GetParameterData): Remove.
6892         Update to changes.
6893         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
6894         Update to changes.
6895
6896 2005-02-08  Raja R Harinath  <rharinath@novell.com>
6897
6898         Fix #72015.
6899         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
6900         TypeManager.multicast_delegate_type is null, resolve it by looking
6901         up "System.MulticastDelegate".
6902         * rootcontext.cs (RootContext.ResolveCore): Simplify.
6903
6904 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
6905             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
6906             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
6907
6908         Fix cs0164.cs.
6909         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
6910         (LabeledStatement.AddReference): New.  Set 'referenced'.
6911         (Goto.Resolve): Use it.
6912
6913 2005-02-05  John Luke  <john.luke@gmail.com>
6914
6915         * driver.cs: remove duplicate -doc line in Usage ()
6916
6917 2005-02-04  Raja R Harinath  <rharinath@novell.com>
6918
6919         * location.cs (Location.AddFile): Fix CS2002 error report.
6920
6921 2005-02-02  Martin Baulig  <martin@ximian.com>
6922
6923         * delegate.cs (Delegate.DefineType): Report an internal error if
6924         TypeManager.multicast_delegate_type is null.  See bug #72015 for
6925         details.        
6926
6927 2005-02-02  Raja R Harinath  <rharinath@novell.com>
6928
6929         Fix a crasher in a variant of #31984.
6930         * const.cs (Constant.CheckBase): New override that defers the
6931         new-or-override check in case the base type hasn't been populated
6932         yet.
6933         (Constant.Define): Ensure the new-or-override check is performed.
6934
6935 2005-02-01  Duncan Mak  <duncan@ximian.com>
6936
6937         * const.cs (LookupConstantValue): Check that `ce' is not null
6938         before calling GetValue ().
6939
6940 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6941
6942         Fix test-334.cs (#69519).
6943         * cs-parser.jay (using_alias_directive): Pass in an expression to
6944         NamespaceEntry.UsingAlias.
6945         (using_namespace_directive): Pass in an expression to
6946         NamespaceEntry.Using.
6947         (namespace_name): Don't flatten to a string.
6948         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
6949         (NamespaceEntry.AliasEntry.Resolve): Lookup using
6950         ResolveAsTypeStep.
6951         (NamespaceEntry.UsingEntry): Likewise.
6952         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
6953         changes.
6954         (NamespaceEntry.LookupForUsing): Remove.
6955         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
6956         names.
6957         (NamespaceEntry.Lookup): Remove support for dotted names.
6958
6959 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6960
6961         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
6962         split into two.
6963         (NamespaceEntry.ImplicitParent): Compute on demand.
6964         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
6965         parallels the current.
6966         (NamespaceEntry.LookupForUsing): Use it.
6967         (NamespaceEntry.Lookup): If the current namespace-entry is
6968         implicit, don't search aliases and using tables.
6969
6970 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6971
6972         Fix #31984.
6973         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
6974         BaseCache here.
6975         (TypeContainer.BaseCache): Compute on demand.
6976         (TypeContainer.FindMembers): Define constants and types if they're
6977         not already created.
6978         (FieldMember.Define): Move resetting of ec.InUnsafe before error
6979         check.
6980         * const.cs (Constant.Define): Make idempotent.
6981
6982 2005-01-29  Miguel de Icaza  <miguel@novell.com>
6983
6984         * pending.cs: Produce better code (no nops produced by using Ldarg
6985         + value).
6986         
6987         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6988         i - 1' it should be arg + 1.
6989
6990         Fixes bug #71819.
6991
6992 2005-01-28  Raja R Harinath  <rharinath@novell.com>
6993
6994         * attribute.cs (Attribute.CheckAttributeType): Make private
6995         non-virtual.
6996         (Attribute.ResolveType): Make virtual.
6997         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
6998         handling of RootContext.Tree.Types.
6999
7000 2005-01-27  Raja R Harinath  <rharinath@novell.com>
7001
7002         Update attribute-handling to use the SimpleName/MemberAccess
7003         mechanisms.
7004         * cs-parser.jay (attribute): Pass in an expression to the
7005         constructors of Attribute and GlobalAttribute.
7006         * attribute.cs (Attribute): Take an expression for the name.
7007         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
7008         passed in attribute name expression.
7009         (Attribute.CheckAttributeType): Use it.
7010         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
7011         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
7012         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
7013         argument to prevent error messages if the lookup fails.
7014
7015 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
7016
7017         * expression.cs (Indirection): Implemented IVariable interface
7018         to support indirection in AddressOf operator.
7019         (PointerArithmetic.Emit): Add optimalization for case where
7020         result can be precomputed.
7021
7022 2005-01-26  Martin Baulig  <martin@ximian.com>
7023
7024         * class.cs (TypeContainer.AttributeTargets): Return the correct
7025         AttributeTargets depending on our `Kind' instead of throwing an
7026         exception; fixes #71632.
7027
7028 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
7029
7030         Fix #71257
7031         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
7032         constant members.
7033
7034 2005-01-25  Raja R Harinath  <rharinath@novell.com>
7035
7036         Fix #71602.
7037         * expression.cs (MemberAccess.DoResolve): Don't complain with
7038         cs0572 when the LHS of a member access has identical name and type
7039         name.
7040
7041 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
7042
7043         Fix #71651, #71675
7044         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
7045         CreatePermission.
7046         Create custom PermissionSet only for PermissionSetAttribute.
7047
7048 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
7049
7050         Fix #71649
7051         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
7052         delegates in static class.
7053
7054 2005-01-24  Martin Baulig  <martin@ximian.com>
7055
7056         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7057         merging an implicit block, just use its reachability.
7058
7059         * statement.cs (Block.Resolve): Make the unreachable code check
7060         work wrt. implicit blocks; see test-337 from #63842.
7061
7062 2005-01-21  Alp Toker  <alp@atoker.com>
7063  
7064         * cs-parser.jay: destructor_declaration's container is PartialContainer
7065         not Class when partial types are used, so use Kind prop instead of
7066         'is'.
7067         
7068 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
7069
7070         * cs-parser.jay: Improve error reporting when an interface
7071         declares new types.
7072
7073 2005-01-20  Dick Porter  <dick@ximian.com>
7074
7075         * support.cs: SeekableStreamReader fix from Sandor Dobos
7076         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
7077         chars are read.  Fixes bug 70369.
7078
7079 2005-01-20  Raja R Harinath  <rharinath@novell.com>
7080
7081         * cs-parser.jay (catch_clause): Simplify current_block handling
7082         somewhat.
7083
7084 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
7085
7086         * convert.cs (ImplicitStandardConversionExists): Synchronize the
7087         code with ImplicitStandardConversion to handle the implicit
7088         conversion of method groups into valid delegate invocations. 
7089
7090         The problem is that in parameter handling we were using this code
7091         path.  Fixes bug #64698
7092
7093 2005-01-19  Raja R Harinath  <rharinath@novell.com>
7094
7095         * cs-parser.jay: Fix several infelicities.
7096         - Avoid assigning to the parser value stack.  Code like 
7097           '$3 = null' is unclean.  Synthesize a value for the code block
7098           instead. 
7099         - Avoid using oob_stack for storing location information.  Use ...
7100         (_mark_): ... this.  New (empty) rule.  Saves the current location
7101         in $$.
7102         (foreach_statement): Avoid using oob_stack for current_block
7103         handling.  Use technique used in for_statement and
7104         using_statement.  Synthesize a value for the code block to store
7105         additional intermediate information.
7106
7107 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
7108
7109         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
7110         of a different type is only allowed to private fields of a
7111         containing type, not on fields of a base class.
7112
7113         See test-174.cs and error cs0122-9.cs
7114
7115 2005-01-13  Raja R Harinath  <rharinath@novell.com>
7116
7117         Fix test-335.cs (bug #58126).
7118         * cs-parser.jay (argument): Split out non-expression parts of the
7119         rule into 'non_simple_argument'.
7120         (invocation_expression): Support parenthesized invocations with
7121         multiple arguments, and with single non-simple arguments.
7122
7123 2005-01-13  Raja R Harinath  <rharinath@novell.com>
7124
7125         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
7126         places.
7127
7128 2005-01-12  Raja R Harinath  <rharinath@novell.com>
7129
7130         Fix cs0038-1.cs, cs1640-6.cs.
7131         * ecore.cs (Expression.Resolve): Remove special-case for
7132         SimpleName in error-handling.
7133         (Expression.almostMatchedMembers): Relax access permission to
7134         protected.
7135         (Expression.MemberLookupFailed): Handle duplicates in
7136         almostMatchedMembers list.
7137         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
7138         * expression.cs (New.DoResolve): Report CS1540 for more cases.
7139         * typemanager.cs (GetFullNameSignature): Use the MethodBase
7140         overload if the passed in MemberInfo is a MethodBase.
7141
7142 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
7143
7144         Fix #70749
7145         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
7146         for non-CAS & merge permission sets properly.
7147
7148 2005-01-11  Raja R Harinath  <rharinath@novell.com>
7149
7150         Improve standard-compliance of simple name and member access 
7151         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
7152         * ecore.cs (FullNamedExpression): New abstract base class 
7153         for Namespaces and TypeExpressions.
7154         (ResolveFlags.SimpleName): Remove.
7155         (SimpleName): Remove support for dotted names.
7156         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
7157         DeclSpace.FindType and DeclSpace.LookupType.
7158         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
7159         (Expression.ExprClassName): Make member function.
7160         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
7161         a namespace.  Remove creation of dotted "SimpleName"s.
7162         (MemberAccess.DoResolve): Likewise.
7163         * decl.cs (DeclSpace.Cache): Make private.
7164         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
7165         (DeclSpace.FindType): Update.
7166         (DeclSpace.LookupType): Move here from RootContext.  Return a 
7167         FullNamedExpression.
7168         * namespace.cs (Namespace): Derive from FullNamedExpression
7169         so that it can be part of expression resolution.
7170         (Namespace.Lookup): Return an FullNamedExpression.
7171         (NamespaceEntry.LookupAlias): Lookup aliases only in current
7172         namespace.
7173         * rootcontext.cs (NamespaceLookup): Remove.
7174         (LookupType): Move to DeclSpace.
7175         * attribute.cs (CheckAttributeType): Update.
7176         * doc.cs (FindDocumentedType): Remove allowAlias argument.
7177         (FindDocumentedTypeNonArray): Likewise.
7178
7179 2005-01-11  Raja R Harinath  <rharinath@novell.com>
7180
7181         Fix cs0509.cs, cs1632.cs.
7182         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
7183         is the same as IsInterface.
7184         (TypeContainer.GetClassBases): Likewise.
7185         * statement.cs (LabeledStatement.ig): New field.
7186         (LabeledStatement.LabelTarget): Save ILGenerator which created the
7187         label.
7188         (LabeledStatement.DoEmit): Check that the label was created with
7189         the same ILGenerator.
7190
7191 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
7192
7193         Fix #71058
7194         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
7195         accessors to its properties.
7196
7197         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
7198         from accessors to property.
7199         
7200 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
7201
7202         Fix #70722
7203         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
7204         only for overrides.
7205         
7206 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
7207
7208         * attribute.cs: Check for null and empty strings.  
7209
7210         I have lost another battle to Paolo.
7211
7212 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
7213
7214         Fix #70942
7215         * class.cs (PropertyMethod): Set Parent field in ctors.
7216         (SetMethod.InternalParameters): Add unsafe switch hack.
7217         Override MarkForDuplicationCheck where it is appropriate.
7218
7219         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
7220         It says whether container allows members with the same name.
7221         Base default is no.
7222         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
7223         Removed is_method parameter.
7224
7225 2005-01-06  Duncan Mak  <duncan@ximian.com>
7226
7227         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
7228         because the previous change led to incorrect reporting of CS1032
7229         ("Cannot define/undefine preprocessor symbols after first token in
7230         file"). Instead of using `tokens_seen' as the only flag that
7231         triggers CS1040, introduce `comments_seen'. This new flag is used
7232         to signify having seen comments on the current line, so it is
7233         unset after a newline.
7234
7235 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
7236
7237         * doc.cs : When searching for a type, find nested type too.
7238           This fixes bug #71040.
7239
7240 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
7241
7242         * doc.cs :
7243           - Warn missing member comment on those classes which also does not
7244             have doc comments. Fixed bug #71041.
7245           - Don't warn missing doc comment on default constructor.
7246             Fixed bug #71042.
7247
7248 2005-01-06  Duncan Mak  <duncan@ximian.com>
7249
7250         * cs-tokenizer.cs (xtoken): After handling traditional C-style
7251         comments, set `tokens_seen' to true. This allows us to detect
7252         misplaced preprocessor directives (i.e. not at the beginning of
7253         the a line, nor after whitespaces). In that case, report error
7254         CS1040. This fixes bug #56460.
7255
7256         * cs-parser.jay (interface_member_declaration): Add checks for
7257         IsExplicitImpl, and report CS0541 error if an interface member is
7258         defined as an explicit interface declaration.
7259
7260 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
7261
7262         Fix #70817
7263         * class.cs (PropertyMethod): Set Parent field in ctors.
7264         (SetMethod.InternalParameters): Add unsafe switch hack.
7265         
7266         * decl.cs (MemberCore.Parent): Cannot be readonly.
7267
7268 2005-01-06  Raja R Harinath  <rharinath@novell.com>
7269
7270         * decl.cs (DeclSpace.ResolveType): Remove.
7271         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
7272         Merge in code from ...
7273         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
7274         * class.cs, enum.cs: Update to changes.
7275
7276 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
7277
7278         * anonymous.cs: Ensure that we init the scope of our parent if it
7279         has not been initialized yet.
7280
7281 2004-12-30  Duncan Mak  <duncan@ximian.com>
7282
7283         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
7284         if field.FieldBuilder is null. Fixes #70758.
7285
7286         * convert.cs: Fixed some typos and updated some of the comments.
7287         (ImplicitStandardConversionExists):
7288         (TryImplicitIntConversion): If `target_type' is an interface and
7289         the type of `ic' implements this interface, return true or a new
7290         BoxedCast instead of null. This fixes #70468.
7291
7292 2004-12-29  Duncan Mak  <duncan@ximian.com>
7293
7294         * expression.cs (Argument.Emit): Check that Expr is
7295         IMemoryLocation before casting to it, and report CS1510 otherwise.
7296
7297         This fixes #70402.
7298
7299 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
7300
7301         * statement.cs (Block.ThisVariable): remove the recursion here, to
7302         make the --profile more sane.
7303
7304 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
7305
7306         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
7307         assembly, by JB Evain.
7308
7309 2004-12-17  Raja R Harinath  <rharinath@novell.com>
7310
7311         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
7312           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
7313         "parent" refers to enclosing type/class.  "base" refers to superclass.
7314
7315 2004-12-17  Raja R Harinath  <rharinath@novell.com>
7316
7317         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7318         Ensure that we only have GlobalAttributes.
7319         * attribute.cs (Attribute.Emit): Make non-virtual.
7320         (GlobalAttribute.Emit): Remove.
7321         (Attribute.Resolve): Make virtual.
7322         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
7323         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
7324         the argument. Don't create one.
7325         (Attribute.GetObsoleteAttribute): Likewise.
7326         (Attribute.GetClsCompliantAttributeValue): Likewise.
7327         * class.cs, decl.cs: Update to changes.
7328
7329 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
7330
7331         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
7332         
7333         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
7334         
7335         * statement.cs (Foreach.Resolve): Add error 186 report.
7336
7337 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
7338
7339         * expression.cs (Conditional.DoResolve): Add warning 429.
7340         
7341         * statement.cs (If.Resolve): Add warning 665.
7342
7343 2004-12-16  Raja R Harinath  <rharinath@novell.com>
7344
7345         New invariant: RootContext.Tree.Types.NamespaceEntry == null
7346         except when in the parser, and in GlobalAttribute.
7347         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
7348         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
7349         RootContext.Tree.Types.NamespaceEntry once work is done.
7350         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
7351         and resets RootContext.Tree.Types.NamespaceEntry.
7352
7353 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
7354
7355         * cs-parser.jay: Don't create a block for every variable.
7356
7357 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
7358
7359         * location.cs: Provide extra information.
7360
7361         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
7362         variables from the captured environment, it is the ldarg_0.
7363
7364 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
7365
7366         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
7367         find a conclusion.
7368         
7369         * class.cs: Changed warning level for 169 to avoid developer
7370         displeasure from warning flooding. It will be changed back when they
7371         fix most of current BCL warnings.
7372         
7373         * RootContext.cs: Pushed default WarningLevel to 3.
7374         
7375         * statement.cs: Removed unused variable.
7376
7377 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
7378
7379         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
7380         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
7381         Add error 502 report.
7382         (StaticClass.DefineType): Add error 441 report.
7383         (Class.AllowedModifiersProp): New virtual property as temporary
7384         extension to AllowedModifiers.
7385         (Class.DefineType): Add error 418 report. Moved ModFlags check here
7386         to share implementation with StaticClass and don't call virtual
7387         methods from ctor.
7388         
7389         * driver.cs (MainDriver): Add error 1558 test.
7390
7391         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
7392         report. Moved error 36 test here.
7393
7394         * statement.cs (Throw.Resolve): Add error 724 report.
7395
7396         * typemanager.cs: Add out_attribute_type core type.
7397         
7398 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
7399
7400         * class.cs (TypeContainer.VerifyClsCompliance): Add error
7401         3018 report.
7402         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
7403
7404         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
7405         3017 report.
7406         
7407         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
7408
7409         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
7410         Add error 3023 report.
7411         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
7412
7413         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
7414         implementation.
7415
7416 2004-12-12  John Luke  <john.luke@gmail.com>
7417
7418         * driver.cs (AddArgs): take -- into account when
7419         adding arguments, fixes bug 65710 
7420
7421 2004-12-12  Martin Baulig  <martin@ximian.com>
7422
7423         * expression.cs (Unary.TryReduceNegative): Added support for
7424         SByteConstant and ByteConstant.
7425         (Unary.Reduce): Check error values from TryReduceNegative().
7426
7427 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
7428
7429         * attributes.cs (Attribute.Resolve): Avoid multiple error report
7430         and report exception as error 182.
7431
7432 2004-12-10  Raja R Harinath  <rharinath@novell.com>
7433
7434         * driver.cs (Main): Fix message when there are warnings.
7435
7436 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
7437
7438         * delegate.cs: Fixed my fix from yesterday, sorry about that.
7439
7440 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
7441
7442         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
7443         Reduced number of warnings.
7444         
7445         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
7446
7447 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
7448
7449         * driver.cs: Removed message.
7450
7451         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
7452
7453 2004-12-08    <vargaz@freemail.hu>
7454
7455         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
7456
7457 2004-12-08  Martin Baulig  <martin@ximian.com>
7458
7459         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7460         instead of a CS3002 for properties and indexer.
7461
7462 2004-12-08  Martin Baulig  <martin@ximian.com>
7463
7464         * decl.cs (MemberName.ToString): Make this work again.
7465
7466 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
7467
7468         * attribute.cs (Resolve): Add error 591 detection.
7469
7470         * class.cs (FieldMember.Define): Add error 1547 detection.
7471         (Indexer.Define): Add error 620 detection.
7472         (Operator.Define): Add error 590 detection.
7473
7474         * ecore.cs: Missing argument for error 79.
7475
7476         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
7477         detection.
7478
7479 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
7480
7481         Fix #70106
7482         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
7483         only.
7484
7485 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
7486
7487         * cs-parser.jay : handle doc comments on implicit/explicit operators.
7488           Some operator comments were suppressed.
7489         * doc.cs : Implicit/explicit operator name in doc comments are like
7490           "op_Explicit(type)~returnType", so added suffix handling.
7491
7492 2004-12-07  Martin Baulig  <martin@ximian.com>
7493
7494         * decl.cs
7495         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7496         (MemberCore.GetClsCompliantAttributeValue): Likewise.
7497         (DeclSpace.ec): New protected field; store the EmitContext here.
7498         (DeclSpace.EmitContext): New public property; moved here from
7499         `TypeContainer'.
7500         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7501         EmitContext.
7502
7503         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7504         (Enum.Emit): Don't create a new EmitContext.
7505
7506         * delegate.cs (Delegate.DefineType): Always create the
7507         EmitContext.
7508
7509         * iterators.cs (Iterators.DefineIterator): Create a new
7510         EmitContext and store it in `ec'.
7511
7512 2004-08-24  Martin Baulig  <martin@ximian.com>
7513
7514         * typemanager.cs
7515         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
7516         this for accessibility checks.
7517         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
7518         IsNestedFamilyAccessible.
7519         (TypeManager.IsSubclassOf): New method, do what the name actually
7520         says.   
7521
7522 2004-12-06  Raja R Harinath  <rharinath@novell.com>
7523
7524         Fix crash on cs0657-17.cs.
7525         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7526         Use RootContext.Tree.Types, not 'new RootTypes ()'.
7527         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
7528         the case where the NamespaceEntry gets overwritten.
7529
7530 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
7531
7532         Fixed #69195, #56821
7533         * ecore.cs (ResolveBoolean): Tiny refactoring.
7534
7535         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
7536         of right expression resolving when left is false constant and
7537         operator is LogicalAnd OR true constant and operator is LogicalOr.
7538
7539         * statement.cs (ResolveUnreachable): Always reports warning.
7540
7541 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
7542
7543         * class.cs: Distinguish between 1721 and 1722 (just a little help
7544         for the programmer).
7545
7546 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
7547
7548         * delegate.cs: Only allow this on new versions of the language. 
7549
7550 2004-12-02  Duncan Mak  <duncan@ximian.com>
7551
7552         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
7553         Expression class.
7554         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
7555         here as a static method. Take an additional bool out parameter
7556         `must_do_cs1540_check' for signaling to InstanceResolve.
7557         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
7558         member field from PropertyExpr class and made it an argument of
7559         the method instead.
7560         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
7561         check for MarshalByRefObject, and report CS0122 instead of CS1540.
7562         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
7563         and `remove_accessor' as well as InstanceResolve: report CS0122
7564         where applicable.
7565
7566         Fixes #70129.
7567
7568 2004-12-03  Raja R Harinath  <rharinath@novell.com>
7569
7570         Fix test-327.cs, test-328.cs, and put in early infrastructure
7571         for eventually fixing #52697.
7572         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
7573         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
7574         from other methods.
7575         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
7576         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
7577         (VerifyUsing, error246): Update.
7578         * rootcontext.cs (RootContext.NamespaceLookup): Just use
7579         'NamespaceEntry.LookupNamespaceOrType'.
7580
7581 2004-12-03  Martin Baulig  <martin@ximian.com>
7582
7583         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7584         method as our child, call AnonymousMethod.Compatible() on it.
7585
7586 2004-12-03  Raja R Harinath  <rharinath@novell.com>
7587
7588         Disable XML documentation support in 'basic' profile.
7589         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
7590         Redirect XmlElement to System.Object.
7591         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
7592         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
7593         * mcs.exe.sources: Add doc-bootstrap.cs.
7594         * doc-bootstrap.cs: New file.  Contains empty stub implementation
7595         of doc.cs.
7596
7597 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
7598
7599         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
7600           comments are allowed.
7601
7602 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
7603
7604         * delegate.cs: Add checks for subtypes in paramaters and return values
7605         in VerifyMethod () to add support for Covariance/Contravariance
7606         in delegates.
7607         
7608 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
7609
7610         * report.cs: Remove extra closing parenthesis.
7611
7612         * convert.cs (Error_CannotImplicitConversion): If the name of the
7613         types are the same, provide some extra information.
7614
7615         * class.cs (FieldBase): Use an unused bit field from the field to
7616         encode the `has_offset' property from the FieldMember.  This saves
7617         a couple of Ks on bootstrap compilation.
7618
7619         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7620         method as our child, return the AnonymousMethod resolved
7621         expression.
7622
7623         * expression.cs (New.DoResolve): Allow return values from
7624         NewDelegate to also include AnonymousMethods.
7625
7626         Fixes #70150.
7627
7628 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
7629
7630         Fix bug #70102
7631         * attribute.cs (Resolve): Improved implementation of params
7632         attribute arguments.
7633
7634         * support.cs (ParameterData): Add HasParams to be faster.
7635
7636 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
7637
7638         all things are for /doc support:
7639
7640         * doc.cs: new file that supports XML documentation generation.
7641         * mcs.exe.sources: added doc.cs.
7642         * driver.cs:
7643           Handle /doc command line option.
7644           Report error 2006 instead of 5 for missing file name for /doc.
7645           Generate XML documentation when required, after type resolution.
7646         * cs-tokenizer.cs:
7647           Added support for picking up documentation (/// and /** ... */),
7648           including a new XmlCommentState enumeration.
7649         * cs-parser.jay:
7650           Added lines to fill Documentation element for field, constant,
7651           property, indexer, method, constructor, destructor, operator, event
7652           and class, struct, interface, delegate, enum.
7653           Added lines to warn incorrect comment.
7654         * rootcontext.cs :
7655           Added Documentation field (passed only when /doc was specified).
7656         * decl.cs:
7657           Added DocComment, DocCommentHeader, GenerateDocComment() and
7658           OnGenerateDocComment() and some supporting private members for
7659           /doc feature to MemberCore.
7660         * class.cs:
7661           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
7662         * delegate.cs:
7663           Added overriden DocCommentHeader.
7664         * enum.cs:
7665           Added overriden DocCommentHeader and GenerateDocComment().
7666
7667 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
7668
7669         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
7670         unwrapping the enumeration values, chain to
7671         DoConstantNumericPromotions again, so we can promote things to the
7672         fundamental types (takes care of enums that are bytes, sbytes).
7673
7674         Fixes bug #62054.
7675
7676 2004-12-01  Raja R Harinath  <rharinath@novell.com>
7677
7678         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
7679         Fix long-standing bug in type-lookup.  Use FindType instead of
7680         LookupType when ec.ResolvingTypeTree.
7681         (Attribute.ResolveType, Attribute.Resolve)
7682         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
7683         Update to changes.
7684         (Attributes.Search): Remove internal version.  Update.
7685         (Attributes.SearchMulti): Update.
7686         (Attributes.GetClsCompliantAttribute): Remove.
7687         (Attributes.GetIndexerNameAttribute): Remove.
7688         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
7689         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
7690         * class.cs (Indexer.Define): Likewise.
7691
7692 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
7693
7694         Fix bug #68790
7695         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
7696         MarshallByReference members access.
7697
7698         * expression.cs: Use CheckMarshallByRefAccess;
7699         Better error CS0197 message.
7700
7701         * report.cs: Print whole related error message.
7702
7703 2004-11-30  Raja R Harinath  <rharinath@novell.com>
7704
7705         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
7706         the current directory to help debugging.
7707
7708 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7709
7710         * class (GetClassBases): Better error 60 report.
7711         (EventProperty): Disabled warning 67 detection.
7712
7713 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7714
7715         Fix bug #60324
7716         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
7717
7718         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
7719         precise values.
7720
7721 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7722
7723         Fix bug #49488
7724         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
7725
7726         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
7727
7728 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
7729
7730         * attribute.cs (Attribute.Resolve): Refine error reporting and
7731         report a cs0117 if the identifier does not exist, to distinguish
7732         from 0617 which is a miss-use of the actual identifier.
7733
7734         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
7735         between cs0070 and cs0079.
7736
7737         * class.cs (MemberBase.DoDefine): When reporting a wrong
7738         accessibility level, we use MethodCore to compare instead of
7739         Method (this was a regression in some refactoring effort).
7740
7741         So now we correctly report cs0056 again.
7742
7743         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
7744         testing the target_type (which was known to be object_type) and
7745         not the source type (which is anonymous_method).
7746
7747         Fixed reporting of error cs1660.
7748
7749         * expression.cs (UserCast.Source): Expose the underlying cast.
7750
7751         * statement.cs (Switch.SwitchGoverningType): Sort the list of
7752         allowed types to find a match to int32 first (most common).
7753
7754         In addition, it ignores any ImplicitUserConversions that did an
7755         internal implicit conversion (as the switch statement allows only
7756         one integral conversion to exist).
7757
7758         * class.cs (PartialContainer.Create): rename `name' to
7759         `member_name' for clarity.  Then replace the string calls with a
7760         call to MemberName.GetPartialName, as now using
7761         MemberName.ToString is an error (this is due to the side effects
7762         it had, that were fixed in the past).
7763
7764         This will restore the error reporting on a number of partial class
7765         errors that were missusing this (and getting an exception as a
7766         results, which is now just a plain textual warning, because
7767         yyparse debug output would crash otherwise).
7768
7769 2004-11-26  Raja R Harinath  <rharinath@novell.com>
7770
7771         * Makefile (PROGRAM_INSTALL_DIR): Remove.
7772
7773 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
7774
7775         * rootcontext.cs (LookupType): Make sure to cache lookups that
7776         don't give us a negative result. This saves about 5% of corlib
7777         compilation time.
7778
7779 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
7780
7781         * report.cs (AbstractMessage.Print): messages are sent to stderr
7782
7783         * class.cs (TypeContainer.GetClassBases): It is an error to have a
7784         non-interface in the list of interfaces (at this point, either
7785         parent was properly set, or a base class is being listed in the
7786         interfaces section).
7787
7788         This flags error 1722, and resolves the crash from bug 69259.
7789
7790 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
7791
7792         * statement.cs (Using.EmitExpressionFinally): make this work right
7793         for valuetypes. Fixes 69926.
7794
7795 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
7796
7797         * const.cs (Const.ChangeType): Cope with the "0 literal can be
7798         converted to an enum" here, before we try to change the underlying
7799         type.  This code exists, but it is a different code path than the
7800         one used while encoding constants.
7801
7802         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
7803         old bug: when converting from the null literal to a pointer,
7804         return an EmptyCast, not the NullLiteral.
7805
7806         This fixes #69921, the recent null_type changes probably made this
7807         bug more prominent.
7808
7809         (ImplicitReferenceConversionExists): In addition, resynchronized
7810         the code here, so it matches the same code in
7811         ImplicitReferenceConversionExists for the `from any class-type S
7812         to any interface-type T'.
7813         
7814
7815 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
7816
7817         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
7818
7819 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
7820
7821         * cs-parser.jay: Use verbosity accordingly. 
7822
7823 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
7824
7825         * expression.cs (Unary.ResolveOperator): Do not report warning;
7826         AddressOf reads from variable.
7827         
7828         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
7829
7830 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
7831
7832         Fix bug #69462
7833
7834         * attribute.cs (Attributable): Removed CheckTargets.
7835         (Attributes.Emit): Explicit attribute targets are tested here.
7836
7837         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
7838         not enabled for interfaces.
7839
7840         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
7841         (GetAssemblyName): Ouch next bug there.
7842
7843 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
7844
7845         * expression.cs: Error 275 added.
7846         
7847 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
7848
7849         Fix bug #69177 (Implemented decimal constant support)
7850
7851         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
7852         (BinaryFold): Add DecimalConstant.
7853
7854         * const.cs (Define): Decimal constant 
7855         (is not constant.
7856         (ChangeType): Add decimal type handling.
7857         (LookupConstantValue): Don't set value for decimal type but
7858         emit DecimalConstantAttribute. Needed for constant optimization.
7859
7860         * constant.cs (ToDecimal): New method.
7861         (ConvertToDecimal): New method.
7862         (IntConstant): Implemented ConvertToDecimal.
7863         (DecimalConstant.Emit): Emit optimized version for decimals in
7864         int range.
7865
7866         * expression.cs (ResolveOperator): Changed order of constant
7867         reduction to work correctly with native types which have
7868         overloaded operators.
7869         (ResolveMemberAccess): Extract constant value from attribute
7870         for decimal type.
7871
7872         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
7873
7874         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
7875         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
7876         (ChangeType): Decimal is special.
7877         (TypeToCoreType): Add decimal type.
7878
7879 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
7880
7881         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
7882         decimal types.
7883
7884 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
7885
7886         * class.cs (EventField.ApplyAttributeBuilder): Fix error
7887         test cs1667-5.cs.
7888
7889 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
7890
7891         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
7892
7893         * pending.cs (PendingImplementation): Grab only interfaces.
7894
7895 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
7896
7897         * statement.cs (ForeachHelperMethods): Add location member and
7898         error 202 detection.
7899
7900 2004-11-19  Raja R Harinath  <rharinath@novell.com>
7901
7902         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
7903         automatically handled by executable.make.
7904         (PROGRAM): Make profile-specific.
7905
7906 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
7907
7908         * expression.cs (DoResolveBase): Fixed wrong warning for out
7909         variables.
7910
7911 2004-11-18  Martin Baulig  <martin@ximian.com>
7912
7913         Merged latest changes into gmcs.  Please keep this comment in
7914         here, it makes it easier for me to see what changed in MCS since
7915         the last time I merged.
7916
7917 2004-11-17  Raja R Harinath  <rharinath@novell.com>
7918
7919         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
7920         (TypeHandle.GetMemberCache): New.
7921         (TypeHandle.TypeHandle): Update.
7922         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
7923         (TypeManager.LookupParentInterfacesCache):
7924         Rename from LookupInterfaceCache.  Optimize slightly.
7925         (TypeManager.MemberLookup_FindMembers): Update.
7926         * decl.cs (MemberCache.MemberCache): Set Container to null in the
7927         multi-type variant.
7928         (AddCacheContents): Rename from AddHashtable.
7929         * class.cs (TypeContainer.parent_container): Remove.
7930         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
7931         (TypeContainer.DoDefineMembers): Don't initialize it.
7932         Update to name changes.
7933         
7934 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
7935
7936         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
7937         that factors the code to check access modifiers on override.  
7938
7939         (PropertyBase): Use the code here.
7940
7941         Patch from Lluis S'anchez, fixes bug #69361.
7942
7943 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
7944
7945         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
7946         routine that is used to report the use of a captured variable
7947         whose address has been taken.
7948
7949         There are two checks: one when variables are being captured and
7950         the other check is when the address of a variable is taken. 
7951         
7952         (because an anonymous methods might be resolved before *or* after
7953         the address has been taken) and 
7954
7955         * expression.cs (Conditional.DoResolve): Remove the special
7956         casing that Martin added to trueExpr and falseExpr being both
7957         NullLiteral.  We get the right behavior now just by introducing
7958         the null_type into the compiler. 
7959
7960         * convert.cs (ExplicitConversion): Change the code to use
7961         null_type instead of testing `expr is NullLiteral'.
7962         (ImplicitConversionStandard): use null_type too.
7963         (ImplicitReferenceConversionExists): use null_type too.
7964         (ImplicitReferenceConversion): use null_type too.
7965
7966         * literal.cs: The type of `NullLiteral' is now null_type instead
7967         of object_type. 
7968         (Resolve): Set the type here.
7969
7970         * typemanager.cs: Introduce null_type.
7971
7972 2004-11-17  Martin Baulig  <martin@ximian.com>
7973
7974         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
7975         direction, like FindMembers() does.  Fixes #69546, testcase is in
7976         test-315.cs.    
7977
7978 2004-11-16  Martin Baulig  <martin@ximian.com>
7979
7980         This is based on a patch from Marek Safar, see bug #69082.
7981         Fixes bugs #63705 and #67130.
7982
7983         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
7984         method; create a MemberCache for an interface type and cache the
7985         result.
7986
7987         * decl.cs (IMemberContainer.ParentContainer): Removed.
7988         (IMemberContainer.ParentCache): New property.
7989         (MemberCache.SetupCacheForInterface): Removed.
7990         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
7991         to create a cache for an interface's "parent".
7992
7993         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
7994         interfaces too.
7995
7996 2004-11-16  Martin Baulig  <martin@ximian.com>
7997
7998         Merged back from gmcs; these changes already went into gmcs a
7999         couple of weeks ago.
8000
8001         * typemanager.cs
8002         (TypeManager.AddUserType): Removed the `ifaces' argument.
8003         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
8004         `TypeExpr []'.
8005         (TypeManager.AddUserInterface): Removed.
8006         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
8007         `TypeExpr []'.
8008         (TypeManager.GetInterfaces): Likewise.
8009         (TypeManager.GetExplicitInterfaces): Likewise.
8010
8011         * ecore.cs (TypeExpr.GetInterfaces): Removed.
8012
8013         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
8014         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
8015
8016 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
8017
8018         * statement.cs: Avoid adding bools to a hashtable.
8019
8020 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
8021
8022         * expression.cs (Invocation.OverloadResolve): Flag error if we are
8023         calling an unsafe method from a safe location.
8024
8025 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
8026
8027         Fix #69167
8028         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
8029
8030 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
8031
8032         * namespace.cs (VerifyUsing): use GetPartialName instead of
8033         ToString. 
8034
8035 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
8036
8037         * statement.cs (Return.Resolve): Fix regression in typo: if
8038         `in_exc', we have to request a NeedReturnLabel, this was a typo
8039         introduced in the anonymous method check-in.  Fixes #69131.
8040
8041         * Indexers were using the ShortName when defining themselves,
8042         causing a regression in the compiler bootstrap when applying the
8043         patch from 2004-11-02 (first part), now they use their full name
8044         and the bug is gone.
8045
8046 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
8047
8048         * driver.cs: Strip the path from the names of embedded resources. Fixes
8049         #68519.
8050
8051 2004-11-04  Raja R Harinath  <rharinath@novell.com>
8052
8053         Fix error message regression: cs0104-2.cs.
8054         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
8055         (AliasEntry.Resolve): Update.
8056         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
8057         'silent' flag.
8058         (RootContext.LookupType): Update.
8059
8060 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
8061
8062         * cs-parser.jay: Add support for handling accessor modifiers
8063         * class: Add support port accessor modifiers and error checking,
8064         define PropertyMethod.Define as virtual (not abstract anymore)
8065         * ecore.cs: Add checking for proeprties access with access modifiers
8066         * iterators.cs: Modify Accessor constructor call based in the modified
8067         constructor
8068 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
8069
8070         * expression.cs (StringConcat): Handle being called twice,
8071         as when we have a concat in a field init with more than two
8072         ctors in the class
8073
8074 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
8075
8076         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
8077         special case explicit implementations, we should always produce
8078         the .property or .event declaration.
8079         
8080         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
8081         since it will not return correct data if people use this
8082         unresolved in the presence of using statements (see test-313).
8083
8084         * class.cs (MethodData.Define): If we are an explicit interface
8085         implementation, set the method name to the full name of the
8086         interface plus the name of the method.  
8087
8088         Notice that using the method.MethodName.GetFullName() does not
8089         work, as it will only contain the name as declared on the source
8090         file (it can be a shorthand in the presence of using statements)
8091         and not the fully qualifed type name, for example:
8092
8093         using System;
8094
8095         class D : ICloneable {
8096                 object ICloneable.Clone ()  {
8097                 }
8098         }
8099
8100         Would produce a method called `ICloneable.Clone' instead of
8101         `System.ICloneable.Clone'.
8102
8103         * namespace.cs (Alias.Resolve): Use GetPartialName.
8104         
8105 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
8106
8107         * cs-parser.jay: Add error 1055 report.
8108
8109 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
8110
8111         * assign.cs (Assign.DoResolve): Only do the transform of
8112         assignment into a New if the types are compatible, if not, fall
8113         through and let the implicit code deal with the errors and with
8114         the necessary conversions. 
8115
8116 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
8117
8118         * cs-parser.jay: Add error 1031 report.
8119
8120         * cs-tokenizer.cs: Add location for error 1038.
8121
8122 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8123
8124         * cs-parser.jay: Add error 1016 report.
8125
8126 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8127
8128         * cs-parser.jay: Add errors 1575,1611 report.
8129
8130 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8131
8132         * cs-parser.jay: Add error 1001 report.
8133
8134 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8135
8136         Fix #68850
8137         * attribute.cs (GetMarshal): Add method argument for
8138         caller identification.
8139
8140         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
8141         agument for GetMarshal and RuntimeMissingSupport.
8142
8143 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8144
8145         * attribute.cs (ExtractSecurityPermissionSet): Removed
8146         TypeManager.code_access_permission_type.
8147
8148         * typemanager.cs: Removed TypeManager.code_access_permission_type.
8149
8150 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
8151
8152         * expression.cs (LocalVariableReference.DoResolveLValue): Check
8153         for obsolete use of a variable here.   Fixes regression on errors
8154         cs0619-25 and cs0619-26.
8155
8156 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
8157
8158         Fix #62358, implemented security attribute encoding.
8159
8160         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
8161         Tests permitted SecurityAction for assembly or other types.
8162         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
8163         data from SecurityPermissionAttribute to PermisionSet class.
8164
8165         * class.cs (ApplyAttributeBuilder): Added special handling
8166         for System.Security.Permissions.SecurityAttribute based types.
8167
8168         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
8169         special handling for System.Security.Permissions.SecurityAttribute
8170         based types.
8171
8172         * enum.cs (ApplyAttributeBuilder): Added special handling
8173         for System.Security.Permissions.SecurityAttribute based types.
8174
8175         * parameter.cs (ApplyAttributeBuilder): Added special handling
8176         for System.Security.Permissions.SecurityAttribute based types.
8177
8178         * rootcontext.cs: Next 2 core types.
8179
8180         * typemanager.cs (TypeManager.security_permission_attr_type):
8181         Built in type for the SecurityPermission Attribute.
8182         (code_access_permission_type): Build in type.
8183
8184 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
8185
8186         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
8187         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
8188         all of this information into
8189         EmitContext.EmitCapturedVariableInstance.
8190         
8191         * codegen.cs (EmitCapturedVariableInstance): move here the
8192         funcionality of emitting an ldarg.0 in the presence of a
8193         remapping.   This centralizes the instance emit code.
8194
8195         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
8196         then emit a load of this: it means that we have reached the
8197         topmost ScopeInfo: the one that contains the pointer to the
8198         instance of the class hosting the anonymous method.
8199
8200         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
8201         captures to the topmost CaptureContext.
8202
8203 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
8204
8205         * expression.cs (LocalVariableReference): Move the knowledge about
8206         the iterators into codegen's EmitCapturedVariableInstance.
8207
8208 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
8209
8210         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
8211         all code paths return a value from an anonymous method (it is the
8212         same as the 161 error, but for anonymous methods).
8213
8214 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
8215
8216         The introduction of anonymous methods in the compiler changed
8217         various ways of doing things in the compiler.  The most
8218         significant one is the hard split between the resolution phase
8219         and the emission phases of the compiler.
8220
8221         For instance, routines that referenced local variables no
8222         longer can safely create temporary variables during the
8223         resolution phase: they must do so from the emission phase,
8224         since the variable might have been "captured", hence access to
8225         it can not be done with the local-variable operations from the runtime.
8226         
8227         * statement.cs 
8228
8229         (Block.Flags): New flag `IsTopLevel' to indicate that this block
8230         is a toplevel block.
8231
8232         (ToplevelBlock): A new kind of Block, these are the blocks that
8233         are created by the parser for all toplevel method bodies.  These
8234         include methods, accessors and anonymous methods.
8235
8236         These contain some extra information not found in regular blocks:
8237         A pointer to an optional CaptureContext (for tracking captured
8238         local variables and parameters).  A pointer to the parent
8239         ToplevelBlock.
8240         
8241         (Return.Resolve): Catch missmatches when returning a value from an
8242         anonymous method (error 1662).
8243         Invoke NeedReturnLabel from the Resolve phase instead of the emit
8244         phase.
8245
8246         (Break.Resolve): ditto.
8247
8248         (SwitchLabel): instead of defining the labels during the
8249         resolution phase, we now turned the public ILLabel and ILLabelCode
8250         labels into methods called GetILLabelCode() and GetILLabel() that
8251         only define the label during the Emit phase.
8252
8253         (GotoCase): Track the SwitchLabel instead of the computed label
8254         (its contained therein).  Emit the code by using
8255         SwitchLabel.GetILLabelCode ().
8256
8257         (LocalInfo.Flags.Captured): A new flag has been introduce to track
8258         whether the Local has been captured or not.
8259
8260         (LocalInfo.IsCaptured): New property, used to tell whether the
8261         local has been captured.
8262         
8263         * anonymous.cs: Vastly updated to contain the anonymous method
8264         support.
8265
8266         The main classes here are: CaptureContext which tracks any
8267         captured information for a toplevel block and ScopeInfo used to
8268         track the activation frames for various local variables.   
8269
8270         Each toplevel block has an optional capture context associated
8271         with it.  When a method contains an anonymous method both the
8272         toplevel method and the anonymous method will create a capture
8273         context.   When variables or parameters are captured, they are
8274         recorded on the CaptureContext that owns them, for example:
8275
8276         void Demo () {
8277              int a;
8278              MyDelegate d = delegate {
8279                  a = 1;
8280              }
8281         }
8282
8283         Here `a' will be recorded as captured on the toplevel
8284         CapturedContext, the inner captured context will not have anything
8285         (it will only have data if local variables or parameters from it
8286         are captured in a nested anonymous method.
8287
8288         The ScopeInfo is used to track the activation frames for local
8289         variables, for example:
8290
8291         for (int i = 0; i < 10; i++)
8292                 for (int j = 0; j < 10; j++){
8293                    MyDelegate d = delegate {
8294                         call (i, j);
8295                    }
8296                 }
8297
8298         At runtime this captures a single captured variable `i', but it
8299         captures 10 different versions of the variable `j'.  The variable
8300         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
8301         recorded on a child.  
8302
8303         The toplevel ScopeInfo will also track information like the `this'
8304         pointer if instance variables were referenced (this is necessary
8305         as the anonymous method lives inside a nested class in the host
8306         type of the method). 
8307
8308         (AnonymousMethod): Expanded to track the Toplevel, implement
8309         `AnonymousMethod.Compatible' to tell whether an anonymous method
8310         can be converted to a target delegate type. 
8311
8312         The routine now also produces the anonymous method content
8313
8314         (AnonymousDelegate): A helper class that derives from
8315         DelegateCreation, this is used to generate the code necessary to
8316         produce the delegate for the anonymous method that was created. 
8317
8318         * assign.cs: API adjustments for new changes in
8319         Convert.ImplicitStandardConversionExists.
8320
8321         * class.cs: Adjustments to cope with the fact that now toplevel
8322         blocks are of type `ToplevelBlock'. 
8323
8324         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
8325         insteda of standard blocks.
8326
8327         Flag errors if params arguments are passed to anonymous methods.
8328
8329         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
8330         `CurrentAnonymousMethod' which points to the current Anonymous
8331         Method.  The variable points to the AnonymousMethod class that
8332         holds the code being compiled.  It is set in the new EmitContext
8333         created for the anonymous method.
8334
8335         (EmitContext.Phase): Introduce a variable and an enumeration to
8336         assist in enforcing some rules about when and where we are allowed
8337         to invoke certain methods (EmitContext.NeedsReturnLabel is the
8338         only one that enfonces this right now).
8339
8340         (EmitContext.HaveCaptureInfo): new helper method that returns
8341         whether we have a CapturedContext initialized.
8342
8343         (EmitContext.CaptureVariable): New method used to register that a
8344         LocalInfo must be flagged for capturing. 
8345
8346         (EmitContext.CapturedParameter): New method used to register that a
8347         parameters must be flagged for capturing. 
8348         
8349         (EmitContext.CapturedField): New method used to register that a
8350         field must be flagged for capturing. 
8351
8352         (EmitContext.HaveCapturedVariables,
8353         EmitContext.HaveCapturedFields): Return whether there are captured
8354         variables or fields. 
8355
8356         (EmitContext.EmitMethodHostInstance): This is used to emit the
8357         instance for the anonymous method.  The instance might be null
8358         (static methods), this (for anonymous methods that capture nothing
8359         and happen to live side-by-side with the current method body) or a
8360         more complicated expression if the method has a CaptureContext.
8361
8362         (EmitContext.EmitTopBlock): Routine that drives the emission of
8363         code: it will first resolve the top block, then emit any metadata
8364         and then emit the code.  The split is done so that we can extract
8365         any anonymous methods and flag any captured variables/parameters.
8366         
8367         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
8368         during this phase, the ILGenerator should not be used as labels
8369         and local variables declared here might not be accessible to any
8370         code that is part of an anonymous method.  
8371
8372         Exceptions to this include the temporary variables that are
8373         created by some statements internally for holding temporary
8374         variables. 
8375         
8376         (EmitContext.EmitMeta): New routine, in charge of emitting all the
8377         metadata for a cb
8378
8379         (EmitContext.TemporaryReturn): This method is typically called
8380         from the Emit phase, and its the only place where we allow the
8381         ReturnLabel to be defined other than the EmitMeta.  The reason is
8382         that otherwise we would have to duplicate a lot of logic in the
8383         Resolve phases of various methods that today is on the Emit
8384         phase. 
8385
8386         (EmitContext.NeedReturnLabel): This no longer creates the label,
8387         as the ILGenerator is not valid during the resolve phase.
8388
8389         (EmitContext.EmitThis): Extended the knowledge in this class to
8390         work in anonymous methods in addition to iterators. 
8391
8392         (EmitContext.EmitCapturedVariableInstance): This emits whatever
8393         code is necessary on the stack to access the instance to a local
8394         variable (the variable will be accessed as a field).
8395
8396         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
8397         EmitContext.EmitAddressOfParameter): Routines to support
8398         parameters (not completed at this point). 
8399         
8400         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
8401         will also remove the parameters.
8402
8403         * convert.cs (Convert): Define a `ConstantEC' which points to a
8404         null.  This is just to prefity some code that uses
8405         ImplicitStandardConversion code and do not have an EmitContext
8406         handy.
8407
8408         The idea is to flag explicitly that at that point in time, it is
8409         known that the conversion will not trigger the delegate checking
8410         code in implicit conversions (which requires a valid
8411         EmitContext). 
8412
8413         Everywhere: pass new EmitContext parameter since
8414         ImplicitStandardConversionExists now requires it to check for
8415         anonymous method conversions. 
8416
8417         (Convert.ImplicitStandardConversionExists): If the type of an
8418         expression is the anonymous_method_type, and the type is a
8419         delegate, we invoke the AnonymousMethod.Compatible method to check
8420         whether an implicit conversion is possible. 
8421
8422         (Convert.ImplicitConversionStandard): Only do implicit method
8423         group conversions if the language level is not ISO_1.
8424
8425         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
8426         MethodInfo for the Invoke method.  used by Delegate and
8427         AnonymousDelegate.
8428
8429         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
8430         method conversions if the target type is a delegate.
8431
8432         Removed extra debugging nops.
8433
8434         (LocalVariableReference): Turn the `local_info' into a public
8435         field. 
8436
8437         Add `prepared' field, the same hack used for FieldExprs to cope
8438         with composed assignments, as Local variables do not necessarily
8439         operate purely on the stack as they used to: they can be captured
8440         fields. 
8441
8442         Add `temp' for a temporary result, like fields.
8443
8444         Refactor DoResolve and DoResolveLValue into DoResolveBase.
8445
8446         It now copes with Local variables that are captured and emits the
8447         proper instance variable to load it from a field in the captured
8448         case. 
8449
8450         (ParameterReference.DoResolveBase): During the resolve phase,
8451         capture parameters if we are in an anonymous method.
8452
8453         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
8454         anonymous method, use the EmitContext helper routines to emit the
8455         parameter reference.
8456
8457         * iterators.cs: Set RemapToProxy to true/false during the
8458         EmitDispose class.
8459
8460         * parameters.cs (GetParameterByName): New helper method. 
8461
8462         * typemanager.cs (anonymous_method_type) a new type that
8463         represents an anonyous method.  This is always an internal type,
8464         used as a fencepost to test against the anonymous-methodness of an
8465         expression. 
8466         
8467 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
8468
8469         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
8470         561 report.
8471         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
8472
8473 2004-10-18  Martin Baulig  <martin@ximian.com>
8474
8475         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
8476         `Type' directly, but call ResolveType() on it.
8477         (Catch.Resolve): Likewise.
8478         (Foreach.Resolve): Likewise.
8479
8480 2004-10-18  Martin Baulig  <martin@ximian.com>
8481
8482         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
8483         `Type' directly, but call ResolveType() on it.
8484         (Probe.DoResolve): Likewise.
8485         (ArrayCreation.LookupType): Likewise.
8486         (TypeOf.DoResolve): Likewise.
8487         (SizeOf.DoResolve): Likewise.
8488
8489 2004-10-18  Martin Baulig  <martin@ximian.com>
8490
8491         * expression.cs (Invocation.BetterFunction): Put back
8492         TypeManager.TypeToCoreType().
8493
8494 2004-10-18  Raja R Harinath  <rharinath@novell.com>
8495
8496         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
8497         the ResolveType.
8498
8499 2004-10-18  Martin Baulig  <martin@ximian.com>
8500
8501         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
8502         `Type' directly, but call ResolveType() on it.
8503
8504 2004-10-18  Martin Baulig  <martin@ximian.com>
8505
8506         * class.cs (FieldMember.Define): Don't access the TypeExpr's
8507         `Type' directly, but call ResolveType() on it.
8508         (MemberBase.DoDefine): Likewise.
8509
8510         * expression.cs (New.DoResolve): Don't access the TypeExpr's
8511         `Type' directly, but call ResolveType() on it.
8512         (ComposedCast.DoResolveAsTypeStep): Likewise.
8513
8514         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
8515         `Type' directly, but call ResolveType() on it.
8516
8517 2004-10-17  John Luke  <john.luke@gmail.com>
8518
8519         * class.cs (Operator.GetSignatureForError): use CSharpName
8520
8521         * parameter.cs (Parameter.GetSignatureForError): Returns
8522         correct name even if was not defined.
8523
8524 2004-10-13  Raja R Harinath  <rharinath@novell.com>
8525
8526         Fix #65816.
8527         * class.cs (TypeContainer.EmitContext): New property.
8528         (DefineNestedTypes): Create an emitcontext for each part.
8529         (MethodCore.DoDefineParameters): Use container's emitcontext.
8530         Pass type array to InternalParameters.
8531         (MemberBase.DoDefine): Use container's emitcontext.
8532         (FieldMember.Define): Likewise.
8533         (Event.Define): Likewise.
8534         (SetMethod.GetParameterInfo): Change argument to EmitContext.
8535         Pass type array to InternalParameters.
8536         (SetIndexerMethod.GetParameterInfo): Likewise.
8537         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8538         * delegate.cs (Define): Pass emitcontext to
8539         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
8540         array to InternalParameters.
8541         * expression.cs (ParameterReference.DoResolveBase): Pass
8542         emitcontext to GetParameterInfo.
8543         (ComposedCast.DoResolveAsTypeStep): Remove check on
8544         ec.ResolvingTypeTree.
8545         * parameter.cs (Parameter.Resolve): Change argument to
8546         EmitContext.  Use ResolveAsTypeTerminal.
8547         (Parameter.GetSignature): Change argument to EmitContext.
8548         (Parameters.ComputeSignature): Likewise.
8549         (Parameters.ComputeParameterTypes): Likewise.
8550         (Parameters.GetParameterInfo): Likewise.
8551         (Parameters.ComputeAndDefineParameterTypes): Likewise.
8552         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
8553         * support.cs (InternalParameters..ctor): Remove variant that takes
8554         a DeclSpace.
8555         * typemanager.cs (system_intptr_expr): New.
8556         (InitExpressionTypes): Initialize it.
8557
8558 2004-10-12  Chris Toshok  <toshok@ximian.com>
8559
8560         * cs-parser.jay: fix location for try_statement and catch_clause.
8561
8562 2004-10-11  Martin Baulig  <martin@ximian.com>
8563
8564         * report.cs: Don't make --fatal abort on warnings, we have
8565         -warnaserror for that.
8566
8567 2004-10-07  Raja R Harinath  <rharinath@novell.com>
8568
8569         More DeclSpace.ResolveType avoidance.
8570         * decl.cs (MemberCore.InUnsafe): New property.
8571         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
8572         with newly created EmitContext.
8573         (FieldMember.Define): Likewise.
8574         * delegate.cs (Delegate.Define): Likewise.
8575         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
8576         only if normal name-lookup fails.
8577         (TypeExpr.DoResolve): Enable error-checking.
8578         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
8579         (SizeOf.DoResolve): Likewise.
8580         (ComposedCast.DoResolveAsTypeStep): Likewise.
8581         (StackAlloc.DoResolve): Likewise.
8582         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
8583         (Block.Unsafe): New property.
8584         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
8585         (Unsafe): Set 'unsafe' flag of contained block.
8586         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
8587         (Fixed.Resolve): Likewise.
8588         (Catch.Resolve): Likewise.
8589         (Using.ResolveLocalVariableDecls): Likewise.
8590         (Foreach.Resolve): Likewise.
8591
8592 2004-10-05  John Luke <john.luke@gmail.com>
8593
8594         * cs-parser.jay: add location to error CS0175
8595
8596 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
8597
8598         * ecore.cs (Expression.Constantity): Add support for turning null
8599         into a constant.
8600
8601         * const.cs (Const.Define): Allow constants to be reference types
8602         as long as the value is Null.
8603
8604 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
8605
8606         * namespace.cs (NamespaceEntry.Using): No matter which warning
8607         level is set, check if this namespace name has already been added.
8608
8609 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
8610
8611         * expression.cs: reftype [!=]= null should always use br[true,false].
8612         # 67410
8613
8614 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
8615
8616         Fix #67108
8617         * attribute.cs: Enum conversion moved to 
8618         GetAttributeArgumentExpression to be applied to the all
8619         expressions.
8620
8621 2004-10-01  Raja R Harinath  <rharinath@novell.com>
8622
8623         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
8624         * class.c (TypeContainer.DefineType): Flag error if
8625         base types aren't accessible due to access permissions.
8626         * decl.cs (DeclSpace.ResolveType): Move logic to
8627         Expression.ResolveAsTypeTerminal.
8628         (DeclSpace.ResolveTypeExpr): Thin layer over
8629         Expression.ResolveAsTypeTerminal.
8630         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
8631         Refactor code into NestedAccess.  Use it.
8632         (DeclSpace.NestedAccess): New.
8633         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
8634         argument to silence errors.  Check access permissions.
8635         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
8636         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
8637         (Cast.DoResolve): Likewise.
8638         (New.DoResolve): Likewise.
8639         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
8640         (TypeOf.DoResolve): Likewise.
8641
8642         * expression.cs (Invocation.BetterConversion): Return the Type of
8643         the better conversion.  Implement section 14.4.2.3 more faithfully.
8644         (Invocation.BetterFunction): Make boolean.  Make correspondence to
8645         section 14.4.2.2 explicit.
8646         (Invocation.OverloadResolve): Update.
8647         (Invocation): Remove is_base field.
8648         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
8649         (Invocation.Emit): Likewise.
8650
8651 2004-09-27  Raja R Harinath  <rharinath@novell.com>
8652
8653         * README: Update to changes.
8654
8655 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
8656
8657         * cs-parser.jay: Reverted 642 warning fix.
8658
8659 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8660
8661         Fix bug #66615
8662         * decl.cs (FindMemberWithSameName): Indexer can have more than
8663         1 argument.
8664
8665 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8666
8667         * expression.cs (LocalVariableReference.DoResolveLValue):
8668         Do not report warning 219 for out values.
8669         (EmptyExpression.Null): New member to avoid extra allocations.
8670
8671 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8672
8673         * cs-parser.jay: Fix wrong warning 642 report.
8674
8675         * cs-tokenizer.cs (CheckNextToken): New helper;
8676         Inspect next character if is same as expected.
8677
8678 2004-09-23  Martin Baulig  <martin@ximian.com>
8679
8680         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8681         (Convert.ImplicitReferenceConversionExists): Likewise.
8682
8683 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8684
8685         * class.cs (Operator.Define): Add error 448 and 559 report.
8686
8687 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8688
8689         * class.cs (MemberBase.IsTypePermitted): New protected
8690         method for checking error CS0610.
8691
8692 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8693
8694         * class.cs (TypeContainer.HasExplicitLayout): New property
8695         Returns whether container has StructLayout attribute set Explicit.
8696         (FieldMember): New abstract class for consts and fields.
8697         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
8698         (Field): Reuse FieldMember.
8699
8700         * const.cs (Const): Reuse FieldMember.
8701
8702         * rootcontext.cs: EmitConstants call moved to class.
8703
8704 2004-09-22  Martin Baulig  <martin@ximian.com>
8705
8706         Thanks to Peter Sestoft for this bug report.
8707
8708         * expression.cs (Conditional): If both the `trueExpr' and the
8709         `falseExpr' is a NullLiteral, return a NullLiteral.
8710
8711 2004-09-22  Martin Baulig  <martin@ximian.com>
8712
8713         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
8714         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
8715         for the "get_Current" call.
8716
8717 2004-09-22  Martin Baulig  <martin@ximian.com>
8718
8719         Marek and me just fixed one of our oldest bugs: #28562 :-)
8720
8721         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
8722
8723         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
8724         we're an EnumConstant, just return that.
8725         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
8726         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
8727         to get the value which'll actually be written into the attribute.
8728         However, we have to use GetValue() to access the attribute's value
8729         in the compiler.        
8730
8731 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8732
8733         * constant.cs (Constant.IsNegative): New abstract property
8734         IsNegative.
8735
8736         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
8737         (StackAlloc.DoResolve): Reused IsNegative.
8738
8739 2004-09-21  Martin Baulig  <martin@ximian.com>
8740
8741         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
8742         if we're used in an iterator, we may be called from different
8743         methods.
8744
8745         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
8746         we actually have an exception block.
8747
8748 2004-09-20  John Luke <jluke@cfl.rr.com>
8749
8750         * class.cs, cs-parser.jay: Improve the error report for 1520:
8751         report the actual line where the error happens, not where the
8752         class was declared.
8753
8754         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
8755         Pass location information that was available elsewhere.
8756
8757 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
8758
8759         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
8760         runtime to delay sign assemblies.
8761
8762 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
8763
8764         * cs-parser.jay: Do not report the stack trace, this is barely
8765         used nowadays.
8766
8767 2004-08-22  John Luke  <john.luke@gmail.com>
8768  
8769         * driver.cs : check that a resource id is not already used
8770         before adding it, report CS1508 if it is, bug #63637
8771
8772 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
8773
8774         * ecore.cs: Removed dead code.
8775
8776 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
8777
8778         * class.cs: Do not report warning CS0067 on the interfaces.
8779
8780 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
8781
8782         * cs-parser.jay: Add error 504 report.
8783
8784 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
8785
8786         * rootcontext.cs: WarningLevel is 4 by default now.
8787
8788         * statement.cs (Fixed.Resolve): Do not null
8789         VariableInfo.
8790
8791 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
8792
8793         Fixed bug #55780
8794         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
8795         deep search when property is not virtual.
8796         (PropertyExpr.ResolveAccessors): Make one call for both
8797         accessors.
8798
8799 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
8800
8801         Fixed bug #65766
8802         * statement.cs: Error 152 report constains also location.
8803
8804 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
8805
8806         Fixed bug #65766
8807         * const.cs: Explicitly set constant as static.
8808
8809 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
8810
8811         Fixed bug #64226
8812         * cs-parser.jay: Add error 1017 report.
8813
8814 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
8815
8816         Fixed bug #59980, #64224
8817         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
8818
8819         * typemanager.cs (IsSpecialMethod): Simplified
8820
8821 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
8822
8823         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
8824         condition with better params.
8825
8826 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
8827
8828         Fixed bug #65238
8829         * attribute.cs (Resolve): Property has to have both
8830         accessors.
8831
8832 2004-09-14  Martin Baulig  <martin@ximian.com>
8833
8834         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
8835
8836 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
8837
8838         Fixed bug #61902
8839         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
8840         called and is obsolete then this member suppress message
8841         when call is inside next [Obsolete] method or type.
8842
8843         * expression.cs: Use TestObsoleteMethodUsage member.
8844
8845 2004-09-14  Martin Baulig  <martin@ximian.com>
8846
8847         * cs-parser.jay: Sync a bit with the GMCS version.
8848
8849 2004-09-14  Martin Baulig  <martin@ximian.com>
8850
8851         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
8852         (CSharpParser.yacc_verbose_flag): New public field.
8853
8854         * genericparser.cs: Removed.
8855
8856 2004-09-14  Raja R Harinath  <rharinath@novell.com>
8857
8858         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
8859
8860 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
8861
8862         * class.cs (MethodCore.CheckBase): Fix bug #65757.
8863
8864 2004-09-10  Martin Baulig  <martin@ximian.com>
8865
8866         Backported my MemberName changes from GMCS into MCS.
8867
8868         - we are now using a special `MemberName' class instead of using
8869         strings; in GMCS, the `MemberName' also contains the type
8870         arguments.
8871
8872         - changed the grammar rules a bit:
8873           * the old `member_name' is now a `namespace_or_type_name':
8874             The rule is that we use `namespace_or_type_name' everywhere
8875             where we expect either a "member name" (GetEnumerator) or a
8876             "member name" with an explicit interface name
8877             (IEnumerable.GetEnumerator).
8878             In GMCS, the explicit interface name may include type arguments
8879             (IEnumerable<T>.GetEnumerator).
8880           * we use `member_name' instead of just `IDENTIFIER' for
8881             "member names":
8882             The rule is that we use `member_name' wherever a member may
8883             have type parameters in GMCS.       
8884
8885         * decl.cs (MemberName): New public class.
8886         (MemberCore.MemberName): New public readonly field.
8887         (MemberCore.ctor): Take a `MemberName' argument, not a string.
8888         (DeclSpace): Likewise.
8889
8890         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
8891         * enum.cs (Enum.ctor): Likewise.
8892
8893         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
8894         MemberName.     
8895         (AliasEntry.ctor): Take a MemberName, not an Expression.
8896         (AliasEntry.UsingAlias): Likewise.
8897
8898         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
8899         (IMethodData.MemberName): Changed type from string to MemberName.
8900         (MemberBase.ExplicitInterfaceName): Likewise.
8901         (AbstractPropertyEventMethod.SetupName): Make this private.
8902         (AbstractPropertyEventMethod.ctor): Added `string prefix'
8903         argument; compute the member name here.
8904         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
8905         on the `member.MemberName' and the `prefix'.
8906
8907         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
8908         not `type_name'.
8909         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
8910         thus, we get a `MemberName' instead of a `string'.  These
8911         declarations may have type parameters in GMCS.
8912         (interface_method_declaration, delegate_declaration): Likewise.
8913         (class_declaration, interface_declaration): Likewise.
8914         (method_header): Use `namespace_or_type_name' instead of
8915         `member_name'.  We may be an explicit interface implementation.
8916         (property_declaration, event_declaration): Likewise.
8917         (member_name): This is now just an `IDENTIFIER', not a
8918         `namespace_or_type_name'.
8919         (type_name, interface_type): Removed.
8920         (namespace_or_type_name): Return a MemberName, not an Expression.
8921         (primary_expression): Use `member_name' instead of `IDENTIFIER';
8922         call GetTypeExpression() on the MemberName to get an expression.
8923         (IndexerDeclaration.interface_type): Changed type from string to
8924         MemberName.
8925         (MakeName): Operate on MemberName's instead of string's.
8926
8927 2004-09-13  Raja R Harinath  <rharinath@novell.com>
8928
8929         Fix bug #55770.
8930         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
8931         (NamespaceEntry.Lookup): Add new argument to flag if we want the
8932         lookup to avoid symbols introduced by 'using'.
8933         * rootcontext.cs (NamespaceLookup): Update.
8934
8935 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
8936
8937         * class.cs (TypeContainer.DoDefineMembers): Do not call
8938         DefineDefaultConstructor for static classes.
8939
8940 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
8941
8942         * attribute.cs (Attribute.Resolve): Add error 653 report.
8943
8944         * class.cs (Class.ApplyAttributeBuilder): Add error 641
8945         report.
8946         (Method.ApplyAttributeBuilder): Add error 685 report.
8947         (Operator.Define): Add error 564 report.
8948
8949         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
8950
8951         * expression.cs (Invocation.DoResolve): Add error
8952         245 and 250 report.
8953
8954         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
8955         error 674 report.
8956
8957 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8958
8959         * class.cs (ConstructorInitializer.Resolve):
8960         Wrong error number (515->516).
8961
8962 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8963
8964         * class.cs (Indexer.Define): Add error 631 report.
8965
8966 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8967
8968         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
8969
8970 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8971
8972         * expression.cs (Probe.DoResolve): Add error CS0241 report.
8973
8974 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
8975
8976         * cs-parser.jay: Added error CS0241 report.
8977
8978 2004-09-10  Raja R Harinath  <rharinath@novell.com>
8979
8980         * cs-parser.jay (fixed_statement): Introduce a scope for the
8981         declaration in the 'fixed' statement.
8982
8983 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8984
8985         * cs-parser.jay: Added CS0230 error report.
8986
8987 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8988
8989         * cs-parser.jay: Added errors CS0231 and CS0257 report.
8990
8991 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8992
8993         * expression.cs (Argument.Resolve): Added error CS0192 and
8994         CS0199 report.
8995
8996 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8997
8998         C# 2.0 #pragma warning feature
8999
9000         * cs-tokenizer.cs (PreProcessPragma): New method; 
9001         Handles #pragma directive.
9002
9003         * report.cs (WarningRegions): New class; Support
9004         class for #pragma warning directive. It tests whether
9005         warning is enabled for a given line.
9006
9007 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
9008
9009         * const.cs: Add more descriptive error report, tahnks to
9010         Sebastien. 
9011
9012 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
9013
9014         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
9015
9016 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
9017
9018         * expression.cs: Apply patch from Ben: Remove dead code from
9019         ArrayCreation, and remove the TurnintoConstant call in const.cs,
9020         as that code just threw an exception anwyays.
9021
9022         * const.cs: Remove the call to the turnintoconstant, for details
9023         see bug: #63144
9024         
9025         * literal.cs: The type of the null-literal is the null type;  So
9026         we use a placeholder type (literal.cs:System.Null, defined here)
9027         for it.
9028
9029         * expression.cs (Conditional.DoResolve): Remove some old code that
9030         is no longer needed, conversions have been fixed.
9031
9032         (ArrayCreationExpression.DoResolve): Return false if we fail to
9033         resolve the inner expression.
9034
9035 2004-09-07  Raja R Harinath  <rharinath@novell.com>
9036
9037         Fix test-290.cs.
9038         * cs-parser.jay (delegate_declaration): Record a delegate
9039         declaration as a type declaration.
9040         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
9041
9042 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
9043
9044         * parameter.cs: Do not crash if the type can not be resolved. 
9045
9046         * expression.cs: Report errors with unsafe pointers, fixes #64896
9047
9048 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
9049
9050         * expression.cs: Pointer arith always needs to do a conv.i
9051         if the operand is a long. fix 65320
9052
9053 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
9054
9055         Fixed cs0619-37.cs, cs0619-38.cs
9056
9057         * enum.cs (GetObsoleteAttribute): Removed.
9058
9059         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
9060         on Enum member is double staged. The first is tested member
9061         and then enum.
9062
9063 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
9064
9065         Fixed #56986, #63631, #65231
9066
9067         * class.cs: (TypeContainer.AddToMemberContainer): New method,
9068         adds member to name container.
9069         (TypeContainer.AddToTypeContainer): New method, adds type to
9070         name container.
9071         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
9072         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
9073         AddOperator): Simplified by reusing AddToMemberContainer.
9074         (TypeContainer.UserDefinedStaticConstructor): Changed to property
9075         instead of field.
9076         (Method.CheckForDuplications): Fixed implementation to test all
9077         possibilities.
9078         (MemberBase): Detection whether member is explicit interface
9079         implementation is now in constructor.
9080         (MemberBase.UpdateMemberName): Handles IndexerName.
9081         (Accessor): Changed to keep also location information.
9082         (AbstractPropertyEventMethod): Is derived from MemberCore.
9083         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
9084         will be emited or not.
9085         (PropertyBase.AreAccessorsDuplicateImplementation):
9086         Tests whether accessors are not in collision with some method.
9087         (Operator): Is derived from MethodCore to simplify common
9088         operations.
9089
9090         * decl.cs (Flags.TestMethodDuplication): Test for duplication
9091         must be performed.
9092         (DeclSpace.AddToContainer): Adds the member to defined_names
9093         table. It tests for duplications and enclosing name conflicts.
9094
9095         * enum.cs (EnumMember): Clean up to reuse the base structures
9096
9097 2004-09-03  Martin Baulig  <martin@ximian.com>
9098
9099         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9100         into TypeContainer, to make partial classes work again.
9101
9102 2004-09-03  Martin Baulig  <martin@ximian.com>
9103
9104         * rootcontext.cs (RootContext.V2): Removed.
9105
9106 2004-03-23  Martin Baulig  <martin@ximian.com>
9107
9108         * expression.cs (Invocation.OverloadResolve): Added `bool
9109         may_fail' argument and use it instead of the Location.IsNull() hack.
9110
9111 2004-09-03  Martin Baulig  <martin@ximian.com>
9112
9113         Merged latest changes into gmcs.  Please keep this comment in
9114         here, it makes it easier for me to see what changed in MCS since
9115         the last time I merged.
9116
9117 2004-09-03  Raja R Harinath  <rharinath@novell.com>
9118
9119         Fix #61128.
9120         * expression.cs (BetterConversion): Don't allow either conversion 
9121         to be null.  Remove redundant implicit conversion test when 'q ==
9122         null' -- when this function is invoked, we already know that the
9123         implicit conversion exists.
9124         (BetterFunction): Assume that 'best' is non-null.  Remove
9125         redundant reimplementation of IsApplicable when 'best' is null.
9126         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
9127         number of arguments.
9128         (IsAncestralType): Extract from OverloadResolve.
9129         (OverloadResolve): Make robust to the MethodGroupExpr being
9130         unsorted.  Implement all the logic of Section 14.5.5.1, and
9131         support overloading of methods from multiple applicable types.
9132         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
9133
9134         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
9135         (RealError, Warning): Append type of report to related symbol.
9136
9137 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
9138
9139         * enum.cs: Fixed CLS-Compliance checks for enum members.
9140         Error tests cs3008-8.cs, cs3014-8.cs
9141
9142 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
9143
9144         Fixed bug #62342, #63102
9145         * class.cs: ImplementIndexer uses member.IsExplicitImpl
9146         like ImplementMethod.
9147
9148 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
9149
9150         * attribute.cs (Attribute.GetAttributeArgumentExpression):
9151         Fixed bug #65170.
9152
9153 2004-09-02  Martin Baulig  <martin@ximian.com>
9154
9155         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9156         TypeManager.GetArgumentTypes() rather than calling GetParameters()
9157         on the MethodBase.
9158
9159 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
9160
9161         C# 2.0 Static classes implemented
9162
9163         * class.cs (TypeContainer): instance_constructors,
9164         initialized_fields, initialized_static_fields,
9165         default_constructor, base_inteface_types are protected to be
9166         accessible from StaticClass.
9167         (TypeContainer.DefineDefaultConstructor): New virtual method
9168         for custom default constructor generating
9169         (StaticClass): New class to handle "Static classes" feature.
9170
9171         * cs-parser.jay: Handle static keyword on class like instance
9172         of StaticClass.
9173
9174         * driver.cs: Added "/langversion" command line switch with two
9175         options (iso-1, default).
9176
9177 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
9178
9179         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
9180
9181 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
9182
9183         * delegate.cs: Style.
9184
9185 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9186
9187         * delegate.cs: Add seperate instance expr field for miguel.
9188
9189 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9190
9191         * PointerArithmetic (Resolve): make sure we are not doing
9192         pointer arith on void*. Also, make sure we are resolved
9193         by not setting eclass until resolve.
9194
9195         All callers: Make sure that PointerArithmetic gets resolved.
9196
9197 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9198
9199         * ArrayCreation (LookupType): If the type does not resolve 
9200         to an array, give an error.
9201
9202 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
9203
9204         * statement.cs (Try.Resolve): Fixed bug #64222
9205
9206 2004-08-27  Martin Baulig  <martin@ximian.com>
9207
9208         * class.cs
9209         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9210         crash here.     
9211
9212 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
9213
9214         * ecore.cs (Constantify): Get underlying type via
9215         System.Enum.GetUnderlyingType to avoid StackOverflow on the
9216         Windows in special cases.
9217
9218 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
9219
9220         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
9221         for obtaining also private methods.
9222         (GetRemoveMethod): Used GetRemoveMethod (true)
9223         for obtaining also private methods.
9224
9225 2004-08-24  Martin Baulig  <martin@ximian.com>
9226
9227         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
9228         MethodAttributes.HideBySig for operators.
9229
9230 2004-08-23  Martin Baulig  <martin@ximian.com>
9231
9232         Back to the old error reporting system :-)
9233
9234         * report.cs (Message): Removed.
9235         (Report.MessageData, ErrorData, WarningData): Removed.
9236         (Report.Error, Warning): Back to the old system.
9237
9238 2004-08-23  Martin Baulig  <martin@ximian.com>
9239
9240         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
9241
9242         * class.cs (TypeContainer.ParentContainer): New public virtual
9243         method; replaces the explicit interface implementation.
9244         (ClassPart.ParentContainer): Override.
9245
9246 2004-08-23  Martin Baulig  <martin@ximian.com>
9247
9248         * statement.cs (Switch): Added support for constant switches; see
9249         #59428 or test-285.cs.
9250
9251 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
9252
9253         Fixed bug #62740.
9254         * statement.cs (GetEnumeratorFilter): Removed useless
9255         logic because C# specs is strict. GetEnumerator must be
9256         public.
9257
9258 2004-08-22  Martin Baulig  <martin@ximian.com>
9259
9260         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9261         a switch and may break, reset the barrier.  Fixes #59867.
9262
9263 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
9264
9265         CLS-Compliance speed up (~5% for corlib)
9266
9267         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
9268         New method. Tests container for CLS-Compliant names
9269
9270         * class.cs (TypeContainer.VerifyClsName): New method.
9271         Checks whether container name is CLS Compliant.
9272         (Constructor): Implements IMethodData.
9273
9274         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
9275         low-case table for CLS Compliance test.
9276         (MemberCache.VerifyClsParameterConflict): New method.
9277         Checks method parameters for CS3006 error.
9278
9279         * enum.cs (EnumMember): Is derived from MemberCore.
9280         (Enum.VerifyClsName): Optimized for better performance.
9281
9282 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
9283
9284         * report.cs: Renamed Error_T to Error and changed all
9285         references.
9286
9287 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
9288
9289         * class.cs (TypeContainer.IndexerArrayList): New inner class
9290         container for indexers.
9291         (TypeContainer.DefaultIndexerName): New constant for default
9292         indexer name. Replaced all "Item" with this constant.
9293         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
9294
9295         * typemanager.cs (TypeManager.default_member_ctor): Cache here
9296         DefaultMemberAttribute constructor.
9297
9298 2004-08-05  Martin Baulig  <martin@ximian.com>
9299
9300         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9301         Fix bug #59429.
9302
9303 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
9304
9305         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
9306         multi platforms problem.
9307
9308         * compiler.csproj: Included shared files.
9309
9310 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9311
9312         Fix bug 60333, 55971 in the more general way
9313         * attribute.cs (Attribute.GetAttributeArgumentExpression):
9314         Added arg_type argument for constant conversion.
9315         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
9316
9317 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9318
9319         Fix bug #59760
9320         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
9321         OperatorArrayList, MethodCoreArrayList for typecontainer
9322         containers. Changed class member types to these new types.
9323         (MethodArrayList.DefineMembers): Added test for CS0659.
9324
9325 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
9326
9327         * cfold.cs: Synchronize the folding with the code in expression.cs
9328         Binary.DoNumericPromotions for uint operands.
9329
9330         * attribute.cs: Revert patch from Raja, it introduced a regression
9331         while building Blam-1.2.1 (hard to isolate a test case).
9332
9333 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9334
9335         Fix for #55382
9336         * class.cs:
9337         (TypeContainer.Define): Renamed to DefineContainerMembers because of
9338         name collision.
9339         (MethodCore.parent_method): New member. The method we're overriding
9340         if this is an override method.
9341         (MethodCore.CheckBase): Moved from Method class and made common.
9342         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
9343         private.
9344         (MethodCore.CheckForDuplications): New abstract method. For custom
9345         member duplication search in a container
9346         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
9347         method and its return type.
9348         (Event.conflict_symbol): New member. Symbol with same name in the
9349         parent class.
9350
9351         * decl.cs:
9352         (MemberCache.FindMemberWithSameName): New method. The method
9353         is looking for conflict with inherited symbols.
9354
9355 2004-08-04  Martin Baulig  <martin@ximian.com>
9356
9357         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9358
9359         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9360
9361 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9362
9363         * report.cs (Message): New enum for better error, warning reference in
9364         the code.
9365         (MessageData): New inner abstract class. It generally handles printing of
9366         error and warning messages.
9367         Removed unused Error, Warning, Message methods.
9368
9369 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9370
9371         Fix for cs0592-8.cs test
9372         * attribute.cs
9373         (Attributable.ValidAttributeTargets): Made public.
9374         (Attribute.ExplicitTarget): New member for explicit target value.
9375         (Attribute.CheckTargets): Now we translate explicit attribute
9376         target to Target here.
9377
9378 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
9379
9380         * ecore.cs (MethodGroupExpr): new IsBase property.
9381
9382         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
9383
9384         * delegate.cs (DelegateCreation): store a MethodGroupExpr
9385         rather than an instance expr.
9386
9387         (DelegateCreation.Emit): Use the method group rather than
9388         the instance expression. Also, if you have base.Foo as the
9389         method for a delegate, make sure to emit ldftn, not ldftnvirt.
9390
9391         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
9392
9393         (NewDelegate.DoResolve): Only check for the existance of Invoke
9394         if the method is going to be needed. Use MethodGroupExpr.
9395
9396         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
9397
9398         * expression.cs: For pointer arith., make sure to use
9399         the size of the type, not the size of the pointer to
9400         the type.
9401
9402 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9403
9404         Fix for #60722
9405         * class.cs (Class): Added error CS0502 test.
9406
9407 2004-08-03  John Luke  <jluke@cfl.rr.com>
9408             Raja R Harinath  <rharinath@novell.com>
9409
9410         Fix for #60997.
9411         * attribute.cs (Attribute.complained_before): New flag.
9412         (Attribute.ResolveType, Attribute.Resolve),
9413         (Attribute.DefinePInvokeMethod): Set it.
9414         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
9415         
9416 2004-08-03  Martin Baulig  <martin@ximian.com>
9417
9418         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9419         use a user-defined operator; we still need to do numeric
9420         promotions in case one argument is a builtin type and the other
9421         one has an implicit conversion to that type.  Fixes #62322.
9422
9423 2004-08-02  Martin Baulig  <martin@ximian.com>
9424
9425         * statement.cs (LocalInfo.Flags): Added `IsThis'.
9426         (LocalInfo.IsThis): New public property.
9427         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
9428
9429 2004-08-01  Martin Baulig  <martin@ximian.com>
9430
9431         * class.cs (TypeContainer.GetClassBases): Don't set the default
9432         here since we may get called from GetPartialBases().
9433         (TypeContainer.DefineType): If GetClassBases() didn't return a
9434         parent, use the default one.
9435
9436 2004-07-30  Duncan Mak  <duncan@ximian.com>
9437
9438         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
9439
9440 2004-07-30  Martin Baulig  <martin@ximian.com>
9441
9442         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
9443
9444         * class.cs (SourceMethod): New public class, derive from the
9445         symbol writer's ISourceMethod.
9446         (Method): Use the new symbol writer API.
9447
9448         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
9449         as argument and use the new symbol writer.
9450
9451         * location.cs
9452         (SourceFile): Implement the symbol writer's ISourceFile.
9453         (Location.SymbolDocument): Removed.
9454         (Location.SourceFile): New public property.
9455
9456         * symbolwriter.cs: Use the new symbol writer API.
9457
9458 2004-07-30  Raja R Harinath  <rharinath@novell.com>
9459
9460         * Makefile (install-local): Remove.  Functionality moved to
9461         executable.make.
9462
9463 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
9464
9465         * Makefile: Install mcs.exe.config file together with mcs.exe.
9466         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
9467         correct runtime version.
9468         
9469 2004-07-25  Martin Baulig  <martin@ximian.com>
9470
9471         * class.cs
9472         (TypeContainer.RegisterOrder): Removed, this was unused.
9473         (TypeContainer, interface_order): Removed.
9474         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
9475         TypeContainer as argument since we can also be called with a
9476         `PartialContainer' for a partial class/struct/interface.
9477         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
9478         of checking whether we're an `Interface' - we could be a
9479         `PartialContainer'.
9480         (PartialContainer.Register): Override; call
9481         AddClass()/AddStruct()/AddInterface() on our parent.
9482
9483         * cs-parser.jay (interface_member_declaration): Add things to the
9484         `current_container', not the `current_class'.
9485
9486         * rootcontext.cs (RegisterOrder): The overloaded version which
9487         takes an `Interface' was unused, removed.
9488
9489         * typemanager.cs (TypeManager.LookupInterface): Return a
9490         `TypeContainer', not an `Interface'.
9491         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
9492         contain a `PartialContainer' for an interface, so check it's
9493         `Kind' to figure out what it is.
9494
9495 2004-07-25  Martin Baulig  <martin@ximian.com>
9496
9497         * class.cs (Class.DefaultTypeAttributes): New public constant.
9498         (Struct.DefaultTypeAttributes): Likewise.
9499         (Interface.DefaultTypeAttributes): Likewise.
9500         (PartialContainer.TypeAttr): Override this and add the
9501         DefaultTypeAttributes.
9502
9503 2004-07-25  Martin Baulig  <martin@ximian.com>
9504
9505         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
9506         we can just use the `Parent' field instead.
9507
9508 2004-07-25  Martin Baulig  <martin@ximian.com>
9509
9510         * class.cs (TypeContainer.Emit): Renamed to EmitType().
9511
9512 2004-07-25  Martin Baulig  <martin@ximian.com>
9513
9514         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
9515         our parts before defining any methods.
9516         (TypeContainer.VerifyImplements): Make this virtual.
9517         (ClassPart.VerifyImplements): Override and call VerifyImplements()
9518         on our PartialContainer.
9519
9520 2004-07-25  Martin Baulig  <martin@ximian.com>
9521
9522         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
9523
9524         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
9525         argument, we can just use the `Parent' field instead.
9526
9527         * class.cs
9528         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
9529         (MemberBase.DoDefine): Likewise.
9530
9531 2004-07-24  Martin Baulig  <martin@ximian.com>
9532
9533         * decl.cs (MemberCore.Parent): New public field.
9534         (DeclSpace.Parent): Moved to MemberCore.
9535
9536         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
9537         (MemberBase.ctor): Added TypeContainer argument, pass it to our
9538         parent's .ctor.
9539         (FieldBase, Field, Operator): Likewise.
9540         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
9541         (EventField, Event): Likewise.
9542
9543 2004-07-23  Martin Baulig  <martin@ximian.com>
9544
9545         * class.cs (PartialContainer): New public class.
9546         (ClassPart): New public class.
9547         (TypeContainer): Added support for partial classes.
9548         (TypeContainer.GetClassBases): Splitted some of the functionality
9549         out into GetNormalBases() and GetPartialBases().
9550
9551         * cs-tokenizer.cs (Token.PARTIAL): New token.
9552         (Tokenizer.consume_identifier): Added some hacks to recognize
9553         `partial', but only if it's immediately followed by `class',
9554         `struct' or `interface'.
9555
9556         * cs-parser.jay: Added support for partial clases.
9557
9558 2004-07-23  Martin Baulig  <martin@ximian.com>
9559
9560         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
9561         a `DeclSpace' and also made it readonly.
9562         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
9563         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
9564         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
9565
9566         * cs-parser.jay: Pass the `current_class', not the
9567         `current_container' (at the moment, this is still the same thing)
9568         to a new Method, Property, Event, Indexer or Constructor.
9569
9570 2004-07-23  Martin Baulig  <martin@ximian.com>
9571
9572         * cs-parser.jay (CSharpParser): Added a new `current_class' field
9573         and removed the `current_interface' one.
9574         (struct_declaration, class_declaration, interface_declaration):
9575         Set `current_class' to the newly created class/struct/interface;
9576         set their `Bases' and call Register() before parsing their body.
9577
9578 2004-07-23  Martin Baulig  <martin@ximian.com>
9579
9580         * class.cs (Kind): New public enum.
9581         (TypeContainer): Made this class abstract.
9582         (TypeContainer.Kind): New public readonly field.
9583         (TypeContainer.CheckDef): New public method; moved here from
9584         cs-parser.jay.
9585         (TypeContainer.Register): New public abstract method.
9586         (TypeContainer.GetPendingImplementations): New public abstract
9587         method.
9588         (TypeContainer.GetClassBases): Removed the `is_class' and
9589         `is_iface' parameters.
9590         (TypeContainer.DefineNestedTypes): Formerly known as
9591         DoDefineType().
9592         (ClassOrStruct): Made this class abstract.
9593
9594         * tree.cs (RootTypes): New public type. 
9595
9596 2004-07-20  Martin Baulig  <martin@ximian.com>
9597
9598         * tree.cs (Tree.RecordNamespace): Removed.
9599         (Tree.Namespaces): Removed.
9600
9601         * rootcontext.cs (RootContext.IsNamespace): Removed.
9602
9603         * cs-parser.jay (namespace_declaration): Just create a new
9604         NamespaceEntry here.
9605
9606 2004-07-20  Martin Baulig  <martin@ximian.com>
9607
9608         * statement.cs (ExceptionStatement): New abstract class.  This is
9609         now used as a base class for everyone who's using `finally'.
9610         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
9611         our local variables before using them.
9612
9613         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
9614         virtual method.  This is used by Yield.Resolve() to "steal" an
9615         outer block's `finally' clauses.
9616         (FlowBranchingException): The .ctor now takes an ExceptionStatement
9617         argument.
9618
9619         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
9620         version which takes an ExceptionStatement.  This version must be
9621         used to create exception branchings.
9622
9623         * iterator.cs
9624         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
9625         (Iterator.EmitMoveNext): Added exception support; protect the
9626         block with a `fault' clause, properly handle 'finally' clauses.
9627         (Iterator.EmitDispose): Run all the `finally' clauses here.
9628
9629 2004-07-20  Martin Baulig  <martin@ximian.com>
9630
9631         * iterator.cs: This is the first of a set of changes in the
9632         iterator code.  Match the spec more closely: if we're an
9633         IEnumerable, then GetEnumerator() must be called.  The first time
9634         GetEnumerator() is called, it returns the current instance; all
9635         subsequent invocations (if any) must create a copy.
9636
9637 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
9638
9639         * expression.cs: Resolve the constant expression before returning
9640         it. 
9641
9642 2004-07-19  Martin Baulig  <martin@ximian.com>
9643
9644         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
9645         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
9646         the return type of the new EmitContext.
9647
9648 2004-07-18  Martin Baulig  <martin@ximian.com>
9649
9650         * class.cs (Property.Define): Fix iterators.
9651
9652         * iterators.cs (Iterator.Define): Moved the
9653         `container.AddInterator (this)' call here from the .ctor; only do
9654         it if we resolved successfully.
9655
9656 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
9657
9658         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
9659         `true' for preprocessing directives that we parse.  The return
9660         value indicates whether we should return to regular tokenizing or
9661         not, not whether it was parsed successfully.
9662
9663         In the past if we were in: #if false ... #line #endif, we would
9664         resume parsing after `#line'.  See bug 61604.
9665
9666         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
9667         building: IsEnumType should return true only for enums, not for
9668         enums or System.Enum itself.  This fixes #61593.
9669
9670         Likely what happened is that corlib was wrong: mcs depended on
9671         this bug in some places.  The bug got fixed, we had to add the
9672         hack, which caused bug 61593.
9673
9674         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
9675         that was a workaround for the older conditions.
9676
9677 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
9678
9679         * assign.cs: IAssignMethod has a new interface, as documented
9680         inline. All assignment code now uses this new api.
9681
9682         * ecore.cs, expression.cs: All classes which implement
9683         IAssignMethod now use the new interface.
9684
9685         * expression.cs (Invocation): add a hack to EmitCall so that
9686         IndexerAccess can be the target of a compound assignment without
9687         evaluating its arguments twice.
9688
9689         * statement.cs: Handle changes in Invocation api.
9690
9691 2004-07-16  Martin Baulig  <martin@ximian.com>
9692
9693         * iterators.cs: Rewrote this.  We're now using one single Proxy
9694         class for both the IEnumerable and the IEnumerator interface and
9695         `Iterator' derives from Class so we can use the high-level API.
9696
9697         * class.cs (TypeContainer.AddIterator): New method.
9698         (TypeContainer.DoDefineType): New protected virtual method, which
9699         is called from DefineType().
9700         (TypeContainer.DoDefineMembers): Call DefineType() and
9701         DefineMembers() on all our iterators.
9702         (TypeContainer.Emit): Call Emit() on all our iterators.
9703         (TypeContainer.CloseType): Call CloseType() on all our iterators.
9704
9705         * codegen.cs (EmitContext.CurrentIterator): New public field.
9706
9707 2004-07-15  Martin Baulig  <martin@ximian.com>
9708
9709         * typemanager.cs
9710         (TypeManager.not_supported_exception_type): New type.   
9711
9712 2004-07-14  Martin Baulig  <martin@ximian.com>
9713
9714         * iterators.cs: Use real error numbers.
9715
9716 2004-07-14  Martin Baulig  <martin@ximian.com>
9717
9718         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
9719         requires this to be a System.Collection.IEnumerable and not a
9720         class implementing that interface.
9721         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
9722
9723 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
9724
9725         * class.cs: Fixed previous fix, it broke some error tests.
9726
9727 2004-07-12  Martin Baulig  <martin@ximian.com>
9728
9729         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
9730         Fixes #61293.
9731
9732 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
9733
9734         * assign.cs (LocalTemporary): Add new argument: is_address,If
9735         `is_address' is true, then the value that we store is the address
9736         to the real value, and not the value itself.
9737         
9738         * ecore.cs (PropertyExpr): use the new local temporary
9739         stuff to allow us to handle X.Y += z (where X is a struct)
9740
9741 2004-07-08  Martin Baulig  <martin@ximian.com>
9742
9743         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
9744         not always return, just like we're doing in Using.Resolve().
9745
9746 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
9747
9748         * cs-parser.jay (fixed_statement): flag this as Pinned.
9749
9750 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
9751
9752         * typemanager.cs (TypeManager): Removed MakePinned method, this
9753         mechanism is replaced with the .NET 2.x compatible mechanism of
9754         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
9755
9756         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
9757         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
9758         `IsFixed' property which has a different meaning.
9759
9760 2004-07-02  Raja R Harinath  <rharinath@novell.com>
9761
9762         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
9763         visible from inside a nested class, not just the names of the
9764         immediately enclosing class.
9765         Fix for bug #60730.
9766
9767 2004-06-24  Raja R Harinath  <rharinath@novell.com>
9768
9769         * expression.cs (BetterConversion): Remove buggy special-case
9770         handling of "implicit constant expression conversions".  At this
9771         point, we already know that the conversion is possible -- we're
9772         only checking to see which is better.
9773
9774 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9775
9776         * cs-parser.jay: Added error CS0210 test.
9777
9778 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9779
9780         * cs-parser.jay: Added error CS0134 test.
9781
9782 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9783
9784         Fix bug #52507
9785         * cs-parser.jay: Added error CS0145 test.
9786
9787 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9788
9789         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
9790
9791 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
9792         
9793         * expression.cs (StackAlloc.Resolve): The argument may not
9794         be a constant; deal with this case.
9795         
9796 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
9797
9798         * attribute.cs (IndexerName_GetIndexerName): Renamed to
9799         GetIndexerAttributeValue.
9800         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
9801
9802         * class.cs (Indexer.Define): Added error tests for CS0415,
9803         CS0609.
9804
9805 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
9806
9807         * attribute.cs (Attribute.Resolve): Keep field code in sync with
9808         property code.
9809
9810 2004-06-23  Martin Baulig  <martin@ximian.com>
9811
9812         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
9813         neither return nor throw, reset the barrier as well.  Fixes #60457.
9814
9815 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
9816
9817         * class.cs : EventAttributes is now set to None by default.
9818           This fixes bug #60459.
9819
9820 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
9821
9822         Fix bug #60219
9823         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9824         Don't throw exception but return null (it's sufficient now).
9825
9826 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
9827
9828         * typemanager.cs (GetArgumentTypes): Faster implementation.
9829
9830 2004-06-18  Martin Baulig  <martin@ximian.com>
9831
9832         * attribute.cs (Attribute.Resolve): Check whether we're an
9833         EmptyCast which a Constant child.  Fixes #60333.
9834
9835 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
9836
9837         * statement.cs (EmitCollectionForeach): Account for the fact that
9838         not all valuetypes are in areas which we can take the address of.
9839         For these variables, we store to a temporary variable. Also, make
9840         sure that we dont emit a `callvirt' on a valuetype method.
9841
9842 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9843
9844         * expression.cs (StackAlloc.DoReSolve): Added test for
9845         negative parameter (CS0247).
9846
9847 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9848
9849         Fix bug #59792
9850         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
9851
9852 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9853
9854         Fix bug #59781
9855         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
9856         ulong.
9857
9858 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
9859
9860         Fix bug #58254 & cs1555.cs, cs1556.cs
9861         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
9862
9863 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
9864
9865         * cs-parser.jay: Added error CS1669 test for indexers.
9866
9867 2004-06-11  Martin Baulig  <martin@ximian.com>
9868
9869         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
9870         call this twice: for params and varargs methods.
9871
9872 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9873
9874         * class.cs:
9875         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
9876
9877 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9878
9879         * attribute.cs (Attribute.GetValidTargets): Made public.
9880
9881         * class.cs: 
9882         (AbstractPropertyEventMethod): New class for better code sharing.
9883         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
9884         CS1667 report.
9885         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
9886
9887 2004-06-11  Raja R Harinath  <rharinath@novell.com>
9888
9889         Fix bug #59477.
9890         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
9891         that the call to Resolve is part of a MemberAccess.
9892         (Expression.Resolve): Use it for SimpleName resolution.
9893         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
9894         Add 'intermediate' boolean argument.
9895         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
9896         error message when the SimpleName can be resolved ambiguously
9897         between an expression and a type.
9898         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
9899         public.
9900         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
9901         call on the left-side.
9902
9903 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9904
9905         * class.cs:
9906         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
9907
9908 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9909
9910         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
9911
9912 2004-06-11  Martin Baulig  <martin@ximian.com>
9913
9914         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
9915         varargs methods if applicable.
9916
9917 2004-06-11  Martin Baulig  <martin@ximian.com>
9918
9919         * expression.cs (Invocation.EmitCall): Don't use
9920         `method.CallingConvention == CallingConventions.VarArgs' since the
9921         method could also have `CallingConventions.HasThis'.
9922
9923 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9924
9925         * class.cs (Event.GetSignatureForError): Implemented.
9926         Fixed crash in error test cs3010.cs
9927
9928 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
9929
9930         * cs-tokenizer.cs: Change the way we track __arglist to be
9931         consistent with the other keywords.
9932
9933 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
9934
9935         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
9936         tomorrow.
9937
9938 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
9939
9940         * codegen.cs: Check that all referenced assemblies have a strongname
9941         before strongnaming the compiled assembly. If not report error CS1577.
9942         Fix bug #56563. Patch by Jackson Harper.
9943         * typemanager.cs: Added a method to return all referenced assemblies.
9944         Fix bug #56563. Patch by Jackson Harper.
9945
9946 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
9947
9948         * class.cs:
9949         (Method.ApplyAttributeBuilder): Moved and added conditional
9950         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
9951
9952         * delegate.cs:
9953         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
9954
9955 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
9956
9957         Fixed #59640
9958         * class.cs: (EventField.attribute_targets): Changed default target.
9959
9960 2004-06-08  Martin Baulig  <martin@ximian.com>
9961
9962         * expression.cs (Invocation.EmitCall): Enable varargs methods.
9963
9964 2004-06-08  Martin Baulig  <martin@ximian.com>
9965
9966         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
9967
9968 2004-06-07  Martin Baulig  <martin@ximian.com>
9969
9970         Added support for varargs methods.
9971
9972         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
9973         keyword.
9974
9975         * cs-parser.jay: Added support for `__arglist'.
9976
9977         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
9978
9979         * expression.cs (Argument.AType): Added `ArgList'.
9980         (Invocation): Added support for varargs methods.
9981         (ArglistAccess): New public class.
9982         (Arglist): New public class.
9983
9984         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
9985
9986         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
9987         a method's top-level block if the method has varargs.
9988
9989         * support.cs (ReflectionParameters, InternalParameters): Added
9990         support for varargs methods.    
9991
9992 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
9993
9994         * class.cs: Provide location in indexer error report.
9995
9996         * driver.cs: Use standard names.
9997
9998         * namespace.cs: Catch the use of using after a namespace has been
9999         declared also on using aliases.
10000
10001 2004-06-03  Raja R Harinath  <rharinath@novell.com>
10002
10003         Bug #50820.
10004         * typemanager.cs (closure_private_ok, closure_invocation_type)
10005         (closure_qualifier_type, closure_invocation_assembly)
10006         (FilterWithClosure): Move to ...
10007         (Closure): New internal nested class.
10008         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
10009         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
10010         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
10011         (MemberLookup, MemberLookupFailed): Use it.
10012         * expression.cs (New.DoResolve): Treat the lookup for the
10013         constructor as being qualified by the 'new'ed type.
10014         (Indexers.GetIndexersForTypeOrInterface): Update.
10015
10016 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
10017
10018         * attribute.cs
10019         (GetConditionalAttributeValue): New method. Returns
10020         condition of ConditionalAttribute.
10021         (SearchMulti): New method.  Returns all attributes of type 't'.
10022         Use it when attribute is AllowMultiple = true.
10023         (IsConditionalMethodExcluded): New method.
10024
10025         * class.cs
10026         (Method.IsExcluded): Implemented. Returns true if method has conditional
10027         attribute and the conditions is not defined (method is excluded).
10028         (IMethodData): Extended interface for ConditionalAttribute support.
10029         (PropertyMethod.IsExcluded): Implemented.
10030
10031         * decl.cs
10032         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
10033
10034         * expression.cs
10035         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
10036         on the method.
10037
10038 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
10039
10040         * expression.cs (ArrayCreationExpression): Make this just an
10041         `expression'. It can't be a statement, so the code here was
10042         dead.
10043
10044 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
10045
10046         Fixed #59072
10047         * typemanager.cs (GetFullNameSignature): New method for
10048         MethodBase types.
10049
10050 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
10051
10052         Fixed #56452
10053         * class.cs (MemberBase.GetSignatureForError): New virtual method.
10054         Use this method when MethodBuilder is null.
10055         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
10056         Added test for error CS0626 (MONO reports error for this situation).
10057         (IMethodData.GetSignatureForError): Extended interface.
10058
10059 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
10060
10061         * attribute.cs
10062         (AttributeTester.GetObsoleteAttribute): Returns instance of
10063         ObsoleteAttribute when type is obsolete.
10064
10065         * class.cs
10066         (TypeContainer.VerifyObsoleteAttribute): Override.
10067         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
10068         (MethodCode.VerifyObsoleteAttribute): Override.
10069         (MemberBase.VerifyObsoleteAttribute): Override.
10070
10071         * decl.cs
10072         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
10073         and report proper error.
10074
10075         *delegate.cs
10076         Delegate.VerifyObsoleteAttribute): Override.
10077
10078         * ecore.cs
10079         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
10080         and report proper error.
10081         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
10082
10083         * enum.cs
10084         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
10085         and enum member.
10086
10087         * expression.cs
10088         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
10089         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
10090         Added test for ObsoleteAttribute.
10091
10092         * statement.cs
10093         (Catch): Derived from Statement.
10094
10095 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
10096  
10097         Fixed bug #59071 & cs0160.cs
10098  
10099         * statement.cs (Try.Resolve): Check here whether order of catch
10100         clauses matches their dependencies.
10101
10102 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
10103
10104         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
10105         caused a regression: #59343.  Referencing nested classes from an
10106         assembly stopped working.
10107
10108 2004-05-31  Martin Baulig  <martin@ximian.com>
10109
10110         MCS is now frozen for beta 2.
10111
10112 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10113
10114         * convert.cs: add a trivial cache for overload operator resolution.
10115
10116 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10117
10118         * decl.cs: If possible, use lookuptypedirect here. We can only do
10119         this if there is no `.' after the namespace. Avoids using
10120         LookupType, which does lots of slow processing.
10121         (FindNestedType) New method, does what it says :-).
10122         * namespace.cs: use LookupTypeDirect.
10123         * rootcontext.cs: use membercache, if possible.
10124         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10125
10126 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10127
10128         * expression.cs:
10129         According to the spec, 
10130
10131         In a member access of the form E.I, if E is a single identifier,
10132         and if the meaning of E as a simple-name (§7.5.2) is a constant,
10133         field, property, localvariable, or parameter with the same type as
10134         the meaning of E as a type-name (§3.8), then both possible
10135         meanings of E are permitted.
10136
10137         We did not check that E as a simple-name had the same type as E as
10138         a type name.
10139
10140         This trivial check gives us 5-7% on bootstrap time.
10141
10142 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10143
10144         * expression.cs (Invocation.OverloadResolve): Avoid the
10145         use of hashtables and boxing here by allocating on demand.
10146
10147 2004-05-30  Martin Baulig  <martin@ximian.com>
10148
10149         * rootcontext.cs (RootContext.LookupType): Don't cache things if
10150         we're doing a silent lookup.  Don't try to lookup nested types in
10151         TypeManager.object_type (thanks to Ben Maurer).
10152
10153 2004-05-30  Martin Baulig  <martin@ximian.com>
10154
10155         Committing a patch from Ben Maurer.
10156
10157         * rootcontext.cs (RootContext.LookupType): Cache negative results.
10158
10159 2004-05-29  Martin Baulig  <martin@ximian.com>
10160
10161         * class.cs (IMethodData.ShouldIgnore): New method.
10162
10163         * typemanager.cs (TypeManager.MethodFlags): Don't take a
10164         `Location' argument, we don't need it anywhere.  Use
10165         `IMethodData.ShouldIgnore ()' instead of
10166         `MethodData.GetMethodFlags ()'.
10167         (TypeManager.AddMethod): Removed.
10168         (TypeManager.AddMethod2): Renamed to AddMethod.
10169
10170 2004-05-29  Martin Baulig  <martin@ximian.com>
10171
10172         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
10173
10174         * convert.cs (Convert.ImplicitReferenceConversion): If we're
10175         converting from a class type S to an interface type and we already
10176         have an object on the stack, don't box it again.  Fixes #52578.
10177
10178 2004-05-29  Martin Baulig  <martin@ximian.com>
10179
10180         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10181         Added support for `params' parameters.  Fixes #59267.
10182
10183 2004-05-29  Martin Baulig  <martin@ximian.com>
10184
10185         * literal.cs (NullPointer): Provide a private .ctor which sets
10186         `type' to TypeManager.object_type.  Fixes #59048.
10187
10188 2004-05-29  Martin Baulig  <martin@ximian.com>
10189
10190         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
10191         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
10192
10193         * ecore.cs (EventExpr.instance_expr): Make the field private.
10194
10195 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
10196
10197         Fixed bug #50080 & cs0214-2.cs
10198         * expression.cs (Cast.DoResolve): Check unsafe context here.
10199         
10200         * statement.cs (Resolve.DoResolve): Likewise.
10201
10202 2004-05-26  Martin Baulig  <martin@ximian.com>
10203
10204         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
10205
10206         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
10207         (RootContext.LookupType): Pass down the `silent' flag.
10208
10209 2004-05-25  Martin Baulig  <martin@ximian.com>
10210
10211         * expression.cs
10212         (MethodGroupExpr.IdenticalTypeName): New public property.
10213         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
10214         expression actually refers to a type.
10215
10216 2004-05-25  Martin Baulig  <martin@ximian.com>
10217
10218         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
10219         for #56176 and made it actually work.
10220
10221 2004-05-25  Martin Baulig  <martin@ximian.com>
10222
10223         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
10224         (FieldExpr, PropertyExpr): Override and implement
10225         CacheTemporaries.  Fixes #52279.
10226
10227 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
10228
10229         * location.cs: In the new compiler listing a file twice is a
10230         warning, not an error.
10231
10232 2004-05-24  Martin Baulig  <martin@ximian.com>
10233
10234         * enum.cs (Enum.DefineType): For the `BaseType' to be a
10235         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
10236
10237 2004-05-24  Martin Baulig  <martin@ximian.com>
10238
10239         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
10240         walking the `using' list.  Fixes #53921.
10241
10242 2004-05-24  Martin Baulig  <martin@ximian.com>
10243
10244         * const.cs (Const.LookupConstantValue): Added support for
10245         EmptyCast's; fixes #55251.
10246
10247 2004-05-24  Martin Baulig  <martin@ximian.com>
10248
10249         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
10250         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
10251         which does the CS0135 check.  The reason is that we first need to
10252         check whether the variable actually exists.
10253
10254 2004-05-24  Martin Baulig  <martin@ximian.com>
10255
10256         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
10257         than RootContext.LookupType() to find the explicit interface
10258         type.  Fixes #58584.
10259
10260 2004-05-24  Raja R Harinath  <rharinath@novell.com>
10261
10262         * Makefile: Simplify.  Use executable.make.
10263         * mcs.exe.sources: New file.  List of sources of mcs.exe.
10264
10265 2004-05-24  Anders Carlsson  <andersca@gnome.org>
10266
10267         * decl.cs:
10268         * enum.cs:
10269         Use the invariant culture when doing String.Compare for CLS case
10270         sensitivity.
10271         
10272 2004-05-23  Martin Baulig  <martin@ximian.com>
10273
10274         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
10275         don't have any dots.  Fixes #52622, added cs0246-8.cs.
10276
10277         * namespace.cs (NamespaceEntry.Lookup): Likewise.
10278         
10279 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
10280
10281         * class.cs (MemberBase.Define): Reuse MemberType member for 
10282         resolved type. Other methods can use it too.
10283
10284 2004-05-23  Martin Baulig  <martin@ximian.com>
10285
10286         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
10287         the variable also exists in the current block (otherwise, we need
10288         to report a CS0103).  Fixes #58670.
10289
10290 2004-05-23  Martin Baulig  <martin@ximian.com>
10291
10292         * flowanalysis.cs (Reachability.Reachable): Compute this
10293         on-the-fly rather than storing it as a field.
10294
10295 2004-05-23  Martin Baulig  <martin@ximian.com>
10296
10297         * flowanalysis.cs (Reachability.And): Manually compute the
10298         resulting `barrier' from the reachability.      
10299        
10300 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
10301
10302         Fix bug #57835
10303         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
10304         instance of ObsoleteAttribute when symbol is obsolete.
10305
10306         * class.cs
10307         (IMethodData): Extended interface for ObsoleteAttribute support.
10308
10309 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
10310
10311         * attribute.cs: Fix bug #55970
10312
10313 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
10314
10315         Fix bug #52705
10316         * attribute.cs
10317         (GetObsoleteAttribute): New method. Creates the instance of
10318         ObsoleteAttribute.
10319         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
10320         ObsoleteAttribute when member is obsolete.
10321         (AttributeTester.Report_ObsoleteMessage): Common method for
10322         Obsolete error/warning reporting.
10323
10324         * class.cs
10325         (TypeContainer.base_classs_type): New member for storing parent type.
10326
10327         * decl.cs
10328         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
10329         for this MemberCore.
10330
10331 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10332
10333         * attribute.cs, const.cs: Fix bug #58590
10334
10335 2004-05-21  Martin Baulig  <martin@ximian.com>
10336
10337         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
10338         out parameters if the end of the method is unreachable.  Fixes
10339         #58098. 
10340
10341 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10342
10343         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
10344         Hari was right, why extra method.
10345
10346 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10347
10348         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
10349
10350 2004-05-20  Martin Baulig  <martin@ximian.com>
10351
10352         Merged this back from gmcs to keep the differences to a minumum.
10353
10354         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
10355         instead of a Declspace.
10356         (Attribute.ResolveType): Likewise.
10357         (Attributes.Search): Likewise.
10358         (Attributes.Contains): Likewise.
10359         (Attributes.GetClsCompliantAttribute): Likewise.
10360
10361         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
10362         argument.
10363         (MethodData.ApplyAttributes): Take an EmitContext instead of a
10364         DeclSpace.
10365
10366 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
10367
10368         Fix bug #58688 (MCS does not report error when the same attribute
10369         is assigned twice)
10370
10371         * attribute.cs (Attribute.Emit): Distinction between null and default.
10372
10373 2004-05-19  Raja R Harinath  <rharinath@novell.com>
10374
10375         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
10376         of a top-level attribute without an attribute target.
10377         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
10378         Make non-static.
10379         (Attribute.Conditional_GetConditionName), 
10380         (Attribute.Obsolete_GetObsoleteMessage): Update.
10381         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
10382         part of ScanForIndexerName.
10383         (Attribute.CanIgnoreInvalidAttribute): New function.
10384         (Attribute.ScanForIndexerName): Move to ...
10385         (Attributes.ScanForIndexerName): ... here.
10386         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
10387         (Attributes.Search): New internal variant that can choose not to
10388         complain if types aren't resolved.  The original signature now
10389         complains.
10390         (Attributes.GetClsCompliantAttribute): Use internal variant, with
10391         complaints suppressed.
10392         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
10393         only if it not useful.
10394         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
10395         top-level for attributes that are shared between the assembly
10396         and a top-level class.
10397         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
10398         * class.cs: Update to reflect changes.
10399         (DefineIndexers): Fuse loops.
10400         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
10401         a couple more variants of attribute names.
10402
10403 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
10404
10405         Fix bug #52585 (Implemented explicit attribute declaration)
10406
10407         * attribute.cs:
10408         (Attributable.ValidAttributeTargets): New abstract method. It gets
10409         list of valid attribute targets for explicit target declaration.
10410         (Attribute.Target): It holds target itself.
10411         (AttributeSection): Removed.
10412         (Attribute.CheckTargets): New method. It checks whether attribute
10413         target is valid for the current element.
10414
10415         * class.cs:
10416         (EventProperty): New class. For events that are declared like
10417         property (with add and remove accessors).
10418         (EventField): New class. For events that are declared like field.
10419         class.cs
10420
10421         * cs-parser.jay: Implemented explicit attribute target declaration.
10422
10423         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
10424         Override ValidAttributeTargets.
10425
10426         * parameter.cs:
10427         (ReturnParameter): Class for applying custom attributes on 
10428         the return type.
10429         (ParameterAtribute): New class. Class for applying custom
10430         attributes on the parameter type.
10431
10432 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
10433
10434         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
10435         definitions. 
10436
10437         (Method): Allow UNSAFE here.
10438
10439         * modifiers.cs: Support unsafe reporting.
10440
10441 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
10442
10443         * decl.cs: Fix bug #58478.
10444
10445 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10446
10447         * statement.cs: When checking for unreachable code on an EmptyStatement,
10448         set the location. Fixes bug #58488.
10449
10450 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
10451
10452         * driver.cs: Add -pkg handling.
10453
10454         From Gonzalo: UseShelLExecute=false
10455
10456 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
10457
10458         * attribute.cs:
10459         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
10460         for attribute.
10461         (Attribute.IsClsCompliaceRequired): Moved to base for better
10462         accesibility.
10463         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
10464         when attribute is AttributeUsageAttribute.
10465         (Attribute.GetValidTargets): Simplified.
10466         (Attribute.GetAttributeUsage): New method returns AttributeUsage
10467         attribute for this type.
10468         (Attribute.ApplyAttributes): Method renamed to Emit and make
10469         non-static.
10470         (GlobalAttributeSection): New class for special handling of global
10471         attributes (assembly, module).
10472         (AttributeSection.Emit): New method.
10473
10474         * class.cs: Implemented Attributable abstract methods.
10475         (MethodCore.LabelParameters): Moved to Parameter class.
10476         (Accessor): Is back simple class.
10477         (PropertyMethod): Implemented Attributable abstract class.
10478         (DelegateMethod): Implemented Attributable abstract class.
10479         (Event): New constructor for disctintion between normal Event
10480         and Event with accessors.
10481
10482         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
10483
10484         * codegen.cs, const.cs, decl.cs, delegate.cs:
10485         (CommonAssemblyModulClass): Implemented Attributable abstract class
10486         and simplified.
10487
10488         * enum.cs: Implement IAttributeSupport interface.
10489         (EnumMember): New class for emum members. Implemented Attributable
10490         abstract class
10491
10492         * parameter.cs:
10493         (ParameterBase): Is abstract.
10494         (ReturnParameter): New class for easier [return:] attribute handling.
10495
10496         * typemanager.cs: Removed builder_to_attr.
10497
10498 2004-05-11  Raja R Harinath  <rharinath@novell.com>
10499
10500         Fix bug #57151.
10501         * attribute.cs (Attribute.GetPositionalValue): New function.
10502         * class.cs (TypeContainer.VerifyMembers): New function.
10503         (TypeContainer.Emit): Use it.
10504         (ClassOrStruct): New base class for Class and Struct.
10505         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
10506         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
10507         class.
10508         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
10509         then each non-static field should have a FieldOffset attribute.
10510         Otherwise, none of the fields should have a FieldOffset attribute.
10511         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
10512         and FieldOffset attributes.
10513         * typemanager.cs (TypeManager.struct_layout_attribute_type)
10514         (TypeManager.field_offset_attribute_type): New core types.
10515         (TypeManager.InitCoreTypes): Initialize them.
10516
10517 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
10518
10519         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
10520         Return correct type.
10521         From bug #58270.
10522
10523 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
10524
10525         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
10526         be implicitly converted to ulong.
10527         
10528         * expression.cs: The logic for allowing operator &, | and ^ worked
10529         was wrong, it worked before because we did not report an error in
10530         an else branch.  Fixes 57895.
10531
10532         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
10533         allow volatile fields to be reference types.
10534
10535 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
10536
10537         * driver.cs: Add support for /debug-
10538
10539 2004-05-07  Raja R Harinath  <rharinath@novell.com>
10540
10541         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
10542         Add a 'complain' parameter to silence errors.
10543         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
10544         silently overlooked type-resolutions.
10545         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
10546         to reflect changes.
10547         (Attributes.Search): New function.
10548         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
10549         (Attributes.GetAttributeFullName): Remove hack.
10550         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
10551         Update to reflect changes.
10552         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10553         Use Attributes.Search instead of nested loops.
10554
10555 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
10556
10557         * decl.cs:
10558         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
10559         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
10560         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
10561
10562         * report.cs: (Report.Warning): Renamed to Warning_T because of
10563         parameter collision.
10564
10565 2004-05-05  Raja R Harinath  <rharinath@novell.com>
10566
10567         * expression.cs (MemberAccess.ResolveMemberAccess):
10568         Exit with non-zero status after Report.Error.
10569         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
10570         Likewise.
10571         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
10572
10573 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
10574
10575         * support.cs: Don't hang when the file is empty.
10576
10577 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
10578
10579         * support.cs: In SeekableStreamReader, compute the preamble size of the
10580           underlying stream. Position changes should take into account that initial
10581           count of bytes.
10582
10583 2004-05-03  Todd Berman  <tberman@sevenl.net>
10584
10585         * driver.cs: remove unused GetSysVersion function.
10586
10587 2004-05-03  Todd Berman  <tberman@sevenl.net>
10588
10589         * driver.cs: Remove the hack from saturday, as well as the hack
10590         from jackson (LoadAssemblyFromGac), also adds the CWD to the
10591         link_paths to get that bit proper.
10592
10593 2004-05-01  Todd Berman  <tberman@sevenl.net>
10594
10595         * driver.cs: Try a LoadFrom before a Load, this checks the current
10596         path. This is currently a bug in mono that is be fixed, however, this
10597         provides a workaround for now. This will be removed when the bug
10598         is fixed.
10599
10600 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
10601
10602         * CryptoConvert.cs: Updated to latest version. Fix issue with 
10603         incomplete key pairs (#57941).
10604
10605 2004-05-01  Todd Berman  <tberman@sevenl.net>
10606
10607         * driver.cs: Remove '.' from path_chars, now System.* loads properly
10608         from the GAC
10609
10610 2004-04-30  Jackson Harper  <jackson@ximian.com>
10611
10612         * codegen.cs: Open keys readonly.
10613         
10614 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10615
10616         * typemanager.cs: don't report cyclic struct layout when a struct
10617         contains 2 or more fields of the same type. Failed for Pango.AttrShape
10618         which has 2 Pango.Rectangle fields.
10619
10620 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10621
10622         * expression.cs: Handle IntPtr comparisons with IL code
10623         rather than a method call.
10624
10625 2004-04-29  Martin Baulig  <martin@ximian.com>
10626
10627         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
10628         the list of PropertyInfo's in class hierarchy and find the
10629         accessor.  Fixes #56013.
10630
10631 2004-04-29  Martin Baulig  <martin@ximian.com>
10632
10633         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
10634
10635 2004-04-29  Martin Baulig  <martin@ximian.com>
10636
10637         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10638
10639         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
10640
10641 2004-04-29  Martin Baulig  <martin@ximian.com>
10642
10643         * class.cs (ConstructorInitializer.Resolve): Check whether the
10644         parent .ctor is accessible.  Fixes #52146.
10645
10646 2004-04-29  Martin Baulig  <martin@ximian.com>
10647
10648         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10649
10650         * statement.cs (Using.EmitLocalVariableDecls): Use
10651         TypeManager.idisposable_type, not typeof (IDisposable).
10652         (Foreach.EmitCollectionForeach): Added support for valuetypes.
10653
10654 2004-04-29  Martin Baulig  <martin@ximian.com>
10655
10656         * class.cs (Event.Define): Don't emit the field and don't set
10657         RTSpecialName and SpecialName for events on interfaces.  Fixes
10658         #57703. 
10659
10660 2004-04-29  Raja R Harinath  <rharinath@novell.com>
10661
10662         Refactor Attribute.ApplyAttributes.
10663         * attribute.cs (Attributable): New base class for objects that can
10664         have Attributes applied on them.
10665         (Attribute): Make AttributeUsage fields public.
10666         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
10667         (Attribute.IsInternalCall): New property.
10668         (Attribute.UsageAttr): Convert to a public read-only property.
10669         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
10670         (Attribute.ResolveType, Attribute.Resolve)
10671         (Attribute.ScanForIndexerName): Update to reflect changes.
10672         (Attribute.CheckAttributeTarget): Re-format.
10673         (Attribute.ApplyAttributes): Refactor, to various
10674         Attributable.ApplyAttributeBuilder methods.
10675         * decl.cs (MemberCore): Make Attributable.
10676         * class.cs (Accessor): Make Attributable.
10677         (MethodData.ApplyAttributes): Use proper attribute types, not
10678         attribute names.
10679         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
10680         (TypeContainer.ApplyAttributeBuilder)
10681         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
10682         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
10683         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
10684         (Operator.ApplyAttributeBuilder): New factored-out methods.
10685         * const.cs (Const.ApplyAttributeBuilder): Likewise.
10686         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
10687         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
10688         * parameter.cs (ParameterBase): New Attributable base class
10689         that can also represent Return types.
10690         (Parameter): Update to the changes.
10691
10692 2004-04-29  Jackson Harper  <jackson@ximian.com>
10693
10694         * driver.cs: Prefer the corlib system version when looking for
10695         assemblies in the GAC. This is still a hack, but its a better hack
10696         now.
10697         
10698 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
10699
10700         * decl.cs, enum.cs: Improved error 3005 reporting.
10701   
10702         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
10703         (related_symbols): New private member for list of symbols
10704         related to reported error/warning.
10705         
10706         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
10707
10708 2004-04-29  Martin Baulig  <martin@ximian.com>
10709
10710         * ecore.cs (Expression.Constantify): If we're an enum and
10711         TypeManager.TypeToCoreType() doesn't give us another type, use
10712         t.UnderlyingSystemType.  Fixes #56178.  
10713
10714 2004-04-29  Martin Baulig  <martin@ximian.com>
10715
10716         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
10717         interfaces and for each interface, only add members directly
10718         declared in that interface.  Fixes #53255.
10719
10720 2004-04-28  Martin Baulig  <martin@ximian.com>
10721
10722         * expression.cs (ConditionalLogicalOperator): Use a temporary
10723         variable for `left' to avoid that we evaluate it more than once;
10724         bug #52588.
10725
10726 2004-04-28  Martin Baulig  <martin@ximian.com>
10727
10728         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
10729         `void[]' (CS1547).
10730
10731 2004-04-28  Martin Baulig  <martin@ximian.com>
10732
10733         * statement.cs (LocalInfo.Resolve): Check whether the type is not
10734         void (CS1547).
10735
10736         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
10737         whether the type is not void (CS1547).
10738
10739 2004-04-28  Martin Baulig  <martin@ximian.com>
10740
10741         * expression.cs (Unary.DoResolveLValue): Override this and report
10742         CS0131 for anything but Operator.Indirection.
10743
10744 2004-04-28  Martin Baulig  <martin@ximian.com>
10745
10746         Committing a patch from Ben Maurer; see bug #50820.
10747
10748         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10749         check for classes.
10750
10751         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10752         classes.        
10753
10754 2004-04-28  Martin Baulig  <martin@ximian.com>
10755
10756         Committing a patch from Ben Maurer; see bug #50820.
10757
10758         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10759         check for classes.
10760
10761         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10762         classes.        
10763
10764 2004-04-28  Martin Baulig  <martin@ximian.com>
10765
10766         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
10767         (Block.AddLabel): Call DoLookupLabel() to only search in the
10768         current block.
10769
10770 2004-04-28  Martin Baulig  <martin@ximian.com>
10771
10772         * cfold.cs (ConstantFold.BinaryFold): Added special support for
10773         comparing StringConstants and NullLiterals in Equality and Inequality.
10774
10775 2004-04-28  Jackson Harper  <jackson@ximian.com>
10776
10777         * driver.cs: Attempt to load referenced assemblies from the
10778         GAC. This is the quick and dirty version of this method that
10779         doesnt take into account versions and just takes the first
10780         canidate found. Will be good enough for now as we will not have more
10781         then one version installed into the GAC until I update this method.
10782
10783 2004-04-28  Martin Baulig  <martin@ximian.com>
10784
10785         * typemanager.cs (TypeManager.CheckStructCycles): New public
10786         static method to check for cycles in the struct layout.
10787
10788         * rootcontext.cs (RootContext.PopulateTypes): Call
10789         TypeManager.CheckStructCycles() for each TypeContainer.
10790         [Note: We only need to visit each type once.]
10791
10792 2004-04-28  Martin Baulig  <martin@ximian.com>
10793
10794         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
10795
10796         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
10797         success and added `out object value'.  Use a `bool resolved' field
10798         to check whether we've already been called rather than
10799         `ConstantValue != null' since this breaks for NullLiterals.
10800
10801 2004-04-28  Raja R Harinath  <rharinath@novell.com>
10802
10803         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
10804         setting of this flag, since the 'set' method may be non-public.
10805
10806 2004-04-28  Raja R Harinath  <rharinath@novell.com>
10807
10808         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
10809         check on current_vector.Block.
10810
10811 2004-04-27  Martin Baulig  <martin@ximian.com>
10812
10813         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
10814         a field initializer.  Fixes #56459.
10815
10816 2004-04-27  Martin Baulig  <martin@ximian.com>
10817
10818         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
10819         we're not attempting to use an indexer.  Fixes #52154.
10820
10821 2004-04-27  Martin Baulig  <martin@ximian.com>
10822
10823         * statement.cs (Return): Don't create a return label if we don't
10824         need it; reverts my change from January 20th.  Thanks to Ben
10825         Maurer for this.
10826
10827 2004-04-27  Martin Baulig  <martin@ximian.com>
10828
10829         According to the spec, `goto' can only leave a nested scope, but
10830         never enter it.
10831
10832         * statement.cs (Block.LookupLabel): Only lookup in the current
10833         block, don't recurse into parent or child blocks.
10834         (Block.AddLabel): Check in parent and child blocks, report
10835         CS0140/CS0158 if we find a duplicate.
10836         (Block): Removed this indexer for label lookups.
10837         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
10838         this already does the error reporting for us.
10839
10840         * flowanalysis.cs
10841         (FlowBranching.UsageVector.Block): New public variable; may be null.
10842         (FlowBranching.CreateSibling): Added `Block' argument.
10843         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
10844         label for the target of a `goto' and check whether we're not
10845         leaving a `finally'.
10846
10847 2004-04-27  Martin Baulig  <martin@ximian.com>
10848
10849         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10850         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
10851         just for returns).
10852
10853 2004-04-27  Martin Baulig  <martin@ximian.com>
10854
10855         * statement.cs (Block.AddLabel): Also check for implicit blocks
10856         and added a CS0158 check.
10857
10858 2004-04-27  Martin Baulig  <martin@ximian.com>
10859
10860         * flowanalysis.cs (FlowBranchingLoop): New class.
10861         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
10862         UsageVector's instead of an ArrayList.
10863         (FlowBranching.Label): Likewise.
10864         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
10865         (FlowBranching.AddBreakVector): New method.
10866
10867 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
10868
10869         * attribute.cs: Small regression fix: only convert the type if we
10870         the type is different, fixes System.Drawing build.
10871
10872 2004-04-27  Martin Baulig  <martin@ximian.com>
10873
10874         * attribute.cs (Attribute.Resolve): If we have a constant value
10875         for a named field or property, implicity convert it to the correct
10876         type.
10877
10878 2004-04-27  Raja R Harinath  <rharinath@novell.com>
10879
10880         * statement.cs (Block.Block): Implicit blocks share
10881         'child_variable_names' fields with parent blocks.
10882         (Block.AddChildVariableNames): Remove.
10883         (Block.AddVariable): Mark variable as "used by a child block" in
10884         every surrounding block.
10885         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
10886         been used in a child block, complain about violation of "Invariant
10887         meaning in blocks" rule.
10888         * cs-parser.jay (declare_local_variables): Don't use
10889         AddChildVariableNames.
10890         (foreach_statement): Don't create an implicit block: 'foreach'
10891         introduces a scope.
10892
10893 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
10894
10895         * convert.cs (ImplicitNumericConversion): 0 is also positive when
10896         converting from 0L to ulong.  Fixes 57522.
10897
10898 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
10899
10900         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
10901         derived class hides via 'new' keyword field from base class (test-242.cs).
10902         TODO: Handle this in the more general way.
10903         
10904         * class.cs (CheckBase): Ditto.
10905
10906 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
10907
10908         * decl.cs (caching_flags): New member for storing cached values
10909         as bit flags.
10910         (MemberCore.Flags): New enum where bit flags for caching_flags
10911         are defined.
10912         (MemberCore.cls_compliance): Moved to caching_flags.
10913         (DeclSpace.Created): Moved to caching_flags.
10914
10915         * class.cs: Use caching_flags instead of DeclSpace.Created
10916         
10917 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
10918
10919         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
10920         if we are only a derived class, not a nested class.
10921
10922         * typemanager.cs: Same as above, but do this at the MemberLookup
10923         level (used by field and methods, properties are handled in
10924         PropertyExpr).   Allow for the qualified access if we are a nested
10925         method. 
10926
10927 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
10928
10929         * class.cs: Refactoring.
10930         (IMethodData): New inteface; Holds links to parent members
10931         to avoid member duplication (reduced memory allocation).
10932         (Method): Implemented IMethodData interface.
10933         (PropertyBase): New inner classes for get/set methods.
10934         (PropertyBase.PropertyMethod): Implemented IMethodData interface
10935         (Event): New inner classes for add/remove methods.
10936         (Event.DelegateMethod): Implemented IMethodData interface.
10937
10938         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
10939         EmitContext (related to class.cs refactoring).
10940
10941 2004-04-21  Raja R Harinath  <rharinath@novell.com>
10942
10943         * delegate.cs (Delegate.VerifyApplicability): If the number of
10944         arguments are the same as the number of parameters, first try to
10945         verify applicability ignoring  any 'params' modifier on the last
10946         parameter.
10947         Fixes #56442.
10948
10949 2004-04-16  Raja R Harinath  <rharinath@novell.com>
10950
10951         * class.cs (TypeContainer.AddIndexer): Use
10952         'ExplicitInterfaceName' to determine if interface name was
10953         explicitly specified.  'InterfaceType' is not initialized at this time.
10954         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
10955         Indexers array is already in the required order.  Initialize
10956         'IndexerName' only if there are normal indexers.
10957         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
10958         (TypeContainer.Emit): Emit DefaultMember attribute only if
10959         IndexerName is initialized.
10960         Fixes #56300.
10961
10962 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
10963
10964         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10965         Fixes #57007
10966
10967 2004-04-15  Raja R Harinath  <rharinath@novell.com>
10968
10969         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10970         attributes.
10971         Fix for #56456.
10972
10973         * attribute.cs (Attribute.Resolve): Check for duplicate named
10974         attributes.
10975         Fix for #56463.
10976
10977 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
10978
10979         * iterators.cs (MarkYield): track whether we are in an exception,
10980         and generate code accordingly.  Use a temporary value to store the
10981         result for our state.
10982
10983         I had ignored a bit the interaction of try/catch with iterators
10984         since their behavior was not entirely obvious, but now it is
10985         possible to verify that our behavior is the same as MS .NET 2.0
10986
10987         Fixes 54814
10988
10989 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
10990
10991         * iterators.cs: Avoid creating temporaries if there is no work to
10992         do. 
10993
10994         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10995         Enumerations, use TypeManager.EnumToUnderlying and call
10996         recursively. 
10997
10998         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
10999         bug #57013
11000
11001         (This.Emit): Use EmitContext.EmitThis to emit our
11002         instance variable.
11003
11004         (This.EmitAssign): Ditto.
11005
11006         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
11007         codepaths, we will move all the functionality into
11008         Mono.CSharp.This 
11009
11010         (FieldExpr.EmitAssign): Ditto.
11011
11012         This fixes several hidden bugs that I uncovered while doing a code
11013         review of this today.
11014
11015         * codegen.cs (EmitThis): reworked so the semantics are more clear
11016         and also support value types "this" instances.
11017
11018         * iterators.cs: Changed so that for iterators in value types, we
11019         do not pass the value type as a parameter.  
11020
11021         Initialization of the enumerator helpers is now done in the caller
11022         instead of passing the parameters to the constructors and having
11023         the constructor set the fields.
11024
11025         The fields have now `assembly' visibility instead of private.
11026
11027 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
11028
11029         * expression.cs (Argument.Resolve): Check if fields passed as ref
11030         or out are contained in a MarshalByRefObject.
11031
11032         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
11033         another compiler type.
11034
11035 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
11036
11037         * class.cs (Indexer.Define): use the new name checking method.
11038         Also, return false on an error.
11039         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
11040         (is_identifier_[start/part]_character): make static.
11041
11042 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
11043
11044         * expression.cs (Binary.ResolveOperator): Do no append strings
11045         twice: since we can be invoked more than once (array evaluation)
11046         on the same concatenation, take care of this here.  Based on a fix
11047         from Ben (bug #56454)
11048
11049 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
11050
11051         * codegen.cs: Fix another case where CS1548 must be reported (when 
11052         delay-sign isn't specified and no private is available #56564). Fix
11053         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
11054         error when MCS is used on the MS runtime and we need to delay-sign 
11055         (which seems unsupported by AssemblyBuilder - see #56621).
11056
11057 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
11058
11059         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
11060         (TypeManager.ComputeNamespaces): Faster implementation for
11061         Microsoft runtime.
11062
11063         * compiler.csproj: Updated AssemblyName to mcs.
11064
11065 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
11066
11067         * rootcontext.cs: Add new types to the boot resolution.
11068
11069         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
11070         MulticastDelegate is not allowed.
11071
11072         * typemanager.cs: Add new types to lookup: System.TypedReference
11073         and ArgIterator.
11074
11075         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
11076         check for TypedReference or ArgIterator, they are not allowed. 
11077
11078         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
11079         makes us properly catch 1510 in some conditions (see bug 56016 for
11080         details). 
11081
11082 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
11083
11084         * CryptoConvert.cs: update from corlib version
11085         with endian fixes.
11086
11087 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
11088
11089         * class.cs (Indexer.Define): Check indexername declaration
11090
11091 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
11092
11093         * attribute.cs (IsClsCompliant): Fixed problem with handling
11094         all three states (compliant, not-compliant, undetected).
11095
11096 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
11097
11098         * attribute.cs (Attribute): Location is now public.
11099         (Resolve): Store resolved arguments (pos_values) in attribute class.
11100         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
11101         (GetClsCompliantAttributeValue): New method that gets
11102         CLSCompliantAttribute value.
11103         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
11104         if exists else null.
11105         (AttributeTester): New class for CLS-Compliant verification routines.
11106
11107         * class.cs (Emit): Add CLS-Compliant verification.
11108         (Method.GetSignatureForError): Implemented.
11109         (Constructor.GetSignatureForError): Implemented
11110         (Constructor.HasCompliantArgs): Returns if constructor has
11111         CLS-Compliant arguments.
11112         (Constructor.Emit): Override.
11113         (Construcor.IsIdentifierClsCompliant): New method; For constructors
11114         is needed to test only parameters.
11115         (FieldBase.GetSignatureForError): Implemented.
11116         (TypeContainer): New member for storing base interfaces.
11117         (TypeContainer.FindMembers): Search in base interfaces too.
11118
11119         * codegen.cs (GetClsComplianceAttribute): New method that gets
11120         assembly or module CLSCompliantAttribute value.
11121         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
11122         for assembly.
11123         (ModuleClass.Emit): Add error 3012 test.
11124
11125         * const.cs (Emit): Override and call base for CLS-Compliant tests.
11126
11127         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
11128         state for all decl types.
11129         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
11130         if CLS-Compliant tests are required.
11131         (IsClsCompliaceRequired): New method. Analyze whether code
11132         must be CLS-Compliant.
11133         (IsExposedFromAssembly): New method. Returns true when MemberCore
11134         is exposed from assembly.
11135         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
11136         value or gets cached value.
11137         (HasClsCompliantAttribute): New method. Returns true if MemberCore
11138         is explicitly marked with CLSCompliantAttribute.
11139         (IsIdentifierClsCompliant): New abstract method. This method is
11140         used to testing error 3005.
11141         (IsIdentifierAndParamClsCompliant): New method. Common helper method
11142         for identifier and parameters CLS-Compliant testing.
11143         (VerifyClsCompliance): New method. The main virtual method for
11144         CLS-Compliant verifications.
11145         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
11146         null. I don't know why is null (too many public members !).
11147         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
11148         and get value of first CLSCompliantAttribute that found.
11149
11150         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
11151         (VerifyClsCompliance): Override and add extra tests.
11152
11153         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
11154         clscheck- disable CLS-Compliant verification event if assembly is has
11155         CLSCompliantAttribute(true).
11156
11157         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
11158         ApllyAttribute is now called in emit section as in the other cases.
11159         Possible future Emit integration.
11160         (IsIdentifierClsCompliant): New override.
11161         (VerifyClsCompliance): New override.
11162         (GetEnumeratorName): Returns full enum name.
11163
11164         * parameter.cs (GetSignatureForError): Implemented.
11165
11166         * report.cs (WarningData): New struct for Warning message information.
11167         (LocationOfPreviousError): New method.
11168         (Warning): New method. Reports warning based on the warning table.
11169         (Error_T): New method. Reports error based on the error table.
11170
11171         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
11172         verifications are done here.
11173
11174         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
11175
11176         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
11177         CLSCompliantAttribute.
11178         (all_imported_types): New member holds all imported types from other
11179         assemblies.
11180         (LoadAllImportedTypes): New method fills static table with exported types
11181         from all referenced assemblies.
11182         (Modules): New property returns all assembly modules.
11183
11184 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
11185
11186         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
11187         throwing a parser error.
11188
11189         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
11190         which removes the hardcoded get_/set_ prefixes for properties, as
11191         IL allows for the properties to be named something else.  
11192
11193         Bug #56013
11194
11195         * expression.cs: Do not override operand before we know if it is
11196         non-null.  Fix 56207
11197
11198 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11199
11200         * typemanager.cs: support for pinned variables.
11201
11202 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11203
11204         * decl.cs, typemanager.cs: Avoid using an arraylist
11205         as a buffer if there is only one result set.
11206
11207 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11208
11209         * expression.cs: Make sure you cant call a static method
11210         with an instance expression, bug #56174.
11211
11212 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
11213
11214         * class.cs (IsDuplicateImplementation): Improve error reporting to
11215         flag 663 (method only differs in parameter modifier).
11216
11217         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
11218         in preprocessor directives.
11219
11220         * location.cs (LookupFile): Allow for the empty path.
11221
11222         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
11223         better approach for some of that patch, but its failing with the
11224         CharSet enumeration.  For now try/catch will do.
11225
11226         * typemanager.cs: Do not crash if a struct does not have fields.
11227         Fixes 56150.
11228
11229 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11230
11231         * expression.cs: cs0213, cant fix a fixed expression.
11232         fixes 50231.
11233
11234 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11235
11236         * cs-parser.jay: detect invalid embeded statements gracefully.
11237         bug #51113.
11238
11239 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11240
11241         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
11242         As a regex:
11243         s/
11244         the invocation type may not be a subclass of the tye of the item/
11245         The type of the item must be a subclass of the invocation item.
11246         /g
11247
11248         Fixes bug #50820.
11249
11250 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
11251
11252         * attribute.cs: Added methods to get a string and a bool from an
11253         attribute. Required to information from AssemblyKeyFileAttribute,
11254         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
11255         * codegen.cs: Modified AssemblyName creation to include support for
11256         strongnames. Catch additional exceptions to report them as CS1548.
11257         * compiler.csproj: Updated include CryptoConvert.cs.
11258         * compiler.csproj.user: Removed file - user specific configuration.
11259         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
11260         Mono.Security assembly. The original class is maintained and tested in
11261         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
11262         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
11263         like CSC 8.0 (C# v2) supports.
11264         * Makefile: Added CryptoConvert.cs to mcs sources.
11265         * rootcontext.cs: Added new options for strongnames.
11266
11267 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
11268
11269         * driver.cs: For --expect-error, report error code `2'
11270         if the program compiled with no errors, error code `1' if
11271         it compiled with an error other than the one expected.
11272
11273 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
11274
11275         * compiler.csproj: Updated for Visual Studio .NET 2003.
11276         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
11277         * compiler.sln: Updated for Visual Studio .NET 2003.
11278
11279 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
11280
11281         * expression.cs: Fix bug #47234. We basically need to apply the
11282         rule that we prefer the conversion of null to a reference type
11283         when faced with a conversion to 'object' (csc behaviour).
11284
11285 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11286
11287         * statement.cs: Shorter form for foreach, eliminates
11288         a local variable. r=Martin.
11289
11290 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11291
11292         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
11293         checks if we can use brtrue/brfalse to test for 0.
11294         * expression.cs: use the above in the test for using brtrue/brfalse.
11295         cleanup code a bit.
11296
11297 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11298
11299         * expression.cs: Rewrite string concat stuff. Benefits:
11300
11301         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
11302         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
11303         rather than a concat chain.
11304
11305         * typemanager.cs: Add lookups for more concat overloads.
11306
11307 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11308
11309         * expression.cs: Emit shorter il code for array init.
11310
11311         newarr
11312         dup
11313         // set 1
11314
11315         // set 2
11316
11317         newarr
11318         stloc.x
11319
11320         ldloc.x
11321         // set 1
11322
11323         ldloc.x
11324         // set 2
11325
11326 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
11327
11328         * statement.cs: Before, two switch blocks would be merged if the
11329         total size of the blocks (end_item - begin_item + 1) was less than
11330         two times the combined sizes of the blocks.
11331
11332         Now, it will only merge if after the merge at least half of the
11333         slots are filled.
11334
11335         fixes 55885.
11336
11337 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
11338
11339         * class.cs : csc build fix for GetMethods(). See bug #52503.
11340
11341 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
11342
11343         * expression.cs: Make sure fp comparisons work with NaN.
11344         This fixes bug #54303. Mig approved this patch a long
11345         time ago, but we were not able to test b/c the runtime
11346         had a related bug.
11347
11348 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
11349
11350         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
11351
11352 2004-03-19  Martin Baulig  <martin@ximian.com>
11353
11354         * class.cs (MemberCore.IsDuplicateImplementation): Report the
11355         error here and not in our caller.
11356
11357 2004-03-19  Martin Baulig  <martin@ximian.com>
11358
11359         * interface.cs: Completely killed this file.
11360         (Interface): We're now a TypeContainer and live in class.cs.
11361
11362         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
11363         argument; we're now also called for interfaces.
11364         (TypeContainer.DefineMembers): Allow this method being called
11365         multiple times.
11366         (TypeContainer.GetMethods): New public method; formerly known as
11367         Interface.GetMethod().  This is used by PendingImplementation.
11368         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
11369         it's now private and non-static.
11370         (Interface): Moved this here; it's now implemented similar to
11371         Class and Struct.
11372         (Method, Property, Event, Indexer): Added `bool is_interface'
11373         argument to their .ctor's.
11374         (MemberBase.IsInterface): New public field.
11375
11376         * cs-parser.jay: Create normal Method, Property, Event, Indexer
11377         instances instead of InterfaceMethod, InterfaceProperty, etc.
11378         (opt_interface_base): Removed; we now use `opt_class_base' instead.
11379         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
11380
11381 2004-03-19  Martin Baulig  <martin@ximian.com>
11382
11383         * class.cs (MethodCore.IsDuplicateImplementation): New private
11384         method which does the CS0111 checking.
11385         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
11386         Use IsDuplicateImplementation().
11387
11388 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
11389
11390         * decl.cs (FindMemberToOverride): New method to find the correct
11391         method or property to override in the base class.
11392         * class.cs
11393             - Make Method/Property use the above method to find the
11394               version in the base class.
11395             - Remove the InheritableMemberSignatureCompare as it is now
11396               dead code.
11397
11398         This patch makes large code bases much faster to compile, as it is
11399         O(n) rather than O(n^2) to do this validation.
11400
11401         Also, it fixes bug 52458 which is that nested classes are not
11402         taken into account when finding the base class member.
11403
11404         Reviewed/Approved by Martin.
11405
11406 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
11407
11408         * interface.cs: In all interface classes removed redundant
11409         member initialization.
11410
11411 2004-03-16  Martin Baulig  <martin@ximian.com>
11412
11413         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11414
11415 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
11416
11417         * decl.cs (DefineTypeAndParents): New helper method to define a
11418         type's containers before the type itself is defined;  This is a
11419         bug exposed by the recent changes to Windows.Forms when an
11420         implemented interface was defined inside a class that had not been
11421         built yet.   
11422
11423         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
11424
11425         (Check): Loop correctly to report errors modifiers
11426         (UNSAFE was not in the loop, since it was the same as TOP).
11427
11428         * interface.cs: Every interface member now takes a ModFlags,
11429         instead of a "is_new" bool, which we set on the base MemberCore. 
11430
11431         Every place where we called "UnsafeOk" in the interface, now we
11432         call the proper member (InterfaceMethod.UnsafeOK) instead to get
11433         the unsafe settings from the member declaration instead of the
11434         container interface. 
11435
11436         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
11437
11438         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11439         `set_indexer_name' to the pending bits (one per type).
11440
11441         We fixed a bug today that was picking the wrong method to
11442         override, since for properties the existing InterfaceMethod code
11443         basically ignored the method name.  Now we make sure that the
11444         method name is one of the valid indexer names.
11445
11446 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
11447  
11448         * support.cs (SeekableStreamReader): Keep track of stream byte
11449         positions and don't mix them with character offsets to the buffer.
11450
11451         Patch from Gustavo Giráldez
11452
11453 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
11454
11455         * interface.cs (InterfaceSetGetBase): Removed double member
11456         initialization, base class does it as well.
11457
11458 2004-03-13  Martin Baulig  <martin@ximian.com>
11459
11460         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
11461         when compiling corlib.
11462
11463 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
11464
11465         * convert.cs (ExplicitConversion): We were reporting an error on
11466         certain conversions (object_type source to a value type, when the
11467         expression was `null') before we had a chance to pass it through
11468         the user defined conversions.
11469
11470         * driver.cs: Replace / and \ in resource specifications to dots.
11471         Fixes 50752
11472
11473         * class.cs: Add check for duplicate operators.  Fixes 52477
11474
11475 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
11476
11477         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
11478         that are in the middle of the statements, not only at the end.
11479         Fixes #54987
11480
11481         * class.cs (TypeContainer.AddField): No longer set the
11482         `HaveStaticConstructor' flag, now we call it
11483         `UserDefineStaticConstructor' to diferentiate the slightly
11484         semantic difference.
11485
11486         The situation is that we were not adding BeforeFieldInit (from
11487         Modifiers.TypeAttr) to classes that could have it.
11488         BeforeFieldInit should be set to classes that have no static
11489         constructor. 
11490
11491         See:
11492
11493         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
11494
11495         And most importantly Zoltan's comment:
11496
11497         http://bugzilla.ximian.com/show_bug.cgi?id=44229
11498
11499         "I think beforefieldinit means 'it's ok to initialize the type sometime 
11500          before its static fields are used', i.e. initialization does not need
11501          to be triggered by the first access to the type. Setting this flag
11502          helps the JIT to compile better code, since it can run the static
11503          constructor at JIT time, and does not need to generate code to call it
11504          (possibly lots of times) at runtime. Unfortunately, mcs does not set
11505          this flag for lots of classes like String. 
11506          
11507          csc sets this flag if the type does not have an explicit static 
11508          constructor. The reasoning seems to be that if there are only static
11509          initalizers for a type, and no static constructor, then the programmer
11510          does not care when this initialization happens, so beforefieldinit
11511          can be used.
11512          
11513          This bug prevents the AOT compiler from being usable, since it 
11514          generates so many calls to mono_runtime_class_init that the AOT code
11515          is much slower than the JITted code. The JITted code is faster, 
11516          because it does not generate these calls if the vtable is type is
11517          already initialized, which is true in the majority of cases. But the
11518          AOT compiler can't do this."
11519
11520 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
11521
11522         * class.cs (MethodData.Emit): Refactor the code so symbolic
11523         information is generated for destructors;  For some reasons we
11524         were taking a code path that did not generate symbolic information
11525         before. 
11526
11527 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
11528
11529         * class.cs: Create a Constructor.CheckBase method that
11530         takes care of all validation type code. The method
11531         contains some code that was moved from Define.
11532
11533         It also includes new code that checks for duplicate ctors.
11534         This fixes bug #55148.
11535
11536 2004-03-09  Joshua Tauberer <tauberer@for.net>
11537
11538         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
11539         a { ... }-style array creation invokes EmitStaticInitializers
11540         which is not good for reference-type arrays.  String, decimal
11541         and now null constants (NullCast) are not counted toward
11542         static initializers.
11543
11544 2004-03-05  Martin Baulig  <martin@ximian.com>
11545
11546         * location.cs (SourceFile.HasLineDirective): New public field;
11547         specifies whether the file contains or is referenced by a "#line"
11548         directive.
11549         (Location.DefineSymbolDocuments): Ignore source files which
11550         either contain or are referenced by a "#line" directive.        
11551
11552 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
11553
11554         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
11555         direct access to our parent, so check the method inline there.
11556
11557 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11558
11559         * expression.cs (Invocation.EmitCall): Miguel's last commit
11560         caused a regression. If you had:
11561
11562             T t = null;
11563             t.Foo ();
11564
11565         In Foo the implict this would be null.
11566
11567 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
11568
11569         * expression.cs (Invocation.EmitCall): If the method is not
11570         virtual, do not emit a CallVirt to it, use Call.
11571
11572         * typemanager.cs (GetFullNameSignature): Improve the method to
11573         cope with ".ctor" and replace it with the type name.
11574
11575         * class.cs (ConstructorInitializer.Resolve): Now the method takes
11576         as an argument the ConstructorBuilder where it is being defined,
11577         to catch the recursive constructor invocations.
11578
11579 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
11580
11581         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
11582         routines to check if a type is an enumerable/enumerator allow
11583         classes that implement the IEnumerable or IEnumerator interfaces.
11584
11585         * class.cs (Property, Operator): Implement IIteratorContainer, and
11586         implement SetYields.
11587
11588         (Property.Define): Do the block swapping for get_methods in the
11589         context of iterators.   We need to check if Properties also
11590         include indexers or not.
11591
11592         (Operator): Assign the Block before invoking the
11593         OperatorMethod.Define, so we can trigger the Iterator code
11594         replacement. 
11595
11596         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
11597         Property and Operator classes are not created when we parse the
11598         declarator but until we have the block completed, so we use a
11599         singleton SimpleIteratorContainer.Simple to flag whether the
11600         SetYields has been invoked.
11601
11602         We propagate this setting then to the Property or the Operator to
11603         allow the `yield' to function.
11604
11605 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
11606
11607         * codegen.cs: Implemented attribute support for modules.
11608         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
11609         Assembly/Module functionality.
11610
11611         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
11612         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
11613         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
11614
11615 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
11616
11617         * interface.cs (FindMembers): The operation is performed on all base
11618         interfaces and not only on the first. It is required for future CLS Compliance patch.
11619
11620 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11621
11622         * statement.cs, codegen.cs:
11623         This patch deals with patterns such as:
11624
11625         public class List : IEnumerable {
11626
11627                 public MyEnumerator GetEnumerator () {
11628                         return new MyEnumerator(this);
11629                 }
11630
11631                 IEnumerator IEnumerable.GetEnumerator () {
11632                         ...
11633                 }
11634                 
11635                 public struct MyEnumerator : IEnumerator {
11636                         ...
11637                 }
11638         }
11639
11640         Before, there were a few things we did wrong:
11641         1) we would emit callvirt on a struct, which is illegal
11642         2) we emited ldarg when we needed to emit ldarga
11643         3) we would mistakenly call the interface methods on an enumerator
11644         type that derived from IEnumerator and was in another assembly. For example:
11645
11646         public class MyEnumerator : IEnumerator
11647
11648         Would have the interface methods called, even if there were public impls of the
11649         method. In a struct, this lead to invalid IL code.
11650
11651 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
11652
11653         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11654           renamed to Emit.
11655
11656         * delegate.cs (Define): Fixed crash when delegate type is undefined.
11657
11658 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
11659
11660         * cs-parser.jay: Fix small regression: we were not testing V2
11661         compiler features correctly.
11662
11663         * interface.cs: If the emit context is null, then create one
11664
11665 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
11666
11667         * decl.cs (GetSignatureForError): New virtual method to get full name
11668           for error messages.
11669
11670         * attribute.cs (IAttributeSupport): New interface for attribute setting.
11671           Now it is possible to rewrite ApplyAttributes method to be less if/else.
11672
11673         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11674           Duplicated members and code in these classes has been removed.
11675           Better encapsulation in these classes.
11676
11677 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
11678
11679         * assign.cs (Assign.DoResolve): When dealing with compound
11680         assignments, there is a new rule in ECMA C# 2.4 (might have been
11681         there before, but it is documented here) that states that in:
11682
11683         a op= b;
11684
11685         If b is of type int, and the `op' is a shift-operator, then the
11686         above is evaluated as:
11687
11688         a = (int) a op b 
11689
11690         * expression.cs (Binary.ResolveOperator): Instead of testing for
11691         int/uint/long/ulong, try to implicitly convert to any of those
11692         types and use that in pointer arithmetic.
11693
11694         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11695         method to print information for from the type, not from the
11696         null-method we were given.
11697
11698 2004-02-01  Duncan Mak  <duncan@ximian.com>
11699
11700         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11701         parsing for cmd, fixes bug #53694.
11702
11703 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
11704
11705         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11706         in the member name duplication tests. Property and operator name duplication
11707         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11708
11709 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
11710
11711         * interface.cs (PopulateMethod): Fixed crash when interface method
11712         returns not existing type (error test cs0246-3.cs).
11713
11714 2004-02-02  Ravi Pratap M <ravi@ximian.com>
11715
11716         * cs-parser.jay (interface_accessors): Re-write actions to also
11717         store attributes attached to get and set methods. Fix spelling
11718         while at it.
11719
11720         (inteface_property_declaration): Modify accordingly.
11721
11722         (InterfaceAccessorInfo): New helper class to store information to pass
11723         around between rules that use interface_accessors.
11724
11725         * interface.cs (Emit): Apply attributes on the get and set
11726         accessors of properties and indexers too.
11727
11728         * attribute.cs (ApplyAttributes): Modify accordingly to use the
11729         right MethodBuilder when applying attributes to the get and set accessors.
11730
11731 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
11732
11733         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11734
11735 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
11736
11737         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11738
11739 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
11740
11741         * cs-parser.jay: Remove YIELD token, instead use the new grammar
11742         changes that treat `yield' specially when present before `break'
11743         or `return' tokens.
11744
11745         * cs-tokenizer.cs: yield is no longer a keyword.
11746
11747 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
11748
11749         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11750         setting for default constructors.
11751         For default constructors are almost every time set wrong Modifier. The
11752         generated IL code has been alright. But inside mcs this values was
11753         wrong and this was reason why several of my CLS Compliance tests
11754         failed.
11755
11756 2004-01-22  Martin Baulig  <martin@ximian.com>
11757
11758         * cs-parser.jay (namespace_or_type_name): Return an Expression,
11759         not a QualifiedIdentifier.  This is what `type_name_expression'
11760         was previously doing.
11761         (type_name_expression): Removed; the code is now in
11762         `namespace_or_type_name'.
11763         (qualified_identifier): Removed, use `namespace_or_type_name'
11764         instead.
11765         (QualifiedIdentifier): Removed this class.      
11766
11767 2004-01-22  Martin Baulig  <martin@ximian.com>
11768
11769         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11770         not a string as alias name.
11771
11772 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
11773
11774         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11775         #52730 bug, and instead compute correctly the need to use a
11776         temporary variable when requesting an address based on the
11777         static/instace modified of the field and the constructor.
11778  
11779 2004-01-21  Martin Baulig  <martin@ximian.com>
11780
11781         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11782         class and namespace before looking up aliases.  Fixes #52517.
11783
11784 2004-01-21  Martin Baulig  <martin@ximian.com>
11785
11786         * flowanalysis.cs (UsageVector.Merge): Allow variables being
11787         assinged in a 'try'; fixes exception4.cs.
11788
11789 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11790         * class.cs : Implemented parameter-less constructor for TypeContainer
11791
11792         * decl.cs: Attributes are now stored here. New property OptAttributes
11793
11794         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
11795
11796         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
11797
11798 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11799
11800         * typemanager.cs (CSharpSignature): Now reports also inner class name.
11801           (CSharpSignature): New method for indexer and property signature.
11802
11803 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11804
11805         * pending.cs (IsVirtualFilter): Faster implementation.
11806
11807 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11808
11809         * typemanager.cs: Avoid inclusion of same assembly more than once.
11810
11811 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11812
11813         * cs-parser.jay: Fixed problem where the last assembly attribute
11814           has been applied also to following declaration (class, struct, etc.)
11815           
11816 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11817
11818         * class.cs: Added error CS0538, CS0539 reporting.
11819         Fixed crash on Microsoft runtime when field type is void.
11820
11821         * cs-parser.jay: Added error CS0537 reporting.
11822
11823         * pending.cs: Added error CS0535 reporting.
11824         Improved error report for errors CS0536, CS0534.
11825
11826 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
11827
11828         Merge a few bits from the Anonymous Method MCS tree.
11829
11830         * statement.cs (ToplevelBlock): New class for toplevel methods,
11831         will hold anonymous methods, lifted variables.
11832
11833         * cs-parser.jay: Create toplevel blocks for delegates and for
11834         regular blocks of code. 
11835
11836 2004-01-20  Martin Baulig  <martin@ximian.com>
11837
11838         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11839         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11840         and `NeedExplicitReturn'; added `IsLastStatement'.
11841         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11842         have a `ReturnLabel' or we're not unreachable.
11843
11844         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
11845         child's reachability; don't just override ours with it.  Fixes
11846         #58058 (lluis's example).
11847         (FlowBranching): Added public InTryOrCatch(), InCatch(),
11848         InFinally(), InLoop(), InSwitch() and
11849         BreakCrossesTryCatchBoundary() methods.
11850
11851         * statement.cs (Return): Do all error checking in Resolve().
11852         Unless we are the last statement in a top-level block, always
11853         create a return label and jump to it.
11854         (Break, Continue): Do all error checking in Resolve(); also make
11855         sure we aren't leaving a `finally'.
11856         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
11857         statement in a top-level block.
11858         (Block.Flags): Added `IsDestructor'.
11859         (Block.IsDestructor): New public property.
11860
11861 2004-01-20  Martin Baulig  <martin@ximian.com>
11862
11863         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11864
11865 2004-01-20  Martin Baulig  <martin@ximian.com>
11866
11867         * statement.cs (Statement.ResolveUnreachable): New public method.
11868         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11869         (Block.Resolve): Resolve unreachable statements.
11870
11871 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11872
11873         * expression.cs: We need to fix the case where we do
11874         not have a temp variable here.
11875
11876         * assign.cs: Only expression compound assignments need
11877         temporary variables.
11878
11879 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11880
11881         * flowanalysis.cs: Reduce memory allocation in a few ways:
11882           - A block with no variables should not allocate a bit
11883             vector for itself.
11884           - A method with no out parameters does not need any tracking
11885             for assignment of the parameters, so we need not allocate
11886             any data for it.
11887           - The arrays:
11888                 public readonly Type[] VariableTypes;
11889                 public readonly string[] VariableNames;
11890             Are redundant. The data is already stored in the variable
11891             map, so we need not allocate another array for it.
11892           - We need to add alot of checks for if (params | locals) == null
11893             due to the first two changes.
11894
11895 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
11896
11897         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11898         implement IMemoryLocation, we store a copy on a local variable and
11899         take the address of it.  Patch from Benjamin Jemlich
11900
11901         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11902         to use a special "type_name_expression" rule which reduces the
11903         number of "QualifiedIdentifier" classes created, and instead
11904         directly creates MemberAccess expressions.
11905
11906 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
11907
11908         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11909         that fixes #52853.  Null literal assignment to ValueType
11910
11911         * class.cs (MethodData.Emit): Instead of checking the name of the
11912         method to determine if its a destructor, create a new derived
11913         class from Method called Destructor, and test for that.  
11914
11915         * cs-parser.jay: Create a Destructor object instead of a Method.  
11916
11917         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11918
11919         Fixes: 52933
11920
11921 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
11922
11923         * expression.cs (Binary.ResolveOperator): Perform an implicit
11924         conversion from MethodGroups to their delegate types on the
11925         Addition operation.
11926
11927         * delegate.cs: Introduce a new class DelegateCreation that is the
11928         base class for `NewDelegate' and `ImplicitDelegateCreation',
11929         factor some code in here.
11930
11931         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11932         conversion from MethodGroups to compatible delegate types. 
11933
11934         * ecore.cs (Expression.Resolve): Do not flag error 654
11935         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11936         we allow conversions from MethodGroups to delegate types now.
11937
11938         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11939         assignments in v2 either.
11940
11941 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
11942
11943         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11944         static read-only fields in ctors.
11945
11946         Applied patch from Benjamin Jemlich 
11947
11948         * expression.cs (UnaryMutator): Avoid leaking local variables. 
11949
11950 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
11951
11952         * cs-tokenizer.cs (IsCastToken): Allow the various native types
11953         here to return true, as they can be used like this:
11954
11955                 (XXX) int.MEMBER ()
11956
11957         Fixed 49836 and all the other dups
11958
11959 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
11960
11961         * driver.cs: Implement /win32res and /win32icon.
11962
11963 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
11964
11965         * cs-parser.jay: Add a rule to improve error handling for the
11966         common mistake of placing modifiers after the type.
11967
11968 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
11969
11970         * cs-parser.jay (interface_event_declaration): Catch
11971         initialization of events on interfaces, and report cs0068
11972
11973         * cs-parser.jay (interface_event_declaration): Catch
11974         initialization of events. 
11975
11976         * ecore.cs: Better report missing constructors.
11977
11978         * expression.cs (Binary.ResolveOperator): My previous bug fix had
11979         the error reporting done in the wrong place.  Fix.
11980
11981         * expression.cs (Binary.ResolveOperator): Catch the 
11982         operator + (E x, E y) error earlier, and later allow for implicit
11983         conversions in operator +/- (E e, U x) from U to the underlying
11984         type of E.
11985
11986         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11987         52596, if the container class is abstract, the default constructor
11988         is protected otherwise its public (before, we were always public).
11989
11990         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11991         fixed statement.
11992
11993         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11994         Jemlich that fixes bug #52597, MCS was generating invalid code for
11995         idisposable structs.   Thanks to Ben for following up with this
11996         bug as well.
11997
11998 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
11999
12000         * driver.cs: Allow assemblies without code to be generated, fixes
12001         52230.
12002
12003 2004-01-07  Nick Drochak <ndrochak@gol.com>
12004
12005         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
12006
12007 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
12008
12009         * cs-parser.jay: Add rules to improve error reporting if fields or
12010         methods are declared at the namespace level (error 116)
12011
12012         * Add rules to catch event add/remove
12013
12014 2004-01-04  David Sheldon <dave-mono@earth.li>
12015
12016   * expression.cs: Added matching ")" to error message for 
12017   CS0077
12018
12019 2004-01-03 Todd Berman <tberman@gentoo.org>
12020
12021         * ecore.cs, attribute.cs:
12022         Applying fix from #52429.
12023
12024 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12025
12026         * ecore.cs, expression.cs, statement.cs:
12027         Total rewrite of how we handle branching. We
12028         now handle complex boolean expressions with fewer
12029         jumps. As well if (x == 0) no longer emits a ceq.
12030
12031         if (x is Foo) is much faster now, because we generate
12032         better code.
12033
12034         Overall, we get a pretty big improvement on our benchmark
12035         tests. The code we generate is smaller and more readable.
12036
12037         I did a full two-stage bootstrap. The patch was reviewed
12038         by Martin and Miguel.
12039
12040 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12041
12042         * cs-parser.jay: Make primary_expression not take a QI.
12043         we dont need this because the member_access rule covers
12044         us here. So we replace the rule with just IDENTIFIER.
12045
12046         This has two good effects. First, we remove a s/r conflict.
12047         Second, we allocate many fewer QualifiedIdentifier objects.
12048
12049 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12050
12051         * attribute.cs: Handle MarshalAs attributes as pseudo, and
12052         set the correct information via SRE. This prevents
12053         hanging on the MS runtime. Fixes #29374.
12054
12055 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12056
12057         * convert.cs: correctly handle conversions to value types
12058         from Enum and ValueType as unboxing conversions.
12059
12060         Fixes bug #52569. Patch by Benjamin Jemlich.
12061
12062 2004-01-02  Ravi Pratap  <ravi@ximian.com>
12063
12064         * expression.cs (BetterConversion): Prefer int -> uint
12065         over int -> ulong (csc's behaviour). This fixed bug #52046.
12066
12067 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12068
12069         * decl.cs (MemberCache.FindMembers): now returns a
12070         MemberInfo [].
12071
12072         * typemanager.cs: In general, go with with ^^.
12073         (CopyNewMethods): take an IList.
12074         (RealMemberLookup): Only allocate an arraylist
12075         if we copy from two sets of methods.
12076
12077         This change basically does two things:
12078         1) Fewer array lists allocated due to CopyNewMethods.
12079         2) the explicit cast in MemberList costed ALOT.
12080
12081 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
12082
12083         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
12084         a hashtable to avoid needless string allocations when an identifier is
12085         used more than once (the common case).
12086
12087 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
12088
12089         * pending.cs: MS's TypeBuilder.GetInterfaces ()
12090         is broken, it will not return anything. So, we
12091         have to use the information we have in mcs to
12092         do the task.
12093
12094         * typemanager.cs: Add a cache for GetInterfaces,
12095         since this will now be used more often (due to ^^)
12096
12097         (GetExplicitInterfaces) New method that gets the
12098         declared, not effective, interfaces on a type
12099         builder (eg, if you have interface IFoo, interface
12100         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
12101         { IBar }.
12102
12103         This patch makes MCS able to bootstrap itself on
12104         Windows again.
12105
12106 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
12107
12108         * expression.cs: Remove the Nop's that Miguel put
12109         in by mistake.
12110
12111 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12112
12113         * report.cs, codegen.cs: Give the real stack trace to
12114         the error when an exception is thrown.
12115
12116 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12117
12118         * decl.cs: only allocate hashtables for ifaces if 
12119         it is an iface!
12120
12121 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12122
12123         * expression.cs: fix the error from cs0121-2.cs
12124         (a parent interface has two child interfaces that
12125         have a function with the same name and 0 params
12126         and the function is called through the parent).
12127
12128 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
12129
12130         * class.cs, rootcontext.cs, typmanager.cs: do not
12131         leak pointers.
12132
12133 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12134
12135         * codegen.cs: remove stack for the ec flow branching.
12136         It is already a linked list, so no need.
12137
12138 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
12139
12140         * Makefile: Allow custom profiler here.
12141
12142 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
12143
12144         * typemanager.cs (LookupType):
12145           - Use a static char [], because split takes
12146             a param array for args, so it was allocating
12147             every time.
12148           - Do not store true in a hashtable, it boxes.
12149
12150 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
12151
12152         * flowanalysis.cs: bytify common enums.
12153
12154 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12155
12156         * modifiers.cs: Add a new set of flags for the
12157         flags allowed on explicit interface impls.
12158         * cs-parser.jay: catch the use of modifiers in
12159         interfaces correctly.
12160         * class.cs: catch private void IFoo.Blah ().
12161
12162         All related to bug #50572.
12163
12164 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12165
12166         * decl.cs: Rewrite the consistant accessability checking.
12167         Accessability is not linear, it must be implemented in
12168         a tableish way. Fixes #49704.
12169
12170 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12171
12172         * expression.cs: Handle negation in a checked context.
12173         We must use subtraction from zero. Fixes #38674.
12174
12175 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12176
12177         * class.cs: Ignore static void main in DLLs.
12178         * rootcontext.cs: Handle the target type here,
12179         since we are have to access it from class.cs
12180         * driver.cs: account for the above.
12181
12182 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12183
12184         * report.cs: Give line numbers and files if available.
12185
12186 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
12187
12188         * driver.cs: Implement /addmodule.
12189
12190         * typemanager.cs:  Change 'modules' field so it now contains Modules not
12191         ModuleBuilders.
12192
12193 2003-12-20  Martin Baulig  <martin@ximian.com>
12194
12195         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
12196         (FieldBase.IsAssigned): Removed this field.
12197         (FieldBase.SetAssigned): New public method.
12198         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
12199
12200 2003-12-20  Martin Baulig  <martin@ximian.com>
12201
12202         * expression.cs (LocalVariableReference.DoResolve): Don't set
12203         `vi.Used' if we're called from DoResolveLValue().
12204
12205         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
12206         returns the usage vector it just merged into the current one -
12207         pass this one to UsageWarning().
12208         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
12209         of the `EmitContext', don't call this recursively on our children.
12210
12211 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
12212
12213         * driver.cs: Implement /target:module.
12214
12215 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
12216
12217         * support.cs (CharArrayHashtable): New helper class.
12218
12219         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
12220         char arrays, not strings, so we can avoid creating a string in
12221         consume_identifier if the identifier is a keyword.
12222
12223 2003-12-16  Martin Baulig  <martin@ximian.com>
12224
12225         * statement.cs (LocalInfo.Assigned): Removed this property.
12226         (LocalInfo.Flags): Removed `Assigned'.
12227         (LocalInfo.IsAssigned): New public method; takes the EmitContext
12228         and uses flow analysis.
12229         (Block.UsageWarning): Made this method private.
12230         (Block.Resolve): Call UsageWarning() if appropriate.
12231
12232         * expression.cs (LocalVariableReference.DoResolve): Always set
12233         LocalInfo.Used here.
12234
12235 2003-12-13  Martin Baulig  <martin@ximian.com>
12236
12237         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
12238         any value here; we're now using flow analysis to figure out
12239         whether a statement/block returns a value.
12240
12241 2003-12-13  Martin Baulig  <martin@ximian.com>
12242
12243         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
12244         working again.
12245         (FlowBranching.MergeFinally): Don't call
12246         `branching.CheckOutParameters()' here, this is called in
12247         MergeTopBlock().
12248         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
12249         when adding the `finally' vector.       
12250
12251 2003-12-13  Martin Baulig  <martin@ximian.com>
12252
12253         * flowanalysis.cs
12254         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
12255         actually work and also fix #48962.
12256
12257 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
12258
12259         * decl.cs: Do not check System.Object for nested types,
12260         since we know it does not have any. Big bang for buck:
12261
12262         BEFORE:
12263            Run 1:   8.35 seconds
12264            Run 2:   8.32 seconds
12265            corlib:  17.99 seconds
12266         AFTER:
12267            Run 1:   8.17 seconds
12268            Run 2:   8.17 seconds
12269            corlib:  17.39 seconds
12270
12271 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
12272
12273         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
12274         time we are returning 0 members, so we save alot here.
12275
12276 2003-12-11  Martin Baulig  <martin@ximian.com>
12277
12278         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
12279         `MergeChild()', also just take the `FlowBranching' as argument;
12280         call Merge() on it and return the result.
12281         (FlowBranching.Merge): We don't need to do anything if we just
12282         have one sibling.
12283
12284 2003-12-11  Martin Baulig  <martin@ximian.com>
12285
12286         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
12287         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
12288         Maurer for this idea.
12289
12290 2003-12-11  Martin Baulig  <martin@ximian.com>
12291
12292         * flowanalysis.cs (MergeResult): This class is now gone; we now
12293         use the `UsageVector' for this.  The reason for this is that if a
12294         branching just has one sibling, we don't need to "merge" them at
12295         all - that's the next step to do.
12296         (FlowBranching.Merge): We now return a `UsageVector' instead of a
12297         `MergeResult'.
12298
12299 2003-12-11  Martin Baulig  <martin@ximian.com>
12300
12301         Reworked flow analyis and made it more precise and bug-free.  The
12302         most important change is that we're now using a special `Reachability'
12303         class instead of having "magic" meanings of `FlowReturns'.  I'll
12304         do some more cleanups and optimizations and also add some more
12305         documentation this week.
12306
12307         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
12308         largely reworked this class.
12309         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
12310         the new `Reachability' class instead of having "magic" values here.
12311         (FlowBranching): We're now using an instance of `Reachability'
12312         instead of having separate `Returns', `Breaks' etc. fields.
12313
12314         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
12315         based on flow analysis; ignore the return value of block.Emit ().
12316
12317 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
12318
12319         * driver.cs typemanager.cs: Find the mono extensions to corlib even
12320         if they are private.
12321
12322 2003-12-09  Martin Baulig  <martin@ximian.com>
12323
12324         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
12325         call them directly on the UsageVector.
12326
12327 2003-12-09  Martin Baulig  <martin@ximian.com>
12328
12329         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
12330         Changed return type from `FlowReturns' to `Reachability'.
12331
12332 2003-12-09  Martin Baulig  <martin@ximian.com>
12333
12334         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
12335         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
12336         `Reachable' fields with a single `Reachability' one.
12337
12338 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12339
12340         * class.cs (FindMembers): Remove foreach's.
12341
12342         Bootstrap times:
12343
12344         BEFORE
12345                 Run 1:   8.74 seconds
12346                 Run 2:   8.71 seconds
12347
12348         AFTER
12349                 Run 1:   8.64 seconds
12350                 Run 2:   8.58 seconds
12351
12352
12353 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12354
12355         * cs-parser.jay:
12356         * gen-treedump.cs:
12357         * statement.cs:
12358         This patch does a few things:
12359                 1. EmptyStatement is now a singleton, so it is never reallocated.
12360                 2. All blah is EmptyStatement constructs have been changed to
12361                    blah == EmptyStatement.Value, which is much faster and valid
12362                    now that EmptyStatement is a singleton.
12363                 3. When resolving a block, rather than allocating a new array for
12364                    the non-empty statements, empty statements are replaced with
12365                    EmptyStatement.Value
12366                 4. Some recursive functions have been made non-recursive.
12367         Mainly the performance impact is from (3), however (1) and (2) are needed for
12368         this to work. (4) does not make a big difference in normal situations, however
12369         it makes the profile look saner.
12370
12371         Bootstrap times:
12372
12373         BEFORE
12374         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12375         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12376         Total memory allocated: 56397 KB
12377
12378         AFTER
12379         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
12380         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
12381         Total memory allocated: 55666 KB
12382
12383 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12384
12385         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
12386         than the hashtable in a hashtable version
12387
12388         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
12389         we always end up concating a string. This results in a huge perf
12390         loss, because many strings have to be tracked by the GC. In this
12391         patch, we first use a hashtable that works with two keys, so that
12392         the strings do not need to be concat'ed.
12393
12394         Bootstrap times:
12395         BEFORE
12396                 Run 1:   8.74 seconds
12397                 Run 2:   8.71 seconds
12398
12399         AFTER
12400                 Run 1:   8.65 seconds
12401                 Run 2:   8.56 seconds
12402
12403 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12404
12405         * Makefile: Add a new target `do-time' that does a quick and simple
12406         profile, leaving easy to parse output.
12407
12408 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
12409
12410         * codegen.cs (Init): Create the dynamic assembly with 
12411         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
12412
12413 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12414
12415         * support.cs: Make the PtrHashtable use only one
12416         instance of its comparer.
12417
12418 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
12419
12420         * typemanager.cs: Fix lookup of GetNamespaces.
12421
12422 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
12423
12424         * expression.cs: Removed redundant line.
12425
12426         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
12427         ArrayLists, use for loops with bounds.  
12428
12429         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
12430         arraylist.
12431
12432         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
12433         arraylists, use for loop with bounds.
12434
12435         The above three changes give us a 0.071 second performance
12436         improvement out of 3.294 seconds down to 3.223.  On my machine
12437         the above changes reduced the memory usage by 1,387 KB during
12438         compiler bootstrap.
12439
12440         * cs-parser.jay (QualifiedIdentifier): New class used to represent
12441         QualifiedIdentifiers.  Before we created a new string through
12442         concatenation, and mostly later on, the result would be
12443         manipulated by DecomposeQI through string manipulation.
12444
12445         This reduced the compiler memory usage for bootstrapping from
12446         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
12447         compile times in 0.05 seconds.
12448
12449 2003-11-28  Dick Porter  <dick@ximian.com>
12450
12451         * support.cs: Do string compares with the Invariant culture.
12452
12453         * rootcontext.cs: 
12454         * gen-treedump.cs: 
12455         * expression.cs: 
12456         * driver.cs: 
12457         * decl.cs: 
12458         * codegen.cs: 
12459         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
12460         the comparison is done with the Invariant culture.
12461
12462 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
12463
12464         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
12465         GetEnumerator method.
12466
12467         (ProbeCollectionType): Iterate starting at the most specific type
12468         upwards looking for a GetEnumerator
12469
12470         * expression.cs: Shift count can be up to 31 for int/uint and 63
12471         for long/ulong.
12472
12473 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
12474
12475         * statement.cs (Block.LookupLabel): Also look for the label on the
12476         children blocks.  Use a hash table to keep track of visited
12477         nodes. 
12478
12479         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
12480         we actually did transform the other operand, otherwise fall back
12481         to the common codepath that casts to long.
12482
12483         * cs-tokenizer.cs: Use the same code pattern as the int case.
12484         Maybe I should do the parsing myself, and avoid depending on the
12485         Parse routines to get this done.
12486
12487 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
12488
12489         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12490         which fixes bug 51347.  This time test it.
12491
12492         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
12493         attributes for example can not tell the difference between these.
12494         The difference was only a syntax feature of the language. 
12495
12496         * attribute.cs: Apply attributes to delegates.
12497
12498         * delegate.cs: Call the apply attributes method.
12499
12500 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
12501
12502         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
12503         comparing 0 vs Byte.MinValue, not the value
12504
12505         (ImplicitConversionRequired): When reporting a conversion error,
12506         use error 31 to print out the constant error instead of the
12507         simpler 29.
12508
12509         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12510         which fixes bug 51347.
12511
12512 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
12513
12514         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
12515         which fixes the -warnaserror command line option.
12516
12517 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
12518
12519         * cfold.cs (DoNumericPromotions): During constant folding of
12520         additions on UIntConstant, special case intconstants with
12521         IntConstants like we do on the expression binary operator. 
12522
12523 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
12524
12525         * convert.cs (ImplicitReferenceConversion): We were missing a case
12526         (System.Enum are not value types or class types, so we need to
12527         classify them separatedly).
12528
12529         * driver.cs: We do not support error 2007.
12530
12531 2003-11-12 Jackson Harper <jackson@ximian.com>
12532
12533         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
12534         system directory. Also use the full file name so users can
12535         libraries names mscorlib-o-tron.dll in a non system dir.
12536
12537 2003-11-10  Martin Baulig  <martin@ximian.com>
12538
12539         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
12540         (TypeManager.InitCoreTypes): Initialize them here, but instead of
12541         calling `ResolveType()' on them, directly assign their `Type'.
12542
12543 2003-11-08  Martin Baulig  <martin@ximian.com>
12544
12545         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
12546         return value and the `out parent' parameter.
12547         (TypeContainer.DefineType): Moved the CS0644 check into
12548         GetClassBases().  Don't pass the interface types to the
12549         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
12550         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
12551
12552         * ecore.cs (TypeExpr.IsAttribute): New property.
12553         (TypeExpr.GetInterfaces): New method.
12554
12555         * interface.cs (Interface.GetInterfaceTypeByName): Return a
12556         TypeExpr instead of a Type.
12557         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
12558         (Interface.DefineType): Don't pass the interface types to the
12559         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
12560         them later and then call `TypeBulider.AddInterfaceImplementation()'.
12561
12562         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
12563         instead of a `Type[]'.
12564         (TypeManager.RegisterBuilder): Likewise.
12565         (TypeManager.AddUserInterface): Likewise.
12566         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
12567         `Type[]' and also return a `TypeExpr[]'.
12568         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
12569
12570 2003-11-08  Martin Baulig  <martin@ximian.com>
12571
12572         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12573         Expression.     
12574
12575 2003-11-08  Martin Baulig  <martin@ximian.com>
12576
12577         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12578         TypeManager.ResolveExpressionTypes().
12579
12580         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12581         instead of an Expression.
12582         (TypeExpr): This is now an abstract base class for `TypeExpression'.
12583         (TypeExpression): New public class; formerly known as `TypeExpr'.
12584
12585         * expression.cs (ComposedCast): Derive from TypeExpr.
12586
12587         * typemanager.cs (TypeManager.system_*_expr): These are now
12588         TypExpr's instead of Expression's.
12589         (TypeManager.ResolveExpressionTypes): New public static function;
12590         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12591         of them.        
12592
12593 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
12594
12595         * expression.cs (New.DoResolve): Do not dereference value that
12596         might be a null return.
12597
12598         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12599         sure that the constant value has the right type.  Fixes an
12600         unreported bug, similar to 50425.
12601
12602         * const.cs (Const.LookupConstantValue): Call
12603         ImplicitStandardConversionExists before doing a conversion to
12604         avoid havng the TypeManager.ChangeType do conversions.
12605
12606         Reduced the number of casts used
12607
12608         (Const.ChangeType): New routine to enable reuse of the constant
12609         type changing code from statement.
12610
12611         * typemanager.cs (ChangeType): Move common initialization to
12612         static global variables.
12613
12614         Fixes #50425.
12615
12616         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12617         every value type to go through, even if it was void.  Fix that. 
12618
12619         * cs-tokenizer.cs: Use is_identifier_start_character on the start
12620         character of the define, and the is_identifier_part_character for
12621         the rest of the string.
12622
12623 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
12624
12625         * expression.cs (UnaryMutator.EmitCode): When I updated
12626         LocalVariableReference.DoResolve, I overdid it, and dropped an
12627         optimization done on local variable references.
12628
12629 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
12630
12631         * ecore.cs: Convert the return from Ldlen into an int.
12632
12633 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
12634
12635         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12636         the accessibility, this is a special case for toplevel non-public
12637         classes (internal for instance).
12638
12639 2003-10-20  Nick Drochak <ndrochak@gol.com>
12640
12641         * ecore.cs: Fix typo and build.  Needed another right paren.
12642
12643 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
12644
12645         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
12646         `internal' case regular and protected, but not allowing protected
12647         to be evaluated later.  Bug 49840
12648
12649 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
12650
12651         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12652         to kb.Nlast, and not the kb.nFirst to isolate the switch
12653         statement.
12654
12655         Extract the underlying type, so enumerations of long/ulong are
12656         treated like long/ulong.
12657
12658 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
12659
12660         * expression.cs (New): Overload the meaning of RequestedType to
12661         track the possible creation of the NewDelegate type, since
12662         DoResolve is invoked more than once for new constructors on field
12663         initialization.
12664
12665         See bugs: #48800 and #37014
12666
12667         * cs-parser.jay (declare_local_constants): Take an arraylist
12668         instead of a single constant.
12669
12670         (local_constant_declaration): It should take a
12671         constant_declarators, not a constant_declarator.  Fixes 49487
12672
12673         * convert.cs: Fix error report.
12674
12675 2003-10-13 Jackson Harper <jackson@ximian.com>
12676
12677         * typemanager.cs (TypeToCoreType): Add float and double this fixes
12678         bug #49611
12679
12680 2003-10-09  Martin Baulig  <martin@ximian.com>
12681
12682         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12683         to the .ctor.
12684         (MethodCore.DoDefineParameters): Removed the TypeContainer
12685         argument; use the DeclSpace which was passed to the .ctor instead.
12686         (MethodCore.CheckParameter): Take a DeclSpace instead of a
12687         TypeContainer; we only need a DeclSpace here.
12688
12689 2003-10-09  Martin Baulig  <martin@ximian.com>
12690
12691         * class.cs (MethodData): Added additional `DeclSpace ds' argument
12692         to the .ctor.
12693         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12694         EmitContext's .ctor.    
12695
12696 2003-10-09  Martin Baulig  <martin@ximian.com>
12697
12698         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12699         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12700         AsAccessible(), moved them as well.
12701
12702         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12703
12704 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12705
12706         * cs-parser.jay : Renamed yyName to yyNames related to jay.
12707
12708 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
12709
12710         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12711         generation for >=, as spotted by Paolo, bug 48679.  
12712         Patch from David Waite.
12713
12714         * cs-tokenizer.cs: Add handling for #pragma.
12715
12716         * cs-parser.jay: Allow for both yield and yield return in the
12717         syntax.  The anti-cobolization of C# fight will go on!
12718
12719         * class.cs (TypeBuilder.DefineType): Catch error condition here
12720         (Parent.DefineType erroring out and returning null).
12721
12722         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12723         coping with enumerations variables, we were mistakenly processing
12724         them as a regular value type instead of built-in types.  Fixes the
12725         bug #48063
12726
12727         * typemanager.cs (IsBuiltinOrEnum): New method.
12728
12729 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
12730
12731         * cs-parser.jay: Upgrade: yield now needs the return clause.
12732
12733 2003-09-19  Martin Baulig  <martin@ximian.com>
12734
12735         * decl.cs (MemberCache.SetupCacheForInterface): Take a
12736         `MemberCache parent' argument.  Normally, an interface doesn't
12737         have a parent type except System.Object, but we use this in gmcs
12738         for generic type parameters.
12739
12740 2003-09-18  Martin Baulig  <martin@ximian.com>
12741
12742         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12743         on `type.IsInterface'; don't check whether the type has a parent
12744         to determine whether it's an interface.
12745
12746 2003-09-15  Martin Baulig  <martin@ximian.com>
12747
12748         * class.cs (TypeContainer.DefineType): Added an error flag to
12749         avoid reporting duplicate CS0146's ("class definition is
12750         circular.").
12751
12752         * driver.cs (Driver.MainDriver): Abort if
12753         RootContext.ResolveTree() reported any errors.
12754
12755 2003-09-07  Martin Baulig  <martin@ximian.com>
12756
12757         * report.cs (Error, Warning): Added overloaded versions which take
12758         a `params object[] args' and call String.Format().
12759
12760 2003-09-07  Martin Baulig  <martin@ximian.com>
12761
12762         * decl.cs (DeclSpace..ctor): Don't call
12763         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12764         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
12765         (DeclSpace.RecordDecl): New method.
12766
12767         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12768
12769 2003-09-02  Ravi Pratap  <ravi@ximian.com>
12770
12771         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12772         value attributes to be applied to ParameterBuilders.
12773
12774         * class.cs (MethodCore.LabelParameters): Make static and more
12775         generic so that it can be used from other places - like interface
12776         methods, for instance.
12777
12778         * interface.cs (Interface.Emit): Call LabelParameters before
12779         emitting attributes on the InterfaceMethod.
12780
12781 2003-08-26  Martin Baulig  <martin@ximian.com>
12782
12783         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12784         resolving aliases; fixes #47927.
12785
12786 2003-08-26  Martin Baulig  <martin@ximian.com>
12787
12788         * statement.cs (Using.DoResolve): This is internally emitting a
12789         try/finally clause, so we need to set ec.NeedExplicitReturn if we
12790         do not always return.  Fixes #47681.
12791
12792 2003-08-26  Martin Baulig  <martin@ximian.com>
12793
12794         * decl.cs (MemberCore): Moved WarningNotHiding(),
12795         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
12796         into MemberBase.
12797         (AdditionResult): Make this nested in DeclSpace.
12798         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
12799         argument; call NamespaceEntry.Define() unless we're nested in a
12800         class or struct.
12801
12802         * namespace.cs (Namespace.DefineName): New public function.  This
12803         is called from DeclSpace's .ctor to add 
12804         (Namespace.Lookup): Include DeclSpaces in the lookup.
12805
12806         * class.cs (Operator): Derive from MemberBase, not MemberCore.
12807
12808         * const.cs (Const): Derive from MemberBase, not MemberCore.     
12809
12810 2003-08-25  Martin Baulig  <martin@ximian.com>
12811
12812         * convert.cs (Convert.ExplicitReferenceConversion): When
12813         converting from an interface type to a class, unbox if the target
12814         type is a struct type.  Fixes #47822.
12815
12816 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12817
12818         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
12819         #47854.
12820
12821 2003-08-22  Martin Baulig  <martin@ximian.com>
12822
12823         * class.cs (TypeManager.DefineType): When defining a nested type,
12824         call DefineType() on our parent; fixes #47801.
12825
12826 2003-08-22  Martin Baulig  <martin@ximian.com>
12827
12828         * class.cs (MethodData.Define): While checking if a method is an
12829         interface implementation, improve the test a bit more to fix #47654.
12830
12831 2003-08-22  Martin Baulig  <martin@ximian.com>
12832
12833         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
12834         correctly; fixes #47722.
12835
12836 2003-08-22  Martin Baulig  <martin@ximian.com>
12837
12838         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
12839         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
12840
12841         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
12842
12843 2003-08-22  Martin Baulig  <martin@ximian.com>
12844
12845         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
12846         can only be assigned in static constructors.  Fixes #47161.
12847
12848 2003-08-22  Martin Baulig  <martin@ximian.com>
12849
12850         Rewrote and improved the flow analysis code.
12851
12852         * flowbranching.cs (FlowBranching): Make this class abstract.
12853         (FlowBranching.CreateBranching): New static function to create a
12854         new flow branching.
12855         (FlowBranchingBlock, FlowBranchingException): New classes.
12856         (FlowBranching.UsageVector.Type): New public readonly field.
12857         (FlowBranching.UsageVector.Breaks): Removed the setter.
12858         (FlowBranching.UsageVector.Returns): Removed the setter.
12859         (FlowBranching.UsageVector): Added Break(), Return(),
12860         NeverReachable() and Throw() methods to modify the reachability.
12861         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
12862         done by FlowBranching.Merge().
12863         (FlowBranching.UsageVector.MergeChild): New method; merges the
12864         merge result into the current vector.
12865         (FlowBranching.Merge): New abstract method to merge a branching.
12866
12867 2003-08-12  Martin Baulig  <martin@ximian.com>
12868
12869         * expression.cs (Indirection.CacheTemporaries): Create the
12870         LocalTemporary with the pointer type, not its element type.
12871
12872 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
12873
12874         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
12875         token was a keyword or not.
12876
12877         Add `error' options where an IDENTIFIER was expected;  Provide
12878         CheckToken and CheckIdentifierToken convenience error reporting
12879         functions. 
12880
12881         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
12882
12883         * decl.cs: Rename `NamespaceEntry Namespace' public field into
12884         NameSpaceEntry NameSpaceEntry.
12885
12886         (LookupInterfaceOrClass): Avoid creating a full qualified name
12887         from namespace and name: avoid doing lookups when we know the
12888         namespace is non-existant.   Use new Tree.LookupByNamespace which
12889         looks up DeclSpaces based on their namespace, name pair.
12890
12891         * driver.cs: Provide a new `parser verbose' to display the
12892         exception thrown during parsing.  This is turned off by default
12893         now, so the output of a failure from mcs is more graceful.
12894
12895         * namespace.cs: Track all the namespaces defined in a hashtable
12896         for quick lookup.
12897
12898         (IsNamespace): New method
12899
12900 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
12901
12902         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
12903         we know that we need to concatenate (full typename can never be
12904         null). 
12905
12906         * class.cs: ditto.
12907
12908         * statement.cs: Use a bitfield;  Do not initialize to null things
12909         which are done by the constructor by default.
12910
12911         * cs-parser.jay: bug fix, parameter was 4, not 3.
12912
12913         * expression.cs: Just use the property;
12914
12915         * statement.cs: No need for GetVariableInfo method.
12916
12917 2003-08-08  Martin Baulig  <martin@ximian.com>
12918
12919         * flowanalysis.cs (FlowReturns): This is now nested in the
12920         `FlowBranching' class.
12921         (MyBitVector): Moved this here from statement.cs.
12922         (FlowBranching.SiblingType): New enum type.
12923         (FlowBranching.CreateSibling): Added `SiblingType' argument.
12924
12925 2003-08-07  Martin Baulig  <martin@ximian.com>
12926
12927         * flowanalysis.cs (FlowBranchingType): This is now nested in the
12928         `FlowBranching' class and called `BranchingType'.
12929
12930 2003-08-07  Martin Baulig  <martin@ximian.com>
12931
12932         * flowanalysis.cs: Moved all the control flow analysis code into
12933         its own file.
12934
12935 2003-08-07  Martin Baulig  <martin@ximian.com>
12936
12937         * assign.cs (Assign.DoResolve): `target' must either be an
12938         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
12939         #37319.
12940
12941 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
12942
12943         * expression.cs (BinaryMethod): This kind of expression is created by the
12944         Binary class if it determines that the operator has to be handled
12945         by a method.
12946
12947         (BinaryDelegate): This kind of expression is created if we are
12948         dealing with a + or - operator on delegates.
12949
12950         (Binary): remove method, argumetns, and DelegateOperator: when
12951         dealing with methods, 
12952
12953         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
12954
12955         * statement.cs (Block): use bitfields for the three extra booleans
12956         we had in use.   Remove unused topblock parameter.
12957
12958         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
12959
12960         * assign.cs: Drop extra unneeded tests.
12961
12962 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
12963
12964         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
12965
12966         * statement.cs (Foreach): Use VariableStorage instead of
12967         LocalBuilders.   
12968
12969         * codegen.cs (VariableStorage): New class used by clients that
12970         require a variable stored: locals or fields for variables that
12971         need to live across yield.
12972
12973         Maybe provide a convenience api for EmitThis+EmitLoad?
12974
12975         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
12976         these bad boys.
12977
12978 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
12979
12980         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
12981         RemapParameterLValue): New methods that are used to turn a
12982         precomputed FieldInfo into an expression like this:
12983
12984                 instance.FieldInfo
12985
12986         The idea is to use this instead of making LocalVariableReference
12987         have more than one meaning.
12988
12989         * cs-parser.jay: Add error production to BASE.
12990
12991         * ecore.cs: Deal with TypeManager.GetField returning null, which
12992         is now a valid return value.
12993
12994         (FieldExprNoAddress): New expression for Fields whose address can
12995         not be taken.
12996
12997         * expression.cs (LocalVariableReference): During the resolve
12998         phases, create new expressions if we are in a remapping context.
12999         Remove code that dealt with remapping here.
13000
13001         (ParameterReference): same.
13002
13003         (ProxyInstance): New expression, like the `This' expression, but
13004         it is born fully resolved.  We know what we are doing, so remove
13005         the errors that are targeted to user-provided uses of `this'.
13006
13007         * statement.cs (Foreach): our variable is now stored as an
13008         Expression;  During resolution, follow the protocol, dont just
13009         assume it will return this.
13010
13011 2003-08-06  Martin Baulig  <martin@ximian.com>
13012
13013         * support.cs (SeekableStreamReader.cs): New public class.
13014
13015         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
13016         SeekableStreamReader instead of the normal StreamReader.
13017
13018 2003-08-04  Martin Baulig  <martin@ximian.com>
13019
13020         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
13021         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
13022         deambiguate casts and delegate invocations.
13023         (parenthesized_expression): Use the new tokens to ensure this is
13024         not a cast of method invocation.
13025
13026         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
13027         when reading a `)' and Deambiguate_CloseParens () was previously
13028         called.
13029
13030         * expression.cs (ParenthesizedExpression): New class.  This is
13031         just used for the CS0075 test.
13032         (Binary.DoResolve): Check for CS0075.   
13033
13034 2003-07-29  Ravi Pratap  <ravi@ximian.com>
13035
13036         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
13037         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
13038         reference comparison.
13039
13040         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
13041         examine the ReturnType for equality - this is necessary in the
13042         cases of implicit and explicit operators whose signature also
13043         includes the return type.
13044
13045 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
13046
13047         * namespace.cs: Cache the result of the namespace computation,
13048         instead of computing it every time.
13049
13050 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
13051
13052         * decl.cs: Use a global arraylist that we reuse over invocations
13053         to avoid excesive memory consumption.  Reduces memory usage on an
13054         mcs compile by one meg (45 average).
13055
13056         * typemanager.cs (LookupTypeReflection): In .NET pointers are
13057         private, work around that.
13058
13059 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
13060
13061         * literal.cs (IntLiteral): Define Zero and One static literals. 
13062
13063         * cs-parser.jay (integer_literal): use static literals to reduce
13064         memory usage for the most used literals (0, 1 and -1).  211kb
13065         reduced in memory usage.
13066
13067         Replace all calls to `new ArrayList' with `new
13068         ArrayList(4)' which is a good average number for most allocations,
13069         and also requires only 16 bytes of memory for its buffer by
13070         default. 
13071
13072         This reduced MCS memory usage in seven megabytes for the RSS after
13073         bootstrapping.
13074
13075 2003-07-28  Ravi Pratap  <ravi@ximian.com>
13076
13077         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
13078         handle params methods the correct way by forming only one
13079         applicable set with params and normal methods in them. Earlier we
13080         were looking at params methods only if we found no normal methods
13081         which was not the correct thing to do.
13082
13083         (Invocation.BetterFunction): Take separate arguments indicating
13084         when candidate and the best method are params methods in their
13085         expanded form.
13086
13087         This fixes bugs #43367 and #46199.
13088
13089         * attribute.cs: Documentation updates.
13090
13091         (CheckAttribute): Rename to CheckAttributeTarget.
13092         (GetValidPlaces): Rename to GetValidTargets.
13093
13094         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
13095         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
13096
13097         Fixes bug #44468.
13098
13099 2003-07-28  Martin Baulig  <martin@ximian.com>
13100
13101         * class.cs (TypeContainer.DefineMembers): Use the base type's full
13102         name when looking up the base class of a nested class.  Fixes #46977.
13103
13104 2003-07-26  Martin Baulig  <martin@ximian.com>
13105
13106         * expression.cs (Indexers.Indexer): New nested struct; contains
13107         getter, setter and the indexer's type.
13108         (Indexers.Properties): This is now an ArrayList of
13109         Indexers.Indexer's.
13110         (IndexerAccess.DoResolveLValue): Correctly set the type if the
13111         indexer doesn't have any getters.
13112
13113         * assign.cs (Assign.DoResolve): Also do the implicit conversions
13114         for embedded property and indexer assignments.
13115
13116 2003-07-26  Martin Baulig  <martin@ximian.com>
13117
13118         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
13119         preprocessor directive is not the first non-whitespace character
13120         on a line.
13121
13122 2003-07-26  Martin Baulig  <martin@ximian.com>
13123
13124         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
13125         namespace parsing, follow the spec more closely.
13126
13127         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
13128         NamespaceEntry.Lookup().
13129
13130 2003-07-25  Martin Baulig  <martin@ximian.com>
13131
13132         * MethodCore.cs (OverridesSomething): New public field; it's set
13133         from TypeContainer.DefineMembers if this method overrides
13134         something (which doesn't need to be a method).  Fix #39462.
13135
13136 2003-07-25  Ravi Pratap  <ravi@ximian.com>
13137
13138         * typemanager.cs (GetMembers): Ensure that the list of members is
13139         reversed. This keeps things in sync.
13140
13141         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
13142         find an AttributeUsage attribute.
13143
13144         * expression.cs (Invocation.OverloadResolve): Perform the check
13145         which disallows Invoke to be directly called on a Delegate.
13146
13147         (Error_InvokeOnDelegate): Report error cs1533.
13148
13149 2003-07-25  Martin Baulig  <martin@ximian.com>
13150
13151         * expression.cs (Indexers.GetIndexersForType): Only look in the
13152         interface hierarchy if the requested type is already an
13153         interface.  Fixes #46788 while keeping #46502 fixed.
13154
13155 2003-07-25  Martin Baulig  <martin@ximian.com>
13156
13157         * class.cs (TypeContainer.DefineMembers): Check whether all
13158         readonly fields have been assigned and report warning CS0649 if
13159         not.
13160
13161         * statement.cs (LocalInfo.IsFixed): Always return true if this is
13162         a valuetype.
13163
13164 2003-07-24  Ravi Pratap  <ravi@ximian.com>
13165
13166         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
13167         returned from GetMethods to make things consistent with the
13168         assumptions MCS makes about ordering of methods.
13169
13170         This should comprehensively fix bug #45127 and it does :-)
13171
13172         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
13173         ordering is actually reverse.
13174
13175         * Clean up some debug messages I left lying around.
13176
13177         * interface.cs (Populate*): Get rid of code which emits attributes
13178         since the stage in which we emit attributes is the 'Emit' stage,
13179         not the define stage.
13180
13181         (Emit): Move attribute emission for interface members here.
13182
13183 2003-07-22  Ravi Pratap  <ravi@ximian.com>
13184
13185         * expression.cs (Invocation.OverloadResolve): Follow the spec more
13186         closely: we eliminate methods in base types when we have an
13187         applicable method in a top-level type.
13188
13189         Please see section 14.5.5.1 for an exact description of what goes
13190         on. 
13191
13192         This fixes bug #45127 and a host of other related to corlib compilation.
13193
13194         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
13195         array is the method corresponding to the top-level type (this is
13196         because of the changes made to icall.c) so we change this
13197         accordingly.
13198
13199         (MethodGroupExpr.Name): This too.
13200
13201         * typemanager.cs (GetElementType): New method which does the right
13202         thing when compiling corlib. 
13203
13204         * everywhere: Make use of the above in the relevant places.
13205
13206 2003-07-22  Martin Baulig  <martin@ximian.com>
13207
13208         * cs-parser.jay (invocation_expression): Moved
13209         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
13210         `cast_expression', but create a InvocationOrCast which later
13211         resolves to either an Invocation or a Cast.
13212
13213         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
13214         method; call this before EmitStatement() to make sure that this
13215         expression can be used as a statement.
13216
13217         * expression.cs (InvocationOrCast): New class; resolves to either
13218         an Invocation or a Cast.
13219
13220         * statement.cs (StatementExpression): Call ResolveStatement() on
13221         the ExpressionStatement before emitting it.
13222
13223 2003-07-21  Martin Baulig  <martin@ximian.com>
13224
13225         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
13226         `ref' and `out' attributes match; fixes #46220.
13227         (MemberAccess.ResolveMemberAccess): You can't reference a type
13228         through an expression; fixes #33180.
13229         (Indexers.GetIndexersForType): Don't return the indexers from
13230         interfaces the class implements; fixes #46502.
13231
13232 2003-07-21  Martin Baulig  <martin@ximian.com>
13233
13234         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
13235         CS0661 checks; fixes bug #30442.
13236
13237 2003-07-21  Martin Baulig  <martin@ximian.com>
13238
13239         * decl.cs (AdditionResult): Added `Error'.
13240
13241         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
13242
13243         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
13244         makes cs0031.cs actually work.
13245
13246 2003-07-20  Martin Baulig  <martin@ximian.com>
13247
13248         * namespace.cs: Fixed that bug which caused a crash when compiling
13249         the debugger's GUI.
13250
13251 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
13252
13253         * typemanager.cs (LookupTypeReflection): Never expose types which
13254         are NotPublic, NestedPrivate, NestedAssembly, or
13255         NestedFamANDAssem.  We used to return these, and later do a check
13256         that would report a meaningful error, but the problem is that we
13257         would not get the real match, if there was a name override.
13258
13259 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
13260
13261         * namespace.cs (Namespace, Name): Do not compute the namespace
13262         name dynamically, compute it in the constructor.  This reduced
13263         memory usage by 1697 KB.
13264
13265         * driver.cs: Use --pause to pause at the end.
13266
13267 2003-07-17  Peter Williams  <peter@newton.cx>
13268
13269         * Makefile: Change the name of the test target so that it doesn't
13270         conflict with the recursive test target.
13271
13272 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
13273
13274         * expression.cs (LocalVariableReference.Emit, EmitAssign,
13275         AddressOf): Do not use EmitThis, that was wrong, use the actual
13276         this pointer.
13277
13278 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
13279
13280         * class.cs (MethodData.Define): While checking if a method is an
13281         interface implementation, improve the test: If we are not public
13282         (use new test here: use the computed MethodAttributes directly,
13283         instead of the parsed modifier flags) check if the `implementing'
13284         method comes from an interface or not.
13285
13286         * pending.cs (VerifyPendingMethods): Slightly better error
13287         message.
13288
13289         * makefile: add test target that does the mcs bootstrap.
13290
13291 2003-07-16  Ravi Pratap  <ravi@ximian.com>
13292
13293         * interface.cs (Define): Do nothing here since there are no
13294         members to populate etc. Move the attribute emission out of here
13295         since this was just totally the wrong place to put it. Attribute
13296         application happens during the 'Emit' phase, not in the 'Define'
13297         phase.
13298
13299         (Emit): Add this method and move the attribute emission here
13300
13301         * rootcontext.cs (EmitCode): Call the Emit method on interface
13302         types too.
13303
13304 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13305
13306         * expression.cs (OverloadResolve): Report error only if Location
13307         is not 'Null' which means that there was a probe going on.
13308
13309 2003-07-14  Martin Baulig  <martin@ximian.com>
13310
13311         * expression.cs (ConditionalLogicalOperator): New public class to
13312         implement user defined conditional logical operators.
13313         This is section 14.11.2 in the spec and bug #40505.
13314
13315 2003-07-14  Martin Baulig  <martin@ximian.com>
13316
13317         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
13318
13319 2003-07-14  Martin Baulig  <martin@ximian.com>
13320
13321         * codegen.cs (EmitContext.InFixedInitializer): New public field.
13322
13323         * ecore.cs (IVariable.VerifyFixed): New interface method.
13324
13325         * expression.cs (Unary.ResolveOperator): When resolving the `&'
13326         operator, check whether the variable is actually fixed.  Fixes bug
13327         #36055.  Set a variable definitely assigned when taking its
13328         address as required by the spec.
13329
13330         * statement.cs (LocalInfo.IsFixed): New field.
13331         (LocalInfo.MakePinned): Set `IsFixed' to true.
13332
13333 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13334
13335         * attribute.cs (Attribute.Resolve): While doing a Member lookup
13336         for .ctors, ensure that we only ask for members declared in the
13337         attribute type (BindingFlags.DeclaredOnly).
13338
13339         Fixes bug #43632.
13340
13341         * expression.cs (Error_WrongNumArguments): Report error 1501
13342         correctly the way CSC does.
13343
13344 2003-07-13  Martin Baulig  <martin@ximian.com>
13345
13346         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
13347         lookup on the fully qualified name, to make things like "X.X" work
13348         where "X.X" is a fully qualified type name, but we also have a
13349         namespace "X" in the using list.  Fixes #41975.
13350
13351 2003-07-13  Martin Baulig  <martin@ximian.com>
13352
13353         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
13354         function. If we're a CompoundAssign, we need to create an embedded
13355         CompoundAssign, not an embedded Assign.
13356         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
13357         Fixes #45854.
13358
13359 2003-07-13  Martin Baulig  <martin@ximian.com>
13360
13361         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
13362         work to fix bug #46088.
13363
13364 2003-07-13  Ravi Pratap <ravi@ximian.com>
13365
13366         * class.cs (Operator.Emit): Do not emit attributes here - it is
13367         taken care of by the Method class that we delegate too. This takes
13368         care of bug #45876.
13369
13370 2003-07-10  Martin Baulig  <martin@ximian.com>
13371
13372         * expression.cs (TypeOfVoid): New class.
13373         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
13374
13375 2003-07-10  Martin Baulig  <martin@ximian.com>
13376
13377         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
13378         bug #35957.
13379
13380 2003-07-10  Martin Baulig  <martin@ximian.com>
13381
13382         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
13383         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
13384
13385         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
13386
13387         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
13388
13389 2003-07-10  Martin Baulig  <martin@ximian.com>
13390
13391         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
13392         of decimal.  Fixes #42850.
13393
13394         NOTE: I also fixed the created byte blob, but this doesn't work on
13395         the MS runtime and csc never produces any byte blobs for decimal
13396         arrays.
13397
13398 2003-07-10  Martin Baulig  <martin@ximian.com>
13399
13400         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
13401         structs; fixes #32068.
13402         (Block.AddChildVariableNames): Fixed #44302.
13403
13404 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13405
13406         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
13407
13408 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13409
13410         * attribute.cs: And this test is onger needed.
13411
13412 2003-07-08  Martin Baulig  <martin@ximian.com>
13413
13414         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
13415         inaccessible types.  Fixes #36313.
13416
13417         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
13418
13419         * namespace.cs (NamespaceEntry): Create implicit entries for all
13420         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
13421         implicit entries for N1.N2 and N1.
13422
13423 2003-07-08  Martin Baulig  <martin@ximian.com>
13424
13425         Rewrote the handling of namespaces to fix a lot of the issues
13426         wrt. `using' aliases etc.
13427
13428         * namespace.cs (Namespace): Splitted this class into a
13429         per-assembly `Namespace' and a per-file `NamespaceEntry'.
13430
13431         * typemanager.cs (TypeManager.IsNamespace): Removed.
13432         (TypeManager.ComputeNamespaces): Only compute namespaces from
13433         loaded assemblies here, not the namespaces from the assembly we're
13434         currently compiling.
13435
13436 2003-07-08  Martin Baulig  <martin@ximian.com>
13437
13438         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
13439
13440 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13441
13442         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
13443         already fixed it.  
13444
13445         I thought about the memory savings here, but LookupTypeReflection
13446         is used under already very constrained scenarios.  Compiling
13447         corlib or mcs only exposes one hit, so it would not really reduce
13448         any memory consumption.
13449
13450 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13451
13452         * typemanager.cs: fixes bug #45889 by only adding public types from
13453         other assemblies to the list of known types.
13454
13455 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13456
13457         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
13458         on the type we resolved.
13459
13460 2003-07-05  Martin Baulig  <martin@ximian.com>
13461
13462         * pending.cs (PendingImplementation.ParentImplements): Don't
13463         create the proxy if the parent is abstract.
13464
13465         * class.cs (TypeContainer.DefineIndexers): Process explicit
13466         interface implementations first.  Fixes #37714.
13467
13468 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
13469
13470         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
13471         defined recursively;  but since we modify the input parameters
13472         (left is set to `this' temporarily), we reset this value if the
13473         left_is_explicit is false, which gives the original semantics to
13474         the code.  
13475
13476         * literal.cs (NullPointer): new class used to represent a null
13477         literal in a pointer context.
13478
13479         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
13480         type is a pointer, use a NullPointer object instead of a
13481         NullLiteral.   Closes 43687
13482
13483         (ExplicitConversion): Convert pointer values using
13484         the conv opcode to the proper type.
13485
13486         * ecore.cs (New): change ValueTypeVariable property into a method,
13487         that returns whether the valuetype is suitable for being used.
13488
13489         * expression.cs (Binary.DoNumericPromotions): Only return if we
13490         the int constant was a valid uint, and we can return both left and
13491         right as uints.  If not, we continue processing, to trigger the
13492         type conversion.  This fixes 39018.
13493
13494         * statement.cs (Block.EmitMeta): During constant resolution, set
13495         the CurrentBlock property on the emitcontext, so that we resolve
13496         constants propertly.
13497
13498 2003-07-02  Martin Baulig  <martin@ximian.com>
13499
13500         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
13501         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
13502
13503         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13504         than emitting it here.
13505
13506         * statement.cs: Fixed some more flow analysis bugs.
13507
13508 2003-07-02  Martin Baulig  <martin@ximian.com>
13509
13510         * class.cs (MethodData.Define): When implementing interface
13511         methods, set Final unless we're Virtual.
13512
13513         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
13514         check work for interface methods.
13515
13516 2003-07-01  Martin Baulig  <martin@ximian.com>
13517
13518         * ecore.cs (EmitContext.This): Replaced this property with a
13519         GetThis() method which takes a Location argument.  This ensures
13520         that we get the correct error location for a CS0188.
13521
13522 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
13523
13524         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13525         ImplicitStandardConversion.
13526
13527         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13528
13529 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
13530
13531         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13532         optimization.
13533
13534 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
13535
13536         * class.cs (Constructor.Define): Turn off initlocals for unsafe
13537         constructors.
13538
13539         (MethodData.Define): Turn off initlocals for unsafe methods.
13540
13541 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
13542
13543         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13544         complete;  Fixes #37521.
13545
13546         * delegate.cs: Use Modifiers.TypeAttr to compute the
13547         TypeAttributes, instead of rolling our own.  This makes the flags
13548         correct for the delegates.
13549
13550 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
13551
13552         * class.cs (Constructor.Define): Set the private flag for static
13553         constructors as well.
13554
13555         * cs-parser.jay (statement_expression): Set the return value to
13556         null, to avoid a crash when we catch an error.
13557
13558 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
13559
13560         * cs-parser.jay: Applied patch from Jackson that adds support for
13561         extern and unsafe modifiers to destructor declarations.
13562
13563         * expression.cs: Report error 21 if the user is trying to index a
13564         System.Array.
13565
13566         * driver.cs: Add an error message, suggested by the bug report.
13567
13568         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13569         if we do not have a ": this ()" constructor initializer.  Fixes 45149
13570
13571 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
13572
13573         * namespace.cs: Add some information to reduce FAQs.
13574
13575 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
13576
13577         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13578         underlying enumeration types.  Fixes #43915.
13579
13580         * expression.cs: Treat ushort/short as legal values to be used in
13581         bitwise operations.
13582
13583 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13584
13585         * delegate.cs: transfer custom attributes for paramenters from
13586         the delegate declaration to Invoke and BeginInvoke.
13587
13588 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13589
13590         * attribute.cs: handle custom marshalers and emit marshal info
13591         for fields, too.
13592
13593 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
13594
13595         * makefile.gnu: Added anonymous.cs to the compiler sources.
13596
13597 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
13598
13599         * iterators.cs: Change the name of the proxy class to include two
13600         underscores.
13601
13602         * cs-parser.jay: Update grammar to include anonymous methods.
13603
13604         * anonymous.cs: new file.
13605
13606 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
13607
13608         * class.cs (Field.Define): Add missing test for pointers and
13609         safety. 
13610
13611 2003-05-27  Ravi Pratap  <ravi@ximian.com>
13612
13613         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13614         we use the stobj opcode.
13615
13616         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13617         since it wasn't the correct fix. 
13618
13619         It still is puzzling that we are required to use stobj for IntPtr
13620         which seems to be a ValueType.
13621
13622 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
13623
13624         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13625         during regular simple name resolution.   Now, the trick is that
13626         instead of returning for processing the simplename, we do a
13627         TypeManager.LookupType (ie, a rooted lookup as opposed to a
13628         contextual lookup type).   If a match is found, return that, if
13629         not, return for further composition.
13630
13631         This fixes long-standing 30485.
13632
13633         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13634         using the address to initialize an object, do an Stobj instead of
13635         using the regular Stelem.
13636
13637         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13638         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13639         Because if we are a BaseIndexerAccess that value will be true.
13640         Fixes 43643.
13641
13642         * statement.cs (GotoCase.Resolve): Return after reporting an
13643         error, do not attempt to continue. 
13644
13645         * expression.cs (PointerArithmetic.Emit): If our operand is a
13646         long, convert our constants to match the operand before
13647         multiplying.  Convert to I type before adding.   Fixes 43670.
13648
13649 2003-05-14  Ravi Pratap  <ravi@ximian.com>
13650
13651         * enum.cs (ImplicitConversionExists) : Rename to
13652         ImplicitEnumConversionExists to remove ambiguity. 
13653
13654         * ecore.cs (NullCast): New type of cast expression class which
13655         basically is very similar to EmptyCast with the difference being
13656         it still is a constant since it is used only to cast a null to
13657         something else
13658         (eg. (string) null)
13659
13660         * convert.cs (ImplicitReferenceConversion): When casting a null
13661         literal, we return a NullCast.
13662
13663         * literal.cs (NullLiteralTyped): Remove - I don't see why this
13664         should be around anymore.
13665
13666         The renaming (reported was slightly wrong). Corrections:
13667
13668         ConvertImplicitStandard -> ImplicitConversionStandard
13669         ConvertExplicitStandard -> ExplicitConversionStandard
13670
13671         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13672         before passing them in !
13673
13674         * convert.cs (ImplicitConversionStandard): When comparing for
13675         equal expr and target types, ensure that expr is not a
13676         NullLiteral.
13677
13678         In general, we must not be checking (expr_type ==
13679         target_type) in the top level conversion methods
13680         (ImplicitConversion, ExplicitConversion etc). This checking is
13681         done in the methods that they delegate to.
13682
13683 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
13684
13685         * convert.cs: Move Error_CannotConvertType,
13686         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13687         ImplicitNumericConversion, ImplicitConversionExists,
13688         ImplicitUserConversionExists, StandardConversionExists,
13689         FindMostEncompassedType, FindMostSpecificSource,
13690         FindMostSpecificTarget, ImplicitUserConversion,
13691         ExplicitUserConversion, GetConversionOperators,
13692         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13693         TryImplicitIntConversion, Error_CannotConvertImplicit,
13694         ConvertImplicitRequired, ConvertNumericExplicit,
13695         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13696         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13697         its own file.
13698
13699         Perform the following renames:
13700
13701         StandardConversionExists -> ImplicitStandardConversionExists
13702         ConvertImplicit -> ImplicitConversion
13703         ConvertImplicitStandard -> ImplicitStandardConversion
13704         TryImplicitIntConversion -> ImplicitIntConversion
13705         ConvertImplicitRequired -> ImplicitConversionRequired
13706         ConvertNumericExplicit -> ExplicitNumericConversion
13707         ConvertReferenceExplicit -> ExplicitReferenceConversion
13708         ConvertExplicit -> ExplicitConversion
13709         ConvertExplicitStandard -> ExplicitStandardConversion
13710
13711 2003-05-19  Martin Baulig  <martin@ximian.com>
13712
13713         * statement.cs (TypeInfo.StructInfo): Made this type protected.
13714         (TypeInfo): Added support for structs having structs as fields.
13715
13716         * ecore.cs (FieldExpr): Implement IVariable.
13717         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13718         VariableInfo for the field.
13719
13720 2003-05-18  Martin Baulig  <martin@ximian.com>
13721
13722         * expression.cs (This.DoResolve): Report a CS0027 if we're
13723         emitting a field initializer.
13724
13725 2003-05-18  Martin Baulig  <martin@ximian.com>
13726
13727         * expression.cs (This.ResolveBase): New public function.
13728         (This.DoResolve): Check for CS0188.
13729
13730         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13731         This.Resolve().
13732
13733         * ecore.cs (MethodGroupExpr.DoResolve): Set the
13734         `instance_expression' to null if we don't have any non-static
13735         methods.
13736
13737 2003-05-18  Martin Baulig  <martin@ximian.com>
13738
13739         Reworked the way how local variables and parameters are handled by
13740         the flow analysis code.
13741
13742         * statement.cs (TypeInfo, VariableMap): New public classes.
13743         (VariableInfo): New public class.  This is now responsible for
13744         checking whether a variable has been assigned.  It is used for
13745         parameters and local variables.
13746         (Block.EmitMeta): Take the InternalParameters as argument; compute
13747         the layout of the flow vectors here.
13748         (Block.LocalMap, Block.ParameterMap): New public properties.
13749         (FlowBranching): The .ctor doesn't get the InternalParameters
13750         anymore since Block.EmitMeta() now computes the layout of the flow
13751         vector.
13752         (MyStructInfo): This class is now known as `StructInfo' and nested
13753         in `TypeInfo'; we don't access this directly anymore.
13754
13755         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13756         property and removed IsAssigned(), IsFieldAssigned(),
13757         SetAssigned() and SetFieldAssigned(); we now call them on the
13758         VariableInfo so we don't need to duplicate this code everywhere.
13759
13760         * expression.cs (ParameterReference): Added `Block block' argument
13761         to the .ctor.
13762         (LocalVariableReference, ParameterReference, This): The new
13763         VariableInfo class is now responsible for all the definite
13764         assignment stuff.
13765
13766         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13767         IsParameterAssigned, SetParameterAssigned): Removed.
13768
13769 2003-05-18  Martin Baulig  <martin@ximian.com>
13770
13771         * typemanager.cs (InitCoreTypes): Try calling
13772         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13773         the 3-args-version.  Corlib now also needs our `void_type'.
13774         (GetMethod): Added overloaded version which takes an optional
13775         `bool report_errors' to allow lookups of optional methods.
13776
13777 2003-05-12  Martin Baulig  <martin@ximian.com>
13778
13779         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13780         only used for locals and not for parameters.
13781
13782 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
13783
13784         * support.cs (InternalParameters.ParameterType): Return the
13785         ExternalType of the parameter.
13786
13787         * parameter.cs (Parameter.ExternalType): drop the two arguments,
13788         they were unused.
13789
13790 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
13791
13792         * class.cs (MethodData.Define): Do not set the `newslot' on
13793         interface members, if they are also flagged as "override".
13794
13795         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
13796         better code for ++i and i++.  This only works for static fields
13797         and local variables.
13798
13799         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
13800         want to pull the DeclSpace out of the builder_to_declspace instead
13801         of the TypeBuilder (like in TypeContainer.FindMembers).
13802
13803         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
13804         instead of LookupTypeContainer.  Fixes the crash on .NET for
13805         looking up interface members.
13806
13807         * const.cs: Create our own emit context during the Definition
13808         stage, so that constants are evaluated in the proper context, when
13809         a recursive definition happens.
13810
13811 2003-05-11  Martin Baulig  <martin@ximian.com>
13812
13813         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
13814         new block for a switch section.
13815         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
13816         the adding/lookup in the switch block.  Fixes #39828.
13817
13818 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
13819
13820         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
13821         functionality: I needed to convert the data after I had performed
13822         the add/sub operation into the operands type size.
13823
13824         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
13825         pass the type for the box operation, otherwise the resulting
13826         object would have been of type object.
13827
13828         (BoxedCast): Add constructor to specify the type to box as.
13829
13830 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
13831
13832         * iterators.cs: I was reusing the `count' variable inadvertently,
13833         take steps to not allow this to happen.
13834
13835 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
13836
13837         * attribute.cs (Attribute.Resolve): Params attributes are encoded
13838         by creating an array at the point where the params starts and
13839         putting all those arguments there, then adjusting the size of the
13840         array.
13841
13842 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
13843
13844         * expression.cs (New.AddressOf): Implement interface
13845         IMemoryLocation.  This is used when the `new' operator is used in
13846         the context of an invocation to a method on a value type.
13847
13848         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
13849         example. 
13850
13851         * namespace.cs: Also check the using aliases here.
13852
13853         * driver.cs: Move the test for using validity after the types have
13854         been entered, so we do a single pass that also includes the using
13855         aliases. 
13856
13857         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
13858         in the regular case.   CreateSiblingForFinally is doing extra
13859         error checking.
13860
13861         * attribute.cs (GetAttributeArgumentExpression): Store the result
13862         on an out value, and use the return value to indicate failure
13863         instead of using null (which is a valid return for Constant.GetValue).
13864
13865         * statement.cs: Perform the analysis flow for the increment
13866         portion after the statement, because this will be the real flow of
13867         execution.  Fixes #42385
13868
13869         * codegen.cs (EmitContext.EmitArgument,
13870         EmitContext.EmitStoreArgument): New helper functions when the
13871         RemapToProxy flag is set.
13872
13873         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
13874         function.
13875
13876         Add support for remapping parameters. 
13877
13878         * iterators.cs: Propagate parameter values;  Store parameter
13879         values in the proxy classes.
13880
13881 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
13882
13883         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
13884         need a proxy reference;  I do not know what I was thinking
13885
13886         * cs-parser.jay (constructor_initializer): catch another error,
13887         and display nice message.
13888
13889         (field_declaration): catch void field declaration
13890         to flag a better error. 
13891
13892         * class.cs (MemberBase.CheckBase): Report an error instead of a
13893         warning if a new protected member is declared in a struct. 
13894         (Field.Define): catch the error of readonly/volatile.
13895
13896         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
13897
13898         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
13899         volatile variable is taken
13900
13901 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
13902
13903         * statement.cs (Fixed.Resolve): Report an error if we are not in
13904         an unsafe context.
13905
13906 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
13907
13908         * typemanager.cs: reuse the code that handles type clashes for
13909         delegates and enumerations.
13910
13911         * class.cs (Report28): Always report.
13912
13913         * expression.cs (EncodeAsAttribute): Allow nulls here.
13914
13915 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
13916
13917         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
13918         the functionality for testing whether an expression is valid for
13919         an attribute here.  Also handle the case of arrays of elements
13920         being stored. 
13921
13922         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
13923         encoding a linear array into an array of objects that are suitable
13924         to be passed to an CustomAttributeBuilder.
13925
13926         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
13927
13928         * ecore.cs: (FieldExpr): Handle field remapping here.
13929
13930         * iteratators.cs: Pass the instance variable (if the method is an
13931         instance method) to the constructors, so we can access the field
13932         variables on the class.
13933
13934         TODO: Test this with structs.  I think the THIS variable on
13935         structs might have to be a pointer, and not a refenrece
13936
13937 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
13938
13939         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
13940         local variables to fields in a proxy class.
13941
13942         * iterators.cs (PopulateProxy): Rename our internal fields to
13943         <XXX>.  
13944         Create a <THIS> field if we are an instance method, so we can
13945         reference our parent container variables.
13946         (MapVariable): Called back from the EmitContext code to enter a
13947         new variable to field mapping into the proxy class (we just create
13948         a FieldBuilder).
13949
13950         * expression.cs
13951         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
13952         for using the remapped locals to fields.
13953
13954         I placed the code here, because that gives the same semantics to
13955         local variables, and only changes the Emit code.
13956
13957         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
13958         statements inside iterators.
13959         (VariableInfo): Add a FieldBuilder for the cases when we are
13960         remapping local variables to fields in a proxy class
13961
13962         * ecore.cs (SimpleNameResolve): Avoid testing two times for
13963         current_block != null.
13964
13965         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
13966         not cope with strings, as it has been moved to the
13967         TableSwitchEmit.  Fixed bug in switch generation.
13968
13969         * expression.cs (New.DoResolve): Provide more context for the user
13970         when reporting an error.
13971
13972         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
13973         pointers. 
13974
13975         * expression.cs (MemberAccess.DoResolve): When we get a type back,
13976         check the permissions for it.  Note than in a type-resolution
13977         context the check was already present in DeclSpace.ResolveType,
13978         but was missing from the MemberAccess.
13979
13980         (ArrayCreation.CheckIndices): warn if the user has
13981         more nested levels of expressions, but there are no more
13982         dimensions specified.  Avoids crash on bug 41906.
13983
13984 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
13985
13986         * statement.cs (Block): replace Implicit bool, for a generic
13987         flags.   
13988         New flag: `Unchecked'.  This is used during the EmitMeta phase
13989         (which is out-of-line with the regular Resolve/Emit process for a
13990         statement, as this is done ahead of time, but still gets a chance
13991         to call constant resolve).
13992
13993         (Block.Flags): new enum for adding a new flag.
13994
13995         (Block.EmitMeta): track the state of unchecked.
13996
13997         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
13998         to enable constant resolution to work there as well.
13999
14000 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
14001
14002         * typemanager.cs (ienumerable_type): Also look up
14003         System.Collections.IEnumerable. 
14004
14005 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
14006
14007         TODO: Test more than one conditional per method.
14008
14009         * class.cs (Indexer.Define): Report the location where the user is
14010         referencing the unsupported feature.
14011
14012         (MethodData): Overload the use of `conditionals' to
14013         minimize the creation of needless ArrayLists.   This saves roughly
14014         212kb on my machine.
14015
14016         (Method): Implement the new IIteratorContainer interface.
14017         (Method.SetYields): Implement the method by setting the ModFlags
14018         to contain METHOD_YIELDS.
14019
14020         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
14021         which just got set to null.
14022
14023         * iterators.cs: New file.
14024
14025         (Yield, YieldBreak): New statements.
14026
14027         * statement.cs (Return.Resolve): Flag an error if we are used in
14028         an iterator method.
14029
14030         * codegen.cs (InIterator): New flag set if the code is being
14031         compiled in an iterator method.
14032
14033         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
14034         internal modifier, and we just use it to avoid adding extra
14035         fields, as this is seldom used.  
14036
14037         * cs-parser.jay: Add yield_statement (yield and yield break).
14038
14039         * driver.cs: New flag -v2 to turn on version 2 features. 
14040
14041         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
14042         hashtable when v2 is enabled.
14043
14044 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
14045
14046         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
14047         there is already a namespace defined with this name.
14048
14049         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
14050         people upgraded their corlibs.
14051
14052         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
14053         always use fully qualified types, no need to use the compiler
14054         front end.
14055
14056         (TypeManager.IsNamespace): Use binarysearch.
14057
14058         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
14059         AddDelegate): I did not quite use the new IsValid API properly: I
14060         have to pass the short-name and the fullname.  I was passing only
14061         the basename instead of the fullname sometimes. 
14062
14063         (TypeContainer.DefineType): call NamespaceClash.
14064
14065         * interface.cs (Interface.DefineType): use NamespaceClash before
14066         defining the type.
14067
14068         * delegate.cs (Delegate.DefineType): use NamespaceClash before
14069         defining the type.
14070
14071         * enum.cs: (Enum.DefineType): use NamespaceClash before
14072         defining the type.
14073
14074         * typemanager.cs (: 3-line patch that gives us some tasty 11%
14075         speed increase.  First, use the negative_hits cache when we get a
14076         negative.  Second, add the type with its full original name
14077         instead of the new . and + encoded name (reflection uses + to
14078         separate type from a nested type).  Use LookupTypeReflection
14079         directly which bypasses the type->name hashtable (that we already
14080         know does not contain the type.
14081
14082         * decl.cs (DeclSpace.ResolveTypeExpr): track the
14083         location/container type. 
14084
14085         * driver.cs: When passing utf8, use directly the UTF8Encoding.
14086
14087 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
14088
14089         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
14090
14091         * delegate.cs (NewDelegate.Resolve): Test whether an instance
14092         method is being referenced in the method group from a static
14093         context, and report error 120 if so.
14094
14095         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
14096         Error118. 
14097
14098         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
14099         is created, we create the A namespace).
14100
14101         * cs-parser.jay: A namespace also introduces a DeclarationFound.
14102         Fixes #41591
14103
14104 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
14105
14106         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
14107         invocation to ModuleBuilder.GetType with the same values will
14108         return a new type instance, so we need to cache its return
14109         values. 
14110
14111         * expression.cs (Binary.ResolveOperator): Only allow the compare
14112         operators on enums if they are of the same type.
14113
14114         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
14115         types of ValueType on their own case.  Before we were giving them
14116         the same treatment as objects.
14117
14118         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
14119         fullname.  Short name is used to compare against container name.
14120         Fullname is used to check against defined namespace names.
14121
14122         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
14123         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
14124
14125         (Method.CheckBase): Call parent.
14126         (MemberBase.CheckBase): Check for protected members on sealed
14127         classes.
14128         (PropertyBase.CheckBase): Call parent.
14129         (Field.Define): Call parent.
14130
14131         * report.cs: Negative error codes are now mapped to 8000 - code,
14132         so that the display is render more nicely.
14133
14134         * typemanager.cs: Do not use try/catch, instead report a regular
14135         error. 
14136
14137         (GetPointerType, GetReferenceType): These methods provide
14138         mechanisms to obtain the T* and T& from a T.  We had the code
14139         previously scattered around the code base, and it also used
14140         TypeManager.LookupType that would go through plenty of caches.
14141         This one goes directly to the type source.
14142
14143         In some places we did the Type.GetType followed by
14144         ModuleBuilder.GetType, but not in others, so this unifies the
14145         processing as well.
14146
14147         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
14148         statements now that we have namespace information.
14149
14150         * typemanager.cs (IsNamespace): New method, returns whether the
14151         string presented is a namespace or not.
14152
14153         (ComputeNamespaces): New public entry point, computes the list of
14154         available namespaces, using the GetNamespaces API call in Mono, or
14155         the slower version in MS.NET.   
14156
14157         Now before we start the semantic analysis phase, we have a
14158         complete list of namespaces including everything that the user has
14159         provided.
14160
14161         Deleted old code to cache namespaces in .nsc files.
14162
14163 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
14164
14165         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
14166         class/struct location definition Location for the implicit
14167         constructor location.
14168
14169         (Operator.Define): Use the location of the operator for the
14170         implicit Method definition.
14171
14172         (Constructor.Emit): use the constructor location for the implicit
14173         base initializer constructor.
14174
14175         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
14176         and the Expression class now contains two new methods:
14177
14178         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
14179         isolate type lookup from the rest of the resolution process.
14180
14181         Since we use Expressions to hold type definitions due to the way
14182         we parse the input we have historically overloaded Resolve to
14183         perform the Type lookups if a special flag is passed.  Now this is
14184         eliminated and two methods take their place. 
14185
14186         The differences in the two methods between xStep and xTerminal is
14187         that xStep is involved in our current lookup system that uses
14188         SimpleNames to compose a name, while xTerminal is used just to
14189         catch the case where the simplename lookup failed.
14190
14191 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
14192
14193         * expression.cs (ResolveMemberAccess): Remove redundant code.
14194         TypeExpr expressions are always born fully resolved.
14195
14196         * interface.cs (PopulateMethod): Do not lookup the types twice.
14197         We were doing it once during SemanticAnalysis and once during
14198         PopulateMethod.
14199
14200         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
14201         in local variable type definitions, were being returned as a
14202         SimpleName (we decomposed everything into a string), that is
14203         because primary_expression was being used instead of a type in the
14204         grammar (reduce/reduce conflicts).
14205
14206         The part that was wrong is that we converted the expression into a
14207         string (an oversimplification in one hand, compounded with primary
14208         expressions doing string concatenation).
14209
14210         So things like:
14211
14212         A.B.C [] x;
14213
14214         Would return "A.B.C[]" as a SimpleName.  This stopped things like
14215         using clauses from working on this particular context.  And a type
14216         was being matched directly against "A.B.C[]".
14217
14218         We now use the correct approach, and allow for ComposedCast to be
14219         part of the unary expression.  So the "A.B.C []" become a composed
14220         cast of "A.B.C" (as a nested group of MemberAccess with a
14221         SimpleName at the end) plus the rank composition "[]". 
14222
14223         Also fixes 35567
14224
14225 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
14226
14227         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
14228         for the access level checking.
14229
14230         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
14231         `TypeContainer container', because I kept getting confused when I
14232         was debugging this code.
14233
14234         * expression.cs (Indexers): Instead of tracking getters/setters,
14235         we now track them in parallel.  We create one arraylist less, but
14236         most importantly it is possible now for the LValue code to find a
14237         matching get for a set.
14238
14239         (IndexerAccess.DoResolveLValue): Update the code.
14240         GetIndexersForType has been modified already to extract all the
14241         indexers from a type.  The code assumed it did not.
14242
14243         Also make the code set the correct return type for the indexer.
14244         This was fixed a long time ago for properties, but was missing for
14245         indexers.  It used to be void_type.
14246
14247         (Binary.Emit): Test first for doubles instead of
14248         floats, as they are more common.
14249
14250         (Binary.EmitBranchable): Use the .un version of the branch opcodes
14251         when dealing with floats and the <=, >= operators.  This fixes bug
14252         #39314 
14253
14254         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14255         to load the array value by emitting a load on the foreach variable
14256         type.  This was incorrect.  
14257
14258         We now emit the code to load an element using the the array
14259         variable type, and then we emit the conversion operator.
14260
14261         Fixed #40176
14262
14263 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
14264
14265         * attribute.cs: Avoid allocation of ArrayLists in the common case.
14266
14267 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
14268
14269         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
14270         test for protection before we test for signatures. 
14271
14272         (MethodSignature.ToString): implement.
14273
14274         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
14275         to the case where we reduced into a LongConstant.
14276
14277         * decl.cs (CheckAccessLevel): If the type is an array, we can not
14278         depend on whether the information is acurrate, because the
14279         Microsoft runtime will always claim that the array type is public,
14280         regardless of the real state.
14281
14282         If the type is a pointer, another problem happens: the type is
14283         reported as non-public in Microsoft.  
14284
14285         In both cases we have to call CheckAccessLevel recursively with
14286         the underlying type as the argument to be tested.
14287
14288 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
14289
14290         * assign.cs (Assign.Emit): If we are dealing with a compound
14291         assignment expression, we should use the code path that stores the
14292         intermediate result in a temporary value.  This fixes #40903.
14293
14294         *expression.cs (Indirection.ToString): Provide ToString method for
14295         debugging. 
14296
14297 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
14298
14299         * class.cs: Null out fields holding references to Block objects so
14300         they can be garbage collected.
14301
14302         * expression.cs (OverloadResolve): Remove unused local.
14303
14304 2003-04-07  Martin Baulig  <martin@ximian.com>
14305
14306         * codegen.cs (EmitContext.CurrentFile): New public field.
14307         (EmitContext.Mark): Use the CurrentFile to check whether the
14308         location is in the correct file.
14309         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
14310
14311 2003-04-07  Martin Baulig  <martin@ximian.com>
14312
14313         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
14314
14315         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
14316         location.  [FIXME: The location argument which gets passed to this
14317         method is sometimes wrong!]
14318
14319 2003-04-07  Nick Drochak <ndrochak@gol.com>
14320
14321         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
14322
14323 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
14324
14325         * expression.cs (Indirection.EmitAssign): We were using the
14326         temporary, but returning immediately instead of continuing the
14327         EmitAssing flow.
14328
14329 2003-04-06  Martin Baulig  <martin@ximian.com>
14330
14331         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
14332         if it's a nested child, but also deriving from the outer class.
14333         See test 190.cs.
14334
14335         * typemanager.cs (IsNestedChildOf): Make this work if it's a
14336         nested child, but also deriving from the outer class.  See
14337         test-190.cs.
14338         (FilterWithClosure): We may access private members of the outer
14339         class if we're a nested child and deriving from the outer class.
14340         (RealMemberLookup): Only set `closure_private_ok' if the
14341         `original_bf' contained BindingFlags.NonPublic.
14342
14343 2003-04-05  Martin Baulig  <martin@ximian.com>
14344
14345         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
14346
14347 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
14348
14349         * class.cs (Event.Define): Do not allow abstract events to have
14350         initializers. 
14351
14352 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
14353
14354         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
14355         block in event declarations.
14356
14357         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
14358         value type, get its address.
14359
14360         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
14361         leaving a class on the stack instead of a boolean value (int
14362         0/1).  Change the code so we compare against null, and then the
14363         result against zero.
14364
14365         * class.cs (TypeContainer.GetClassBases): We were checking for the
14366         parent class being sealed too late.
14367
14368         * expression.cs (Binary.Emit): For <= and >= when dealing with
14369         floating point values, use cgt.un and clt.un instead of cgt and
14370         clt alone.
14371
14372 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
14373
14374         * statement.cs: Apply the same optimization as MS: skip the 
14375         GetEnumerator returning an IEnumerator, and use the one returning a 
14376         CharEnumerator instead. This allows us to avoid the try-finally block 
14377         and the boxing.
14378
14379 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
14380
14381         * cs-parser.jay: Attributes cannot be applied to
14382                          namespaces. Fixes #40473
14383
14384 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14385
14386         * class.cs:
14387         (Add*): check if the name is valid using the full name for constants,
14388         fields, properties and events.
14389
14390 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
14391
14392         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
14393         char constants to be part of the enumeration.
14394
14395         * expression.cs (Conditional.DoResolve): Add support for operator
14396         true. Implements the missing functionality from 14.12
14397
14398         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
14399         operator true/false as required by the spec.
14400
14401         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
14402         implicit conversion to boolean.
14403
14404         * statement.cs (Statement.ResolveBoolean): A boolean expression is
14405         also one where the type implements `operator true'. 
14406
14407         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
14408         get an expression that will invoke operator true based on an
14409         expression.  
14410
14411         (GetConversionOperators): Removed the hack that called op_True
14412         here.  
14413
14414         (Expression.ResolveBoolean): Move this from Statement.
14415
14416 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
14417
14418         * ecore.cs (FieldExpr): do not allow initialization of initonly
14419         fields on derived classes
14420
14421 2003-03-13  Martin Baulig  <martin@ximian.com>
14422
14423         * statement.cs (Block.Emit): Call ig.BeginScope() and
14424         ig.EndScope() when compiling with debugging info; call
14425         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
14426
14427 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
14428
14429         * expression.cs (Indexers): Do not construct immediately, allow
14430         for new members to be appended as we go.  Fixes 38143
14431
14432 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14433
14434         * expression.cs: save/restore context when resolving an unchecked
14435         expression.
14436
14437 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
14438
14439         * cfold.cs: Catch division by zero in modulus operator during
14440         constant folding.
14441
14442 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
14443
14444         * interface.cs (Interface.DefineMembers): Avoid defining members
14445         twice. 
14446
14447 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
14448
14449         * driver.cs: handle the +/- options for -noconfig
14450
14451         * statement.cs (Unckeched.Resolve): Also track the state of
14452         unchecked in the Resolve phase.
14453
14454 2003-02-27  Martin Baulig  <martin@ximian.com>
14455
14456         * ecore.cs (Expression.MemberLookup): Don't create a
14457         MethodGroupExpr for something which is not a method.  Fixes #38291.
14458
14459 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
14460
14461         * class.cs (MemberBase.CheckParameters): Also check that the type
14462         is unmanaged if it is a pointer.
14463
14464         * expression.cs (SizeOf.Resolve): Add location information.
14465
14466         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
14467         a managed type is declared.
14468
14469         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
14470         parameter modifiers as well.  Fixes bug 38606
14471
14472         * class.cs: Very sad.  Am backing out the speed up changes
14473         introduced by the ArrayList -> Array in the TypeContainer, as they
14474         were not actually that much faster, and introduced a bug (no error
14475         reports on duplicated methods).
14476
14477         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
14478         source first, this will guarantee that we have a valid expression
14479         before calling in lower levels functions that will require a
14480         resolved object.  Then use this original_source in the
14481         target.ResolveLValue instead of the original source that was
14482         passed to us.
14483
14484         Another change.  Use target.Resolve instead of LValueResolve.
14485         Although we are resolving for LValues, we will let the Assign code
14486         take care of that (it will be called again from Resolve).  This
14487         basically allows code like this:
14488
14489         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
14490         class Y { void A (X x) { x [0] += o; }
14491
14492         The problem was that the indexer was trying to resolve for
14493         set_Item (idx, object o) and never finding one.  The real set_Item
14494         was set_Item (idx, X).  By delaying the process we get the right
14495         semantics. 
14496
14497         Fixes bug 36505
14498
14499 2003-02-23  Martin Baulig  <martin@ximian.com>
14500
14501         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14502         while calling DoEmit ().
14503
14504         * codegen.cs (EmitContext.Mark): Don't mark locations in other
14505         source files; if you use the #line directive inside a method, the
14506         compiler stops emitting line numbers for the debugger until it
14507         reaches the end of the method or another #line directive which
14508         restores the original file.
14509
14510 2003-02-23  Martin Baulig  <martin@ximian.com>
14511
14512         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14513
14514 2003-02-23  Martin Baulig  <martin@ximian.com>
14515
14516         * statement.cs (Block.AddChildVariableNames): We need to call this
14517         recursively, not just for our immediate children.
14518
14519 2003-02-23  Martin Baulig  <martin@ximian.com>
14520
14521         * class.cs (Event.Define): Always make the field private, like csc does.
14522
14523         * typemanager.cs (TypeManager.RealMemberLookup): Make events
14524         actually work, fixes bug #37521.
14525
14526 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
14527
14528         * delegate.cs: When creating the various temporary "Parameters"
14529         classes, make sure that we call the ComputeAndDefineParameterTypes
14530         on those new parameters (just like we do with the formal ones), to
14531         allow them to be resolved in the context of the DeclSpace.
14532
14533         This fixes the bug that Dick observed in Bugzilla #38530.
14534
14535 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
14536
14537         * expression.cs (ResolveMemberAccess): When resolving a constant,
14538         do not attempt to pull a constant if the value was not able to
14539         generate a valid constant.
14540
14541         * const.cs (LookupConstantValue): Do not report more errors than required.
14542
14543 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14544
14545         * expression.cs: fixes bug #38328.
14546
14547 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14548
14549         * class.cs: Changed all the various members that can be part of a
14550         class from being an ArrayList to be an Array of the right type.
14551         During the DefineType type_list, interface_list, delegate_list and
14552         enum_list are turned into types, interfaces, delegates and enums
14553         arrays.  
14554
14555         And during the member population, indexer_list, event_list,
14556         constant_list, field_list, instance_constructor_list, method_list,
14557         operator_list and property_list are turned into their real arrays.
14558
14559         Although we could probably perform this operation earlier, for
14560         good error reporting we need to keep the lists and remove the
14561         lists for longer than required.
14562
14563         This optimization was triggered by Paolo profiling the compiler
14564         speed on the output of `gen-sample-program.pl' perl script. 
14565
14566         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
14567         not crash in methods like MemberLookupFailed that use this field.  
14568
14569         This problem arises when the compiler fails to resolve a type
14570         during interface type definition for example.
14571
14572 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14573
14574         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14575         inherit from System.Object, so we have to stop at null, not only
14576         when reaching System.Object.
14577
14578 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
14579
14580         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14581         DeclaredOnly because the parent indexer might have had a different
14582         name, but did not loop until the top of the hierarchy was reached.
14583
14584         The problem this one fixes is 35492: when a class implemented an
14585         indexer from an interface, we were getting the interface method
14586         (which was abstract) and we were flagging an error (can not invoke
14587         abstract method).
14588
14589         This also keeps bug 33089 functioning, and test-148 functioning.
14590
14591         * typemanager.cs (IsSpecialMethod): The correct way of figuring
14592         out if a method is special is to see if it is declared in a
14593         property or event, or whether it is one of the predefined operator
14594         names.   This should fix correctly #36804.
14595
14596 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
14597
14598         The goal here is to remove the dependency on EmptyCast.Peel ().
14599         Killing it completely.
14600
14601         The problem is that currently in a number of places where
14602         constants are expected, we have to "probe" for an EmptyCast, and
14603         Peel, which is not the correct thing to do, as this will be
14604         repetitive and will likely lead to errors. 
14605
14606         The idea is to remove any EmptyCasts that are used in casts that
14607         can be reduced to constants, so we only have to cope with
14608         constants. 
14609
14610         This bug hunt was triggered by Bug 37363 and the desire to remove
14611         the duplicate pattern where we were "peeling" emptycasts to check
14612         whether they were constants.  Now constants will always be
14613         constants.
14614
14615         * ecore.cs: Use an enumconstant here instead of wrapping with
14616         EmptyCast.  
14617
14618         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14619         throwing me off.  By handling this we can get rid of a few hacks.
14620
14621         * statement.cs (Switch): Removed Peel() code.
14622
14623 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
14624
14625         * class.cs: Location information for error 508
14626
14627         * expression.cs (New.DoResolve): Add a guard against double
14628         resolution of an expression.  
14629
14630         The New DoResolve might be called twice when initializing field
14631         expressions (see EmitFieldInitializers, the call to
14632         GetInitializerExpression will perform a resolve on the expression,
14633         and later the assign will trigger another resolution
14634
14635         This leads to bugs (#37014)
14636
14637         * delegate.cs: The signature for EndInvoke should contain any ref
14638         or out parameters as well.  We were not doing this in the past. 
14639
14640         * class.cs (Field.Define): Do not overwrite the type definition
14641         inside the `volatile' group.  Turns out that volatile enumerations
14642         were changing the type here to perform a validity test, which
14643         broke conversions. 
14644
14645 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
14646
14647         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14648         and structs, we do not want to load the instance variable
14649
14650         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14651         enum_type has to be handled like an object reference (implicit
14652         conversions exists from this to object), but the regular IsClass
14653         and IsValueType tests will never return true for this one.
14654
14655         Also we use TypeManager.IsValueType instead of type.IsValueType,
14656         just for consistency with the rest of the code (this is only
14657         needed if we ever use the construct exposed by test-180.cs inside
14658         corlib, which we dont today).
14659
14660 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
14661
14662         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14663         just InternalCall.
14664
14665 2003-02-09  Martin Baulig  <martin@ximian.com>
14666
14667         * namespace.cs (Namespace..ctor): Added SourceFile argument.
14668         (Namespace.DefineNamespaces): New static public method; this is
14669         called when we're compiling with debugging to add all namespaces
14670         to the symbol file.
14671
14672         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14673         pass it to the Namespace's .ctor.
14674
14675         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14676         and MethodBase arguments; pass the namespace ID to the symwriter;
14677         pass the MethodBase instead of the token to the symwriter.
14678         (SymbolWriter.DefineNamespace): New method to add a namespace to
14679         the symbol file.
14680
14681 2003-02-09  Martin Baulig  <martin@ximian.com>
14682
14683         * symbolwriter.cs: New file.  This is a wrapper around
14684         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
14685         methods here in near future.
14686
14687 2003-02-09  Martin Baulig  <martin@ximian.com>
14688
14689         * codegen.cs (EmitContext.Mark): Just pass the arguments to
14690         ILGenerator.MarkSequencePoint() which are actually used by the
14691         symbol writer.
14692
14693 2003-02-09  Martin Baulig  <martin@ximian.com>
14694
14695         * location.cs (SourceFile): New public sealed class.  This
14696         contains the name and an index which is used in the location's token.
14697         (Location): Reserve an appropriate number of bits in the token for
14698         the source file instead of walking over that list, this gives us a
14699         really huge performance improvement when compiling with debugging.
14700
14701         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14702         `SourceFile' argument instead of a string.
14703         (Driver.ProcessFile): Add all the files via Location.AddFile(),
14704         but don't parse/tokenize here, we need to generate the list of all
14705         source files before we do that.
14706         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
14707         the files.
14708
14709         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14710         instead of a string.
14711
14712         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14713         of a string.
14714
14715 2003-02-09  Martin Baulig  <martin@ximian.com>
14716
14717         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14718         filename on `#line default'.
14719
14720 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14721
14722         * statement.cs: don't clear the pinned var when the fixed statement
14723         returns from the method (fixes bug#37752).
14724
14725 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14726
14727         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
14728         to IsValueType.
14729
14730 2003-02-07  Martin Baulig  <martin@ximian.com>
14731
14732         * driver.cs: Removed the `--debug-args' command line argument.
14733
14734         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14735         automatically by the AsssemblyBuilder.
14736         (CodeGen.InitializeSymbolWriter): We don't need to call any
14737         initialization function on the symbol writer anymore.  This method
14738         doesn't take any arguments.
14739
14740 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
14741
14742         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14743         from referenced assemblies as well.
14744
14745 2003-02-02  Martin Baulig  <martin@ximian.com>
14746
14747         * class.cs (MethodData.Emit): Generate debugging info for external methods.
14748
14749 2003-02-02  Martin Baulig  <martin@ximian.com>
14750
14751         * class.cs (Constructor.Emit): Open the symbol writer before
14752         emitting the constructor initializer.
14753         (ConstructorInitializer.Emit): Call ec.Mark() to allow
14754         single-stepping through constructor initializers.
14755
14756 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
14757
14758         * class.cs: Handle error 549: do not allow virtual methods in
14759         sealed classes. 
14760
14761 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14762
14763         * decl.cs: Check access levels when resolving types
14764
14765 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14766
14767         * statement.cs: Add parameters and locals set in catch blocks that might 
14768         return to set vector
14769
14770 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
14771
14772         * class.cs (Operator): Set the SpecialName flags for operators.
14773
14774         * expression.cs (Invocation.DoResolve): Only block calls to
14775         accessors and operators on SpecialName methods.
14776
14777         (Cast.TryReduce): Handle conversions from char constants.
14778
14779
14780 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14781
14782         * statement.cs: small memory and time optimization in FlowBranching.
14783
14784 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
14785
14786         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14787         problem that the last fix but in the other sid (Set).
14788
14789         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14790         access when there is no indexer in the hierarchy.
14791
14792 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14793
14794         * class.cs: Combine some if statements.
14795
14796 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14797
14798         * driver.cs: fixed bug #37187.
14799
14800 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
14801
14802         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
14803         any indexer, it's needed to build a list with all the indexers in the
14804         hierarchy (AllGetters), else we have problems. Fixes #35653.
14805
14806 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
14807
14808         * class.cs (MethodData.Define): It is wrong for an interface
14809         implementation to be static in both cases: explicit and implicit.
14810         We were only handling this in one case.
14811
14812         Improve the if situation there to not have negations.
14813
14814         * class.cs (Field.Define): Turns out that we do not need to check
14815         the unsafe bit on field definition, only on usage.  Remove the test.
14816
14817 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14818
14819         * driver.cs: use assembly.Location instead of Codebase (the latest
14820         patch made mcs fail when using MS assemblies).
14821
14822 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
14823
14824         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
14825         get the path to *corlib.dll.
14826
14827 2003-01-21  Nick Drochak <ndrochak@gol.com>
14828
14829         * cs-tokenizer.cs:
14830         * pending.cs:
14831         * typemanager.cs: Remove compiler warnings
14832
14833 2003-01-20  Duncan Mak  <duncan@ximian.com>
14834
14835         * AssemblyInfo.cs: Bump the version number to 0.19.
14836
14837 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14838
14839         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
14840
14841 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
14842
14843         * class.cs (Constructor::Emit): Emit debugging info for constructors.
14844
14845 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
14846
14847         * cs-parser.jay: Small fix: we were not comparing the constructor
14848         name correctly.   Thanks to Zoltan for the initial pointer.
14849
14850 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
14851
14852         * cs-tokenizer.cs: Set file name when specified with #line
14853
14854 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
14855
14856         * cs-parser.jay: Only perform the constructor checks here if we
14857         are named like the class;  This will help provider a better
14858         error.  The constructor path is taken when a type definition is
14859         not found, but most likely the user forgot to add the type, so
14860         report that rather than the constructor error.
14861
14862 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
14863
14864         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
14865         allocations.
14866
14867 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14868
14869         * cs-parser.jay: Add cleanup call.
14870
14871 2003-01-13  Duncan Mak  <duncan@ximian.com>
14872
14873         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
14874         consistent with other methods.
14875
14876 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14877
14878         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
14879
14880 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
14881
14882         * attribute.cs: only set GuidAttr to true when we have a
14883         GuidAttribute.
14884
14885 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14886
14887         * ecore.cs:
14888         * expression.cs:
14889         * typemanager.cs: fixes to allow mcs compile corlib with the new
14890         Type.IsSubclassOf fix.
14891
14892 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
14893
14894         * expression.cs (LocalVariableReference.DoResolve): Classify a
14895         constant as a value, not as a variable.   Also, set the type for
14896         the variable.
14897
14898         * cs-parser.jay (fixed_statement): take a type instead of a
14899         pointer_type, so we can produce a better error message later.
14900
14901         * statement.cs (Fixed.Resolve): Flag types that are not pointers
14902         as an error.  
14903
14904         (For.DoEmit): Make inifinite loops have a
14905         non-conditional branch back.
14906
14907         (Fixed.DoEmit): First populate the pinned variables, then emit the
14908         statement, then clear the variables.  Before I was emitting the
14909         code once for each fixed piece.
14910
14911
14912 2003-01-08  Martin Baulig  <martin@ximian.com>
14913
14914         * statement.cs (FlowBranching.MergeChild): A break in a
14915         SWITCH_SECTION does not leave a loop.  Fixes #36155.
14916
14917 2003-01-08  Martin Baulig  <martin@ximian.com>
14918
14919         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
14920         lives in the same number space than `param_map'.  Fixes #36154.
14921
14922 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
14923
14924         * cs-parser.jay (constructor_declaration): Set the
14925         Constructor.ModFlags before probing for it.  This makes the
14926         compiler report 514, 515 and 132 (the code was there, but got
14927         broken). 
14928
14929         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
14930         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
14931         (GotoCase.Resolve): Set `Returns' to ALWAYS.
14932
14933 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
14934
14935         * enum.cs: create the enum static fields using the enum type.
14936
14937 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
14938
14939         * class.cs: don't try to create the ParamBuilder for the return
14940         type if it's not needed (and handle it breaking for the ms runtime
14941         anyway).
14942
14943 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
14944
14945         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
14946
14947 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
14948
14949         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
14950         the command.   This showed up while compiling the JANET source
14951         code, which used \r as its only newline separator.
14952
14953 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
14954
14955         * class.cs (Method.Define): If we are an operator (because it
14956         reuses our code), then set the SpecialName and HideBySig.  #36128
14957
14958 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
14959
14960         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
14961         exception, report error 120 `object reference required'.
14962
14963         * driver.cs: Add --pause option, used during to measure the size
14964         of the process as it goes with --timestamp.
14965
14966         * expression.cs (Invocation.DoResolve): Do not allow methods with
14967         SpecialName to be invoked.
14968
14969 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
14970
14971         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
14972         number before adding it.
14973
14974 2002-12-21  Ravi Pratap  <ravi@ximian.com>
14975
14976         * ecore.cs (StandardImplicitConversion): When in an unsafe
14977         context, we allow conversion between void * to any other pointer
14978         type. This fixes bug #35973.
14979
14980 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
14981
14982         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
14983         is not thrown when extensionless outputs are used 
14984
14985 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14986
14987         * rootcontext.cs: fixed compilation of corlib.
14988
14989 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
14990
14991         * attribute.cs (Attributes.Contains): Add new method.
14992
14993         * class.cs (MethodCore.LabelParameters): if the parameter is an
14994         `out' parameter, check that no attribute `[In]' has been passed.
14995
14996         * enum.cs: Handle the `value__' name in an enumeration.
14997
14998 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
14999
15000         * decl.cs: Added special case to allow overrides on "protected
15001         internal" methods
15002
15003 2002-12-18  Ravi Pratap  <ravi@ximian.com>
15004
15005         * attribute.cs (Attributes.AddAttributeSection): Rename to this
15006         since it makes much more sense.
15007
15008         (Attributes.ctor): Don't require a Location parameter.
15009
15010         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
15011
15012         * attribute.cs (ApplyAttributes): Remove extra Location parameters
15013         since we already have that information per attribute.
15014
15015         * everywhere : make appropriate changes.
15016
15017         * class.cs (LabelParameters): Write the code which actually
15018         applies attributes to the return type. We can't do this on the MS
15019         .NET runtime so we flag a warning in the case an exception is
15020         thrown.
15021
15022 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
15023
15024         * const.cs: Handle implicit null conversions here too.
15025
15026 2002-12-17  Ravi Pratap  <ravi@ximian.com>
15027
15028         * class.cs (MethodCore.LabelParameters): Remove the extra
15029         Type [] parameter since it is completely unnecessary. Instead
15030         pass in the method's attributes so that we can extract
15031         the "return" attribute.
15032
15033 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
15034
15035         * cs-parser.jay (parse): Use Report.Error to flag errors instead
15036         of ignoring it and letting the compile continue.
15037
15038         * typemanager.cs (ChangeType): use an extra argument to return an
15039         error condition instead of throwing an exception.
15040
15041 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
15042
15043         * expression.cs (Unary.TryReduce): mimic the code for the regular
15044         code path.  Perform an implicit cast in the cases where we can
15045         implicitly convert to one of the integral types, and then reduce
15046         based on that constant.   This fixes bug #35483.
15047
15048 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15049
15050         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
15051
15052 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15053
15054         * namespace.cs: fixed bug #35489.
15055
15056 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
15057
15058         * class.cs: Remove some dead code.
15059
15060         * cs-parser.jay: Estimate the number of methods needed
15061         (RootContext.MethodCount);
15062
15063         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
15064         numbers instead of StringBuilders.
15065
15066         * support.cs (PtrHashtable): Add constructor with initial size;
15067         We can now reduce reallocations of the method table.
15068
15069 2002-12-10  Ravi Pratap  <ravi@ximian.com>
15070
15071         * attribute.cs (ApplyAttributes): Keep track of the emitted
15072         attributes on a per-target basis. This fixes bug #35413.
15073
15074 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
15075
15076         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
15077         default to the Windows 1252 encoding.
15078
15079         (UnixParseOption): Support version, thanks to Alp for the missing
15080         pointer. 
15081
15082         * AssemblyInfo.cs: Add nice assembly information.
15083
15084         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
15085         (bug 35169).
15086
15087         * cs-parser.jay: Allow a trailing comma before the close bracked
15088         in the attribute_section production.
15089
15090         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
15091         address of the instance was being taken, I will take this out,
15092         because we take the address of the object immediately here.
15093
15094 2002-12-09  Ravi Pratap  <ravi@ximian.com>
15095
15096         * typemanager.cs (AreMultipleAllowed): Take care of the most
15097         obvious case where attribute type is not in the current assembly -
15098         stupid me ;-)
15099
15100 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
15101
15102         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
15103         definitions, instead of doing that afterwards.  
15104
15105         Also we use a nice little hack, depending on the constructor, we
15106         know if we are a "composed" name or a simple name.  Hence, we
15107         avoid the IndexOf test, and we avoid 
15108
15109         * codegen.cs: Add code to assist in a bug reporter to track down
15110         the source of a compiler crash. 
15111
15112 2002-12-07  Ravi Pratap  <ravi@ximian.com>
15113
15114         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
15115         types have been emitted for a given element and flag an error
15116         if something which does not have AllowMultiple set is used more
15117         than once.
15118
15119         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
15120         attribute types and their corresponding AllowMultiple properties
15121
15122         (AreMultipleAllowed): Check the property for a given type.
15123
15124         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
15125         property in the case we have a TypeContainer.
15126
15127         (Attributes.AddAttribute): Detect duplicates and just skip on
15128         adding them. This trivial fix catches a pretty gross error in our
15129         attribute emission - global attributes were being emitted twice!
15130
15131         Bugzilla bug #33187 is now fixed.
15132
15133 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
15134
15135         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
15136         instead of pp_and).
15137
15138         * expression.cs (Binary.ResolveOperator): I can only use the
15139         Concat (string, string, string) and Concat (string, string,
15140         string, string) if the child is actually a concatenation of
15141         strings. 
15142
15143 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
15144
15145         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
15146         context where we need a 2-character lookahead.
15147
15148         * pending.cs (PendingImplementation): Rework so we can keep track
15149         of interface types all the time, and flag those which were
15150         implemented by parents as optional.
15151
15152 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
15153
15154         * expression.cs (Binary.ResolveOperator): Use
15155         String.Concat(string,string,string) or
15156         String.Concat(string,string,string,string) when possible. 
15157
15158         * typemanager: More helper methods.
15159
15160
15161 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
15162
15163         * pending.cs: remove the bogus return from GetMissingInterfaces()
15164         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
15165
15166 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15167
15168         * namespace.cs: avoid duplicated 'using xxx' being added to
15169         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
15170         when we get more than one 'using' statement for the same namespace.
15171         Report a CS0105 warning for it.
15172
15173 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
15174
15175         * cs-tokenizer.cs (consume_identifier): use read directly, instead
15176         of calling getChar/putback, uses internal knowledge of it.    
15177
15178         (xtoken): Reorder tokenizer so most common patterns are checked
15179         first.  This reduces the compilation time in another 5% (from 8.11s
15180         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
15181
15182         The parsing time is 22% of the compilation in mcs, and from that
15183         64% is spent on the tokenization process.  
15184
15185         I tried using a binary search for keywords, but this is slower
15186         than the hashtable.  Another option would be to do a couple of
15187         things:
15188
15189                 * Not use a StringBuilder, instead use an array of chars,
15190                   with a set value.  Notice that this way we could catch
15191                   the 645 error without having to do it *afterwards*.
15192
15193                 * We could write a hand-parser to avoid the hashtable
15194                   compares altogether.
15195
15196         The identifier consumption process takes 37% of the tokenization
15197         time.  Another 15% is spent on is_number.  56% of the time spent
15198         on is_number is spent on Int64.Parse:
15199
15200                 * We could probably choose based on the string length to
15201                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
15202                   computations. 
15203
15204         Another 3% is spend on wrapping `xtoken' in the `token' function.
15205
15206         Handle 0xa0 as whitespace (#34752)
15207
15208 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
15209
15210         * typemanager.cs (IsCLRType): New routine to tell whether a type
15211         is one of the builtin types.  
15212
15213         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
15214         typecode in more places instead of doing pointer comparissions.
15215         We could leverage some knowledge about the way the typecodes are
15216         laid out.
15217
15218         New code to cache namespaces in assemblies, it is currently not
15219         invoked, to be used soon.
15220
15221         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
15222
15223         * expression.cs (Binary.ResolveOperator): specially handle
15224         strings, and do not perform user-defined operator overloading for
15225         built-in types.
15226
15227 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
15228
15229         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
15230         internalcall as it is a pretty simple operation;  Avoid whenever
15231         possible to call Char.IsLetter.
15232
15233         (consume_identifier): Cut by half the number of
15234         hashtable calls by merging the is_keyword and GetKeyword behavior.
15235
15236         Do not short-circuit, because if we do, we
15237         report errors (ie, #if false && true would produce an invalid
15238         directive error);
15239
15240
15241 2002-11-24  Martin Baulig  <martin@ximian.com>
15242
15243         * expression.cs (Cast.TryReduce): If we're in checked syntax,
15244         check constant ranges and report a CS0221.  Fixes #33186.
15245
15246 2002-11-24  Martin Baulig  <martin@ximian.com>
15247
15248         * cs-parser.jay: Make this work for uninitialized variable
15249         declarations in the `for' initializer.  Fixes #32416.
15250
15251 2002-11-24  Martin Baulig  <martin@ximian.com>
15252
15253         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
15254         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
15255
15256 2002-11-24  Martin Baulig  <martin@ximian.com>
15257
15258         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
15259         argument; if true, we also check for user-defined conversions.
15260         This is only needed if both arguments are of a user-defined type.
15261         Fixes #30443, added test-175.cs.
15262         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
15263
15264         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
15265
15266 2002-11-24  Martin Baulig  <martin@ximian.com>
15267
15268         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
15269         function to get the store opcode.
15270         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
15271         only emit the Ldelema if the store opcode is Stobj.  You must run
15272         both test-34 and test-167 to test this.  Fixes #34529.
15273
15274 2002-11-23  Martin Baulig  <martin@ximian.com>
15275
15276         * ecore.cs (Expression.MemberLookup): Added additional
15277         `qualifier_type' argument which is used when we're being called
15278         from MemberAccess.DoResolve() and null if we're called from a
15279         SimpleName lookup.
15280         (Expression.MemberLookupFailed): New method to report errors; this
15281         does the CS1540 check and reports the correct error message.
15282
15283         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
15284         argument for the CS1540 check and redone the way how we're dealing
15285         with private members.  See the comment in the source code for details.
15286         (FilterWithClosure): Reverted this back to revision 1.197; renamed
15287         `closure_start_type' to `closure_qualifier_type' and check whether
15288         it's not null.  It was not this filter being broken, it was just
15289         being called with the wrong arguments.
15290
15291         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
15292         and pass it the correct `qualifier_type'; this also does the error
15293         handling for us.
15294
15295 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
15296
15297         * expression.cs (Invocation.EmitParams): If the we are dealing
15298         with a non-built-in value type, load its address as well.
15299
15300         (ArrayCreation): Use a a pretty constant instead
15301         of the hardcoded value 2.   Use 6 instead of 2 for the number of
15302         static initializers.  
15303
15304         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
15305         because they are not really value types, just glorified integers. 
15306
15307         * driver.cs: Do not append .exe, the CSC compiler does not do it.
15308
15309         * ecore.cs: Remove redundant code for enumerations, make them use
15310         the same code path as everything else, fixes the casting issue
15311         with enumerations in Windows.Forms.
15312
15313         * attribute.cs: Do only cast to string if it is a string, the
15314         validation happens later.
15315
15316         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
15317         people upgrade their corlibs.
15318
15319         * ecore.cs: Oops, enumerations were not following the entire code path
15320
15321 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
15322
15323         * typemanager.cs (FilterWithClosure): Commented out the test for
15324         1540 in typemanager.cs, as it has problems when accessing
15325         protected methods from a parent class (see test-174.cs). 
15326
15327         * attribute.cs (Attribute.ValidateGuid): new method.
15328         (Attribute.Resolve): Use above.
15329
15330 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
15331
15332         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
15333
15334         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
15335         handling for enumerations, as we only needed the TypeContainer
15336         functionality to begin with (this is required for the fix below to
15337         work for enums that reference constants in a container class for
15338         example). 
15339
15340         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
15341
15342         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
15343         a valid TypeBuilder to perform lookups on.o
15344
15345         * class.cs (InheritableMemberSignatureCompare): Use true in the
15346         call to GetGetMethod and GetSetMethod, because we are comparing
15347         the signature, and we need to get the methods *even* if they are
15348         private. 
15349
15350         (PropertyBase.CheckBase): ditto.
15351
15352         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
15353         GotoCase.Resolve): Use Peel on EmpytCasts.
15354
15355         * ecore.cs (EmptyCast): drop child, add Peel method.
15356
15357 2002-11-17  Martin Baulig  <martin@ximian.com>
15358
15359         * ecore.cs (EmptyCast.Child): New public property.
15360
15361         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
15362         label resolved to an EmptyCast.  Fixes #34162.
15363         (GotoCase.Resolve): Likewise.
15364         (Block.EmitMeta): Likewise.
15365
15366 2002-11-17  Martin Baulig  <martin@ximian.com>
15367
15368         * expression.cs (Invocation.BetterConversion): Prefer int over
15369         uint; short over ushort; long over ulong for integer literals.
15370         Use ImplicitConversionExists instead of StandardConversionExists
15371         since we also need to check for user-defined implicit conversions.
15372         Fixes #34165.  Added test-173.cs.
15373
15374 2002-11-16  Martin Baulig  <martin@ximian.com>
15375
15376         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
15377         with the `true' and `false' literals.  Fixes #33151.
15378
15379 2002-11-16  Martin Baulig  <martin@ximian.com>
15380
15381         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
15382         October 22nd; don't do the cs1540 check for static members.
15383
15384         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
15385         now using our own filter here and doing the cs1540 check again.
15386
15387 2002-11-16  Martin Baulig  <martin@ximian.com>
15388
15389         * support.cs (InternalParameters): Don't crash if we don't have
15390         any fixed parameters.  Fixes #33532.
15391
15392 2002-11-16  Martin Baulig  <martin@ximian.com>
15393
15394         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
15395         when looking up static methods to make this work on Windows.
15396         Fixes #33773.
15397
15398 2002-11-16  Martin Baulig  <martin@ximian.com>
15399
15400         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
15401         a setter rather than using PropertyInfo.CanWrite.
15402
15403 2002-11-15  Nick Drochak  <ndrochak@gol.com>
15404
15405         * class.cs: Allow acces to block member by subclasses. Fixes build
15406         breaker.
15407
15408 2002-11-14  Martin Baulig  <martin@ximian.com>
15409
15410         * class.cs (Constructor.Emit): Added the extern/block check.
15411         Fixes bug #33678.
15412
15413 2002-11-14  Martin Baulig  <martin@ximian.com>
15414
15415         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
15416         iteration while looking for indexers, this is needed because the
15417         indexer may have a different name in our base classes.  Fixed the
15418         error reporting (no indexers at all, not get accessor, no
15419         overloaded match).  Fixes bug #33089.
15420         (IndexerAccess.DoResolveLValue): Likewise.
15421
15422 2002-11-14  Martin Baulig  <martin@ximian.com>
15423
15424         * class.cs (PropertyBase.CheckBase): Make this work for multiple
15425         indexers.  Fixes the first part of bug #33089.
15426         (MethodSignature.InheritableMemberSignatureCompare): Added support
15427         for properties.
15428
15429 2002-11-13  Ravi Pratap  <ravi@ximian.com>
15430
15431         * attribute.cs (Attribute.Resolve): Catch the
15432         NullReferenceException and report it since it isn't supposed to
15433         happen. 
15434
15435 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
15436
15437         * expression.cs (Binary.EmitBranchable): Also handle the cases for
15438         LogicalOr and LogicalAnd that can benefit from recursively
15439         handling EmitBranchable.  The code now should be nice for Paolo.
15440
15441 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
15442
15443         * typemanager.cs (LookupType): Added a negative-hit hashtable for
15444         the Type lookups, as we perform quite a number of lookups on
15445         non-Types.  This can be removed once we can deterministically tell
15446         whether we have a type or a namespace in advance.
15447
15448         But this might require special hacks from our corlib.
15449
15450         * TODO: updated.
15451
15452         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
15453         and double which avoids a conversion from an integer to a double.
15454
15455         * expression.cs: tiny optimization, avoid calling IsConstant,
15456         because it effectively performs the lookup twice.
15457
15458 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
15459
15460         But a bogus return here to keep the semantics of the old code
15461         until the Mono runtime is fixed.
15462
15463         * pending.cs (GetMissingInterfaces): New method used to remove all
15464         the interfaces that are already implemented by our parent
15465         classes from the list of pending methods. 
15466
15467         * interface.cs: Add checks for calls after ResolveTypeExpr.
15468
15469 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
15470
15471         * class.cs (Class.Emit): Report warning 67: event not used if the
15472         warning level is beyond 3.
15473
15474         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
15475         being a NullLiteral.
15476
15477         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
15478         specifiers. 
15479
15480         * class.cs (TypeContainer.GetClassBases): Cover a missing code
15481         path that might fail if a type can not be resolved.
15482
15483         * expression.cs (Binary.Emit): Emit unsigned versions of the
15484         operators. 
15485
15486         * driver.cs: use error 5.
15487
15488 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
15489
15490         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
15491
15492 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
15493
15494         * cs-parser.jay (switch_section): A beautiful patch from Martin
15495         Baulig that fixed 33094.
15496
15497 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
15498
15499         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15500         Check whether the base is abstract and report an error if so.
15501
15502         * expression.cs (IndexerAccess.DoResolveLValue,
15503         IndexerAccess.DoResolve): ditto. 
15504
15505         (Invocation.DoResolve): ditto.
15506
15507         (Invocation.FullMethodDesc): Improve the report string.
15508
15509         * statement.cs (Block): Eliminate IsVariableDefined as it is
15510         basically just a wrapper for GetVariableInfo.
15511
15512         * ecore.cs (SimpleName): Use new 
15513
15514         * support.cs (ReflectionParamter.ParameterType): We unwrap the
15515         type, as we return the actual parameter ref/unref state on a
15516         different call.
15517
15518 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
15519
15520         * support.cs: Return proper flags REF/OUT fixing the previous
15521         commit.  
15522
15523         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
15524         not used to mean `ref' but `ref or out' in ParameterReference
15525
15526         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15527         full type signature instead of calling TypeManger.CSharpName
15528         ourselves. 
15529
15530         * support.cs (InternalParameters.ParameterDesc): Do not compare
15531         directly to the modflags, because REF/OUT will actually be bitsets
15532         if set. 
15533
15534         * delegate.cs (VerifyMethod): Check also the modifiers.
15535
15536         * cs-tokenizer.cs: Fix bug where floating point values with an
15537         exponent where a sign was missing was ignored.
15538
15539         * driver.cs: Allow multiple assemblies to be specified in a single
15540         /r: argument
15541
15542 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
15543
15544         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
15545         because identifiers after a parenthesis would end up in this kind
15546         of production, and we needed to desamiguate it for having casts
15547         like:
15548
15549                 (UserDefinedType *) xxx
15550
15551 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
15552
15553         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
15554         we should set on the Bindingflags.NonPublic, but not turn on
15555         private_ok.  private_ok controls whether a Private member is
15556         returned (this is chekced on the filter routine), while the
15557         BindingFlags.NonPublic just controls whether private/protected
15558         will be allowed.   This fixes the problem part of the problem of
15559         private properties being allowed to be used in derived classes.
15560
15561         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
15562         so we can call the children DoResolveLValue method (this will
15563         properly signal errors on lvalue assignments to base properties)
15564
15565         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
15566         getter are null, and we have a property info, we know that this
15567         happened because the lookup failed, so we report an error 122 for
15568         protection level violation.
15569
15570         We also silently return if setter and getter are null in the
15571         resolve functions, this condition only happens if we have flagged
15572         the error before.  This is the other half of the problem. 
15573
15574         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15575         not have accessibility information, that is why we were returning
15576         true in the filter function in typemanager.cs.
15577
15578         To properly report 122 (property is inaccessible because of its
15579         protection level) correctly, we report this error in ResolveAccess
15580         by failing if both the setter and the getter are lacking (ie, the
15581         lookup failed). 
15582
15583         DoResolve and DoLResolve have been modified to check for both
15584         setter/getter being null and returning silently, the reason being
15585         that I did not want to put the knowledge about this error in upper
15586         layers, like:
15587
15588         int old = Report.Errors;
15589         x = new PropertyExpr (...);
15590         if (old != Report.Errors)
15591                 return null;
15592         else
15593                 return x;
15594
15595         So the property expr is returned, but it is invalid, so the error
15596         will be flagged during the resolve process. 
15597
15598         * class.cs: Remove InheritablePropertySignatureCompare from the
15599         class, as we no longer depend on the property signature to compute
15600         whether it is possible to implement a method or not.
15601
15602         The reason is that calling PropertyInfo.GetGetMethod will return
15603         null (in .NET, in Mono it works, and we should change this), in
15604         cases where the Get Method does not exist in that particular
15605         class.
15606
15607         So this code:
15608
15609         class X { public virtual int A { get { return 1; } } }
15610         class Y : X { }
15611         class Z : Y { public override int A { get { return 2; } } }
15612
15613         Would fail in Z because the parent (Y) would not have the property
15614         defined.  So we avoid this completely now (because the alternative
15615         fix was ugly and slow), and we now depend exclusively on the
15616         method names.
15617
15618         (PropertyBase.CheckBase): Use a method-base mechanism to find our
15619         reference method, instead of using the property.
15620
15621         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15622         routines are gone now.
15623
15624         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15625         names, they were incorrectly named.
15626
15627         * cs-tokenizer.cs: Return are more gentle token on failure. 
15628
15629         * pending.cs (PendingImplementation.InterfaceMethod): This routine
15630         had an out-of-sync index variable, which caused it to remove from
15631         the list of pending methods the wrong method sometimes.
15632
15633 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
15634
15635         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15636         CanWrite, because those refer to this particular instance of the
15637         property, and do not take into account the fact that we can
15638         override single members of a property.
15639
15640         Constructor requires an EmitContext.  The resolution process does
15641         not happen here, but we need to compute the accessors before,
15642         because the resolution does not always happen for properties.
15643
15644         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15645         subclass, before we did not update this flag, but we did update
15646         bindingflags. 
15647
15648         (GetAccessors): Drop this routine, as it did not work in the
15649         presence of partially overwritten set/get methods. 
15650
15651         Notice that this broke the cs1540 detection, but that will require
15652         more thinking. 
15653
15654 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15655
15656         * class.cs:
15657         * codegen.cs:
15658         * driver.cs: issue a warning instead of an error if we don't support
15659         debugging for the platform. Also ignore a couple of errors that may
15660         arise when trying to write the symbols. Undo my previous patch.
15661
15662 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15663
15664         * driver.cs: ignore /debug switch except for Unix platforms.
15665
15666 2002-10-23  Nick Drochak  <ndrochak@gol.com>
15667
15668         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15669
15670 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
15671
15672         * driver.cs: Do not make mcs-debug conditional, so we do not break
15673         builds that use it.
15674
15675         * statement.cs (UsageVector.MergeChildren): I would like Martin to
15676         review this patch.  But basically after all the children variables
15677         have been merged, the value of "Breaks" was not being set to
15678         new_breaks for Switch blocks.  I think that it should be set after
15679         it has executed.  Currently I set this to the value of new_breaks,
15680         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15681         conservative, but I do not understand this code very well.
15682
15683         I did not break anything in the build, so that is good ;-)
15684
15685         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15686
15687 2002-10-20  Mark Crichton  <crichton@gimp.org>
15688
15689         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
15690
15691 2002-10-20  Nick Drochak  <ndrochak@gol.com>
15692
15693         * cfold.cs: Fixed compile blocker.
15694
15695 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
15696
15697         * driver.cs: I was chekcing the key, not the file.
15698
15699 2002-10-19  Ravi Pratap  <ravi@ximian.com>
15700
15701         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15702         message that we were generating - we just need to silently return
15703         a null.
15704
15705 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
15706
15707         * class.cs (Event.Define): Change my previous commit, as this
15708         breaks the debugger.  This is a temporary hack, as it seems like
15709         the compiler is generating events incorrectly to begin with.
15710
15711         * expression.cs (Binary.ResolveOperator): Added support for 
15712         "U operator - (E x, E y)"
15713
15714         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15715         y)".
15716
15717         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15718         init-only variables, but this path did not take into account that
15719         there might be also instance readonly variables.  Correct this
15720         problem. 
15721
15722         This fixes bug 32253
15723
15724         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15725         delegates as well.
15726
15727         * driver.cs: Change the extension for modules to `netmodule'
15728
15729         * cs-parser.jay: Improved slightly the location tracking for
15730         the debugger symbols.
15731
15732         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15733         modifiers that were specified instead of the hardcoded value
15734         (FamAndAssem).  This was basically ignoring the static modifier,
15735         and others.  Fixes 32429.
15736
15737         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15738         fixed a bug in the process (32476)
15739
15740         * expression.cs (ArrayAccess.EmitAssign): Patch from
15741         hwang_rob@yahoo.ca that fixes bug 31834.3
15742
15743 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
15744
15745         * driver.cs: Make the module extension .netmodule.
15746
15747 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
15748
15749         * driver.cs: Report an error if the resource file is not found
15750         instead of crashing.
15751
15752         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15753         false, like Emit does.
15754
15755 2002-10-16  Nick Drochak  <ndrochak@gol.com>
15756
15757         * typemanager.cs: Remove unused private member.  Also reported mcs
15758         bug to report this as a warning like csc.
15759
15760 2002-10-15  Martin Baulig  <martin@gnome.org>
15761
15762         * statement.cs (Statement.Emit): Made this a virtual method; emits
15763         the line number info and calls DoEmit().
15764         (Statement.DoEmit): New protected abstract method, formerly knows
15765         as Statement.Emit().
15766
15767         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15768
15769 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
15770
15771         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15772         have fixed a remaining problem: not every AddXXXX was adding a
15773         fully qualified name.  
15774
15775         Now everyone registers a fully qualified name in the DeclSpace as
15776         being defined instead of the partial name.  
15777
15778         Downsides: we are slower than we need to be due to the excess
15779         copies and the names being registered this way.  
15780
15781         The reason for this is that we currently depend (on the corlib
15782         bootstrap for instance) that types are fully qualified, because
15783         we dump all the types in the namespace, and we should really have
15784         types inserted into the proper namespace, so we can only store the
15785         basenames in the defined_names array.
15786
15787 2002-10-10  Martin Baulig  <martin@gnome.org>
15788
15789         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15790         from bug #31834, see the bug report for a testcase which is
15791         miscompiled.
15792
15793 2002-10-10  Martin Baulig  <martin@gnome.org>
15794
15795         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
15796         flow analysis code for this.
15797
15798         * statement.cs (Do, While, For): Tell the flow analysis code about
15799         infinite loops.
15800         (FlowBranching.UsageVector): Added support for infinite loops.
15801         (Block.Resolve): Moved the dead code elimination here and use flow
15802         analysis to do it.
15803
15804 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
15805
15806         * class.cs (Field.Define): Catch cycles on struct type
15807         definitions. 
15808
15809         * typemanager.cs (IsUnmanagedtype): Do not recursively check
15810         fields if the fields are static.  We only need to check instance
15811         fields. 
15812
15813         * expression.cs (As.DoResolve): Test for reference type.
15814
15815         * statement.cs (Using.ResolveExpression): Use
15816         ConvertImplicitRequired, not ConvertImplicit which reports an
15817         error on failture
15818         (Using.ResolveLocalVariableDecls): ditto.
15819
15820         * expression.cs (Binary.ResolveOperator): Report errors in a few
15821         places where we had to.
15822
15823         * typemanager.cs (IsUnmanagedtype): Finish implementation.
15824
15825 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
15826
15827         * expression.cs: Use StoreFromPtr instead of extracting the type
15828         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
15829
15830         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
15831         an enumeration value to a System.Enum, but System.Enum is not a
15832         value type, but an class type, so we need to box.
15833
15834         (Expression.ConvertExplicit): One codepath could return
15835         errors but not flag them.  Fix this.  Fixes #31853
15836
15837         * parameter.cs (Resolve): Do not allow void as a parameter type.
15838
15839 2002-10-06  Martin Baulig  <martin@gnome.org>
15840
15841         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
15842         if it's a class type and not a struct.  Fixes #31815.
15843
15844 2002-10-06  Martin Baulig  <martin@gnome.org>
15845
15846         * statement.cs: Reworked the flow analysis code a bit to make it
15847         usable for dead code elimination.
15848
15849 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15850
15851         * cs-parser.jay: allow empty source files. Fixes bug #31781.
15852
15853 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15854
15855         * expression.cs (ComposedCast.DoResolveType): A quick workaround
15856         to fix the test 165, will investigate deeper.
15857
15858 2002-10-04  Martin Baulig  <martin@gnome.org>
15859
15860         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
15861         finally blocks actually work.
15862         (Try.Resolve): We don't need to create a sibling for `finally' if
15863         there is no finally block.
15864
15865 2002-10-04  Martin Baulig  <martin@gnome.org>
15866
15867         * class.cs (Constructor.Define): The default accessibility for a
15868         non-default constructor is private, not public.
15869
15870 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15871
15872         * class.cs (Constructor): Make AllowedModifiers public, add
15873         EXTERN.
15874
15875         * cs-parser.jay: Perform the modifiers test here, as the
15876         constructor for the Constructor class usually receives a zero
15877         because of the way we create it (first we create, later we
15878         customize, and we were never checking the modifiers).
15879
15880         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
15881         is a version of LookupTypeReflection that includes the type-name
15882         cache.  This can be used as a fast path for functions that know
15883         the fully qualified name and are only calling into *.GetType() to
15884         obtain a composed type.
15885
15886         This is also used by TypeManager.LookupType during its type
15887         composition.
15888
15889         (LookupType): We now also track the real type name, as sometimes
15890         we can get a quey for the real type name from things like
15891         ComposedCast.  This fixes bug 31422.
15892
15893         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
15894         complete type fullname, it does not have to go through the type
15895         resolution system to obtain the composed version of the type (for
15896         obtaining arrays or pointers).
15897
15898         (Conditional.Emit): Use the EmitBoolExpression to
15899         generate nicer code, as requested by Paolo.
15900
15901         (ArrayCreation.CheckIndices): Use the patch from
15902         hwang_rob@yahoo.ca to validate the array initializers. 
15903
15904 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
15905
15906         * class.cs (ConstructorInitializer.Emit): simplify code by using
15907         Invocation.EmitCall, and at the same time, fix the bugs in calling
15908         parent constructors that took variable arguments. 
15909
15910         * ecore.cs (Expression.ConvertNumericExplicit,
15911         Expression.ImplicitNumericConversion): Remove the code that
15912         manually wrapped decimal (InternalTypeConstructor call is now gone
15913         as well).
15914
15915         * expression.cs (Cast.TryReduce): Also handle decimal types when
15916         trying to perform a constant fold on the type.
15917
15918         * typemanager.cs (IsUnmanagedtype): Partially implemented.
15919
15920         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
15921         that only turned off an error report, and did nothing else. 
15922
15923 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
15924
15925         * driver.cs: Handle and ignore /fullpaths
15926
15927 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
15928
15929         * expression.cs (Binary.ResolveOperator): Catch the case where
15930         DoNumericPromotions returns true, 
15931
15932         (Binary.DoNumericPromotions): Simplify the code, and the tests.
15933
15934 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
15935
15936         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
15937         report error 70.
15938
15939 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
15940
15941         * ecore.cs (ConvertNumericExplicit): It is not enough that the
15942         conversion exists, but it is also required that the conversion be
15943         performed.  This manifested in "(Type64Enum) 2".  
15944
15945         * class.cs (TypeManager.AddMethod): The fix is not to change
15946         AddEnum, because that one was using a fully qualified name (every
15947         DeclSpace derivative does), but to change the AddMethod routine
15948         that was using an un-namespaced name.  This now correctly reports
15949         the duplicated name.
15950
15951         Revert patch until I can properly fix it.  The issue
15952         is that we have a shared Type space across all namespaces
15953         currently, which is wrong.
15954
15955         Options include making the Namespace a DeclSpace, and merge
15956         current_namespace/current_container in the parser.
15957
15958 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
15959
15960         * cs-parser.jay: Improve error reporting when we get a different
15961         kind of expression in local_variable_type and
15962         local_variable_pointer_type. 
15963
15964         Propagate this to avoid missleading errors being reported.
15965
15966         * ecore.cs (ImplicitReferenceConversion): treat
15967         TypeManager.value_type as a target just like object_type.   As
15968         code like this:
15969
15970         ValueType v = 1;
15971
15972         Is valid, and needs to result in the int 1 being boxed before it
15973         is assigned to the value type v.
15974
15975         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
15976         to validate the enumeration name.
15977
15978         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
15979         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
15980         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
15981
15982         * ecore.cs (TryImplicitIntConversion): When doing an
15983         implicit-enumeration-conversion, check if the type is 64-bits and
15984         perform a conversion before passing to EnumConstant.
15985
15986 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
15987
15988         * decl.cs (Error_AmbiguousTypeReference); New routine used to
15989         report ambiguous type references.  Unlike the MS version, we
15990         report what the ambiguity is.   Innovation at work ;-)
15991
15992         (DeclSpace.FindType): Require a location argument to
15993         display when we display an ambiguous error.
15994
15995         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
15996
15997         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
15998
15999         * expression.cs (EmitDynamicInitializers): Apply patch from
16000         hwang_rob@yahoo.ca that fixes the order in which we emit our
16001         initializers. 
16002
16003 2002-09-21  Martin Baulig  <martin@gnome.org>
16004
16005         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
16006         delegate takes no arguments.
16007
16008 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
16009
16010         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
16011         from integers.
16012
16013         * expression.cs: Extract the underlying type.
16014
16015         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
16016
16017         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
16018
16019 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
16020
16021         * class.cs (TypeContainer.DefineType): We can not use the nice
16022         PackingSize with the size set to 1 DefineType method, because it
16023         will not allow us to define the interfaces that the struct
16024         implements.
16025
16026         This completes the fixing of bug 27287
16027
16028         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
16029         means also structs.  This fixes part of the problem. 
16030         (Expresion.ImplicitReferenceConversionExists): ditto.
16031
16032         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
16033         error if there were no errors reported during the type lookup
16034         process, to avoid duplicates or redundant errors.  Without this
16035         you would get an ambiguous errors plus a type not found.  We have
16036         beaten the user enough with the first error.  
16037
16038         (DeclSparce.FindType): Emit a warning if we have an ambiguous
16039         reference. 
16040
16041         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
16042         during the resolution process, stop the lookup, this avoids
16043         repeated error reports (same error twice).
16044
16045         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
16046
16047         * typemanager.cs (LookupType): Redo the type lookup code to match
16048         the needs of System.Reflection.  
16049
16050         The issue is that System.Reflection requires references to nested
16051         types to begin with a "+" sign instead of a dot.  So toplevel
16052         types look like: "NameSpace.TopLevelClass", and nested ones look
16053         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
16054         levels. 
16055
16056 2002-09-19  Martin Baulig  <martin@gnome.org>
16057
16058         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
16059         says that a method always returns or always throws an exception,
16060         don't report the CS0161.
16061
16062         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
16063         set `Returns = new_returns'.
16064
16065 2002-09-19  Martin Baulig  <martin@gnome.org>
16066
16067         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
16068         to an enum constant, check for a CS0176.
16069
16070 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
16071
16072         * class.cs (TypeContainer.CheckPairedOperators): Now we check
16073         for operators that must be in pairs and report errors.
16074
16075         * ecore.cs (SimpleName.DoResolveType): During the initial type
16076         resolution process, when we define types recursively, we must
16077         check first for types in our current scope before we perform
16078         lookups in the enclosing scopes.
16079
16080         * expression.cs (MakeByteBlob): Handle Decimal blobs.
16081
16082         (Invocation.VerifyArgumentsCompat): Call
16083         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
16084         I thought we were supposed to always call this, but there are a
16085         few places in the code where we dont do it.
16086
16087 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
16088
16089         * driver.cs: Add support in -linkres and -resource to specify the
16090         name of the identifier.
16091
16092 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16093
16094         * ecore.cs (StandardConversionExists): Sync with the conversion
16095         code: allow anything-* to void* conversions.
16096
16097         (FindMostSpecificSource): Use an Expression argument
16098         instead of a Type, because we might be handed over a Literal which
16099         gets a few more implicit conversions that plain types do not.  So
16100         this information was being lost.
16101
16102         Also, we drop the temporary type-holder expression when not
16103         required.
16104
16105 2002-09-17  Martin Baulig  <martin@gnome.org>
16106
16107         * class.cs (PropertyBase.CheckBase): Don't check the base class if
16108         this is an explicit interface implementation.
16109
16110 2002-09-17  Martin Baulig  <martin@gnome.org>
16111
16112         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
16113         different `IndexerName' attributes.
16114
16115         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
16116         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
16117         virtual CommonResolve().
16118
16119 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16120
16121         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
16122         and convert that to the UnderlyingType.
16123
16124         * statement.cs (Foreach.Resolve): Indexers are just like variables
16125         or PropertyAccesses.
16126
16127         * cs-tokenizer.cs (consume_string): Track line numbers and columns
16128         inside quoted strings, we were not doing this before.
16129
16130 2002-09-16  Martin Baulig  <martin@gnome.org>
16131
16132         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
16133         resolve it.  This is needed for the definite assignment check of the
16134         instance expression, fixes bug #29846.
16135         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
16136
16137 2002-09-16  Nick Drochak  <ndrochak@gol.com>
16138
16139         * parameter.cs: Fix compile error.  Cannot reference static member
16140         from an instance object.  Is this an mcs bug?
16141
16142 2002-09-14  Martin Baulig  <martin@gnome.org>
16143
16144         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
16145         multiple times.  Fixes bug #30295, added test-166.cs.
16146
16147 2002-09-14  Martin Baulig  <martin@gnome.org>
16148
16149         * statement.cs (Block.Emit): Don't emit unreachable code.
16150         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
16151         `break' statements.
16152         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
16153
16154 2002-09-14  Martin Baulig  <martin@gnome.org>
16155
16156         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
16157         is set.
16158
16159 2002-09-14  Martin Baulig  <martin@gnome.org>
16160
16161         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
16162         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
16163         be false on the ms runtime.
16164
16165 2002-09-13  Martin Baulig  <martin@gnome.org>
16166
16167         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
16168         the CS0038 error message.
16169
16170 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
16171
16172         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
16173         constant inside, return it.
16174
16175 2002-09-12  Martin Baulig  <martin@gnome.org>
16176
16177         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
16178         implicit conversion can be done between enum types.
16179
16180         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
16181         check whether an implicit conversion to the current enum's UnderlyingType
16182         exists and report an error if not.
16183
16184         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
16185         without debugging support.
16186
16187         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
16188         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
16189
16190 2002-09-12  Martin Baulig  <martin@gnome.org>
16191
16192         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
16193
16194         * ecore.cs (IMemberExpr.DeclaringType): New property.
16195         (SimpleName.SimpleNameResolve): Check whether we're accessing a
16196         nonstatic member of an outer type (CS0038).
16197
16198 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
16199
16200         * driver.cs: Activate the using-error detector at warning level
16201         4 (at least for MS-compatible APIs).
16202
16203         * namespace.cs (VerifyUsing): Small buglett fix.
16204
16205         * pending.cs (PendingImplementation): pass the container pointer. 
16206
16207         * interface.cs (GetMethods): Allow for recursive definition.  Long
16208         term, I would like to move every type to support recursive
16209         definitions, not the current ordering mechanism that we have right
16210         now.
16211
16212         The situation is this: Attributes are handled before interfaces,
16213         so we can apply attributes to interfaces.  But some attributes
16214         implement interfaces, we will now handle the simple cases
16215         (recursive definitions will just get an error).  
16216
16217         * parameter.cs: Only invalidate types at the end if we fail to
16218         lookup all types.  
16219
16220 2002-09-09  Martin Baulig  <martin@gnome.org>
16221
16222         * ecore.cs (PropertyExpr.Emit): Also check for
16223         TypeManager.system_int_array_get_length so this'll also work when
16224         compiling corlib.  Fixes #30003.
16225
16226 2002-09-09  Martin Baulig  <martin@gnome.org>
16227
16228         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
16229         and throw an exception if we can't get the type's size.  Fixed #30040,
16230         added test-165.cs.
16231
16232 2002-09-09  Martin Baulig  <martin@gnome.org>
16233
16234         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
16235
16236         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
16237         context.  Fixes bug #30027.
16238
16239         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
16240         virtual functions.  Fixes bug #30043, added test-164.cs.
16241
16242 2002-09-08  Ravi Pratap  <ravi@ximian.com>
16243
16244         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
16245
16246 2002-09-08  Nick Drochak  <ndrochak@gol.com>
16247
16248         * driver.cs: Use an object to get the windows codepage since it's not a
16249         static property.
16250
16251 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
16252
16253         * statement.cs (For.Emit): for infinite loops (test == null)
16254         return whether there is a break inside, not always "true".
16255
16256         * namespace.cs (UsingEntry): New struct to hold the name of the
16257         using definition, the location where it is defined, and whether it
16258         has been used in a successful type lookup.
16259
16260         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
16261         strings.
16262
16263         * decl.cs: ditto.
16264
16265 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16266
16267         * attribute.cs : Fix incorrect code which relied on catching
16268         a NullReferenceException to detect a null being passed in
16269         where an object was expected.
16270
16271 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
16272
16273         * statement.cs (Try): flag the catch variable as assigned
16274
16275         * expression.cs (Cast): Simplified by using ResolveType instead of
16276         manually resolving.
16277
16278         * statement.cs (Catch): Fix bug by using ResolveType.
16279
16280 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16281
16282         * expression.cs (BetterConversion): Special case for when we have
16283         a NullLiteral as the argument and we have to choose between string
16284         and object types - we choose string the way csc does.
16285
16286         * attribute.cs (Attribute.Resolve): Catch the
16287         NullReferenceException and report error #182 since the Mono
16288         runtime no more has the bug and having this exception raised means
16289         we tried to select a constructor which takes an object and is
16290         passed a null.
16291
16292 2002-09-05  Ravi Pratap  <ravi@ximian.com>
16293
16294         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
16295         message (1502, 1503) when we can't locate a method after overload
16296         resolution. This is much more informative and closes the bug
16297         Miguel reported.
16298
16299         * interface.cs (PopulateMethod): Return if there are no argument
16300         types. Fixes a NullReferenceException bug.
16301
16302         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
16303         expressions too. Previously we were checking only in one place for
16304         positional arguments leaving out named arguments.
16305
16306         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
16307         type to the enum type is not allowed. Remove code corresponding to
16308         that.
16309
16310         (ConvertNumericExplicit): Allow explicit conversions from
16311         the underlying type to enum type. This precisely follows the spec
16312         and closes a bug filed by Gonzalo.
16313
16314 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16315
16316         * compiler.csproj:
16317         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
16318
16319 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
16320
16321         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
16322         it was important that we stored the right value after the
16323         reduction in `converted'.
16324
16325 2002-09-04  Martin Baulig  <martin@gnome.org>
16326
16327         * location.cs (Location.SymbolDocument): Use full pathnames for the
16328         source files.
16329
16330 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
16331
16332         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
16333         of the expression resolve mechanism, because that will catch the
16334         SimpleName error failures.
16335
16336         (Conditional): If we can not resolve the
16337         expression, return, do not crash.
16338
16339 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16340
16341         * cs-tokenizer.cs:
16342         (location): display token name instead of its number.
16343
16344 2002-08-28  Martin Baulig  <martin@gnome.org>
16345
16346         * expression.cs (Binary.ResolveOperator): Don't silently return
16347         but return an error if an operator cannot be applied between two
16348         enum types.
16349
16350 2002-08-28  Martin Baulig  <martin@gnome.org>
16351
16352         * class.cs (Constructor.Define): Set the permission attributes
16353         correctly instead of making all constructors public.
16354
16355 2002-08-28  Martin Baulig  <martin@gnome.org>
16356
16357         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
16358         for private members before reporting a CS0103; if we find anything,
16359         it's a CS0122.
16360
16361 2002-08-28  Martin Baulig  <martin@gnome.org>
16362
16363         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
16364         to check whether `closure_start_type == closure_invocation_type',
16365         we also need to check whether `m.DeclaringType == closure_invocation_type'
16366         before bypassing the permission checks.  We might be accessing
16367         protected/private members from the base class.
16368         (TypeManager.RealMemberLookup): Only set private_ok if private
16369         members were requested via BindingFlags.NonPublic.
16370
16371         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
16372
16373         * expression.cs (MemberAccess.ResolveMemberAccess): Set
16374         MethodGroupExpr.IsExplicitImpl if appropriate.
16375         (Invocation.DoResolve): Don't report the CS0120 for explicit
16376         interface implementations.
16377
16378 2002-08-27  Martin Baulig  <martin@gnome.org>
16379
16380         * expression.cs (Invocation.DoResolve): If this is a static
16381         method and we don't have an InstanceExpression, we must report
16382         a CS0120.
16383
16384 2002-08-25  Martin Baulig  <martin@gnome.org>
16385
16386         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
16387         `==' between a valuetype and an object.
16388
16389 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
16390
16391         * ecore.cs (TypeExpr): Provide a ToString method.
16392
16393 2002-08-24  Martin Baulig  <martin@gnome.org>
16394
16395         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
16396         now called proggie.dbg and it's a binary file.
16397
16398 2002-08-23  Martin Baulig  <martin@gnome.org>
16399
16400         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
16401
16402 2002-08-23  Martin Baulig  <martin@gnome.org>
16403
16404         * struct.cs (MyStructInfo.ctor): Make this work with empty
16405         structs; it's not allowed to use foreach() on null.
16406
16407 2002-08-23  Martin Baulig  <martin@gnome.org>
16408
16409         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
16410         writer the full pathname of the generated assembly.
16411
16412 2002-08-23  Martin Baulig  <martin@gnome.org>
16413
16414         * statements.cs (FlowBranching.UsageVector.MergeChildren):
16415         A `finally' block never returns or breaks; improved handling of
16416         unreachable code.
16417
16418 2002-08-23  Martin Baulig  <martin@gnome.org>
16419
16420         * statement.cs (Throw.Resolve): Allow `throw null'.
16421
16422 2002-08-23  Martin Baulig  <martin@gnome.org>
16423
16424         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
16425         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
16426         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
16427         MemberLookup would return a wrong event if this is an explicit
16428         interface implementation and the class has an event with the same
16429         name.
16430
16431 2002-08-23  Martin Baulig  <martin@gnome.org>
16432
16433         * statement.cs (Block.AddChildVariableNames): New public method.
16434         (Block.AddChildVariableName): Likewise.
16435         (Block.IsVariableNameUsedInChildBlock): Likewise.
16436         (Block.AddVariable): Check whether a variable name has already
16437         been used in a child block.
16438
16439         * cs-parser.jay (declare_local_variables): Mark all variable names
16440         from the current block as being used in a child block in the
16441         implicit block.
16442
16443 2002-08-23  Martin Baulig  <martin@gnome.org>
16444
16445         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
16446         find the symbol writer.
16447
16448         * driver.cs: csc also allows the arguments to /define being
16449         separated by commas, not only by semicolons.
16450
16451 2002-08-23  Martin Baulig  <martin@gnome.org>
16452
16453         * interface.cs (Interface.GetMembers): Added static check for events.
16454
16455 2002-08-15  Martin Baulig  <martin@gnome.org>
16456
16457         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
16458         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
16459
16460         * ecore.cs (Expression.MemberLookup): Added documentation and explained
16461         why the MethodData.EmitDestructor() change was necessary.
16462
16463 2002-08-20  Martin Baulig  <martin@gnome.org>
16464
16465         * class.cs (TypeContainer.FindMembers): Added static check for events.
16466
16467         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
16468
16469         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
16470         use Type.GetEvents(), not Type.FindMembers().
16471
16472 2002-08-20  Martin Baulig  <martin@gnome.org>
16473
16474         * decl.cs (MemberCache): Added a special method cache which will
16475         be used for method-only searched.  This ensures that a method
16476         search will return a MethodInfo with the correct ReflectedType for
16477         inherited methods.      
16478
16479 2002-08-20  Martin Baulig  <martin@gnome.org>
16480
16481         * decl.cs (DeclSpace.FindMembers): Made this public.
16482
16483 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16484
16485         * delegate.cs: fixed build on windows.
16486         [FIXME:  Filed as bug #29150: MCS must report these errors.]
16487
16488 2002-08-19  Ravi Pratap  <ravi@ximian.com>
16489
16490         * ecore.cs (StandardConversionExists): Return a false
16491         if we are trying to convert the void type to anything else
16492         since that is not allowed.
16493
16494         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16495         we flag error 70 in the event an event is trying to be accessed
16496         directly from outside the declaring type.
16497
16498 2002-08-20  Martin Baulig  <martin@gnome.org>
16499
16500         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16501         MemberCache from typemanager.cs to decl.cs.
16502
16503 2002-08-19  Martin Baulig  <martin@gnome.org>
16504
16505         * class.cs (TypeContainer): Implement IMemberContainer.
16506         (TypeContainer.DefineMembers): Create the MemberCache.
16507         (TypeContainer.FindMembers): Do better BindingFlags checking; only
16508         return public members if BindingFlags.Public was given, check
16509         whether members are static.
16510
16511 2002-08-16  Martin Baulig  <martin@gnome.org>
16512
16513         * decl.cs (DeclSpace.Define): Splitted this in Define and
16514         DefineMembers.  DefineMembers is called first and initializes the
16515         MemberCache.
16516
16517         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
16518         DefineMembers() on all our DeclSpaces.
16519
16520         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16521         but call DefineMembers() on all nested interfaces.  We call their
16522         Define() in our new Define() function.
16523
16524         * interface.cs (Interface): Implement IMemberContainer.
16525         (Interface.Define): Moved all code except the attribute stuf to
16526         DefineMembers().
16527         (Interface.DefineMembers): Initialize the member cache.
16528
16529         * typemanager.cs (IMemberFinder): Removed this interface, we don't
16530         need this anymore since we can use MemberCache.FindMembers directly.
16531
16532 2002-08-19  Martin Baulig  <martin@gnome.org>
16533
16534         * typemanager.cs (MemberCache): When creating the cache for an
16535         interface type, add all inherited members.
16536         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16537         to `out bool used_cache' and documented it.
16538         (TypeManager.MemberLookup): If we already used the cache in the first
16539         iteration, we don't need to do the interfaces check.
16540
16541 2002-08-19  Martin Baulig  <martin@gnome.org>
16542
16543         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
16544         here from IMemberFinder and don't implement this interface anymore.
16545         (DeclSpace.MemberCache): Moved here from IMemberFinder.
16546
16547         * typemanager.cs (IMemberFinder): This interface is now only used by
16548         classes which actually support the member cache.
16549         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16550         since we only put DeclSpaces into this Hashtable.
16551         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
16552         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
16553
16554 2002-08-16  Martin Baulig  <martin@gnome.org>
16555
16556         * typemanager.cs (ICachingMemberFinder): Removed.
16557         (IMemberFinder.MemberCache): New property.
16558         (TypeManager.FindMembers): Merged this with RealFindMembers().
16559         This function will never be called from TypeManager.MemberLookup()
16560         so we can't use the cache here, just the IMemberFinder.
16561         (TypeManager.MemberLookup_FindMembers): Check whether the
16562         IMemberFinder has a MemberCache and call the cache's FindMembers
16563         function.
16564         (MemberCache): Rewrote larger parts of this yet another time and
16565         cleaned it up a bit.
16566
16567 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
16568
16569         * driver.cs (LoadArgs): Support quoting.
16570
16571         (Usage): Show the CSC-like command line arguments.
16572
16573         Improved a few error messages.
16574
16575 2002-08-15  Martin Baulig  <martin@gnome.org>
16576
16577         * typemanager.cs (IMemberContainer.Type): New property.
16578         (IMemberContainer.IsInterface): New property.
16579
16580         The following changes are conditional to BROKEN_RUNTIME, which is
16581         defined at the top of the file.
16582
16583         * typemanager.cs (MemberCache.MemberCache): Don't add the base
16584         class'es members, but add all members from TypeHandle.ObjectType
16585         if we're an interface.
16586         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16587         is the current type.
16588         (MemberCache.CacheEntry.Container): Removed this field.
16589         (TypeHandle.GetMembers): Include inherited members.
16590
16591 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16592
16593         * typemanager.cs: fixed compilation and added a comment on a field that
16594         is never used.
16595
16596 2002-08-15  Martin Baulig  <martin@gnome.org>
16597
16598         * class.cs (ConstructorInitializer.Resolve): In the
16599         Expression.MemberLookup call, use the queried_type as
16600         invocation_type.
16601
16602         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16603         declared' attribute, it's always true.
16604         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16605         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16606         temporary wrapper for FindMembers which tells MemberLookup whether
16607         members from the base classes are included in the return value.
16608         This will go away soon.
16609         (TypeManager.MemberLookup): Use this temporary hack here; once the
16610         new MemberCache is completed, we don't need to do the DeclaredOnly
16611         looping here anymore since the MemberCache will take care of this.
16612         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16613         (MemberCache): When creating the MemberCache for a class, get
16614         members from the current class and all its base classes.
16615         (MemberCache.CacheEntry.Container): New field.  This is a
16616         temporary hack until the Mono runtime is fixed to distinguish
16617         between ReflectedType and DeclaringType.  It allows us to use MCS
16618         with both the MS runtime and the unfixed Mono runtime without
16619         problems and without accecting performance.
16620         (MemberCache.SearchMembers): The DeclaredOnly looping from
16621         TypeManager.MemberLookup is now done here.      
16622
16623 2002-08-14  Martin Baulig  <martin@gnome.org>
16624
16625         * statement.cs (MyStructInfo.MyStructInfo): Don't call
16626         Type.GetFields on dynamic types but get the fields from the
16627         corresponding TypeContainer.
16628         (MyStructInfo.GetStructInfo): Added check for enum types.
16629
16630         * typemanager.cs (MemberList.IsSynchronized): Implemented.
16631         (MemberList.SyncRoot): Implemented.
16632         (TypeManager.FilterWithClosure): No need to check permissions if
16633         closure_start_type == closure_invocation_type, don't crash if
16634         closure_invocation_type is null.
16635
16636 2002-08-13  Martin Baulig  <martin@gnome.org>
16637
16638         Rewrote TypeContainer.FindMembers to use a member cache.  This
16639         gives us a speed increase of about 35% for the self-hosting MCS
16640         build and of about 15-20% for the class libs (both on GNU/Linux).
16641
16642         * report.cs (Timer): New class to get enhanced profiling.  This
16643         whole class is "TIMER" conditional since it remarkably slows down
16644         compilation speed.
16645
16646         * class.cs (MemberList): New class.  This is an IList wrapper
16647         which we're now using instead of passing MemberInfo[]'s around to
16648         avoid copying this array unnecessarily.
16649         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16650         (ICachingMemberFinder, IMemberContainer): New interface.
16651         (TypeManager.FilterWithClosure): If `criteria' is null, the name
16652         has already been checked, otherwise use it for the name comparision.
16653         (TypeManager.FindMembers): Renamed to RealMemberFinder and
16654         provided wrapper which tries to use ICachingMemberFinder.FindMembers
16655         if possible.  Returns a MemberList, not a MemberInfo [].
16656         (TypeHandle): New class, implements IMemberContainer.  We create
16657         one instance of this class per type, it contains a MemberCache
16658         which is used to do the member lookups.
16659         (MemberCache): New class.  Each instance of this class contains
16660         all members of a type and a name-based hash table.
16661         (MemberCache.FindMembers): This is our new member lookup
16662         function.  First, it looks up all members of the requested name in
16663         the hash table.  Then, it walks this list and sorts out all
16664         applicable members and returns them.
16665
16666 2002-08-13  Martin Baulig  <martin@gnome.org>
16667
16668         In addition to a nice code cleanup, this gives us a performance
16669         increase of about 1.4% on GNU/Linux - not much, but it's already
16670         half a second for the self-hosting MCS compilation.
16671
16672         * typemanager.cs (IMemberFinder): New interface.  It is used by
16673         TypeManager.FindMembers to call FindMembers on a TypeContainer,
16674         Enum, Delegate or Interface.
16675         (TypeManager.finder_to_member_finder): New PtrHashtable.
16676         (TypeManager.finder_to_container): Removed.
16677         (TypeManager.finder_to_delegate): Removed.
16678         (TypeManager.finder_to_interface): Removed.
16679         (TypeManager.finder_to_enum): Removed.
16680
16681         * interface.cs (Interface): Implement IMemberFinder.
16682
16683         * delegate.cs (Delegate): Implement IMemberFinder.
16684
16685         * enum.cs (Enum): Implement IMemberFinder.
16686
16687         * class.cs (TypeContainer): Implement IMemberFinder.
16688
16689 2002-08-12  Martin Baulig  <martin@gnome.org>
16690
16691         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16692
16693 2002-08-12  Martin Baulig  <martin@gnome.org>
16694
16695         * ecore.cs (ITypeExpression): New interface for expressions which
16696         resolve to a type.
16697         (TypeExpression): Renamed to TypeLookupExpression.
16698         (Expression.DoResolve): If we're doing a types-only lookup, the
16699         expression must implement the ITypeExpression interface and we
16700         call DoResolveType() on it.
16701         (SimpleName): Implement the new ITypeExpression interface.
16702         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16703         hack, the situation that we're only looking up types can't happen
16704         anymore when this method is called.  Moved the type lookup code to
16705         DoResolveType() and call it.
16706         (SimpleName.DoResolveType): This ITypeExpression interface method
16707         is now doing the types-only lookup.
16708         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16709         (ResolveFlags): Added MaskExprClass.
16710
16711         * expression.cs (MemberAccess): Implement the ITypeExpression
16712         interface.
16713         (MemberAccess.DoResolve): Added support for a types-only lookup
16714         when we're called via ITypeExpression.DoResolveType().
16715         (ComposedCast): Implement the ITypeExpression interface.
16716
16717         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
16718         Expression.Resolve() with ResolveFlags.Type instead.
16719
16720 2002-08-12  Martin Baulig  <martin@gnome.org>
16721
16722         * interface.cs (Interface.Define): Apply attributes.
16723
16724         * attribute.cs (Attribute.ApplyAttributes): Added support for
16725         interface attributes.
16726
16727 2002-08-11  Martin Baulig  <martin@gnome.org>
16728
16729         * statement.cs (Block.Emit): Only check the "this" variable if we
16730         do not always throw an exception.
16731
16732         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16733         whether the property has a set accessor.
16734
16735 2002-08-11  Martin Baulig  <martin@gnome.org>
16736
16737         Added control flow analysis support for structs.
16738
16739         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16740         with control flow analysis turned off.
16741         (IVariable): New interface.
16742         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16743         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16744         (FieldExpr.DoResolve): Resolve the instance expression with flow
16745         analysis turned off and do the definite assignment check after the
16746         resolving when we know what the expression will resolve to.
16747
16748         * expression.cs (LocalVariableReference, ParameterReference):
16749         Implement the new IVariable interface, only call the flow analysis
16750         code if ec.DoFlowAnalysis is true.
16751         (This): Added constructor which takes a Block argument.  Implement
16752         the new IVariable interface.
16753         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16754         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16755         This does the definite assignment checks for struct members.
16756
16757         * class.cs (Constructor.Emit): If this is a non-static `struct'
16758         constructor which doesn't have any initializer, call
16759         Block.AddThisVariable() to tell the flow analysis code that all
16760         struct elements must be initialized before control returns from
16761         the constructor.
16762
16763         * statement.cs (MyStructInfo): New public class.
16764         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16765         argument to this indexer.  If non-zero, check an individual struct
16766         member, not the whole struct.
16767         (FlowBranching.CheckOutParameters): Check struct members.
16768         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16769         overloaded versions of these methods which take an additional
16770         `int field_idx' argument to check struct members.
16771         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16772         overloaded versions of these methods which take an additional
16773         `string field_name' argument to check struct member.s
16774         (VariableInfo): Implement the IVariable interface.
16775         (VariableInfo.StructInfo): New public property.  Returns the
16776         MyStructInfo instance of the variable if it's a struct or null.
16777         (Block.AddThisVariable): New public method.  This is called from
16778         Constructor.Emit() for non-static `struct' constructor which do
16779         not have any initializer.  It creates a special variable for the
16780         "this" instance variable which will be checked by the flow
16781         analysis code to ensure that all of the struct's fields are
16782         initialized before control returns from the constructor.
16783         (UsageVector): Added support for struct members.  If a
16784         variable/parameter is a struct with N members, we reserve a slot
16785         in the usage vector for each member.  A struct is considered fully
16786         initialized if either the struct itself (slot 0) or all its
16787         members are initialized.
16788
16789 2002-08-08  Martin Baulig  <martin@gnome.org>
16790
16791         * driver.cs (Driver.MainDriver): Only report an error CS5001
16792         if there were no compilation errors.
16793
16794         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
16795         `UnsafeContext' property to determine whether the parent is in
16796         unsafe context rather than checking the parent's ModFlags:
16797         classes nested in an unsafe class are unsafe as well.
16798
16799 2002-08-08  Martin Baulig  <martin@gnome.org>
16800
16801         * statement.cs (UsageVector.MergeChildren): Distinguish between
16802         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
16803         we return.  Added test17() and test18() to test-154.cs.
16804
16805 2002-08-08  Martin Baulig  <martin@gnome.org>
16806
16807         * typemanager.cs (TypeManager.FilterWithClosure): If we have
16808         Family access, make sure the invoking type isn't a subclass of the
16809         queried type (that'd be a CS1540).
16810
16811         * ecore.cs (Expression.MemberLookup): Added overloaded version of
16812         this method which takes an additional `Type invocation_type'.
16813
16814         * expression.cs (BaseAccess.DoResolve): Use the base type as
16815         invocation and query type.
16816         (MemberAccess.DoResolve): If the lookup failed and we're about to
16817         report a CS0122, try a lookup with the ec.ContainerType - if this
16818         succeeds, we must report a CS1540.
16819
16820 2002-08-08  Martin Baulig  <martin@gnome.org>
16821
16822         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
16823         (MethodGroupExpr): Implement the IMemberExpr interface.
16824
16825         * expression (MemberAccess.ResolveMemberAccess): No need to have
16826         any special code for MethodGroupExprs anymore, they're now
16827         IMemberExprs.   
16828
16829 2002-08-08  Martin Baulig  <martin@gnome.org>
16830
16831         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
16832         Family, FamANDAssem and FamORAssem permissions.
16833         (TypeManager.IsSubclassOrNestedChildOf): New public method.
16834
16835 2002-08-08  Martin Baulig  <martin@gnome.org>
16836
16837         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
16838         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
16839         or loop block.
16840
16841 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
16842
16843         * driver.cs: implemented /resource option to embed managed resources.
16844
16845 2002-08-07  Martin Baulig  <martin@gnome.org>
16846
16847         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
16848         (FieldBase.HasFieldInitializer): New public property.
16849         (FieldBase.GetInitializerExpression): New public method.  Resolves and
16850         returns the field initializer and makes sure it is only resolved once.
16851         (TypeContainer.EmitFieldInitializers): Call
16852         FieldBase.GetInitializerExpression to get the initializer, this ensures
16853         that it isn't resolved multiple times.
16854
16855         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
16856         the resolving process (SimpleName/MemberLookup) that we're currently
16857         emitting a field initializer (which must not access any instance members,
16858         this is an error CS0236).
16859
16860         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
16861         argument, if the `IsFieldInitializer' flag is set, we must report and
16862         error CS0236 and not an error CS0120.   
16863
16864 2002-08-07  Martin Baulig  <martin@gnome.org>
16865
16866         * ecore.cs (IMemberExpr): New public interface.
16867         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
16868         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
16869         if the expression is an IMemberExpr.
16870
16871         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
16872         to be null, implicitly default to `this' if we're non-static in
16873         this case.  Simplified the code a lot by using the new IMemberExpr
16874         interface.  Also fixed bug #28176 here.
16875
16876 2002-08-06  Martin Baulig  <martin@gnome.org>
16877
16878         * cs-parser.jay (SimpleLookup): Removed.  We need to create
16879         ParameterReferences during semantic analysis so that we can do a
16880         type-only search when resolving Cast, TypeOf and SizeOf.
16881         (block): Pass the `current_local_parameters' to the Block's
16882         constructor.
16883
16884         * class.cs (ConstructorInitializer): Added `Parameters parameters'
16885         argument to the constructor.
16886         (ConstructorInitializer.Resolve): Create a temporary implicit
16887         block with the parameters.
16888
16889         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
16890         references here if we aren't doing a type-only search.
16891
16892         * statement.cs (Block): Added constructor which takes a
16893         `Parameters parameters' argument.
16894         (Block.Parameters): New public property.
16895
16896         * support.cs (InternalParameters.Parameters): Renamed `parameters'
16897         to `Parameters' and made it public readonly.
16898
16899 2002-08-06  Martin Baulig  <martin@gnome.org>
16900
16901         * ecore.cs (Expression.Warning): Made this public as well.
16902
16903         * report.cs (Report.Debug): Print the contents of collections.
16904
16905 2002-08-06  Martin Baulig  <martin@gnome.org>
16906
16907         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
16908         used to tell Resolve() which kinds of expressions it may return.
16909         (Expression.Resolve): Added overloaded version of this method which
16910         takes a `ResolveFlags flags' argument.  This can be used to tell
16911         Resolve() which kinds of expressions it may return.  Reports a
16912         CS0118 on error.
16913         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
16914         ResolveFlags.SimpleName.
16915         (Expression.Error118): Added overloaded version of this method which
16916         takes a `ResolveFlags flags' argument.  It uses the flags to determine
16917         which kinds of expressions are allowed.
16918
16919         * expression.cs (Argument.ResolveMethodGroup): New public method.
16920         Resolves an argument, but allows a MethodGroup to be returned.
16921         This is used when invoking a delegate.
16922
16923         * TODO: Updated a bit.
16924
16925 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16926
16927         Fixed compilation with csc.
16928
16929         * ecore.cs: Expression.Error made public. Is this correct? Should
16930         Warning be made public too?
16931
16932         * expression.cs: use ea.Location instead of ea.loc.
16933         [FIXME:  Filed as bug #28607: MCS must report these errors.]
16934
16935 2002-08-06  Martin Baulig  <martin@gnome.org>
16936
16937         * ecore.cs (Expression.loc): Moved the location here instead of
16938         duplicating it in all derived classes.
16939         (Expression.Location): New public property.
16940         (Expression.Error, Expression.Warning): Made them non-static and
16941         removed the location argument.
16942         (Expression.Warning): Added overloaded version which takes an
16943         `int level' argument.
16944         (Expression.Error118): Make this non-static and removed the
16945         expression and location arguments.
16946         (TypeExpr): Added location argument to the constructor.
16947
16948         * expression.cs (StaticCallExpr): Added location argument to
16949         the constructor.
16950         (Indirection, PointerArithmetic): Likewise.
16951         (CheckedExpr, UnCheckedExpr): Likewise.
16952         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
16953         (StringPtr): Likewise.
16954
16955
16956 2002-08-05  Martin Baulig  <martin@gnome.org>
16957
16958         * expression.cs (BaseAccess.DoResolve): Actually report errors.
16959
16960         * assign.cs (Assign.DoResolve): Check whether the source
16961         expression is a value or variable.
16962
16963         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
16964         while resolving the corresponding blocks.
16965
16966         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
16967         an error, don't silently return null.
16968
16969         * statement.cs (Block.AddVariable): Do the error reporting here
16970         and distinguish between CS0128 and CS0136.
16971         (Block.DoResolve): Report all unused labels (warning CS0164).
16972         (LabeledStatement): Pass the location to the constructor.
16973         (LabeledStatement.HasBeenReferenced): New property.
16974         (LabeledStatement.Resolve): Set it to true here.
16975
16976         * statement.cs (Return.Emit): Return success even after reporting
16977         a type mismatch error (CS0126 or CS0127), this is what csc does and
16978         it avoids confusing the users with any consecutive errors.
16979
16980 2002-08-05  Martin Baulig  <martin@gnome.org>
16981
16982         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
16983
16984         * const.cs (Const.LookupConstantValue): Catch circular definitions.
16985
16986         * expression.cs (MemberAccess.DoResolve): Silently return if an
16987         error has already been reported.
16988
16989         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
16990         error has already been reported.
16991
16992 2002-08-05  Martin Baulig  <martin@gnome.org>
16993
16994         * statement.cs (UsageVector): Only initialize the `parameters'
16995         vector if we actually have any "out" parameters.
16996
16997 2002-08-05  Martin Baulig  <martin@gnome.org>
16998
16999         * expression.cs (Binary.ResolveOperator): When combining delegates,
17000         they must have the same type.
17001
17002 2002-08-05  Martin Baulig  <martin@gnome.org>
17003
17004         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
17005         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
17006         work with the ms runtime and we also don't need it: if we're a
17007         PropertyBuilder and not in the `indexer_arguments' hash, then we
17008         are a property and not an indexer.
17009
17010         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
17011         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
17012         since the latter one doesn't work with the ms runtime.
17013
17014 2002-08-03  Martin Baulig  <martin@gnome.org>
17015
17016         Fixed bugs #27998 and #22735.
17017
17018         * class.cs (Method.IsOperator): New public field.
17019         (Method.CheckBase): Report CS0111 if there's already a method
17020         with the same parameters in the current class.  Report CS0508 when
17021         attempting to change the return type of an inherited method.
17022         (MethodData.Emit): Report CS0179 if a method doesn't have a body
17023         and it's not marked abstract or extern.
17024         (PropertyBase): New abstract base class for Property and Indexer.
17025         (PropertyBase.CheckBase): Moved here from Property and made it work
17026         for indexers.
17027         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
17028         the same so we can reuse it there.
17029         (Property, Indexer): Derive from PropertyBase.
17030         (MethodSignature.inheritable_property_signature_filter): New delegate
17031         to find properties and indexers.
17032
17033         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
17034         argument and improved error reporting.
17035
17036         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
17037         EmptyReadOnlyParameters and made it a property.
17038
17039         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
17040         version of this method which takes a `PropertyInfo indexer'.
17041         (TypeManager.RegisterIndexer): New method.
17042
17043         * class.cs: Added myself as author of this file :-)
17044
17045 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17046
17047         * class.cs: fixed compilation on windoze.
17048
17049 2002-08-03  Martin Baulig  <martin@gnome.org>
17050
17051         * interface.cs (Interface.GetInterfaceBases): Check whether all
17052         base interfaces are at least as accessible than the current one.
17053
17054         * class.cs (TypeContainer.GetClassBases): Check whether base types
17055         are at least as accessible than the current type.
17056         (TypeContainer.AsAccessible): Implemented and made non-static.
17057         (MemberBase.CheckParameters): Report errors if the accessibility
17058         checks fail.
17059
17060         * delegate.cs (Delegate.Delegate): The default visibility is
17061         internal for top-level types and private for nested types.
17062         (Delegate.Define): Report errors if the accessibility checks fail.
17063
17064         * enum.cs (Enum.Enum): The default visibility is internal for
17065         top-level types and private for nested types.
17066         (Enum.DefineType): Compute the correct visibility.
17067
17068         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
17069         function which takes a `bool is_toplevel' instead of a TypeContainer.
17070
17071         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
17072         builtin type.
17073
17074 2002-08-02  Martin Baulig  <martin@gnome.org>
17075
17076         * expression.cs (LocalVariableReferenc): Added constructor which
17077         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
17078         (LocalVariableReference.IsReadOnly): New property.
17079         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
17080         variable is readonly, use our own readonly flag to do this; you can
17081         use the new constructor to get a writable reference to a read-only
17082         variable.
17083
17084         * cs-parser.jay (foreach_statement, using_statement): Get a writable
17085         reference to the local variable.
17086
17087 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
17088
17089         * rootcontext.cs (ResolveCore): Also include System.Exception
17090
17091         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
17092         we reach an EmptyStatement.
17093
17094         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
17095         is also fine.
17096
17097         * expression.cs (Binary.ResolveOperator): Check error result in
17098         two places.
17099
17100         use brtrue/brfalse directly and avoid compares to null.
17101
17102 2002-08-02  Martin Baulig  <martin@gnome.org>
17103
17104         * class.cs (TypeContainer.Define): Define all nested interfaces here.
17105         Fixes bug #28407, added test-155.cs.
17106
17107 2002-08-01  Martin Baulig  <martin@gnome.org>
17108
17109         * class.cs (Event.EmitDefaultMethod): Make this work with static
17110         events.  Fixes #28311, added verify-3.cs.
17111
17112 2002-08-01  Martin Baulig  <martin@gnome.org>
17113
17114         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
17115         `is_disposable' fields.
17116         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
17117         `hm.is_disposable' if we're using the collection pattern.
17118         (Foreach.EmitCollectionForeach): Use the correct type for the
17119         enumerator's local variable, only emit the try/finally block if
17120         necessary (fixes #27713).
17121
17122 2002-08-01  Martin Baulig  <martin@gnome.org>
17123
17124         * ecore.cs (Expression.report118): Renamed to Error118 and made
17125         it public static.
17126
17127         * statement.cs (Throw.Resolve): Check whether the expression is of
17128         the correct type (CS0118) and whether the type derives from
17129         System.Exception (CS0155).
17130         (Catch.Resolve): New method.  Do the type lookup here and check
17131         whether it derives from System.Exception (CS0155).
17132         (Catch.CatchType, Catch.IsGeneral): New public properties.
17133
17134         * typemanager.cs (TypeManager.exception_type): Added.
17135
17136 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
17137
17138         * driver.cs: Updated About function.
17139
17140 2002-07-31  Martin Baulig  <martin@gnome.org>
17141
17142         Implemented Control Flow Analysis.
17143
17144         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
17145         (EmitContext.CurrentBranching): Added.
17146         (EmitContext.StartFlowBranching): Added.
17147         (EmitContext.EndFlowBranching): Added.
17148         (EmitContext.KillFlowBranching): Added.
17149         (EmitContext.IsVariableAssigned): Added.
17150         (EmitContext.SetVariableAssigned): Added.
17151         (EmitContext.IsParameterAssigned): Added.
17152         (EmitContext.SetParameterAssigned): Added.
17153         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
17154         Added control flow analysis stuff here.
17155
17156         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
17157         resolve the expression as lvalue.
17158         (LocalVariableReference.DoResolve): Check whether the variable has
17159         already been assigned.
17160         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
17161         the parameter as assigned here.
17162         (ParameterReference.DoResolve): Check whether the parameter has already
17163         been assigned.
17164         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
17165         expression as lvalue.
17166
17167         * statement.cs (FlowBranching): New class for the flow analysis code.
17168         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
17169         (LabeledStatement.IsDefined): New public property.
17170         (LabeledStatement.AddUsageVector): New public method to tell flow
17171         analyis that the label may be reached via a forward jump.
17172         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
17173         flow analysis.
17174         (VariableInfo.Number): New public field.  This is used by flow analysis
17175         to number all locals of a block.
17176         (Block.CountVariables): New public property.  This is the number of
17177         local variables in this block (including the locals from all parent
17178         blocks).
17179         (Block.EmitMeta): Number all the variables.
17180
17181         * statement.cs: Added flow analysis support to all classes.
17182
17183 2002-07-31  Martin Baulig  <martin@gnome.org>
17184
17185         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
17186         To get debugging messages, compile mcs with /define:MCS_DEBUG and
17187         then use this argument.
17188
17189         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
17190
17191         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
17192         use this to specify /define options.
17193
17194 2002-07-29  Martin Baulig  <martin@gnome.org>
17195
17196         * statement.cs (Fixed): Moved all code that does variable lookups
17197         and resolvings from Emit to Resolve.
17198
17199         * statement.cs (For): Moved all code that does variable lookups
17200         and resolvings from Emit to Resolve.
17201
17202         * statement.cs (Using): Moved all code that does variable lookups
17203         and resolvings from Emit to Resolve.
17204
17205 2002-07-29  Martin Baulig  <martin@gnome.org>
17206
17207         * attribute.cs (Attribute.Resolve): Explicitly catch a
17208         System.NullReferenceException when creating the
17209         CustromAttributeBuilder and report a different warning message.
17210
17211 2002-07-29  Martin Baulig  <martin@gnome.org>
17212
17213         * support.cs (ParameterData.ParameterName): Added method to
17214         get the name of a parameter.
17215
17216         * typemanager.cs (TypeManager.IsValueType): New public method.
17217
17218 2002-07-29  Martin Baulig  <martin@gnome.org>
17219
17220         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
17221         is a flag which specifies that it's either ref or out.
17222         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
17223         the out parameter to `out Parameter.Modifier mod', also set the
17224         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
17225
17226         * support.cs (InternalParameters.ParameterModifier): Distinguish
17227         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17228         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17229
17230         * expression.cs (Argument.GetParameterModifier): Distinguish
17231         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17232         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17233
17234 2002-07-29  Martin Baulig  <martin@gnome.org>
17235
17236         * expression.cs (ParameterReference.ParameterReference): Added
17237         `Location loc' argument to the constructor.
17238
17239         * cs-parser.jay: Pass location to ParameterReference.
17240
17241 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
17242
17243         * statement.cs (Try): Initialize the location.
17244
17245         * cs-parser.jay: pass location to Try.
17246
17247         * expression.cs (Unary.Reduce): Change the prototype to return
17248         whether a constant fold could be performed or not.  The result is
17249         returned in an out parameters.  In the case of Indirection and
17250         AddressOf, we want to perform the full tests.
17251
17252 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
17253
17254         * statement.cs (Statement.Emit): Flag dead code.
17255
17256 2002-07-27  Andrew Birkett  <andy@nobugs.org>
17257
17258         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
17259
17260 2002-07-27  Martin Baulig  <martin@gnome.org>
17261
17262         * class.cs (MethodData.Define): Put back call to
17263         TypeManager.AddMethod(), accidentally commented this out.
17264
17265         * report.cs (Debug): New public method to print debugging information,
17266         this is `[Conditional ("DEBUG")]'.
17267
17268 2002-07-26  Martin Baulig  <martin@gnome.org>
17269
17270         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
17271         (switch_statement): Push the current_block to the switch_stack and
17272         pop it again when we're done with the switch.
17273         (switch_section): The new block is a child of the current_block.
17274         Fixes bug #24007, added test-152.cs.
17275
17276 2002-07-27  Martin Baulig  <martin@gnome.org>
17277
17278         * expression.cs (Invocation.EmitArguments): When calling a varargs
17279         function with only its fixed arguments, we need to pass an empty
17280         array.
17281
17282 2002-07-27  Martin Baulig  <martin@gnome.org>
17283
17284         Mono 0.13 has been released.
17285
17286 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
17287
17288         * driver.cs: Rename --resource to --linkres, because that is what
17289         we do currently, we dont support --resource yet.
17290
17291         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
17292
17293 2002-07-25  Martin Baulig  <martin@gnome.org>
17294
17295         * class.cs (MethodData): New public class.  This is a `method builder'
17296         class for a method or one accessor of a Property/Indexer/Event.
17297         (MethodData.GetMethodFlags): Moved here from MemberBase.
17298         (MethodData.ApplyAttributes): Likewise.
17299         (MethodData.ApplyObsoleteAttribute): Likewise.
17300         (MethodData.ApplyConditionalAttribute): Likewise.
17301         (MethodData.ApplyDllImportAttribute): Likewise.
17302         (MethodData.CheckAbstractAndExternal): Likewise.
17303         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
17304         (MethodData.Emit): Formerly known as Method.Emit().
17305         (MemberBase): Moved everything which was specific to a single
17306         accessor/method to MethodData.
17307         (Method): Create a new MethodData and call Define() and Emit() on it.
17308         (Property, Indexer, Event): Create a new MethodData objects for each
17309         accessor and call Define() and Emit() on them.
17310
17311 2002-07-25  Martin Baulig  <martin@gnome.org>
17312
17313         Made MethodCore derive from MemberBase to reuse the code from there.
17314         MemberBase now also checks for attributes.
17315
17316         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
17317         (MemberBase.GetMethodFlags): Moved here from class Method and marked
17318         as virtual.
17319         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
17320         `CallingConventions cc' and `Attributes opt_attrs' arguments.
17321         (MemberBase.ApplyAttributes): New virtual method; applies the
17322         attributes to a method or accessor.
17323         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
17324         (MemberBase.ApplyConditionalAttribute): Likewise.
17325         (MemberBase.ApplyDllImportAttribute): Likewise.
17326         (MemberBase.CheckAbstractAndExternal): Likewise.
17327         (MethodCore.ParameterTypes): This is now a property instead of a
17328         method, it's initialized from DoDefineParameters().
17329         (MethodCore.ParameterInfo): Removed the set accessor.
17330         (MethodCore.DoDefineParameters): New protected virtual method to
17331         initialize ParameterTypes and ParameterInfo.
17332         (Method.GetReturnType): We can now simply return the MemberType.
17333         (Method.GetMethodFlags): Override the MemberBase version and add
17334         the conditional flags.
17335         (Method.CheckBase): Moved some code from Define() here, call
17336         DoDefineParameters() here.
17337         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
17338         here to avoid some larger code duplication.
17339         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
17340         ensure that abstract and external accessors don't declare a body.
17341
17342         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
17343         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
17344         lookup in the attribute's parent classes, so we need to abort as soon
17345         as we found the first match.
17346         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
17347         the attribute has no arguments.
17348
17349         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
17350         of a Method.
17351
17352 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17353
17354         * cs-parser.jay: reverted previous patch.
17355
17356 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17357
17358         * cs-parser.jay: fixed bug #22119.
17359
17360 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17361
17362         * attribute.cs: fixed compilation. The error was:
17363         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
17364         be assigned to before control leaves the current method."
17365         [FIXME:  Filed as bug #28186: MCS must report this error.]
17366
17367 2002-07-25  Martin Baulig  <martin@gnome.org>
17368
17369         * attribute.cs (Attribute.Conditional_GetConditionName): New static
17370         method to pull the condition name ouf of a Conditional attribute.
17371         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
17372         the obsolete message and error flag out of an Obsolete attribute.
17373
17374         * class.cs (Method.GetMethodFlags): New public method to get the
17375         TypeManager.MethodFlags for this method.
17376         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
17377         private methods.
17378         (Method.Define): Get and apply the Obsolete and Conditional attributes;
17379         if we're overriding a virtual function, set the new private variable
17380         `parent_method'; call the new TypeManager.AddMethod().
17381
17382         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
17383         the MethodBuilder and the Method in a PtrHashtable.
17384         (TypeManager.builder_to_method): Added for this purpose.
17385         (TypeManager.MethodFlags): Added IsObsoleteError.
17386         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
17387         Obsolete and Conditional arguments in MethodBuilders.  If we discover
17388         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
17389         the message from the attribute.
17390
17391 2002-07-24  Martin Baulig  <martin@gnome.org>
17392
17393         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
17394         preprocessor directives, ensure that the argument to #define/#undef is
17395         exactly one identifier and that it's actually an identifier.
17396
17397         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
17398         did not work ....
17399
17400 2002-07-24  Martin Baulig  <martin@gnome.org>
17401
17402         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
17403         initialize it to TypeManager.object_type in the constructor.
17404         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
17405         of the `hm.get_current' method if we're using the collection pattern.
17406         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
17407         for the explicit conversion to make it work when we're using the collection
17408         pattern and the `Current' property has a different return type than `object'.
17409         Fixes #27713.
17410
17411 2002-07-24  Martin Baulig  <martin@gnome.org>
17412
17413         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
17414         does not match, but don't report any errors.  This method is called in
17415         order for all methods in a MethodGroupExpr until a matching method is
17416         found, so we don't want to bail out if the first method doesn't match.
17417         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
17418         matches, report the 123.  Fixes #28070.
17419
17420 2002-07-24  Martin Baulig  <martin@gnome.org>
17421
17422         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
17423         TypeManager.TypeToCoreType() to the top of the method so the
17424         following equality checks will work.  Fixes #28107.
17425
17426 2002-07-24  Martin Baulig  <martin@gnome.org>
17427
17428         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
17429         operand is of type uint, and the other operand is of type sbyte,
17430         short or int, the operands are converted to type long." -
17431         Actually do what this comment already told us.  Fixes bug #28106,
17432         added test-150.cs.
17433
17434 2002-07-24  Martin Baulig  <martin@gnome.org>
17435
17436         * class.cs (MethodBase): New abstract class.  This is now a base
17437         class for Property, Indexer and Event to avoid some code duplication
17438         in their Define() and DefineMethods() methods.
17439         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
17440         generic methods for Define() and DefineMethods().
17441         (FieldBase): Derive from MemberBase, not MemberCore.
17442         (Property): Derive from MemberBase, not MemberCore.
17443         (Property.DefineMethod): Moved all the code from this method to the
17444         new MethodBase.DefineAccessor(), just call it with appropriate
17445         argumetnts.
17446         (Property.Define): Call the new Property.DoDefine(), this does some
17447         sanity checks and we don't need to duplicate the code everywhere.
17448         (Event): Derive from MemberBase, not MemberCore.
17449         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
17450         accessors, this will also make them work with interface events.
17451         (Indexer): Derive from MemberBase, not MemberCore.
17452         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
17453         (Indexer.Define): Use the new MethodBase functions.
17454
17455         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
17456         argument to the constructor.
17457         (Interface.FindMembers): Added support for interface events.
17458         (Interface.PopluateEvent): Implemented.
17459
17460         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
17461
17462 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
17463
17464         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
17465         but this is required to check for a method name being the same as
17466         the containing class.  
17467
17468         Handle this now.
17469
17470 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17471
17472         * interface.cs: initialize variable.
17473
17474 2002-07-23  Martin Baulig  <martin@gnome.org>
17475
17476         Implemented the IndexerName attribute in interfaces.
17477
17478         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17479         name if this is an explicit interface implementation.
17480         (Indexer.InterfaceIndexerName): New public variable.  If we're
17481         implementing an interface indexer, this is the IndexerName in that
17482         interface.  Otherwise, it's the IndexerName.
17483         (Indexer.DefineMethod): If we're implementing interface indexer,
17484         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
17485         and Pending.ImplementIndexer methods.
17486         (Indexer.Define): Also define the PropertyBuilder if we're
17487         implementing an interface indexer and this is neither an explicit
17488         interface implementation nor do the IndexerName match the one in
17489         the interface.
17490
17491         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17492         If a method is defined here, then we always need to create a proxy
17493         for it.  This is used when implementing interface indexers.
17494         (Pending.IsInterfaceIndexer): New public method.
17495         (Pending.ImplementIndexer): New public method.
17496         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17497         This is used when implementing interface indexers to define a proxy
17498         if necessary.
17499         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17500         define a proxy if necessary.
17501
17502         * interface.cs (Interface.IndexerName): New public variable.
17503         (Interface.PopulateIndexer): Set the IndexerName.
17504         (Interface.DefineIndexers): New private method.  Populate all the
17505         indexers and make sure their IndexerNames match.
17506
17507         * typemanager.cs (IndexerPropertyName): Added support for interface
17508         indexers.
17509
17510 2002-07-22  Martin Baulig  <martin@gnome.org>
17511
17512         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17513         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17514         ret if HasReturnLabel.
17515         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17516         variables.
17517
17518         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17519         and set the ec.LoopBeginTryCatchLevel.
17520         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17521         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17522         the current ec.TryCatchLevel, the branch goes out of an exception
17523         block.  In this case, we need to use Leave and not Br.
17524
17525 2002-07-22  Martin Baulig  <martin@gnome.org>
17526
17527         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17528         block unless the block does not always return or it is contained in
17529         another try { ... } catch { ... } block.  Fixes bug #26506.
17530         Added verify-1.cs to the test suite.
17531
17532 2002-07-22  Martin Baulig  <martin@gnome.org>
17533
17534         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17535         then we do not always return.  Fixes bug #24985.
17536
17537 2002-07-22  Martin Baulig  <martin@gnome.org>
17538
17539         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17540         lookup on a per-class level; ie. walk up the class hierarchy until we
17541         found at least one applicable method, then choose the best among them.
17542         Fixes bug #24463 and test-29.cs.
17543
17544 2002-07-22  Martin Baulig  <martin@gnome.org>
17545
17546         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17547         return types of the methods.  The return type is not part of the
17548         signature and we must not check it to make the `new' modifier work.
17549         Fixes bug #27999, also added test-147.cs.
17550         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
17551
17552         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
17553         on the method's return type.
17554
17555 2002-07-21  Martin Baulig  <martin@gnome.org>
17556
17557         * assign.cs: Make this work if the rightmost source is a constant and
17558         we need to do an implicit type conversion.  Also adding a few more tests
17559         to test-38.cs which should have caught this.
17560
17561         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
17562         target in the makefile for this.  The makefile.gnu is primarily intended
17563         for end-users who don't want to debug the compiler.
17564
17565 2002-07-21  Martin Baulig  <martin@gnome.org>
17566
17567         * assign.cs: Improved the Assign class so it can now handle embedded
17568         assignments (X = Y = Z = something).  As a side-effect this'll now also
17569         consume less local variables.  test-38.cs now passes with MCS, added
17570         a few new test cases to that test.
17571
17572 2002-07-20  Martin Baulig  <martin@gnome.org>
17573
17574         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17575         instructions.  Fixes bug #27977, also added test-146.cs.
17576
17577 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17578
17579         * cs-tokenizer.cs: fixed getHex ().
17580
17581 2002-07-19  Martin Baulig  <martin@gnome.org>
17582
17583         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17584         not Type.GetType() to lookup the array type.  This is needed when
17585         we're constructing an array of a user-defined type.
17586         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17587         single-dimensional arrays, but also for single-dimensial arrays of
17588         type decimal.
17589
17590 2002-07-19  Martin Baulig  <martin@gnome.org>
17591
17592         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17593         this function is called, it's not allowed to share LocalBuilders
17594         among ILGenerators.
17595
17596 2002-07-19  Martin Baulig  <martin@gnome.org>
17597
17598         * expression.cs (Argument.Resolve): Report an error 118 when trying
17599         to pass a type as argument.
17600
17601 2002-07-18  Martin Baulig  <martin@gnome.org>
17602
17603         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17604         Conv_R_Un for the signed `long' type.
17605
17606 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
17607
17608         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17609         `expr' for the temporary result, as that will fail if we do
17610         multiple resolves on the same expression.
17611
17612 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
17613
17614         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17615         ec.TypeContainer for looking up aliases. 
17616
17617         * class.cs (TypeContainer): Remove LookupAlias from here.
17618
17619         * decl.cs (DeclSpace); Move here.
17620
17621 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
17622
17623         * class.cs (FindMembers): Only call filter if the constructor
17624         bulider is not null.
17625
17626         Also handle delegates in `NestedTypes' now.  Now we will perform
17627         type lookups using the standard resolution process.  This also
17628         fixes a bug.
17629
17630         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17631         This uses Expressions (the limited kind that can be parsed by the
17632         tree) instead of strings.
17633
17634         * expression.cs (ComposedCast.ToString): Implement, used to flag
17635         errors since now we have to render expressions.
17636
17637         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
17638         FormArrayType. 
17639
17640         * ecore.cs (SimpleName.ToString): ditto.
17641
17642         * cs-parser.jay: Instead of using strings to assemble types, use
17643         Expressions to assemble the type (using SimpleName, ComposedCast,
17644         MemberAccess).  This should fix the type lookups in declarations,
17645         because we were using a different code path for this.
17646
17647         * statement.cs (Block.Resolve): Continue processing statements
17648         even when there is an error.
17649
17650 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
17651
17652         * class.cs (Event.Define): Also remove the `remove' method from
17653         the list of pending items.
17654
17655         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17656         generate more compact code. 
17657
17658 2002-07-17  Martin Baulig  <martin@gnome.org>
17659
17660         * const.cs (Const.LookupConstantValue): Add support for constant
17661         `unchecked' and `checked' expressions.
17662         Also adding test case test-140.cs for this.
17663
17664 2002-07-17  Martin Baulig  <martin@gnome.org>
17665
17666         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17667         check whether mi.ReturnType implements the IEnumerator interface; the
17668         `==' and the IsAssignableFrom() will fail in this situation.
17669
17670 2002-07-16  Ravi Pratap  <ravi@ximian.com>
17671
17672         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
17673         here too.
17674
17675 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17676
17677         * expression.cs: fixed bug #27811.
17678
17679 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
17680
17681         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17682         Molaro: when we are a ref, the value already contains a pointer
17683         value, do not take the address of it.
17684
17685 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17686         * removed mb-parser.jay and mb-tokenizer.cs
17687
17688 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17689
17690         * expression.cs: check against the building corlib void type.
17691
17692 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17693
17694         * ecore.cs: fix for valuetype static readonly fields: when 
17695         initializing them, we need their address, not the address of a copy.
17696
17697 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17698
17699         * typemanager.cs: register also enum_type in corlib.
17700
17701 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17702
17703         * class.cs: allow calling this (but not base) initializers in structs.
17704
17705 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17706
17707         * ecore.cs: make sure we compare against the building base types
17708         in GetTypeSize ().
17709
17710 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
17711
17712         * typemanager.cs: fix TypeToCoreType() to handle void and object
17713         (corlib gets no more typerefs after this change).
17714
17715 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
17716
17717         * expression.cs (ArrayCreation.EmitArrayArguments): use
17718         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17719
17720         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17721         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
17722         array indexes, the runtime actually forbids them.
17723
17724         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17725         for array arguments here.
17726
17727         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17728         instead of the default for ValueTypes.
17729
17730         (New.DoEmit): Use IsValueType instead of
17731         IsSubclassOf (value_type)
17732         (New.DoResolve): ditto.
17733         (Invocation.EmitCall): ditto.
17734
17735         * assign.cs (Assign): ditto.
17736
17737         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17738         Statements *are* currently doing part of their resolution during
17739         Emit.  
17740
17741         Expressions do always resolve during resolve, but statements are
17742         only required to propagate resolution to their children.
17743
17744 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
17745
17746         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17747
17748         (LoadAssembly): Do not add the dll if it is already specified
17749
17750         (MainDriver): Add the System directory to the link path at the end,
17751         after all the other -L arguments. 
17752
17753         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17754         wrong opcode for loading bytes and bools (ldelem.i1 instead of
17755         ldelem.u1) and using the opposite for sbytes.
17756
17757         This fixes Digger, and we can finally run it.
17758
17759         * driver.cs (UnixParseOption): Move the option parsing here.  
17760         (CSCParseOption): Implement CSC-like parsing of options.
17761
17762         We now support both modes of operation, the old Unix way, and the
17763         new CSC-like way.  This should help those who wanted to make cross
17764         platform makefiles.
17765
17766         The only thing broken is that /r:, /reference: and /lib: are not
17767         implemented, because I want to make those have the same semantics
17768         as the CSC compiler has, and kill once and for all the confussion
17769         around this.   Will be doing this tomorrow.
17770
17771         * statement.cs (Unsafe.Resolve): The state is checked during
17772         resolve, not emit, so we have to set the flags for IsUnsfe here.
17773
17774 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17775
17776         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17777         not catch the Error_ObjectRefRequired in SimpleName (as it is
17778         possible to have a class/instance variable name that later gets
17779         deambiguated), we have to check this here.      
17780
17781 2002-07-10  Ravi Pratap  <ravi@ximian.com>
17782
17783         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17784         make static and put into Expression.
17785
17786         (Event.Define): Register the private field of the event with the 
17787         TypeManager so that GetFieldFromEvent can get at it.
17788
17789         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17790         keep track of the private field associated with an event which
17791         has no accessors.
17792
17793         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
17794         private field.
17795
17796         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
17797
17798 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17799
17800         * expression.cs (Binary.EmitBranchable): this routine emits the
17801         Binary expression in a branchable context.  This basically means:
17802         we need to branch somewhere, not just get the value on the stack.
17803
17804         This works together with Statement.EmitBoolExpression.
17805
17806         * statement.cs (Statement.EmitBoolExpression): Use
17807         EmitBranchable. 
17808
17809 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
17810
17811         * statement.cs (For): Reduce the number of jumps in loops.
17812
17813         (For): Implement loop inversion for the For statement.
17814
17815         (Break): We can be breaking out of a Try/Catch controlled section
17816         (foreach might have an implicit try/catch clause), so we need to
17817         use Leave instead of Br.
17818
17819         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
17820         now).  If the instace expression supports IMemoryLocation, we use
17821         the AddressOf method from the IMemoryLocation to extract the
17822         address instead of emitting the instance.
17823
17824         This showed up with `This', as we were emitting the instance
17825         always (Emit) instead of the Address of This.  Particularly
17826         interesting when This is a value type, as we dont want the Emit
17827         effect (which was to load the object).
17828
17829 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
17830
17831         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
17832
17833         * statement.cs (Checked): Set the CheckedState during the resolve
17834         process too, as the ConvCast operations track the checked state on
17835         the resolve process, and not emit.
17836
17837         * cs-parser.jay (namespace_member_declaration): Flag that we have
17838         found a declaration when we do.  This is used to flag error 1529
17839
17840         * driver.cs: Report ok when we display the help only.
17841
17842 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
17843
17844         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
17845
17846 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
17847
17848         * cs-tokenizer.cs (define): We also have to track locally the
17849         defines.  AllDefines is just used for the Conditional Attribute,
17850         but we also need the local defines for the current source code. 
17851
17852 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
17853
17854         * statement.cs (While, For, Do): These loops can exit through a
17855         Break statement, use this information to tell whether the
17856         statement is the last piece of code.
17857
17858         (Break): Flag that we break.
17859
17860         * codegen.cs (EmitContexts): New `Breaks' state variable.
17861
17862 2002-07-03  Martin Baulig  <martin@gnome.org>
17863
17864         * class.cs (TypeContainer.MethodModifiersValid): Allow override
17865         modifiers in method declarations in structs.  Otherwise, you won't
17866         be able to override things like Object.Equals().
17867
17868 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17869
17870         * class.cs (Method, Property, Indexer): Do not allow the public
17871         modifier to be used in explicit interface implementations.
17872
17873         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
17874         override modifiers in method declarations in structs
17875
17876 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
17877
17878         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
17879         integer or real overflow, report an error
17880
17881 2002-07-02  Martin Baulig  <martin@gnome.org>
17882
17883         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
17884         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
17885         to tell the runtime about our newly created System.Object and
17886         System.ValueType types.
17887
17888 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17889
17890         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
17891         struct instead of Ldarg/Starg.
17892
17893 2002-07-02  Martin Baulig  <martin@gnome.org>
17894
17895         * expression.cs (Indirection.Indirection): Call
17896         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
17897
17898 2002-07-02  Martin Baulig  <martin@gnome.org>
17899
17900         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
17901         ValueType, call TypeManager.TypeToCoreType() on it.
17902         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
17903         the OpCodes.Newarr argument.
17904
17905 2002-07-02  Martin Baulig  <martin@gnome.org>
17906
17907         * expression.cs (Invocation.EmitCall): When compiling corlib,
17908         replace all calls to the system's System.Array type to calls to
17909         the newly created one.
17910
17911         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
17912         System.Array methods.
17913         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
17914         from the system's System.Array type which must be replaced.
17915
17916 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
17917
17918         * typemanager.cs: load unverifiable_code_ctor so we can build
17919         corlib using the correct type. Avoid using GetTypeCode() with
17920         TypeBuilders.
17921         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
17922         TypeManager.object_type to allow building corlib.
17923
17924 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
17925
17926         * ecore.cs: handle System.Enum separately in LoadFromPtr().
17927
17928 2002-07-01  Martin Baulig  <martin@gnome.org>
17929
17930         * class.cs: Make the last change actually work, we need to check
17931         whether `ifaces != null' to avoid a crash.
17932
17933 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17934
17935         * class.cs: when we build structs without fields that implement
17936         interfaces, we need to add the interfaces separately, since there is
17937         no API to both set the size and add the interfaces at type creation
17938         time.
17939
17940 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17941
17942         * expression.cs: the dimension arguments to the array constructors
17943         need to be converted if they are a long.
17944
17945 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
17946
17947         * class.cs: don't emit ldarg.0 if there is no parent constructor
17948         (fixes showstopper for corlib).
17949
17950 2002-06-29  Martin Baulig  <martin@gnome.org>
17951
17952         MCS now compiles corlib on GNU/Linux :-)
17953
17954         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
17955         ie. check for MethodImplOptions.InternalCall.
17956
17957         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
17958         and TypeManager.attribute_type are null, so we must explicitly check
17959         whether parent is not null to find out whether it's an attribute type.
17960         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
17961         and SetBuilder, not only if the property is neither abstract nor external.
17962         This is necessary to set the MethodImplOptions on the accessor methods.
17963         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
17964         SetBuilder, see Property.Emit().
17965
17966         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
17967         populate "System.Object", "System.ValueType" and "System.Attribute" since
17968         they've already been populated from BootCorlib_PopulateCoreTypes().
17969
17970 2002-06-29  Martin Baulig  <martin@gnome.org>
17971
17972         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
17973         is the NullLiteral, we also need to make sure that target_type is not
17974         an enum type.   
17975
17976 2002-06-29  Martin Baulig  <martin@gnome.org>
17977
17978         * rootcontext.cs (RootContext.ResolveCore): We must initialize
17979         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
17980         before calling BootstrapCorlib_ResolveDelegate ().
17981
17982 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17983
17984         * statement.cs: fixed build-breaker. All tests passed ok.
17985
17986 2002-06-27  Martin Baulig  <martin@gnome.org>
17987
17988         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
17989         for System.Decimal when compiling corlib.
17990
17991 2002-06-27  Martin Baulig  <martin@gnome.org>
17992
17993         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
17994         switch blocks which contain nothing but a default clause.
17995
17996 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
17997
17998        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
17999
18000 2002-06-27  Martin Baulig  <martin@gnome.org>
18001
18002         * ecore.cs (PropertyExpr.PropertyExpr): Call
18003         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
18004
18005         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
18006         is already a TypeBuilder.
18007
18008 2002-06-27  Martin Baulig  <martin@gnome.org>
18009
18010         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
18011         `target_type == TypeManager.array_type', not IsAssignableFrom() in
18012         the "from an array-type to System.Array" case.  This makes it work
18013         when compiling corlib.
18014
18015 2002-06-27  Martin Baulig  <martin@gnome.org>
18016
18017         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
18018         non-static PropertyExpr, set its InstanceExpression.  This makes
18019         the `ICollection.Count' property work in System/Array.cs.
18020
18021 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
18022
18023         * driver.cs: Made error handling more consistent.  Errors now
18024         tracked by Report class, so many methods which used to return int
18025         now return void.  Main() now prints success/failure and 
18026         errors/warnings message.
18027
18028         Renamed '--probe' compiler argument to '--expect-error'.  Removed
18029         the magic number return values (123 and 124).  Now, if the
18030         expected error occurs, the compiler exits with success (exit value
18031         0).  If the compilation completes without seeing that particular
18032         error, the compiler exits with failure (exit value 1).  The
18033         makefile in mcs/errors has been changed to handle the new behaviour.
18034
18035         * report.cs: Made 'expected error' number a property and renamed
18036         it from 'Probe' to 'ExpectedError'.
18037
18038         * genericparser.cs: Removed error handling support, since it is
18039         now all done by Report class.
18040
18041         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
18042         class, so parse() no longer returns an int.
18043
18044         * namespace.cs: Use Report.Error instead of GenericParser.error
18045
18046 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
18047
18048         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
18049         TypeContainer.AddOperator): At the front of the list put the
18050         explicit implementations, so they get resolved/defined first. 
18051
18052 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
18053
18054         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
18055         interface type is implemented by this TypeContainer.  Used during
18056         explicit interface implementation.
18057
18058         (Property.Define, Indexer.Define, Method.Define): Validate that
18059         the given interface in the explicit implementation is one of the
18060         base classes for the containing type.
18061
18062         Also if we are explicitly implementing an interface, but there is
18063         no match in the pending implementation table, report an error.
18064
18065         (Property.Define): Only define the property if we are
18066         not explicitly implementing a property from an interface.  Use the
18067         correct name also for those properties (the same CSC uses,
18068         although that is really not needed).
18069
18070         (Property.Emit): Do not emit attributes for explicitly implemented
18071         properties, as there is no TypeBuilder.
18072
18073         (Indexer.Emit): ditto.
18074
18075         Hiding then means that we do not really *implement* a pending
18076         implementation, which makes code fail.
18077
18078 2002-06-22  Martin Baulig  <martin@gnome.org>
18079
18080         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
18081         the return value of Object.GetType().  [FIXME: we need to do this whenever
18082         we get a type back from the reflection library].
18083
18084 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
18085
18086         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
18087
18088 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
18089
18090         * attribute.cs: Return null if we can not look up the type.
18091
18092         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
18093         the interface types found.
18094
18095         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
18096         interface types found.
18097
18098         * typemanager.cs (GetInterfaces): Make this routine returns alll
18099         the interfaces and work around the lame differences between
18100         System.Type and System.Reflection.Emit.TypeBuilder in the results
18101         result for GetInterfaces.
18102
18103         (ExpandInterfaces): Given an array of interface types, expand and
18104         eliminate repeated ocurrences of an interface.  This expands in
18105         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
18106         be IA, IB, IC.
18107
18108 2002-06-21  Martin Baulig  <martin@gnome.org>
18109
18110         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
18111         on System.Enum.
18112
18113 2002-06-21  Martin Baulig  <martin@gnome.org>
18114
18115         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
18116         and called with one of the core types, return the corresponding typebuilder for
18117         that type.
18118
18119         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
18120         element type.
18121
18122 2002-06-21  Martin Baulig  <martin@gnome.org>
18123
18124         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
18125         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
18126         (Expression.ConvertReferenceExplicit): Likewise.
18127
18128         * expression.cs (ElementAccess.DoResolve): Likewise.
18129         (ElementAccess.DoResolveLValue): Likewise.
18130
18131 2002-06-10  Martin Baulig  <martin@gnome.org>
18132
18133         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
18134         add the "value" parameter to the parameter list.
18135
18136         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
18137         to our caller.
18138
18139 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
18140
18141         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
18142         the argument to an int, uint, long or ulong, per the spec.  Also
18143         catch negative constants in array creation.
18144
18145 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
18146
18147         * class.cs: do not allow the same interface to appear twice in
18148         the definition list.
18149
18150 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
18151
18152         * ecore.cs: don't use ldlen with System.Array.
18153
18154 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
18155
18156         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
18157
18158 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
18159
18160         * modifiers.cs: produce correct field attributes for protected
18161         internal. Easy fix so miguel can work on ther harder stuff:-)
18162
18163 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
18164
18165         * pending.cs: New file.  Move the code from class.cs here.
18166         Support clearning the pending flag for all methods (when not doing
18167         explicit interface implementation).
18168
18169 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
18170
18171         * rootcontext.cs: added a couple more types needed to bootstrap.
18172
18173 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
18174
18175         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
18176         constructor in the type, instead of any constructor in the type
18177         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
18178         a bug in the Mono runtime when applying the params attribute). 
18179
18180 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
18181         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
18182
18183 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
18184
18185         * expression.cs (Unary.ResolveOperator): Use TypeManager
18186         to resolve the type.
18187
18188 2002-06-13  Ravi Pratap  <ravi@ximian.com>
18189
18190         * cs-parser.jay (enum_member_declaration): Pass in the attributes
18191         attached.
18192
18193         * enum.cs (AddEnumMember): Add support to store the attributes associated 
18194         with each member too.
18195
18196         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
18197         field builders too - this takes care of the enum member case.
18198
18199 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
18200
18201         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
18202         address-of operator on both value types and pointers.
18203
18204 2002-06-10  Martin Baulig  <martin@gnome.org>
18205
18206         * interface.cs (Interface.PopulateIndexer): Add the indexer's
18207         PropertyBuilder to the `property_builders' list.
18208
18209         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
18210         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
18211         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
18212         find any indexers which are inherited from an interface.
18213
18214 2002-06-09  Martin Baulig  <martin@gnome.org>
18215
18216         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
18217         the same type as the constant if necessary.  There's also a test-130.cs
18218         for this.
18219
18220         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
18221
18222         * typemanager.cs (TypeManager.ChangeType): Previously known as
18223         Enum.ChangeEnumType().
18224
18225 2002-06-09  Martin Baulig  <martin@gnome.org>
18226
18227         * expression.cs (Cast.TryReduce): Added support for consts.
18228
18229 2002-06-08  Ravi Pratap  <ravi@ximian.com>
18230
18231         * class.cs (Accessor): Hold attributes information so we can pass
18232         it along.
18233
18234         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
18235         Modify to pass in attributes attached to the methods.
18236
18237         (add_accessor_declaration, remove_accessor_declaration): Ditto.
18238
18239         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
18240         to handle the Accessor kind :-)
18241
18242         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
18243
18244 2002-06-08  Martin Baulig  <martin@gnome.org>
18245
18246         * expression.cs (Unary.TryReduceNegative): Added support for
18247         ULongConstants.
18248
18249 2002-06-08  Martin Baulig  <martin@gnome.org>
18250
18251         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
18252         name can't be found in the `defined_names' - the caller will do a
18253         MemberLookup in this case and thus find methods in System.Enum
18254         such as Enum.IsDefined().
18255
18256 2002-06-08  Martin Baulig  <martin@gnome.org>
18257
18258         * enum.cs (Enum.ChangeEnumType): This is a custom version of
18259         Convert.ChangeType() which works with TypeBuilder created types.
18260         (Enum.LookupEnumValue, Enum.Define): Use it here.
18261
18262         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
18263         `TypeBuilder.BaseType != null' check.
18264         (TypeContainer.FindMembers): Only lookup parent members if we
18265         actually have a parent.
18266         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
18267         (ConstructorInitializer.Resolve): Likewise.
18268
18269         * interface.cs (Interface.FindMembers): Added
18270         `TypeBuilder.BaseType != null' check.
18271
18272         * rootcontext.cs (RootContext.ResolveCore): Added
18273         "System.Runtime.CompilerServices.IndexerNameAttribute" to
18274         classes_second_stage.
18275
18276         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
18277         debug_type and trace_type when compiling with --nostdlib.       
18278
18279 2002-06-07  Martin Baulig  <martin@gnome.org>
18280
18281         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
18282         (AddField): Set it to true when adding a non-static field.
18283         (DefineType): Use `have_nonstatic_fields' to find out whether we
18284         have non-static fields, not `Fields != null'.
18285
18286 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
18287
18288         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
18289         dereferencing a null on the static-field code path)
18290
18291 2002-05-30  Martin Baulig  <martin@gnome.org>
18292
18293         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
18294         to take command line arguments.  Use reflection to call the new
18295         custom `Initialize' function on the symbol writer and pass it the
18296         command line arguments.
18297
18298         * driver.cs (--debug-args): New command line argument to pass command
18299         line arguments to the symbol writer.
18300
18301 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
18302
18303         * assign.cs (DoResolve): Forgot to do the implicit conversion to
18304         the target type for indexers and properties.  Thanks to Joe for
18305         catching this.
18306
18307 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
18308
18309         * typemanager.cs (MethodFlags): returns the method flags
18310         (Obsolete/ShouldIgnore) that control warning emission and whether
18311         the invocation should be made, or ignored. 
18312
18313         * expression.cs (Invocation.Emit): Remove previous hack, we should
18314         not do this on matching a base type, we should do this based on an attribute
18315
18316         Only emit calls to System.Diagnostics.Debug and
18317         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
18318         on the command line.
18319
18320         * rootcontext.cs: Global settings for tracing and debugging.
18321
18322         * cs-tokenizer.cs (define): New utility function to track
18323         defines.   Set the global settings for TRACE and DEBUG if found.
18324
18325 2002-05-25  Ravi Pratap  <ravi@ximian.com>
18326
18327         * interface.cs (Populate*): Pass in the TypeContainer as well as
18328         the DeclSpace as parameters so that we can create EmitContexts and
18329         then use that to apply attributes etc.
18330
18331         (PopulateMethod, PopulateEvent, PopulateProperty)
18332         (PopulateIndexer): Apply attributes everywhere.
18333
18334         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
18335         etc.
18336
18337         (ApplyAttributes): Update accordingly.
18338
18339         We now apply interface attributes for all members too.
18340
18341 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
18342
18343         * class.cs (Indexer.Define); Correctly check if we are explicit
18344         implementation (instead of checking the Name for a ".", we
18345         directly look up if the InterfaceType was specified).
18346
18347         Delay the creation of the PropertyBuilder.
18348
18349         Only create the PropertyBuilder if we are not an explicit
18350         interface implementation.   This means that explicit interface
18351         implementation members do not participate in regular function
18352         lookups, and hence fixes another major ambiguity problem in
18353         overload resolution (that was the visible effect).
18354
18355         (DefineMethod): Return whether we are doing an interface
18356         implementation. 
18357
18358         * typemanager.cs: Temporary hack until we get attributes in
18359         interfaces (Ravi is working on that) and we get IndexerName
18360         support in interfaces.
18361
18362         * interface.cs: Register the indexers as properties.
18363
18364         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
18365         warning, I have verified that this is a bug in the .NET runtime
18366         (JavaScript suffers of the same problem).
18367
18368         * typemanager.cs (MemberLookup): When looking up members for
18369         interfaces, the parent of an interface is the implicit
18370         System.Object (so we succeed in searches of Object methods in an
18371         interface method invocation.  Example:  IEnumerable x;  x.ToString
18372         ()) 
18373
18374 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
18375
18376         * class.cs (Event): Events should also register if they do
18377         implement the methods that an interface requires.
18378
18379         * typemanager.cs (MemberLookup); use the new GetInterfaces
18380         method. 
18381
18382         (GetInterfaces): The code used to lookup interfaces for a type is
18383         used in more than one place, factor it here. 
18384
18385         * driver.cs: Track the errors at the bottom of the file, we kept
18386         on going.
18387
18388         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
18389         instance if the method we are calling is static!
18390
18391 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
18392
18393         * attribute.cs (ApplyAttributes): Make this function filter out
18394         the IndexerName attribute (as that attribute in reality is never
18395         applied) and return the string constant for the IndexerName
18396         attribute. 
18397
18398         * class.cs (TypeContainer.Emit): Validate that all the indexers
18399         have the same IndexerName attribute, and if so, set the
18400         DefaultName attribute on the class. 
18401
18402         * typemanager.cs: The return value might contain other stuff (not
18403         only methods).  For instance, consider a method with an "Item"
18404         property and an Item method.
18405
18406         * class.cs: If there is a problem with the parameter types,
18407         return. 
18408
18409 2002-05-24  Ravi Pratap  <ravi@ximian.com>
18410
18411         * ecore.cs (ImplicitConversionExists): Wrapper function which also
18412         looks at user defined conversion after making a call to 
18413         StandardConversionExists - we need this for overload resolution.
18414
18415         * expression.cs : Update accordingly the various method calls.
18416
18417         This fixes 2 bugs filed against implicit user defined conversions 
18418
18419 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
18420
18421         * statement.cs: Track the result of the assignment.
18422
18423 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
18424
18425         * expression.cs (MemberAccess): Improved error reporting for
18426         inaccessible members.
18427
18428 2002-05-22  Martin Baulig  <martin@gnome.org>
18429
18430         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
18431         itself with debugging support.
18432
18433 2002-05-22  Martin Baulig  <martin@gnome.org>
18434
18435         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
18436         Removed, this isn't needed anymore.
18437
18438 2002-05-20  Martin Baulig  <martin@gnome.org>
18439
18440         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
18441         be underlying type for an enum.
18442
18443 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
18444
18445         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
18446         that splits out the loading of just the core types.
18447
18448         * rootcontext.cs (ResolveCore): Split the struct resolution in
18449         two, so we can load the enumeration underlying types before any
18450         enums are used.
18451
18452         * expression.cs (Is): Bandaid until we fix properly Switch (see
18453         bug #24985 for details).
18454
18455         * typemanager.cs (ImplementsInterface): The hashtable will contain
18456         a null if there are no interfaces implemented.
18457
18458 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
18459
18460         * cs-parser.jay (indexer_declarator): It is fine to have array
18461         parameters
18462
18463 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18464
18465         * typemanager.cs: (RegisterBuilder): New function used to register
18466         TypeBuilders that implement interfaces.  Since
18467         TypeBuilder.GetInterfaces (as usual) does not work with lame
18468         Reflection.Emit. 
18469         (AddUserType): register interfaces.
18470
18471         (ImplementsInterface): Use the builder_to_ifaces hash if we are
18472         dealing with TypeBuilder.  Also, arrays are showing up as
18473         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
18474         methods can not be invoked on them!
18475
18476         * ecore.cs (ExplicitReferenceConversionExists): Made public.
18477         (ImplicitReferenceConversionExists): Split out from
18478         StandardConversionExists. 
18479
18480         * expression.cs (As): We were only implementing one of the three
18481         cases for the as operator.  We now implement them all.
18482         (Is): Implement the various other cases for Is as well.
18483
18484         * typemanager.cs (CACHE): New define used to control if we want or
18485         not the FindMembers cache.  Seems to have a negative impact on
18486         performance currently
18487
18488         (MemberLookup): Nested types have full acess to
18489         enclosing type members
18490
18491         Remove code that coped with instance/static returns for events, we
18492         now catch this in RealFindMembers.
18493
18494         (RealFindMembers): only perform static lookup if the instance
18495         lookup did not return a type or an event.  
18496
18497 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18498
18499         * assign.cs (CompoundAssign): We pass more semantic information
18500         now to Compound Assignments than we did before: now we have all
18501         the information at hand, and now we resolve the target *before* we
18502         do the expression expansion, which allows the "CacheValue" method
18503         to have the effect we intended (before, a [x] += 1 would generate
18504         two differen ArrayAccess expressions from the ElementAccess,
18505         during the resolution process).
18506
18507         (CompoundAssign.DoResolve): Resolve target and original_source here.
18508
18509 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
18510
18511         * expression.cs (ArrayAccess): dropped debugging information. 
18512
18513         * typemanager.cs: Small bug fix: I was always returning i_members,
18514         instead of one of i_members or s_members (depending on which had
18515         the content).
18516
18517         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
18518         method is invoked before any code generation takes place, and it
18519         is a mechanism to inform that the expression will be invoked more
18520         than once, and that the method should use temporary values to
18521         avoid having side effects
18522
18523         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18524
18525         * ecore.cs (Expression.CacheTemporaries): Provide empty default
18526         implementation.
18527
18528         * expression.cs (Indirection, ArrayAccess): Add support for
18529         CacheTemporaries in these two bad boys. 
18530
18531         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18532         ldobj or ldind_ref.  
18533         (StoreFromPtr): Handle stobj as well.
18534
18535         * expression.cs (UnaryMutator): Share more code.
18536
18537         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18538         down: I was not tracking the Filter function as well, which
18539         was affecting the results of the cache.
18540
18541 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
18542
18543         * attribute.cs: Remove the hack to handle the CharSet property on
18544         StructLayouts. 
18545
18546 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
18547
18548         * attribute.cs (DoResolve): More uglyness, we now only try to
18549         resolve the attribute partially, to extract the CharSet
18550         information (only if we are a StructLayout attribute).  Otherwise 
18551
18552         (GetExtraTypeInfo): Add some code to conditionally kill in the
18553         future this.   I am more and more convinced that the .NET
18554         framework has special code to handle the attribute setting on
18555         certain elements.
18556
18557         * expression.cs (IsParamsMethodApplicable): Revert my previous
18558         foreach change here, it was wrong.
18559
18560 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
18561
18562         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
18563         (pp_expr): do not abort on unknown input, just return.
18564         (eval): abort if there are pending chars.
18565
18566         * attribute.cs (Attribute.Resolve): Positional parameters are
18567         optional.  Deal with that case.
18568
18569         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
18570         the Ansi/Unicode/Auto information for the type.
18571
18572         (TypeContainer.DefineType): instantiate the EmitContext here, as
18573         we will be using it during the type definition (to resolve
18574         attributes) and during the emit phase.
18575
18576         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18577         to pull type information out of the attributes
18578
18579         (Attribute.Resolve): track the constructor builder, and allow for
18580         multiple invocations (structs and classes will use this).
18581
18582         * ecore.cs (MemberLookupFinal): new version with all the
18583         parameters customizable.
18584
18585         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18586         constructors.  Return if the result value is null (as the error
18587         would have been flagged already by MemberLookupFinal)
18588
18589         Do not allow instances of abstract classes or interfaces to be
18590         created.
18591
18592         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18593         We have to compare the assembly property here when dealing with
18594         FamANDAssem and Assembly access modifiers, because we might be
18595         creating an assembly from *modules* (that means that we are not
18596         getting TypeBuilders for types defined in other modules that are
18597         part of this assembly).
18598
18599         (Method.Emit): If the method is marked abstract and has a body,
18600         emit an error. 
18601
18602         (TypeContainer.DefineMembers): If both the defined member and the
18603         parent name match are methods, then do not emit any warnings: let
18604         the Method.Define routine take care of flagging warnings.  But if
18605         there is a mismatch (method overrides something else, or method is
18606         overriwritten by something, then emit warning).
18607
18608         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18609         set to null, this means `do not check for the return type on the
18610         signature'. 
18611
18612         (Method.Define): set the return type for the method signature to
18613         null, so that we get methods with the same name and parameters and
18614         different return types.  This is used to flag warning 114 (you are
18615         hiding a method, and you probably want to use the new/override
18616         keywords instead).
18617
18618         * typemanager.cs (MemberLookup): Implemented proper access
18619         control, closing a long standing set of bug reports.  The problem
18620         was that the Framework only has two bits: Public and NonPublic,
18621         and NonPublic includes private and protected methods, but we need
18622         to enforce the FamANDAssem, FamOrAssem and Family. 
18623
18624 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
18625
18626         * statement.cs (GotoCase): Return true: Ammounts to giving up
18627         knowledge on whether we return or not, and letting the other case
18628         be responsible for it.
18629
18630 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
18631
18632         * driver.cs: Do not load directories for each file processed, only
18633         do it if there is a pattern.
18634
18635         * ecore.cs: Report readonly assigns here as well, as we might have
18636         been resolved only by MemberAccess.
18637
18638         (SimpleName.SimpleNameResolve): Also be useful for LValue
18639         resolution.   We need this to propagate assign to local readonly variables
18640
18641         * typemanager.cs: Use a ptrhashtable for the criteria, because we
18642         do not want to reuse potential criteria memory.
18643
18644         * class.cs (MyEventBuilder): Set reflected_type;
18645
18646         * ecore.cs (Constantify): Added support for constifying bools.
18647
18648         (RootContext.LookupType): Added a cache for values looked up in
18649         the declaration space.
18650
18651         * typemanager.cs (FindMembers): Now is a front-end to
18652         RealFindMembers, and provides a two-level hashtable-based cache to
18653         the request.  
18654
18655         15% performance improvement: from 22.5 to 19.2 seconds.
18656
18657         * expression.cs (IsParamsMethodApplicable): use foreach.
18658         (Invocation.DoResolve): ditto.
18659         (New.DoResolve): ditto.
18660         (ArrayCreation.DoResolve): ditto.
18661
18662         * ecore.cs (FindMostEncompassingType): use foreach.
18663
18664         * delegate.cs (NewDelegate.DoResolve): Use foreach
18665
18666         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18667         (RemoveMethods): use foreach.
18668
18669         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18670         nested foreach statements instead of for, and also break out of
18671         the inner loop once a match is found.
18672
18673         (Invocation.OverloadResolve): Use foreach, simplify the code. 
18674
18675 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
18676
18677         * cfold.cs (BinaryFold): During an enumeration evaluation context,
18678         we actually unwrap the expression to allow for extra information
18679         to be extracted. 
18680
18681         * expression.cs: Use Shr_Un on unsigned operations. 
18682
18683 2002-05-08  Ravi Pratap  <ravi@ximian.com>
18684
18685         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
18686         applicable operators was not being considered correctly. This closes
18687         the bug Miguel reported.
18688
18689 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18690
18691         * attribute.cs: check that the type derives from System.Attribute
18692         and report the correct error in that case (moved the duplicate code to
18693         its own method, too).
18694
18695 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18696
18697         * attribute.cs: lookup attribute type name as the spec says: first the
18698         bare attribute name and then name + "Attribute" (nant compiles with
18699         mcs after this fix).
18700
18701 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
18702
18703         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
18704         Because of the way we parse things, we should try to see if a
18705         UIntConstant can fit in an integer.
18706
18707 2002-05-07  Ravi Pratap  <ravi@ximian.com>
18708
18709         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18710         when we are in an explicit context.
18711
18712         (ConvertReferenceExplicit): When converting from Iface type S to Class
18713         T make sure the rules are implemented as an OR.
18714
18715         * parameter.cs (ParameterType): Make it a property for now although the
18716         purpose really isn't anything immediate.
18717
18718         * expression.cs (Is*Applicable): Do better checking on the parameter type
18719         of a ref/out parameter. The ones from the system assemblies are already 
18720         marked with the correct type so we don't need to do any correction.
18721
18722         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
18723         the object type is standard too so include that.
18724
18725 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18726
18727         * ecore.cs (StandardConversionExists): Augment with missing code:
18728         deal with IntConstant, LongConstants and Enumerations.
18729
18730         * assign.cs: Report the error, instead of failing silently
18731
18732         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18733         typecontainer that they are declared, because the
18734         typecontainer/namespace will have the list of using clauses that
18735         need to be applied.
18736
18737         Assembly Attributes were escaping the normal registration
18738         mechanism. 
18739
18740         (EmitCode): Apply attributes within an EmitContext that represents
18741         the container they were declared on.
18742
18743         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
18744
18745 2002-05-06  Ravi Pratap  <ravi@ximian.com>
18746
18747         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18748         Revamp completely - make much cleaner as we now operate only
18749         on a set of Types.
18750
18751         (FindMostSpecificSource, FindMostSpecificTarget): New methods
18752         to implement the logic detailed in the spec more correctly.
18753
18754         (UserDefinedConversion): Update accordingly.
18755
18756 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18757
18758         * statement.cs: Return flow analysis information up.
18759
18760         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18761         and the default.
18762
18763         (token): Do not consume an extra character before calling
18764         decimal_digits.
18765
18766 2002-05-06  Piers Haken <piersh@friskit.com>
18767
18768         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18769
18770 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18771
18772         * class.cs (Constructor.Emit): Set the IsStatic flag in the
18773         EmitContext during the instance constructor initializer
18774         resolution, to stop access to instance variables.
18775
18776         This is mandated by the spec, last paragraph of the `constructor
18777         initializers' section. 
18778
18779 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
18780
18781         * cs-parser.jay, class.cs (Accessor): new class used to represent
18782         an accessor (get or set).  In the past we used `null' to represent
18783         a missing accessor.  But this is ambiguous because there was no
18784         way to tell in abstract indexers/properties if one of them was
18785         specified.
18786
18787         Now there is a way of addressing that.
18788
18789         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18790         instead of FindMembers.
18791
18792         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18793         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
18794
18795         * attribute.cs: Treat indexers and properties as the same in terms
18796         of applying attributes
18797
18798         * ecore.cs (FindMostEncompassedType): Use statically initialized
18799         EmptyExpressions()s like we do elsewhere to avoid creating useless
18800         objects (and we take this out of the tight loop).
18801
18802         (GetConversionOperators): Move the code to extract the actual
18803         operators to a separate routine to clean things up.
18804
18805 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
18806
18807         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
18808         events are always registered FieldBuilders.
18809
18810         * class.cs (FieldBase): New class shared by Fields 
18811
18812         * delegate.cs: If we are a toplevel delegate, use our full name.
18813         If we are a nested delegate, then only use our tail name.
18814
18815 2002-05-02  Ravi Pratap  <ravi@ximian.com>
18816
18817         * expression.cs (IsApplicable): Ensure that we add the "&" to
18818         ref/out types before comparing it with the type of the argument.
18819
18820         (IsParamsMethodApplicable): Ditto.
18821
18822         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
18823         silly me ;-)
18824
18825         * delegate.cs : Handle the case when we have more than one applicable
18826         method. Flag an error only when we finish checking all.
18827
18828 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
18829
18830         * expression.cs: Add support for boolean static initializers.
18831
18832 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
18833
18834         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
18835
18836         * parameter.cs (ComputeParameterTypes,
18837         ComputeAndDefineParameterTypes): Better error handling: now we
18838         clear the `types' cache if we fail during any of the type lookups.
18839         We also return the status code correctly to our caller
18840
18841         * delegate.cs: If we fail to define a delegate, abort the extra
18842         steps. 
18843
18844         * expression.cs (Binary.ResolveOperator): for
18845         operator==(object,object) and operator !=(object, object) we also
18846         have to verify that there is an implicit conversion from one to
18847         the other.
18848
18849         (ArrayAccess.DoResolve): Array Access can operate on
18850         non-variables. 
18851
18852 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
18853
18854         * assign.cs (CompoundAssign): A new class used as a "flag" that
18855         the assignment actually is happening as part of a compound
18856         assignment operator.
18857
18858         During compound assignment, a few new rules exist to enable things
18859         like:
18860
18861         byte b |= 1 + 2
18862
18863         From the spec:
18864
18865         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
18866         to the type of x) if y is implicitly convertible to the type of x,
18867         and the operator is a builtin operator and the return type of the
18868         operator is explicitly convertible to the type of x. 
18869
18870         * rootcontext.cs: Reset warning level to 2.  4 catches various
18871         "interesting" features in mcs, we must clean this up at some
18872         point, but currently am trying to kill other bugs ;-)
18873
18874         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
18875         in container classes as well.  
18876
18877         * expression.cs (Binary.ResolveOperator): Handle string case
18878         before anything else (as operator overloading does emit an error
18879         before doing anything else).
18880
18881         This code could go away when we move to a table driven model, but
18882         i could not come up with a good plan last night.
18883
18884 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
18885
18886         * typemanager.cs (CSharpName): reimplementation using regex.
18887         * class.cs: added null check for fields in Emit
18888         * rootcontext.cs: set warninglevel to 4
18889
18890 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
18891
18892         * typemanager.cs (CSharpName): reimplemented with Lupus
18893         suggestion.
18894
18895 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
18896
18897         * statement.cs (If): correclty implement Resolve, because we were
18898         not catching sem errors in there.  The same process is needed
18899         everywhere else. 
18900         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
18901
18902
18903         (Statement.Warning_DeadCodeFound): Factorize code.
18904         (While): Report dead code here too.
18905
18906         (Statement): Added Resolve virtual method to allow
18907         for resolution split from the emit code.
18908
18909 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
18910
18911         * statement.cs (EmitBoolExpression): No longer try to resolve the
18912         expression here.    
18913         (MakeBoolean): New utility function that resolve, implicitly
18914         converts to boolean and tags the expression. 
18915
18916
18917         (If, Do): Implement dead code elimination.
18918         (While): Implement loop inversion
18919
18920         (Do, While, For, If): Resolve the expression prior to calling our
18921         code generation.
18922
18923 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
18924
18925         * class.cs:
18926           - added method Report28 (warning: program has more than one entry point)
18927           - added method IsEntryPoint, implements paragraph 10.1 of the spec
18928           - modified method Method.Define, the part at the end of the method
18929
18930         * rootcontext.cs: added static public Location EntryPointLocation;
18931           
18932         * ../errors/cs0028.cs : Add test case for the above warning.              
18933
18934         * typemanager.cs:
18935           - modified method CSharpName to allow arrays of primitive type to
18936             be printed nicely (e.g. instead of System.Int32[][] it now prints
18937             int[][])
18938           - added method CSharpSignature: returns the signature of a method
18939             in string format to be used in reporting errors, warnings, etc.
18940
18941         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
18942         with String.Empty.
18943
18944 2002-04-26  Ravi Pratap  <ravi@ximian.com>
18945
18946         * delegate.cs (Define): Fix extremely silly bug where I was
18947         setting the type of the 'object' parameter of the BeginInvoke
18948         method to System.IAsyncResult instead of System.Object ;-)
18949
18950 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
18951
18952         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
18953         here. 
18954
18955         (Constructor.Emit): return if we fail to initialize the
18956         constructor.  Another door closed!  
18957
18958         * expression.cs (New.DoResolve): Improve error message (from -6 to
18959         1501).  Use DeclaredOnly lookup to find the exact constructor.
18960
18961         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
18962         loop.  This is useful.
18963
18964         * cs-parser.jay: Adjust the default parameters so that destructors
18965         have the proper signature.
18966
18967 2002-04-26  Martin Baulig  <martin@gnome.org>
18968
18969         * driver.cs (LoadAssembly): If `assembly' contains any characters
18970         which are only valid in path names and not in assembly names
18971         (currently slash, backslash and point), use Assembly.LoadFrom ()
18972         instead of Assembly.Load () on the `assembly' (before iteration
18973         over the link_paths).
18974
18975 2002-04-26  Martin Baulig  <martin@gnome.org>
18976
18977         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
18978
18979 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
18980
18981         * class.cs (Property): use the new typemanager.MemberLookup
18982
18983         (TypeContainer.MemberLookup): Implement using the
18984         TypeManager.MemberLookup now. 
18985
18986         * typemanager.cs: Make MemberLookup a function of the TypeManager,
18987         and return MemberInfos, so that these can be used without an
18988         EmitContext (what we had before).
18989
18990 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
18991
18992         * expression.cs: Fix the case where the argument to params if the
18993         type of the params.  I omitted handling this before.   Fixed
18994
18995 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
18996
18997         * driver.cs: Call BootCorlib_PopulateCoreType
18998
18999         * class.cs (Property.CheckBase): Check for properties only, not
19000         for all members. 
19001
19002         * interface.cs: Temporary hack: try/catch around the
19003         CustomAttributeBuilder, because I am getting an exception that I
19004         do not understand.
19005
19006         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
19007         types whose definitions are required to be there (attributes are
19008         defined before standard types).
19009
19010         Compute definitions as we boot the various types, as they are used
19011         immediately (value_type class will need object_type, but if we do
19012         not initialize object_type, we will pass a null, which will let
19013         the runtime pick the System.Object from the existing corlib, which
19014         is not what we want).
19015
19016 2002-04-22  Patrik Torstensson <totte@labs2.com>
19017
19018         * cs-tokenizer.cs: fixed a number of trim() issues.
19019
19020 2002-04-22  Ravi Pratap  <ravi@ximian.com>
19021
19022         * expression.cs (Argument.Type): Ensure that we return the correct
19023         type when we have out or ref parameters [in which case we 
19024         append a "&"].
19025
19026 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19027
19028         * class.cs (Property, Indexer): Allow extern modifier in there. 
19029
19030         * typemanager.cs (InitBaseTypes): Initializes object_type and
19031         value_type, since those will be used early on during the bootstrap
19032         process to compile corlib.
19033
19034         (InitCoreTypes): Move code from here to InitBaseTypes.
19035
19036 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
19037
19038         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
19039         single-dimension arrays as using the ldlen opcode.  
19040
19041         Daniel Lewis discovered this optimization.  
19042
19043         * typemanager.cs: Add signature for System.Array::get_Length
19044
19045 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19046
19047         * statement.cs: report the error when the foreach does not apply to an
19048         array nor a collection.
19049
19050 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
19051
19052         * expression.cs: Add implicit conversions to the operator ~.
19053
19054         * constant.cs (DecimalConstant.Emit): Emit decimal value.
19055
19056         * typemanager.cs: Locate the decimal constructor.
19057
19058 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19059
19060         * attribute.cs: use the new property of TypeOf.
19061         * expression.cs: added 'get' property around typearg.
19062
19063         These changes fix a build breaker reported by NickD. Is this the
19064         correct way to fix?  If not, please, revert my changes and make it
19065         work :-).
19066
19067 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
19068
19069         * attribute.cs: Add support for typeof in attribute invocations.
19070         I am not sure that this is right though.
19071
19072 2002-04-14  Duncan Mak  <duncan@ximian.com>
19073
19074         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
19075         Binary.Operator.Division case.
19076
19077 2002-04-13  Ravi Pratap  <ravi@ximian.com>
19078
19079         * class.cs (DefineType): Ensure that we do a proper check on
19080         attribute types and also register it with the TypeManager.
19081
19082         (TypeContainer.Targets): The default for attribute types is
19083         AttributeTargets.All.
19084
19085         * attribute.cs (ApplyAttributes): Registering the attribute type
19086         is done elsewhere, not when we discover we have a Usage attribute.
19087
19088 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19089
19090         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
19091         and get rid of is_delegate parameter.
19092
19093         * everywhere : update.
19094
19095 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19096
19097         * cs-parser.jay (compilation_unit): Revamp completely to use
19098         some new ideas that I got from Rhys' grammar to solve the problems
19099         with assembly level attributes.
19100
19101         (outer_declaration): New grammar production.
19102
19103         (attribute_sections): Add.
19104
19105         (opt_attributes): Base on attribute_sections
19106
19107         (namespace_declaration): Allow opt_attributes to tackle the case
19108         when we have assembly level attributes - we are clever in this
19109         regard now ;-)
19110
19111         * attribute.cs (ApplyAttributes): Do not worry about assembly 
19112         attributes in the non-global context.
19113
19114         * rootcontext.cs (AddGlobalAttributes): Go back to using this
19115         instead of SetGlobalAttributes.
19116
19117         * class.cs, rootcontext.cs : Ensure we define and generate 
19118         attribute types before anything else.
19119
19120         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
19121         and flag the new error -20 for the case when the attribute type
19122         does not have valid targets specified. csc does not catch this.
19123
19124         * ../errors/errors.txt : update for error # -20
19125
19126 2002-04-11  Ravi Pratap  <ravi@ximian.com>
19127
19128         * support.cs (InternalParameters.ParameterModifier): Do some null
19129         checking and return sane values.
19130
19131         * class.cs (Method.Define): If we are a PInvoke method, ensure
19132         that we are static and extern. Report error # 601
19133
19134         * ../errors/cs0601.cs : Add test case for the above error.
19135
19136 2002-04-07  Ravi Pratap  <ravi@ximian.com>
19137
19138         * rootcontext.cs (attribute_types): We need to keep type of
19139         all attribute types separately and emit code for them first.
19140
19141         (RegisterAttribute) : Implement.
19142
19143         * class.cs (DefineType): Check if the current Type is a custom
19144         attribute type and register it accordingly.
19145
19146         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
19147         adding the first attribute twice and rename to
19148
19149         (SetGlobalAttributes): this.
19150
19151         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
19152         lookups.
19153
19154         * attribute.cs (ApplyAttributes): Take an additional argument telling us
19155         if we are processing global arguments. Hmm, I am unsure of this.
19156
19157 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19158
19159         * expression.cs: added static array of strings to avoid calling
19160         Enum.ToString () for Operator in Binary. Significant recover of
19161         performance.
19162
19163 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
19164
19165         * class.cs (FindMembers): Allow the Builders of the various
19166         members to be null.  If they are skip them.  This only happens
19167         during the PInvoke declaration.
19168
19169 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
19170
19171         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
19172         failure, so we do not keep going afterwards.
19173
19174         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
19175         wanted to pass `false' as the `is_delegate' argument.  If this is
19176         the case, why not use delegate_type == null to mean `is_delegate =
19177         false' and anything else as is_delegate = true.
19178
19179 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
19180
19181         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
19182         code for the section, not the beginning of the tests.
19183
19184 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
19185
19186         * cfold.cs: Handle operator + (Enum x, Underlying x) 
19187
19188         * expression.cs (Binary): same.  Warn about errors where we have
19189         Enum/Enum in operator + as well.
19190
19191 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
19192
19193         * statement.cs:
19194                 - added support for switch(bool)
19195                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
19196                 - add TableSwitchEmit() to handle table-based switch statements
19197
19198 2002-04-05  Ravi Pratap  <ravi@ximian.com>
19199
19200         * expression.cs (Invocation.OverloadResolve): Factor out code which
19201         does parameter compatibility checking with arguments so that we can 
19202         re-use the code even from Delegate.VerifyApplicability
19203
19204         (VerifyArgumentsCompat): Move above code here.
19205
19206         * delegate.cs (VerifyApplicability): Get rid of duplicate code
19207         and instead make a call to the above method.
19208
19209 2002-03-31  Ravi Pratap  <ravi@ximian.com>
19210
19211         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
19212         We use it to keep track of classes which are attribute types.
19213
19214 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
19215
19216         * delegate.cs (Delegate.Define): Correctly define the types in the
19217         presence of fixed and array parameters.
19218
19219         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
19220         doing FindMembers.
19221
19222         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
19223         include NonPublic after the first iteration.
19224
19225         * class.cs (Indexer.CheckBase): Only check if both parents are
19226         non-null. 
19227
19228         * cs-parser.jay (accessor_body): If empty, set to null.
19229
19230         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
19231         same code path here to resolve constants names that we did have in
19232         MemberAccess.DoResolve.  There is too much code duplicated here.
19233
19234 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
19235
19236         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
19237
19238         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
19239         to MakeUnionSet.
19240
19241         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
19242         tokens, numbers and strings.
19243
19244         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
19245         parenthesis.
19246
19247         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
19248         asyncronous parameters and the regular parameters.  
19249
19250         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
19251         specify the target directory.
19252
19253         * expression.cs: (This.DoResolve): Simplify
19254         (As.Emit): Optimize, do not generate IsInst if the expression is
19255         always of the given type.
19256
19257         (Is.DoResolve): Bug fix, we were reporting both always/never for
19258         the is expression.
19259
19260         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
19261         creating too many unnecessary arrays.
19262
19263 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
19264
19265         * class.cs (EmitFieldInitializer): Use Assign expression to assign
19266         fields instead of rolling our own initializer.   Takes care of all
19267         implicit conversions, and drops unnecessary static checks/argument.
19268
19269 2002-03-31  Dick Porter  <dick@ximian.com>
19270
19271         * driver.cs: use the GetDirectories() return values properly, and
19272         use "/" as path separator.
19273
19274 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
19275
19276         * expression.cs (Unary): Optimize - - expr into expr.
19277         (Binary): Optimize a + (-b) into a -b.
19278
19279         * codegen.cs (CodeGen): Made all methods static.
19280
19281 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
19282
19283         * rootcontext.cs: 
19284
19285         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
19286         TypeBuilder property.
19287
19288         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
19289         instead. 
19290
19291         * tree.cs: Removed the various RecordXXXX, and replaced with a
19292         single RecordDecl.  Removed all the accessor methods, and just
19293         left a single access point Type 
19294
19295         * enum.cs: Rename DefineEnum to DefineType.
19296
19297         * decl.cs: New abstract method `DefineType' used to unify the
19298         Defines for Enumerations, Interfaces, TypeContainers and
19299         Delegates.
19300
19301         (FindType): Moved LookupInterfaceOrClass here.  Moved the
19302         LookupBaseClasses method that used to live in class.cs and
19303         interface.cs here, and renamed to FindType.
19304
19305         * delegate.cs: Implement DefineType.  Take advantage of the
19306         refactored pattern for locating the parent builder without taking
19307         the parent_builder argument (which we know does not work if we are
19308         nested, and triggering a toplevel definition).
19309
19310 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19311
19312         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
19313         accessibility of a member has changed during override and report
19314         an error if so.
19315
19316         * class.cs (Method.Define, Property.Define): Only complain on
19317         overrides if the method is private, any other accessibility is
19318         fine (and since we just checked the permission is the same, we are
19319         good to go).
19320
19321         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
19322         and elif are processed always.  The other pre-processing
19323         directives are only processed if we are "taking" the path
19324
19325 2002-03-29  Martin Baulig  <martin@gnome.org>
19326
19327         * class.cs (Method.Emit): Only emit symbolic debugging info if the
19328         current location is not Null.
19329
19330         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
19331         a separate method so we can profile it.
19332
19333         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
19334         `span.Seconds' are just seconds, but no minutes or hours.
19335         (MainDriver): Profile the CodeGen.SaveSymbols calls.
19336
19337 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19338
19339         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
19340         Remove the gratuitous set of Final:
19341
19342                                 // If an interface implementation, then we can set Final.
19343                                 if (((flags & MethodAttributes.Abstract) == 0) &&
19344                                     implementing.DeclaringType.IsInterface)
19345                                         flags |= MethodAttributes.Final;
19346
19347         I do not know what I was smoking when I used that.
19348
19349
19350         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
19351         step into fixing the name resolution issues for delegates and
19352         unifying the toplevel name resolution.
19353
19354 2002-03-28  Martin Baulig  <martin@gnome.org>
19355
19356         * class.cs (Method.Emit): If we have a symbol writer, call its
19357         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
19358         tell it about the current method.
19359
19360         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
19361         writer that we're going to emit the first byte of IL code for a new
19362         statement (a new source line).
19363         (EmitContext.EmitTopBlock): If we have a symbol writer, call
19364         EmitContext.Mark() before emitting any code.
19365
19366         * location.cs (SymbolDocument): Return null when we're Null.
19367
19368         * statement.cs (Statement): Moved the `Location loc' variable here.
19369         (Statement.EmitBoolExpression): If we have a symbol writer, call
19370         ec.Mark() before emitting any code to tell it that we're at the
19371         beginning of a new statement.
19372         (StatementExpression): Added `Location' argument to the constructor.
19373         (Block): Added public readonly variable `StartLocation' and public
19374         variable `EndLocation'.  The latter is to be set using SetEndLocation().
19375         (Block): Added constructor which takes a start and end location.
19376         (Block.SetEndLocation): New method. This sets the end location.
19377         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
19378         local variables we create.
19379         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
19380         each statement and do also mark the begin and end of the block.
19381
19382         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
19383         tell it the current lexer.Location, use Location.Null for the end of the
19384         block.
19385         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
19386         current block, set its end location using SetEndLocation().
19387         (statement_expression): StatementExpression constructor now takes the
19388         lexer.Location as additional argument.
19389         (for_statement, declare_local_variables): Likewise.
19390         (declare_local_variables): When creating a new implicit block, use the
19391         new Block constructor and pass it the lexer.Location.
19392
19393 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19394
19395         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
19396         members also on the parent interfaces recursively.
19397
19398 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
19399
19400         * report.cs: Use new formats, since Gonzalo finished the missing
19401         bits. 
19402
19403         * expression.cs (Binary.ResolveOperator): added missing operator|
19404         operator& and operator^ for bool/bool.
19405
19406         * cs-parser.jay: CheckDef now takes a Location argument that is
19407         used to report errors more precisly (instead of reporting the end
19408         of a definition, we try to track something which is a lot closer
19409         to the source of the problem).
19410
19411         * cs-tokenizer.cs: Track global token use, so we can properly flag
19412         the use of #define/#undef after the first token has been seen.
19413
19414         Also, rename the reportXXXX to Error_DescriptiveName
19415
19416         * decl.cs (DeclSpace.IsTopLevel): Move property here from
19417         TypeContainer, so that Enum and Interface can use this too.
19418
19419         * class.cs (TypeContainer.LookupInterfaceOrClass,
19420         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
19421         `builder' argument.  Typically this was used to pass the parent
19422         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
19423         the definition).  
19424
19425         The problem is that a nested class could trigger the definition of
19426         a toplevel class, and the builder would be obviously wrong in that
19427         case. 
19428
19429         So we drop this argument, and we compute dynamically the
19430         TypeBuilder/ModuleBuilder (the correct information was available
19431         to us anyways from DeclSpace.Parent)
19432
19433         * interface.cs (Interface.DefineInterface): Drop builder
19434         parameter cleanup like class.cs
19435
19436         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
19437         like class.cs
19438
19439         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
19440         values. 
19441
19442         (Try.Emit): Propagate the returns value from the statement.
19443
19444         (Return.Emit): Even if we are leavning 
19445
19446         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
19447
19448         * modifiers.cs: Fix the computation of MethodAttributes flags.
19449
19450 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
19451
19452         * driver.cs: allow compilation of files that start with '/'.
19453         Add a default case when checking the argument of --target.
19454
19455 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
19456
19457         * interface.cs: Implement the same search algorithm for types in
19458         the interface code.
19459
19460         * delegate.cs: Do not allow multiple definition.
19461
19462         * Recovered ChangeLog that got accidentally amputated
19463
19464         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
19465
19466         * rootcontext.cs: Load manually enum to allow core classes to
19467         contain enumerations.
19468
19469         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
19470         Update to new static methods in TypeManager.
19471
19472         * typemanager.cs (GetMethod, GetConstructor): Use our
19473         implementation of FindMembers to find the members, since during
19474         corlib compilation, the types are TypeBuilders and GetMethod and
19475         GetConstructor do not work.
19476
19477         Make all methods in TypeManager static.
19478
19479         (InitCodeHelpers): Split the functionality from
19480         the InitCodeTypes function.
19481
19482         * driver.cs: Call InitCodeHelpers after we have populated the
19483         types. 
19484
19485         * cs-parser.jay (delegate_declaration): we did not used to compute
19486         the delegate name correctly for void delegates.
19487
19488 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
19489
19490         * rootcontext.cs (RootContext): Init the interface_resolve_order
19491         and type_container_resolve_order always.
19492
19493         (ResolveCore, BootstrapCorlib_ResolveClass,
19494         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19495         compiler when compiling with --nostdlib
19496
19497         * class.cs (TypeContainer.DefineType): Check that our parent is
19498         not null.  This test is most important when we are bootstraping
19499         the core types.
19500
19501         * codegen.cs: Split out the symbol writing code.
19502
19503 2002-03-25  Martin Baulig  <martin@gnome.org>
19504
19505         * driver.cs (-g): Made -g an alias for --debug.
19506
19507 2002-03-24  Martin Baulig  <martin@gnome.org>
19508
19509         * codegen.cs (SymbolWriter): New public variable. Returns the
19510         current symbol writer.
19511         (CodeGen): Added `bool want_debugging_support' argument to the
19512          constructor. If true, tell the ModuleBuild that we want debugging
19513         support and ask it for the ISymbolWriter.
19514         (Save): If we have a symbol writer, call it's Close() method after
19515         saving the assembly.
19516
19517         * driver.c (--debug): New command line argument to create a
19518         debugger information file.
19519
19520         * location.cs (SymbolDocument): New public property. Returns an
19521         ISymbolDocumentWriter object for the current source file or null
19522         if we don't have a symbol writer.
19523
19524 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
19525
19526         * driver.cs (LoadAssembly): Correctly return when all the paths
19527         have been tried and not before.
19528
19529         * statement.cs (Switch.Emit): return the actual coverage for this
19530         statement (returns/not-returns)
19531
19532         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19533         switch of the statement if we are the last switch section.  That
19534         kills two problems: try/catch problems (we used to emit an empty
19535         nop at the end) and switch statements where all branches would
19536         return. 
19537
19538 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
19539
19540         * driver.cs: Add default assemblies (the equivalent to the
19541         Microsoft CSC.RSP file)
19542
19543         * cs-tokenizer.cs: When updating `cols and setting it to zero,
19544         also update tokens_seen and set it to false.
19545
19546         * driver.cs: Implement --recurse for Mike.
19547
19548         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19549         correctly splitting out the paths.
19550
19551 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
19552
19553         * interface.cs (Interface.PopulateProperty): Instead of using
19554         `parent' as the declaration space for the set parameters, use
19555         `this' 
19556
19557         * support.cs (InternalParameters): InternalParameters constructor
19558         takes a DeclSpace instead of a TypeContainer.
19559
19560         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
19561         types are being initialized, load the address of it before calling
19562         the function.  
19563
19564         (New): Provide a mechanism to disable the generation of local
19565         value type temporaries when the caller will be providing us with
19566         an address to store it.
19567
19568         (ArrayCreation.EmitDynamicInitializers): Use it.
19569
19570 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
19571
19572         * expression.cs (Invocation.EmitArguments): Only probe for array
19573         property if there is more than one argument.  Sorry about that.
19574
19575         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19576         empty param arrays.
19577
19578         * class.cs (Method.LabelParameters): Fix incorrect code path that
19579         prevented the `ParamArrayAttribute' from being applied to the
19580         params attribute.
19581
19582 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
19583
19584         * support.cs (ReflectionParameters): Correctly compute whether the
19585         last argument is a params array.  Fixes the problem with
19586         string.Split ('a')
19587
19588         * typemanager.cs: Make the assemblies array always be non-null
19589         (empty, but non-null)
19590
19591         * tree.cs (RecordDecl): New function that abstracts the recording
19592         of names.  This reports error 101, and provides a pointer to the
19593         previous declaration.  Fixes a crash in the compiler.
19594
19595         * cs-parser.jay (constructor_declaration): Update to new grammar,
19596         and provide a constructor_body that can be empty.
19597
19598 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
19599
19600         * driver.cs: Add support for --resources.
19601
19602         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19603         Make all types for the various array helper methods be integer.
19604
19605         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19606         CheckState to ConvCast.
19607
19608         (ConvCast): Now it takes a `checked' state argument, to avoid
19609         depending on the emit context for the conversion, and just using
19610         the resolve time setting.
19611
19612         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19613         instead of Invocation.EmitArguments.  We do not emit the original
19614         arguments, instead we emit those which have been converted to
19615         unsigned int expressions.
19616
19617         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19618
19619         * codegen.cs: ditto.
19620
19621         * expression.cs (LocalVariableReference): Drop the use of the
19622         Store function that depended on the variable index.
19623
19624         * statement.cs (VariableInfo): Drop the `Idx' property from this
19625         class, as this is not taking into account the indexes for
19626         temporaries tat we generate during the execution, getting the
19627         indexes wrong.
19628
19629         * class.cs: First emit class initializers, then call the parent
19630         constructor. 
19631
19632         * expression.cs (Binary): Fix opcode emision.
19633         (UnaryMutator.EmitCode): Support checked code generation
19634
19635         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19636         matches for events for both the Static and Instance scans,
19637         pointing to the same element.   Fix that.
19638
19639 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
19640
19641         * rootcontext.cs (ResolveTree): Always set the
19642         interface_resolve_order, because nested interfaces will be calling
19643         into us.
19644
19645         * class.cs (GetInterfaceOrClass): Track the same resolution
19646         process used by TypeManager.LookupType.  This fixes the nested
19647         type lookups in class declarations (separate path from
19648         LookupType). 
19649
19650         (TypeContainer.DefineType): Also define nested interfaces.
19651         (TypeContainer.RegisterOrder): New public function used to
19652         register the order in which child interfaces need to be closed.
19653
19654         Nested interfaces need to be closed after their parents have been
19655         created. 
19656
19657         * interface.cs (InterfaceAttr): Put all the logic for computing
19658         the interface attribute here. 
19659
19660         (DefineInterface): Register our interface order with the
19661         RootContext or with the TypeContainer depending on the case.
19662
19663 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19664
19665         * cs-parser.jay: rework foreach statement to work with the new
19666         changes to the policy on SimpleNames.
19667
19668         * report.cs: support Stacktrace on warnings as well.
19669
19670         * makefile: drop --unsafe and /unsafe from the compile.
19671
19672 2002-03-13  Ravi Pratap  <ravi@ximian.com>
19673
19674         * ecore.cs (StandardConversionExists): Modify to take an Expression
19675         as the first parameter. Ensure we do null -> reference type conversion
19676         checking.
19677
19678         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19679         temporary Expression objects.
19680
19681 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19682
19683         * interface.cs: workaround bug in method overloading resolution
19684         (there is already a bugzilla bug for it).
19685
19686 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19687
19688         We could also solve this problem by having a separate path for
19689         performing type lookups, instead of DoResolve, we could have a
19690         ResolveType entry point, and only participating pieces of the
19691         production (simplename, deref, array) would implement this. 
19692
19693         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19694         signal SimpleName to only resolve type names and not attempt to
19695         resolve anything else.
19696
19697         * expression.cs (Cast): Set the flag.
19698
19699         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19700
19701         * class.cs: Only report 108 if there is no `new' modifier.
19702
19703         * cs-parser.jay: rework foreach statement to work with the new
19704         changes to the policy on SimpleNames.
19705
19706         * report.cs: support Stacktrace on warnings as well.
19707
19708         * makefile: drop --unsafe and /unsafe from the compile.
19709
19710 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
19711
19712         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19713         lookups here, instead of doing that at parse time.  This means
19714         that our grammar will not introduce `LocalVariableReferences' as
19715         expressions at this point.  That solves the problem of code like
19716         this:
19717
19718         class X {
19719            static void Main ()
19720            { int X = 1;
19721             { X x = null }}}
19722
19723         This is only half the fix.  The full fix requires parameters to
19724         also be handled in this way.
19725
19726         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19727         makes the use more obvious of the DeclSpace.  The
19728         ec.TypeContainer.TypeBuilder is now only used to pull the
19729         TypeBuilder for it.
19730
19731         My theory is that I can get rid of the TypeBuilder completely from
19732         the EmitContext, and have typecasts where it is used (from
19733         DeclSpace to where it matters).  
19734
19735         The only pending problem is that the code that implements Aliases
19736         is on TypeContainer, and probably should go in DeclSpace.
19737
19738         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19739         lookups here, instead of doing that at parse time.  This means
19740         that our grammar will not introduce `LocalVariableReferences' as
19741         expressions at this point.  That solves the problem of code like
19742         this:
19743
19744         class X {
19745            static void Main ()
19746            { int X = 1;
19747             { X x = null }}}
19748
19749         This is only half the fix.  The full fix requires parameters to
19750         also be handled in this way.
19751
19752         * class.cs (Property.DefineMethod): When implementing an interface
19753         method, set newslot, when implementing an abstract method, do not
19754         set the flag (before we tried never setting it, or always setting
19755         it, which is the difference).
19756         (Indexer.DefineMethod): same.
19757         (Method.DefineMethod): same.
19758
19759         * ecore.cs: Only set the status used flag if we get back a Field.
19760
19761         * attribute.cs: Temporary hack, so Paolo can keep working.
19762
19763 2002-03-08  Ravi Pratap  <ravi@ximian.com>
19764
19765         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19766         the unmanaged type in the case we have a MarshalAs attribute.
19767
19768         (Resolve): Handle the case when we are parsing the special MarshalAs
19769         attribute [we need to store the unmanaged type to use later]
19770
19771         * typemanager.cs (marshal_as_attr_type): Built in type for the 
19772         MarshalAs Attribute.
19773
19774         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
19775         on parameters and accordingly set the marshalling info.
19776
19777 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
19778
19779         * class.cs: Optimizing slightly by removing redundant code after
19780         we switched to the `NoTypes' return value.
19781         (Property.DefineMethod): use NoTypes here too.
19782
19783         This fixes the bug I introduced in my last batch of changes.
19784
19785 2002-03-05  Ravi Pratap  <ravi@ximian.com>
19786
19787         * tree.cs (RecordEnum): Add. We now keep track of enums too.
19788
19789         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19790         Enums since those are types too. 
19791
19792         * cs-parser.jay (enum_declaration): Record enums as we parse them.
19793
19794         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
19795         thanks to a call during the lookup process.
19796
19797 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
19798
19799         * statement.cs (Foreach): Lots of work to accomodate a particular
19800         kind of foreach statement that I had not kept in mind.  It is
19801         possible to have foreachs on classes that provide a GetEnumerator
19802         method that return objects that implement the "pattern" for using
19803         a foreach, there is no need to support GetEnumerator
19804         specifically. 
19805
19806         This is needed to compile nant.
19807
19808         * decl.cs: Only report 114 if the member is not `Finalize' and if
19809         the warning level is at least 2.
19810
19811         * class.cs: Moved the compare function from Method to
19812         MethodSignature. 
19813
19814         (MethodSignature.InheritableMemberSignatureCompare): Add new
19815         filter function that is used to extract inheritable methods from a
19816         class. 
19817
19818         (Method.Define): Use the new `inheritable_method_signature_filter'
19819         delegate
19820
19821         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
19822         command. 
19823
19824 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
19825
19826         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
19827
19828         * cs-parser.jay: Add opt_semicolon to the interface declaration.
19829
19830         * expression.cs: Pass location information to
19831         ConvertImplicitStandard. 
19832
19833         * class.cs: Added debugging code to track return values from
19834         interfaces. 
19835
19836 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
19837
19838         * expression.cs (Is.DoResolve): If either side of the `is' is an
19839         interface, do not flag the warning.
19840
19841         * ecore.cs (ImplicitReferenceConversion): We need a separate test
19842         for interfaces
19843
19844         * report.cs: Allow for --fatal to be used with --probe.
19845
19846         * typemanager.cs (NoTypes): Move the definition for the empty Type
19847         array here. 
19848
19849         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
19850         properties. 
19851         (TypeContainer.DefineProxy): New function used to proxy to parent
19852         implementations when implementing interfaces.
19853         (TypeContainer.ParentImplements): used to lookup if our parent
19854         implements a public function that is required by an interface.
19855         (TypeContainer.VerifyPendingMethods): Hook this up.
19856
19857         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
19858         `modules' and `assemblies' arraylists into arrays.  We only grow
19859         these are the very early start up of the program, so this improves
19860         the speedof LookupType (nicely measured).
19861
19862         * expression.cs (MakeByteBlob): Replaced unsafe code with
19863         BitConverter, as suggested by Paolo.
19864
19865         * cfold.cs (ConstantFold.Binary): Special case: perform constant
19866         folding of string concatenation, but if either side is a string,
19867         and the other is not, then return null, and let the runtime use
19868         the concatenation on the string plus the object (using
19869         `Object.ToString'). 
19870
19871 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
19872
19873         Constant Folding has been implemented now.
19874
19875         * expression.cs (Unary.Reduce): Do not throw an exception, catch
19876         the error instead on types that are not supported in one's
19877         complement. 
19878
19879         * constant.cs (Constant and all children): New set of functions to
19880         perform implict and explicit conversions.
19881
19882         * ecore.cs (EnumConstant): Implement the new functions to perform
19883         conversion by proxying to the child expression.
19884
19885         * codegen.cs: (ConstantCheckState): Constant evaluation has its
19886         own separate setting that can not be turned off from the command
19887         line using --unchecked or --checked and is only controlled using
19888         the checked/unchecked statements and expressions.  This setting is
19889         used by the constant folder to flag errors.
19890
19891         * expression.cs (CheckedExpr, UncheckedExpr): Set the
19892         ConstantCheckState as well.   
19893
19894         During Resolve, they also have to flag the state, because the
19895         constant folder runs completely in the Resolve phase.
19896
19897         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
19898         well.
19899
19900 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
19901
19902         * cfold.cs: New file, this file contains the constant folder.
19903
19904         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
19905         argument to track whether we are using the resulting address to
19906         load or store a value and provide better error messages. 
19907
19908         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
19909         new AddressOf arguments.
19910
19911         * statement.cs (Foreach.EmitCollectionForeach): Update
19912
19913         * expression.cs (Argument.Emit): Call AddressOf with proper
19914         arguments to track usage.
19915
19916         (New.DoEmit): Call AddressOf with new arguments.
19917
19918         (Unary.Emit): Adjust AddressOf call.
19919
19920 2002-03-01  Ravi Pratap  <ravi@ximian.com>
19921
19922         * cs-parser.jay (member_access): Change the case for pre-defined types
19923         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
19924         this suggestion.
19925
19926         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
19927         a method body.
19928
19929         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
19930         essentially like methods and apply attributes like MethodImplOptions to them too.
19931
19932         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
19933         not being null.
19934
19935         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
19936         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
19937         is the DeclSpace.
19938
19939         * Update code everywhere accordingly.
19940
19941         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
19942
19943         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
19944
19945 2002-02-28  Ravi Pratap  <ravi@ximian.com>
19946
19947         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
19948         try performing lookups against those instead of jumping straight into using
19949         the 'using' clauses.
19950
19951         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
19952
19953         (LookupType): Perform lookups in implicit parents too.
19954
19955         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
19956         sequence as RootContext.LookupType. 
19957
19958         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
19959         the various cases of namespace lookups into this method.
19960
19961 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
19962
19963         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
19964         in positional arguments)
19965
19966         * class.cs (Operator): Update the AllowedModifiers to contain
19967         extern. 
19968
19969         * cs-parser.jay: Update operator declaration to allow for the
19970         operator body to be empty.
19971
19972         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
19973         values. 
19974
19975 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
19976
19977         * class.cs (Method.Emit): Label parameters.
19978
19979         * driver.cs: Return 1 or 0 as the program exit code.
19980
19981 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
19982
19983         * expression.cs: Special case the `null' object when trying to
19984         auto-compute the type, as anything can be explicitly converted to
19985         that. 
19986
19987         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
19988         spotting this Paolo.
19989
19990         (Expression.ImplicitNumericConversion): Perform comparissions of
19991         the type using the underlying type in the case of an enumeration
19992         rather than using the enumeration type for the compare.
19993
19994         Cope with the underlying == type case, which is not possible to
19995         catch before. 
19996
19997         (Expression.ConvertNumericExplicit): Perform comparissions of
19998         the type using the underlying type in the case of an enumeration
19999         rather than using the enumeration type for the compare.
20000
20001         * driver.cs: If the user does not supply an extension, assume .exe
20002
20003         * cs-parser.jay (if_statement): Rewrote so that we can track the
20004         location for the if statement.
20005
20006         * expression.cs (Binary.ConstantFold): Only concat strings when
20007         the operation is "+", not everything ;-)
20008
20009         * statement.cs (Statement.EmitBoolExpression): Take a location
20010         argument. 
20011         (If, While, Do): Track location.
20012
20013         * expression.cs (Binary.ResolveOperator): In the object + string
20014         case, I was missing a call to ConvertImplicit
20015
20016 2002-02-25  Ravi Pratap  <ravi@ximian.com>
20017
20018         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
20019         Location arguments. Ensure we use RootContext.LookupType to do our work
20020         and not try to do a direct Type.GetType and ModuleBuilder.GetType
20021
20022         * interface.cs (PopulateMethod): Handle the type of the parameter being
20023         null gracefully.
20024
20025         * expression.cs (Invocation.BetterFunction): Handle the case when we 
20026         have a params method with no fixed arguments and a call is made with no
20027         arguments.
20028
20029 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
20030
20031         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
20032         the verbatim-string-literal
20033
20034         * support.cs (InternalParameters.ParameterModifier): handle null
20035         fixed parameters.
20036         (InternalParameters.ParameterType): ditto.
20037
20038         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
20039         duplicating the name of the variable parameter.
20040         (GetParameterByName): Fix bug where we were not looking up array
20041         paramters if they were the only present (thanks Paolo!).
20042         (GetParameterInfo): We only have an empty set of types if both
20043         fixed and array are set to null.
20044         (GetParameterInfo-idx): Handle FixedParameter == null
20045
20046         * cs-parser.jay: Handle the case where there is no catch
20047         statements (missing null test).
20048
20049 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
20050
20051         * driver.cs (MainDriver): Be conservative on our command line
20052         handling.
20053
20054         Catch DirectoryNotFoundException when calling GetFiles.
20055
20056         (SplitPathAndPattern): Used to split the input specification into
20057         a path and a pattern that we can feed to Directory.GetFiles.
20058
20059 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
20060
20061         * statement.cs (Fixed): Implement the last case of the Fixed
20062         statement (string handling).
20063
20064         * expression.cs (StringPtr): New class used to return a char * to
20065         a string;  Used by the Fixed statement.
20066
20067         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
20068
20069         * expression.cs (Binary.ResolveOperator): Remove redundant
20070         MemberLookup pn parent type.
20071         Optimize union call, we do not need a union if the types are the same.
20072         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
20073         type.
20074
20075         Specialize the use of MemberLookup everywhere, instead of using
20076         the default settings. 
20077
20078         (StackAlloc): Implement stackalloc keyword.
20079
20080         * cs-parser.jay: Add rule to parse stackalloc.
20081
20082         * driver.cs: Handle /h, /help, /?
20083
20084         * expression.cs (MakeByteBlob): Removed the hacks we had in place
20085         before we supported unsafe code.
20086
20087         * makefile: add --unsafe to the self compilation of mcs.
20088
20089 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
20090
20091         * expression.cs (PointerArithmetic): New class that is used to
20092         perform pointer arithmetic.
20093         (Binary.Resolve): Handle pointer arithmetic
20094         Handle pointer comparission.
20095         (ArrayPtr): Utility expression class that is used to take the
20096         address of an array.
20097
20098         (ElementAccess): Implement array access for pointers
20099
20100         * statement.cs (Fixed): Implement fixed statement for arrays, we
20101         are missing one more case before we are done.
20102
20103         * expression.cs (Indirection): Implement EmitAssign and set the
20104         ExprClass to Variable.  This allows pointer dereferences to be
20105         treated as variables, and to have values assigned to them.
20106
20107         * ecore.cs (Expression.StoreFromPtr): New utility function to
20108         store values dereferencing.
20109
20110 2002-02-20  Ravi Pratap  <ravi@ximian.com>
20111
20112         * expression.cs (Binary.ResolveOperator): Ensure that we are
20113         not trying to operate on a void type - this fixes the reported
20114         bug.
20115
20116         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
20117         the parent implementation is sealed.
20118
20119         * ../errors/cs0239.cs : Add.
20120
20121         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
20122
20123         * typemanager.cs (unverifiable_code_type): Corresponds to 
20124         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
20125         which have unsafe code in them.
20126
20127         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
20128         unsafe context.
20129
20130 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
20131
20132         * cs-tokenizer.cs: Add support for @"litreal strings"
20133
20134         Make tokenizer accept pre-processor directives
20135         on any column (remove the old C-like limitation). 
20136
20137         * rootcontext.cs (EmitCode): Emit any global attributes.
20138         (AddGlobalAttributes): Used to keep track of assembly attributes. 
20139
20140         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
20141
20142         * cs-parser.jay: Add support for global attributes.  
20143
20144 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
20145
20146         * expression.cs (Indirection): New helper class.  Unary will
20147         create Indirection classes to be able to implement the
20148         IMemoryLocation interface on it.
20149
20150 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
20151
20152         * cs-parser.jay (fixed_statement): reference the right statement.
20153
20154         * statement.cs (Fixed.Emit): Finish implementing the fixed
20155         statement for the &x case.
20156
20157 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
20158
20159         * class.cs (Property.Define, Method.Define): Remove newslot when
20160         `implementing'.  
20161
20162         * modifiers.cs: My use of NewSlot when `Abstract' was set was
20163         wrong.  NewSlot should only be used if the `new' keyword is present.
20164
20165         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
20166         locating our system dir.  Sorry about this.
20167
20168 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20169
20170         * driver.cs (GetSystemDir): Compute correctly the location of our
20171         system assemblies.  I was using the compiler directory instead of
20172         the library directory.
20173
20174 2002-02-13  Ravi Pratap  <ravi@ximian.com>
20175
20176         * expression.cs (BetterFunction): Put back in what Miguel commented out
20177         since it is the correct fix. The problem is elsewhere ;-)
20178
20179         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
20180         parameters of the parms method are themselves compatible or not !
20181
20182         (StandardConversionExists): Fix very dangerous bug where we were forgetting
20183         to check that a class implements an interface before saying that an implicit
20184         conversion was allowed. Use ImplementsInterface to do the checking.
20185
20186 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20187
20188         * class.cs (Method.Define): Track whether we are an explicit
20189         implementation or not.  And only call DefineMethodOverride if we
20190         are an explicit implementation.
20191
20192         (Property.DefineMethod): Ditto.
20193
20194 2002-02-11  Ravi Pratap  <ravi@ximian.com>
20195
20196         * expression.cs (BetterFunction): Catch hideous bug which was
20197          preventing us from detecting ambiguous calls due to implicit casts i.e
20198         cs0121.
20199
20200 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
20201
20202         * support.cs (Pair): Remove un-needed method.  I figured why I was
20203         getting the error in cs-parser.jay, the variable in a foreach loop
20204         is readonly, and the compiler does not really treat this as a variable.
20205
20206         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
20207         instead of EQUALS in grammar.  
20208
20209         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
20210
20211         * expression.cs (Unary.DoResolve): Check whether the argument is
20212         managed or not.
20213
20214 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
20215
20216         * support.cs: Api for Pair to set a value.  Despite the fact that
20217         the variables are public the MS C# compiler refuses to compile
20218         code that accesses the field if the variable is part of a foreach
20219         statement. 
20220
20221         * statement.cs (Fixed): Begin implementation of the fixed
20222         statement.
20223
20224         (Block.AddVariable): Return the VariableInfo on success and null
20225         on failure instead of true/false. 
20226
20227         * cs-parser.jay (foreach): Catch errors on variables already
20228         defined (we were ignoring this value before) and properly unwind
20229         the block hierarchy
20230
20231         (fixed_statement): grammar for the fixed statement.
20232
20233 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
20234
20235         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
20236         pointer types to be incretemented.
20237
20238         (SizeOf): Implement.
20239
20240         * cs-parser.jay (pointer_member_access): Implement
20241         expr->IDENTIFIER production.
20242
20243         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
20244         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
20245         on safe contexts.
20246
20247         (Unary): Implement indirection.
20248
20249         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
20250         use in non-unsafe context).
20251
20252         (SimpleName.DoResolve): Check for pointers in field access on safe
20253         contexts. 
20254
20255         (Expression.LoadFromPtr): Factor the load-indirect code in this
20256         function.  This was duplicated in UnboxCast and ParameterReference
20257
20258 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
20259
20260         * expression.cs (ComposedCast): report an error if a pointer cast
20261         is used in a safe region.
20262
20263         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
20264         pointer type casts in unsafe context.
20265
20266         * codegen.cs (EmitContext): Set up IsUnsafe.
20267
20268         * cs-parser.jay (non_expression_type): Add productions for pointer
20269         casts. 
20270
20271         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
20272         code.  We should not use force into static mode if the method is
20273         not virtual.  Fixes bug in MIS
20274
20275         * statement.cs (Do.Emit, While.Emit, For.Emit,
20276         Statement.EmitBoolExpression): Add support to Do and While to
20277         propagate infinite loop as `I do return' semantics.
20278
20279         Improve the For case to also test for boolean constants.
20280
20281         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
20282         to the list of attributes we can add.
20283
20284         Remove `EmitContext' argument.
20285
20286         * class.cs (Method.Define): Apply parameter attributes.
20287         (Constructor.Define): Apply parameter attributes.
20288         (MethodCore.LabelParameters): Move here the core of labeling
20289         parameters. 
20290
20291         * support.cs (ReflectionParameters.ParameterModifier,
20292         InternalParameters.ParameterModifier): Use IsByRef on the type and
20293         only return the OUT bit for these parameters instead of in/out/ref
20294         flags.
20295
20296         This is because I miss-understood things.  The ParameterInfo.IsIn
20297         and IsOut represent whether the parameter has the [In] and [Out]
20298         attributes set.  
20299
20300 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
20301
20302         * ecore.cs (FieldExpr.Emit): Release temporaries.
20303
20304         * assign.cs (LocalTemporary.Release): new function.
20305
20306         * codegen.cs (EmitContext.GetTemporaryStorage,
20307         EmitContext.FreeTemporaryStorage): Rework the way we deal with
20308         temporary storage.  Now we can "put back" localbuilders when we
20309         are done with them
20310
20311 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
20312
20313         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
20314         need to make a copy of the variable to generate verifiable code.
20315
20316 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
20317
20318         * driver.cs: Compute dynamically the system directory.
20319
20320         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
20321         Slower, but more generally useful.  Used by the abstract
20322         registering implementation. 
20323
20324         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
20325         the rules for the special rule on Type/instances.  First check if
20326         we have the same name, and if so, try that special static path
20327         rather than the instance path.
20328
20329 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
20330
20331         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
20332         for, while and if.
20333
20334         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
20335         Enum, ValueType, Delegate or Array for non-corlib compiles.
20336
20337         * cs-tokenizer.cs: Catch long identifiers (645)
20338
20339         * typemanager.cs (IndexerPropetyName): Ravi never tested this
20340         piece of code.
20341
20342         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
20343         fix, we were returning too early, so we were not registering
20344         pending methods from abstract classes.
20345
20346         Do not register pending methods if the class is abstract.
20347
20348         * expression.cs (Conditional.DoResolve): Report circular implicit
20349         conversions when we neecd to compute it for conditional
20350         expressions. 
20351
20352         (Is.DoResolve): If the expression is always of the provided type,
20353         flag warning 183.  If the expression can not ever be of the
20354         provided type flag warning 184.
20355
20356         * class.cs: Catch 169 as well.
20357
20358         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
20359         read. 
20360
20361 2002-01-18  Nick Drochak  <ndrochak@gol.com>
20362
20363         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
20364
20365 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
20366
20367         * interface.cs: (PopulateMethod): Check for pointers being defined
20368         only if the unsafe context is active.
20369         (PopulateProperty): ditto.
20370         (PopulateIndexer): ditto.
20371
20372         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
20373         specified.  If pointers are present, make sure that they are
20374         present in an unsafe context.
20375         (Constructor, Constructor.Define): ditto.
20376         (Field, Field.Define): ditto.
20377         (Property, Property.Define): ditto.
20378         (Event, Event.Define): ditto.
20379
20380         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
20381         hashtable if there are classes or structs defined.
20382
20383         * expression.cs (LocalVariableReference.DoResolve): Simplify this
20384         code, as the constant resolution moved.
20385
20386         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
20387         the metadata, so we can flag error 133. 
20388
20389         * decl.cs (MemberCore.UnsafeOK): New function to test that a
20390         pointer is being declared in an unsafe context.
20391
20392 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
20393
20394         * modifiers.cs (Modifiers.Check): Require a Location argument.
20395         Report error 227 for Unsafe use.
20396
20397         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
20398
20399         * statement.cs (For.Emit): If the test is null, then report that
20400         we do `return', as we wont reach anything afterwards.
20401
20402         (Switch.SwitchGoverningType): Track the expression that matched
20403         the conversion.
20404
20405         * driver.cs: Allow negative numbers as an error code to flag.
20406
20407         * cs-parser.jay: Handle 1551.
20408
20409         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
20410
20411 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20412
20413         * cs-parser.jay: Report 1518 (type declaration can only contain
20414         class, struct, interface, enum or delegate)
20415
20416         (switch_label): Report 1523 (keywords `case' or `default' must
20417         preced code)
20418
20419         (opt_switch_sections): Report 1522 (empty switch)
20420
20421         * driver.cs: Report 1515 (response file specified multiple times)
20422         Report 1516 (Source file specified multiple times).
20423
20424         * expression.cs (Argument.Resolve): Signal 1510
20425
20426         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
20427         access not allowed in static code)
20428
20429 2002-01-11  Ravi Pratap  <ravi@ximian.com>
20430
20431         * typemanager.cs (IsPointerType): Utility method which we are going
20432         to need a lot.
20433
20434         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
20435         the object type, so we take care of that.
20436
20437         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
20438
20439         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
20440         added to non-params parameters :-)
20441
20442         * typemanager.cs (CSharpName): Include 'void' type too. 
20443
20444         (void_ptr_type): Include in the set of core types.
20445
20446         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
20447         duplicating code.
20448
20449         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
20450         an unsafe context.
20451
20452         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
20453         completely forgotten about it.
20454
20455 2002-01-10  Ravi Pratap  <ravi@ximian.com>
20456
20457         * cs-parser.jay (pointer_type): Add. This begins our implementation
20458         of parsing rules for unsafe code.
20459
20460         (unsafe_statement): Implement.
20461
20462         (embedded_statement): Modify to include the above.
20463
20464         * statement.cs (Unsafe): Implement new class for unsafe blocks.
20465
20466         * codegen.cs (EmitContext.InUnsafe): Add. This determines
20467         if the current context is an unsafe one.
20468
20469         * cs-parser.jay (local_variable_pointer_type): Since local variable types
20470         are handled differently, we need separate rules for them.
20471
20472         (local_variable_declaration): Update to use local_variable_pointer_type
20473         to allow variable declarations of unmanaged pointer types.
20474
20475         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
20476         in unsafe contexts.
20477
20478         * ../errors/cs0214.cs : Add.
20479
20480 2002-01-16  Nick Drochak  <ndrochak@gol.com>
20481
20482         * makefile: remove 'response' file when cleaning.
20483
20484 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20485
20486         * cs-parser.jay: Report 1524.
20487
20488 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
20489
20490         * typemanager.cs (RegisterMethod): drop checking if we have
20491         registered this from here
20492
20493 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
20494
20495         * class.cs (Method.EmitDestructor): Implement calling our base
20496         destructor. 
20497
20498         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20499         value of InFinally.
20500
20501         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20502         this routine and will wrap the call in a try/catch block.  Deal
20503         with the case.
20504
20505 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
20506
20507         * ecore.cs (Expression.MemberLookup): instead of taking a
20508         parameter `same_type' that was used to tell whether we could
20509         access private members we compute our containing type from the
20510         EmitContext.
20511
20512         (FieldExpr): Added partial support for volatile fields.  This does
20513         not work for volatile fields exposed from assemblies, as I can not
20514         figure out how to extract the modreq from it.
20515
20516         Updated all the source files to use this.
20517
20518         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20519         because it is referenced by MemberLookup very often. 
20520
20521 2002-01-09  Ravi Pratap  <ravi@ximian.com>
20522
20523         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20524         TypeBuilder.GetCustomAttributes to retrieve what we need.
20525
20526         Get rid of redundant default_member_attr_type as this is the same as
20527         default_member_type which already exists.
20528
20529         * interface.cs, attribute.cs : Update accordingly.
20530
20531 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
20532
20533         * typemanager.cs: Enable IndexerPropertyName again.  It does not
20534         work for TYpeBuilders though.  Ravi, can you please fix this?
20535
20536         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20537
20538         * expression.cs (Argument.Emit): Handle the case of ref objects
20539         being passed to ref functions;  
20540
20541         (ParameterReference.EmitLoad): Loads the content of the pointer
20542         without dereferencing.
20543
20544 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20545
20546         * cs-tokenizer.cs: Implemented the pre-processing expressions.
20547
20548 2002-01-08  Ravi Pratap  <ravi@ximian.com>
20549
20550         * class.cs (Indexer.DefineMethod): Incorporate the interface
20551         type in the name of the method if we are doing explicit interface
20552         implementation.
20553
20554         * expression.cs (ConversionExists): Remove as it is completely obsolete.
20555
20556         (BetterConversion): Fix extremely trivial bug where we were referring to
20557         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
20558         again !
20559
20560         * ../errors/bug16.cs : Add although we have fixed it.
20561
20562 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20563
20564         * expression.cs (BaseIndexer): Begin implementation.
20565
20566         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
20567
20568         * cs-parser.jay (indexer_declarator): Use qualified_identifier
20569         production directly to remove a shift/reduce, and implement
20570         explicit interface implementation.
20571
20572         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
20573         after a floating point suffix.
20574
20575         * expression.cs (DoNumericPromotions): Improved the conversion for
20576         uint/uint.  If we have a constant, we avoid doing a typecast to a
20577         larger type.
20578
20579         * class.cs (Indexer): Implement explicit interface implementation
20580         for indexers.
20581
20582 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20583
20584         * class.cs: make the default instance constructor public and hidebysig.
20585
20586 2001-01-03  Ravi Pratap  <ravi@ximian.com>
20587
20588         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20589         so we can call it from elsewhere.
20590
20591         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20592         we emit it internally if the class has a defined indexer; otherwise the user
20593         emits it by decorating the class definition with the DefaultMemberAttribute.
20594
20595         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20596         attribute is not used on a type which defines an indexer.
20597
20598         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20599         character when we skip whitespace.
20600
20601         * ../errors/cs0646.cs : Add.
20602
20603 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
20604
20605         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20606         again. 
20607
20608         * makefile: Add practical target `mcs3.exe' which builds the third
20609         generation compiler. 
20610
20611         * expression.cs (New): Fix structures constructor calling.
20612
20613         * class.cs (Property, Method, Indexer): Emit Final flag on the
20614         method if we are an interface implementation and we are not
20615         abstract. 
20616
20617         * ecore.cs (PropertyExpr): New public field `IsBase', tells
20618         whether this property is referencing a `base' method.
20619
20620         * expression.cs (Invocation.EmitCall): take an extra argument:
20621         is_base, this is used to determine whether the `call' or
20622         `callvirt' opcode should be used.
20623
20624
20625         * delegate.cs: update EmitCall.
20626
20627         * class.cs (Method.Define): Set NewSlot for the cases where we are
20628         not implementing an interface method.
20629
20630         (Property.Define): ditto.
20631
20632 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
20633
20634         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20635         'r'.  Allows mcs to parse itself fully.
20636
20637 2002-01-02  Ravi Pratap  <ravi@ximian.com>
20638
20639         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20640         of the number of initializers that require the InitializeArray method.
20641
20642         (CheckIndices): Store the Expression in all cases - not the plain value. Also
20643         update the above field where necessary.
20644
20645         (MakeByteBlob): Update accordingly.
20646
20647         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
20648         greater than 2.
20649
20650         (EmitDynamicInitializers): Update in accordance with the new optimization.
20651
20652         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20653         same OpCode applies.
20654
20655         * cs-parser.jay : Fix some glaring errors I introduced.
20656
20657 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
20658
20659         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20660         so that we can check for name clashes there too.
20661
20662         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20663         for interface indexers.
20664
20665         * interfaces.cs (Define): Emit the default member attribute.
20666
20667         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20668         variable was being referred to while setting the value ;-)
20669
20670 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
20671
20672         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20673         byte-by-byte information when we know the data is zero.
20674
20675         Make the block always a multiple of 4, because
20676         DefineInitializedData has a bug.
20677
20678         * assign.cs: Fix, we should assign from the temporary, not from
20679         the source. 
20680
20681         * expression.cs (MakeByteBlob): Fix my incorrect code.
20682
20683 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
20684
20685         * typemanager.cs (EnumToUnderlying): This function is used to get
20686         the underlying type from an enumeration, because it does not
20687         always work. 
20688
20689         * constant.cs: Use the I4_S form for values between -128 and 127.
20690
20691         * statement.cs (Block.LookupLabel): Looks up a label.
20692         (Block): Drop support for labeled blocks.
20693
20694         (LabeledStatement): New kind of statement that represents a label
20695         only.
20696
20697         (Goto): Finally implement this bad boy.
20698
20699         * cs-parser.jay: Update to reflect new mechanism to implement
20700         labels.
20701
20702 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
20703
20704         * codegen.cs (EmitContext.This): a codegen property that keeps the
20705         a single instance of this instead of creating many different this
20706         instances. 
20707
20708         * delegate.cs (Delegate.DoResolve): Update to use the property;
20709
20710         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
20711
20712         * expression.cs (BaseAccess.DoResolve): Ditto.
20713
20714 2001-12-29  Ravi Pratap  <ravi@ximian.com>
20715
20716         * typemanager.cs (methodimpl_attr_type): Add to hold the type
20717         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20718
20719         (InitCoreTypes): Update accordingly.
20720
20721         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20722         so we can quickly store the state.
20723
20724         (ApplyAttributes): Set the correct implementation flags
20725         for InternalCall methods.
20726
20727 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
20728
20729         * expression.cs (EmitCall): if a method is not virtual, then do
20730         not use callvirt on it.
20731
20732         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20733         user defined stuff) requires the use of stobj, which takes an
20734         address on the stack instead of an array and an index.  So emit
20735         the Ldelema operation for it.
20736
20737         (EmitStoreOpcode): Use stobj for valuetypes.
20738
20739         (UnaryMutator.EmitCode): Use the right 1 value depending on
20740         whether we are dealing with int64/uint64, float or doubles.
20741
20742         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20743         constructors that I implemented last night.
20744
20745         (Constructor.IsDefault): Fix to work properly for static
20746         constructors.
20747
20748         * cs-parser.jay (CheckDef): report method signature errors.
20749         Update error number 103 to be 132.
20750
20751         * decl.cs: New AdditionResult enumeration value: MethodExists.
20752         Although we do this check for methods later on in the semantic
20753         analysis, catching repeated default constructors is so easy that
20754         we catch these here. 
20755
20756         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20757         promotions code.
20758
20759         (ParameterReference.EmitAssign, Emit): handle
20760         bools as bytes.
20761
20762         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20763         (ArrayAccess.EmitStoreOpcode): ditto.
20764
20765         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20766
20767         * expression.cs (MakeByteBlob): Complete all the missing types
20768         (uint, short, ushort, byte, sbyte)
20769
20770         * class.cs: Only init instance field initializers on instance
20771         constructors. 
20772
20773         Rename `constructors' to instance_constructors. 
20774
20775         (TypeContainer.AddConstructor): Only add constructors to the list
20776         if it is not static.
20777
20778         Make sure that we handle default_static_constructor independently
20779         everywhere where we handle instance_constructors
20780
20781 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
20782
20783         * class.cs: Do not lookup or create a base initializer for a
20784         static constructor.
20785
20786         (ConstructorInitializer.Resolve): use the proper type to lookup
20787         for constructors.
20788
20789         * cs-parser.jay: Report error 1585 (modifiers between type and name).
20790
20791         * enum.cs, interface.cs: Remove CloseType, this is taken care by
20792         in DeclSpace. 
20793
20794         * decl.cs: CloseType is now an virtual method, the default
20795         implementation just closes this type.
20796
20797 2001-12-28  Ravi Pratap  <ravi@ximian.com>
20798
20799         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
20800         to PreserveSig by default. Also emit HideBySig on such methods.
20801
20802         Basically, set the defaults to standard values.
20803
20804         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
20805         argument, if candidate is better, it can't be worse than the best !
20806
20807         (Invocation): Re-write bits to differentiate between methods being
20808         applicable in their expanded form and their normal form - for params
20809         methods of course.
20810
20811         Get rid of use_standard everywhere as only standard conversions are allowed
20812         in overload resolution. 
20813
20814         More spec conformance.
20815
20816 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20817
20818         * driver.cs: Add --timestamp, to see where the compiler spends
20819         most of its time.
20820
20821         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
20822         `this' in static code.
20823
20824         (SimpleName.DoResolve): Implement in terms of a helper function
20825         that allows static-references to be passed upstream to
20826         MemberAccess.
20827
20828         (Expression.ResolveWithSimpleName): Resolve specially simple
20829         names when called by MemberAccess to implement the special
20830         semantics. 
20831
20832         (Expression.ImplicitReferenceConversion): Handle conversions from
20833         Null to reference types before others, as Null's type is
20834         System.Object. 
20835
20836         * expression.cs (Invocation.EmitCall): Handle the special case of
20837         calling methods declared on a reference type from a ValueType
20838         (Base classes System.Object and System.Enum)
20839
20840         (MemberAccess.Resolve): Only perform lookups on Enumerations if
20841         the left hand side is a TypeExpr, not on every enumeration. 
20842
20843         (Binary.Resolve): If types are reference types, then do a cast to
20844         object on operators != and == of both arguments.
20845
20846         * typemanager.cs (FindMembers): Extract instance and static
20847         members if requested.
20848
20849         * interface.cs (PopulateProperty): Use void_type instead of null
20850         as the return type for the setter method.
20851
20852         (PopulateIndexer): ditto.
20853
20854 2001-12-27  Ravi Pratap  <ravi@ximian.com>
20855
20856         * support.cs (ReflectionParameters): Fix minor bug where we
20857         were examining the wrong parameter for the ParamArray attribute.
20858
20859         Cope with requests for the type of the parameter at position
20860         greater than the params parameter's. We now return the element
20861         type of the params array as that makes more sense.
20862
20863         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
20864         accordingly as we no longer have to extract the element type
20865         ourselves.
20866
20867         (Invocation.OverloadResolve): Update.
20868
20869 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20870
20871         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
20872         against IEnumerator, test whether the return value is a descendant
20873         of the IEnumerator interface.
20874
20875         * class.cs (Indexer.Define): Use an auxiliary method to implement
20876         the other bits of the method definition.  Begin support for
20877         explicit interface implementation.
20878
20879         (Property.DefineMethod): Use TypeManager.void_type instead of null
20880         for an empty return value.
20881
20882 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
20883
20884         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
20885         dealing with a FieldExpr which is composed of a FieldBuilder, in
20886         the code path we did extract the constant, but we should have
20887         obtained the underlying value to be able to cast it (otherwise we
20888         end up in an infinite loop, this is what Ravi was running into).
20889
20890         (ArrayCreation.UpdateIndices): Arrays might be empty.
20891
20892         (MemberAccess.ResolveMemberAccess): Add support for section
20893         14.5.4.1 that deals with the special case of E.I when E is a type
20894         and something else, that I can be a reference to a static member.
20895
20896         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
20897         handle a particular array type to create byte blobs, it is just
20898         something we dont generate byteblobs for.
20899
20900         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
20901         arguments. 
20902
20903         * location.cs (Push): remove the key from the hashtable that we
20904         are about to add.   This happens for empty files.
20905
20906         * driver.cs: Dispose files after we have parsed them.
20907
20908         (tokenize): new function that only runs the tokenizer on its
20909         input, for speed testing.
20910
20911 2001-12-26  Ravi Pratap  <ravi@ximian.com>
20912
20913         * class.cs (Event.Define): Define the private field only if there
20914         are no accessors defined.
20915
20916         * expression.cs (ResolveMemberAccess): If there is no associated
20917         field with the event, that means we have an event defined with its
20918         own accessors and we should flag error cs0070 since transforming
20919         ourselves into a field is not valid in that case.
20920
20921         * ecore.cs (SimpleName.DoResolve): Same as above.
20922
20923         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
20924         and charset to sane values.
20925
20926 2001-12-25  Ravi Pratap  <ravi@ximian.com>
20927
20928         * assign.cs (DoResolve): Perform check on events only if they 
20929         are being accessed outside the declaring type.
20930
20931         * cs-parser.jay (event_declarations): Update rules to correctly
20932         set the type of the implicit parameter etc.
20933
20934         (add_accessor, remove_accessor): Set current local parameters.
20935
20936         * expression.cs (Binary): For delegate addition and subtraction,
20937         cast the return value from the method into the appropriate delegate
20938         type.
20939
20940 2001-12-24  Ravi Pratap  <ravi@ximian.com>
20941
20942         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
20943         of these as the workaround is unnecessary.
20944
20945         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
20946         delegate data - none of that is needed at all.
20947
20948         Re-write bits to extract the instance expression and the delegate method
20949         correctly.
20950
20951         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
20952         on delegates too.
20953
20954         * attribute.cs (ApplyAttributes): New method to take care of common tasks
20955         of attaching attributes instead of duplicating code everywhere.
20956
20957         * everywhere : Update code to do attribute emission using the above method.
20958
20959 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
20960
20961         * expression.cs (IsParamsMethodApplicable): if there are not
20962         parameters, return immediately.
20963
20964         * ecore.cs: The 0 literal can be implicity converted to an enum
20965         type. 
20966
20967         (SimpleName.DoResolve): First lookup the type, then lookup the
20968         members. 
20969
20970         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
20971         want to get its address.  If the InstanceExpression is not
20972         addressable, store the result in a temporary variable, then get
20973         the address of it.
20974
20975         * codegen.cs: Only display 219 errors on warning level or above. 
20976
20977         * expression.cs (ArrayAccess): Make it implement the
20978         IMemoryLocation interface.
20979
20980         (Binary.DoResolve): handle the operator == (object a, object b)
20981         and operator != (object a, object b) without incurring into a
20982         BoxedCast (because 5 != o should never be performed).
20983
20984         Handle binary enumerator operators.
20985
20986         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
20987         value type, otherwise use Ldelem_ref.
20988
20989         Use precomputed names;
20990
20991         (AddressOf): Implement address of
20992
20993         * cs-parser.jay (labeled_statement): Fix recursive block
20994         addition by reworking the production.
20995
20996         * expression.cs (New.DoEmit): New has a special case:
20997                 
20998                  If we are dealing with a ValueType, we have a few
20999                  situations to deal with:
21000                 
21001                     * The target of New is a ValueType variable, that is
21002                       easy, we just pass this as the variable reference
21003                 
21004                     * The target of New is being passed as an argument,
21005                       to a boxing operation or a function that takes a
21006                       ValueType.
21007                 
21008                       In this case, we need to create a temporary variable
21009                       that is the argument of New.
21010
21011
21012 2001-12-23  Ravi Pratap  <ravi@ximian.com>
21013
21014         * rootcontext.cs (LookupType): Check that current_type is not null before
21015         going about looking at nested types.
21016
21017         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
21018         not implement the IAssignMethod interface any more.
21019
21020         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
21021         where we tranform them into FieldExprs if they are being resolved from within
21022         the declaring type.
21023
21024         * ecore.cs (SimpleName.DoResolve): Do the same here.
21025
21026         * assign.cs (DoResolve, Emit): Clean up code considerably. 
21027
21028         * ../errors/bug10.cs : Add.
21029
21030         * ../errors/cs0070.cs : Add.
21031
21032         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
21033
21034         * assign.cs : Get rid of EventIsLocal everywhere.
21035
21036 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21037
21038         * ecore.cs (ConvertIntLiteral): finished the implementation.
21039
21040         * statement.cs (SwitchLabel): Convert the value we are using as a
21041         key before looking up the table.
21042
21043 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21044
21045         * codegen.cs (EmitTopBlock): Require a Location argument now.
21046
21047         * cs-parser.jay (constructor_declarator): We need to setup
21048         current_local_parameters before we parse the
21049         opt_constructor_initializer, to allow the variables to be bound
21050         to the constructor arguments.
21051
21052         * rootcontext.cs (LookupType): First lookup nested classes in our
21053         class and our parents before we go looking outside our class.
21054
21055         * expression.cs (ConstantFold): Extract/debox the values at the
21056         beginnning. 
21057
21058         * rootcontext.cs (EmitCode): Resolve the constants first before we
21059         resolve the types.  This is not really needed, but it helps debugging.
21060
21061         * statement.cs: report location.
21062
21063         * cs-parser.jay: pass location to throw statement.
21064
21065         * driver.cs: Small bug fix.
21066
21067         * report.cs: Updated format to be 4-zero filled digits.
21068
21069 2001-12-22  Ravi Pratap  <ravi@ximian.com>
21070
21071         * expression.cs (CheckIndices): Fix minor bug where the wrong
21072         variable was being referred to ;-)
21073
21074         (DoEmit): Do not call EmitStaticInitializers when the 
21075         underlying type is System.Object.
21076
21077 2001-12-21  Ravi Pratap  <ravi@ximian.com>
21078
21079         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
21080         and do the usual workaround for SRE.
21081
21082         * class.cs (MyEventBuilder.EventType): New member to get at the type
21083         of the event, quickly.
21084
21085         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
21086
21087         * assign.cs (Assign.DoResolve): Handle the case when the target
21088         is an EventExpr and perform the necessary checks.
21089
21090         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
21091         interface.
21092
21093         (SimpleName.MemberStaticCheck): Include check for EventExpr.
21094
21095         (EventExpr): Set the type in the constructor itself since we 
21096         are meant to be born fully resolved.
21097
21098         (EventExpr.Define): Revert code I wrote earlier.
21099                 
21100         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
21101         instance expression is null. The instance expression is a This in that case
21102         or a null, depending on whether it is a static method or not.
21103
21104         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
21105         refers to more than one method.
21106
21107         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
21108         and accordingly flag errors.
21109
21110 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21111
21112         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
21113
21114 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21115
21116         * location.cs (ToString): Provide useful rutine.
21117
21118 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21119
21120         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
21121         objects, return the actual integral boxed.
21122
21123         * statement.cs (SwitchLabel): define an ILLabel for each
21124         SwitchLabel. 
21125
21126         (Switch.CheckSwitch): If the value is a Literal, extract
21127         the underlying literal.
21128
21129         Also in the unused hashtable we had, add the SwitchLabel so we can
21130         quickly look this value up.
21131
21132         * constant.cs: Implement a bunch of new constants.  Rewrite
21133         Literal based on this.  Made changes everywhere to adapt to this.
21134
21135         * expression.cs (Expression.MakeByteBlob): Optimize routine by
21136         dereferencing array only once, and also copes with enumrations.
21137
21138         bytes are two bytes wide, not one.
21139
21140         (Cast): Perform constant conversions.
21141
21142         * ecore.cs (TryImplicitIntConversion): Return literals instead of
21143         wrappers to the literals here.
21144
21145         * expression.cs (DoNumericPromotions): long literals can converted
21146         to ulong implicity (this is taken care of elsewhere, but I was
21147         missing this spot).
21148
21149         * ecore.cs (Expression.Literalize): Make the return type Literal,
21150         to improve type checking.
21151
21152         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
21153
21154 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21155
21156         * literal.cs: Revert code from ravi that checked the bounds.  The
21157         bounds are sane by the definition of the type itself. 
21158
21159         * typemanager.cs: Fix implementation of ImplementsInterface.  We
21160         need to actually look up in our parent hierarchy for interfaces
21161         implemented. 
21162
21163         * const.cs: Use the underlying type for enumerations
21164
21165         * delegate.cs: Compute the basename for the delegate creation,
21166         that should fix the delegate test case, and restore the correct
21167         Type Lookup semantics in rootcontext
21168
21169         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
21170         referencing a nested type with the Reflection API is using the "+"
21171         sign. 
21172
21173         * cs-parser.jay: Do not require EOF token at the end.
21174
21175 2001-12-20  Ravi Pratap  <ravi@ximian.com>
21176
21177         * rootcontext.cs (LookupType): Concatenate type names with
21178         a '.' instead of a '+' The test suite passes again.
21179
21180         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
21181         field of the enumeration.
21182
21183         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
21184         the case when the member is an EventExpr.
21185
21186         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
21187         static has an associated instance expression.
21188
21189         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
21190
21191         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
21192
21193         * class.cs (Event.Define): Register event and perform appropriate checks
21194         for error #111.
21195
21196         We define the Add and Remove methods even if the use provides none because
21197         in that case, we provide default implementations ourselves.
21198
21199         Define a private field of the type of the event. This is done by the CSC compiler
21200         and we should be doing it too ;-)
21201
21202         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
21203         More methods we use in code we generate.
21204
21205         (multicast_delegate_type, delegate_type): Two separate types since the distinction
21206         is important.
21207
21208         (InitCoreTypes): Update accordingly for the above.
21209
21210         * class.cs (Event.Emit): Generate code for default accessors that we provide
21211
21212         (EmitDefaultMethod): Do the job in the above.
21213
21214         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
21215         appropriate place.
21216
21217 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21218
21219         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
21220         builders even if we were missing one.
21221
21222         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
21223         pass the Basename as our class name instead of the Name.  The
21224         basename will be correctly composed for us.
21225
21226         * parameter.cs (Paramters): Now takes a Location argument.
21227
21228         * decl.cs (DeclSpace.LookupType): Removed convenience function and
21229         make all the code call directly LookupType in RootContext and take
21230         this chance to pass the Location information everywhere.
21231
21232         * Everywhere: pass Location information.
21233
21234 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
21235
21236         * class.cs (Constructor.Define): Updated way of detecting the
21237         length of the parameters.
21238
21239         (TypeContainer.DefineType): Use basename as the type name for
21240         nested types.
21241
21242         (TypeContainer.Define): Do not recursively define types here, as
21243         definition is taken care in order by the RootContext.
21244
21245         * tree.cs: Keep track of namespaces in a per-file basis.
21246
21247         * parameter.cs (Parameter.ComputeSignature): Update to use
21248         DeclSpace. 
21249
21250         (Parameters.GetSignature): ditto.
21251
21252         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
21253         instead of a TypeContainer.
21254
21255         (Interface.SemanticAnalysis): Use `this' instead of our parent to
21256         resolve names.  Because we need to be resolve in our context, not
21257         our parents.
21258
21259         * driver.cs: Implement response files.
21260
21261         * class.cs (TypeContainer.DefineType): If we are defined, do not
21262         redefine ourselves.
21263
21264         (Event.Emit): Emit the code for add/remove handlers.
21265         (Event.Define): Save the MethodBuilders for add/remove.
21266
21267         * typemanager.cs: Use pair here too.
21268
21269         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
21270         DictionaryEntry requires the first argument to be non-null.  
21271
21272         (enum_declaration): Compute full name for registering the
21273         enumeration.
21274
21275         (delegate_declaration): Instead of using
21276         formal_parameter_list, use opt_formal_parameter_list as the list
21277         can be empty.
21278
21279         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
21280         (EventParsing): New property that controls whether `add' and
21281         `remove' are returned as tokens or identifiers (for events);
21282
21283 2001-12-19  Ravi Pratap  <ravi@ximian.com>
21284
21285         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
21286         use MyEventBuilder only and let it wrap the real builder for us.
21287
21288         (MyEventBuilder): Revamp constructor etc.
21289
21290         Implement all operations that we perform on EventBuilder in precisely the same
21291         way here too.
21292
21293         (FindMembers): Update to use the EventBuilder member.
21294
21295         (Event.Emit): Update accordingly.
21296
21297 2001-12-18  Ravi Pratap  <ravi@ximian.com>
21298
21299         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
21300         by calling the appropriate methods.
21301
21302         (GetCustomAttributes): Make stubs as they cannot possibly do anything
21303         useful.
21304
21305         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
21306
21307 2001-12-17  Ravi Pratap  <ravi@ximian.com>
21308
21309         * delegate.cs (Delegate.Populate): Check that the return type
21310         and various parameters types are indeed accessible.
21311
21312         * class.cs (Constructor.Define): Same here.
21313
21314         (Field.Define): Ditto.
21315
21316         (Event.Define): Ditto.
21317
21318         (Operator.Define): Check that the underlying Method defined itself
21319         correctly - so it's MethodBuilder should not be null.
21320
21321         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
21322         expression happens to be null.
21323
21324         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
21325         members but as of now we don't seem to be able to do anything really useful with it.
21326
21327         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
21328         not the EventBuilder.
21329
21330 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
21331
21332         * cs-tokenizer.cs: Add support for defines.
21333         Add support for #if, #elif, #else, #endif
21334
21335         (eval_var): evaluates a variable.
21336         (eval): stubbed for evaluating functions.
21337
21338         * cs-parser.jay: Pass the defines information
21339
21340         * driver.cs: Add --define command line option.
21341
21342         * decl.cs: Move MemberCore here.
21343
21344         Make it the base class for DeclSpace.  This allows us to catch and
21345         report 108 and 109 for everything now.
21346
21347         * class.cs (TypeContainer.Define): Extract all the members
21348         before populating and emit the warning 108 (new keyword required
21349         to override) instead of having each member implement this.
21350
21351         (MemberCore.Define): New abstract method, we will be using this in
21352         the warning reporting engine in Populate.
21353
21354         (Operator.Define): Adjust to new MemberCore protocol. 
21355
21356         * const.cs (Const): This does not derive from Expression, it is a
21357         temporary object we use to create fields, it is a MemberCore. 
21358
21359         * class.cs (Method.Define): Allow the entry point to be in a
21360         specific class.
21361
21362         * driver.cs: Rewrite the argument handler to clean it up a bit.
21363
21364         * rootcontext.cs: Made it just an auxiliary namespace feature by
21365         making everything static.
21366
21367         * driver.cs: Adapt code to use RootContext type name instead of
21368         instance variable.
21369
21370         * delegate.cs: Remove RootContext argument.
21371
21372         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
21373         argument. 
21374
21375         * class.cs (Event.Define): The lookup can fail.
21376
21377         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
21378
21379         * expression.cs: Resolve the this instance before invoking the code.
21380
21381 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
21382
21383         * cs-parser.jay: Add a production in element_access that allows
21384         the thing to become a "type" reference.  This way we can parse
21385         things like "(string [])" as a type.
21386
21387         Note that this still does not handle the more complex rules of
21388         casts. 
21389
21390
21391         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
21392
21393         * ecore.cs: (CopyNewMethods): new utility function used to
21394         assemble the list of methods from running FindMembers.
21395
21396         (MemberLookup): Rework FindMembers so that 
21397
21398 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
21399
21400         * class.cs (TypeContainer): Remove Delegates who fail to be
21401         defined.
21402
21403         * delegate.cs (Populate): Verify that we dont get null return
21404         values.   TODO: Check for AsAccessible.
21405
21406         * cs-parser.jay: Use basename to emit error 574 (destructor should
21407         have the same name as container class), not the full name.
21408
21409         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
21410         possible representation.  
21411
21412         Also implements integer type suffixes U and L.
21413
21414 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
21415
21416         * expression.cs (ArrayCreation.DoResolve): We need to do the
21417         argument resolution *always*.
21418
21419         * decl.cs: Make this hold the namespace.  Hold the root context as
21420         well.
21421         (LookupType): Move here.
21422
21423         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
21424
21425         * location.cs (Row, Name): Fixed the code, it was always returning
21426         references to the first file.
21427
21428         * interface.cs: Register properties defined through interfaces.
21429
21430         * driver.cs: Add support for globbing on the command line
21431
21432         * class.cs (Field): Make it derive from MemberCore as well.
21433         (Event): ditto.
21434
21435 2001-12-15  Ravi Pratap  <ravi@ximian.com>
21436
21437         * class.cs (Event::Define): Check that the type of the event is a delegate
21438         type else flag error #66.
21439
21440         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
21441         same.
21442
21443         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
21444         values of EntryPoint, CharSet etc etc.
21445
21446         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
21447
21448         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
21449         be null and we should ignore this. I am not sure if this is really clean. Apparently,
21450         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
21451         which needs this to do its work.
21452
21453         * ../errors/cs0066.cs : Add.
21454
21455 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
21456
21457         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
21458         helper functions.
21459
21460         * class.cs: (MethodSignature.MethodSignature): Removed hack that
21461         clears out the parameters field.
21462         (MemberSignatureCompare): Cleanup
21463
21464         (MemberCore): New base class used to share code between MethodCore
21465         and Property.
21466
21467         (RegisterRequiredImplementations) BindingFlags.Public requires
21468         either BindingFlags.Instace or Static.  Use instance here.
21469
21470         (Property): Refactored code to cope better with the full spec.
21471
21472         * parameter.cs (GetParameterInfo): Return an empty array instead
21473         of null on error.
21474
21475         * class.cs (Property): Abstract or extern properties have no bodies.
21476
21477         * parameter.cs (GetParameterInfo): return a zero-sized array.
21478
21479         * class.cs (TypeContainer.MethodModifiersValid): Move all the
21480         method modifier validation to the typecontainer so we can reuse
21481         this on properties.
21482
21483         (MethodCore.ParameterTypes): return an empty sized array of types.
21484
21485         (Property.Define): Test property modifier validity.
21486
21487         Add tests for sealed/override too.
21488
21489         (Method.Emit): abstract or extern methods have no bodies.
21490
21491 2001-12-14  Ravi Pratap  <ravi@ximian.com>
21492
21493         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21494         thing.
21495
21496         (Method::Define, ::Emit): Modify accordingly.
21497
21498         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21499
21500         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21501
21502         * makefile: Pass in /unsafe.
21503
21504 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
21505
21506         * class.cs (MakeKey): Kill routine.
21507
21508         * class.cs (TypeContainer.Define): Correctly define explicit
21509         method implementations (they require the full interface name plus
21510         the method name).
21511
21512         * typemanager.cs: Deply the PtrHashtable here and stop using the
21513         lame keys.  Things work so much better.
21514
21515         This of course broke everyone who depended on `RegisterMethod' to
21516         do the `test for existance' test.  This has to be done elsewhere.
21517
21518         * support.cs (PtrHashtable): A hashtable that avoid comparing with
21519         the object stupid Equals method (because, that like fails all over
21520         the place).  We still do not use it.
21521
21522         * class.cs (TypeContainer.SetRequiredInterface,
21523         TypeContainer.RequireMethods): Killed these two routines and moved
21524         all the functionality to RegisterRequiredImplementations.
21525
21526         (TypeContainer.RegisterRequiredImplementations): This routine now
21527         registers all the implementations required in an array for the
21528         interfaces and abstract methods.  We use an array of structures
21529         which can be computed ahead of time to reduce memory usage and we
21530         also assume that lookups are cheap as most classes will not
21531         implement too many interfaces.
21532
21533         We also avoid creating too many MethodSignatures.
21534
21535         (TypeContainer.IsInterfaceMethod): Update and optionally does not
21536         clear the "pending" bit if we find that there are problems with
21537         the declaration.
21538
21539         (TypeContainer.VerifyPendingMethods): Update to report errors of
21540         methods that look like implementations but are not.
21541
21542         (TypeContainer.Define): Add support for explicit interface method
21543         implementation. 
21544
21545 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
21546
21547         * typemanager.cs: Keep track of the parameters here instead of
21548         being a feature of the TypeContainer.
21549
21550         * class.cs: Drop the registration of parameters here, as
21551         InterfaceMethods are also interface declarations.
21552
21553         * delegate.cs: Register methods with the TypeManager not only with
21554         the TypeContainer.  This code was buggy.
21555
21556         * interface.cs: Full registation here.
21557
21558 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
21559
21560         * expression.cs: Remove reducer for binary expressions, it can not
21561         be done this way.
21562
21563         * const.cs: Put here the code that used to go into constant.cs
21564
21565         * constant.cs: Put here the code for constants, this is a new base
21566         class for Literals.
21567
21568         * literal.cs: Make Literal derive from Constant.
21569
21570 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
21571
21572         * statement.cs (Return.Emit): Report error 157 if the user
21573         attempts to return from a finally block.
21574
21575         (Return.Emit): Instead of emitting a return, jump to the end of
21576         the function.
21577
21578         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21579         LocalBuilder to store the result of the function.  ReturnLabel is
21580         the target where we jump.
21581
21582
21583 2001-12-09  Radek Doulik  <rodo@ximian.com>
21584
21585         * cs-parser.jay: remember alias in current namespace
21586
21587         * ecore.cs (SimpleName::DoResolve): use aliases for types or
21588         namespaces
21589
21590         * class.cs (LookupAlias): lookup alias in my_namespace
21591
21592         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21593         aliases hashtable
21594         (LookupAlias): lookup alias in this and if needed in parent
21595         namespaces
21596
21597 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
21598
21599         * support.cs: 
21600
21601         * rootcontext.cs: (ModuleBuilder) Made static, first step into
21602         making things static.  I need this to avoid passing the
21603         TypeContainer when calling ParameterType.
21604
21605         * support.cs (InternalParameters.ParameterType): Remove ugly hack
21606         that did string manipulation to compute the type and then call
21607         GetType.  Use Parameter.ParameterType instead.
21608
21609         * cs-tokenizer.cs: Consume the suffix for floating values.
21610
21611         * expression.cs (ParameterReference): figure out whether this is a
21612         reference parameter or not.  Kill an extra variable by computing
21613         the arg_idx during emission.
21614
21615         * parameter.cs (Parameters.GetParameterInfo): New overloaded
21616         function that returns whether a parameter is an out/ref value or not.
21617
21618         (Parameter.ParameterType): The type of the parameter (base,
21619         without ref/out applied).
21620
21621         (Parameter.Resolve): Perform resolution here.
21622         (Parameter.ExternalType): The full type (with ref/out applied).
21623
21624         * statement.cs (Using.Emit, Using.EmitExpression): Implement
21625         support for expressions on the using statement.
21626
21627 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
21628
21629         * statement.cs (Using.EmitLocalVariableDecls): Split the
21630         localvariable handling of the using statement.
21631
21632         (Block.EmitMeta): Keep track of variable count across blocks.  We
21633         were reusing slots on separate branches of blocks.
21634
21635         (Try.Emit): Emit the general code block, we were not emitting it. 
21636
21637         Check the type of the declaration to be an IDisposable or
21638         something that can be implicity converted to it. 
21639
21640         Emit conversions if required.
21641
21642         * ecore.cs (EmptyExpression): New utility class.
21643         (Expression.ImplicitConversionExists): New utility function.
21644
21645 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
21646
21647         * statement.cs (Using): Implement.
21648
21649         * expression.cs (LocalVariableReference): Support read only variables.
21650
21651         * statement.cs: Remove the explicit emit for the Leave opcode.
21652         (VariableInfo): Add a readonly field.
21653
21654 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
21655
21656         * ecore.cs (ConvCast): new class used to encapsulate the various
21657         explicit integer conversions that works in both checked and
21658         unchecked contexts.
21659
21660         (Expression.ConvertNumericExplicit): Use new ConvCast class to
21661         properly generate the overflow opcodes.
21662
21663 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21664
21665         * statement.cs: The correct type for the EmptyExpression is the
21666         element_type, not the variable type.  Ravi pointed this out.
21667
21668 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21669
21670         * class.cs (Method::Define): Handle PInvoke methods specially
21671         by using DefinePInvokeMethod instead of the usual one.
21672
21673         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21674         above to do the task of extracting information and defining the method.
21675
21676 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21677
21678         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21679         of the condition for string type.
21680
21681         (Emit): Move that here. 
21682
21683         (ArrayCreation::CheckIndices): Keep string literals in their expression
21684         form.
21685
21686         (EmitDynamicInitializers): Handle strings appropriately.
21687
21688 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21689
21690         * codegen.cs (EmitContext): Replace multiple variables with a
21691         single pointer to the current Switch statement.
21692
21693         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21694         EmitContext.
21695
21696 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21697
21698         * statement.cs 
21699
21700         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21701         default'.
21702
21703         (Foreach.Emit): Foreach on arrays was not setting
21704         up the loop variables (for break/continue).
21705
21706         (GotoCase): Semi-implented.
21707
21708 2001-12-03  Ravi Pratap  <ravi@ximian.com>
21709
21710         * attribute.cs (CheckAttribute): Handle system attributes by using
21711         Attribute.GetAttributes to examine information we need.
21712
21713         (GetValidPlaces): Same here.
21714
21715         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21716
21717         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21718
21719         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21720
21721         (Method::Define): Set appropriate flags if we have a DllImport attribute.
21722
21723         (Method::Emit): Handle the case when we are a PInvoke method.
21724
21725 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21726
21727         * expression.cs: Use ResolveWithSimpleName on compound names.
21728
21729 2001-12-02  Ravi Pratap  <ravi@ximian.com>
21730
21731         * constant.cs (EmitConstant): Make sure we resolve the associated expression
21732         before trying to reduce it.
21733
21734         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21735
21736         * constant.cs (LookupConstantValue): Implement.
21737
21738         (EmitConstant): Use the above in emitting the constant.
21739
21740         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21741         that are user-defined by doing a LookupConstantValue on them.
21742
21743         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21744         too, like above.
21745
21746 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
21747
21748         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21749
21750         (BaseAccess.DoResolve): Implement.
21751
21752         (MemberAccess.DoResolve): Split this routine into a
21753         ResolveMemberAccess routine that can be used independently
21754
21755 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
21756
21757         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21758         As that share bits of the implementation.  Is returns a boolean,
21759         while As returns the Type that is being probed.
21760
21761 2001-12-01  Ravi Pratap  <ravi@ximian.com>
21762
21763         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21764         instead of a Literal - much easier.
21765
21766         (EnumInTransit): Remove - utterly useless :-)
21767
21768         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21769
21770         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21771
21772         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21773         chain when we have no associated expression.
21774
21775 2001-11-30  Ravi Pratap  <ravi@ximian.com>
21776
21777         * constant.cs (Define): Use Location while reporting the errror.
21778
21779         Also emit a warning when 'new' is used and there is no inherited
21780         member to hide.
21781
21782         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
21783         populated.
21784
21785         (LookupEnumValue): Implement to lookup an enum member's value and define it
21786         if necessary.
21787
21788         (Populate): Re-write accordingly to use the above routine.
21789
21790 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
21791
21792         * expression.cs (This): Fix prototype for DoResolveLValue to
21793         override the base class DoResolveLValue.
21794
21795         * cs-parser.cs: Report errors cs574 and cs575 (destructor
21796         declarations) 
21797
21798         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
21799         (we need to load the address of the field here).  This fixes
21800         test-22. 
21801
21802         (FieldExpr.DoResolveLValue): Call the DoResolve
21803         function to initialize the Instance expression.
21804
21805         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
21806         correctly the GetEnumerator operation on a value type.
21807
21808         * cs-parser.jay: Add more simple parsing error catches.
21809
21810         * statement.cs (Switch): Add support for string switches.
21811         Handle null specially.
21812
21813         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
21814
21815 2001-11-28  Ravi Pratap  <ravi@ximian.com>
21816
21817         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
21818
21819         (declare_local_constant): New helper function.
21820
21821         * statement.cs (AddConstant): Keep a separate record of constants
21822
21823         (IsConstant): Implement to determine if a variable is a constant.
21824
21825         (GetConstantExpression): Implement.
21826
21827         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
21828
21829         * statement.cs (IsVariableDefined): Re-write.
21830
21831 2001-11-27  Ravi Pratap  <ravi@ximian.com>
21832
21833         * class.cs (TypeContainer::FindMembers): Look for constants
21834         in the case when we are looking for MemberTypes.Field
21835
21836         * expression.cs (MemberAccess::DoResolve): Check that in the
21837         case we are a FieldExpr and a Literal, we are not being accessed
21838         by an instance reference.
21839
21840         * cs-parser.jay (local_constant_declaration): Implement.
21841
21842         (declaration_statement): Implement for constant declarations.
21843
21844 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
21845
21846         * statement.cs (Switch): Catch double defaults.
21847
21848         (Switch): More work on the switch() statement
21849         implementation.  It works for integral values now, need to finish
21850         string support.
21851
21852
21853 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21854
21855         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
21856         integer literals into other integer literals.  To be used by
21857         switch. 
21858
21859 2001-11-24  Ravi Pratap  <ravi@ximian.com>
21860
21861         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
21862         some memory.
21863
21864         (EmitDynamicInitializers): Cope with the above since we extract data
21865         directly from ArrayData now.
21866
21867         (ExpectInitializers): Keep track of whether initializers are mandatory
21868         or not.
21869
21870         (Bounds): Make it a hashtable to prevent the same dimension being 
21871         recorded for every element in that dimension.
21872
21873         (EmitDynamicInitializers): Fix bug which prevented the Set array method
21874         from being found.
21875
21876         Also fix bug which was causing the indices to be emitted in the reverse
21877         order.
21878
21879 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21880
21881         * expression.cs (ArrayCreation): Implement the bits that Ravi left
21882         unfinished.  They do not work, because the underlying code is
21883         sloppy.
21884
21885 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21886
21887         * cs-parser.jay: Remove bogus fixme.
21888
21889         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
21890         on Switch statement.
21891
21892 2001-11-23  Ravi Pratap  <ravi@ximian.com>
21893
21894         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
21895         the same. 
21896
21897         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
21898         parameter. Apparently, any expression is allowed. 
21899
21900         (ValidateInitializers): Update accordingly.
21901
21902         (CheckIndices): Fix some tricky bugs thanks to recursion.
21903
21904         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
21905         I was being completely brain-dead.
21906
21907         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
21908         and re-write acordingly.
21909
21910         (DelegateInvocation): Re-write accordingly.
21911
21912         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
21913
21914         (MakeByteBlob): Handle types more correctly.
21915
21916         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
21917         initialization from expressions but it is incomplete because I am a complete
21918         Dodo :-|
21919
21920 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21921
21922         * statement.cs (If.Emit): Fix a bug that generated incorrect code
21923         on If.  Basically, we have to return `true' (ie, we do return to
21924         our caller) only if both branches of the if return.
21925
21926         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
21927         short-circuit operators, handle them as short circuit operators. 
21928
21929         (Cast.DoResolve): Resolve type.
21930         (Cast.Cast): Take an expression as the target type.
21931
21932         * cs-parser.jay (cast_expression): Remove old hack that only
21933         allowed a limited set of types to be handled.  Now we take a
21934         unary_expression and we resolve to a type during semantic
21935         analysis.
21936
21937         Use the grammar productions from Rhys to handle casts (this is
21938         not complete like Rhys syntax yet, we fail to handle that corner
21939         case that C# has regarding (-x), but we will get there.
21940
21941 2001-11-22  Ravi Pratap  <ravi@ximian.com>
21942
21943         * class.cs (EmitFieldInitializer): Take care of the case when we have a
21944         field which is an array type.
21945
21946         * cs-parser.jay (declare_local_variables): Support array initialization too.
21947
21948         * typemanager.cs (MakeKey): Implement.
21949
21950         (everywhere): Use the above appropriately.
21951
21952         * cs-parser.jay (for_statement): Update for array initialization while
21953         declaring variables.
21954
21955         * ecore.cs : The error message was correct, it's the variable's names that
21956         were misleading ;-) Make the code more readable.
21957
21958         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
21959         the correct type etc.
21960
21961         (ConvertExplicit): Handle Enum types by examining the underlying type.
21962
21963 2001-11-21  Ravi Pratap  <ravi@ximian.com>
21964
21965         * parameter.cs (GetCallingConvention): Always return
21966         CallingConventions.Standard for now.
21967
21968 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21969
21970         * expression.cs (Binary.ResolveOperator): Update the values of `l'
21971         and `r' after calling DoNumericPromotions.
21972
21973         * ecore.cs: Fix error message (the types were in the wrong order).
21974
21975         * statement.cs (Foreach.ProbeCollectionType): Need to pass
21976         BindingFlags.Instance as well 
21977
21978         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
21979         implicit int literal conversion in an empty cast so that we
21980         propagate the right type upstream.
21981
21982         (UnboxCast): new class used to unbox value types.
21983         (Expression.ConvertExplicit): Add explicit type conversions done
21984         by unboxing.
21985
21986         (Expression.ImplicitNumericConversion): Oops, forgot to test for
21987         the target type before applying the implicit LongLiterals to ULong
21988         literal cast.
21989
21990 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
21991
21992         * cs-parser.jay (for_statement): Reworked the way For works: now
21993         we declare manually any variables that are introduced in
21994         for_initializer to solve the problem of having out-of-band code
21995         emition (that is what got for broken).
21996
21997         (declaration_statement): Perform the actual variable declaration
21998         that used to be done in local_variable_declaration here.
21999
22000         (local_variable_declaration): Do not declare anything, just pass
22001         the information on a DictionaryEntry
22002
22003 2001-11-20  Ravi Pratap  <ravi@ximian.com>
22004
22005         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
22006         re-write of the logic to now make it recursive.
22007
22008         (UpdateIndices): Re-write accordingly.
22009
22010         Store element data in a separate ArrayData list in the above methods.
22011
22012         (MakeByteBlob): Implement to dump the array data into a byte array.
22013
22014 2001-11-19  Ravi Pratap  <ravi@ximian.com>
22015
22016         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
22017         into CheckIndices.
22018
22019         * constant.cs (Define): Implement.
22020
22021         (EmitConstant): Re-write fully.
22022
22023         Pass in location info.
22024
22025         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
22026         respectively.
22027
22028         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
22029         DictionaryEntry since we need location info too.
22030
22031         (constant_declaration): Update accordingly.
22032
22033         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
22034         code into another method : UpdateIndices.
22035
22036 2001-11-18  Ravi Pratap  <ravi@ximian.com>
22037
22038         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
22039         some type checking etc.
22040
22041 2001-11-17  Ravi Pratap  <ravi@ximian.com>
22042
22043         * expression.cs (ArrayCreation::ValidateInitializers): Implement
22044         bits to provide dimension info if the user skips doing that.
22045
22046         Update second constructor to store the rank correctly.
22047
22048 2001-11-16  Ravi Pratap  <ravi@ximian.com>
22049
22050         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
22051         and try to implement.
22052
22053         * ../errors/cs0150.cs : Add.
22054
22055         * ../errors/cs0178.cs : Add.
22056
22057 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
22058
22059         * statement.cs: Implement foreach on multi-dimensional arrays. 
22060
22061         * parameter.cs (Parameters.GetParameterByName): Also lookup the
22062         name of the params argument.
22063
22064         * expression.cs: Use EmitStoreOpcode to get the right opcode while
22065         initializing the array.
22066
22067         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
22068         we can use this elsewhere.
22069
22070         * statement.cs: Finish implementation of foreach for single
22071         dimension arrays.
22072
22073         * cs-parser.jay: Use an out-of-band stack to pass information
22074         around, I wonder why I need this.
22075
22076         foreach_block: Make the new foreach_block the current_block.
22077
22078         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
22079         function used to return a static Parameters structure.  Used for
22080         empty parameters, as those are created very frequently.
22081
22082         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
22083
22084 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22085
22086         * interface.cs : Default modifier is private, not public. The
22087         make verify test passes again.
22088
22089 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22090
22091         * support.cs (ReflectionParameters): Fix logic to determine
22092         whether the last parameter is a params one. Test 9 passes again.
22093
22094         * delegate.cs (Populate): Register the builders we define with
22095         RegisterParameterForBuilder. Test 19 passes again.
22096
22097         * cs-parser.jay (property_declaration): Reference $6 instead
22098         of $$ to get at the location.
22099
22100         (indexer_declaration): Similar stuff.
22101
22102         (attribute): Ditto.
22103
22104         * class.cs (Property): Register parameters for the Get and Set methods
22105         if they exist. Test 23 passes again.
22106
22107         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
22108         call to EmitArguments as we are sure there aren't any params arguments. 
22109         Test 32 passes again.
22110
22111         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
22112         IndexOutOfRangeException. 
22113
22114         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
22115         Test 33 now passes again.
22116
22117 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
22118
22119         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
22120         broke a bunch of things.  Will have to come up with a better way
22121         of tracking locations.
22122
22123         * statement.cs: Implemented foreach for single dimension arrays.
22124
22125 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22126
22127         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
22128         an error.  This removes the lookup from the critical path.
22129
22130         * cs-parser.jay: Removed use of temporary_loc, which is completely
22131         broken. 
22132
22133 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
22134
22135         * support.cs (ReflectionParameters.ParameterModifier): Report
22136         whether the argument is a PARAMS argument or not.
22137
22138         * class.cs: Set the attribute `ParamArrayAttribute' on the
22139         parameter argument.
22140
22141         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
22142         and cons_param_array_attribute (ConstructorInfo for
22143         ParamArrayAttribute)., 
22144
22145         * codegen.cs: Emit the return using the `Return' statement, that
22146         way we can report the error correctly for missing return values. 
22147
22148         * class.cs (Method.Emit): Clean up.
22149
22150         * expression.cs (Argument.Resolve): Take another argument: the
22151         location where this argument is used.  Notice that this is not
22152         part of the "Argument" class as to reduce the size of the
22153         structure (we know the approximate location anyways).
22154
22155         Test if the argument is a variable-reference, if not, then
22156         complain with a 206.
22157
22158         (Argument.Emit): Emit addresses of variables.
22159
22160         (Argument.FullDesc): Simplify.
22161
22162         (Invocation.DoResolve): Update for Argument.Resolve.
22163
22164         (ElementAccess.DoResolve): ditto.
22165
22166         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
22167         method should be virtual, as this method is always virtual.
22168
22169         (NewDelegate.DoResolve): Update for Argument.Resolve.
22170
22171         * class.cs (ConstructorInitializer.DoResolve): ditto.
22172
22173         * attribute.cs (Attribute.Resolve): ditto.
22174
22175 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
22176
22177         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
22178
22179         * expression.cs (ParameterReference): Drop IStackStorage and implement
22180         IAssignMethod instead. 
22181
22182         (LocalVariableReference): ditto.
22183
22184         * ecore.cs (FieldExpr): Drop IStackStorage and implement
22185         IAssignMethod instead. 
22186
22187 2001-11-13  Miguel de Icaza <miguel@ximian.com>
22188
22189         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
22190         enumerations that are used in heavily used structures derive from
22191         byte in a laughable and pathetic attempt to reduce memory usage.
22192         This is the kind of pre-optimzations that you should not do at
22193         home without adult supervision.
22194
22195         * expression.cs (UnaryMutator): New class, used to handle ++ and
22196         -- separatedly from the other unary operators.  Cleans up the
22197         code, and kills the ExpressionStatement dependency in Unary.
22198
22199         (Unary): Removed `method' and `Arguments' from this class, making
22200         it smaller, and moving it all to SimpleCall, so I can reuse this
22201         code in other locations and avoid creating a lot of transient data
22202         strucutres when not required.
22203
22204         * cs-parser.jay: Adjust for new changes.
22205
22206 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
22207
22208         * enum.cs (Enum.Populate): If there is a failure during
22209         definition, return
22210
22211         * cs-parser.jay (opt_enum_base): we used to catch type errors
22212         here, but this is really incorrect.  The type error should be
22213         catched during semantic analysis.
22214
22215 2001-12-11  Ravi Pratap  <ravi@ximian.com>
22216
22217         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
22218         current_local_parameters as expected since I, in my stupidity, had forgotten
22219         to do this :-)
22220
22221         * attribute.cs (GetValidPlaces): Fix stupid bug.
22222
22223         * class.cs (Method::Emit): Perform check on applicability of attributes.
22224
22225         (Constructor::Emit): Ditto.
22226
22227         (Field::Emit): Ditto.
22228
22229         (Field.Location): Store location information.
22230
22231         (Property, Event, Indexer, Operator): Ditto.
22232
22233         * cs-parser.jay (field_declaration): Pass in location for each field.
22234
22235         * ../errors/cs0592.cs : Add.
22236
22237 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22238
22239         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
22240
22241         (InitCoreTypes): Update accordingly.
22242
22243         (RegisterAttrType, LookupAttr): Implement.
22244
22245         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
22246         info about the same.
22247
22248         (Resolve): Update to populate the above as necessary.
22249
22250         (Error592): Helper.
22251
22252         (GetValidPlaces): Helper to the above.
22253
22254         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
22255
22256         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
22257
22258 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22259
22260         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
22261
22262         * ../errors/cs0617.cs : Add.
22263
22264 2001-11-11  Ravi Pratap  <ravi@ximian.com>
22265
22266         * enum.cs (Emit): Rename to Populate to be more consistent with what
22267         we expect it to do and when exactly it is called.
22268
22269         * class.cs, rootcontext.cs : Update accordingly.
22270
22271         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
22272         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
22273
22274         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
22275
22276         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
22277         of a fieldinfo using the above, when dealing with a FieldBuilder.
22278
22279 2001-11-10  Ravi Pratap  <ravi@ximian.com>
22280
22281         * ../errors/cs0031.cs : Add.
22282
22283         * ../errors/cs1008.cs : Add.
22284
22285         * ../errrors/cs0543.cs : Add.
22286
22287         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
22288         enum type.
22289
22290         (FindMembers): Implement.
22291
22292         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
22293         enums and delegates too.
22294
22295         (enum_types): Rename to builder_to_enum.
22296
22297         (delegate_types): Rename to builder_to_delegate.
22298
22299         * delegate.cs (FindMembers): Implement.
22300
22301 2001-11-09  Ravi Pratap  <ravi@ximian.com>
22302
22303         * typemanager.cs (IsEnumType): Implement.
22304
22305         * enum.cs (Emit): Re-write parts to account for the underlying type
22306         better and perform checking etc.
22307
22308         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
22309         of the underlying type.
22310
22311         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
22312         value
22313
22314         * enum.cs (error31): Helper to report error #31.
22315
22316         * cs-parser.jay (enum_declaration): Store location of each member too.
22317
22318         * enum.cs (member_to_location): New hashtable. 
22319
22320         (AddEnumMember): Update location hashtable.
22321
22322         (Emit): Use the location of each member while reporting errors.
22323
22324 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22325
22326         * cs-parser.jay: A for_initializer if is a
22327         local_variable_declaration really ammount to have an implicit
22328         block with the variable declaration and no initializer for for.
22329
22330         * statement.cs (For.Emit): Cope with null initializers.
22331
22332         This fixes the infinite loop on for initializers.
22333
22334 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
22335
22336         * enum.cs: More cleanup.
22337
22338         * ecore.cs: Remove dead code.
22339
22340         * class.cs (Property.Emit): More simplification.
22341         (Event.Emit): ditto.
22342
22343         Reworked to have less levels of indentation.
22344
22345 2001-11-08  Ravi Pratap  <ravi@ximian.com>
22346
22347         * class.cs (Property): Emit attributes.
22348
22349         (Field): Ditto.
22350
22351         (Event): Ditto.
22352
22353         (Indexer): Ditto.
22354
22355         (Operator): Ditto.
22356
22357         * enum.cs (Emit): Ditto.
22358
22359         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
22360         Enums too.
22361
22362         * class.cs (Field, Event, etc.): Move attribute generation into the
22363         Emit method everywhere.
22364
22365         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
22366         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
22367         as we had no way of defining nested enums !
22368
22369         * rootcontext.cs : Adjust code accordingly.
22370
22371         * typemanager.cs (AddEnumType): To keep track of enum types separately.
22372
22373 2001-11-07  Ravi Pratap  <ravi@ximian.com>
22374
22375         * expression.cs (EvalConstantExpression): Move into ecore.cs
22376
22377         * enum.cs (Enum): Rename some members and make them public and readonly
22378         according to our convention.
22379
22380         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
22381         nothing else.
22382
22383         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
22384
22385         (Enum::Emit): Write a simple version for now which doesn't try to compute
22386         expressions. I shall modify this to be more robust in just a while.
22387
22388         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
22389
22390         (TypeContainer::CloseType): Create the Enum types too.
22391
22392         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
22393
22394         * expression.cs (EvalConstantExpression): Get rid of completely.
22395
22396         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
22397         user-defined values and other cases.
22398
22399         (IsValidEnumLiteral): Helper function.
22400
22401         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
22402         out there in the case we had a literal FieldExpr.
22403
22404         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
22405
22406         (Literalize): Revamp a bit to take two arguments.
22407
22408         (EnumLiteral): New class which derives from Literal to wrap enum literals.
22409
22410 2001-11-06  Ravi Pratap  <ravi@ximian.com>
22411
22412         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
22413
22414         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
22415
22416         (Resolve): Use the above to ensure we have proper initializers.
22417
22418 2001-11-05  Ravi Pratap  <ravi@ximian.com>
22419
22420         * expression.cs (Expression::EvalConstantExpression): New method to 
22421         evaluate constant expressions.
22422
22423         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
22424
22425 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
22426
22427         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
22428         in an array.
22429
22430         (Binary.ResolveOperator): Handle operator != (object a, object b)
22431         and operator == (object a, object b);
22432
22433         (Binary.DoNumericPromotions): Indicate whether the numeric
22434         promotion was possible.
22435
22436         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
22437         Implement.  
22438
22439         Made the ArrayAccess implement interface IAssignMethod instead of
22440         IStackStore as the order in which arguments are passed reflects
22441         this.
22442
22443         * assign.cs: Instead of using expr.ExprClass to select the way of
22444         assinging, probe for the IStackStore/IAssignMethod interfaces.
22445
22446         * typemanager.cs: Load InitializeArray definition.
22447
22448         * rootcontext.cs (RootContext.MakeStaticData): Used to define
22449         static data that can be used to initialize arrays. 
22450
22451 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
22452
22453         * expression.cs: Handle operator== and operator!= for booleans.
22454
22455         (Conditioal.Reduce): Implement reducer for the ?: operator.
22456
22457         (Conditional.Resolve): Implement dead code elimination.
22458
22459         (Binary.Resolve): Catch string literals and return a new
22460         concatenated string.
22461
22462         (Unary.Reduce): Implement reduction of unary expressions.
22463
22464         * ecore.cs: Split out the expression core handling here.
22465
22466         (Expression.Reduce): New method used to perform constant folding
22467         and CSE.  This is needed to support constant-expressions. 
22468
22469         * statement.cs (Statement.EmitBoolExpression): Pass true and false
22470         targets, and optimize for !x.
22471
22472 2001-11-04  Ravi Pratap  <ravi@ximian.com>
22473
22474         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
22475         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
22476         set custom atttributes.
22477
22478         * literal.cs (Literal::GetValue): New abstract method to return the actual
22479         value of the literal, cast as an object.
22480
22481         (*Literal): Implement GetValue method.
22482
22483         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22484         expressions to the arraylist but objects of type Argument.
22485
22486         * class.cs (TypeContainer::Emit): Emit our attributes too.
22487
22488         (Method::Emit, Constructor::Emit): Ditto.
22489
22490         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
22491         to be ignoring earlier.
22492
22493 2001-11-03  Ravi Pratap  <ravi@ximian.com>
22494
22495         * attribute.cs (AttributeSection::Define): Implement to do the business
22496         of constructing a CustomAttributeBuilder.
22497
22498         (Attribute): New trivial class. Increases readability of code.  
22499
22500         * cs-parser.jay : Update accordingly.
22501
22502         (positional_argument_list, named_argument_list, named_argument): New rules
22503
22504         (attribute_arguments): Use the above so that we are more correct.
22505
22506 2001-11-02  Ravi Pratap  <ravi@ximian.com>
22507
22508         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22509         to perform all checks for a method with a params parameter.
22510
22511         (Invocation::OverloadResolve): Update to use the above method and therefore
22512         cope correctly with params method invocations.
22513
22514         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
22515         params too.
22516
22517         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22518         constructors in our parent too because we can't afford to miss out on 
22519         protected ones ;-)
22520
22521         * attribute.cs (AttributeSection): New name for the class Attribute
22522
22523         Other trivial changes to improve readability.
22524
22525         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22526         use the new class names.
22527
22528 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22529
22530         * class.cs (Method::Define): Complete definition for params types too
22531
22532         (Indexer::Define): Ditto.
22533
22534         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22535         Cope everywhere with a request for info about the array parameter.
22536
22537 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22538
22539         * tree.cs (RecordNamespace): Fix up to check for the correct key.
22540
22541         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
22542         local_variable_type to extract the string corresponding to the type.
22543
22544         (local_variable_type): Fixup the action to use the new helper method.
22545
22546         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
22547         go.
22548
22549         * expression.cs : Clean out code which uses the above.
22550
22551 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22552
22553         * typemanager.cs (RegisterMethod): Check if we already have an existing key
22554         and bale out if necessary by returning a false.
22555
22556         (RegisterProperty): Ditto.
22557
22558         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
22559         and print out appropriate error messages.
22560
22561         * interface.cs (everywhere): Ditto.
22562
22563         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
22564         location to constructor.
22565
22566         * class.cs (Property, Event, Indexer): Update accordingly.
22567
22568         * ../errors/cs111.cs : Added.
22569
22570         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
22571         of a method, as laid down by the spec.
22572
22573         (Invocation::OverloadResolve): Use the above method.
22574
22575 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22576
22577         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22578         now take a TypeContainer and a Parameters object.
22579
22580         (ParameterData): Modify return type of ParameterModifier method to be 
22581         Parameter.Modifier and not a string.
22582
22583         (ReflectionParameters, InternalParameters): Update accordingly.
22584
22585         * expression.cs (Argument::GetParameterModifier): Same here.
22586
22587         * support.cs (InternalParameters::ParameterType): Find a better way of determining
22588         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22589         symbol in it at all so maybe this is only for now.
22590
22591 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22592
22593         * support.cs (InternalParameters): Constructor now takes an extra argument 
22594         which is the actual Parameters class.
22595
22596         (ParameterDesc): Update to provide info on ref/out modifiers.
22597
22598         * class.cs (everywhere): Update call to InternalParameters to pass in
22599         the second argument too.
22600
22601         * support.cs (ParameterData): Add ParameterModifier, which is a method 
22602         to return the modifier info [ref/out etc]
22603
22604         (InternalParameters, ReflectionParameters): Implement the above.
22605
22606         * expression.cs (Argument::ParameterModifier): Similar function to return
22607         info about the argument's modifiers.
22608
22609         (Invocation::OverloadResolve): Update to take into account matching modifiers 
22610         too.
22611
22612         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22613         a new SetFormalParameters object which we pass to InternalParameters.
22614
22615 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22616
22617         * expression.cs (NewArray): Merge into the ArrayCreation class.
22618
22619 2001-10-29  Ravi Pratap  <ravi@ximian.com>
22620
22621         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
22622         NewUserdefinedArray into one as there wasn't much of a use in having
22623         two separate ones.
22624
22625         * expression.cs (Argument): Change field's name to ArgType from Type.
22626
22627         (Type): New readonly property which returns the proper type, taking into 
22628         account ref/out modifiers.
22629
22630         (everywhere): Adjust code accordingly for the above.
22631
22632         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22633         whether we are emitting for a ref or out parameter.
22634
22635         * expression.cs (Argument::Emit): Use the above field to set the state.
22636
22637         (LocalVariableReference::Emit): Update to honour the flag and emit the
22638         right stuff.
22639
22640         * parameter.cs (Attributes): Set the correct flags for ref parameters.
22641
22642         * expression.cs (Argument::FullDesc): New function to provide a full desc.
22643
22644         * support.cs (ParameterData): Add method ParameterDesc to the interface.
22645
22646         (ReflectionParameters, InternalParameters): Implement the above method.
22647
22648         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22649         reporting errors.
22650
22651         (Invocation::FullMethodDesc): Ditto. 
22652
22653 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
22654
22655         * cs-parser.jay: Add extra production for the second form of array
22656         creation. 
22657
22658         * expression.cs (ArrayCreation): Update to reflect the above
22659         change. 
22660
22661         * Small changes to prepare for Array initialization.
22662
22663 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
22664
22665         * typemanager.cs (ImplementsInterface): interface might be null;
22666         Deal with this problem;
22667
22668         Also, we do store negative hits on the cache (null values), so use
22669         this instead of calling t.GetInterfaces on the type everytime.
22670
22671 2001-10-28  Ravi Pratap  <ravi@ximian.com>
22672
22673         * typemanager.cs (IsBuiltinType): New method to help determine the same.
22674
22675         * expression.cs (New::DoResolve): Get rid of array creation code and instead
22676         split functionality out into different classes.
22677
22678         (New::FormArrayType): Move into NewBuiltinArray.
22679
22680         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22681         quite useless.
22682
22683         (NewBuiltinArray): New class to handle creation of built-in arrays.
22684
22685         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22686         account creation of one-dimensional arrays.
22687
22688         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22689
22690         (NewUserdefinedArray::DoResolve): Implement.
22691
22692         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22693
22694         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22695         we maintain inside the TypeManager. This is necessary to perform lookups on the
22696         module builder.
22697
22698         (LookupType): Update to perform GetType on the module builders too.     
22699
22700         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22701
22702         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22703
22704 2001-10-23  Ravi Pratap  <ravi@ximian.com>
22705
22706         * expression.cs (New::DoResolve): Implement guts of array creation.
22707
22708         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22709
22710 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
22711
22712         * expression.cs: Fix bug I introduced lsat night that broke
22713         Delegates. 
22714
22715         (Expression.Resolve): Report a 246 error (can not resolve name)
22716         if we find a SimpleName in the stream.
22717
22718         (Expression.ResolveLValue): Ditto.
22719
22720         (Expression.ResolveWithSimpleName): This function is a variant of
22721         ResolveName, this one allows SimpleNames to be returned without a
22722         warning.  The only consumer of SimpleNames is MemberAccess
22723
22724 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
22725
22726         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22727         might arrive here.  I have my doubts that this is correct.
22728
22729         * statement.cs (Lock): Implement lock statement.
22730
22731         * cs-parser.jay: Small fixes to support `lock' and `using'
22732
22733         * cs-tokenizer.cs: Remove extra space
22734
22735         * driver.cs: New flag --checked, allows to turn on integer math
22736         checking. 
22737
22738         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22739         Threading.Monitor.Exit 
22740
22741 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
22742
22743         * expression.cs (IndexerAccess::DoResolveLValue): Set the
22744         Expression Class to be IndexerAccess.
22745
22746         Notice that Indexer::DoResolve sets the eclass to Value.
22747
22748 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
22749
22750         * class.cs (TypeContainer::Emit): Emit code for indexers.
22751
22752         * assign.cs (IAssignMethod): New interface implemented by Indexers
22753         and Properties for handling assignment.
22754
22755         (Assign::Emit): Simplify and reuse code. 
22756
22757         * expression.cs (IndexerAccess, PropertyExpr): Implement
22758         IAssignMethod, clean up old code. 
22759
22760 2001-10-22  Ravi Pratap  <ravi@ximian.com>
22761
22762         * typemanager.cs (ImplementsInterface): New method to determine if a type
22763         implements a given interface. Provides a nice cache too.
22764
22765         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22766         method.
22767
22768         (ConvertReferenceExplicit): Ditto.
22769
22770         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
22771         various methods, with correct names etc.
22772
22773         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
22774         Operator.UnaryNegation.
22775
22776         * cs-parser.jay (operator_declarator): Be a little clever in the case where
22777         we have a unary plus or minus operator.
22778
22779         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
22780         UnaryMinus.
22781
22782         * everywhere : update accordingly.
22783
22784         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22785         respectively.
22786
22787         * class.cs (Method::Define): For the case where we are implementing a method
22788         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
22789         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22790
22791 2001-10-21  Ravi Pratap  <ravi@ximian.com>
22792
22793         * interface.cs (FindMembers): Implement to work around S.R.E
22794         lameness.
22795
22796         * typemanager.cs (IsInterfaceType): Implement.
22797
22798         (FindMembers): Update to handle interface types too.
22799
22800         * expression.cs (ImplicitReferenceConversion): Re-write bits which
22801         use IsAssignableFrom as that is not correct - it doesn't work.
22802
22803         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
22804         and accordingly override EmitStatement.
22805
22806         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
22807         using the correct logic :-)
22808
22809 2001-10-19  Ravi Pratap  <ravi@ximian.com>
22810
22811         * ../errors/cs-11.cs : Add to demonstrate error -11 
22812
22813 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
22814
22815         * assign.cs (Assign::Resolve): Resolve right hand side first, and
22816         then pass this as a hint to ResolveLValue.
22817
22818         * expression.cs (FieldExpr): Add Location information
22819
22820         (FieldExpr::LValueResolve): Report assignment to readonly
22821         variable. 
22822
22823         (Expression::ExprClassFromMemberInfo): Pass location information.
22824
22825         (Expression::ResolveLValue): Add new method that resolves an
22826         LValue. 
22827
22828         (Expression::DoResolveLValue): Default invocation calls
22829         DoResolve. 
22830
22831         (Indexers): New class used to keep track of indexers in a given
22832         Type. 
22833
22834         (IStackStore): Renamed from LValue, as it did not really describe
22835         what this did.  Also ResolveLValue is gone from this interface and
22836         now is part of Expression.
22837
22838         (ElementAccess): Depending on the element access type
22839
22840         * typemanager.cs: Add `indexer_name_type' as a Core type
22841         (System.Runtime.CompilerServices.IndexerNameAttribute)
22842
22843         * statement.cs (Goto): Take a location.
22844
22845 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22846
22847         * delegate.cs (Delegate::VerifyDelegate): New method to verify
22848         if two delegates are compatible.
22849
22850         (NewDelegate::DoResolve): Update to take care of the case when
22851         we instantiate a delegate from another delegate.
22852
22853         * typemanager.cs (FindMembers): Don't even try to look up members
22854         of Delegate types for now.
22855
22856 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22857
22858         * delegate.cs (NewDelegate): New class to take care of delegate
22859         instantiation.
22860
22861         * expression.cs (New): Split the delegate related code out into 
22862         the NewDelegate class.
22863
22864         * delegate.cs (DelegateInvocation): New class to handle delegate 
22865         invocation.
22866
22867         * expression.cs (Invocation): Split out delegate related code into
22868         the DelegateInvocation class.
22869
22870 2001-10-17  Ravi Pratap  <ravi@ximian.com>
22871
22872         * expression.cs (New::DoResolve): Implement delegate creation fully
22873         and according to the spec.
22874
22875         (New::DoEmit): Update to handle delegates differently.
22876
22877         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
22878         because of which we were printing out arguments in reverse order !
22879
22880         * delegate.cs (VerifyMethod): Implement to check if the given method
22881         matches the delegate.
22882
22883         (FullDelegateDesc): Implement.
22884
22885         (VerifyApplicability): Implement.
22886
22887         * expression.cs (Invocation::DoResolve): Update to accordingly handle
22888         delegate invocations too.
22889
22890         (Invocation::Emit): Ditto.
22891
22892         * ../errors/cs1593.cs : Added.
22893
22894         * ../errors/cs1594.cs : Added.
22895
22896         * delegate.cs (InstanceExpression, TargetMethod): New properties.
22897
22898 2001-10-16  Ravi Pratap  <ravi@ximian.com>
22899
22900         * typemanager.cs (intptr_type): Core type for System.IntPtr
22901
22902         (InitCoreTypes): Update for the same.
22903
22904         (iasyncresult_type, asynccallback_type): Ditto.
22905
22906         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
22907         correct.
22908
22909         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
22910         too.
22911
22912         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
22913         the builders for the 4 members of a delegate type :-)
22914
22915         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
22916         type.
22917
22918         * expression.cs (New::DoResolve): Implement guts for delegate creation.
22919
22920         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
22921
22922 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
22923
22924         * statement.cs (Break::Emit): Implement.   
22925         (Continue::Emit): Implement.
22926
22927         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22928         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22929         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22930         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
22931         end loop
22932
22933         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
22934         properties that track the label for the current loop (begin of the
22935         loop and end of the loop).
22936
22937 2001-10-15  Ravi Pratap  <ravi@ximian.com>
22938
22939         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
22940         use of emitting anything at all.
22941
22942         * class.cs, rootcontext.cs : Get rid of calls to the same.
22943
22944         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
22945
22946         (Populate): Define the constructor correctly and set the implementation
22947         attributes.
22948
22949         * typemanager.cs (delegate_types): New hashtable to hold delegates that
22950         have been defined.
22951
22952         (AddDelegateType): Implement.
22953
22954         (IsDelegateType): Implement helper method.
22955
22956         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
22957
22958         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
22959         and accordingly handle it.
22960
22961         * delegate.cs (Populate): Take TypeContainer argument.
22962         Implement bits to define the Invoke method. However, I still haven't figured out
22963         how to take care of the native int bit :-(
22964
22965         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
22966         Qualify the name of the delegate, not its return type !
22967
22968         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
22969         conversion.
22970
22971         (StandardConversionExists): Checking for array types turns out to be recursive.
22972
22973         (ConvertReferenceExplicit): Implement array conversion.
22974
22975         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
22976
22977 2001-10-12  Ravi Pratap  <ravi@ximian.com>
22978
22979         * cs-parser.jay (delegate_declaration): Store the fully qualified
22980         name as it is a type declaration.
22981
22982         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
22983         readonly.
22984
22985         (DefineDelegate): Renamed from Define. Does the same thing essentially,
22986         as TypeContainer::DefineType.
22987
22988         (Populate): Method in which all the definition of the various methods (Invoke)
22989         etc is done.
22990
22991         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
22992         see.
22993
22994         (CloseDelegate): Finally creates the delegate.
22995
22996         * class.cs (TypeContainer::DefineType): Update to define delegates.
22997         (Populate, Emit and CloseType): Do the same thing here too.
22998
22999         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
23000         delegates in all these operations.
23001
23002 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
23003
23004         * expression.cs: LocalTemporary: a new expression used to
23005         reference a temporary that has been created.
23006
23007         * assign.cs: Handle PropertyAccess back here, so that we can
23008         provide the proper semantic access to properties.
23009
23010         * expression.cs (Expression::ConvertReferenceExplicit): Implement
23011         a few more explicit conversions. 
23012
23013         * modifiers.cs: `NEW' modifier maps to HideBySig.
23014
23015         * expression.cs (PropertyExpr): Make this into an
23016         ExpressionStatement, and support the EmitStatement code path. 
23017
23018         Perform get/set error checking, clean up the interface.
23019
23020         * assign.cs: recognize PropertyExprs as targets, and if so, turn
23021         them into toplevel access objects.
23022
23023 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
23024
23025         * expression.cs: PropertyExpr::PropertyExpr: use work around the
23026         SRE.
23027
23028         * typemanager.cs: Keep track here of our PropertyBuilders again to
23029         work around lameness in SRE.
23030
23031 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
23032
23033         * expression.cs (LValue::LValueResolve): New method in the
23034         interface, used to perform a second resolution pass for LValues. 
23035
23036         (This::DoResolve): Catch the use of this in static methods.
23037
23038         (This::LValueResolve): Implement.
23039
23040         (This::Store): Remove warning, assigning to `this' in structures
23041         is 
23042
23043         (Invocation::Emit): Deal with invocation of
23044         methods on value types.  We need to pass the address to structure
23045         methods rather than the object itself.  (The equivalent code to
23046         emit "this" for structures leaves the entire structure on the
23047         stack instead of a pointer to it). 
23048
23049         (ParameterReference::DoResolve): Compute the real index for the
23050         argument based on whether the method takes or not a `this' pointer
23051         (ie, the method is static).
23052
23053         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
23054         value types returned from functions when we need to invoke a
23055         method on the sturcture.
23056
23057
23058 2001-10-11  Ravi Pratap  <ravi@ximian.com>
23059
23060         * class.cs (TypeContainer::DefineType): Method to actually do the business of
23061         defining the type in the Modulebuilder or Typebuilder. This is to take
23062         care of nested types which need to be defined on the TypeBuilder using
23063         DefineNestedMethod.
23064
23065         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
23066         methods in RootContext, only ported to be part of TypeContainer.
23067
23068         (TypeContainer::GetInterfaceOrClass): Ditto.
23069
23070         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
23071
23072         * interface.cs (Interface::DefineInterface): New method. Does exactly
23073         what RootContext.CreateInterface did earlier, only it takes care of nested types 
23074         too.
23075
23076         (Interface::GetInterfaces): Move from RootContext here and port.
23077
23078         (Interface::GetInterfaceByName): Same here.
23079
23080         * rootcontext.cs (ResolveTree): Re-write.
23081
23082         (PopulateTypes): Re-write.
23083
23084         * class.cs (TypeContainer::Populate): Populate nested types too.
23085         (TypeContainer::Emit): Emit nested members too.
23086
23087         * typemanager.cs (AddUserType): Do not make use of the FullName property,
23088         instead just use the name argument passed in as it is already fully
23089         qualified.
23090
23091         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
23092         to TypeContainer mapping to see if a type is user-defined.
23093
23094         * class.cs (TypeContainer::CloseType): Implement. 
23095
23096         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
23097         the default constructor.
23098
23099         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
23100         twice.
23101
23102         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
23103
23104         * interface.cs (CloseType): Create the type here.
23105
23106         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
23107         the hierarchy.
23108
23109         Remove all the methods which are now in TypeContainer.
23110
23111 2001-10-10  Ravi Pratap  <ravi@ximian.com>
23112
23113         * delegate.cs (Define): Re-write bits to define the delegate
23114         correctly.
23115
23116 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
23117
23118         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
23119
23120         * expression.cs (ImplicitReferenceConversion): handle null as well
23121         as a source to convert to any reference type.
23122
23123         * statement.cs (Return): Perform any implicit conversions to
23124         expected return type.  
23125
23126         Validate use of return statement.  
23127
23128         * codegen.cs (EmitContext): Pass the expected return type here.
23129
23130         * class.cs (Method, Constructor, Property): Pass expected return
23131         type to EmitContext.
23132
23133 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
23134
23135         * expression.cs: Make DoResolve take an EmitContext instead of a
23136         TypeContainer.
23137
23138         Replaced `l' and `location' for `loc', for consistency.
23139
23140         (Error, Warning): Remove unneeded Tc argument.
23141
23142         * assign.cs, literal.cs, constant.cs: Update to new calling
23143         convention. 
23144
23145         * codegen.cs: EmitContext now contains a flag indicating whether
23146         code is being generated in a static method or not.
23147
23148         * cs-parser.jay: DecomposeQI, new function that replaces the old
23149         QualifiedIdentifier.  Now we always decompose the assembled
23150         strings from qualified_identifier productions into a group of
23151         memberaccesses.
23152
23153 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
23154
23155         * rootcontext.cs: Deal with field-less struct types correctly now
23156         by passing the size option to Define Type.
23157
23158         * class.cs: Removed hack that created one static field. 
23159
23160 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23161
23162         * statement.cs: Moved most of the code generation here. 
23163
23164 2001-10-09  Ravi Pratap  <ravi@ximian.com>
23165
23166         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
23167         seem very right.
23168
23169         (ElementAccess): Remove useless bits for now - keep checks as the spec
23170         says.
23171
23172 2001-10-08  Ravi Pratap  <ravi@ximian.com>
23173
23174         * expression.cs (ElementAccess::DoResolve): Remove my crap code
23175         and start performing checks according to the spec.
23176
23177 2001-10-07  Ravi Pratap  <ravi@ximian.com>
23178
23179         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
23180         rank_specifiers instead.
23181
23182         (rank_specifiers): Change the order in which the rank specifiers are stored
23183
23184         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
23185
23186         * expression.cs (ElementAccess): Implement the LValue interface too.
23187
23188 2001-10-06  Ravi Pratap  <ravi@ximian.com>
23189
23190         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
23191         except that user defined conversions are not included.
23192
23193         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
23194         perform the conversion of the return type, if necessary.
23195
23196         (New::DoResolve): Check whether we are creating an array or an object
23197         and accordingly do the needful.
23198
23199         (New::Emit): Same here.
23200
23201         (New::DoResolve): Implement guts of array creation.
23202
23203         (New::FormLookupType): Helper function.
23204
23205 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23206
23207         * codegen.cs: Removed most of the code generation here, and move the
23208         corresponding code generation bits to the statement classes. 
23209
23210         Added support for try/catch/finalize and throw.
23211
23212         * cs-parser.jay: Added support for try/catch/finalize.
23213
23214         * class.cs: Catch static methods having the flags override,
23215         virtual or abstract.
23216
23217         * expression.cs (UserCast): This user cast was not really doing
23218         what it was supposed to do.  Which is to be born in fully resolved
23219         state.  Parts of the resolution were being performed at Emit time! 
23220
23221         Fixed this code.
23222
23223 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23224
23225         * expression.cs: Implicity convert the result from UserCast.
23226
23227 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23228
23229         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
23230         prevented it from working correctly. 
23231
23232         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
23233         merely ConvertImplicit.
23234
23235 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23236
23237         * typemanager.cs: Make the LookupTypeContainer function static,
23238         and not per-instance.  
23239
23240         * class.cs: Make static FindMembers (the one that takes a Type
23241         argument). 
23242
23243         * codegen.cs: Add EmitForeach here.
23244
23245         * cs-parser.jay: Make foreach a toplevel object instead of the
23246         inline expansion, as we need to perform semantic analysis on it. 
23247
23248 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23249
23250         * expression.cs (Expression::ImplicitUserConversion): Rename to
23251         UserDefinedConversion.
23252
23253         (Expression::UserDefinedConversion): Take an extra argument specifying 
23254         whether we look for explicit user conversions too.
23255
23256         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
23257
23258         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
23259
23260         (ExplicitUserConversion): Make it a call to UserDefinedConversion
23261         with the appropriate arguments.
23262
23263         * cs-parser.jay (cast_expression): Record location too.
23264
23265         * expression.cs (Cast): Record location info.
23266
23267         (Expression::ConvertExplicit): Take location argument.
23268
23269         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
23270         to determine if we are doing explicit conversions.
23271
23272         (UserCast::Emit): Update accordingly.
23273
23274         (Expression::ConvertExplicit): Report an error if everything fails.
23275
23276         * ../errors/cs0030.cs : Add.
23277
23278 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
23279
23280         * modifiers.cs: If the ABSTRACT keyword is present, also set the
23281         virtual and newslot bits. 
23282
23283         * class.cs (TypeContainer::RegisterRequiredImplementations):
23284         Record methods we need.
23285
23286         (TypeContainer::MakeKey): Helper function to make keys for
23287         MethodBases, since the Methodbase key is useless.
23288
23289         (TypeContainer::Populate): Call RegisterRequiredImplementations
23290         before defining the methods.   
23291
23292         Create a mapping for method_builders_to_methods ahead of time
23293         instead of inside a tight loop.
23294
23295         (::RequireMethods):  Accept an object as the data to set into the
23296         hashtable so we can report interface vs abstract method mismatch.
23297
23298 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23299
23300         * report.cs: Make all of it static.
23301
23302         * rootcontext.cs: Drop object_type and value_type computations, as
23303         we have those in the TypeManager anyways.
23304
23305         Drop report instance variable too, now it is a global.
23306
23307         * driver.cs: Use try/catch on command line handling.
23308
23309         Add --probe option to debug the error reporting system with a test
23310         suite. 
23311
23312         * report.cs: Add support for exiting program when a probe
23313         condition is reached.
23314
23315 2001-10-03  Ravi Pratap  <ravi@ximian.com>
23316
23317         * expression.cs (Binary::DoNumericPromotions): Fix the case when
23318         we do a forcible conversion regardless of type, to check if 
23319         ForceConversion returns a null.
23320
23321         (Binary::error19): Use location to report error.
23322
23323         (Unary::error23): Use location here too.
23324
23325         * ../errors/cs0019.cs : Check in.
23326
23327         * ../errors/cs0023.cs : Check in.
23328
23329         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
23330         case of a non-null MethodInfo object with a length of 0 !
23331
23332         (Binary::ResolveOperator): Flag error if overload resolution fails to find
23333         an applicable member - according to the spec :-)
23334         Also fix logic to find members in base types.
23335
23336         (Unary::ResolveOperator): Same here.
23337
23338         (Unary::report23): Change name to error23 and make first argument a TypeContainer
23339         as I was getting thoroughly confused between this and error19 :-)
23340
23341         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
23342         (::FindMostEncompassedType): Implement.
23343         (::FindMostEncompassingType): Implement.
23344         (::StandardConversionExists): Implement.
23345
23346         (UserImplicitCast): Re-vamp. We now need info about most specific
23347         source and target types so that we can do the necessary conversions.
23348
23349         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
23350         mathematical union with no duplicates.
23351
23352 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23353
23354         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
23355         in order from base classes to child classes, so that we can in
23356         child classes look up in our parent for method names and
23357         attributes (required for handling abstract, virtual, new, override
23358         constructs: we need to instrospect our base class, and if we dont
23359         populate the classes in order, the introspection might be
23360         incorrect.  For example, a method could query its parent before
23361         the parent has any methods and would determine that the parent has
23362         no abstract methods (while it could have had them)).
23363
23364         (RootContext::CreateType): Record the order in which we define the
23365         classes.
23366
23367 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
23368
23369         * class.cs (TypeContainer::Populate): Also method definitions can
23370         fail now, keep track of this.
23371
23372         (TypeContainer::FindMembers): Implement support for
23373         DeclaredOnly/noDeclaredOnly flag.
23374
23375         (Constructor::Emit) Return the ConstructorBuilder.
23376
23377         (Method::Emit) Return the MethodBuilder. 
23378         Check for abstract or virtual methods to be public.
23379
23380         * rootcontext.cs (RootContext::CreateType): Register all the
23381         abstract methods required for the class to be complete and the
23382         interface methods that must be implemented. 
23383
23384         * cs-parser.jay: Report error 501 (method requires body if it is
23385         not marked abstract or extern).
23386
23387         * expression.cs (TypeOf::Emit): Implement.
23388
23389         * typemanager.cs: runtime_handle_type, new global type.
23390
23391         * class.cs (Property::Emit): Generate code for properties.
23392
23393 2001-10-02  Ravi Pratap  <ravi@ximian.com>
23394
23395         * expression.cs (Unary::ResolveOperator): Find operators on base type
23396         too - we now conform exactly to the spec.
23397
23398         (Binary::ResolveOperator): Same here.
23399
23400         * class.cs (Operator::Define): Fix minor quirk in the tests.
23401
23402         * ../errors/cs0215.cs : Added.
23403
23404         * ../errors/cs0556.cs : Added.
23405
23406         * ../errors/cs0555.cs : Added.
23407
23408 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23409
23410         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
23411         single integer which is really efficient
23412
23413 2001-10-01  Ravi Pratap  <ravi@ximian.com>
23414
23415         *  expression.cs (Expression::ImplicitUserConversion): Use location
23416         even in the case when we are examining True operators.
23417  
23418         * class.cs (Operator::Define): Perform extensive checks to conform
23419         with the rules for operator overloading in the spec.
23420
23421         * expression.cs (Expression::ImplicitReferenceConversion): Implement
23422         some of the other conversions mentioned in the spec.
23423
23424         * typemanager.cs (array_type): New static member for the System.Array built-in
23425         type.
23426
23427         (cloneable_interface): For System.ICloneable interface.
23428
23429         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
23430         we start resolving the tree and populating types.
23431
23432         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
23433  
23434 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23435
23436         * expression.cs (Expression::ExprClassFromMemberInfo,
23437         Expression::Literalize): Create literal expressions from
23438         FieldInfos which are literals.
23439
23440         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
23441         type casts, because they were wrong.  The test suite in tests
23442         caught these ones.
23443
23444         (ImplicitNumericConversion): ushort to ulong requires a widening
23445         cast. 
23446
23447         Int32 constant to long requires widening cast as well.
23448
23449         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
23450         for integers because the type on the stack is not i4.
23451
23452 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
23453
23454         * expression.cs (report118): require location argument. 
23455
23456         * parameter.cs: Do not dereference potential null value.
23457
23458         * class.cs: Catch methods that lack the `new' keyword when
23459         overriding a name.  Report warnings when `new' is used without
23460         anything being there to override.
23461
23462         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
23463
23464         * class.cs: Only add constructor to hashtable if it is non-null
23465         (as now constructors can fail on define).
23466
23467         (TypeManager, Class, Struct): Take location arguments.
23468
23469         Catch field instance initialization in structs as errors.
23470
23471         accepting_filter: a new filter for FindMembers that is static so
23472         that we dont create an instance per invocation.
23473
23474         (Constructor::Define): Catch errors where a struct constructor is
23475         parameterless 
23476
23477         * cs-parser.jay: Pass location information for various new
23478         constructs. 
23479
23480         * delegate.cs (Delegate): take a location argument.
23481
23482         * driver.cs: Do not call EmitCode if there were problesm in the
23483         Definition of the types, as many Builders wont be there. 
23484
23485         * decl.cs (Decl::Decl): Require a location argument.
23486
23487         * cs-tokenizer.cs: Handle properly hex constants that can not fit
23488         into integers, and find the most appropiate integer for it.
23489
23490         * literal.cs: Implement ULongLiteral.
23491
23492         * rootcontext.cs: Provide better information about the location of
23493         failure when CreateType fails.
23494
23495 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
23496
23497         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23498         as well.
23499
23500         * expression.cs (Binary::CheckShiftArguments): Add missing type
23501         computation.
23502         (Binary::ResolveOperator): Add type to the logical and and logical
23503         or, Bitwise And/Or and Exclusive Or code paths, it was missing
23504         before.
23505
23506         (Binary::DoNumericPromotions): In the case where either argument
23507         is ulong (and most signed types combined with ulong cause an
23508         error) perform implicit integer constant conversions as well.
23509
23510 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23511
23512         * expression.cs (UserImplicitCast): Method should always be
23513         non-null. 
23514         (Invocation::BetterConversion): Simplified test for IntLiteral.
23515
23516         (Expression::ImplicitNumericConversion): Split this routine out.
23517         Put the code that performs implicit constant integer conversions
23518         here. 
23519
23520         (Expression::Resolve): Become a wrapper around DoResolve so we can
23521         check eclass and type being set after resolve.
23522
23523         (Invocation::Badness): Remove this dead function
23524
23525         (Binary::ResolveOperator): Do not compute the expensive argumnets
23526         unless we have a union for it.
23527
23528         (Probe::Emit): Is needs to do an isinst and then
23529         compare against null.
23530
23531         (::CanConvert): Added Location argument.  If the Location argument
23532         is null (Location.Null), then we do not report errors.  This is
23533         used by the `probe' mechanism of the Explicit conversion.  We do
23534         not want to generate an error for something that the user
23535         explicitly requested to be casted.  But the pipeline for an
23536         explicit cast first tests for potential implicit casts.
23537
23538         So for now, if the Location is null, it means `Probe only' to
23539         avoid adding another argument.   Might have to revise this
23540         strategy later.
23541
23542         (ClassCast): New class used to type cast objects into arbitrary
23543         classes (used in Explicit Reference Conversions).
23544
23545         Implement `as' as well.
23546
23547         Reverted all the patches from Ravi below: they were broken:
23548
23549                 * The use of `level' as a mechanism to stop recursive
23550                   invocations is wrong.  That was there just to catch the
23551                   bug with a strack trace but not as a way of addressing
23552                   the problem.
23553
23554                   To fix the problem we have to *understand* what is going
23555                   on and the interactions and come up with a plan, not
23556                   just get things going.
23557
23558                 * The use of the type conversion cache that I proposed
23559                   last night had an open topic: How does this work across
23560                   protection domains.  A user defined conversion might not
23561                   be public in the location where we are applying the
23562                   conversion, a different conversion might be selected
23563                   (ie, private A->B (better) but public B->A (worse),
23564                   inside A, A->B applies, but outside it, B->A will
23565                   apply).
23566
23567                 * On top of that (ie, even if the above is solved),
23568                   conversions in a cache need to be abstract.  Ie, `To
23569                   convert from an Int to a Short use an OpcodeCast', not
23570                   `To convert from an Int to a Short use the OpcodeCast on
23571                   the variable 5' (which is what this patch was doing).
23572
23573 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23574
23575         * expression.cs (Invocation::ConversionExists): Re-write to use
23576         the conversion cache
23577
23578         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23579         cache all conversions done, not just user-defined ones.
23580
23581         (Invocation::BetterConversion): The real culprit. Use ConversionExists
23582         to determine if a conversion exists instead of acutually trying to 
23583         perform the conversion. It's faster too.
23584
23585         (Expression::ConvertExplicit): Modify to use ConversionExists to check
23586         and only then attempt the implicit conversion.
23587
23588 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23589
23590         * expression.cs (ConvertImplicit): Use a cache for conversions
23591         already found. Check level of recursion and bail out if necessary.
23592
23593 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23594
23595         * typemanager.cs (string_concat_string_string, string_concat_object_object):
23596         Export standard methods that we expect for string operations.
23597
23598         * statement.cs (Block::UsageWarning): Track usage of variables and
23599         report the errors for not used variables.
23600
23601         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23602         operator. 
23603
23604 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23605
23606         * codegen.cs: remove unnneded code 
23607
23608         * expression.cs: Removed BuiltinTypeAccess class
23609
23610         Fix the order in which implicit conversions are
23611         done.  
23612
23613         The previous fixed dropped support for boxed conversions (adding a
23614         test to the test suite now)
23615
23616         (UserImplicitCast::CanConvert): Remove test for source being null,
23617         that code is broken.  We should not feed a null to begin with, if
23618         we do, then we should track the bug where the problem originates
23619         and not try to cover it up here.
23620
23621         Return a resolved expression of type UserImplicitCast on success
23622         rather than true/false.  Ravi: this is what I was talking about,
23623         the pattern is to use a static method as a "constructor" for
23624         objects. 
23625
23626         Also, do not create arguments until the very last minute,
23627         otherwise we always create the arguments even for lookups that
23628         will never be performed. 
23629
23630         (UserImplicitCast::Resolve): Eliminate, objects of type
23631         UserImplicitCast are born in a fully resolved state. 
23632
23633         * typemanager.cs (InitCoreTypes): Init also value_type
23634         (System.ValueType). 
23635
23636         * expression.cs (Cast::Resolve): First resolve the child expression.
23637
23638         (LValue): Add new method AddressOf to be used by
23639         the `&' operator.  
23640
23641         Change the argument of Store to take an EmitContext instead of an
23642         ILGenerator, because things like FieldExpr need to be able to call
23643         their children expression to generate the instance code. 
23644
23645         (Expression::Error, Expression::Warning): Sugar functions for
23646         reporting errors.
23647
23648         (Expression::MemberLookup): Accept a TypeContainer instead of a
23649         Report as the first argument.
23650
23651         (Expression::ResolvePrimary): Killed.  I still want to improve
23652         this as currently the code is just not right.
23653
23654         (Expression::ResolveMemberAccess): Simplify, but it is still
23655         wrong. 
23656
23657         (Unary::Resolve): Catch errors in AddressOf operators.
23658
23659         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23660         index to a byte for the short-version, or the compiler will choose
23661         the wrong Emit call, which generates the wrong data.
23662
23663         (ParameterReference::Emit, ::Store): same.
23664
23665         (FieldExpr::AddressOf): Implement.
23666
23667         * typemanager.cs: TypeManager: made public variable instead of
23668         property.
23669
23670         * driver.cs: document --fatal.
23671
23672         * report.cs (ErrorMessage, WarningMessage): new names for the old
23673         Error and Warning classes.
23674
23675         * cs-parser.jay (member_access): Turn built-in access to types
23676         into a normal simplename
23677
23678 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23679
23680         * expression.cs (Invocation::BetterConversion): Fix to cope
23681         with q being null, since this was introducing a bug.
23682
23683         * expression.cs (ConvertImplicit): Do built-in conversions first.
23684
23685 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23686
23687         * expression.cs (UserImplicitCast::Resolve): Fix bug.
23688
23689 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23690
23691         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23692         I had introduced long ago (what's new ?).
23693
23694         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
23695         the work of all the checking. 
23696         (ConvertImplicit): Call CanConvert and only then create object if necessary.
23697         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23698
23699         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23700         that is the right way. 
23701
23702         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
23703         overloading resolution. Use everywhere instead of cutting and pasting code.
23704
23705         (Binary::ResolveOperator): Use MakeUnionSet.
23706
23707         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
23708         we have to convert to bool types. Not complete yet.
23709
23710 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23711
23712         * typemanager.cs (TypeManager::CSharpName): support ushort.
23713
23714         * expression.cs (Expression::TryImplicitIntConversion): Attempts
23715         to provide an expression that performsn an implicit constant int
23716         conversion (section 6.1.6).
23717         (Expression::ConvertImplicitRequired): Reworked to include
23718         implicit constant expression conversions.
23719
23720         (Expression::ConvertNumericExplicit): Finished.
23721
23722         (Invocation::Emit): If InstanceExpression is null, then it means
23723         that we perform a call on this.
23724
23725 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23726
23727         * expression.cs (Unary::Emit): Remove some dead code.
23728         (Probe): Implement Resolve and Emit for `is'.
23729         (Expression::ConvertImplicitRequired): Attempt to do constant
23730         expression conversions here.  Maybe should be moved to
23731         ConvertImplicit, but I am not sure.
23732         (Expression::ImplicitLongConstantConversionPossible,
23733         Expression::ImplicitIntConstantConversionPossible): New functions
23734         that tell whether is it possible to apply an implicit constant
23735         expression conversion.
23736
23737         (ConvertNumericExplicit): Started work on explicit numeric
23738         conversions.
23739
23740         * cs-parser.jay: Update operator constants.
23741
23742         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23743         (Parameters::GetSignature): Hook up VerifyArgs here.
23744         (Parameters::VerifyArgs): Verifies that no two arguments have the
23745         same name. 
23746
23747         * class.cs (Operator): Update the operator names to reflect the
23748         ones that the spec expects (as we are just stringizing the
23749         operator names).
23750
23751         * expression.cs (Unary::ResolveOperator): Fix bug: Use
23752         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23753         previous usage did only work for our methods.
23754         (Expression::ConvertImplicit): Handle decimal implicit numeric
23755         conversions as well.
23756         (Expression::InternalTypeConstructor): Used to invoke constructors
23757         on internal types for default promotions.
23758
23759         (Unary::Emit): Implement special handling for the pre/post
23760         increment/decrement for overloaded operators, as they need to have
23761         the same semantics as the other operators.
23762
23763         (Binary::ResolveOperator): ditto.
23764         (Invocation::ConversionExists): ditto.
23765         (UserImplicitCast::Resolve): ditto.
23766
23767 2001-09-26  Ravi Pratap  <ravi@ximian.com>
23768
23769         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23770         operator, return after emitting body. Regression tests pass again !
23771
23772         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23773         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23774         (Invocation::OverloadResolve): Ditto.
23775         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23776
23777         * everywhere : update calls to the above methods accordingly.
23778
23779 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23780
23781         * assign.cs (Assign): Make it inherit from ExpressionStatement.
23782
23783         * expression.cs (ExpressionStatement): New base class used for
23784         expressions that can appear in statements, so that we can provide
23785         an alternate path to generate expression that do not leave a value
23786         on the stack.
23787
23788         (Expression::Emit, and all the derivatives): We no longer return
23789         whether a value is left on the stack or not.  Every expression
23790         after being emitted leaves a single value on the stack.
23791
23792         * codegen.cs (EmitContext::EmitStatementExpression): Use the
23793         facilties of ExpressionStatement if possible.
23794
23795         * cs-parser.jay: Update statement_expression.
23796
23797 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
23798
23799         * driver.cs: Change the wording of message
23800
23801 2001-09-25  Ravi Pratap  <ravi@ximian.com>
23802
23803         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
23804         the type of the expression to the return type of the method if
23805         we have an overloaded operator match ! The regression tests pass again !
23806         (Unary::ResolveOperator): Ditto.
23807
23808         * expression.cs (Invocation::ConversionExists): Correct the member lookup
23809         to find "op_Implicit", not "implicit" ;-)
23810         (UserImplicitCast): New class to take care of user-defined implicit conversions.
23811         (ConvertImplicit, ForceConversion): Take TypeContainer argument
23812
23813         * everywhere : Correct calls to the above accordingly.
23814
23815         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
23816         (ConvertImplicit): Do user-defined conversion if it exists.
23817
23818 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
23819
23820         * assign.cs: track location.
23821         (Resolve): Use implicit conversions on assignment.
23822
23823         * literal.cs: Oops.  Not good, Emit of short access values should
23824         pass (Bytes) or the wrong argument will be selected.
23825
23826         * expression.cs (Unary::Emit): Emit code for -expr.
23827
23828         (Unary::ResolveOperator): Handle `Substract' for non-constants
23829         (substract from zero from the non-constants).
23830         Deal with Doubles as well. 
23831
23832         (Expression::ConvertImplicitRequired): New routine that reports an
23833         error if no implicit conversion exists. 
23834
23835         (Invocation::OverloadResolve): Store the converted implicit
23836         expressions if we make them
23837
23838 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23839
23840         * class.cs (ConstructorInitializer): Take a Location argument.
23841         (ConstructorBaseInitializer): Same here.
23842         (ConstructorThisInitializer): Same here.
23843
23844         * cs-parser.jay : Update all calls accordingly.
23845
23846         * expression.cs (Unary, Binary, New): Take location argument.
23847         Update accordingly everywhere.
23848
23849         * cs-parser.jay : Update all calls to the above to take a location
23850         argument.
23851
23852         * class.cs : Ditto.
23853
23854 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23855
23856         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
23857         (Invocation::BetterConversion): Same here
23858         (Invocation::ConversionExists): Ditto.
23859
23860         (Invocation::ConversionExists): Implement.
23861
23862 2001-09-22  Ravi Pratap  <ravi@ximian.com>
23863
23864         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
23865         Also take an additional TypeContainer argument.
23866
23867         * All over : Pass in TypeContainer as argument to OverloadResolve.
23868
23869         * typemanager.cs (CSharpName): Update to check for the string type and return
23870         that too.
23871
23872         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
23873         a given method.
23874
23875 2001-09-21  Ravi Pratap  <ravi@ximian.com>
23876
23877         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
23878         (Invocation::BetterFunction): Implement.
23879         (Invocation::BetterConversion): Implement.
23880         (Invocation::ConversionExists): Skeleton, no implementation yet.
23881
23882         Okay, things work fine !
23883
23884 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
23885
23886         * typemanager.cs: declare and load enum_type, delegate_type and
23887         void_type. 
23888
23889         * expression.cs (Expression::Emit): Now emit returns a value that
23890         tells whether a value is left on the stack or not.  This strategy
23891         might be reveted tomorrow with a mechanism that would address
23892         multiple assignments.
23893         (Expression::report118): Utility routine to report mismatches on
23894         the ExprClass.
23895
23896         (Unary::Report23): Report impossible type/operator combination
23897         utility function.
23898
23899         (Unary::IsIncrementableNumber): Whether the type can be
23900         incremented or decremented with add.
23901         (Unary::ResolveOperator): Also allow enumerations to be bitwise
23902         complemented. 
23903         (Unary::ResolveOperator): Implement ++, !, ~,
23904
23905         (Invocation::Emit): Deal with new Emit convetion.
23906
23907         * All Expression derivatives: Updated their Emit method to return
23908         whether they leave values on the stack or not.
23909
23910         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
23911         stack for expressions that are statements. 
23912
23913 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
23914
23915         * expression.cs (LValue): New interface.  Must be implemented by
23916         LValue objects.
23917         (LocalVariableReference, ParameterReference, FieldExpr): Implement
23918         LValue interface.
23919
23920         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
23921         interface for generating code, simplifies the code.
23922
23923 2001-09-20  Ravi Pratap  <ravi@ximian.com>
23924
23925         * expression.cs (everywhere): Comment out return statements in ::Resolve
23926         methods to avoid the warnings.
23927
23928 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
23929
23930         * driver.cs (parse): Report error 2001 if we can not open the
23931         source file.
23932
23933         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
23934         not resolve it.
23935
23936         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
23937         object. 
23938
23939         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
23940         otherwise nested blocks end up with the same index.
23941
23942         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
23943
23944         * expression.cs:  Instead of having FIXMEs in the Resolve
23945         functions, throw exceptions so it is obvious that we are facing a
23946         bug. 
23947
23948         * cs-parser.jay (invocation_expression): Pass Location information.
23949
23950         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
23951         Use a basename for those routines because .NET does not like paths
23952         on them. 
23953
23954         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
23955         already defined.
23956
23957 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
23958
23959         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
23960         are loading the correct data types (throws an exception if not).
23961         (TypeManager::InitCoreTypes): Use CoreLookupType
23962
23963         * expression.cs (Unary::ResolveOperator): return the child
23964         expression for expressions which are just +expr.
23965         (Unary::ResolveOperator): Return negative literals for -LITERAL
23966         expressions (otherwise they are Unary {Literal}).
23967         (Invocation::Badness): Take into account `Implicit constant
23968         expression conversions'.
23969
23970         * literal.cs (LongLiteral): Implement long literal class.
23971         (IntLiteral): export the `Value' of the intliteral. 
23972
23973 2001-09-19  Ravi Pratap  <ravi@ximian.com>
23974
23975         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
23976
23977         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
23978         instead of 'Operator'
23979
23980         * expression.cs (Binary::ResolveOperator): Update accordingly.
23981         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
23982         and 'Minus'
23983
23984         * cs-parser.jay (unary_expression): Update to use the new names.
23985
23986         * gen-treedump.cs (GetUnary): Same here.
23987
23988         * expression.cs (Unary::Resolve): Implement.
23989         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
23990         operators are found instead of making noise ;-)
23991         (Unary::ResolveOperator): New method to do precisely the same thing which
23992         Binary::ResolveOperator does for Binary expressions.
23993         (Unary.method, .Arguments): Add.
23994         (Unary::OperName): Implement.   
23995         (Unary::ForceConversion): Copy and Paste !
23996
23997         * class.cs (Operator::Define): Fix a small bug for the case when we have 
23998         a unary operator.
23999
24000         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
24001         for the inbuilt operators. Only overloading works for now ;-)
24002
24003 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
24004
24005         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
24006         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
24007
24008         * expression.cs (This::Emit): Implement. 
24009         (This::Resolve): Implement.
24010         (TypeOf:Resolve): Implement.
24011         (Expression::ResolveSimpleName): Add an implicit this to instance
24012         field references. 
24013         (MemberAccess::Resolve): Deal with Parameters and Fields. 
24014         Bind instance variable to Field expressions.
24015         (FieldExpr::Instance): New field used to track the expression that
24016         represents the object instance.
24017         (FieldExpr::Resolve): Track potential errors from MemberLookup not
24018         binding 
24019         (FieldExpr::Emit): Implement.
24020
24021         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
24022         the last instruction contains a return opcode to avoid generating
24023         the last `ret' instruction (this generates correct code, and it is
24024         nice to pass the peverify output).
24025
24026         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
24027         initializer for static and instance variables.
24028         (Constructor::Emit): Allow initializer to be null in the case of
24029         static constructors.  Only emit initializer for instance
24030         constructors. 
24031
24032         (TypeContainer::FindMembers): Return a null array if there are no
24033         matches.
24034
24035         Also fix the code for the MemberTypes.Method branch, as it was not
24036         scanning that for operators (or tried to access null variables before).
24037
24038         * assign.cs (Assign::Emit): Handle instance and static fields. 
24039
24040         * TODO: Updated.
24041
24042         * driver.cs: Stop compilation if there are parse errors.
24043
24044         * cs-parser.jay (constructor_declaration): Provide default base
24045         initializer for non-static constructors.
24046         (constructor_declarator): Do not provide a default base
24047         initializers if none was specified.
24048         Catch the fact that constructors should not have parameters.
24049
24050         * class.cs: Do not emit parent class initializers for static
24051         constructors, that should be flagged as an error.
24052
24053 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24054
24055         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
24056         Move back code into TypeContainer::Populate.
24057
24058 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24059
24060         * class.cs (TypeContainer::AddConstructor): Fix the check to
24061         compare against Name, not Basename. 
24062         (Operator::OpType): Change Plus and Minus to Add and Subtract.
24063
24064         * cs-parser.jay : Update accordingly.
24065
24066         * class.cs (TypeContainer::FindMembers): For the case where we are searching
24067         for methods, don't forget to look into the operators too.
24068         (RegisterMethodBuilder): Helper method to take care of this for
24069         methods, constructors and operators.
24070         (Operator::Define): Completely revamp.
24071         (Operator.OperatorMethod, MethodName): New fields.
24072         (TypeContainer::Populate): Move the registering of builders into
24073         RegisterMethodBuilder.
24074         (Operator::Emit): Re-write.
24075
24076         * expression.cs (Binary::Emit): Comment out code path to emit method
24077         invocation stuff for the case when we have a user defined operator. I am
24078         just not able to get it right !
24079
24080 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24081
24082         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
24083         argument. 
24084
24085         (Expression::MemberLookup): Provide a version that allows to
24086         specify the MemberTypes and BindingFlags. 
24087
24088         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
24089         so it was not fetching variable information from outer blocks.
24090
24091         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
24092         Beforefieldinit as it was buggy.
24093
24094         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
24095         that Ravi put here.  
24096
24097         * class.cs (Constructor::Emit): Only emit if block is not null.
24098         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
24099         deal with this by semantically definining it as if the user had
24100         done it.
24101
24102         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
24103         constructors as we now "emit" them at a higher level.
24104
24105         (TypeContainer::DefineDefaultConstructor): Used to define the
24106         default constructors if none was provided.
24107
24108         (ConstructorInitializer): Add methods Resolve and Emit. 
24109
24110         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
24111
24112 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24113
24114         * class.cs (TypeContainer::EmitDefaultConstructor): Register
24115         the default constructor builder with our hashtable for methodbuilders
24116         to methodcores.
24117
24118         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
24119         and argument_count is 0 in which case we have a match.
24120         (Binary::ResolveOperator): More null checking and miscellaneous coding
24121         style cleanup.
24122
24123 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24124
24125         * rootcontext.cs (IsNameSpace): Compare against null.
24126
24127         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
24128
24129         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
24130         and Unary::Operator.
24131
24132         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
24133         accordingly.
24134
24135         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
24136         we have overloaded operators.
24137         (Binary::ResolveOperator): Implement the part which does the operator overload
24138         resolution.
24139
24140         * class.cs (Operator::Emit): Implement.
24141         (TypeContainer::Emit): Emit the operators we have too.
24142
24143         * expression.cs (Binary::Emit): Update to emit the appropriate code for
24144         the case when we have a user-defined operator.
24145
24146 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24147
24148         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
24149
24150 2001-09-16  Ravi Pratap  <ravi@ximian.com>
24151
24152         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
24153         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
24154         (Constructor::Emit): Implement.
24155         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
24156         if we have no work to do. 
24157         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
24158         Emit method.
24159
24160         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
24161         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
24162
24163         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
24164         of parent.parent.
24165
24166 2001-09-15  Ravi Pratap  <ravi@ximian.com>
24167
24168         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
24169         in the source.
24170         (Tree::RecordNamespace): Method to do what the name says ;-)
24171         (Tree::Namespaces): Property to get at the namespaces hashtable.
24172
24173         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
24174         keep track.
24175
24176         * rootcontext.cs (IsNamespace): Fixed it :-)
24177
24178 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24179
24180         * class.cs (TypeContainer::FindMembers): Add support for
24181         constructors. 
24182         (MethodCore): New class that encapsulates both the shared aspects
24183         of a Constructor and a Method.  
24184         (Method, Constructor): Factored pieces into MethodCore.
24185
24186         * driver.cs: Added --fatal which makes errors throw exceptions.
24187         Load System assembly as well as part of the standard library.
24188
24189         * report.cs: Allow throwing exceptions on errors for debugging.
24190
24191         * modifiers.cs: Do not use `parent', instead use the real type
24192         container to evaluate permission settings.
24193
24194         * class.cs: Put Ravi's patch back in.  He is right, and we will
24195         have to cope with the
24196
24197 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24198
24199         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
24200         FamORAssem, not FamANDAssem.
24201
24202 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24203
24204         * driver.cs: Added --parse option that only parses its input files
24205         and terminates.
24206
24207         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
24208         incorrect.  IsTopLevel is not used to tell whether an object is
24209         root_types or not (that can be achieved by testing this ==
24210         root_types).  But to see if this is a top-level *class* (not
24211         necessarly our "toplevel" container). 
24212
24213 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24214
24215         * enum.cs (Enum::Define): Modify to call the Lookup method on the
24216         parent instead of a direct call to GetType.
24217
24218 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24219
24220         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
24221         Modifiers.TypeAttr. This should just be a call to that method.
24222
24223         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
24224         object so that we can determine if we are top-level or not.
24225
24226         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
24227         TypeContainer too.
24228
24229         * enum.cs (Enum::Define): Ditto.
24230
24231         * modifiers.cs (FieldAttr): Re-write.
24232
24233         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
24234         (TypeContainer::HaveStaticConstructor): New property to provide access
24235         to precisely that info.
24236
24237         * modifiers.cs (MethodAttr): Re-write.
24238         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
24239
24240         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
24241         of top-level types as claimed.
24242
24243 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24244
24245         * expression.cs (MemberLookup): Fruitless attempt to lookup
24246         constructors.  Maybe I need to emit default constructors?  That
24247         might be it (currently .NET emits this for me automatically).
24248         (Invocation::OverloadResolve): Cope with Arguments == null.
24249         (Invocation::EmitArguments): new function, shared by the new
24250         constructor and us.
24251         (Invocation::Emit): Handle static and instance methods.  Emit
24252         proper call instruction for virtual or non-virtual invocations.
24253         (New::Emit): Implement.
24254         (New::Resolve): Implement.
24255         (MemberAccess:Resolve): Implement.
24256         (MethodGroupExpr::InstanceExpression): used conforming to the spec
24257         to track instances.
24258         (FieldExpr::Resolve): Set type.
24259
24260         * support.cs: Handle empty arguments.
24261                 
24262         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
24263         SimpleLookup): Auxiliary routines to help parse a qualifier
24264         identifier.  
24265
24266         Update qualifier_identifier rule.
24267
24268         * codegen.cs: Removed debugging messages.
24269
24270         * class.cs: Make this a global thing, this acts just as a "key" to
24271         objects that we might have around.
24272
24273         (Populate): Only initialize method_builders_to_methods once.
24274
24275         * expression.cs (PropertyExpr): Initialize type from the
24276         PropertyType. 
24277
24278         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
24279         Resolve pattern.  Attempt to implicitly convert value to boolean.
24280         Emit code.
24281
24282         * expression.cs: Set the type for the int32/int32 argument case.
24283         (Binary::ResolveOperator): Set the return type to boolean for
24284         comparission operators
24285
24286         * typemanager.cs: Remove debugging print code.
24287
24288         (Invocation::Resolve): resolve type.
24289
24290         * class.cs: Allocate a MemberInfo of the correct size, as the code
24291         elsewhere depends on the test to reflect the correct contents.
24292
24293         (Method::) Keep track of parameters, due to System.Reflection holes
24294
24295         (TypeContainer::Populate): Keep track of MethodBuilders to Method
24296         mapping here.
24297
24298         (TypeContainer::FindMembers): Use ArrayList and then copy an array
24299         of the exact size and return that.
24300
24301         (Class::LookupMethodByBuilder): New function that maps
24302         MethodBuilders to its methods.  Required to locate the information
24303         on methods because System.Reflection bit us again.
24304
24305         * support.cs: New file, contains an interface ParameterData and
24306         two implementations: ReflectionParameters and InternalParameters
24307         used to access Parameter information.  We will need to grow this
24308         as required.
24309
24310         * expression.cs (Invocation::GetParameterData): implement a cache
24311         and a wrapper around the ParameterData creation for methods. 
24312         (Invocation::OverloadResolve): Use new code.
24313
24314 2001-09-13  Ravi Pratap  <ravi@ximian.com>
24315
24316         * class.cs (TypeContainer::EmitField): Remove and move into 
24317         (Field::Define): here and modify accordingly.
24318         (Field.FieldBuilder): New member.
24319         (TypeContainer::Populate): Update accordingly.
24320         (TypeContainer::FindMembers): Implement.
24321
24322 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24323
24324         * statement.cs: (VariableInfo::VariableType): New field to be
24325         initialized with the full type once it is resolved. 
24326
24327 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
24328
24329         * parameter.cs (GetParameterInfo): Use a type cache to compute
24330         things only once, and to reuse this information
24331
24332         * expression.cs (LocalVariableReference::Emit): Implement.
24333         (OpcodeCast::Emit): fix.
24334
24335         (ParameterReference::Resolve): Implement.
24336         (ParameterReference::Emit): Implement.
24337
24338         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
24339         that are expressions need to stay as Expressions.
24340
24341         * typemanager.cs (CSharpName): Returns the C# name of a type if
24342         possible. 
24343
24344         * expression.cs (Expression::ConvertImplicit): New function that
24345         implements implicit type conversions.
24346
24347         (Expression::ImplicitReferenceConversion): Implements implicit
24348         reference conversions.
24349
24350         (EmptyCast): New type for transparent casts.
24351
24352         (OpcodeCast): New type for casts of types that are performed with
24353         a sequence of bytecodes.
24354
24355         (BoxedCast): New type used for casting value types into reference
24356         types.  Emits a box opcode.
24357
24358         (Binary::DoNumericPromotions): Implements numeric promotions of
24359         and computation of the Binary::Type.
24360
24361         (Binary::EmitBranchable): Optimization.
24362
24363         (Binary::Emit): Implement code emission for expressions.
24364
24365         * typemanager.cs (TypeManager): Added two new core types: sbyte
24366         and byte.
24367
24368 2001-09-12  Ravi Pratap  <ravi@ximian.com>
24369
24370         * class.cs (TypeContainer::FindMembers): Method which does exactly
24371         what Type.FindMembers does, only we don't have to use reflection. No
24372         implementation yet.
24373
24374         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
24375         typecontainer objects as we need to get at them.
24376         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
24377
24378         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
24379         typecontainer object.
24380
24381         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
24382         of just a Report object.
24383
24384 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24385
24386         * class.cs (Event::Define): Go back to using the prefixes "add_" and
24387         "remove_"
24388         (TypeContainer::Populate): Now define the delegates of the type too.
24389         (TypeContainer.Delegates): Property to access the list of delegates defined
24390         in the type.
24391
24392         * delegates.cs (Delegate::Define): Implement partially.
24393
24394         * modifiers.cs (TypeAttr): Handle more flags.
24395
24396 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24397
24398         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
24399         and not <=
24400         (Operator::Define): Re-write logic to get types by using the LookupType method
24401         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
24402         (Indexer::Define): Ditto.
24403         (Event::Define): Ditto.
24404         (Property::Define): Ditto.
24405
24406 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24407
24408         * class.cs (TypeContainer::Populate): Now define operators too. 
24409         (TypeContainer.Operators): New property to access the list of operators
24410         in a type.
24411         (Operator.OperatorMethodBuilder): New member to hold the method builder
24412         for the operator we are defining.
24413         (Operator::Define): Implement.
24414
24415 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24416
24417         * class.cs (Event::Define): Make the prefixes of the accessor methods
24418         addOn_ and removeOn_ 
24419
24420         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
24421         of the location being passed in too. Ideally, this should go later since all
24422         error reporting should be done through the Report object.
24423
24424         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
24425         (Populate): Iterate thru the indexers we have and define them too.
24426         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
24427         for the get and set accessors.
24428         (Indexer::Define): Implement.
24429
24430 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
24431
24432         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
24433         my previous implementation, did not work.
24434
24435         * typemanager.cs: Add a couple of missing types (the longs).
24436
24437         * literal.cs: Use TypeManager.bool_type instead of getting it.
24438
24439         * expression.cs (EventExpr): New kind of expressions.
24440         (Expressio::ExprClassFromMemberInfo): finish
24441
24442 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
24443
24444         * assign.cs: Emit stores to static fields differently.
24445
24446 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24447
24448         * Merge in changes and adjust code to tackle conflicts. Backed out my
24449         code in Assign::Resolve ;-) 
24450
24451 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24452
24453         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
24454         instead Report.Error and also pass in the location.
24455         (CSharpParser::Lexer): New readonly property to return the reference
24456         to the Tokenizer object.
24457         (declare_local_variables): Use Report.Error with location instead of plain 
24458         old error.
24459         (CheckDef): Ditto.
24460
24461         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
24462         (Operator.CheckBinaryOperator): Ditto.
24463
24464         * cs-parser.jay (operator_declarator): Update accordingly.
24465
24466         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
24467         (CheckBinaryOperator): Same here.
24468
24469         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
24470         on the name without any prefixes of namespace names etc. This is because we
24471         already might have something already fully qualified like 
24472         'System.Console.WriteLine'
24473
24474         * assign.cs (Resolve): Begin implementation. Stuck ;-)
24475
24476 2001-09-07  Ravi Pratap  <ravi@ximian.com>
24477
24478         * cs-tokenizer.cs (location): Return a string which also contains
24479         the file name.
24480
24481         * expression.cs (ElementAccess): New class for expressions of the
24482         type 'element access.'
24483         (BaseAccess): New class for expressions of the type 'base access.'
24484         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
24485         respectively.
24486
24487         * cs-parser.jay (element_access): Implement action.
24488         (base_access): Implement actions.
24489         (checked_expression, unchecked_expression): Implement.
24490
24491         * cs-parser.jay (local_variable_type): Correct and implement.
24492         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24493
24494         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24495
24496         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24497         name and the specifiers.
24498
24499         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24500
24501         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
24502         making them all public ;-)
24503
24504         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24505         class anyways.
24506
24507 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
24508
24509         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24510         PropertyExprs.
24511         (FieldExpr, PropertyExprs): New resolved expressions.
24512         (SimpleName::MemberStaticCheck): Perform static checks for access
24513         to non-static fields on static methods. Maybe this should be
24514         generalized for MemberAccesses. 
24515         (SimpleName::ResolveSimpleName): More work on simple name
24516         resolution. 
24517
24518         * cs-parser.jay (primary_expression/qualified_identifier): track
24519         the parameter index.
24520
24521         * codegen.cs (CodeGen::Save): Catch save exception, report error.
24522         (EmitContext::EmitBoolExpression): Chain to expression generation
24523         instead of temporary hack.
24524         (::EmitStatementExpression): Put generic expression code generation.
24525
24526         * assign.cs (Assign::Emit): Implement variable assignments to
24527         local variables, parameters and fields.
24528
24529 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
24530
24531         * statement.cs (Block::GetVariableInfo): New method, returns the
24532         VariableInfo for a variable name in a block.
24533         (Block::GetVariableType): Implement in terms of GetVariableInfo
24534
24535         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24536         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24537
24538 2001-09-06  Ravi Pratap  <ravi@ximian.com>
24539
24540         * cs-parser.jay (operator_declaration): Continue on my quest : update
24541         to take attributes argument.
24542         (event_declaration): Ditto.
24543         (enum_declaration): Ditto.
24544         (indexer_declaration): Ditto.
24545
24546         * class.cs (Operator::Operator): Update constructor accordingly.
24547         (Event::Event): Ditto.
24548
24549         * delegate.cs (Delegate::Delegate): Same here.
24550
24551         * enum.cs (Enum::Enum): Same here.
24552
24553 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24554
24555         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
24556
24557         * ../tests/cs0658.cs : New file to demonstrate error 0658.
24558
24559         * attribute.cs (Attributes): New class to encapsulate all attributes which were
24560         being passed around as an arraylist.
24561         (Attributes::AddAttribute): Method to add attribute sections.
24562
24563         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
24564         (struct_declaration): Update accordingly.
24565         (constant_declaration): Update.
24566         (field_declaration): Update.
24567         (method_header): Update.
24568         (fixed_parameter): Update.
24569         (parameter_array): Ditto.
24570         (property_declaration): Ditto.
24571         (destructor_declaration): Ditto.
24572
24573         * class.cs (Struct::Struct): Update constructors accordingly.
24574         (Class::Class): Ditto.
24575         (Field::Field): Ditto.
24576         (Method::Method): Ditto.
24577         (Property::Property): Ditto.
24578         (TypeContainer::OptAttribute): update property's return type.
24579
24580         * interface.cs (Interface.opt_attributes): New member.
24581         (Interface::Interface): Update to take the extra Attributes argument.
24582
24583         * parameter.cs (Parameter::Parameter): Ditto.
24584
24585         * constant.cs (Constant::Constant): Ditto.
24586
24587         * interface.cs (InterfaceMemberBase): New OptAttributes field.
24588         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
24589         the attributes as a parameter.
24590         (InterfaceProperty): Update constructor call.
24591         (InterfaceEvent): Ditto.
24592         (InterfaceMethod): Ditto.
24593         (InterfaceIndexer): Ditto.
24594
24595         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
24596         pass the attributes too.
24597         (interface_event_declaration): Ditto.
24598         (interface_property_declaration): Ditto.
24599         (interface_method_declaration): Ditto.
24600         (interface_declaration): Ditto.
24601
24602 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
24603
24604         * class.cs (Method::Define): Track the "static Main" definition to
24605         create an entry point. 
24606
24607         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24608         EntryPoint if we find it. 
24609
24610         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24611         (EmitContext::ig): Make this variable public.
24612
24613         * driver.cs: Make the default output file be the first file name
24614         with the .exe extension.  
24615
24616         Detect empty compilations
24617
24618         Handle various kinds of output targets.  Handle --target and
24619         rename -t to --dumper.
24620
24621         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24622         methods inherited from Expression return now an Expression.  This
24623         will is used during the tree rewriting as we resolve them during
24624         semantic analysis.
24625
24626         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24627         the spec.  Missing entirely is the information about
24628         accessability of elements of it.
24629
24630         (Expression::ExprClassFromMemberInfo): New constructor for
24631         Expressions that creates a fully initialized Expression based on
24632         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24633         a Type.
24634
24635         (Invocation::Resolve): Begin implementing resolution of invocations.
24636
24637         * literal.cs (StringLiteral):  Implement Emit.
24638
24639 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24640
24641         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24642         member.
24643
24644 2001-09-04  Ravi Pratap  <ravi@ximian.com>
24645
24646         * cs-parser.jay (attribute_arguments): Implement actions.
24647         (attribute): Fix bug in production. Implement action.
24648         (attribute_list): Implement.
24649         (attribute_target): Implement.
24650         (attribute_target_specifier, opt_target_specifier): Implement
24651         (CheckAttributeTarget): New method to check if the attribute target
24652         is valid.
24653         (attribute_section): Implement.
24654         (opt_attributes): Implement.
24655
24656         * attribute.cs : New file to handle attributes.
24657         (Attribute): Class to hold attribute info.
24658
24659         * cs-parser.jay (opt_attribute_target_specifier): Remove production
24660         (attribute_section): Modify production to use 2 different rules to 
24661         achieve the same thing. 1 s/r conflict down !
24662         Clean out commented, useless, non-reducing dimension_separator rules.
24663
24664         * class.cs (TypeContainer.attributes): New member to hold list
24665         of attributes for a type.
24666         (Struct::Struct): Modify to take one more argument, the attribute list.
24667         (Class::Class): Ditto.
24668         (Field::Field): Ditto.
24669         (Method::Method): Ditto.
24670         (Property::Property): Ditto.
24671
24672         * cs-parser.jay (struct_declaration): Update constructor call to
24673         pass in the attributes too.
24674         (class_declaration): Ditto.
24675         (constant_declaration): Ditto.
24676         (field_declaration): Ditto.
24677         (method_header): Ditto.
24678         (fixed_parameter): Ditto.
24679         (parameter_array): Ditto.
24680         (property_declaration): Ditto.
24681
24682         * constant.cs (Constant::Constant): Update constructor similarly.
24683         Use System.Collections.
24684
24685         * parameter.cs (Parameter::Parameter): Update as above.
24686
24687 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24688
24689         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24690         (TypeContainer.delegates): New member to hold list of delegates.
24691
24692         * cs-parser.jay (delegate_declaration): Implement the action correctly 
24693         this time as I seem to be on crack ;-)
24694
24695 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
24696
24697         * rootcontext.cs (RootContext::IsNamespace): new function, used to
24698         tell whether an identifier represents a namespace.
24699
24700         * expression.cs (NamespaceExpr): A namespace expression, used only
24701         temporarly during expression resolution.
24702         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24703         utility functions to resolve names on expressions.
24704
24705 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
24706
24707         * codegen.cs: Add hook for StatementExpressions. 
24708
24709         * class.cs: Fix inverted test for static flag in methods.
24710
24711 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24712
24713         * class.cs (Operator::CheckUnaryOperator): Correct error number used
24714         to make it coincide with MS' number.
24715         (Operator::CheckBinaryOperator): Ditto.
24716
24717         * ../errors/errors.txt : Remove error numbers added earlier.
24718
24719         * ../errors/cs1019.cs : Test case for error # 1019
24720
24721         * ../errros/cs1020.cs : Test case for error # 1020
24722
24723         * cs-parser.jay : Clean out commented cruft.
24724         (dimension_separators, dimension_separator): Comment out. Ostensibly not
24725         used anywhere - non-reducing rule.
24726         (namespace_declarations): Non-reducing rule - comment out.
24727
24728         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24729         with TypeContainer::AddEnum.
24730
24731         * delegate.cs : New file for delegate handling classes.
24732         (Delegate): Class for declaring delegates.
24733
24734         * makefile : Update.
24735
24736         * cs-parser.jay (delegate_declaration): Implement.
24737
24738 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
24739
24740         * class.cs (Event::Define): Implement.
24741         (Event.EventBuilder): New member.
24742
24743         * class.cs (TypeContainer::Populate): Update to define all enums and events
24744         we have.
24745         (Events): New property for the events arraylist we hold. Shouldn't we move to using
24746         readonly fields for all these cases ?
24747
24748 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24749
24750         * class.cs (Property): Revamp to use the convention of making fields readonly.
24751         Accordingly modify code elsewhere.
24752
24753         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24754         the Define method of the Property class.
24755
24756         * class.cs : Clean up applied patch and update references to variables etc. Fix 
24757         trivial bug.
24758         (TypeContainer::Populate): Update to define all the properties we have. Also
24759         define all enumerations.
24760
24761         * enum.cs (Define): Implement.
24762
24763 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24764
24765         * cs-parser.jay (overloadable_operator): The semantic value is an
24766         enum of the Operator class.
24767         (operator_declarator): Implement actions.
24768         (operator_declaration): Implement.
24769
24770         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24771         validity of definitions.
24772         (Operator::CheckBinaryOperator): Static method to check for binary operators
24773         (TypeContainer::AddOperator): New method to add an operator to a type.
24774
24775         * cs-parser.jay (indexer_declaration): Added line to actually call the
24776         AddIndexer method so it gets added ;-)
24777
24778         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
24779         already taken care of by the MS compiler ?  
24780
24781 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24782
24783         * class.cs (Operator): New class for operator declarations.
24784         (Operator::OpType): Enum for the various operators.
24785
24786 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24787
24788         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24789         ostensibly handle this in semantic analysis.
24790
24791         * cs-parser.jay (general_catch_clause): Comment out
24792         (specific_catch_clauses, specific_catch_clause): Ditto.
24793         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24794         (catch_args, opt_catch_args): New productions.
24795         (catch_clause): Rewrite to use the new productions above
24796         (catch_clauses): Modify accordingly.
24797         (opt_catch_clauses): New production to use in try_statement
24798         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
24799         and re-write the code in the actions to extract the specific and
24800         general catch clauses by being a little smart ;-)
24801
24802         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
24803         Hooray, try and catch statements parse fine !
24804
24805 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24806
24807         * statement.cs (Block::GetVariableType): Fix logic to extract the type
24808         string from the hashtable of variables.
24809
24810         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
24811         I end up making that mistake ;-)
24812         (catch_clauses): Fixed gross error which made Key and Value of the 
24813         DictionaryEntry the same : $1 !!
24814
24815 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24816
24817         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
24818
24819         * cs-parser.jay (event_declaration): Correct to remove the semicolon
24820         when the add and remove accessors are specified. 
24821
24822 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24823
24824         * cs-parser.jay (IndexerDeclaration): New helper class to hold
24825         information about indexer_declarator.
24826         (indexer_declarator): Implement actions.
24827         (parsing_indexer): New local boolean used to keep track of whether
24828         we are parsing indexers or properties. This is necessary because 
24829         implicit_parameters come into picture even for the get accessor in the 
24830         case of an indexer.
24831         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
24832
24833         * class.cs (Indexer): New class for indexer declarations.
24834         (TypeContainer::AddIndexer): New method to add an indexer to a type.
24835         (TypeContainer::indexers): New member to hold list of indexers for the
24836         type.
24837
24838 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24839
24840         * cs-parser.jay (add_accessor_declaration): Implement action.
24841         (remove_accessor_declaration): Implement action.
24842         (event_accessors_declaration): Implement
24843         (variable_declarators): swap statements for first rule - trivial.
24844
24845         * class.cs (Event): New class to hold information about event
24846         declarations.
24847         (TypeContainer::AddEvent): New method to add an event to a type
24848         (TypeContainer::events): New member to hold list of events.
24849
24850         * cs-parser.jay (event_declaration): Implement actions.
24851
24852 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24853
24854         * cs-parser.jay (dim_separators): Implement. Make it a string
24855         concatenating all the commas together, just as they appear.
24856         (opt_dim_separators): Modify accordingly
24857         (rank_specifiers): Update accordingly. Basically do the same
24858         thing - instead, collect the brackets here.
24859         (opt_rank_sepcifiers): Modify accordingly.
24860         (array_type): Modify to actually return the complete type string
24861         instead of ignoring the rank_specifiers.
24862         (expression_list): Implement to collect the expressions
24863         (variable_initializer): Implement. We make it a list of expressions
24864         essentially so that we can handle the array_initializer case neatly too.
24865         (variable_initializer_list): Implement.
24866         (array_initializer): Make it a list of variable_initializers
24867         (opt_array_initializer): Modify accordingly.
24868
24869         * expression.cs (New::NType): Add enumeration to help us
24870         keep track of whether we have an object/delegate creation
24871         or an array creation.
24872         (New:NewType, New::Rank, New::Indices, New::Initializers): New
24873         members to hold data about array creation.
24874         (New:New): Modify to update NewType
24875         (New:New): New Overloaded contructor for the array creation
24876         case.
24877
24878         * cs-parser.jay (array_creation_expression): Implement to call
24879         the overloaded New constructor.
24880
24881 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
24882
24883         * class.cs (TypeContainer::Constructors): Return member
24884         constructors instead of returning null.
24885
24886 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
24887
24888         * typemanager.cs (InitCoreTypes): Initialize the various core
24889         types after we have populated the type manager with the user
24890         defined types (this distinction will be important later while
24891         compiling corlib.dll)
24892
24893         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
24894         on Expression Classification.  Now all expressions have a method
24895         `Resolve' and a method `Emit'.
24896
24897         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
24898         generation from working.     Also add some temporary debugging
24899         code. 
24900
24901 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
24902
24903         * codegen.cs: Lots of code generation pieces.  This is only the
24904         beginning, will continue tomorrow with more touches of polish.  We
24905         handle the fundamentals of if, while, do, for, return.  Others are
24906         trickier and I need to start working on invocations soon.
24907
24908         * gen-treedump.cs: Bug fix, use s.Increment here instead of
24909         s.InitStatement. 
24910
24911         * codegen.cs (EmitContext): New struct, used during code
24912         emission to keep a context.   Most of the code generation will be
24913         here. 
24914
24915         * cs-parser.jay: Add embedded blocks to the list of statements of
24916         this block.  So code generation proceeds in a top down fashion.
24917
24918 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
24919
24920         * statement.cs: Add support for multiple child blocks.
24921
24922 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
24923
24924         * codegen.cs (EmitCode): New function, will emit the code for a
24925         Block of code given a TypeContainer and its ILGenerator. 
24926
24927         * statement.cs (Block): Standard public readonly optimization.
24928         (Block::Block constructors): Link children. 
24929         (Block::Child): Child Linker.
24930         (Block::EmitVariables): Emits IL variable declarations.
24931
24932         * class.cs: Drop support for MethodGroups here, delay until
24933         Semantic Analysis.
24934         (Method::): Applied the same simplification that I did before, and
24935         move from Properties to public readonly fields.
24936         (Method::ParameterTypes): Returns the parameter types for the
24937         function, and implements a cache that will be useful later when I
24938         do error checking and the semantic analysis on the methods is
24939         performed.
24940         (Constructor::GetCallingConvention): Renamed from CallingConvetion
24941         and made a method, optional argument tells whether this is a class
24942         or a structure to apply the `has-this' bit.
24943         (Method::GetCallingConvention): Implement, returns the calling
24944         convention. 
24945         (Method::Define): Defines the type, a second pass is performed
24946         later to populate the methods.
24947
24948         (Constructor::ParameterTypes): implement a cache similar to the
24949         one on Method::ParameterTypes, useful later when we do semantic
24950         analysis. 
24951
24952         (TypeContainer::EmitMethod):  New method.  Emits methods.
24953
24954         * expression.cs: Removed MethodGroup class from here.
24955
24956         * parameter.cs (Parameters::GetCallingConvention): new method.
24957
24958 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
24959
24960         * class.cs (TypeContainer::Populate): Drop RootContext from the
24961         argument. 
24962
24963         (Constructor::CallingConvention): Returns the calling convention.
24964         (Constructor::ParameterTypes): Returns the constructor parameter
24965         types. 
24966
24967         (TypeContainer::AddConstructor): Keep track of default constructor
24968         and the default static constructor.
24969
24970         (Constructor::) Another class that starts using `public readonly'
24971         instead of properties. 
24972
24973         (Constructor::IsDefault): Whether this is a default constructor. 
24974
24975         (Field::) use readonly public fields instead of properties also.
24976
24977         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
24978         track of static constructors;  If none is used, turn on
24979         BeforeFieldInit in the TypeAttributes. 
24980
24981         * cs-parser.jay (opt_argument_list): now the return can be null
24982         for the cases where there are no arguments. 
24983
24984         (constructor_declarator): If there is no implicit `base' or
24985         `this', then invoke the default parent constructor. 
24986
24987         * modifiers.cs (MethodAttr): New static function maps a set of
24988         modifiers flags into a MethodAttributes enum
24989         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
24990         MethodAttr, TypeAttr to represent the various mappings where the
24991         modifiers are used.
24992         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
24993
24994 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
24995
24996         * parameter.cs (GetParameterInfo): Fix bug where there would be no
24997         method arguments.
24998
24999         * interface.cs (PopulateIndexer): Implemented the code generator
25000         for interface indexers.
25001
25002 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
25003
25004         * interface.cs (InterfaceMemberBase): Now we track the new status
25005         here.  
25006
25007         (PopulateProperty): Implement property population.  Woohoo!  Got
25008         Methods and Properties going today. 
25009
25010         Removed all the properties for interfaces, and replaced them with
25011         `public readonly' fields. 
25012
25013 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
25014
25015         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
25016         initialize their hashtables/arraylists only when they are needed
25017         instead of doing this always.
25018
25019         * parameter.cs: Handle refs and out parameters.
25020
25021         * cs-parser.jay: Use an ArrayList to construct the arguments
25022         instead of the ParameterCollection, and then cast that to a
25023         Parameter[] array.
25024
25025         * parameter.cs: Drop the use of ParameterCollection and use
25026         instead arrays of Parameters.
25027
25028         (GetParameterInfo): Use the Type, not the Name when resolving
25029         types. 
25030
25031 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
25032
25033         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
25034         and instead use public readonly fields.
25035
25036         * class.cs: Put back walking code for type containers.
25037
25038 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
25039
25040         * class.cs (MakeConstant): Code to define constants.
25041
25042         * rootcontext.cs (LookupType): New function.  Used to locate types 
25043
25044
25045 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
25046
25047         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
25048         this System.Reflection code is.  Kudos to Microsoft
25049
25050         * typemanager.cs: Implement a type cache and avoid loading all
25051         types at boot time.  Wrap in LookupType the internals.  This made
25052         the compiler so much faster.  Wow.  I rule!
25053
25054         * driver.cs: Make sure we always load mscorlib first (for
25055         debugging purposes, nothing really important).
25056
25057         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
25058         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
25059
25060         * rootcontext.cs: Lookup types on their namespace;  Lookup types
25061         on namespaces that have been imported using the `using' keyword.
25062
25063         * class.cs (TypeContainer::TypeAttr): Virtualize.
25064         (Class::TypeAttr): Return attributes suitable for this bad boy.
25065         (Struct::TypeAttr): ditto.
25066         Handle nested classes.
25067         (TypeContainer::) Remove all the type visiting code, it is now
25068         replaced with the rootcontext.cs code
25069
25070         * rootcontext.cs (GetClassBases): Added support for structs. 
25071
25072 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
25073
25074         * interface.cs, statement.cs, class.cs, parameter.cs,
25075         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
25076         Drop use of TypeRefs, and use strings instead.
25077
25078 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
25079
25080         * rootcontext.cs: 
25081
25082         * class.cs (Struct::Struct): set the SEALED flags after
25083         checking the modifiers.
25084         (TypeContainer::TypeAttr): new property, returns the
25085         TypeAttributes for a class.  
25086
25087         * cs-parser.jay (type_list): Oops, list production was creating a
25088         new list of base types.
25089
25090         * rootcontext.cs (StdLib): New property.
25091         (GetInterfaceTypeByName): returns an interface by type name, and
25092         encapsulates error handling here.
25093         (GetInterfaces): simplified.
25094         (ResolveTree): Encapsulated all the tree resolution here.
25095         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
25096         types. 
25097
25098         * driver.cs: Add support for --nostdlib, to avoid loading the
25099         default assemblies.
25100         (Main): Do not put tree resolution here. 
25101
25102         * rootcontext.cs: Beginning of the class resolution.
25103
25104 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
25105
25106         * rootcontext.cs: Provide better error reporting. 
25107
25108         * cs-parser.jay (interface_base): set our $$ to be interfaces.
25109
25110         * rootcontext.cs (CreateInterface): Handle the case where there
25111         are no parent interfaces.
25112
25113         (CloseTypes): Routine to flush types at the end.
25114         (CreateInterface): Track types.
25115         (GetInterfaces): Returns an array of Types from the list of
25116         defined interfaces.
25117
25118         * typemanager.c (AddUserType): Mechanism to track user types (puts
25119         the type on the global type hash, and allows us to close it at the
25120         end). 
25121
25122 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
25123
25124         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
25125         RecordInterface instead.
25126
25127         * cs-parser.jay: Updated to reflect changes above.
25128
25129         * decl.cs (Definition): Keep track of the TypeBuilder type that
25130         represents this type here.  Not sure we will use it in the long
25131         run, but wont hurt for now.
25132
25133         * driver.cs: Smaller changes to accomodate the new code.
25134
25135         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
25136         when done. 
25137
25138         * rootcontext.cs (CreateInterface):  New method, used to create
25139         the System.TypeBuilder type for interfaces.
25140         (ResolveInterfaces): new entry point to resolve the interface
25141         hierarchy. 
25142         (CodeGen): Property, used to keep track of the code generator.
25143
25144 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
25145
25146         * cs-parser.jay: Add a second production for delegate_declaration
25147         with `VOID'.
25148
25149         (enum_body): Put an opt_comma here instead of putting it on
25150         enum_body or enum_member_declarations so we can handle trailing
25151         commas on enumeration members.  Gets rid of a shift/reduce.
25152
25153         (type_list): Need a COMMA in the middle.
25154
25155         (indexer_declaration): Tell tokenizer to recognize get/set
25156
25157         * Remove old targets.
25158
25159         * Re-add the parser target.
25160
25161 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25162
25163         * cs-parser.jay: Add precendence rules for a number of operators
25164         ot reduce the number of shift/reduce conflicts in the grammar.
25165
25166 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
25167
25168         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
25169         and put it here.
25170
25171         Get rid of old crufty code.
25172
25173         * rootcontext.cs: Use this to keep track of the parsed
25174         representation and the defined types available to the program. 
25175
25176         * gen-treedump.cs: adjust for new convention.
25177
25178         * type.cs: Split out the type manager, and the assembly builder
25179         from here. 
25180
25181         * typemanager.cs: the type manager will live here now.
25182
25183         * cil-codegen.cs: And the code generator here. 
25184
25185 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
25186
25187         * makefile: Fixed up for easy making.
25188
25189 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25190
25191         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
25192         the 
25193
25194         (unary_expression): Expand pre_increment_expression and
25195         post_decrement_expression to reduce a shift/reduce.
25196
25197 2001-07-11  Simon Cozens
25198
25199         * cs-tokenizer.cs: Hex numbers should begin with a 0.
25200
25201         Improve allow_keyword_as_indent name.
25202
25203 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
25204
25205         * Adjustments for Beta2. 
25206
25207 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
25208
25209         * decl.cs: Added `Define' abstract method.
25210         (InTransit): new property, used to catch recursive definitions. 
25211
25212         * interface.cs: Implement `Define'. 
25213
25214         * modifiers.cs: Map Modifiers.constants to
25215         System.Reflection.TypeAttribute flags.
25216
25217         * class.cs: Keep track of types and user-defined types.
25218         (BuilderInit): New method for creating an assembly
25219         (ResolveType): New function to launch the resolution process, only
25220         used by interfaces for now.
25221
25222         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
25223         that are inserted into the name space. 
25224
25225 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
25226
25227         * ARGH.  I have screwed up my tree so many times due to the use of
25228         rsync rather than using CVS.  Going to fix this at once. 
25229
25230         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
25231         load types.
25232
25233 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
25234
25235         * Experiment successful: Use System.Type rather that our own
25236         version of Type.  
25237
25238 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
25239
25240         * cs-parser.jay: Removed nsAliases from here.
25241
25242         Use new namespaces, handle `using XXX;' 
25243
25244         * namespace.cs: Reimplemented namespace handling, use a recursive
25245         definition of the class.  Now we can keep track of using clauses
25246         and catch invalid using clauses.
25247
25248 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
25249
25250         * gen-treedump.cs: Adapted for all the renaming.
25251
25252         * expression.cs (Expression): this class now has a Type property
25253         which returns an expression Type.
25254
25255         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
25256         `Type', as this has a different meaning now in the base
25257
25258 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
25259
25260         * interface.cs, class.cs: Removed from all the sources the
25261         references to signature computation, as we can not do method
25262         signature computation during the parsing time, as we are not
25263         trying to solve at that point distinguishing:
25264
25265         class X {
25266                 void a (Blah x) {}
25267                 void a (NS.Blah x) {}
25268         }
25269
25270         Which depending on the context might be valid or not, as we do not
25271         know if Blah is the same thing as NS.Blah at that point.
25272
25273         * Redid everything so the code uses TypeRefs now instead of
25274         Types.  TypeRefs are just temporary type placeholders, that need
25275         to be resolved.  They initially have a pointer to a string and the
25276         current scope in which they are used.  This is used later by the
25277         compiler to resolve the reference to an actual Type. 
25278
25279         * DeclSpace is no longer a CIR.Type, and neither are
25280         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
25281         are all DeclSpaces, but no Types. 
25282
25283         * type.cs (TypeRefManager): This implements the TypeRef manager,
25284         which keeps track of all the types that need to be resolved after
25285         the parsing has finished. 
25286
25287 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
25288
25289         * ARGH.  We are going to have to store `foreach' as a class rather
25290         than resolving it, as we need to verify error 1579 after name
25291         resolution.   *OR* we could keep a flag that says `This request to
25292         IEnumerator comes from a foreach statement' which we can then use
25293         to generate the error.
25294
25295 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
25296
25297         * class.cs (TypeContainer.AddMethod): we now add methods to the
25298         MethodGroup instead of the method hashtable.  
25299
25300         * expression.cs: Add MethodGroup abstraction, which gets us one
25301         step closer to the specification in the way we handle method
25302         declarations.  
25303
25304         * cs-parser.jay (primary_expression): qualified_identifier now
25305         tried to match up an identifier to a local variable reference or
25306         to a parameter reference.
25307
25308         current_local_parameters is now a parser global variable that
25309         points to the current parameters for the block, used during name
25310         lookup.
25311
25312         (property_declaration): Now creates an implicit `value' argument to
25313         the set accessor.
25314
25315 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
25316
25317         * parameter.cs: Do not use `param' arguments as part of the
25318         signature, per the spec.
25319
25320 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
25321
25322         * decl.cs: Base class for classes, structs and interfaces.  This
25323         is the "Declaration Space" 
25324
25325         * cs-parser.jay: Use CheckDef for checking declaration errors
25326         instead of having one on each function.
25327
25328         * class.cs: Factor out some code for handling error handling in
25329         accordance to the "Declarations" section in the "Basic Concepts"
25330         chapter in the ECMA C# spec.
25331
25332         * interface.cs: Make all interface member classes derive from
25333         InterfaceMemberBase.
25334
25335 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
25336
25337         * Many things: all interfaces are parsed and generated in
25338         gen-treedump.  Support for member variables, constructors,
25339         destructors, properties, constants is there.
25340
25341         Beginning of the IL backend, but very little done, just there for
25342         testing purposes. 
25343
25344 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
25345
25346         * cs-parser.jay: Fix labeled statement.
25347
25348         * cs-tokenizer.cs (escape): Escape " and ' always.
25349         ref_line, ref_name: keep track of the line/filename as instructed
25350         by #line by the compiler.
25351         Parse #line.
25352
25353 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
25354
25355         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
25356         to match the values in System.CodeDOM.
25357
25358         Divid renamed to Divide.
25359
25360         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
25361         statements. 
25362         (Statements.set): remove.
25363
25364         * System.CodeDOM/CodeCatchClause.cs: always have a valid
25365         statements. 
25366
25367         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
25368         falseStatements always have valid values. 
25369
25370         * cs-parser.jay: Use System.CodeDOM now.
25371