* Form.cs: Make the fix for #80775 windows-only (fixes #81957).
[mono.git] / mcs / mcs / ChangeLog
1
2 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
3
4         * iterators.cs: reverted Miguel's latest change (r81925) as it
5         breaks the build in System.
6
7 2007-07-13  Miguel de Icaza  <miguel@novell.com>
8
9         * iterators.cs (Yield.CheckContext): Check for the iterator type
10         also here as we can call into Yield even in codepaths that are not
11         directly checked by
12         (MethodOrOperator is the only path that was checked).
13
14         In addition to the standard check, use a more specific check for
15         constructors to report a more verbose error. 
16
17 2007-07-12  Miguel de Icaza  <miguel@novell.com>
18
19         * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
20         report the warning and continue 
21
22         * statement.cs (Using.EmitLocalVariableDecls): We were leaving
23         values on the stack on the call to Emit.   Use EmitStatement if
24         possible, or using Emit + Pop if not possible.   Fixes #82064
25
26 2007-07-12  Raja R Harinath  <rharinath@novell.com>
27
28         * expression.cs (Invocation.IsApplicable): Reorganize slightly to
29         avoid try...finally in some cases.
30
31 2007-07-10  Marek Safar  <marek.safar@gmail.com>
32
33         * attribute.cs (Attribute.ResolveConstructor): Uses method group.
34         
35         * class.cs (ConstructorInitializer.Resolve): Use and keep method group
36         instead of method. Re-use standard error handling.
37         (ConstructorInitializer.Emit): Simplified.
38         
39         * delegate.cs: Updated after Invocation.EmitCall change.
40         
41         * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
42         (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
43         (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
44         method and don't permanently changing input arguments.
45         (MethodGroupExpr): Introduced resolved best_candidate, when method group
46         is resolved it has one of the candidates is the best one which is later
47         used to emit. Removed a few unused method.
48         (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
49
50         * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
51         (Binary.ResolveOperator): Ditto.
52         (ConditionalLogicalOperator.DoResolve): Ditto.
53         (Invocation): Uses method group.
54         (Invocation.DoResolve): Simplified.
55         (Invocation.EmitCall): Removed useless is_static.
56         (Invocation.Emit): Delegate to method group.
57         (Invocation.EmitStatement): Simplified.
58         (New): Uses method group.
59         (MemberAccess.DoResolve): Don't destroy original expression.
60         
61         * statement.cs (ForEach.Resolve): Use null for no method arguments.
62         
63 2007-07-04  Marek Safar  <marek.safar@gmail.com>
64
65         * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
66         
67         * anonymous.cs,
68         * lambda.cs: Add custom error message type.
69
70 2007-07-03  Marek Safar  <marek.safar@gmail.com>
71
72         * lambda.cs: Simplified little bit.
73         
74         * parameter.cs: Introduced ImplicitLambdaParameter.
75         (Parameters.CreateFullyResolved): New factory instead of ctor.
76         
77         * anonymous.cs,
78         * class.cs,
79         * delegate.cs: Updated parameter creation.
80         
81 2007-07-03  Marek Safar  <marek.safar@gmail.com>
82
83         *  ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
84         arguments.
85         
86         * generic.cs: Synchronized with gmcs.
87         
88 2007-07-03  Marek Safar  <marek.safar@gmail.com>
89
90         * class.cs (Indexer): Check return type as soon as possible.
91         
92         * cs-parser.jay: Initialize implicit_value_parameter_type for interface
93         members too.
94         
95         * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
96         
97         * expression.cs (Invocation.Error_InvalidArguments): Show type only.
98         
99         * parameter.cs (Parameter): Use expression type when it is available.
100         
101         * support.cs (ReflectionParameters.ParameterDesc): Show an extension
102         method modifier for the first parameter only.
103
104 2007-06-24  Marek Safar  <marek.safar@gmail.com>
105
106         A fix for bug #81938
107         * typemanager.cs (ChangeType): Fixed couple of char conversions.
108         
109         * constant.cs: Tide up an exception message.
110
111 2007-06-22  Marek Safar  <marek.safar@gmail.com>
112
113         * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
114         an uninitialized variable is used.
115         
116         * expression.cs (LocalVariableReference.DoResolve): Ditto.
117
118 2007-06-22  Marek Safar  <marek.safar@gmail.com>
119
120         * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
121         not found error handling.
122
123         * expression.cs (ArrayCreation): Removed redundant fields and little bit
124         simplified.
125         (ArrayCreation.ResolveArrayElement): To be ready to customization.
126         (ArrayCreation.DoResolve): Simplified.
127         (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
128         its own resolve process.
129         (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
130
131 2007-06-20  Marek Safar  <marek.safar@gmail.com>
132
133         * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
134         more error details.
135         
136 2007-06-20  Marek Safar  <marek.safar@gmail.com>
137
138         * cs-tokenizer.cs: Removed var related stuff.
139         
140         * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
141         (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
142         a type and a keyword at same time.
143         
144         * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
145         matches to "var".
146         
147         * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
148         implicitly typed arrays, more changes will follow.
149         
150         * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
151         
152 2007-06-19  Marek Safar  <marek.safar@gmail.com>
153
154         * ecore.cs (VarExpr): Removed Handled field.
155         
156         * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
157         build-in assign functionality.
158         (ForEach.Resolve): Removed all implicitly typed local variable code and
159         simplified.
160         (ArrayForeach.Resolve): Infer implicitly typed local variable here.
161         (CollectionForeach.Resolve): Infer implicitly typed local variable here.
162
163 2007-06-18  Marek Safar  <marek.safar@gmail.com>
164
165         * assign.cs: Removed implicitly typed local variable check.
166         
167         * expression.cs (LocalVariableReference.DoResolve): Add check for self
168         referencing implicitly typed local variable.
169         (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
170         variable here.
171         
172         * statement.cs (Fixed): Removed unsupported implicitly typed local
173         variable code.
174
175 2007-06-15  Marek Safar  <marek.safar@gmail.com>
176
177         * decl.cs (MemberName): Moved all Unbound stuff to parser.
178
179 2007-06-14  Marek Safar  <marek.safar@gmail.com>
180
181         A fix for bugs #81855 and #76274
182         * attribute.cs (AttachTo): Always set owner for global attributes to
183         prefined owner.
184         
185         * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
186         usefull too.
187         
188         * cs-parser.jay: Assembly and module attributes must precede all other
189         elements except using clauses and extern alias declarations.
190
191 2007-06-13  Marek Safar  <marek.safar@gmail.com>
192
193         A fix for bug #81748
194         * cs-tokenizer.cs,
195         * expression.cs: More checks for non ISO-1 features.
196
197 2007-06-12  Marek Safar  <marek.safar@gmail.com>
198
199         A fix for bug #81807
200         * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
201         present inside switch statement and it is required by nullable check.
202
203 2007-06-12  Marek Safar  <marek.safar@gmail.com>
204
205         A fix for bug #81840
206         * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
207         when type matching fails.
208         
209         * namespace.cs: Tiny error message change.
210
211 2007-06-12  Marek Safar  <marek.safar@gmail.com>
212
213         * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
214         reporting. Added automatic property check.
215         
216         * class.cs: Updated after CheckAbstractAndExtern relocation.
217         (AEventPropertyAccessor.GetSignatureForError): Customized.
218         
219 2007-06-11  Marek Safar  <marek.safar@gmail.com>
220
221         * class.cs (DefineBaseTypes): Base type can be undefined.
222         
223         * ecore.cs (TypeLookup): Minor refactoring.
224         (DoResolveAsTypeStep): Removed redundant check.
225
226         * namespace.cs (Lookup): Removed redundant check.
227                 
228         * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal 
229         ResolveAsTypeTerminal step.
230         (BootstrapCorlib_*): Simplified.
231         (PopulateCoreType): Core types can be now external.
232
233 2007-06-07  Marek Safar  <marek.safar@gmail.com>
234
235         * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
236          verification only.
237          (InferTypeArguments): Infers anonymous expression type arguments.
238          (Compatible): Split to Compatible and InferTypeArguments. 
239         
240         * lambda.cs: Updated.
241
242 2007-06-08  Marek Safar  <marek.safar@gmail.com>
243
244         * anonymous.cs (AnonymousContainer): Marked as compiler generated.
245
246 2007-06-07  Raja R Harinath  <harinath@gmail.com>
247
248         Fix #80477, cs0135-2.cs, cs0135-3.cs
249         * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
250         names to the "known" variables list.
251         (Block.CheckInvariantMeaningInBlock): Handle the fact the
252         parameter names are also "known".
253         (Block.CheckError136): Remove.
254         (ExplicitBlock.CloneTo): New.  Set 'known_variables' in target to
255         null.
256
257 2007-06-07  Marek Safar  <marek.safar@gmail.com>
258
259         * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
260
261 2007-06-06  Marek Safar  <marek.safar@gmail.com>
262
263         * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
264         internal error not an user error.
265          
266         * expression.cs (IsApplicable): Refactored to make debugging easier.
267
268         * support.cs: More tricks for non-mono runtimes.
269         
270         * typemanager.cs (CoreLookupType): Made public.
271         (InitSystemCore): All linq specific stuff moved to linq.cs
272
273 2007-06-05  Marek Safar  <marek.safar@gmail.com>
274
275         * typemanager.cs (CSharpSignature): One more missing build-in types
276         replacement.
277         More tricks for non-mono runtime.
278
279 2007-06-05  Raja R Harinath  <harinath@gmail.com>
280
281         * statement.cs (Block.CheckError136_InParents): Remove.
282         (Block.AddVariable): Use GetParameterInfo instead.
283         (ToplevelBlock.ProcessArguments): Likewise.
284
285 2007-06-04  Raja R Harinath  <rharinath@novell.com>
286
287         * statement.cs (ToplevelBlock.CloneTo): New.  Copy over parameter
288         information too.
289         (ToplevelBlock.GetParameterInfo): Split out of ...
290         (ToplevelBlock.GetParameterRefernce): ... this.
291         (ToplevelBlock.ParameterMap): Remove.
292         * expression.cs (ParameterReference): Update to use
293         ToplevelParameterInfo.
294
295         * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
296         regression.
297
298         * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
299         * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
300
301         * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
302         (ToplevelBlock.ProcessParameters) ... here.
303         (ToplevelBlock..ctor): Invoke it.
304
305         * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
306         new parameters.
307
308         * statement.cs (IKnownVariable): New interface.
309         (LocalInfo): Implement it.
310         (ToplevelParameterInfo): New class.
311         (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
312         (ExplicitBlock.GetKnownVariable): Likewise.  Rename from
313         GetKnownVariableInfo.
314
315 2007-06-03  Raja R Harinath  <harinath@gmail.com>
316
317         Partly speed up CS0136 error checks.
318         * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
319         'recurse' parameter.
320         (Block.DoCheckError136): Only check errors in parameters.  Move
321         local variable checks ...
322         (Block.AddVariable): ... here, and ...
323         (ToplevelBlock.ResolveMeta): ... here.
324
325 2007-06-02  Raja R Harinath  <harinath@gmail.com>
326
327         * statement.cs (Block.IsChildOf): Remove.
328
329         * statement.cs (Statement.Clone): Move special case code ...
330         (Block.CloneTo): ... here.
331
332 2007-05-29  Raja R Harinath  <rharinath@novell.com>
333
334         * statement.cs (ToplevelBlock.container): Remove field.  It's
335         redundant with 'Parent'.
336         (ToplevelBlock.ContainerBlock): Remove accessor.
337         (ToplevelBlock..ctor): Update to changes.  Register anonymous
338         child with parent here, ...
339         * cs-parser.jay (end_anonymous): ... not here.  Don't modify
340         current_block.
341         (start_anonymous): Don't save current_block.
342         (top_current_block): Remove.
343
344         * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
345         (Block.Resolve): Update to changes.
346         (Block..ctor): Move setting of "correct" 'Toplevel'
347         and 'Explicit' fields to ...
348         (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
349
350 2007-05-27  Raja R Harinath  <harinath@gmail.com>
351
352         Kill Block.Implicit
353         * statement.cs (Block.Implicit): Remove.
354         (Block): Update to changes.
355         * flowanalysis.cs: Likewise.
356
357         Mildly speed up CheckInvariantMeaningInBlock
358         * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
359         Recursively call AddKnownVariable to all enclosing blocks.
360         (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
361         Remove recursive calls.
362         (Block): Update to changes.
363
364         New ExplicitBlock invariants
365         * statement.cs (Block.Explicit): New field.  It points to the
366         immediately enclosing non-implicit block.
367         (Block..ctor): Maintain the invariant.
368         * cs-parser.jay: Take advantage of invariant.
369
370         Introduce ExplicitBlock
371         * statement.cs (ExplicitBlock): New.
372         (ToplevelBlock): Derive from it.
373         (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
374         sense of flag.
375         (Block.Implicit): Update to changes.
376         * cs-parser.jay: Update to changes.
377
378         Remove unused field
379         * codegen.cs (EmitContext.IsLastStatement): Remove.
380         * statement.cs (Block.DoEmit): Update to changes.
381
382 2007-05-25  Raja R Harinath  <rharinath@novell.com>
383
384         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
385         modifying current_block directly.
386
387 2007-05-23  Scott Peterson  <lunchtimemama@gmail.com>
388         
389         * class.cs: Implemented automatic properties (C# 3.0)
390           Thanks to Marek for the help.
391
392 2007-05-23  Raja R Harinath  <rharinath@novell.com>
393
394         * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
395         variable as assigned, note also that all its components are
396         assigned too.
397         (MyBitVector.SetRange): New.  Function to set multiple bits to true.
398
399 2007-05-19  Marek Safar  <marek.safar@gmail.com>
400
401         * anonymous.cs, class.cs: Emit Compiler generated attribute when
402         member is marked as compiler generated.
403         
404         * decl.cs (MemberCore): Refactored ModFlags into property.
405
406         * modifiers.cs: Add new modifier (COMPILER_GENERATED).
407         (Check): Check only accessibility modifiers.
408
409 2007-05-18  Raja R Harinath  <rharinath@novell.com>
410
411         Track all assignable slots in one bit array
412         * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
413         (ToplevelBlock.ResolveMeta): Don't create a VariableMap.  Move
414         logic from VariableMap constructor here.  Use the same 'offset'
415         variable that's later used for computing offsets of local
416         variables.
417         * flowanalysis.cs (UsageVector.parameters): Remove.
418         (UsageVector): Update to changes.
419         (VariableMap): Remove.
420
421         Avoid creating ParameterMap in every block
422         * statement.cs (Block.ParameterMap): Move ...
423         (ToplevelBlock.ParameterMap): ... here.
424         (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
425         only once.
426         * flowanalysis.cs (FlowBranching.param_map): Remove.
427         (FlowBranching.UsageVector): Update to changes.
428         (FlowBranchingToplevel.CheckOutParameters): Likewise.
429
430         * statement.cs (Block.CloneTo): Clone Toplevel field too.
431
432         * expression.cs (ParameterReference): Distinguish between block
433         where parameter was referenced and declared.
434
435 2007-05-18  Marek Safar  <marek.safar@gmail.com>
436
437         * flowanalysis.cs, statement.cs: Put back improved error handling.
438
439 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
440         
441         * assign.cs:
442         * expression.cs:
443           Imporved object and collection initialization (C# 3.0).
444
445 2007-05-15  Marek Safar  <marek.safar@gmail.com>
446
447         A fix for bug #81380
448         * expression.cs (Is.DoResolve): Only value types have constant `is'
449         behaviour.
450
451 2007-05-15  Raja R Harinath  <rharinath@novell.com>
452
453         * statement.cs (ToplevelBlock.child): Remove.
454
455 2007-05-15  Raja R Harinath  <harinath@gmail.com>
456
457         Rationalize ResolveMeta: refactoring
458         (Block.ResolveMeta): Remove wrong or superfluous comments.  Carve
459         out constant handling code into ...
460         (Block.DoResolveConstants): ... this.
461
462         Rationalize ResolveMeta: kill local_map
463         * statement.cs (Block.local_map, Block.LocalMap): Remove.
464         (Block.AssignableSlots): New.
465         (Block.ResolveMeta): Make protected.  Don't create a VariableMap
466         for locals -- move code from VariableMap here.  Avoid unnecessary
467         allocations.
468         * flowanalysis.cs (FlowBranching.local_map): Remove.
469         (FlowBranching..ctor): Use Block.AssignableSlots.
470         (VariableMap): Remove unused constructors.
471
472 2007-05-11  Raja R Harinath  <rharinath@novell.com>
473
474         * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
475
476 2007-05-11  Marek Safar  <marek.safar@gmail.com>
477
478         * typemanager.cs (IsFriendAssembly): Should not be called for building
479         assembly.
480
481 2007-05-09  Marek Safar  <marek.safar@gmail.com>
482
483         * literal.cs (NullConstant): Print null in all cases.
484         
485         * expression.cs (Binary.ResolveOperator): Implemented delegate
486          comparison based on C# 2.0 changes.
487
488 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
489
490         This code is contributed under the MIT X11 license
491         
492         The following enables support for several C# 3.0 language features:
493         
494         * cs-tokenizer.cs: Added support for the "var" keyword.
495         
496         * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
497           Added VarExpr class to facilitate type inferencing.
498         
499         * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
500           to support anonymous types.
501         
502         * assign.cs: Added support for type inferencing and initialization.
503         
504         * anonymous.cs: Added AnonymousClass class to enable anonymous types.
505         
506         * expression.cs: Added implicit array support to ArrayCreation.
507           Added 5 types and 1 interface:
508           
509           IInitializable                Implementing classes can inject initializing
510                                         statements after object instantiation.
511           
512           Initializer                   Stores data for object initialization.
513           
514           AnonymousType                 An expression for anonymous types.
515           
516           AnonymousTypeParameter        Stores data about an anonymous type's field.
517           
518           NewInitialize                 An expression for object initialization.
519           
520           CollectionInitialize          An expression for collection initialization.
521         
522         * statement.cs: Added "var" keyword support to the foreach, using, and fixed
523           statements.
524
525 2007-05-06  Marek Safar  <marek.safar@gmail.com>
526
527         A fix for bug #81500
528         * cs-tokenizer.cs: Add special handling for coalescing operator.
529
530 2007-05-06  Marek Safar  <marek.safar@gmail.com>
531
532         A fix for bug #81529
533         * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
534         its value from base class until it is redefined.
535
536 2007-05-02  Raja R Harinath  <rharinath@novell.com>
537
538         Fix regression in cs0631-3.cs
539         * cs-parser.jay (operator_declarator): Add opt_attributes to error
540         fallback.  Make error fallback catch more cases.
541
542 2007-05-01  Miguel de Icaza  <miguel@novell.com>
543
544         * cs-parser.jay: Allow parameters in operator declarations to have
545         attributes. 
546
547 2007-04-27  Miguel de Icaza  <miguel@novell.com>
548
549         * statement.cs (If.CloneTo): Only clone the FalseStatement if it
550         exists. 
551
552         * lambda.cs (ContextualReturn.Resolve): An expression is valid
553         inside the ContextualReturn, it does not have to be an
554         ExpressionStatement. 
555
556 2007-04-24  Miguel de Icaza  <miguel@novell.com>
557
558         * lambda.cs (ContextualReturn.Resolve): if the return type is not
559         set, set it.
560
561 2007-04-23  Miguel de Icaza  <miguel@novell.com>
562
563         * anonymous.cs (AnonymousContainer): split the virtual Resolve
564         method in two methods: ResolveNoDefine and Resolve.
565
566         ResolveNoDefine will stop just after ResolveTopBlock has been
567         called.   
568
569         Resolve will then continue by creating a method and issuing the
570         call to method.Define ().
571
572         (AnonymousMethod): Split and implement the new Resolve and
573         ResolveNoDefine as well.
574
575         * lambda.cs (LambdaExpression): Split the anonymous method
576         resolution code into a separate routine (CoreCompatibilityTest)
577         from DoCompatibleTest.
578
579         (LambdaExpression.TryBuild): New method, this method tries to
580         build the LambdaExpression with the given set of types to be used
581         as the types for the various parameters of the lambda expression. 
582
583         If the compilation succeed with the given types, the infered type
584         of the Anonymous method is returned, otherwise null is returned.
585
586 2007-04-23  Marek Safar  <marek.safar@gmail.com>
587
588         A fix for bug #81414
589         * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
590
591 2007-04-22  Miguel de Icaza  <miguel@novell.com>
592
593         * cs-tokenizer.cs: Change various identifiers here from the
594         camelCasing to the recommended Linux-like style for instance
595         variables from the Coding Guidelines. 
596
597 2007-04-19  Martin Baulig  <martin@ximian.com>
598
599         * convert.cs
600         (Convert.ImplicitReferenceConversionCore): Allow conversions from
601         System.Enum to System.ValueType.
602
603 2007-04-13  Martin Baulig  <martin@ximian.com>
604
605         Rewrote implicit reference conversions.  We need to distinguish
606         between implicit reference conversions (13.1.4) and implicit
607         boxing conversions (13.1.5).
608
609         According to the spec, there's an an implicit conversion
610         "From a one-dimensional array-type S[] to IList<T> and base
611         interfaces of this interface, provided there is an implicit
612         reference conversion from S to T."  Note that this does not
613         include boxing conversions.
614
615         * convert.cs
616         (Convert.ImplicitTypeParameterBoxingConversion): New method.
617         (Convert.ImplicitReferenceConversion): Split into
618         ImplicitReferenceConversionCore() and
619         ImplicitBoxingConversionExist().
620         (Convert.ImplicitReferenceConversionExists): Use the new
621         ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
622
623 2007-04-12  Martin Baulig  <martin@ximian.com>
624
625         * convert.cs (Convert.ImplicitReferenceConversion): Move the
626         `TypeManager.null_type' checks up to the top of the method.
627
628 2007-04-11  Marek Safar  <marek.safar@gmail.com>
629
630         A fix for bug #81350
631         * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
632         extension methods.
633
634 2007-04-11  Martin Baulig  <martin@ximian.com>
635
636         * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
637         Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
638         to make this work for generic classes; fixes #79561.
639
640 2007-04-11  Martin Baulig  <martin@ximian.com>
641
642         * expression.cs (As): Add support for nullable types; fixes #79371.
643
644 2007-04-11  Martin Baulig  <martin@ximian.com>
645
646         * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
647         `type.FullName' is null; fixes #80243.
648
649 2007-04-11  Martin Baulig  <martin@ximian.com>
650
651         * expression.cs (Invocation.IsApplicable): Don't modify the method
652         if type inference succeeded, but the method was not applicable.
653         Fixes #81250.
654
655 2007-04-10  Marek Safar  <marek.safar@gmail.com>
656
657         A fix for bug #81324
658         * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
659         internal and external namespaces containers.
660
661 2007-04-10  Martin Baulig  <martin@ximian.com>
662
663         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
664         TypeManager.DropGenericMethodArguments() so we also call
665         IMethodData.SetMemberIsUsed() for generic methods.  Fixes #80357.
666
667 2007-04-10  Martin Baulig  <martin@ximian.com>
668
669         * iterators.cs (Iterator.CreateIterator): Don't crash if
670         `method.ReturnType' is null.  This happens if something went wrong
671         while resolving that typ (we already reported an error in this case).
672
673 2007-04-10  Martin Baulig  <martin@ximian.com>
674
675         * expression.cs (New.DoResolve): Don't call CheckComImport() on
676         generic interfaces; report the CS0144 directly.
677
678 2007-04-10  Martin Baulig  <martin@ximian.com>
679
680         * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
681         `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
682
683 2007-04-10  Martin Baulig  <martin@ximian.com>
684
685         * expression.cs (New.DoEmitTypeParameter): Fix #81109.
686
687 2007-04-09  Raja R Harinath  <rharinath@novell.com>
688
689         A better fix
690         * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
691         * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
692
693         Fix #81338
694         * statement.cs (For.Resolve): If resolution fails, use
695         KillFlowBranching.
696
697 2007-04-08  Marek Safar  <marek.safar@gmail.com>
698
699         * anonymous.cs (MakeName): Make faster and zero-based.
700         (VerifyExplicitParameterCompatibility): Back to mode where generic
701         parameter is ignored.
702         (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
703
704         * class.cs (EmitType): Method can emit another new method.
705
706         * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
707
708         * driver.cs: Updated.
709
710         * lambda.cs: Reuse predefined empty parameters.
711
712         * parameter.cs: Updated
713
714         * support.cs: Implemented InflateTypes.
715
716         * typemanager.cs (GetFullName): Don't use FullName as it can be null.
717         (InitSystemCore): Introduced to isolate 3.0 dependencies.
718
719 2007-04-03  Martin Baulig  <martin@ximian.com>
720
721         Fix #80632.
722
723         * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
724         version of TypeManager.IsOverride() which also works with generic
725         types.  
726
727 2007-04-03  Martin Baulig  <martin@ximian.com>
728
729         Fix #81044.
730
731         * convert.cs
732         (Convert.ExplicitReferenceConversion): We need to cast when
733         converting from IList<T> to S[].
734
735 2007-04-01  Marek Safar  <marek.safar@gmail.com>
736
737         * decl.cs (FindExtensionMethods): Consider all candidates with same name
738         at this level.
739         
740         * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
741
742 2007-03-31  Marek Safar  <marek.safar@gmail.com>
743
744         * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
745         argument and return type inferring.
746
747         * codegen.cs (InferReturnType): Flag whether return can be inferred.
748         (ReturnType): Turned to property.
749
750         * statement.cs (Return): Implemented return type inferring.
751
752         * support.cs (ReflectionParameters): Use local types if possible.
753
754 2007-03-30  Raja R Harinath  <rharinath@novell.com>
755
756         * flowanalysis.cs (FlowBranching.Reachability): Remove.
757         (FlowBranching.UsageVector): Update to changes.
758
759         Prepare to kill 'Reachability'
760         * flowanalysis.cs (UsageVector): Remove 'Reachability' from
761         argument of constructor.
762
763 2007-03-29  Raja R Harinath  <rharinath@novell.com>
764
765         Prepare to kill 'Reachability'
766         * flowanalysis.cs (UsageVector.is_unreachable): New.
767         (UsageVector): Update to maintain 'is_unreachable' in parallel to
768         'reachability', and verify they're consistent.
769
770         Fix #81121
771         * expression.cs (New.EmitStatement): Handle type parameters here too.
772
773 2007-03-29  Martin Baulig  <martin@ximian.com>
774
775         Fix #79148.
776
777         * anonymous.cs
778         (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
779         CompilerGeneratedClass.
780         (ScopeInfo.EmitScopeInstance): Make this protected.
781         (CapturedVariable.EmitInstance): Use `Ldarg_0' if
782         `ec.CurrentAnonymousMethod.Scope == Scope'.
783
784         * statement.cs (Block.ScopeInfo): Make this a property.
785
786 2007-03-27  Raja R Harinath  <harinath@gmail.com>
787
788         Prepare to kill 'Reachability'
789         * flowanalysis.cs (FlowBranching.Reachability): Make class private.
790         (FlowBranching.UsageVector.Reachability): Remove property.
791         (FlowBranching.UsageVector.IsUnreachable): New property.
792         (FlowBranching.UsageVector.ResetBarrier): New.
793         (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
794         * codegen.cs, statement.cs: Update to changes.
795
796 2007-03-27  Martin Baulig  <martin@ximian.com>
797
798         Fix #81209.
799
800         * decl.cs
801         (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
802         generic types.
803
804 2007-03-26  Raja R Harinath  <rharinath@novell.com>
805
806         * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
807         instead of TriState.  Remove all mention of TriState.
808
809         * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
810         replaced by a boolean.  Add boolean 'is_unreachable' field, check
811         and maintain invariants.
812
813 2007-03-25  Marek Safar  <marek.safar@gmail.com>
814
815         * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
816
817 2007-03-25  Marek Safar  <marek.safar@gmail.com>
818
819         * expression.cs: Stop using obsolete 2.0 opcodes.
820
821 2007-03-25  Marek Safar  <marek.safar@gmail.com>
822
823         * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
824         one of the latests Martin's fixes.
825
826 2007-03-23  Miguel de Icaza  <miguel@novell.com>
827
828         * expression.cs: On BigEndian systems, swap the bytes, temporary
829         solution until we get a new bitconverter class.
830
831 2007-03-23  Martin Baulig  <martin@ximian.com>
832
833         Fix #81158.
834
835         * decl.cs (MemberCache.AddMembers): Add generic methods both as
836         "Method" and "Method`1".  Normally, a cache lookup is done on the
837         "Method" form (ie. without the generic arity), but this one makes
838         lookups on the full form work as well.
839
840 2007-03-22  Raja R Harinath  <rharinath@novell.com>
841
842         * flowanalysis.cs (Reachability): Reorganize slightly, and remove
843         unused properties.
844
845 2007-03-20  Bill Holmes  <billholmes54@gmail.com>
846         * class.cs: 
847         Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
848         ordered_member_list, to TypeBuilder to store members to be defined
849         in the order they were parsed in.
850         - ordered_explicit_member_list contains all properties indexers
851           and methods that are defined as explicit implementation of an
852           interface or base class.
853         - ordered_member_list contains all properties indexers and methods
854           that are not defined as explicit implementation of an interface
855           or base class.
856
857         Removed MethodArrayList and IndexerArrayList from TypeBuilder.  The 
858         functionality in these removed classes has been replaced with 
859         ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and 
860         CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
861
862         Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
863         to CheckForDuplications inside GetMethod and SetMethod Define Method
864         to handle method property and indexer name conflicts.
865
866         Fixes #79434
867
868         All code is contributed under the MIT/X11 license.
869
870 2007-03-20  Martin Baulig  <martin@ximian.com>
871
872         * class.cs (TypeContainer.Interfaces): Removed; they're now
873         included in `TypeContainer.Types'.
874
875 2007-03-20  Martin Baulig  <martin@ximian.com>
876
877         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
878
879         * class.cs (TypeContainer.CreateType): New public method.  This is
880         now called before DefineType() to create the TypeBuilders.
881         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
882         has already been created by CreateType().
883         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
884         don't resolve our base classes here; this has been moved into
885         DefineBaseTypes().  We're now called from CreateType().
886         (TypeContainer.DefineBaseTypes): New private method; resolve our
887         base classes here.  We're now called from DefineType().
888
889         * rootcontext.cs
890         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
891         our types first to create all the TypeBuilders.  After that, call
892         TypeContainer.DefineType() on all the types which'll resolve their
893         base classes and setup the resolve order.
894
895 2007-03-20  Martin Baulig  <martin@ximian.com>
896
897         * class.cs (TypeContainer.Enums): Removed; they're now included in
898         `TypeContainer.Types'.  
899
900 2007-03-20  Martin Baulig  <martin@ximian.com>
901
902         * class.cs
903         (TypeContainer.DefineType): Don't call ResolveMembers() here.
904         (TypeContainer.DoResolveMembers): Call DefineType() on our
905         `compiler_generated' classes; moved here from DefineNestedTypes().
906
907         * rootcontext.cs
908         (RootContext.ResolveTree): Call ResolveMembers() on all
909         TypeContainer's in the `type_container_resolve_order'.
910
911 2007-03-19  Marek Safar  <marek.safar@gmail.com>
912
913         * class.cs: Use corlib to handle InternalMethodImplAttribute.
914
915 2007-03-17  Marek Safar  <marek.safar@gmail.com>
916
917         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
918         implementation flags.
919
920 2007-03-17  Marek Safar  <marek.safar@gmail.com>
921
922         * class.cs: More optimizations for type parameters.
923
924 2007-03-15  Marek Safar  <marek.safar@gmail.com>
925
926         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
927
928         * ecore.cs, parameter.cs: More common code for both corlibs.
929
930         * typemanager.cs (IsGenericMethod): Simplified.
931
932 2007-03-15  Raja R Harinath  <rharinath@novell.com>
933
934         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
935         'returns'.
936         * statement.cs, iterators.cs, lambda.cs: Update to changes.
937
938         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
939         unconditionally.  Simplify explanation.
940         (Try.Resolve, Using.Resolve): Likewise.
941
942 2007-03-15  Martin Baulig  <martin@ximian.com>
943
944         Fix #80731.
945
946         * decl.cs (DeclSpace): If we're a partial class, use our
947         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
948
949 2007-03-15  Raja R Harinath  <rharinath@novell.com>
950
951         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
952         'throws'.
953         (FlowBranching.UsageVector): Update to changes.
954         (FlowBranching.MergeSiblings): Likewise.
955         * statement.cs: Likewise.
956
957 2007-03-15  Martin Baulig  <martin@ximian.com>
958
959         Fix #79302.
960
961         * decl.cs
962         (MemberCache): Added a special .ctor for type parameters.
963
964         * typemanager.cs
965         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
966         `MemberCache'.  
967
968 2007-03-09  Martin Baulig  <martin@ximian.com>
969
970         * enum.cs (Enum): Make this a TypeContainer.
971         (EnumMember): Derive from `Const'.
972
973         * const.cs
974         (Const.DoResolveValue): New protected virtual method; move most of
975         the functionality of ResolveValue() here so we can override it in
976         `EnumMember'.
977         (Const.CreateConstantReference): Make this virtual.
978
979         * class.cs (Kind): Add `Kind.Enum'.
980         (TypeContainer.Emit): Don't emit the enums here; they're already
981         in the `RootContext.typecontainer_resolve_order'.
982
983         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
984         here; they're already in the `typecontainer_resolve_order'.
985
986         * ecore.cs (EnumConstant.ConvertImplicitly): Add
987         TypeManager.DropGenericTypeArguments().
988
989         * typemanager.cs
990         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
991         (TypeManager.IsEnumType): Likewise.
992         (TypeManager.EnumToUnderlying): Likewise.
993         (TypeManager.IsEqual): Add support for enums.
994
995 2007-03-12  Raja R Harinath  <rharinath@novell.com>
996
997         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
998         DefaultParameterValueAttribute to be undefined, say if System.dll
999         is not referenced.
1000
1001 2007-03-11  Marek Safar  <marek.safar@gmail.com>
1002
1003         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
1004         any mscorlib.
1005
1006 2007-03-10  Marek Safar  <marek.safar@gmail.com>
1007
1008         * class.cs, parameter.cs: Unified parameters verification.
1009
1010 2007-03-08  Martin Baulig  <martin@ximian.com>
1011
1012         * cs-parser.jay (constructor_header): Pass the location to the
1013         newly created TopLevelBlock.
1014
1015 2007-03-07  Martin Baulig  <martin@ximian.com>
1016
1017         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
1018
1019 2007-03-06  Miguel de Icaza  <miguel@novell.com>
1020
1021         * convert.cs (ExplicitReferenceConversionExists): Sync this method
1022         with the changes from David, fixes the build.
1023
1024 2007-03-05  David Mitchell  <dmitchell@logos.com>
1025
1026         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
1027         and its base interfaces to a one-dimensional array type S[],
1028         provided there is an implicit or explicit reference conversion
1029         from S to T.
1030
1031 2007-03-03  Marek Safar  <marek.safar@gmail.com>
1032
1033         * cs-tokenizer.cs: Implemented basic linq grammar.
1034
1035         * driver.cs: Set linq lang version on demand.
1036
1037 2007-02-26  Marek Safar  <marek.safar@gmail.com>
1038
1039         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
1040
1041 2007-02-25  Marek Safar  <marek.safar@gmail.com>
1042
1043         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
1044         (Fixes #80455)
1045
1046         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
1047         here.
1048         Check property and event extern attributes.
1049
1050         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
1051         charset.
1052
1053 2007-02-24  Marek Safar  <marek.safar@gmail.com>
1054
1055         A fix for bug #80407
1056         * ecore.cs: Don't report ambiguity error when methods have same parent.
1057
1058 2007-02-23  Marek Safar  <marek.safar@gmail.com>
1059
1060         A fix for bug #80878
1061         * class.cs, cs-parser.jay: Event property can host anonymous methods.
1062
1063 2007-02-22  Marek Safar  <marek.safar@gmail.com>
1064
1065         * attribute.cs: Enable ExtensionAttribute presence test.
1066
1067 2007-02-22  Marek Safar  <marek.safar@gmail.com>
1068
1069         * class.cs: Warn about missing GetHashCode only when Equals is override.
1070
1071         * decl.cs: Check accessibility of type arguments.
1072
1073         * typemanager.cs: Correctly report nullable array.
1074
1075 2007-02-20  Marek Safar  <marek.safar@gmail.com>
1076
1077         * class.cs, report.cs: Capture more details when things go wrong.
1078
1079 2007-02-20  Marek Safar  <marek.safar@gmail.com>
1080
1081         A fix for bug #80650
1082         * cs-parser.jay: Anonymous container starts at constructor declaration
1083         and not at block beginning because it has to be usable in constructor
1084         initializer.
1085
1086         * statement.cs: Use context location and not block one for error reporting.
1087
1088 2007-02-18  Marek Safar  <marek.safar@gmail.com>
1089
1090         A fix for bug #78712
1091         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
1092         too.
1093
1094 2007-02-18  Marek Safar  <marek.safar@gmail.com>
1095
1096         A fix for bug #80493 by Atsushi Enomoto
1097         * cs-parser.jay: Ignore invalid attribute target.
1098
1099 2007-02-18  Marek Safar  <marek.safar@gmail.com>
1100  
1101         * cs-tokenizer.cs: Ignore '\0' as white space character.
1102
1103 2007-02-17  Miguel de Icaza  <miguel@novell.com>
1104
1105         * cs-parser.jay: Add support for lambda expressions to the mcs
1106         compiler as well.
1107
1108         * lambda.cs: Only clone when we are probing, not on the final call
1109         (Compatible is the final call). 
1110
1111         * statement.cs (CloneContext): Introduce class to provide block
1112         remapping during clone.
1113
1114         All statements Clone themselves now.
1115
1116         (Clone): special handling for blocks, when we clone a block, we
1117         register the block inside this routine, as children of the block
1118         might trigger a lookup. 
1119         
1120         * expression.cs: Add support for CloneContext in all expressions. 
1121         
1122 2007-02-17  Marek Safar  <marek.safar@gmail.com>
1123  
1124         A fix for bug #80493
1125         * statement.cs: Report ambiguous warning when interfaces are not related.
1126
1127 2007-02-15  Marek Safar  <marek.safar@gmail.com>
1128
1129         C# 3.0 extension methods.
1130
1131         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
1132         cannot be used directly.
1133
1134         * class.cs (Class.Emit): Emit extension attribute if any class method
1135         is extension method.
1136         (Method.Define): Add basic extension method validation conditions.
1137         (Method.Emit): Emit extension attribute for method.
1138
1139         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
1140         extension method exists. Currently we follow same approach as Microsoft
1141         does, emit even if a method or a class are private but this can change
1142         later.
1143
1144         * cs-parser.jay: Add handling of `this' keyword in method parameters
1145         context.
1146
1147         * decl.cs (DeclSpace.IsStaticClass): New property.
1148         (MemberCache.FindExtensionMethods): Looks for extension methods with
1149         defined name and extension type.
1150
1151         * doc.cs: Updated after OverloadResolve changes.
1152
1153         * driver.cs: Add new soft reference to System.Core.dll.
1154
1155         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
1156         (ExtensionMethodGroupExpr): Represents group of extension methods.
1157
1158         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
1159         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
1160         to MethodGroupExpr and made non-static for easier customization.
1161         (Invocation.DoResolve): Add extension method lookup when no standard
1162         method was found.
1163         (MemberAccess.DoResolve): Try extension methods if no member exists.
1164
1165         * modifiers.cs: Add METHOD_EXTENSION modifier.
1166
1167         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
1168         as well as candidate extension type.
1169         (ComputeNamespaces): When assembly constains extension methods registers
1170         them.
1171         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
1172         extension method lookup.
1173         (Namespace.LookupExtensionMethod): Looks for extension method in this
1174         namespace.
1175         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
1176         find a method which matches name and extensionType.
1177
1178         * parameter.cs (Parameter): Add This modifer.
1179         (HasExtensionMethodModifier): New property.
1180         (Resolve): Add extension parameter check.
1181         (ModFlags): turned to property to exclude this modifier as it is not real
1182         parameter modifier.
1183         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
1184
1185         * support.cs (ParameterData): Add ExtensionMethodType.
1186         (ReflectionParameters): Implemented ExtensionMethodType interface property.
1187
1188         * typemanager.cs: Add type and ctor extension attribute type.
1189
1190 2007-02-15  Miguel de Icaza  <miguel@novell.com>
1191
1192         * report.cs (DisableErrors, EnableErrors): used to prevent error
1193         output when we are "trying" to compile various methods with
1194         different types. 
1195
1196         * ecore.cs (Expression): Add Clone method that calls the virtual
1197         CloneTo method.  The current CloneTo method in Expression throws
1198         an exception so we can track down all the places where this must
1199         be implemented (not using abstract, because that would be a lot of
1200         up-front-work before we can start testing the implementation
1201         idea). 
1202
1203         Important: we only need Clone capabilities for expressions created
1204         by the parser, as the expressions we will be cloning are
1205         expressions in the pre-resolved state.   This vastly simplifies
1206         the work required. 
1207         
1208         (SimpleName): Add CloneTo that does nothing.
1209         (EmptyCast): Add CloneTo.
1210         
1211         * expression.cs (Binary): Implement CloneTo.
1212         (Invocation.IsApplicable): Store the current ec in
1213         EmitContext.TempEc and restore it on return.  This is used so we
1214         do not have to sprinkle hundres of methods with an extra
1215         EmitContext, we know that the only user is the lambda expression
1216         ImplicitConversionExists code. 
1217         
1218         (Argument): Add Cloning capabilities.
1219         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
1220         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
1221         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
1222         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
1223         IndexerAccess): Add Clone capability.
1224
1225         (LocalVariableReference, This): TODO: needs cloned Block mapping.
1226
1227         (Argument): Add cloning capability.
1228
1229         * assign.cs (Assign): Implement CloneTo.
1230
1231         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
1232         
1233         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
1234         version by calling Convert with the EmitContext (that we are
1235         currently storing in ec, this is not great, but will do for now,
1236         to avoid passing EmitContext parameters to hundreds of functions
1237         that do not need them now).
1238
1239         (SetExpression): Remove, it is not needed.
1240         
1241         (ContextualReturn): Implement CloneTo.
1242
1243         * statement.cs (Statement): Implement cloning infrastructure,
1244         similar to expressions.
1245
1246         (Block): Partial implementation of Clone for statements.
1247
1248         (Return): Implement clone.
1249         
1250         * constant.cs (Constant.CloneTo): New method, does nothing.
1251
1252         * codegen.cs (TempEc): Add a static EmitContext as a temporary
1253         solution, until we decide how to exactly do this.  
1254         
1255 2007-02-14  Marek Safar  <marek.safar@gmail.com>
1256  
1257         A fix for bug #80493
1258         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
1259         a property is override we need to use second accessor.
1260
1261 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1262  
1263         A fix for bug #80418
1264         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
1265         methods.
1266
1267 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1268
1269         Another fix for bug #80749
1270         * pending.cs: Abstract class has priority over interfaces.
1271
1272 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1273
1274         Another fix for bug #80749
1275         * pending.cs: Abstract class has priority over interfaces.
1276
1277 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1278
1279         Another fix for bug #80749
1280         * pending.cs: Abstract class has priority over interfaces.
1281
1282 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1283
1284         Another fix for bug #80749
1285         * pending.cs: Abstract class has priority over interfaces.
1286
1287 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1288
1289         * class.cs Better error message.
1290
1291         * driver.cs: Add shorter versions of -optimize option.
1292
1293 2007-02-13  Martin Baulig  <martin@ximian.com>
1294
1295         * class.cs (Constructor.Emit): Check the return value of
1296         ec.ResolveTopBlock() and return on error.
1297
1298 2007-02-13  Raja R Harinath  <rharinath@novell.com>
1299
1300         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
1301         message to fix error message regression.
1302
1303 2007-02-12  Marek Safar  <marek.safar@gmail.com>
1304
1305         * delegate.cs: Delegate creation expression cannot be of Nullable type.
1306
1307 2007-02-12  Marek Safar  <marek.safar@gmail.com>
1308
1309         A fix for bug #80749
1310         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
1311         its parent container.
1312
1313         * class.cs (DefineFieldInitializers): Each initializer can has different
1314         resolve context.
1315
1316         * const.cs: Updated.
1317
1318 2007-02-11  Miguel de Icaza  <miguel@novell.com>
1319
1320         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
1321         now all the heavy lifting to check that embedded statements or
1322         expressions have the right form is done in the ContextualReturn.
1323
1324         (ContextualReturn): New class.  
1325
1326         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
1327         method that can be invoked to report 201, so we do not replicate
1328         this everywhere.
1329
1330         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
1331         
1332         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
1333         treating tabs as spaces. 
1334
1335 2007-02-09  Marek Safar  <marek.safar@gmail.com>
1336
1337         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
1338         * assign.cs: Use full implicit conversion for right side check.
1339
1340 2007-02-09  Marek Safar  <marek.safar@gmail.com>
1341
1342         * statement.cs (Switch): Switch over boolean type is not standardized.
1343
1344 2007-02-08  Marek Safar  <marek.safar@gmail.com>
1345
1346         A fix for bug #80755
1347         * decl.cs (FindBaseEvent): Don't use method cache for events.
1348
1349 2007-02-07  Marek Safar  <marek.safar@gmail.com>
1350
1351         * cs-parser.jay: Better syntax error handling.
1352
1353         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
1354         instead of underlying type value.
1355
1356 2007-02-06  Marek Safar  <marek.safar@gmail.com>
1357
1358         * driver.cs: Check define identifier before is registered.
1359
1360         * namespace.cs: Use existing error message.
1361
1362         * report.cs: New warning.
1363
1364 2007-02-06  Marek Safar  <marek.safar@gmail.com>
1365
1366         A fix for bug #80742
1367         * expression.cs: Delegate Invoke method can be called directly.
1368
1369 2007-02-06  Marek Safar  <marek.safar@gmail.com>
1370
1371         A fix for bug #80676
1372         * class.cs (IsEntryPoint): The Main method can have params modifier.
1373
1374 2007-02-04  Miguel de Icaza  <miguel@novell.com>
1375
1376         * parameter.cs (Parameter, Parameters): Add Clone method.
1377
1378         * anonymous.cs (Compatible): Turn method into virtual method, so
1379         LambdaExpression can implement a different behavior.
1380
1381         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
1382         out the basic checking here, so it can be used by
1383         LambdaExpressions.
1384         
1385         * lambda.cs: Introduce "Compatible" function that will do the
1386         heavy lifting.
1387
1388 2007-02-02  Marek Safar  <marek.safar@gmail.com>
1389
1390         * attribute.cs: Unified one error message.
1391
1392         * class.cs (Class): Use type attributes and not properties to test static
1393         class.
1394         (IsEntryPoint): Don's pass local variable.
1395
1396         * convert.cs: Removed duplicate check.
1397
1398         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
1399
1400         * driver.cs: Don't crash when soft reference does not exist.
1401
1402         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
1403         (UsingEntry): Removed redundant allocation.
1404
1405         * parameter.cs: Add fast path for type parameters.
1406
1407         * support.cs: Don't allocate attribute when it's not used.
1408
1409 2007-01-30  Miguel de Icaza  <miguel@novell.com>
1410
1411         * anonymous.cs
1412         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
1413         this into a virtual method, so we can override it in LambdaExpression.
1414
1415         * driver.cs: Improve diagnostics in case of failure. 
1416
1417         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
1418         write a function that is slightly more complex and that parses:
1419
1420         type identifier [, type identifier]* )
1421
1422         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
1423         this expression:
1424
1425                 (canEmpty ? i >= 0 : i > 0)
1426
1427 2007-01-30  Raja R Harinath  <rharinath@novell.com>
1428
1429         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
1430         exception on possibly valid code.
1431
1432 2007-01-29  Raja R Harinath  <rharinath@novell.com>
1433
1434         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
1435         Push/PopPosition.
1436         (parse_opt_type_arguments): Remove.  It's almost the same as
1437         parse_less_than.
1438         (parse_namespace_or_typename): Use parse_less_than.
1439
1440 2007-01-28  Miguel de Icaza  <miguel@novell.com>
1441
1442         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
1443         this bug took a few hours to find, because the state saved and
1444         restored by PushPosition and PopPosition was ignoring the state of
1445         parse_generic_less_than.
1446
1447         I can also now remove the handling of OP_LT and OP_GT, this solves
1448         the big mistery.
1449         
1450         * cs-tokenizer.cs: store the location for the ARROW token, we use
1451         that in the parser.
1452
1453         (PushPosition, PopPosition): save/restore also `current_token',
1454         restore `parse_generic_less_than' (was missing).
1455
1456         (parse_opt_type_arguments): use parse_type, not
1457         parse_namespace_or_typename to parse types.
1458
1459         * lambda.cs: Empty new file, will eventually have the lambda
1460         expression implementation.
1461
1462         * lambda.test: used to test the internal tokenizer. 
1463
1464         * report.cs (FeatureIsNotISO1): Rename from
1465         FeatureIsNotStandardized, because it was about the language level
1466         (1 vs 2) it was not about standarization.
1467
1468         (FeatureRequiresLINQ): New.
1469
1470         * support.cs (SeekableStreamReader): Only require that the reader
1471         is a TextReader, not a StreamReader, so we can plug StringReader. 
1472
1473         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
1474         given position in the input stream the following tokens can be
1475         parsed as a type followed by an identifier.
1476
1477         (is_punct): after a '(' if parse_type_and_parameter returns true,
1478         then return a special token OPEN_PARENS_LAMBDA which is used to
1479         avoid reduce/reduce errors in the grammar for the
1480         lambda_expression rules.
1481
1482         (parse_type): implement a type parser inside the
1483         tokenizer, the parser only returns true or false depending on
1484         whether the input at a given position can be parsed as a type.
1485
1486         (peek_token): new method used during type parsing.
1487
1488 2007-01-28  Raja R Harinath  <rharinath@novell.com>
1489
1490         Fix #80531
1491         * anonymous.cs (ScopeInfo.InflateParameters): New.
1492         (AnonymousContainer.Resolve): Use it to redirect types of
1493         delegate parameters.
1494
1495 2007-01-27  Raja R Harinath  <rharinath@novell.com>
1496
1497         Fix #80530
1498         * expression.cs (Error_InvalidArguments): Don't use two different
1499         messages for CS1503.  Use ExtraInformation and
1500         SymbolRelatedToPreviousError instead.
1501
1502         Fix #80358
1503         * decl.cs (DeclSpace.initialize_type_params): Don't access
1504         'type_params' of a partial class directly.
1505
1506 2007-01-26  Miguel de Icaza  <miguel@novell.com>
1507
1508         * constant.cs: Removed a handful of out-of-range checks that were
1509         not necessary. 
1510
1511 2007-01-25  Marek Safar  <marek.safar@gmail.com>
1512
1513         * expression.cs (CheckUselessComparison): Add additional check for char
1514         constants.
1515
1516         * namespace.cs: Fixed typo.
1517
1518 2007-01-23  Miguel de Icaza  <miguel@novell.com>
1519
1520         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
1521         gone, instead we inline the test, preventing the needless casts to
1522         longs, ulongs and doubles for the parameters, avoiding calls to
1523         methods that overchecked stuff, and instead inlined things
1524         nicely. 
1525
1526 2007-01-20  Marek Safar  <marek.safar@gmail.com>
1527
1528         * cs-parser.jay: Better parameter error handling.
1529
1530 2007-01-17  Marek Safar  <marek.safar@gmail.com>
1531
1532         A fix for bug #80368, #80522
1533         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
1534         whether array initializer contains constants only.
1535         (ArrayCreation.Emit): Use better formula to decide when
1536         are array initializers for static initialization.
1537         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
1538         have to emit even constants otherwise they are pre-initialized.
1539
1540 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
1541             Raja R Harinath  <rharinath@novell.com>
1542
1543         Fix emit order of 'get' vs. 'set'.
1544         * support.cs (Accessors): New.
1545         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
1546         Note the order in which accessors are declared in the source.
1547         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
1548         Refactored from Property.Define and Indexer.Define.
1549         (PropertyBase.DefineAccessors): New helper that calls the above in
1550         appropriate order as noted by the parser.
1551         (Property.Define, Indexer.Define): Update to changes.
1552         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
1553
1554 2007-01-17  Raja R Harinath  <rharinath@novell.com>
1555
1556         Fix cs0029-6.cs and gcs0029-2.cs (regression)
1557         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
1558         there's an implicit conversion from the current type to the target
1559         type before converting the underlying constant.
1560
1561 2007-01-16  Marek Safar  <marek.safar@gmail.com>
1562
1563         * const.cs (ResolveValue): Updated after constant conversion was made more
1564         generic.
1565
1566         * constant.cs (GetAttributableValue): constant to object conversion is
1567         used for attributes only.
1568         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
1569         constant conversions.
1570         (LongConstant.ConvertImplicitly): Ditto.
1571
1572         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
1573         (ImplicitConversionStandard): Handle constant conversion as extra step.
1574         It solves the issue when constant conversion was called indirectly like
1575         inside array initializer and constant folding was skipped.
1576
1577         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
1578         this change.
1579
1580         * statement.cs(ImplicitConversionStandard): Updated after constant
1581         conversion was made more generic.
1582
1583 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
1584
1585         * expression.cs (As.DoResolve): Use GenericConstraints instead of
1586         Constraints, solves the problem where the compiler incorrectly
1587         reported that a type parameter was not constrained to a class (Bug
1588         80518)
1589
1590 2007-01-14  Marek Habersack  <grendello@gmail.com>
1591
1592         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
1593
1594 2007-01-14  Marek Safar  <marek.safar@gmail.com>
1595
1596         A fix for bug #80368
1597         * assign.cs (FieldInitializer): New class implements field
1598         initializer statement.
1599
1600         * attribute.cs: Update after FieldMember rename.
1601
1602         * class.cs (PropertyBasedMember): New common class for property based
1603         types.
1604         (InterfaceMemberBase): New base class for all members which can be used as
1605         an interface members.
1606         (MethodCore): Moved really common code to InterfaceMemberBase.
1607         (Method.Define): Equal and GetHasCode detection is relevant for methods
1608         only.
1609         (MethodData.Define): Don't assume that public event implements an
1610         interface automatically.
1611         (MethodData.DefineMethodBuilder): Issue an error even if only extern
1612         modifier is used.
1613         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
1614         (FieldMember): Merged with FieldBase.
1615         (EventProperty.AEventPropertyAccessor): New specialization to check whether
1616         event extern modifier can be used.
1617         (EventField.EventFieldAccessor): Moved event field specific code here.
1618         (Event.AllowedModifiers): Even event can be extern.
1619         (Event.FindOutBaseMethod): New override specific to events.
1620         (Indexer.parameters): Reintroduce parameters because base class holds
1621         only properties common data.
1622         (Indexer.CheckForDuplications): Indexers are threated as methods so we
1623         need do extra parameters check.
1624
1625         * const.cs: Update after FieldMember rename.
1626
1627         * decl.cs (MemberCache.FindBaseEvent): New method.
1628
1629         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
1630         to reflect that indexer is now derived from PropertyBased.
1631
1632         * ecore.cs (GetMemberType): Made public.
1633         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
1634         obsolete event.
1635
1636         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
1637         
1638         * typemanager.cs (CSharpSignature): Correctly print event accessors.
1639         (RegisterEvent): Removed.
1640         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
1641         (GetPrivateFieldOfEvent): Renamed to GetEventField.
1642
1643 2007-01-11  Raja R Harinath  <rharinath@novell.com>
1644
1645         Fix #80249
1646         * statement.cs (CollectionForeach.TryType): Prefer generic
1647         GetEnumerator over non-generic variant.  Fix code to follow comments.
1648
1649 2007-01-09  Raja R Harinath  <rharinath@novell.com>
1650
1651         Fix #80446
1652         * support.cs (ReflectionParameter): Don't use an invalid index on
1653         the generic parameter data.
1654
1655 2007-01-08  Miguel de Icaza  <miguel@novell.com>
1656
1657         * driver.cs: Just add a tiny bit of infrastructure.
1658
1659 2007-01-02  Marek Safar  <marek.safar@gmail.com>
1660
1661         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
1662         where field type is struct from current assembly.
1663         
1664         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
1665         it is possible.
1666
1667 2007-01-02  Marek Safar  <marek.safar@gmail.com>
1668
1669         A fix for bug #80381
1670         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
1671         the core types.
1672
1673         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
1674         messages.
1675         (Namespace.LookupType): Always use core types from corlib when speficied.
1676
1677         * report.cs: A new warning.
1678
1679         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
1680         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
1681         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
1682
1683         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
1684         (InitCoreTypes): Set expression type of object_type and value_type
1685         immediately after lookup.
1686
1687 2007-01-01  Miguel de Icaza  <miguel@novell.com>
1688
1689         * cs-tokenizer.cs: Accept Pc class characters (Connector
1690         Punctuation) as valid identifiers.  Fixes #78259
1691
1692         * expression.cs (Invocation.DoResolve): Moved the check for the
1693         use of `this' for doing method calls to the Invocation resolution
1694         step, after overload resolution has taken place instead of doing
1695         the check at the low-level `This.DoResolve' level.
1696
1697         The `This.DoResolve'(appens before overload resolution, so it has
1698         no way of knowing if the method that will be called will be
1699         instace or static, triggering an erroneous report for cs0188 (Bug
1700         78113).
1701
1702         We now do the check for instance method invocations after we know
1703         what method will be called.
1704
1705         (This.CheckThisUsage): Move the actual use of this structure
1706         checking into its own method and expose it. 
1707
1708         * Everywhere that called Error_ValueCannotBeConverted: pass a new
1709         EmitContext.
1710
1711         Exceptions: Null.ConvertImplicitly,
1712         Constant.ImplicitConversionRequired as there are too many call
1713         sites for passing the ec. 
1714
1715         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
1716         EmitContext, if the value is null, then we do not try to provide
1717         the extra information from the error (If a userdefined conversion
1718         exists, as UserDefinedConversion requires a non null-EmitContext).
1719
1720         Fixes: #80347
1721
1722 2006-12-30  Raja R Harinath  <rharinath@novell.com>
1723
1724         * flowanalysis.cs (MyBitVector): Document some invariants.
1725         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
1726         introduced below, and add a couple of others, 
1727
1728 2006-12-30  Marek Safar  <marek.safar@gmail.com>
1729
1730         * attribute.cs (GetMethodObsoleteAttribute): Uses new
1731         GetPropertyFromAccessor and GetEventFromAccessor.
1732         
1733         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
1734         overrides non-obsolete one.
1735         (Indexer.Define): Error message has been moved to the parser.
1736
1737         * cs-parser.jay: Better syntax errors handling.
1738
1739         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
1740         when an invocation has no arguments.
1741
1742         * ecore.cs: Removed not used caching.
1743
1744         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
1745         implementation.
1746
1747         * report.cs: Add a new warning.
1748
1749         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
1750
1751         * typemanager.cs (enumeration_type): Removed.
1752         (CSharpSignature): Reuses IsSpecialMethod.
1753         (IsEqual): Hack for MS BCL.
1754         (GetPropertyFromAccessor): New method.
1755         (GetEventFromAccessor): New method.
1756         (IsSpecialMethod): Fixed to handle more cases.
1757
1758 2006-12-30  Marek Safar  <marek.safar@gmail.com>
1759
1760         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
1761         Made white spaces array static.
1762
1763         * ecore.cs (RemoveGenericArity): Optimized.
1764
1765         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
1766         10 times faster).
1767         (MyBitVector.initialize_vector): Simplified.
1768
1769 2006-12-22  Miguel de Icaza  <miguel@novell.com>
1770
1771         * ecore.cs: Am not entirely happy with this hack, but it seems to
1772         address the issue in 80257 (a small test case for
1773         CreativeDocs.NET). 
1774
1775         I set the MethodGroupExpr.Type to an internal compiler type
1776         (itself in this case) to force the resolution to take place.   Why
1777         it does not take place with a null is beyond me.
1778
1779 2006-12-20  Marek Safar  <marek.safar@gmail.com>
1780
1781         A fix for bug #80288
1782         * expression.cs (ResolveOperator): Consider user defined conversion for
1783         logical and operator too.
1784         (EmitBranchable): Optimization for logical and when full constant folding
1785         could not be applied but one operand is constant.
1786
1787 2006-12-19  Marek Safar  <marek.safar@gmail.com>
1788
1789         * class.cs (GetClassBases): Write 5 times every day, will never use
1790         FullName for error reporting.
1791
1792         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
1793
1794 2006-12-19  Martin Baulig  <martin@ximian.com>
1795
1796         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
1797         the symbol file info here.
1798
1799 2006-12-18  Marek Safar  <marek.safar@gmail.com>
1800
1801         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
1802         of `elseif' is taking then following sections are not taking.
1803         Fixes an issue reported on mono mailing list.
1804
1805 2006-12-18  Marek Safar  <marek.safar@gmail.com>
1806
1807         A fix for bug #80300
1808         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
1809         a caller is not taking.
1810
1811 2006-12-18  Raja R Harinath  <rharinath@novell.com>
1812
1813         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
1814         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
1815         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
1816         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
1817         * class.cs: Update to changes.
1818
1819 2006-12-17  Marek Safar  <marek.safar@gmail.com>
1820
1821         A fix for bug #79934
1822         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
1823         partial container.
1824
1825         * class.cs (ResolveMembers): Register an iterator in current container and
1826         not in shared one.
1827
1828 2006-12-16  Raja R Harinath  <rharinath@novell.com>
1829
1830         Fix test-543.cs
1831         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
1832         satisfy a params annotated parameter.
1833
1834 2006-12-16  Marek Safar  <marek.safar@gmail.com>
1835
1836         A fix for bug #77014
1837         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
1838         paramters correctly and not rely on hacks in Parameters class.
1839         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
1840         at any possition.
1841         (Invocation.VerifyArgumentsCompat): Ditto.
1842         (Invocation.EmitArguments): Changed to correctly emit params arguments at
1843         any possition.
1844
1845         * parameter.cs (HasParams): Don't assume that params is the last one.
1846
1847         * support.cs (ReflectionParameters.ctor): Look for params attribute
1848         correctly.
1849         (ReflectionParameters.ParameterType): Removed hack when we returned last
1850         parameter for out of range parameters.
1851         (ParameterName, ParameterModifier): Ditto.
1852
1853 2006-12-14  Marek Safar  <marek.safar@gmail.com>
1854
1855         A fix for bug #79987
1856         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
1857         when assembly is not CLS compliant but type is. I have no idea why is this
1858         allowed.
1859
1860         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
1861
1862 2006-12-13  Miguel de Icaza  <miguel@novell.com>
1863
1864         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
1865         in struct constructors, they are basically no-ops.
1866
1867 2006-12-12  Marek Safar  <marek.safar@gmail.com>
1868
1869         * cs-tokenizer.cs (Position): Save preprocessor status too.
1870
1871 2006-12-12  Marek Safar  <marek.safar@gmail.com>
1872
1873         A fix for bug #77794
1874         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
1875
1876 2006-12-12  Marek Safar  <marek.safar@gmail.com>
1877
1878         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
1879         Fixes #69299.
1880         (pp_expr): Report error for an invalid expression.
1881         (handle_preprocessing_directive): Simplified; add more error checking.
1882
1883 2006-12-11  Marek Safar  <marek.safar@gmail.com>
1884
1885         A fix for bug #74939
1886         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
1887         directives handling.
1888
1889 2006-12-10  Marek Safar  <marek.safar@gmail.com>
1890
1891         A fix for bugs #80093, and #75984
1892         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
1893         logic, it seems to me as it worked before "by coincidence".
1894         (xtoken): Simplified to use reworked handle_preprocessing_directive.
1895         (cleanup): Enabled endif check.
1896
1897 2006-12-09  Marek Safar  <marek.safar@gmail.com>
1898
1899         A fix for bug #80162
1900         * statement.cs (CollectionForeach.TryType): Generics and non-generics
1901         enumerators are never ambiguous.
1902
1903 2006-12-08  Raja R Harinath  <rharinath@novell.com>
1904
1905         Fix #80060
1906         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
1907
1908 2006-12-06  Marek Safar  <marek.safar@gmail.com>
1909
1910         A fix for bug #80144
1911         * class.cs (EventProperty.Define): Explicit implementation means
1912         that an even is used.
1913
1914 2006-12-06  Marek Safar  <marek.safar@gmail.com>
1915
1916         Fixes the operators implementation (part II)
1917
1918         * cfold.cs (DoConstantNumericPromotions): Renamed to
1919         DoBinaryNumericPromotions and simplified.
1920         (BinaryFold): Couple of conversion fixes; simplified.
1921
1922         * constant.cs, ecore.cs, literal.cs
1923         (ToType): Renamed to ConvertImplicitly.
1924         (Reduce): Renamed to ConvertExplicitly.
1925
1926         * class.cs, convert.cs: Updated.
1927
1928         * expression.cs: TryReduce doesn't throw an exception.
1929
1930 2006-12-01  Marek Safar  <marek.safar@gmail.com>
1931
1932         A fix for bug #80108
1933         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
1934         compatible.
1935
1936 2006-11-30  Marek Safar  <marek.safar@gmail.com>
1937
1938         Fixes unary operators implementation (part I)
1939         Also fixes #80026
1940
1941         * cfold.cs (Error_CompileTimeOverflow): Made internal
1942
1943         * const.cs (IConstant): Changed to use reference to constant and
1944         not constant itself.
1945         Updated IConstant implementations.
1946
1947         * constant.cs (CreateConstant): New factory method.
1948         Updated IConstant implementation.
1949
1950         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
1951
1952         * ecore.cs: Updated to use CreateConstantReference.
1953
1954         * enum.cs: Reflects IConstant changes.
1955
1956         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
1957
1958         * literal.cs (NullConstant): Change to be independently usable.
1959
1960 2006-11-29  Martin Baulig  <martin@ximian.com>
1961
1962         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
1963         we need to emit the scope initializer before calling the base .ctor.
1964
1965         * anonymous.cs: Merged back from the new anonymous methods branch.
1966         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
1967
1968         * expression.cs (ParameterReference.DoResolveBase): Create a
1969         "normal" ScopeInfo when capturing parameters rather than using the
1970         root scope; this makes things work with anonymous methods having
1971         parameters.
1972
1973         * statement.cs
1974         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
1975
1976 2006-11-22  Marek Safar  <marek.safar@gmail.com>
1977
1978         A fix for bug #79987
1979         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
1980         check to a base class.
1981         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
1982         only when assembly has missing attribute.
1983         * report.cs: Update.
1984
1985 2006-11-21  Marek Safar  <marek.safar@gmail.com>
1986
1987         * cs-tokenizer.cs: Merged with gmcs version.
1988
1989 2006-11-20  Marek Safar  <marek.safar@gmail.com>
1990
1991         * cs-tokenizer.cs,
1992         * cs-parser.jay: Better error message when partial keyword is misplaced.
1993
1994 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
1995
1996         A fix for bug #79810
1997         report.cs: CS1058 only applies to 2.0 profile (gmcs).
1998         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
1999         a RuntimeWrappedException by default.
2000
2001 2006-11-18  Marek Safar  <marek.safar@gmail.com>
2002
2003         A fix for bug #79843
2004         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
2005         implementation.
2006         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
2007
2008 2006-11-18  Marek Safar  <marek.safar@gmail.com>
2009
2010         * driver.cs, namespace.cs: Uses faster IndexOf version.
2011
2012 2006-11-17  Marek Safar  <marek.safar@gmail.com>
2013
2014         A fix for bug #79941
2015         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
2016         operators.
2017         (Operator.Define): Implicit/Explicit operator of same type is duplicate
2018         even if internal name is different.
2019         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
2020         (UserDefinedConversion): Simplified as the operators cannot be internal.
2021         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
2022         conversions.
2023         (MethodLookup): Replaced EmitContext with parentType.
2024         * expression.cs: Updated.
2025
2026 2006-11-09  Raja R Harinath  <rharinath@novell.com>
2027
2028         * driver.cs (BadAssembly): Handle all the ugliness of
2029         DefineDynamicAssembly.
2030
2031 2006-11-08  Raja R Harinath  <rharinath@novell.com>
2032
2033         Address parts of #58244 -- most of what's left is in the runtime
2034         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
2035         CS1509 error checks, and handle them for all assembly loads, not
2036         just the first invocation.
2037         (LoadModule): Likewise.  Move handling of 'adder_method' ...
2038         * codegen.cs (AssemblyClass.AddModule): ... here.
2039
2040 2006-11-02  Marek Safar  <marek.safar@gmail.com>
2041
2042         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
2043         IEnumerable<T> is ambiguous.
2044
2045 2006-10-31  Marek Safar  <marek.safar@gmail.com>
2046
2047         A fix for bug #67689
2048         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
2049         GetEnumerator is ambiguous.
2050
2051         * report.cs: Add new warning.
2052
2053 2006-10-29  Marek Safar  <marek.safar@gmail.com>
2054
2055         A fix for bug #78602
2056         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
2057         to protected member can be nested type.
2058
2059 2006-10-28  Marek Safar  <marek.safar@gmail.com>
2060
2061         A fix for bug #78965
2062         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
2063         to protected member must derive from current type.
2064
2065 2006-10-27  Marek Safar  <marek.safar@gmail.com>
2066
2067         assign.cs: Reuses error method.
2068
2069         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
2070         instead of type for constants.
2071         (Expression.Error_ValueAssignment): Common error method.
2072
2073         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
2074         for any assignment.
2075
2076 2006-10-27  Marek Safar  <marek.safar@gmail.com>
2077
2078         A fix for bug #79081
2079         * expression.cs (MemberAccess.DoResolve): Check nested type
2080         accessibility.
2081
2082 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
2083
2084         * doc.cs : nested delegates were not handled. Fixed bug #79754.
2085
2086 2006-10-26  Marek Safar  <marek.safar@gmail.com>
2087
2088         A fix for bug #76591
2089         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
2090
2091 2006-10-26  Marek Safar  <marek.safar@gmail.com>
2092
2093         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
2094         type forwarder of the same type multiple times.
2095
2096 2006-10-26  Raja R Harinath  <rharinath@novell.com>
2097
2098         Fix #78820
2099         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
2100         instance as an rvalue, even when we later resolve as an lvalue.
2101
2102 2006-10-25  Martin Baulig  <martin@ximian.com>
2103
2104         * anonymous.cs: Fix #79673.
2105
2106 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
2107
2108         A fix for bug #79666
2109         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
2110         ignored when is optimized (= default value) as its value is already set.
2111
2112 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
2113
2114         A fix for bug #79724
2115         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
2116         TypeContainer for type lookup.
2117
2118 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
2119
2120         A fix for bug #79231
2121         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
2122         * expression.cs (OverloadResolve): Always convert type name for
2123         an error message.
2124         (ResolveNamespaceOrType): Don't confuse a nested type with any 
2125         other member.
2126
2127 2006-10-18  Martin Baulig <martin@ximian.com>
2128
2129         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
2130
2131 2006-10-17  Miguel de Icaza  <miguel@novell.com>
2132
2133         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
2134         an int32, but requesting an int64 from the conversion
2135
2136 2006-10-12  Martin Baulig  <martin@ximian.com>
2137
2138         * anonymous.cs
2139         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
2140         
2141 2006-10-12  Martin Baulig  <martin@ximian.com>
2142
2143         * statement.cs
2144         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
2145
2146 2006-10-11  Miguel de Icaza  <miguel@novell.com>
2147
2148         * convert.cs: Remove broken code: I was doing the "Existance"
2149         tests for Implicit conversions.
2150
2151 2006-10-10  Miguel de Icaza  <miguel@novell.com>
2152
2153         * convert.cs: Added one missing case in
2154         ImplicitStandardConversionExists uint64 to intptr.
2155
2156         Fixes #59800
2157         
2158         * typemanager.cs (uintptr_type): another core known type.   
2159
2160         * ecore.cs (OperatorCast): routine used to do cast operations that
2161         depend on op_Explicit.  We could change some of the Decimal
2162         conversions to use this.
2163
2164         This one has a probe mechanism that checks both types for an op_
2165         which it coudl be used to eliminate two classes: CastToDecimal
2166         and CastFromDecimal.
2167
2168         * convert.cs: Implement the conversions documented in #59800
2169         
2170 2006-10-10  Martin Baulig  <martin@ximian.com>
2171
2172         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
2173         before RootScope.ResolveMembers().
2174
2175         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
2176         `CurrentType' if appropriate.
2177
2178 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
2179
2180         A fix for bug #78568
2181         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
2182         when contains binary operators.
2183         * cs-parser.jay: Updated.
2184
2185 2006-10-09  Martin Baulig  <martin@ximian.com>
2186
2187         * delegate.cs
2188         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
2189         moved that into Define() and also do the other type parameter
2190         checks there.  Fixes #79094.  Added gtest-292.cs.
2191
2192         * expression.cs
2193         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
2194         since that doesn't include type parameters; don't use `Ldelema'
2195         for type parameters.  Fixes #78980.  Added gtest-293.cs.
2196
2197 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
2198
2199         A fix for #77796
2200         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
2201         conversion is allowed.
2202
2203 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
2204
2205         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
2206         error reporting when no error occurs.
2207
2208 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
2209
2210         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
2211         does not exist.
2212
2213 2006-10-06  Raja R Harinath  <rharinath@novell.com>
2214
2215         Fix #79584
2216         * class.cs (DefineTypeBuilder): Check circular dependencies before
2217         setting the parent of the TypeBuilder.
2218         (CheckRecursiveDefinition): Don't use 'BaseType', since
2219         it may not be valid until after DefineTypeBuilder.  Use
2220         'base_type' instead.
2221
2222 2006-10-04  Martin Baulig  <martin@ximian.com>
2223
2224         Merged the Anonymous Methods patch.
2225
2226         * anonymous.cs, iterators.cs: The new anonymous methods code.
2227
2228         * statement.cs (Variable): New public abstract class.
2229         (LocalInfo.Variable): New public property.
2230         (LocalInfo.ResolveVariable): New public method.
2231         (Block.Flags): Add `IsIterator'.
2232         (Block.AddVariable): Improved the CS0136 check.
2233         (Block.AnonymousChildren): New public property.
2234         (Block.AddAnonymousChild): New public method.
2235         (ToplevelBlock): Update to use the new anonymous method framework.
2236         (ToplevelBlock.ctor): `container' is now a `Block' and not a
2237         `ToplevelBlock'; this is required to correctly implement the
2238         CS0136 check.
2239         (Fixed, Using): Use `TemporaryVariable' instead of directly
2240         creating the `LocalBuilder'.
2241
2242         * parameter.cs (Parameter.ResolveVariable): New public method.
2243         (Parameters.ResolveVariable): Likewise.
2244
2245         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
2246
2247         * class.cs (TypeContainer): Replaced the `iterators' list and
2248         corresponding methods with a list of `CompilerGeneratedClass'es.
2249         (TypeContainer.ResolveMembers): New public method.
2250         (Method): `IIteratorContainer' has been replaced by
2251         `IAnonymousHost'.
2252
2253         * expression.cs (VariableReference): New public abstract base
2254         class for `LocalVariableReference', `ParameterReference' and
2255         `This'.
2256
2257         * codegen.cs (EmitContext): Removed `capture_context',
2258         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
2259         (EmitContext.EmitThis): Removed.
2260
2261         * cs-parser.jay: Replace `iterator_container' with
2262         `anonymous_host'.       
2263
2264 2006-10-04  Martin Baulig  <martin@ximian.com>
2265
2266         * generic.cs (GenericMethod): Don't make this abstract.
2267         (Constraints.Clone): Added dummy implementation.
2268
2269 2006-10-04  Raja R Harinath  <harinath@gmail.com>
2270
2271         Fix #79577
2272         * namespace.cs (LookForAnyGenericType): Avoid nullref on
2273         'declspaces'.  Avoid allocating arrays willy-nilly.
2274
2275         Fix #79553
2276         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
2277         cases out of the switch.
2278
2279 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
2280
2281         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
2282         message when non-generic type is used with the type arguments.
2283         * expression.cs: Updated.
2284
2285 2006-09-28  Raja R Harinath  <rharinath@novell.com>
2286
2287         Fix #79013
2288         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
2289         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
2290         Change semantics slightly.  Don't insist on having only one
2291         temporary EmptyExpression -- just throttle the creation of new ones.
2292
2293         Fix #79451
2294         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
2295         non-interfaces too.  If no methods are found, don't try to create
2296         a MethodGroupExpr.
2297
2298 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
2299
2300         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
2301         generic type.
2302
2303         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
2304         us produce better error message.
2305
2306 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
2307
2308         * expression.cs (Binary.ResolveOperator): Warn about a side effect
2309         of the `|' operator.
2310
2311         * report.cs: A new warning added.
2312
2313 2006-09-27  Martin Baulig  <martin@ximian.com>
2314
2315         * generic.cs (GenericMethod): Don't make this abstract.
2316
2317 2006-09-27  Martin Baulig  <martin@ximian.com>
2318
2319         * report.cs
2320         (InternalErrorException): Added overloaded ctor taking a params array.
2321
2322 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
2323
2324         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
2325         Fixed the cases when same error was reported twice.
2326
2327         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
2328         now report symbol information.
2329
2330 2006-09-25  Martin Baulig  <martin@ximian.com>
2331
2332         * class.cs: Completely unified with the gmcs version.
2333
2334 2006-09-25  Martin Baulig  <martin@ximian.com>
2335
2336         * typemanager.cs (TypeManager.IsNullableType): New public function.
2337         (TypeManager.IsNullableTypeOf): Likewise.
2338         (TypeManager.IsNullableValueType): Likewise.
2339
2340         * class.cs (MethodCore): Added the `GenericMethod' argument from
2341         gmcs and also unified all classes derived from `MethodCore' with gmcs.
2342
2343 2006-09-24  Raja R Harinath  <harinath@gmail.com>
2344
2345         * convert.cs: Unify with gmcs version.
2346
2347 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
2348
2349         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
2350         verify them as well.
2351
2352         * report.cs: New warning.
2353
2354 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
2355
2356         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
2357         for anonymous block with out argument.
2358
2359 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
2360
2361         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
2362         not used private events only.
2363
2364 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
2365
2366         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
2367
2368         * const.cs (Const.Define): Check for constant type.
2369         (Const.IsConstantTypeValid): Looks for valid constant types.
2370
2371         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
2372
2373         * ecore.cs (EmptyConstantCast): New common class for all constant based
2374         EmptyCast(s).
2375
2376         * expression.cs (Is.DoResolve): Handle null constant especially.
2377         (New.DoResolve): Check for new void().
2378         (MemberAccess.DoResolve): Cope with all kind of nulls.
2379
2380         * literal.cs (NullConstant): Uses EmptyConstantCast.
2381         (NullDefault): Based on EmptyConstantCast.
2382         (NullLiteral): Uses EmptyConstantCast.
2383
2384         * statement.cs (Block.ResolveMeta): Check for constant type.
2385
2386 2006-09-22  Martin Baulig  <martin@ximian.com>
2387
2388         * delegate.cs, attribute.cs: Merged with the gmcs versions.
2389
2390 2006-09-22  Raja R Harinath  <rharinath@novell.com>
2391
2392         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
2393         not the null type.
2394
2395         Fix part of #79451
2396         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
2397         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
2398         code slightly.
2399
2400 2006-09-22  Martin Baulig  <martin@ximian.com>
2401
2402         * ecore.cs: Merged with the gmcs version.
2403
2404         * generic.cs (ConstructedType): New dummy class.
2405         (TypeArguments): Don't make this abstract.
2406
2407         * typemanager.cs
2408         (TypeManager.IsGenericTypeDefinition): New method.
2409         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
2410
2411 2006-09-22  Raja R Harinath  <rharinath@novell.com>
2412
2413         * expression.cs (ComposedCast): Check for arrays of TypedReference
2414         before creating the type, not after.
2415
2416 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
2417
2418         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
2419         after ToType change.
2420
2421         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
2422         when constant must be implicitly convertible.
2423
2424         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
2425
2426         * ecore.cs (NullCast): Derives from NullConstant.
2427
2428         * expression.cs (Is.DoResolve): Removed useless variables.
2429         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
2430         (New.Constantify): Add enum support.
2431         (MemberAccess.DoResolve): Add warning when accessing null constant or
2432         variable.
2433
2434         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
2435         property.
2436
2437         * literal.cs (NullConstant): New abstract class with common
2438         functionality for all null specializations.
2439         (NullDefault): Represents default(X) when result can be
2440         reduced to null.
2441         (NullLiteral): Updated.
2442
2443         * report.cs: Add new warning.
2444
2445 2006-09-21  Martin Baulig  <martin@ximian.com>
2446
2447         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
2448
2449 2006-09-21  Martin Baulig  <martin@ximian.com>
2450
2451         * generic.cs (GenericConstraints): New dummy class.
2452         (Constraints): Likewise.
2453         (TypeParameter): Likewise.
2454         (TypeParameterName): Likewise.
2455         (GenericMethod): Likewise.
2456
2457         * typemanager.cs (TypeManager.GetGenericArguments): New method.
2458
2459         * decl.cs: Merged with the gmcs version.
2460
2461 2006-09-21  Raja R Harinath  <rharinath@novell.com>
2462
2463         * generic.cs (TypeParameter): Implement IMemberContainer.
2464         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
2465
2466         * rootcontext.cs: Unify with gmcs version.
2467
2468         * report.cs: Unify with gmcs version.
2469         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
2470         from gmcs/generics.cs.
2471         * generics.cs (TypeParameter): New dummy class.
2472
2473         * support.cs: Unify with gmcs version.
2474
2475 2006-09-20  Raja R Harinath  <rharinath@novell.com>
2476
2477         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
2478         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
2479
2480         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
2481         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
2482         * mcs.exe.sources: Add generic.cs.
2483
2484         * codegen.cs: Unify with gmcs version.
2485
2486         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
2487         (EmitContext): Add GenericDeclContainer implementation.
2488         * decl.cs (MemberCore, DeclSpace): Likewise.
2489         * namespace.cs: Remove #ifdef GMCS_SOURCE.
2490
2491         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
2492         MCS TypeManager has a corresponding dummy method.
2493
2494 2006-09-19  Martin Baulig  <martin@ximian.com>
2495
2496         * expression.cs: Completely merged with the gmcs version.
2497
2498 2006-09-19  Martin Baulig  <martin@ximian.com>
2499
2500         * expression.cs (Invocation): Merged with the gmcs version.
2501         (ArrayAccess.GetStoreOpcode): Likewise.
2502
2503 2006-09-19  Martin Baulig  <martin@ximian.com>
2504
2505         * typemanager.cs
2506         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
2507         (TypeManager.IsGenericMethodDefinition): Likewise.
2508
2509 2006-09-19  Martin Baulig  <martin@ximian.com>
2510
2511         * typemanager.cs
2512         (TypeManager.IsEqual): Moved the gmcs implementation here.
2513         (TypeManager.DropGenericTypeArguments): Likewise.
2514         (TypeManager.DropGenericMethodArguments): Likewise.
2515         (TypeManager.GetTypeArguments): Moved here from gmcs.
2516         (TypeManager.HasGenericArguments): Likewise.
2517
2518 2006-09-19  Martin Baulig  <martin@ximian.com>
2519
2520         * expression.cs (Binary): Merged with the gmcs version.
2521
2522 2006-09-19  Martin Baulig  <martin@ximian.com>
2523
2524         * expression.cs (Probe, As, Is): Merged with the gmcs version.
2525
2526 2006-09-19  Martin Baulig  <martin@ximian.com>
2527
2528         * typemanager.cs: Merged with the gmcs version.
2529
2530 2006-09-16  Raja R Harinath  <rharinath@novell.com>
2531
2532         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
2533         * driver.cs: Likewise.
2534
2535 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
2536
2537         A fix for #79401
2538         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
2539         only if parent type is class.
2540         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
2541         update.
2542
2543 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
2544
2545         * cs-parser.jay,
2546         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
2547         keywords are used.
2548         * typemanager.cs(CSharpName): Converts NullType to null.
2549
2550 2006-09-15  Martin Baulig  <martin@ximian.com>
2551
2552         * typemanager.cs
2553         (TypeManager.GetMethodName): Added mcs implementation.
2554         (TypeManager.IsEqual): Likewise.
2555
2556         * ecore.cs
2557         (SimpleName.RemoveGenericArity): Added dummy implementation.
2558
2559         * pending.cs: Merged with the gmcs version.     
2560
2561 2006-09-15  Martin Baulig  <martin@ximian.com>
2562
2563         * statement.cs: Merge with the gmcs version.
2564
2565 2006-09-15  Martin Baulig  <martin@ximian.com>
2566
2567         * statement.cs (Switch): Merge with the gmcs implementation
2568         (without nullables), which is newer.
2569
2570 2006-09-15  Martin Baulig  <martin@ximian.com>
2571
2572         * statement.cs (Block.Variables): Make this public.
2573         (ToplevelBlock.Parameters): Make this a property.
2574         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
2575
2576 2006-09-15  Martin Baulig  <martin@ximian.com>
2577
2578         * namespace.cs: Merge with the gmcs version.
2579
2580 2006-09-15  Martin Baulig  <martin@ximian.com>
2581
2582         * decl.cs (MemberName): Minor code cleanups.
2583
2584 2006-09-15  Martin Baulig  <martin@ximian.com>
2585
2586         * parameter.cs: Merge with the gmcs version.
2587
2588 2006-09-15  Martin Baulig  <martin@ximian.com>
2589
2590         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
2591         and an error in mcs.
2592
2593 2006-09-15  Martin Baulig  <martin@ximian.com>
2594
2595         * flowanalysis.cs: Merged from GMCS; added the generics code into
2596         a `GMCS_SOURCE' conditional so we can share this file.
2597
2598 2006-09-08  Martin Baulig  <martin@ximian.com>
2599
2600         * typemanager.cs (TypeManager.interlocked_type): New public field.
2601         (TypeManager.int_interlocked_compare-exchange): New public field.
2602         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
2603         enumerator types here and call InitGenericCoreTypes().
2604         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
2605         after calling InitEnumUnderlyingTypes().
2606
2607         * rootcontext.cs
2608         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
2609         `classes_second_stage'. 
2610
2611 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
2612
2613         * assign.cs, ecore.cs, expression.cs: Share error message text.
2614         * class.cs (FieldMember.Define): Check for varible of static type.
2615         * driver.cs (LoadAssembly): Uses error output for errors.
2616         * statement.cs: Updated.
2617
2618 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
2619
2620         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
2621         type instance.
2622
2623 2006-09-07  Martin Baulig  <martin@ximian.com>
2624
2625         * driver.cs
2626         (MainDriver): Revert r62663 from Marek; see #70506 for details.
2627
2628 2006-08-29  Miguel de Icaza  <miguel@novell.com>
2629
2630         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
2631         
2632 2006-08-17  Miguel de Icaza  <miguel@novell.com>
2633
2634         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
2635         #52019 and #79064, the use of the \uXXXX sequence in source code
2636         to represent unicode characters.
2637
2638 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
2639
2640         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
2641         support.
2642         * class.cs, ecore.cs, statement.cs: Merged to one error message.
2643
2644 2006-08-13  Miguel de Icaza  <miguel@novell.com>
2645
2646         * assign.cs: Catch attempts to assign to a method groups in += and
2647         report as 1656
2648
2649 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
2650
2651         A fix for #79056
2652         * cs-parser.jay: Don't destroy current array type by typeof of array's.
2653
2654 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
2655
2656         * class.cs (Method.Define): Issue a warning when generic method looks like
2657         an entry point.
2658         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
2659         as well.
2660
2661 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
2662  
2663         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
2664         looking for ctor.
2665         * decl.cs (MemberCache.FindMembers): When container is interface we need to
2666         search all base interfaces as a member can be ambiguous.
2667         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
2668         Constructor member type filter. 
2669         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
2670         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
2671         reporting for returned memberinfos.
2672         * report.cs: Updated.
2673         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
2674         version to work on all runtimes.
2675         (TypeManager.RealMemberLookup): Removed members filtering.
2676
2677 2006-08-08  Raja R Harinath  <rharinath@novell.com>
2678
2679         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
2680         (PropertyExpr.EmitAssign): Likewise.
2681         * expression.cs (Indirection.EmitAssign): Likewise.
2682         (LocalVariableReference.EmitAssign): Likewise.
2683         (ParameterReference.EmitAssign): Likewise.
2684         (Invocation.EmitArguments): Likewise.
2685         (ArrayAccess.EmitAssign): Likewise.
2686         (IndexerAccess.EmitAssign): Likewise.
2687         (This.EmitAssign): Likewise.
2688         (ConditionalLogicalOperator.Emit): Likewise.
2689
2690         Fix #79026
2691         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
2692         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
2693         leave it in after returning it.
2694         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
2695
2696 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
2697
2698         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
2699         message.
2700
2701 2006-08-03  Raja R Harinath  <rharinath@novell.com>
2702
2703         Fix cs0146-3.cs and cs0146-4.cs.
2704         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
2705         enclosing types don't depend on the current type.
2706
2707 2006-08-02  Raja R Harinath  <rharinath@novell.com>
2708
2709         Fix #77963
2710         * class.cs (TypeContainer.DoDefineMembers): Use
2711         FindBaseMemberWithSameName on Parent, since we're interested in
2712         whether we hide inherited members or not.
2713         (FindBaseMemberWithSameName): Make slightly more robust.
2714
2715         Fix the non-generic testcase from #77396
2716         * decl.cs (DeclSpace.DeclContainer): Remove override.
2717
2718         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
2719         declspaces for doppelgangers too.
2720         (UsingEntry): Implement IResolveContext.
2721         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
2722         'this' as the resolve context.
2723         (LocalAliasEntry): Likewise.
2724
2725         Implement parts of #77403
2726         * roottypes.cs (RootDeclSpace): New.  Used to represent the
2727         toplevel declaration space.  Each namespace declaration introduces
2728         a "partial" root declaretion space.
2729         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
2730         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
2731         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
2732         from 'current_namespace.SlaveDeclSpace'.
2733         (namespace_declaration): Likewise.
2734         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
2735         check.  It can't happen now.
2736         * decl.cs (DeclSpace.LookupType): Likewise.
2737         * driver.cs (MainDriver): Sanity check.
2738
2739 2006-08-01  Raja R Harinath  <rharinath@novell.com>
2740
2741         * decl.cs (DeclSpace.FindNestedType): Remove.
2742         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
2743         LookupTypeContainer to get the container of the nested type.
2744         * class.cs (TypeContainer.FindNestedType): Make non-override.
2745
2746 2006-07-31  Raja R Harinath  <rharinath@novell.com>
2747
2748         * decl.cs (DeclSpace.PartialContainer): Move field from ...
2749         * class.cs (TypeContainer.PartialContainer): ... here.
2750         (TypeContainer.AddBasesForPart): New helper.
2751         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
2752         instead.
2753         * cs-parser.jay (current_class): Convert to DeclSpace.
2754         (struct_declaration, interface_declaration, class_declaration):
2755         Use AddBasesForPart instead of .Bases directly.
2756         * const.cs, iterators.cs: Update to changes.
2757
2758 2006-07-28  Raja R Harinath  <rharinath@novell.com>
2759
2760         * class.cs (TypeContainer.AddMemberType): Rename from
2761         AddToTypeContainer.
2762         (TypeContainer.AddMember): Rename from AddToMemberContainer.
2763         (AddTypeContainer): New.  Combine AddClassOrStruct and
2764         AddInterface.
2765         (AddPartial): Update.  Add 'is_partial' argument.
2766         * roottypes.cs: Update to changes.
2767         * cs-parser.jay (push_current_class): New helper for handling
2768         current_container and current_class.
2769         (struct_declaration, interface_declaration, class_declaration):
2770         Use it.
2771
2772 2006-07-26  Raja R Harinath  <rharinath@novell.com>
2773
2774         * roottypes.cs: Rename from tree.cs.
2775
2776         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
2777         * tree.cs (Tree, ITreeDump): Remove types.
2778         * rootcontext.cs (tree, Tree): Remove fields.
2779         (root, ToplevelTypes): New.
2780         * *.cs: Update to rename.
2781
2782         * tree.cs (Tree.RecordDecl): Remove.
2783         (RootTypes.AddToTypeContainer): Record the toplevel type in its
2784         namespace here.
2785         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
2786
2787 2006-07-23  Raja R Harinath  <harinath@gmail.com>
2788
2789         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
2790         DoFlowAnalysis and OmitStructFlowAnalysis here.
2791         (ec.With): Rename from WithUnsafe and generalize.
2792         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
2793         (ec.WithFlowAnalyis): New.
2794         * ecore.cs, expression.cs, statement.cs: Update.
2795
2796 2006-07-22  Raja R Harinath  <harinath@gmail.com>
2797
2798         * statement.cs (Block.ResolveMeta): Simplify slightly.
2799
2800         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
2801         multiple boolean fields.  Convert InUnsafe, constant_check_state,
2802         check_state to flags.
2803         (CheckState, ConstantCheckState): Update.
2804         (InUnsafe): New read-only property.
2805         (FlagsHandle): Rename from CheckStateHandle and convert to handle
2806         arbitrary flags.
2807         (WithUnsafe): New helper similar to WithCheckState.
2808         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
2809         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
2810
2811 2006-07-21  Raja R Harinath  <rharinath@novell.com>
2812
2813         Make comparisons use the same IL irrespective of whether they're
2814         in a 'checked' or 'unchecked' context: one of the issues in #78899
2815         * codegen.cs (EmitContext.CheckState): Make read-only property.
2816         (EmitContext.ConstantCheckState): Likewise.
2817         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
2818         helper that implement a save/restore stack for CheckState
2819         values.  This is the only way to change check-state.
2820         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
2821         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
2822         (CheckedExpr.EmitBranchable): New forwarding method.
2823         (UnCheckedExpr): Likewise.
2824         * statement.cs (Block.ResolveMeta): Use WithCheckState.
2825         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
2826         (Checked.Resolve, checked.DoEmit): Likewise.
2827
2828 2006-07-20  Miguel de Icaza  <miguel@novell.com>
2829
2830         * anonymous.cs: Cache the resolved anonymous delegate, and return
2831         this so that the ResolveTopBlock is only triggered once, not
2832         twice.
2833
2834         Currently we trigger ResolvetopBlock twice due to a first pass of
2835         argument check compatibility, and a second pass that does the
2836         actual resolution.   
2837         
2838 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
2839
2840         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
2841         modifiers.
2842         * rootcontext.cs (Reset): Add helper_classes.
2843
2844 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
2845
2846         A fix for #78860
2847         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
2848         correctly.
2849
2850 2006-07-13  Miguel de Icaza  <miguel@novell.com>
2851
2852         * statement.cs (Lock): Handle expressions of type
2853         TypeManager.null_type specially.  Fixes #78770
2854
2855 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
2856
2857         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
2858         to an event.
2859
2860 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
2861
2862         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
2863         for accessors as well.
2864         * ecore.cs (EventExpr): Add AccessorTable.
2865
2866 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
2867
2868         A fix for #78738
2869         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
2870         for CS0122 where appropriate.
2871         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
2872         level attributes.
2873         (Filter): Assembly can be null in the case of top level attributes.
2874
2875 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
2876
2877         A fix for #78690
2878
2879         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
2880         is done at global level.
2881
2882 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
2883
2884         A fix for #77002, Implemented TypeForwarder support.
2885
2886         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
2887         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
2888         * typemanager.cs (): Add type_forwarder_attr_type.
2889
2890 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
2891
2892         * report.cs: Add CS0469 warning.
2893
2894 2006-06-21  Martin Baulig  <martin@ximian.com>
2895
2896         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
2897         the `try'-block, so we also report CS0016 etc. there.
2898
2899 2006-06-21  Martin Baulig  <martin@ximian.com>
2900
2901         * delegate.cs
2902         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
2903
2904 2006-06-21  Martin Baulig  <martin@ximian.com>
2905
2906         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
2907         also report CS1686 for parameters.
2908
2909 2006-06-21  Martin Baulig  <martin@ximian.com>
2910
2911         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
2912         instead of an error if the value is not implicitly convertible to
2913         the switch types; fixes #77964.
2914
2915 2006-06-21  Raja R Harinath  <rharinath@novell.com>
2916
2917         Fix #78673
2918         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
2919         FieldBuilder is null.
2920
2921         Fix #78662
2922         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
2923         'left' and 'right' before error-checking.
2924
2925 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
2926
2927         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
2928         Fixed bug #78601.
2929         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
2930         (FieldExpr.DoResolve): likewise.
2931         (PropertyExpr.InstanceResolve): likewise.
2932         (EventExpr.InstanceResolve): likewise. 
2933
2934 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
2935
2936         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
2937         attribute applicable tests for attribute argument.
2938
2939 2006-06-02  Raja R Harinath  <rharinath@novell.com>
2940
2941         Fix #78079
2942         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
2943         (Binary.OverloadResolve_PredefinedIntegral): New.
2944         (Binary.OverloadResolve_PredefinedFloating): New.
2945         (Binary.OverloadResolve_PredefinedString): New.
2946         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
2947         Follow the standard more closely, and treat numeric promotions in
2948         terms of overload resolution.
2949         (Binary.CheckShiftArguments): Simplify.
2950
2951 2006-06-01  Raja R Harinath  <rharinath@novell.com>
2952
2953         * flowanalysis.cs (MyBitVector): Simplify representation.
2954         (MyBitVector.Clone): Avoid allocating BitArray.
2955         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
2956         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
2957         (*): Update.  Change all references to MyBitVector.And and
2958         MyBitVector.Or to &= and |=.
2959
2960 2006-05-29  Raja R Harinath  <rharinath@novell.com>
2961
2962         Fix cs0231-[34].cs.
2963         * cs-parser.jay (formal_parameter_list): Extend the pattern below
2964         to param arguments too.
2965
2966 2006-05-26  Miguel de Icaza  <miguel@novell.com>
2967
2968         * cs-parser.jay: Catch another parsing form for arglist being
2969         followed by other arguments.  Fixes #78313.
2970
2971 2006-05-24  Raja R Harinath  <rharinath@novell.com>
2972
2973         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
2974         checking of out parameters to ...
2975         (FlowBranchingToplevel.Merge): ... here.
2976         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
2977         set, propagate the origin upward, and only complain if there was
2978         no other error.
2979         (FlowBranchingException.AddContinueOrigin): Likewise.
2980         (FlowBranchingException.AddReturnOrigin): Likewise.
2981         (FlowBranchingException.AddGotoOrigin): Likewise.       
2982
2983 2006-05-23  Raja R Harinath  <rharinath@novell.com>
2984
2985         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
2986         unreachable, skip it.
2987         (FlowBranchingException.Merge): Always propagate jumps, even if
2988         the finally block renders subsequent code unreachable.
2989
2990 2006-05-18  Raja R Harinath  <rharinath@novell.com>
2991
2992         Fix #77601
2993         * statement.cs (Goto.Resolve): Move responsibility for resolving
2994         'goto' to FlowBranching.AddGotoOrigin.
2995         (Goto.SetResolvedTarget): New.  Callback to set the
2996         LabeledStatement that's the target of the goto.
2997         (Goto.DoEmit): Use Leave instead of Br when crossing an
2998         unwind-protect boundary.
2999         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
3000         LookupLabel and adjust to new semantics.
3001         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
3002         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
3003         Goto.SetResolvedTarget to update target.
3004         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
3005         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
3006         AddBreakOrigin & co.  Delay propagation until ...
3007         (FlowBranchingException.Merge): ... this.
3008
3009         * statement.cs (Block.Resolve): Always depend on flow-branching to
3010         determine unreachability.  Kill workaround that originally emitted
3011         only one statement after an "unreachable" label (see infloop in
3012         test-515.cs).
3013
3014         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
3015         This is still "wrong", but anything better would probably need a
3016         multi-pass algorithm.
3017         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
3018         usage vector.  Force current usage vector to be reachable, to
3019         optimistically signify backward jumps.
3020         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
3021         detected.
3022         (FlowBranchingLabeled.Merge): New.  If no backward jump was
3023         detected, return the original salted-away usage vector instead,
3024         updated with appropriate changes.  Print unreachable warning if
3025         necessary.
3026         * statement.cs (Block.Resolve): Don't print unreachable warning on
3027         a labeled statement.
3028
3029 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
3030
3031         * driver.cs: Pass filename without path to AssemblyBuilder's 
3032         AddResourceFile. Fixes bug #78407.
3033
3034 2006-05-17  Raja R Harinath  <rharinath@novell.com>
3035
3036         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
3037         * flowanalysis.cs (FlowBranchingLabeled): ... here.
3038         (FlowBranching.MergeChild): Overwrite
3039         reachability information from Labeled branchings too.
3040
3041 2006-05-16  Raja R Harinath  <rharinath@novell.com>
3042
3043         * statement.cs (Goto.Resolve): Merge jump origins here ...
3044         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
3045
3046         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
3047         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
3048         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
3049         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
3050         here, ...
3051         * statement.cs (Goto.Resolve): ... not here.
3052         (Goto.Emit): Remove CS1632 check.
3053
3054 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
3055
3056         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
3057         error message.
3058
3059 2006-05-11  Raja R Harinath  <rharinath@novell.com>
3060
3061         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
3062         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
3063         (FlowBranchingException.Label): Likewise.
3064
3065         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
3066         given value.
3067         (MyBitVector.Or): Use it to avoid losing information (Count).
3068         (FlowBranching.MergeOrigins): Likewise.
3069
3070         * flowanalysis.cs (UsageVector.IsDirty): Remove.
3071         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
3072         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
3073         (UsageVector.ToString): Simplify.
3074         (UsageVector.MergeSiblings): Move here from ...
3075         (FlowBranching.Merge): ... here.
3076         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
3077         not a MyBitVector.
3078
3079 2006-05-10  Raja R Harinath  <rharinath@novell.com>
3080
3081         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
3082         null bitvector is treated as all-true.
3083
3084         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
3085         (MyBitVector): Rationalize invariants.  'vector != null' implies
3086         that we have our own copy of the bitvector.  Otherwise,
3087         'InheritsFrom == null' implies all inherited bits are true.
3088
3089 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
3090
3091         * statement.cs (LocalInfo): Add IsConstant.
3092         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
3093         local variable for constants.
3094
3095 2006-05-09  Raja R Harinath  <rharinath@novell.com>
3096
3097         * flowanalysis.cs (MyBitVector.Empty): New.
3098         (MyBitVector): Don't allow InheritedFrom to be null.
3099         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
3100         (UsageVector, FlowBranching): Update to changes.
3101
3102         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
3103         recursion.  The 'Parent == null' condition isn't sufficient for
3104         anonymous methods.
3105         (FlowBranching.AddBreakOrigin): Likewise.
3106         (FlowBranching.AddContinueOrigin): Likewise.
3107         (FlowBranching.AddReturnOrigin): Likewise.
3108         (FlowBranching.StealFinallyClauses): Likewise.
3109         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
3110         (FlowBranching.CheckOutParameters): Likewise.
3111         (FlowBranchingToplevel): Terminate all the above recursions here.
3112         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
3113         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
3114
3115         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
3116         toplevel block.
3117         (FlowBranchingToplevel): New.  Empty for now.
3118         (FlowBranching.MergeTopBlock): Update.
3119         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
3120         branching for the anonymous delegate.
3121         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
3122
3123         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
3124         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
3125         information at the start of the merge.  Reorganize.
3126
3127 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
3128
3129         * class.cs (MethodData.Define): Method cannot implement interface accessor.
3130
3131 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
3132
3133         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
3134         to newly introduced ctor.
3135
3136         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
3137         message to one place.
3138         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
3139         global namespace.
3140
3141 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
3142
3143         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
3144
3145         * ecore.cs (Expression.ResolveAsConstant): Updated.
3146
3147         * statement.cs (ResolveMeta): Updated.
3148
3149 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
3150
3151         * cs-parser.jay: __arglist cannot be used in initializer.
3152
3153 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
3154
3155         A fix for #77879
3156         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
3157         private types.
3158
3159 2006-05-05  Raja R Harinath  <rharinath@novell.com>
3160
3161         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
3162         (LabeledStatement): Add 'name' parameter.
3163         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
3164         (Block.AddLabel): Update to changes.
3165         * cs-parser.jay (labeled_statement): Likewise.
3166
3167         * flowanalysis.cs (BranchingType.Labeled): New.
3168         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
3169         (FlowBranchingLabeled): New.  Does nothing for now, but will
3170         eventually handle 'goto' flows.
3171         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
3172         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
3173         that's terminated ...
3174         (Block.Resolve): ... here.
3175
3176         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
3177         (UsageVector.MergeFinallyOrigins): Likewise.
3178         (FlowBranching.InTryOrCatch): Likewise.
3179         (FlowBranching.AddFinallyVector): Likewise.
3180         (FlowBranchingException): Update to changes.
3181
3182         Fix #78290
3183         * statement.cs (Return.Resolve): Move error checking to ...
3184         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
3185         (FlowBranchingException): Handle return origins like break and
3186         continue origins.
3187         (FlowBranching.UsageVector.CheckOutParameters): Remove.
3188
3189 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
3190
3191         A fix for #76122
3192         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
3193         filter.
3194
3195 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
3196
3197         A fix for #77543
3198         * class.cs (MethodData.Define): Do public accessor check only when method
3199         implements an interface.
3200
3201 2006-05-04  Raja R Harinath  <rharinath@novell.com>
3202
3203         Remove special handling of 'break'
3204         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
3205         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
3206         (UsageVector.Break): Remove.
3207         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
3208         reachability.
3209         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
3210
3211         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
3212         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
3213
3214 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
3215
3216         A fix for #75726
3217         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
3218         be the interface member.
3219
3220 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
3221
3222         A fix for #60069
3223         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
3224         for emitting small (int) values.
3225
3226 2006-05-03  Raja R Harinath  <rharinath@novell.com>
3227
3228         Fix #59427
3229         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
3230         control-flow passes through the 'finally' after merging-in all the
3231         control-flows from 'try' and the 'catch' clauses.
3232
3233         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
3234         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
3235         always true at the only non-recursive entry point.
3236         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
3237         FlowBranchingBreakable.
3238         (FlowBranchingLoop): Remove.
3239         * statement.cs (Return.DoResolve): Update to changes.
3240
3241         Fix #76471, #76665
3242         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
3243         (FlowBranching.CreateBranching): Handle it: create a
3244         FlowBranchingContinuable.
3245         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
3246         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
3247         except that it handles the 'continue' command.
3248         (FlowBranching.UsageVector.MergeOrigins): Rename from
3249         MergeBreakOrigins.
3250         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
3251         except that it overrides AddContinueOrigin.
3252         (FlowBranchingException): Override AddContinueOrigin, similar to
3253         AddBreakOrigin.
3254         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
3255         Create a new branching around the embedded statement.
3256         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
3257         control flow after the embedded statement.
3258         (Continue.Resolve): Move all error checking to AddContinueOrigin.
3259
3260         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
3261         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
3262         FlowBranchingBreakable.
3263         (FlowBranchingSwitch): Remove.
3264
3265         Fix test-503.cs
3266         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
3267         error reporting to ...
3268         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
3269         Rename from 'AddBreakVector'.  Add new location argument.  Return
3270         a bool indicating whether the 'break' crosses an unwind-protect.
3271         (FlowBranchingException.AddBreakOrigin): Add.
3272         (FlowBranchingException.Merge): Propagate 'break's to surrounding
3273         flowbranching after updating with the effects of the 'finally'
3274         clause.
3275         (FlowBranchingBreakable): New common base class for
3276         FlowBranchingLoop and FlowBranchingSwitch.
3277
3278         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
3279         embedded statement.
3280         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
3281
3282 2006-05-02  Raja R Harinath  <rharinath@novell.com>
3283
3284         * statement.cs (Do.Resolve): If the loop is infinite, set the
3285         barrier.
3286         (While.Resolve, For.Resolve): Set a barrier after the embedded
3287         statement.  There's no direct control flow that goes from the end
3288         of the embedded statement to the end of the loop.
3289         * flowanalysis.cs (FlowBranching.Infinite): Remove.
3290         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
3291         above ensure that the reachability is correctly computed.
3292
3293         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
3294         (UsageVector.MergeBreakOrigins): If the current path is
3295         unreachable, treat it as if all parameters/locals are initialized.
3296         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
3297         infinite loops before merging-in break origins.
3298
3299         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
3300         (Reachability.Reachable): Split part into ...
3301         (Reachability.Unreachable): ... this.  Simplify.
3302         (Reachability.IsUnreachable): Use 'Unreachable' instead.
3303
3304         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
3305         (Reachability.SetThrowsSometimes): Likewise.
3306         (FlowBranchingBlock.MergeTopBlock): Don't compare against
3307         TriState.Always, use corresponding property.
3308         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
3309         (Block.Resolve): Likewise.  Remove some redundant checks.
3310
3311 2006-05-02  Raja R Harinath  <harinath@gmail.com>
3312
3313         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
3314         (Reachability.Meet): Don't bother checking AlwaysThrows --
3315         barrier is always set.
3316         (FlowBranchingBlock.Merge): Likewise.
3317
3318 2006-05-01  Raja R Harinath  <harinath@gmail.com>
3319
3320         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
3321         checks for unreachable.
3322
3323 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
3324
3325         A fix for #77980
3326         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
3327
3328         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
3329         whether field is really assigned.
3330
3331 2006-04-30  Raja R Harinath  <harinath@gmail.com>
3332
3333         * flowanalysis.cs (Reachability): Make 4-argument constructor
3334         private.
3335         (Reachability.Meet): Rename from 'And'.  Remove static variant.
3336         (Reachability.Always): Rename from the highly misleading
3337         'Reachability.Never'.
3338         (FlowBranching.Merge): Update to changes.  Mark an impossible
3339         situation with a 'throw'.
3340         (*): Update to changes.
3341
3342 2006-04-29  Raja R Harinath  <harinath@gmail.com>
3343
3344         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
3345         Remove 'Undefined'.
3346         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
3347         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
3348         (*): Update to changes.
3349         * statement.cs: Update to changes.
3350
3351 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
3352
3353         A fix for #78049
3354         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
3355
3356 2006-04-28  Raja R Harinath  <harinath@gmail.com>
3357
3358         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
3359         dummy UsageVector.
3360
3361         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
3362         argument to two arguments: an usage-vector and a bool.  Move call
3363         to FlowBranching.Merge () ...
3364         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
3365
3366         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
3367         handling of loop and switch reachability to ...
3368         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
3369
3370 2006-04-27  Raja R Harinath  <harinath@gmail.com>
3371
3372         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
3373         handling to FlowBranchingLoop.InLoop.
3374         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
3375
3376 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
3377
3378         A fix for #78115
3379         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
3380         anonymous method is allowed from AnonymousContainer here.
3381
3382         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
3383
3384 2006-04-24  Raja R Harinath  <rharinath@novell.com>
3385
3386         Fix #78156
3387         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
3388
3389 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
3390
3391         A fix for #49011.
3392         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
3393         (DoubleConstant.Reduce): Ditto.
3394
3395 2006-04-23  Raja R Harinath  <rharinath@novell.com>
3396
3397         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
3398         Remove 'lvalue_right_side' argument.  Move parts to ...
3399         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
3400         (LocalVariable.DoResolveLValue): ... these.
3401
3402 2006-04-21  Raja R Harinath  <rharinath@novell.com>
3403
3404         Fix cs1655.cs
3405         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
3406         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
3407         (LocalVariableReference.DoResolveBase): Use it to implement new
3408         CS1655 check.
3409         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
3410         (Argument.Resolve): Simplify.  Move CS1510 check ...
3411         * ecore.cs (Expression.ResolveLValue): ... here.
3412         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
3413         (PropertyExpr.DoResolveLValue): Likewise.
3414         (FieldExpr.Report_AssignToReadonly): Likewise.
3415         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
3416         LValueMemberAccess or LValueMemberOutAccess on instance depending
3417         on it.
3418         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
3419         DoResolve as appropriate.
3420
3421 2006-04-20  Raja R Harinath  <rharinath@novell.com>
3422
3423         Fix #75800
3424         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
3425         implicit conversions on 'out' and 'ref' arguments.
3426
3427         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
3428         improve clarity.  Remove dead code.
3429
3430         Fix #66031
3431         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
3432         (Catch.Resolve): Resolve VarBlock if it exists.
3433
3434 2006-04-19  Miguel de Icaza  <miguel@novell.com>
3435
3436         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
3437         twice, this was some residual code, the enumerator was emitted
3438         properly in the two branche of if later.
3439
3440 2006-04-19  Raja R Harinath  <rharinath@novell.com>
3441
3442         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
3443         cast is never an lvalue.
3444         (Cast.DoResolve, Cast.ResolveRest): Combine.
3445         (Argument.Emit): Simplify slightly.  Move 'Expr is
3446         IMemoryLocation' check ...
3447         (Argument.Resolve): ... here.
3448         (Argument.Error_LValueRequired): Remove.  Inline into only user.
3449
3450         Simplifications.  Fix cs0191-2.cs
3451         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
3452         CS1649 and CS1651 to ...
3453         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
3454         the actual selection of the error code and message to a lookup
3455         table.  Add a dummy return value to simplify callsites.
3456         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
3457         readonly fields of other instances of the same type.  Move CS0197
3458         warning from ...
3459         * expression.cs (Argument.Resolve): ... here.  Simplify code.
3460         Ensure that ec.InRefOutArgumentResolving is only set during LValue
3461         resolution of an out or ref argument.  The code simplification
3462         above uses this invariant.
3463
3464 2006-04-18  Raja R Harinath  <rharinath@novell.com>
3465
3466         Possibly fix #77752.  Fix cs1690-[4-7].cs.
3467         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
3468         CheckMarshallByRefAccess.  Drop parameter.
3469         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
3470         warning.
3471         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
3472         InstanceExpression.
3473         * report.cs (AllWarnings): Add CS1690.
3474         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
3475         for ref access too.
3476         (LocalVariableReference.DoResolveBase): Update.
3477
3478 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
3479
3480         * class.cs (MethodOrOperator): Moved common parts from method class.
3481         detect obsolete attributes.
3482         (Method.Define): Simplified as it reuses code from base.
3483         (Constructor.ValidAttributeTargets): Fixed issue found during
3484         refactoring.
3485         (Destructor.ValidAttributeTargets): Fixed issue found during
3486         refactoring.
3487         (Operator): Finished refactoring set off by #78020. Operator class is now
3488         ordinary method class.
3489
3490         * anonymous.cs: Updated.
3491
3492         * decl.cs (DeclSpace): Add IsGeneric
3493
3494 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
3495
3496         * class.cs (Constructor.Emit): Don't emit the attributes twice.
3497
3498 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
3499
3500         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
3501         detect obsolete attributes.
3502         (Method.CreateEmitContext): Moved to MethodOrOperator.
3503
3504 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
3505
3506         A fix for #78048.
3507         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
3508         customized exception to make crash detection easier.
3509         (MethodOrOperator): Started to work on new base class for methods and
3510         operators.
3511         (Method): Derives from MethodOrOperator.
3512         (Constructor.Emit): Emits its own attributes.
3513         (AbstractPropertyEventMethod.Emit): Ditto.
3514         (Operator): Derives from MethodOrOperator, will refactor fully in extra
3515         patch.
3516         (Operator.Emit): It's temporary more tricky than should be.
3517         
3518         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
3519
3520         * report.cs (InternalErrorException): Add ctor with inner exception.
3521
3522 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
3523
3524         A fix for #76744.
3525         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
3526         only not visible.
3527
3528 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
3529
3530         A fix for #77916.
3531         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
3532         array.
3533
3534 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
3535
3536         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
3537         attribute is present and Guid not.
3538         (Interface.ApplyAttributeBuilder): Ditto.
3539
3540         * attribute.cs: Add error message.
3541
3542 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
3543
3544         A fix for #78020.
3545
3546         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
3547         sources (it's composite) so hold them in extra array as they are used in
3548         Emit phase only. It worked in the previous versions by mistake.
3549         (Attribute.Emit): Emit attribute for more owners when exist.
3550
3551         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
3552         it has now different behaviour.
3553
3554 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
3555
3556         * constant.cs (Constant.IsDefaultInitializer): New method.
3557
3558         * class.cs: Updated.
3559
3560         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
3561         re-initialize default values. It saves KBs almost for every assembly.
3562         Thanks Zoltan for the idea.
3563         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
3564         (ArrayCreation.DoResolve): Resolve only once.
3565         (ArrayCreation.Emit): Emit static initializer only when it is faster.
3566         (ArrayCreation.GetAttributableValue): Cope with optimized values.
3567
3568 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
3569
3570         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
3571         From #77961.
3572
3573 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
3574
3575         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
3576         in an embedded statement too.
3577
3578 2006-04-01  Raja R Harinath  <rharinath@novell.com>
3579
3580         Fix #77958
3581         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
3582
3583 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
3584
3585         A fix for #77966.
3586
3587         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
3588         was not specified.
3589
3590         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
3591
3592 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
3593
3594         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
3595         phase.
3596
3597         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
3598         LocalTemporary change.
3599
3600         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
3601         TypeContainer.
3602         (ClassOrStruct.DefineFieldInitializers): Implemented static field
3603         initializers optimization.
3604         (ClassOrStruct.TypeAttr): Moved from modifiers.
3605         (Constructor.CheckBase): Don't crash when static ctor has parameters.
3606         (FieldBase.ResolveInitializer): Resolves initializer.
3607         (FieldBase.HasDefaultInitializer): New property.
3608
3609         * cs-parser.jay: Removed message.
3610
3611         * expression.cs (CompilerGeneratedThis): New specialization.
3612
3613         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
3614
3615 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
3616
3617         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
3618
3619 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
3620
3621         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
3622         be now EnumConstants only.
3623
3624 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
3625
3626         * attribute.cs, driver.cs: Reset more caches.
3627
3628 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
3629
3630         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
3631
3632 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
3633
3634         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
3635         for easier reuse. Updated all overrides.
3636         (IntegralConstant): New base class for all integral constants.
3637         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
3638         of the constant range, report custom error.
3639         (UIntConstant.Reduce): Fixed uint conversion.
3640
3641         * ecore.cs, literal.cs: Reduce updates.
3642
3643 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
3644
3645         A fix for #75813.
3646
3647         * class.cs (Constructor.Define): Removed extra if for default ctors.
3648         A patch from Atsushi Enomoto.
3649
3650 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
3651
3652         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
3653         GetAttributableValue.
3654
3655         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
3656         when required.
3657
3658         * convert.cs (ImplicitConversionRequired): Error message moved to
3659         DoubleLiteral.
3660
3661         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
3662         automatic implicit conversion of an output value.
3663         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
3664
3665         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
3666         conversion.
3667         (TypeOf.GetAttributableValue): Add extra handling for object type.
3668
3669         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
3670         special error message.
3671
3672 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
3673
3674         * class.cs (Constructor.Emit): Don't crash when struct ctor is
3675         InternalCall.
3676         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
3677         compatible with MS runtime.
3678
3679 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
3680
3681         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
3682         attribute arguments here.
3683
3684         * class.cs (Indexer.Define): The check was moved to attribute class.
3685
3686 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
3687
3688         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
3689         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
3690         easier.
3691
3692 2006-03-22  Raja R Harinath  <rharinath@novell.com>
3693
3694         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
3695         mcs to keep code differences small.
3696         * attribute.cs (Attribute.GetParameterDefaultValue): New.
3697         * typemanager.cs (parameter_default_value_attribute_type): New.
3698         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
3699         CS1908 check.
3700
3701 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
3702
3703         * expression.cs (StringConcat.Append): Reverted back to no warning state.
3704
3705 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
3706
3707         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
3708
3709         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
3710         the blocks too.
3711
3712 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
3713
3714         * doc-bootstrap.cs : fix build.
3715
3716 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
3717
3718         * expression.cs (StringConcat.Append): Issue a warning when empty string
3719         is going to append.
3720
3721 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
3722
3723         * assign.cs (CompoundAssign.ResolveSource): Removed.
3724
3725         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
3726         clean up.
3727
3728         * class.cs (TypeContainer.FindMethods): Removed.
3729         (TypeContainer.CheckMemberUsage): Made static.
3730
3731         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
3732
3733         * constant.cs (CheckRange): Removed unused type argument.
3734         (CheckUnsigned): Removed unused type argument.
3735
3736         * cs-parser.jay: Updated after MemberAccess clean up.
3737         Uses Length for empty string test.
3738
3739         * cs-tokenizer.cs: Uses Length for empty string test.
3740         (IsCastToken): Made static.
3741         (is_hex): Made static.
3742         (real_type_suffix): Made static.
3743
3744         * decl.cs (SetupCache): Made static.
3745         (OnGenerateDocComment): Removed unused ds argument.
3746
3747         * delegate.cs (VerifyDelegate): Removed unused argument.
3748
3749         * doc.cs: Uses Length for empty string test.
3750
3751         * driver.cs: Uses Length for empty string test.
3752
3753         * enum.cs (IsValidEnumType): Made static
3754
3755         * expression.cs (EnumLiftUp): Removed unused argument.
3756         (ResolveMethodGroup): Ditto.
3757         (BetterConversion): Ditto.
3758         (GetVarargsTypes): Ditto.
3759         (UpdateIndices): Ditto.
3760         (ValidateInitializers): Ditto.
3761         (MemberAccess.ctor): Ditto.
3762         (GetIndexersForType): Ditto.
3763
3764         * flowanalysis.cs: (MergeFinally): Removed unused argument.
3765
3766         * iterators.cs: Updated after MemberAccess clean up.
3767
3768         * location.cs: Uses Length for empty string test.
3769
3770         * namespace.cs: Uses Length for empty string test.
3771
3772          * report.cs (CheckWarningCode): Made static.
3773
3774         * statement.cs (LabeledStatement): Removed unused argument.
3775
3776         * typemanager.cs (FilterNone): Removed.
3777
3778 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
3779
3780         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
3781         obsolete.
3782
3783         * class.cs: Updated.
3784
3785 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
3786
3787         * cs-parser.jay.cs: __arglist is not allowed for delegates.
3788
3789 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
3790
3791         A fix for #77822.
3792
3793         * expression.cs (VerifyArgumentsCompat): Reverted to double error
3794         reporting, it's more tricky than I thought.
3795
3796 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
3797
3798         A fix for #77816.
3799
3800         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
3801         host container.
3802         (AnonymousMethod.ImplicitStandardConversionExists): New method.
3803         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
3804         Add more error reporting; Fixed issue with params.
3805
3806         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
3807
3808         * cs-parser.jay: AnonymousMethod requires host container.
3809
3810         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
3811
3812 2006-03-18  Raja R Harinath  <harinath@gmail.com>
3813
3814         * class.cs: Change 'TypeContainer ds' constructor argument to
3815         'DeclSpace parent'.  Some classes were missed below due to
3816         different naming convention.
3817
3818         * class.cs (MemberCore.Parent): Delete.  This makes the
3819         ParentContainer changes below enforceable by the compiler.
3820
3821         Treat pointers to enclosing declaration space as 'DeclSpace', not
3822         'TypeContainer'.
3823         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
3824         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
3825
3826         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
3827         of TypeContainer.
3828         (Block.AddThisVariable): Likewise.
3829         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
3830         (AbstractPropertyEventMethod.Emit): Likewise.
3831         (AbstractPropertyEventMethod.EmitMethod): Likewise.
3832         (GetMethod.Define, SetMethod.Define): Likewise.
3833         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
3834         (DelegateMethod.EmitMethod): Likewise.
3835
3836         Fix regression test-partial-13.cs.
3837         Rationalize use of PartialContainer.  Ensure that the partial
3838         class semantics can be tied to type-correctness, i.e., any
3839         violation will cause a compile error.
3840         * class.cs, const.cs: Access all fields that belong to class
3841         TypeContainer via ParentContainer.  Arguments of EmitContexts and
3842         Resolve()-like functions still use 'Parent'.
3843
3844         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
3845         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
3846         (PropertyMethod.CheckModifiers): Remove unused argument.
3847         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
3848         DeclSpace.
3849
3850 2006-03-17  Raja R Harinath  <harinath@gmail.com>
3851
3852         Make semantics of PartialContainer simpler.
3853         * decl.cs (DeclSpace.IsPartial): Remove.
3854         * class.cs (TypeContainer.IsPartial): Likewise.
3855         (TypeContainer..ctor): Set PartialContainer to point to self.
3856         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
3857         (TypeContainer.FindNestedType): Likewise.
3858         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
3859
3860 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
3861
3862         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
3863
3864 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
3865
3866         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
3867         classes.
3868
3869 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
3870
3871         * class.cs (Operator.Define): An error for base conversion was not
3872         reported correctly.
3873
3874 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
3875
3876         * iterator.cs : yield break is allowed in try statement which has
3877           catch clauses. Fixed bug #77767.
3878
3879 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
3880
3881         A fix for #77593, #77574.
3882
3883         * class.cs (MethodCore.CheckBase): Another if for operator.
3884
3885 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
3886
3887         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
3888         were not resolved
3889
3890         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
3891         (DelegateCreation.ImplicitStandardConversionExists): New method for just
3892         conversion test.
3893         
3894         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
3895         not needed.
3896
3897         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
3898         Updated after another emitcontext usage was clean up. It should help us to
3899         synchronize with gmcs easier.
3900
3901 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
3902
3903         A fix for #77353.
3904
3905         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
3906         (Event.Define): ditto
3907         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
3908
3909         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
3910         Removed redundant code and set NewSlot for Invoke method too.
3911
3912         * parameter.cs (Parameters.ctor): Add custom, type ctor.
3913         (Parameters.MergeGenerated): New method. Use this method when you merge
3914         compiler generated argument with user arguments.
3915
3916 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
3917
3918         * attribute.cs (ResolveAsTypeTerminal): Removed.
3919
3920         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
3921         specialization for predefined types; 30% speed up.
3922         Finally placed obsolete check to right place.
3923         (Expression.ResolveType): Removed.
3924
3925         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
3926         Updated after ResolveType was removed.
3927
3928         * expression.cs (Cast.ctor): Check void cast.
3929         (Binary.ResolveAsTypeTerminal): Is never type.
3930         (Conditional.ResolveAsTypeTerminal): Is never type.
3931
3932         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
3933
3934 2006-03-01  Raja R Harinath  <rharinath@novell.com>
3935
3936         Fix #77679.
3937         * expression.cs (ParameterReference.DoResolveBase): Change return
3938         type to bool.
3939         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
3940         Update.
3941
3942         Fix #77628.
3943         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
3944
3945         Fix #77642.
3946         * typemanager.cs (GetFullNameSignature): Don't nullref on
3947         protected accessors.
3948
3949 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
3950
3951         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
3952         these two separated members to simplify the code.
3953         (Attribute.Resolve): Refactored to use new fields and methods.
3954         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
3955         implemented obsolete attribute checking.
3956         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
3957         implemented obsolete checking again. It look line never ending quest ;-)
3958         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
3959
3960         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
3961
3962         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
3963
3964         *class.cs (Property.Define): Add RegisterProperty call.
3965
3966         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
3967         argument groups (only 2).
3968
3969         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
3970         encoding expression to arguments.
3971         (Expression.ExprClassToResolveFlags): Just turned to property.
3972
3973         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
3974         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
3975         optimized as well as implemented support for zero-length attributes.
3976
3977         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
3978         Add caching of PropertyInfo's.
3979
3980 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
3981
3982         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
3983         error multiple times.
3984
3985 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
3986
3987         New partial class implementation.
3988         A fix for #77027, #77029, #77403
3989
3990         * attribute.cs (Attributable): Made attributes protected.
3991
3992         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
3993         the replacements of ClassPart and PartialContainer.
3994         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
3995         (TypeContainer.AddInterface): Ditto.
3996         (TypeContainer.AddPartial): The main method for partial classes. It checks
3997         for errors and merges ModFlags and attributes. At the end class is added to
3998         partial_parts list.
3999         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
4000         required here.
4001         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
4002         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
4003         from the rest of partial classes.
4004         (TypeContainer.GetClassBases): Simplified.
4005         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
4006         DefineType.
4007         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
4008         (TypeContainer.HasExplicitLayout): Uses Flags now.
4009         (PartialContainer): Removed.
4010         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
4011         (StaticClass): Was merged with Class.
4012         (Class.GetClassBases): class and static class bases are verified here.
4013         (Class.TypeAttr): Added static attributes when class is static.
4014         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
4015         (MemberBase): In some cases we need to call parent container for partial
4016         class. It should be eliminated but it's not easy now.
4017
4018         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
4019
4020         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
4021         partial classed to accumulate class comments.
4022         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
4023
4024         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
4025
4026         * driver.cs (MainDriver): Tree.GetDecl was removed.
4027
4028         * modifiers.cs (Modifiers): Add partial modifier.
4029
4030         * tree.cs (Tree.decl): Removed.
4031         (RootTypes): Started to use this class more often for root types
4032         specializations.
4033
4034 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
4035
4036         A fix for #77615
4037
4038         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
4039         external interface does not have an attribute.
4040
4041 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
4042
4043         Another prerequisites for new partial classs implementation.
4044         
4045         * attribute.cs (Attribute.Equal): Implemented.
4046         (Attribute.Emit): Changed as attributes can be applied more than twice.
4047         (Attributes.Emit): Check for duplicate attributes here.
4048
4049         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
4050         as a parameter, clean-up.
4051
4052 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
4053
4054         A fix for #77485
4055
4056         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
4057         contains obsolete attribute check which can in some cases look for base
4058         type of current class which is not initialized yet.
4059         (TypeContainer.BaseType): Replacement of ptype.
4060
4061         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
4062
4063 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
4064
4065         First of prerequisites for new partial classs implemention.
4066         
4067         * attribute.cs (Attributable): Extended by ResolveContext;
4068         Attributes finally have correct context for resolving in all cases.
4069         (AttachTo): Attribute owner is assigned here.
4070
4071         * codegen.cs (IResolveContext): Introduce new interface to hold
4072         all information needed in resolving phase.
4073         (EmitContext): Implements IResolveContext; more clean-up needed here.
4074         
4075         * decl.cs (MemberCore): Implemented IResolveContext.
4076
4077         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
4078         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
4079         parameter.cs, statement.cs, tree.cs, typemanager.cs:
4080         Refactored to use new IResolveContext instead of EmitContext; cleanup
4081
4082 2006-02-06  Miguel de Icaza  <miguel@novell.com>
4083
4084         * codegen.cs (EmitScopeInitFromBlock): check here the
4085         capture_context, there is no need to make two calls to the
4086         EmitContext. 
4087
4088         * anonymous.cs: Add some debugging messages that might help me
4089         track other instances of this problem in the future (the
4090         regression of test 467).
4091
4092         * cs-parser.jay: track the variable block, as we need to initalize
4093         any captured variables declared in this block for the "catch"
4094         portion of the "Try" statement.
4095
4096         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
4097         scope initialization for captured variables. 
4098
4099         Also, move the emit for the variables after the block location has
4100         been marked.
4101
4102 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
4103
4104         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
4105
4106 2006-02-02  Miguel de Icaza  <miguel@novell.com>
4107
4108         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
4109         commit yesterday, the initialization for the roots is necessary.
4110         What is not necessary is the scope activation.
4111
4112 2006-02-02  Raja R Harinath  <rharinath@novell.com>
4113
4114         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
4115         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
4116         CS0206 checks.
4117         (Argument.Resolve): Remove CS0206 checks.
4118
4119 2006-02-01  Miguel de Icaza  <miguel@novell.com>
4120
4121         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
4122         scopes for all the roots, the scopes will now be emitted when the
4123         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
4124
4125         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
4126         code.  This reduces a lot of existing cruft.
4127         
4128         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
4129         that the ScopeInfo is generated as we enter the scope, not at the
4130         time of use, which is what we used to do before.
4131
4132         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
4133         every time a Block is about to be emitted if we have a
4134         CaptureContext. 
4135
4136 2006-02-01  Raja R Harinath  <rharinath@novell.com>
4137
4138         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
4139         (Reset): Update.
4140         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
4141
4142         * typemanager.cs (cons_param_array_attribute): Make private.
4143         (Reset): Set it to null.
4144         (InitCoreHelpers): Don't initialize it.
4145         (ConsParamArrayAttribute): New.  Initialize it as needed.
4146         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
4147
4148 2006-01-31  Miguel de Icaza  <miguel@novell.com>
4149
4150         * expression.cs: There might be errors reported during the
4151         selection of applicable methods.  If there are errors, do not
4152         continue execution as it will lead the compiler to crash.
4153
4154 2006-01-30  Miguel de Icaza  <miguel@novell.com>
4155
4156         * expression.cs: Member access is not allowed on anonymous
4157         methods.  Fixes #77402.
4158
4159 2006-01-30  Raja R Harinath  <rharinath@novell.com>
4160
4161         Fix #77401
4162         * cs-parser.jay (VariableDeclaration): Don't set
4163         current_array_type to null.
4164         (field_declaration, event_declaration, declaration_statement):
4165         Set it to null here.
4166
4167 2006-01-28  Raja R Harinath  <harinath@gmail.com>
4168
4169         * typemanager.cs (GenericParameterPosition): New.
4170         * doc.cs: Use it.
4171
4172 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
4173
4174         * doc.cs : To process "include" elements, first we should create
4175           another list than XmlNodeList, because it could result in node
4176           removal, which could result in that the XmlNodeList gives up
4177           yielding next node.
4178
4179           (Also made code identical to gmcs again.)
4180
4181 2006-01-25  Miguel de Icaza  <miguel@novell.com>
4182
4183         * ecore.cs: Introduce an error report that we were not catching
4184         before, if not silent, we must report the error.  Gonzalo ran into
4185         it.
4186
4187 2006-01-23  Miguel de Icaza  <miguel@novell.com>
4188
4189         A fix for bug: #76957
4190         
4191         * iterators.cs (MoveNextMethod.CreateMethodHost): call
4192         ComputeMethodHost before creating the method, this is a new
4193         requirement. 
4194
4195         * anonymous.cs (AnonymousContainer): Now we track all the scopes
4196         that this method references (RegisterScope).  The actual scope
4197         where the method is hosted is computed with the ComputeMethodHost
4198         before we create the method.
4199
4200         Moved the Deepest routine here.
4201
4202         (AnonymousContainer.ComputeMethodHost): New routine used to
4203         compute the proper ScopeInfo that will host the anonymous method.
4204
4205         (ScopeInfo): Deal with multiple roots.  The problem was that we
4206         did not have a unique root where all ScopeInfos could be hanged
4207         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
4208         of roots.  
4209
4210         Remove AdjustMethodScope which is now computed at the end.  Remove
4211         LinkScope which did a partial link, instead link all ScopeInfos
4212         before code generation from the new "LinkScopes" routine. 
4213
4214         Simplify all the Add* routines as they no longer need to maintain
4215         the tree, they just need to record that they are using variables
4216         from a ScopeInfo.
4217
4218         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
4219         routines to produce the forest of ScopeInfo trees.
4220
4221         * class.cs (TypeContainer.AppendMethod): This is just like
4222         AddMethod, but ensures that an interface implementation method
4223         (IEnumerable.XXX) is not inserted at the beginning of the queue of
4224         methods, but at the end.
4225
4226         We use this functionality to ensure that the generated MoveNext
4227         method in the iterator class is resolved/emitted before the
4228         enumerator methods created.   
4229
4230         This is required because the MoveNext method computes the right
4231         ScopeInfo for the method.  And the other methods will eventually
4232         need to resolve and fetch information computed from the anonymous
4233         method. 
4234
4235 2006-01-21  Raja R Harinath  <harinath@gmail.com>
4236             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
4237
4238         Fix rest of #76995.
4239         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
4240         the 'aliases' hash.
4241         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
4242         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
4243
4244 2006-01-18  Raja R Harinath  <rharinath@novell.com>
4245
4246         Fix #76656, cs0231-2.cs.
4247         * cs-parser.jay (formal_parameter_list): Make error case catch
4248         more issues.
4249         (parenthesized_expression_0): Add CS1026 check.
4250         (invocation_expression): Remove unused { $$ = lexer.Location }.
4251
4252 2006-01-17  Raja R Harinath  <rharinath@novell.com>
4253
4254         Fix #76824.
4255         * cs-parser.jay (statement_expression): Don't list out the
4256         individual statement-expressions.  Convert syntax error into
4257         CS0201 check.
4258
4259 2006-01-16  Raja R Harinath  <rharinath@novell.com>
4260
4261         Fix #76874.
4262         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
4263         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
4264         CheckIntermediateModification.
4265         (FieldExpr.DoResolve): Add new two-argument version that
4266         allows us to resolve the InstanceExpression as an lvalue.
4267         The one-argument variant is now just a wrapper.
4268         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
4269         Resolve the lhs as an lvalue if the it has a value type.
4270         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
4271         from Assign.DoResolve.
4272         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
4273         resolved as an lvalue.
4274         (PropertyExpr.DoResolve): Update.
4275         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
4276         has a value type.  Move CS1612 check here from
4277         CheckIntermediateModification.
4278         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
4279         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
4280         'right_side' of a ResolveLValue on an 'out' argument.
4281         (EmptyExpression.LValueMemberAccess): New.  Used as the
4282         'right_side' of a propagated ResolveLValue on a value type.
4283         (LocalVariableReference.DoResolveBase): Recognize
4284         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
4285         Add CS1654 check.
4286         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
4287         EmptyExpression.Null.
4288
4289 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
4290
4291         * typemanager.cs : added IsGenericParameter(). In mcs it always
4292           return false.
4293         * doc.cs : for generic parameters, use GenericParameterPosition,
4294           not FullName.
4295
4296 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
4297
4298         * expression.cs: Fix Console.WriteLine ((this = x).foo);
4299
4300 2006-01-12  Miguel de Icaza  <miguel@novell.com>
4301
4302         This fixes the problem where we used ldfld instead of ldflda to
4303         load the "THIS" pointer on captured parameters, when THIS is a
4304         value type.  See bug #77205.
4305         
4306         * iterators.cs (CapturedThisReference.Emit): Pass false to
4307         EmitThis (we do not need the address).
4308
4309         * codegen.cs (EmitThis): it needs to know whether we need the
4310         address of `this' or not.  This is used by value types.  
4311
4312         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
4313         every other call passes false.
4314
4315 2006-01-12  Raja R Harinath  <rharinath@novell.com>
4316
4317         Fix #77221.
4318         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
4319         GetOverride.
4320         * expression.cs (Invocation.OverloadResolve): Update.
4321         (Invocation.DoResolve): Avoid double resolution of invocation.
4322
4323 2006-01-11  Raja R Harinath  <rharinath@novell.com>
4324
4325         Fix #77180.
4326         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
4327         unary negation of floating point types as 0-expr; negation cannot
4328         overflow in floating point types.
4329
4330         Fix #77204.
4331         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
4332         on operands of 'void' type.
4333
4334         Fix #77200.
4335         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
4336         and ExclusiveOr for boolean constants too.
4337
4338 2006-01-09  Raja R Harinath  <rharinath@novell.com>
4339
4340         Fix #75636.
4341         * expression.cs (Invocation.OverloadResolve): Replace reflected
4342         override methods with their base virtual methods, rather than
4343         skipping over them.
4344         * typemanager.cs (TypeManager.GetOverride): New.
4345
4346 2006-01-05  Jb Evain  <jbevain@gmail.com>
4347
4348         * class.cs (Property.Define, Indexer.Define): do not tag the
4349         properties as SpecialName | RTSpecialName.
4350
4351 2006-01-04  Miguel de Icaza  <miguel@novell.com>
4352
4353         * class.cs (MethodCore.IsDuplicateImplementation): This method was
4354         doing a low-level comparission of parameter types.  It was lacking
4355         a check for __argslist. 
4356
4357 2005-12-30  Miguel de Icaza  <miguel@novell.com>
4358
4359         * expression.cs (ParameterReference.DoResolveBase): Allow
4360         reference parameters if they are local to this block. 
4361
4362         This allows the ref and out parameters of a delegate to be used in
4363         an anonymous method, for example:
4364
4365         delegate void set (out int x);
4366
4367         set s = delegate (out int x){
4368                 x = 0;
4369         };
4370
4371         This is used by functionality introduced late in the C# language.
4372         
4373         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
4374         method that take ref and out parameters. 
4375
4376         Fixes #77119 which was a late change in the spec.
4377
4378 2005-12-23  Miguel de Icaza  <miguel@novell.com>
4379
4380         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
4381         parent if its the same scope.  Fixes #77060.
4382
4383 2005-12-21  Miguel de Icaza  <miguel@novell.com>
4384
4385         * driver.cs: Report the case of no source files and no -out:
4386         argument provided.
4387
4388 2005-12-20  Raja R Harinath  <rharinath@novell.com>
4389
4390         Fix #77035.
4391         * expression.cs (ComposedCast.GetSignatureForError): Define.
4392
4393 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4394
4395         Fix #76995
4396
4397         * namespace.cs (NamespaceEntry): Add extern_aliases as a
4398         ListDictionary, to contain the ExternAliasEntry entries (in
4399         addition to the NamespaceEntry.aliases hashtable). This field is
4400         shared between the original entry and its doppelganger (bodyless 
4401         copy of it).
4402         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
4403         extern_aliases field.
4404         (NamespaceEntry.Lookup): Move the IsImplicit check after the
4405         lookup in extern_aliases.
4406
4407 2005-12-16  Raja R Harinath  <rharinath@novell.com>
4408
4409         Fix #77006.
4410         * class.cs (TypeContainer.Mark_HasEquals): New.
4411         (TypeContainer.Mark_HasGetHashCode): New.
4412         (ClassPart): Override them.
4413         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
4414
4415         Fix #77008.
4416         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
4417         'parent' argument to the base constructor.
4418
4419         Remove all mention of TypeContainer from decl.cs.
4420         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
4421         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
4422         (DeclSpace.DeclSpace): Likewise.
4423         (DeclSpace.DefineMembers): Remove unused argument.
4424         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
4425         debugging check -- we don't care if the debug code throws an
4426         InvalidCastException instead of an InternalErrorException.
4427         * class.cs (TypeContainer.DefineMembers): Update to changes.
4428         (TypeContainer.DoDefineMembers): Likewise.
4429         (TypeContainer.GetMethods): Likewise.
4430         (PropertyMember.Define): Likewise.
4431         (MemberBase.Parent): New property that forwards to
4432         MemberCore.Parent, but ensures that we get a TypeContainer.
4433         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
4434         (RootContext.PopulateTypes): Likewise.  Remove special case code
4435         for !RootContext.StdLib: DefineMembers is idempotent.
4436
4437 2005-12-14  Miguel de Icaza  <miguel@novell.com>
4438
4439         * convert.cs (ExplicitConversionCore): Check the return value from
4440         ExplicitConversionCore which can return null on failure.  Fixes #76914
4441
4442 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
4443
4444         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
4445
4446 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
4447
4448         * doc.cs : The search for referenced namespace was insufficient to
4449           get global one as it used to do. Fixed bug #76965.
4450
4451 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
4452
4453         * doc.cs : check name in cref in the last phase that whether it is
4454           namespace or not.
4455
4456 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
4457
4458         * cs-tokenizer.cs : reverted the latest change: it somehow broke
4459           Mono.C5.
4460
4461 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
4462
4463         * doc.cs : so it turned out that we cannot skip override check for 
4464           interface members. Fixed bug #76954.
4465
4466 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
4467
4468         * cs-tokenizer.cs : fixed bug #75984:
4469           - #warning and #error should not be handled when the source line
4470             is disabled.
4471           - #line is not checked strictly when the source line is disabled.
4472           - #define and #undef is on the other hand checked strictly at any
4473             state.
4474
4475 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
4476
4477         * cs-tokenizer.cs : missing Location (actually, filename) in one of
4478           CS1027 report.
4479
4480 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
4481
4482         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
4483
4484         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
4485         event initializers.
4486         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
4487         (FieldBase.Initializer): Initializer is now optional.
4488         (EventField.Define): Only event field can have initializer.
4489
4490         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
4491
4492         * const.cs (Const): Reuse initializer.
4493
4494         * cs-parser.jay: Updated after FieldBase changes.
4495         Added current_array_type to simplify array initializers.
4496
4497         * ecore.cs (NullCast.IsDefaultValue): Implemented.
4498
4499         * expression.cs, iterators.cs: Updated.
4500
4501         * namespace.cs (NamespaceEntry): Made UsingFound private.
4502
4503 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
4504
4505         * parameterCollection.cs: Obsolete, removed.
4506         * parser.cs: Obsolete, removed.
4507
4508 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
4509
4510         Fix #76849.
4511         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
4512
4513         * enum.cs (Enum.Define): Set obsolete context here.
4514
4515 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
4516
4517         * doc.cs :
4518           - FindDocumentedMember() now expects 1) paramList as null
4519             when "we don't have to check the number of parameters" and
4520             2) Type.EmptyTypes when "there is no arguments".
4521           - Introduced FoundMember struct to hold the exact type which was
4522             used to find the documented member (the above change broke
4523             test-xml-044; it might be better just to use DeclaringType than
4524             what MS does, like this change does, but it depends on usage.)
4525
4526 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
4527
4528         * doc.cs : documented member might be from DeclaringType for nested
4529           types. Fixed bug #76782.
4530
4531 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
4532
4533         * anonymous.cs: Have the param code handle leaving copies on the
4534         stack etc. Allows anonymous params to take part in the assignment
4535         code (++, +=, etc). Fixes bug #76550
4536
4537         * expression.cs: Handle the prepare_for_load/leave_copy by passing
4538         it down to the anon code.
4539
4540         * iterators.cs: Use dummy var here
4541
4542         * codegen.cs: Handle new vars
4543
4544 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
4545
4546         Fix #76849.
4547         * class.cs (MethodData.Define): Set proper Obsolete context.
4548
4549         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
4550         obsolete context.
4551         (FieldExpr.DoResolve): Ditto.
4552
4553 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
4554
4555         Fix #76849.
4556         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
4557         parent is not obsolete.
4558
4559 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
4560
4561         * doc.cs : (FindDocumentedMember) find parameterless members first
4562           and get CS0419 in the early stage. Fixed first case of bug #76727.
4563
4564 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
4565
4566         Fix #76859.
4567         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
4568         no error was reported.
4569
4570         *expression.cs (Binary.DoResolve): left can be null.
4571
4572 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
4573
4574         Fix #76783.
4575         * class.cs (MethodData.Emit): Parameters should be labeled first.
4576
4577 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
4578
4579         Fix #76761.
4580         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
4581
4582 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
4583
4584         * attribute.cs (AreParametersCompliant): Moved to Parameter.
4585
4586         * class.cs (MethodCore): Parameter clean up.
4587         (IMethodData): Added ParameterInfo.
4588         (MethodData): Parameter clean up.
4589         (Indexer.Define): Parameter clean up.
4590
4591         * anonymous.cs,
4592         * codegen.cs,
4593         * cs-parser.jay,
4594         * decl.cs,
4595         * doc.cs,
4596         * ecore.cs,
4597         * flowanalysis.cs,
4598         * iterators.cs,
4599         * pending.cs,
4600         * statement.cs,
4601         * typemanager.cs: Parameter clean up.
4602
4603         * delegate.cs (Define): Get rid of duplicated code.
4604
4605         * expression.cs (ParameterReference): Removed useless parameters
4606         and simplified.
4607         (Invocation): Ditto.
4608
4609         * parameter.cs (ParamsParameter): New class, params specialization.
4610         (ArglistParameter): Attemp to separate arglist.
4611         (Parameter): Refactored to be reusable and faster.
4612         (Parameter.Modifier): Made understandable.
4613         (Parameters): Changed to be used as a class for `this' assembly
4614         parameters. Refactored to use new specialized classes.
4615
4616         * support.cs (ParameterData): Added Types property.
4617         (InternalParameters): Deleted.
4618
4619 2005-08-20  Martin Baulig  <martin@ximian.com>
4620
4621         Merging this patch from GMCS to fix #75867.
4622
4623         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4624         scope if we don't already have it.
4625
4626 2005-11-17  Martin Baulig  <martin@ximian.com>
4627
4628         * anonymous.cs
4629         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
4630         inherit the scope from our parent.  Fixes #76653.
4631
4632 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
4633
4634         * doc.cs : the previous patch does not actually fix the bug.
4635           PropertyInfo override check is now implemented and really fixed it.
4636         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
4637
4638 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
4639
4640         * doc.cs : apply "override filter" also to properties.
4641           Fixed bug #76730.
4642
4643 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
4644
4645         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
4646           no need to check overrides. For classes, omit those results from 
4647           interfaces since they must exist in the class. Fixed bug #76726.
4648
4649 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
4650
4651         * typemanager.cs : (GetFullNameSignature) differentiate indexers
4652           with different parameters. Fixed the second problem in #76685.
4653
4654 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
4655
4656         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
4657           get expected 'protected' access in CheckValidFamilyAccess()).
4658           Fixed bug #76692.
4659
4660 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
4661
4662         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
4663           Fixed bug #76705.  CS1569 was incorrectly commented out.
4664
4665 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
4666
4667         * doc.cs : use Invocation.IsOverride() to do real override check.
4668         * expression.cs : made Invocation.IsOverride() internal.
4669
4670 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
4671
4672         * doc.cs : use TypeManager.FindMembers() instead of (possible)
4673           TypeBuilder.FindMembers() and filter overriden base members out.
4674           Fixed bug #76990.
4675
4676 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
4677
4678         * doc.cs : ref/out parameters are represented as '@' (instead of
4679           '&' in type FullName). Fixed bug #76630 (additionally crefs).
4680
4681 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
4682
4683         * doc.cs : when there was no '.' in cref to methods in doc comment,
4684           then parameters were missing in the output. Fixed bug #76691.
4685
4686 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
4687
4688         * driver.cs : don't output docs when there is an error.
4689           Fixed bug #76693.
4690
4691 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
4692
4693         * doc.cs :
4694           Now it should detect indexers. Fixed primary concern in bug #76685.
4695           Fixed CS0419 message to not show the identical member signature in
4696           the message.
4697
4698 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
4699
4700         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
4701           instead of Type.FindMembers() since it does not handle events.
4702           Fixed bug #71604.
4703
4704 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
4705
4706         * codegen.cs: Fixed typo (speficied -> specified).
4707
4708 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
4709
4710         Fix #76369.
4711         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
4712
4713 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
4714
4715         * attribute.cs: Changed error message.
4716
4717         * cs-tokenizer.cs: One more check.
4718
4719 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
4720
4721         * statement.cs (Block.Resolve): Ignore empty statement.
4722
4723 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
4724
4725         * report.cs: Made error/warning methods more strict to avoid
4726         their misuse.
4727
4728         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
4729         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
4730         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
4731         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
4732
4733 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
4734
4735         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
4736         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
4737
4738         * class.cs (TypeContainer.IsComImport): New property.
4739         (Constructor.Define): Create proper ctor for ComImport types.
4740
4741         * expression.cs (New.CheckComImport): Fixed.
4742
4743 2005-11-07  Miguel de Icaza  <miguel@novell.com>
4744
4745         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
4746         that a parameter has been captured does not mean that we do not
4747         have to do the rest of the processing.  This fixes the second part
4748         of #76592.  If there was another anonymous method capturing
4749         values in the past, the Scope would never be set for the second
4750         method that captured the same parameter.
4751
4752         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
4753         properly manipulate the stack.   Second part of fix for #76592.
4754
4755         * expression.cs (New): Add support for invoking "new" on
4756         interfaces that have been flagged with the ComImport attribute and
4757         the CoClass.  Fixes #76637 
4758
4759         * statement.cs (Try.DoEmit): When a variable is captured, do not
4760         try to emit the vi.LocalBuilder variable as it has been captured.
4761         Create a temporary variable and store the results on the
4762         FieldBuilder.  Fixes #76642
4763
4764 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
4765
4766         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
4767
4768         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
4769
4770         * expression.cs (Binary.DoResolve): Added && optimalization.
4771     
4772         * typemanager.cs (AddUserType): Removed useless argument.
4773
4774 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
4775
4776         * statement.cs (Block.variables): Uses ListDictionary.
4777
4778 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
4779
4780         Fix #75969.
4781         * class.cs (PartialContainer.EmitType): Customized to emit
4782         security attributes.
4783         (ClassPart.ApplyAttributeBuilder): Transform security attribute
4784         for partial classes.
4785
4786 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
4787
4788         Fix #76599.
4789         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
4790         access has to be fixed.
4791         
4792         * typemanager.cs (IsUnmanagedType): Wrong common field type.
4793
4794 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
4795
4796         Fix #76590.
4797         * ecore.cs (NullCast.Reduce): Implemented.
4798
4799         * expression.cs (ArrayCreation.CheckIndices): Correcly check
4800         constant type.
4801         
4802         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
4803         properly.
4804         (Foreach.Resolve): Catch null properly.
4805
4806 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
4807  
4808         * cs-tokenizer.cs: Warning text fix.
4809
4810         * driver.cs: AllWarningNumbers exposed on public interface.
4811
4812         * report.cs (): Reviewed warning numbers.
4813         (IsValidWarning): Use binary search.
4814
4815 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
4816  
4817         * driver.cs: Implemeted resource visibility.
4818         (Resources): New class for code sharing between /res: and
4819         /linkres:
4820  
4821 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
4822
4823         Fix #76568.
4824         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
4825         folding.
4826         
4827         * convert (Convert.ImplicitReferenceConversion): NullCast holds
4828         contants only.
4829         
4830         * ecore.cs (NullCast): Child is contant only.
4831         
4832         * literal.cs (NullLiteral.Reduce): null can be converted to any
4833         reference type.
4834
4835 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
4836
4837         * driver.cs: Use Encoding.Default as default code page instead
4838           of ISO-28591.
4839
4840 2005-10-27  Raja R Harinath  <rharinath@novell.com>
4841
4842         Fix #76085.
4843         * expression.cs (Invocation.Error_InvalidArguments): Handle
4844         __arglist parameters.
4845         (Invocation.VerifyArgumentsCompat): Likewise.
4846         * support.cs (ReflectionParameters.GetSignatureForError): Print
4847         __arglist parameters.
4848         (InternalParamters.GetSignatureForError): Likewise.
4849         * parameter.cs (Parameters.GetSignatureForError): Likewise.
4850
4851 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
4852
4853         * attribute.cs (GetPropertyValue): Made public.
4854
4855         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
4856         Resolve.
4857         Add new property WrapNonExceptionThrows to handle 2.0 assembly
4858         attribute.
4859         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
4860         is not defined.
4861         
4862         * driver.cs: Reflect method name change.
4863         
4864         * statement.cs (Try.Resolve): Warn when try has both general
4865         exception handlers.
4866         
4867         * typemanager.cs: runtime_compatibility_attr_type new predefined
4868         type.
4869
4870 2005-10-26  Raja R Harinath  <harinath@gmail.com>
4871
4872         Fix #76419.
4873         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
4874         treat it as an empty parameter list.
4875
4876 2005-10-26  Raja R Harinath  <rharinath@novell.com>
4877
4878         Fix #76271.     
4879         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
4880         ResolveAsTypeStep silent.
4881         * statement.cs (Block.AddConstant): Mark block as used.
4882         (Block.ResolveMeta): Avoid piling on error messages
4883         if a constant initializer resolution fails.
4884
4885 2005-10-25  Raja R Harinath  <rharinath@novell.com>
4886
4887         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
4888         Remove.
4889         (NamespaceEntry.VerifyAllUsing): New.
4890         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
4891         behaviour.  Delegates actual resolution of alias to ...
4892         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
4893         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
4894         Update.
4895         * driver.cs (Driver.MainDriver): Update.
4896         
4897         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
4898         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
4899         property.
4900         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
4901         Remove.
4902         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
4903         RootNamespace.DefineNamespacesForAll.
4904
4905 2005-10-24  Raja R Harinath  <harinath@gmail.com>
4906
4907         * typemanager.cs (assemblies, external_aliases, modules)
4908         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
4909         (ComputeNamespaces, GetRootNamespace): Remove extra staging
4910         overhead.  Move resposibility ...
4911         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
4912         * driver.cs, attribute.cs, codegen.cs: Update to changes.
4913
4914 2005-10-23  Raja R Harinath  <harinath@gmail.com>
4915
4916         * namespace.cs (RootNamespace.all_namespaces): Renamed from
4917         cached_namespaces.  Improve usage.
4918         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
4919         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
4920         Move from GlobalRootNamespace and simplify.
4921         (RootNamespace.Global): Make instance variable.
4922         (RootNamespace.RootNamespace): Add "alias name" parameter.
4923         (GlobalRootNamespace): Simplify drastically.
4924         (Namespace.Lookup): Don't use GetNamespace.
4925         * typemanager.cs (GetRootNamespace): Rename from
4926         ComputeNamespaceForAlias.
4927         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
4928
4929 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
4930
4931         * anonymous.cs (AnonymousContainer): Don't crash when container
4932         doesn't exist.
4933
4934 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
4935
4936         * expression.cs (Binary.DoResolve): Warn when comparing same
4937         values.
4938
4939 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
4940
4941         Fix #76486.
4942         * expression.cs (Binary.DoResolve): It looks like there are no
4943         convetsion rules in enum context.
4944
4945 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4946
4947         Add support for extern alias qualifiers.
4948         * typemanager.cs: Move some LookupTypeReflection code
4949         to namespace.cs, to have cleaner code. Added some methods
4950         to help us keep track of the extern aliased references.
4951         * driver.cs: Add suport for extern alias assemblies on command
4952         line and check for their warnings/errors. Also keep track of the
4953         extern aliased assemblies.
4954         * namespace.cs: Move the global functionality of Namespace
4955         to GlobalRootNamespace/RootNamespace. Now the global namespace
4956         is GlobalRootNamespace.Globa. Also the code moved from 
4957         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
4958         Finally added LocalAliasEntry (AliasEntry before) and
4959         ExternAliasEntry, to handle alias statements.
4960         * cs-parser.jay: Add support in the grammar for extern alias
4961         statement.
4962         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
4963         Update callings to Namespace (now in GlobalRootNamespace).
4964
4965 2005-10-18  Raja R Harinath  <rharinath@novell.com>
4966
4967         Fix #76371.
4968         * class.cs (TypeContainer.DefineType): Move updating of
4969         topological sort earlier in the code.
4970         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
4971
4972 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
4973
4974         Fix #76273.
4975         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
4976         
4977         * constant.cs (Constant.TryReduce): Moved from Cast class.
4978         (Reduce): Made little bit more OO and fixed missing conversions.
4979         
4980         * ecore.cs (Reduce): Implemented.
4981         (Binary.EnumLiftUp): New method to upgrade values to enum values.
4982         
4983         * literal.cs (Reduce): Implemented.
4984         
4985         * class.cs: Reverted Miguel's wrong commit.
4986
4987 2005-10-14  Miguel de Icaza  <miguel@novell.com>
4988
4989         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
4990
4991 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
4992
4993         * cs-parser.jay, expression.cs : CS0214 was missing error location
4994           for constants. Fixed bug #76404.
4995
4996 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
4997
4998         Fix #76370.
4999         * convert.cs (ExplicitConversionCore): Fixed object->enum
5000         conversion.
5001
5002 2005-10-10  Raja R Harinath  <rharinath@novell.com>
5003
5004         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
5005         InstanceExpression.
5006         (PropertyExpr.EmitCall): Likewise.
5007         * expression.cs (Invocation.EmitArguments): Handle case where
5008         arguments == null.
5009         (Invocation.EmitCall): Avoid allocating temporary variable if
5010         there are no arguments.
5011
5012 2005-10-07  Raja R Harinath  <rharinath@novell.com>
5013
5014         Fix #76323.
5015         * convert.cs (ImplicitConversionStandard): Move conversion of
5016         void* to arbitrary pointer types ...
5017         (ExplicitConversionStandard): .. here.
5018         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
5019         error to always print typenames.
5020
5021 2005-10-07  Raja R Harinath  <rharinath@novell.com>
5022
5023         * convert.cs (GetConversionOperator): Rename from
5024         GetConversionOperators.  Move operator selection code from ...
5025         (UserDefinedConversion): ... here.
5026
5027 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
5028
5029         * convert.cs (ExplicitConversionCore): Removed duplicate enum
5030         conversion.
5031
5032 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
5033
5034         * assign.cs (Assign.DoResolve): Error method changed.
5035
5036         * cfold.cs (DoConstantNumericPromotions): Error method changed.
5037         
5038         * const.cs (ResolveValue): Reset in_transit immediately.
5039         
5040         * constant.cs: Error method changed.
5041         
5042         * convert.cs: Removed useless location parameter.
5043         (ExplicitNumericConversion): Don't do double enum check.
5044         (ExplicitConversionCore): Renamed from ExplicitConversion.
5045         (ExplicitUnsafe): Extracted from ExplicitConversion.
5046         (ExplicitConversion): Uses for error reporting.
5047         
5048         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
5049         error messages.
5050         (ResolveBoolean): Uses common error method.
5051         (CastToDecimal): Get rid of ec.
5052         (CastFromDecimal): Optimized.
5053         (ConvCast): Get rid of ec.
5054         
5055         * enum.cs (ResolveValue): Reset in_transit immediately.
5056         (Emit): Return after first error.
5057         
5058         * expression.cs: Convert changes.
5059         
5060         * literal.cs: Error method changed.
5061         
5062         * statement.cs: Error method changed.
5063
5064 2005-10-03  Raja R Harinath  <rharinath@novell.com>
5065
5066         * support.cs (SeekableStreamReader.Position): Don't error out when
5067         the requested position is just beyond the end of the current
5068         buffered data.
5069
5070 2005-09-28  Raja R Harinath  <rharinath@novell.com>
5071
5072         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
5073         try to keep in sync with the byte count of the underlying Stream.
5074         However, this limits us to a window size of 2048 characters: i.e.,
5075         the maximum lookahead of our lexer/parser can be 2048 characters.
5076
5077 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
5078
5079         Fix #76255.
5080         * driver.cs: Fix compilation files with full root path.
5081
5082 2005-09-25  Miguel de Icaza  <miguel@novell.com>
5083
5084         * report.cs (SymbolRelatedToPreviousError): Format the output so
5085         it does not use an open parenthesis that is never closed. 
5086
5087         * driver.cs: Follow coding guidelines
5088
5089 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
5090
5091         Fix #72930.
5092         * const.cs (Const.ResolveValue): Check for assigning non-null
5093         value to reference type.
5094
5095 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
5096
5097         * anonymous.cs: Implemented ExprClassName.
5098         
5099         * assign.cs (Assign.DoResolve): Don't chrash when type is not
5100         delegate.
5101         
5102         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
5103         check.
5104         
5105         * class.cs (StaticClass.DefineContainerMembers): Report protected
5106         members as error.
5107         
5108         * codegen.cs: if(ed) PRODUCTION.
5109         
5110         * convert.cs (Error_CannotImplicitConversion): Better error
5111         distinction.
5112         
5113         * cs-parser.jay: More error checks.
5114         
5115         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
5116         
5117         * driver.cs (CSCParseOption): Enabled wrong option check.
5118         
5119         * ecore.cs (Expression.ExprClassName): Turned to property.
5120         (MemberExpr.CheckIntermediateModification): For checking boxed
5121         value types     modification.
5122         
5123         * statement.cs (Fixed.Resolve): Expression type must be
5124         convertible to fixed type.
5125         (CollectionForeach.GetEnumeratorFilter,TryType):
5126         Small refactoring for easier error checking.
5127
5128 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
5129
5130         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
5131         attributes.
5132         
5133         * class.cs (GeneratedBaseInitializer): New class for customization
5134         compiler generated initializers.
5135         (MemberBase.DoDefine): Check Obsolete attribute here.
5136         (FieldMember.DoDefine): Ditto.
5137         
5138         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
5139         constants.
5140         
5141         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
5142         (MemberCore.GetObsoleteAttribute): Removed argument.
5143         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
5144         (MemberCore.CheckObsoleteType): New helper.
5145         
5146         * delegate.cs,
5147         * enum.cs,
5148         * statement.cs: Updates after MemberCore changes.
5149         
5150         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
5151         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
5152         
5153         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
5154         obsolete attribute for compiler construct.
5155         (As.DoResolve): Cache result.
5156         
5157         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
5158
5159 2005-09-26  Raja R Harinath  <rharinath@novell.com>
5160
5161         Fix #76133.
5162         * expression.cs (This.VerifyFixed): In a value type T, the type of
5163         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
5164         value type R, 'this' is treated as a value parameter.
5165
5166 2005-09-22  Miguel de Icaza  <miguel@novell.com>
5167
5168         * statement.cs (Lock): Use the TemporaryVariable class instead of
5169         manually using local variables as those do not work when variables
5170         are captured.
5171
5172         * ecore.cs: Moved the TemporaryVariable class from being a nested
5173         class inside Foreach to be a public class that can be employed in
5174         other places. 
5175
5176 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
5177
5178         * cs-parser.jay: interface_accessors replaced by
5179         accessor_declarations.
5180
5181         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
5182         location.
5183         
5184         * statement.cs (GotoCase.Resolve): Convert null constant to
5185         null case.
5186         (SwitchLabel.ResolveAndReduce): Ditto.
5187         (SwitchLabel.NullStringCase): Custom null stamp.
5188         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
5189         
5190         typemanager.cs (CSharpSignature): Don't skip first argument
5191         for full names.
5192
5193 2005-09-18  Miguel de Icaza  <miguel@novell.com>
5194
5195         * driver.cs: Set InEmacs based on the environment variable EMACS. 
5196
5197         * location.cs (InEmacs): in this mode, do not report column
5198         location as it confuses Emacs.
5199
5200 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
5201
5202         * cfold.cs, constant.cs, convert.cs, ecore.cs,
5203         expression.cs, iterators.cs, literal.cs: Store constants and
5204         literals location.
5205         
5206         * class.cs (MemberBase.ShortName): Pass location.
5207         
5208         * cs-parser.jay: Some location fixes.
5209         
5210         * ecore.cs (Expression.Location): Made virtual.
5211
5212 2005-09-05  Miguel de Icaza  <miguel@novell.com>
5213
5214         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
5215         if the underlying types are the same, otherwise we need to produce
5216         code that will do the proper cast.
5217
5218         This was exposed by Marek's constant rewrite which produced
5219         invalid code for the call site:
5220
5221         enum X : long { a }
5222         void Method (X v) {}
5223
5224         Method ((X) 5)
5225
5226         This fixes test-49.cs
5227
5228 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
5229
5230         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
5231           Type/Object should be allowed as well. Fixed bug #75968.
5232
5233 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
5234
5235         * expression.cs : (Binary.DoResolve): when one is enum constant and
5236           another is constant 0, then return enum one *as enum type*.
5237           Fixed bug 74846.
5238
5239 2005-09-02  Raja R Harinath  <rharinath@novell.com>
5240
5241         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
5242         internal.
5243
5244         Fix #75941.
5245         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
5246         flow-branching for LocalVariableReferences in case we were invoked
5247         from a MemberAccess.
5248         * expression.cs (LocalVariableReference.VerifyAssigned): New.
5249         Carved out of ...
5250         (LocalVariableReference.DoResolveBase): ... this.
5251         (MemberAccess.Resolve): Do the check that was disabled during
5252         SimpleNameResolve.
5253
5254 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
5255
5256         * class.cs :
5257           (PartialContainer.Create): check abstract/sealed/static strictly
5258           but abstract/sealed can exist only at one side. Fixed bug #75883.
5259
5260 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
5261
5262         Fix #75945.
5263         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
5264         specified, don't default to UnmanagedType.I4.
5265
5266 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
5267
5268         * expression.cs : conditional operator should check possibly
5269           incorrect assign expression. Fixed bug #75946.
5270
5271 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
5272
5273         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
5274           Reverting the change. gmcs is much complex than mcs on this matter.
5275
5276 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
5277
5278         * cs-tokenizer.cs : To read another token ahead of the actual 
5279           consumption, use new SavedToken and cache token instead of moving
5280           back the stream with SeekableStreamReader (it seemed problematic).
5281         * cs-parser.jay,
5282           driver.cs : Thus use StreamReader directly.
5283         * support.cs : Thus removed SeekableStreamReader.
5284
5285 2005-08-30  Raja R Harinath  <rharinath@novell.com>
5286
5287         Fix #75934.
5288         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
5289         (ScopeInfo.EmitScopeType): Use it to construct field names from
5290         names of captured locals.
5291
5292         Fix #75929.
5293         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
5294         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
5295         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
5296         (ExplicitConversion): Remove enum cases already handled by
5297         implicit conversion.  Move implicit conversion check to the beginning.
5298         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
5299         * expression.cs (ArrayCreation.EmitDynamicInitializers):
5300         Don't treat System.Enum as a struct.
5301
5302 2005-08-30  Jb Evain  <jbevain@gmail.com>
5303
5304         * attribute.cs: handles as expression in parameters.
5305
5306 2005-08-30  Raja R Harinath  <rharinath@novell.com>
5307
5308         Fix #75802.
5309         * class.cs (TypeContainer.VerifyClsName): Don't use a
5310         PartialContainer when verifying CLS compliance.
5311         (AbstractPropertyEventMethod): Set Parent here, ...
5312         (PropertyMethod): ... not here.
5313
5314 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
5315
5316         * attribute.cs : escaped attribute name should not be allowed to be
5317           resolved (e.g. @class as classAttribute). Fixed bug #75930.
5318
5319 2005-08-29  Raja R Harinath  <rharinath@novell.com>
5320
5321         Fix #75927.
5322         * convert.cs (ImplicitStandardConversionExists): Allow zero also
5323         when converting a long constant to unsigned long.
5324         * expression.cs (Invocation.OverloadResolve): Add sanity check to
5325         detect where IsApplicable and VerifyArgumentsCompat disagree.
5326
5327 2005-08-29  Raja R Harinath  <rharinath@novell.com>
5328         and Carlos Alberto Cortez  <carlos@unixmexico.org>
5329
5330         Fix #75848.
5331         * class.cs (TypeContainer.CanElideInitializer): New helper.
5332         (TypeContainer.EmitFieldInitializers): Use it to determine if we
5333         can safely emitting the initializer of a field.
5334
5335 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
5336
5337         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
5338           allowed inside a switch (without loop). Fixed bug #75433.
5339
5340 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
5341
5342         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
5343         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
5344
5345 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
5346
5347         * driver.cs : kinda reverting the default encoding changes (not exact 
5348           revert since I noticed that "codepage:reset" might not work fine).
5349
5350 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
5351
5352         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
5353           Location. Now getter and setter store location correctly.
5354           (errors/cs0111-12.cs now reports the expected location.)
5355
5356 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
5357
5358         * driver.cs : Use default encoding on the environment.
5359           Removed (now that) extra parameter for SeekableStreamReader.
5360         * support.cs : (SeekableStreamReader) third .ctor() argument for
5361           StreamReader is not required (always true). preamble size could
5362           be acquired in simpler and safe way.
5363
5364 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
5365
5366         * cs-parser.jay: report CS0642 at warning level 3
5367           and report CS0642 for an if else statement also
5368           fixes bug #74745. Patch by John Luke (and a bit
5369           modified by me).
5370           Removed extra CS0642 warning check for "while",
5371           "for" and "fixed".
5372         * statement.cs: In Block.Resolve(), CS0642 check
5373           is reimplemented to check a sequence of an empty
5374           statement and a block.
5375
5376           Both fix bug #66777.
5377
5378 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
5379
5380         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
5381         detection until I fix it.
5382         
5383         * cs-tokenizer.cs: Changed error message.
5384         
5385         * cs-parser.jay: Fixed 2 error locations.
5386         
5387         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
5388         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
5389         properties.
5390         
5391         * enum.cs (GetSignatureForError): Fixed.
5392         
5393         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
5394         method detection.
5395         
5396         * class.cs,
5397         * typemanager.cs (RegisterProperty): Removed.
5398         
5399         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
5400
5401 2005-08-24  Raja R Harinath  <rharinath@novell.com>
5402
5403         Fix #75874.
5404         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
5405         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
5406
5407 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5408
5409         * expression.cs : tiny fix is required for not warning positive ulong.
5410           See test-441.cs.
5411
5412 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5413
5414         * expression.cs : add CS0652 check for constant and integral
5415           expression. Fixed bug #53974.
5416
5417 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5418
5419         * expression.cs : in DoNumericPromotions(), check if there is implicit
5420           conversion overload for string (to check CS0034). Fixed bug #52492.
5421
5422 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5423
5424         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
5425
5426 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5427
5428         * ecore.cs : report location when it is *not* Null.
5429
5430 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5431
5432         * codegen.cs,
5433           ecore.cs,
5434           flowanalysis.cs,
5435           expression.cs:
5436           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
5437           correctly. Fixed bug #75721.
5438
5439 2005-08-23  Raja R Harinath  <rharinath@novell.com>
5440
5441         * support.cs (SeekableStreamReader.Position): Avoid an expensive
5442         loop that performs 'min (pos, char_count)'.
5443
5444         Fix #75862.
5445         * expression.cs (Unary.ResolveOperator): Don't discard implicit
5446         converted value in Operator.OnesComplement.
5447
5448 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
5449
5450         * anonymous.cs: If the anon method is pulled into a helper class,
5451         it needs to be `internal' not `private'. Fixes runtime behavior on
5452         msft. bug #75704
5453
5454 2005-08-20  Martin Baulig  <martin@ximian.com>
5455
5456         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
5457         scope if we don't already have it.
5458
5459         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
5460         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
5461         fixes #75867.
5462
5463 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
5464
5465         Fix #75803
5466         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
5467         is a partial class.
5468
5469 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
5470
5471         The big constants rewrite
5472         Fix #75746, #75685 and more
5473         As a side effect saved 1MB for MWF ;-)
5474         
5475         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
5476         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
5477         enum based for corlib compilation.
5478         
5479         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
5480         subtractions.
5481         
5482         * class.cs (FixedField.Define): Use ResolveAsConstant.
5483         
5484         * const.cs (IConstant): Interface constants and enums.
5485         (Const.ResolveValue): New method for constant resolvning.
5486         (ExternalConstant): Constants from imported assemblies.
5487         
5488         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
5489         conversion; like enums.
5490         (Constant.ToType): Converts this constant to different type.
5491         (Constant.Increment): Adds 1.
5492         
5493         * convert.cs (ImplicitConversionRequired): Simplified.
5494         
5495         * cs-parser.jay: Create EnumMember directly.
5496         
5497         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
5498         
5499         * doc.cs (GenerateEnumDocComment): Removed.
5500         
5501         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
5502         (ConvertIntLiteral): Removed.
5503         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
5504         
5505         * enum.cs (EnumMember): Implement IConstant.
5506         (Enum.IsValidEnumConstant): Removed.
5507         (Enum.GetNextDefaultValue): Removed.
5508         (Enum.FindMembers): Updated.
5509         (Enum.GenerateDocComment): Iterate enum members.
5510         
5511         * expression.cs (Cast.TryReduce): Handle enums correctly.
5512         (New.Constantify): Made public.
5513         (MemberAccess.DoResolve): Removed contant specific if(s).
5514         
5515         * literal.cs (NullLiteral): Implement new abstract methods.
5516         
5517         * statement.cs (GotoCase.Resolve): Use new constant methods.
5518         (SwitchLabel.ResolveAndReduce): Use new constant methods.
5519         
5520         * typemanager.cs (LookupEnum): Removed.
5521         (IsEnumType): Fixed to work with corlib.
5522         (RegisterConstant): Removed.
5523         (LookupConstant): Removed.
5524         (GetConstant): Changed to work with IConstant.
5525
5526 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
5527
5528         * location.cs : Fixed overflown (>255) column number.
5529
5530 2005-08-03  Raja R Harinath  <rharinath@novell.com>
5531
5532         First cut of the qualified-alias-member feature.
5533         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
5534         token.
5535         * cs-parser.jay (DOUBLE_COLON): New token.
5536         (namespace_or_type_name): Add rule for recognizing
5537         qualified-alias-members.
5538         (primary_expression): Likewise.
5539         (element_access): Allow QualifiedAliasMember as a possible
5540         type-bearing expression.
5541         (local_variable_type, local_variable_pointer_type): Likewise.
5542         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
5543         aliases in the current and enclosing namespace declarations.
5544         (NamespaceEntry.UsingAlias): Add CS0440 warning.
5545         * decl.cs (MemberName.is_double_colon): New.
5546         (MemberName.MemberName): Add new constructor for alias-member.
5547         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
5548         * expression.cs (QualifiedAliasMember): New expression type.
5549
5550 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
5551
5552         * location.cs : it borked when no argument was specified.
5553
5554 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
5555
5556         * location.cs : tiny ToString() format fix.
5557
5558 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
5559
5560         * statement.cs : oops, it was missing.
5561
5562 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
5563
5564         A set of fixes for precise line/column location.
5565
5566         * location.cs :
5567           "token" field now holds a file/line "delta", a line number offset 
5568           from the segment, and a column number. See also:
5569           http://lists.ximian.com/pipermail/mono-devel-list/2004-
5570           December/009508.html
5571           Removed static IsNull. Use instance IsNull property instead.
5572         * cs-tokenizer.cs :
5573           For some tokens it stores Location. For Identifier it stores
5574           LocatedToken which is a pair of string name and location.
5575           Column numbers are adjusted only at getChar().
5576         * report.cs :
5577           Use Location.ToString() for reporting (it now contains column).
5578         * cs-parser.jay :
5579           Largely modified to use LocatedToken instead of
5580           string (IDENTIFIER), and to acquire Location from some tokens.
5581         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
5582           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
5583           codegen.cs :
5584           Now MemberName holds Location. DeclSpace.ctor() receives Location
5585           as a parameter. Removed extra parameters to all derived classes.
5586           Replaced Location.IsNull() with instance property.
5587         * assign.cs, expression.cs :
5588           Added .ctor() overload that omits Location.
5589         * attribute.cs :
5590           Added "nameEscaped" flag that indicates the identifier was escaped
5591           in the source file. This fixes bug #57047.
5592
5593 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
5594
5595         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
5596         New method, looking for lo-case imported cls type.
5597
5598         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
5599         here.
5600
5601         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
5602
5603         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
5604
5605         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
5606         all_imported_types.
5607         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
5608
5609         Optimized to save 3.5 MB for SWF compilation.
5610
5611 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
5612
5613         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
5614         (PartialContainer.Create): Moved logic AddToContainer.
5615         (PartialContainer.MarkForDuplicationCheck): Shares name.
5616         
5617         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
5618         place.
5619         
5620         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
5621         initialization.
5622         (Namespace.GetSignatureForError): New method.
5623         
5624         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
5625         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
5626
5627 2005-08-01  Raja R Harinath  <rharinath@novell.com>
5628
5629         Fix #75669.
5630         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
5631         member lookup rather than qualifier_type, since qualifier_type can
5632         be null.
5633
5634 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
5635
5636         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
5637         enum member.
5638
5639 2005-07-31  Miguel de Icaza  <miguel@novell.com>
5640
5641         * statement.cs: Copy the local exception into the exception
5642         captured local.  Fixes 75674
5643
5644 2005-07-31  Raja R Harinath  <harinath@gmail.com>
5645
5646         Fix #75658.
5647         * expression.cs (Invocation.OverloadResolve): Don't report error
5648         CS1501 if error CS1502 has been reported.
5649         (New.DoResolve): Delegate CS1501 reporting to
5650         Invocation.OverloadResolve.
5651
5652         Fix #75656.
5653         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
5654         invariant-meaning-in-block property in an enclosing block if
5655         necessary.
5656
5657 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
5658
5659         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
5660         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
5661         (Switch.CheckSwitch): Just save 50kb for SWF.
5662
5663 2005-07-27  Martin Baulig  <martin@ximian.com>
5664
5665         * anonymous.cs (CaptureContext.AddField): Added
5666         `AnonymousContainer am' argument; compute its toplevel scope if
5667         it's not already computed.  Fixes #75649.
5668
5669 2005-07-26  Raja R Harinath  <rharinath@novell.com>
5670
5671         Fix #75628.
5672         * class.cs (Constructor.Emit): Reset block to null if the block
5673         resolve fails.
5674
5675 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
5676
5677         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
5678
5679 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
5680
5681         * class.cs (MethodData.Define): Check whether accessor implementing
5682         interface is public.
5683
5684         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
5685
5686 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
5687
5688         Fix #57245
5689         * namespace.cs (LookupType): Moved same type check to...
5690         
5691         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
5692         with the same name.
5693
5694 2005-07-21  Raja R Harinath  <rharinath@novell.com>
5695
5696         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
5697         already found a typebuilder.
5698         * class.cs (MethodCore.IsDuplicateImplementation): Compare
5699         MemberNames, not strings.
5700
5701         * const.cs (Error_ExpressionMustBeConst): 
5702         Rename from Error_EpressionMustBeConst.
5703         * const.cs, class.cs, statement.cd: Update.
5704
5705 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
5706
5707         Fix #65573
5708
5709         * const.cs (Const.LookupConstantValue): Report missing contant expression
5710         everytime.
5711         (Error_EpressionMustBeConstant): Only one error method.
5712
5713         * class.cs, statement.c: Updated.
5714
5715 2005-07-20  Raja R Harinath  <rharinath@novell.com>
5716
5717         * statement.cs (Block.Flags): Add back HasVarargs.
5718         (Block.flags): Make protected.
5719         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
5720
5721         * typemanager.cs (types, typecontainers, user_types): Remove.
5722         (UserTypes, TypeContainers): Likewise.
5723         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
5724         (CleanUp, Reset): Update.
5725         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
5726         (GetNestedType): Use Type.GetNestedType.
5727         (CoreLookupType): Take two arguments, the namespace and the
5728         basename of the type.  Update to use the Namespace.Lookup
5729         mechanism.
5730         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
5731         (RealMemberLookup): Use IsNestedChildOf instead of playing with
5732         string concatenation and substring matches.
5733         * class.cs, enum.cs, delegate.cs: Update to changes.
5734
5735 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
5736
5737         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
5738         Expression and made virtual.
5739
5740         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
5741         (ImplicitStandardConversionExists): Fixed `byte' typo ?
5742
5743         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
5744
5745         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
5746         error message.
5747
5748         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
5749         change.
5750
5751 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
5752
5753         Fix #57707
5754         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
5755         AssemblyCultureAttribute is not used on executable.
5756
5757         * rootcontext.cs,
5758         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
5759
5760 2005-07-16  Raja R Harinath  <rharinath@novell.com>
5761
5762         Fix #60638.
5763         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
5764         New.  Reports CS0252/CS0253.
5765         Mostly taken from preliminary patch by Duncak Mak.
5766         (Binary.DoResolveOperator): Store results of operator lookup.
5767         Use them to detect if we need to warn about unintended reference
5768         comparisons.
5769
5770 2005-07-15  Raja R Harinath  <rharinath@novell.com>
5771
5772         Fix #72969.
5773         * namespace.cs (Namespace.Lookup): Add back location parameter.
5774         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
5775         * delegate.cs, ecore.cs, expression.cs: Update to changes.
5776
5777         * codegen.cs (EmitContext.DeclSpace): Make readonly.
5778         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
5779         (Namespace.LookupType): ... this.
5780         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
5781         of namespaces.
5782         * typemanager.cs (LookupTypeReflection): Remove buggy code that
5783         purported to handle pointers.
5784         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
5785         CoreLookupType.
5786
5787 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
5788
5789         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
5790         type as namespace.
5791
5792 2005-07-15  Raja R Harinath  <rharinath@novell.com>
5793
5794         * namespace.cs (Namespace.Lookup): Drop location parameter.
5795         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
5796         (NamespaceEntry.Lookup): ... this.
5797         (NamespaceEntry.Error_AmbiguousTypeReference):
5798         Move here from DeclSpace.
5799         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
5800         names ...
5801         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
5802         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
5803         Move to NamespaceEntry.
5804         * delegate.cs, expression.cs: Update to changes.
5805
5806 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
5807
5808         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
5809         CheckAttributeType and refactored.
5810         (Attribute.ResolvePossibleAttributeType): Changed to reuse
5811         ResolveAsTypeTerminal error handling.
5812         (ResolveAsTypeTerminal): Introduced because of global attributes extra
5813         handling.
5814         (GetSignatureForError): Print errors in same way.
5815
5816         * class.cs,
5817         * codegen.cs: Reflect attribute GetSignatureForError change.
5818
5819         * ecore.cs,
5820         * expression.cs: Add silent parameter to ResolveAsTypeStep.
5821
5822         * namespace.cs (UsingEntry): Refactored to make fields private.
5823
5824         * assign.cs,
5825         statement.cs: Error_UnexpectedKind has extra parameter.
5826
5827 2005-07-14  Raja R Harinath  <rharinath@novell.com>
5828
5829         * ecore.cs (IAlias): Remove.
5830         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
5831         that implement the interface.
5832         * namespace.cs (Namespace): Likewise.
5833         (Namespace.declspaces): Renamed from 'defined_names'.
5834         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
5835         DeclSpace instead of an IAlias.
5836         * tree.cs (Tree.AddDecl): Update.
5837
5838 2005-07-12  Raja R Harinath  <rharinath@novell.com>
5839
5840         * statement.cs (Block.Flags); Remove HasVarargs.
5841         (Block.HasVarargs): Move to ToplevelBlock.
5842         (Block.ThisVariable, Block.AddThisVariable): Likewise.
5843         (Block.Variables): Make protected.  Initialize variable hashtable
5844         if necessary.
5845         (Block.AddVariable): Update.
5846         (Block.Resolve): Update to changes.
5847         (ToplevelBlock.HasVarargs): New boolean.
5848         (ToplevelBlock.ThisVariable): Move here from Block.
5849         (ToplevelBlock.AddThisVariable): Likewise.
5850         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
5851         * expression.cs (This.ResolveBase): Update to changes.
5852         (ArglistAccess.DoResolve): Likewise.
5853
5854 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
5855
5856         Fix #75321
5857         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
5858
5859         * class.cs (TypeContainer.VerifyMembers): Distinguish between
5860         not used and not used & assigned.
5861         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
5862
5863 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
5864
5865         Fix #75053
5866         * expression.cs (Is.DoResolve): null is never provided type.
5867
5868 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
5869
5870         Fix #52496
5871         * cs-parser.jay: Less strict event error rule to catch more errors.
5872
5873 2005-07-08  Martin Baulig  <martin@ximian.com>
5874
5875         Fix test-iter-10.cs - distinguish whether we `yield' in a property
5876         gettter (allowed) or setter (not allowed).
5877
5878         * class.cs (Accessor): Implement IIteratorContainer.
5879         (Accessor.Yields): New public field.
5880         (PropertyBase.PropertyMethod.Define): Handle iterators on a
5881         per-accessor basis.
5882
5883         * cs-parser.jay
5884         (get_accessor_declaration, set_accessor_declaration): Set the
5885         `yields' flag on the accessor, not the property.
5886         (property_declaration): Do the iterators check on a per-accessor
5887         basis and not for the whole property.
5888
5889 2005-07-08  Martin Baulig  <martin@ximian.com>
5890
5891         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
5892         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
5893
5894 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
5895
5896         Fix #74975
5897         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
5898         (ExtractSecurityPermissionSet): Cope with self referencing security
5899         attributes properly.
5900
5901         * driver.cs (SetOutputFile): Made public property OutputFile.
5902
5903 2005-07-07  Raja R Harinath  <rharinath@novell.com>
5904
5905         Fix #75486.
5906         * class.cs (TypeContainer.first_nonstatic_field): Rename from
5907         has_nonstatic_fields.  Make into a FieldBase pointer.
5908         (TypeContainer.AddField): Add CS0282 check.
5909         (TypeContainer.EmitType): Update.
5910
5911 2005-07-06  Miguel de Icaza  <miguel@novell.com>
5912
5913         * cs-tokenizer.cs (consume_identifier): Do not create strings to
5914         compare if they start with __.
5915
5916 2005-07-06  Raja R Harinath  <rharinath@novell.com>
5917
5918         * statement.cs (Switch.SwitchGoverningType): Only look at
5919         UserCasts that don't need implicit standard conversions to one of
5920         the allowed switch types (Fixes test-322.cs).
5921         (LocalInfo.Resolve): Re-enable sanity-test.
5922
5923 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
5924
5925         * cs-tokenizer.cs (consume_identifier): Detect double undescores
5926         
5927         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
5928         
5929         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
5930
5931 2005-07-06  Raja R Harinath  <rharinath@novell.com>
5932
5933         Fix #75472.
5934         * ecore.cs (SimpleName.GetSignatureForError): Add.
5935         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
5936         (MemberAccess.GetSignatureForError): Add.
5937
5938 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
5939  
5940         The big error and warning messages review.
5941         
5942         * anonymous.cs,
5943         * assign.cs,
5944         * attribute.cs,
5945         * class.cs,
5946         * codegen.cs,
5947         * convert.cs,
5948         * cs-parser.jay,
5949         * cs-tokenizer.cs,
5950         * decl.cs,
5951         * delegate.cs,
5952         * doc.cs,
5953         * driver.cs,
5954         * ecore.cs,
5955         * enum.cs,
5956         * expression.cs,
5957         * flowanalysis.cs,
5958         * iterators.cs,
5959         * literal.cs,
5960         * location.cs,
5961         * modifiers.cs,
5962         * namespace.cs,
5963         * parameter.cs,
5964         * pending.cs,
5965         * report.cs,
5966         * rootcontext.cs,
5967         * statement.cs,
5968         * support.cs,
5969         * tree.cs,
5970         * typemanager.cs: Updated.
5971         
5972         * class.cs: (MethodCore.SetYields): Moved here to share.
5973         (PropertyMethod.Define): Moved iterator setup here.
5974         
5975         * iterators.cs: Add orig_method to have full access to parent
5976         container.
5977
5978 2005-07-05  Raja R Harinath  <rharinath@novell.com>
5979
5980         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
5981         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
5982         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
5983         variable of struct type.
5984         * expression.cs (Unary.ResolveOperator): Update to change.
5985         (Indirection.VerifyFixed): Likewise.
5986         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
5987         (ParameterReference.VerifyFixed): Value parameters are fixed.
5988         (This.VerifyFixed): Treat 'this' as a value parameter.
5989         * statement.cs (LocalInfo.IsFixed): Remove.
5990
5991 2005-07-01  Martin Baulig  <martin@ximian.com>
5992
5993         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
5994         `ec.EmitThis ()' to get the correct scope.
5995
5996 2005-07-01  Martin Baulig  <martin@ximian.com>
5997
5998         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
5999         instance is a ParameterReference; fixes #75299.
6000
6001 2005-07-01  Martin Baulig  <martin@ximian.com>
6002
6003         Reverted Marek's latest patch (r46725):
6004         - it contains structural changes which are neither mentioned in
6005           the ChangeLog nor explained anywhere; for example the additional
6006           argument of EmitContext's and Iterator's .ctor's and the
6007           TypeContainer.DefineMembers() change.
6008         - structural changes like this should go in in seperate patches
6009           and not be hidden in a huge patch which just seems to affect
6010           warnings and errors.
6011           a big and hard to understand patch.
6012         - it breaks iterators and causes regressions, for instance in
6013           test-iter-03.cs.      
6014
6015 2005-06-30  Raja R Harinath  <rharinath@novell.com>
6016
6017         Fix #75412.
6018         * expression.cs (Indexers.map): Remove.
6019         (Indexers.Append): Filter out inaccessible setters and getters.
6020         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
6021
6022         Fix #75283.
6023         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
6024         Refactored from ...
6025         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
6026         (FieldExpr.Emit, PropertyExpr.Emit): Update.
6027         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
6028         * expression.cs (Invocation.EmitCall): Add CS0120 check.
6029
6030 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
6031
6032         Fix #75322
6033         * class.cs (FieldBase.GetInitializerExpression): One more field
6034         for backup.
6035
6036 2005-06-28  Miguel de Icaza  <miguel@novell.com>
6037
6038         * pending.cs: Do not define a proxy if the base method is virtual,
6039         it will be picked up by the runtime (bug 75270).
6040
6041 2005-06-08  Martin Baulig  <martin@ximian.com>
6042
6043         The big Iterators rewrite :-)
6044
6045         * iterators.cs: Rewrite this to use the anonymous methods framework.
6046
6047         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
6048         before the TypeContainers; see 2test-21.cs.
6049
6050         * class.cs
6051         (TypeContainer.DefineType): Don't create a new EmitContext if we
6052         already have one (this only happens if we're an Iterator).
6053         (TypeContainer.Define): Also call Define() on all our iterators.
6054         (Method.CreateEmitContext): Added support for iterators.
6055
6056         * anonymous.cs
6057         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
6058         (AnonymousContainer.CreateMethodHost): Moved here from
6059         AnonymousMethod and made abstract.
6060         (AnonymousContainer.CreateScopeType): New abstract method.
6061         (AnonymousContainer.IsIterator): New public property.
6062         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
6063         get the ScopeTypeBuilder rather than manually defining it here. 
6064         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
6065         iterators here.
6066
6067         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
6068         before RootContext.DefineTypes().
6069
6070         * codegen.cs (EmitContext.RemapToProxy): Removed.
6071         (EmitContext.CurrentAnonymousMethod): Changed type from
6072         AnonymousMethod -> AnonymousContainer.
6073         (EmitContext.ResolveTopBlock): Protect from being called twice.
6074         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
6075         (EmitContext.EmitThis): Removed the iterators hacks; use the
6076         anonymous methods framework for that.
6077
6078         * statement.cs
6079         (ToplevelBlock.Container): Make this a property, not a field.
6080         (ToplevelBlock.ReParent): New public method; move the
6081         ToplevelBlock into a new container.
6082         (Foreach.TemporaryVariable): Simplify.
6083
6084 2005-06-05  Martin Baulig  <martin@ximian.com>
6085
6086         * statement.cs (LocalInfo.CompilerGenerated): New flag.
6087         (Block.AddTemporaryVariable): New public method; creates a new
6088         `LocalInfo' for a temporary variable.
6089         (Block.EmitMeta): Create the LocalBuilders for all the temporary
6090         variables here.
6091         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
6092         non-iterator variables.
6093
6094 2005-06-05  Martin Baulig  <martin@ximian.com>
6095
6096         * statement.cs (Foreach.TemporaryVariable): Create the
6097         LocalBuilder in the Emit phase and not in Resolve since in some
6098         situations, we don't have an ILGenerator during Resolve; see
6099         2test-19.cs for an example.
6100
6101 2005-06-04  Martin Baulig  <martin@ximian.com>
6102
6103         **** Merged r45395 from GCS ****
6104
6105         The big Foreach rewrite - Part II.
6106
6107         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
6108         with `PropertyInfo ienumerator_getcurrent'.
6109
6110         * codegen.cs (VariableStorage): Removed.
6111
6112         * statement.cs
6113         (Foreach): Derive from Statement, not ExceptionStatement.
6114         (Foreach.CollectionForeach): New nested class.  Moved all the code
6115         dealing with collection foreach here.
6116         (Foreach.ForeachHelperMethods): Removed.
6117         (Foreach.TemporaryVariable): Implement IMemoryLocation.
6118
6119 2005-05-23  Martin Baulig  <martin@ximian.com>
6120
6121         * statement.cs (Try.DoResolve): Don't create a `finally' if we
6122         don't need to.  Fix #75014.
6123
6124 2005-05-20  Martin Baulig  <martin@ximian.com>
6125
6126         Merged r44808 from GMCS.
6127
6128         * class.cs (TypeContainer.CircularDepException): Removed.
6129         (TypeContainer.DefineType): Removed the `InTransit' stuff.
6130         (TypeContainer.CheckRecursiveDefinition): Check for circular class
6131         (CS0146) and interface (CS0529) dependencies here.
6132
6133 2005-06-21  Raja R Harinath  <rharinath@novell.com>
6134
6135         * expression.cs (Invocation.EmitCall): Fix initialization
6136         'this_call' to reflect current behaviour.  Fix indentation.
6137
6138         * convert.cs (FindMostEncompassedType): Add two trivial special
6139         cases (number_of_types == 0 || number_of_types == 1).
6140         (FindMostEncompasingType): Likewise.
6141
6142 2005-06-17  Raja R Harinath  <rharinath@novell.com>
6143
6144         Some cleanups preparing for the fix of #75283.
6145         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
6146         error testing.
6147         (EventExpr.InstanceResolve): Likewise.
6148         (EventExpr.DoResolve): Remove redundant checks.
6149
6150 2005-06-10  Duncan Mak  <duncan@novell.com>
6151
6152         * cs-tokenizer.cs (process_directives): New flag for controlling
6153         the processing of preprocessor directives.
6154         (x_token): After seeing a '#', return Token.NONE instead of going
6155         to handle_preprocessing_directive() when not processing
6156         directives. This avoids unnecessary processing during the token peek in
6157         is_punct().
6158
6159         This fixes #74939.
6160
6161         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
6162         the existing error reporting methods instead of Report.Error.
6163
6164         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
6165         after Raja's rewrite.
6166
6167 2005-06-08  Miguel de Icaza  <miguel@novell.com>
6168
6169         * class.cs: Small fix.
6170
6171 2005-06-08  Raja R Harinath  <rharinath@novell.com>
6172
6173         Fix #75160.
6174         * class.cs (GetPartialBases): Fix return value check of
6175         part.GetClassBases.
6176
6177 2005-06-07  Raja R Harinath  <rharinath@novell.com>
6178
6179         Ensure that partial classes are registered in their enclosing
6180         namespace.  Initial part of fix of #75160.
6181         * tree.cs (Tree.RecordDecl): Add new namespace argument.
6182         Register declspace with namespace here, not in
6183         DeclSpace.RecordDecl.
6184         * cs-parser.jay: Pass namespace to RecordDecl.
6185         * class.cs (PartialContainer.Create): Likewise.
6186         (ClassPart.DefineType): New sanity-check.  Throws an exception if
6187         called.
6188         * decl.cs (Declspace.RecordDecl): Remove.
6189         * namespace.cs (NamespaceEntry.DefineName): Remove.
6190
6191 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
6192
6193         * rootcontext.cs: Reset TargetExt as well.
6194
6195 2005-06-03  Raja R Harinath  <rharinath@novell.com>
6196
6197         * ecore.cs (Expression.Resolve): Emit CS0654 error when
6198         -langversion:ISO-1.
6199
6200 2005-06-02  Raja R Harinath  <rharinath@novell.com>
6201
6202         Fix #75080, cs0119.cs.
6203         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
6204         of ...
6205         (Expression.Resolve): ... this.  Use it.  Remove bogus code
6206         allowing ExprClass.Type and ExprClass.Namespace for
6207         ResolveFlags.VariableOrValue.
6208         (Expression.Resolve) [1-argument variant]: Change default resolve
6209         flags based on language version.
6210         (Expression.Error_UnexpectedKind): Use a simple string array
6211         rather than an ArrayList.
6212         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
6213         not ExprClass.Type.
6214         (TypeOfVoid.DoResolve): Likewise.
6215         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
6216         flags argument -- it always has the same value.
6217
6218 2005-05-31  Raja R Harinath  <rharinath@novell.com>
6219
6220         Fix #75081.
6221         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
6222         Use it in the error message.
6223         * assign.cs, expression.cs, statement.cs: Update.
6224
6225 2005-05-30  Raja R Harinath  <rharinath@novell.com>
6226
6227         Fix #75088.
6228         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
6229         the "almostMatchedMember" case too.
6230         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
6231         that failed the accessibility checks to 'almost_match'.
6232
6233 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
6234
6235         * attribute.cs: Use internal MethodBuilder methods to set
6236         ExactSpelling and SetLastError on PInvoke methods, instead
6237         of passing them via charset.  Fixes #75060.
6238
6239 2005-05-27  Raja R Harinath  <rharinath@novell.com>
6240
6241         * parameter.cs (Parameter): Remove TODO comment.
6242         (Parameter.DefineParameter): Remove Location parameter.
6243         (Parameters.LabelParameters): Likewise.
6244         * class.cs (Constructor.Emit): Update to change.
6245         (MethodData.Emit): Likewise.
6246         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
6247         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
6248
6249 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
6250
6251         * parameter.cs,
6252           Removed Parameters.Location and added Parameter.Location instead.
6253           Removed Location parameter from Emit() and GetSignature().
6254         * anonymous.cs,
6255           class.cs,
6256           cs-parser.jay,
6257           delegate.cs,
6258           iterators.cs,
6259           statement.cs :
6260           Modified all related calls.
6261
6262 2005-05-26  Raja R Harinath  <rharinath@novell.com>
6263
6264         Improve user-defined conversion handling.
6265         * convert.cs (GetConversionOperators): Rewrite.  Return only the
6266         applicable operators.
6267         (AddConversionOperators): New.  Helper for GetConversionOperators.
6268         (FindMostEncompassedType, FindMostEncompassingType): Verify that
6269         there is only one most encompassed/encompassing type.
6270         (FindMostSpecificSource, FindMostSpecificTarget): Remove
6271         "applicable operator" handling.
6272         (UserConversion): Move cache here from GetConversionOperators.
6273         Directly cache the chosen operator, rather than the whole
6274         MethodGroup.
6275         (ExplicitNumericConversion): Fix buggy implementation of Decimal
6276         case.  Allow conversion of decimal to sbyte and byte too.
6277         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
6278         New static methods.  Used to avoid allocating EmptyExpressions in
6279         convert.cs.
6280
6281 2005-05-24  Duncan Mak  <duncan@novell.com>
6282
6283         * ecore.cs (CastFromDecimal): New class for casting a decimal to
6284         another class, used in Convert.ExplicitNumericConversion.
6285         (CastToDecimal): New class, similar to above, but casts to
6286         System.Decimal, used in Convert.ImplicitNumericConversion and also
6287         in explicit convesion from double/float to decimal.
6288
6289         * convert.cs (ImplicitNumericConversion): Handle implicit
6290         conversions to System.Decimal.
6291         (ExplicitNumericConversion): handle explicit conversions to
6292         System.Decimal.
6293
6294         This fixes #68711.
6295         
6296 2005-05-20  Miguel de Icaza  <miguel@novell.com>
6297
6298         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
6299         know the type at this stage, just break through.   Fixes #75008 
6300
6301 2005-05-19  Martin Baulig  <martin@ximian.com>
6302
6303         * delegate.cs
6304         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
6305         to disable error reporting.
6306
6307         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
6308         here since we don't want to report an error; see the new test-336.cs.
6309
6310 2005-05-19  Raja R Harinath  <rharinath@novell.com>
6311
6312         * statement.cs (ToplevelBlock.GetParameterReference)
6313         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
6314         Move here from class Block.
6315         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
6316         * expression.cs (ParameterReference.DoResolveBase): Likewise.
6317
6318 2005-05-18  Martin Baulig  <martin@ximian.com>
6319
6320         Fix #74978.
6321
6322         * flowanalysis.cs
6323         (FlowBranching.Reachability): Add non-static public And() and Or()
6324         methods.
6325         (FlowBranchingSwitch): New class; do the `break_origins' thing
6326         like in FlowBranchingLoop.
6327         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
6328         reachability, not just locals and parameters.
6329         (FlowBranching.MergeChild): Remove some of the hacks for loop and
6330         switch; MergeBreakOrigins() now takes care of that.
6331
6332 2005-05-18  Martin Baulig  <martin@ximian.com>
6333
6334         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6335         a loop and may leave it, reset the barrier; fixes #74974.
6336
6337 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
6338         
6339         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
6340         is back.
6341         
6342         * cs-parser.jay: Catch more lexical errors.
6343         
6344         * report.cs: Add one more Error method.
6345         
6346         * rootcontext.cs,
6347         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
6348
6349 2005-05-17  Martin Baulig  <martin@ximian.com>
6350
6351         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
6352         #70970. 
6353
6354 2005-05-16  Raja R Harinath  <rharinath@novell.com>
6355
6356         Fix test-382.cs.  Emit values of decimal constants.
6357         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
6358         Carved out of ...
6359         (TypeContainer.AddField): ... this.
6360         (TypeContainer.EmitFieldInitializers): Allow the list of fields
6361         with initializers to include 'Const's.
6362         (ClassPart.RegisterFieldForInitialization): Forward to
6363         PartialContainer.
6364         * const.cs (Const.Const): Pass initializer to base class.
6365         (Const.Define): In case of decimal constants, register them for
6366         initialization in a static constructor.
6367
6368 2005-05-14  Martin Baulig  <martin@ximian.com>
6369
6370         * statement.cs (Block.Resolve): Correctly handle unreachable code;
6371         do not call ResolveUnreachable() on unreachable statements in
6372         here, see the comment in the source code.
6373
6374 2005-05-13  Raja R Harinath  <rharinath@novell.com>
6375
6376         Fix #74934.
6377         * expression.cs (BinaryResolveOperator): If one of the operands of
6378         an equality comparison is 'null' and the other is a pointer type,
6379         convert the null to a NullPointer.
6380         * convert.cs (ImplicitReferenceConversion): If the expression is a
6381         NullLiteral and the target type is a pointer type, return a
6382         NullPointer instead.
6383         (ImplicitConversionStandard): Likewise.
6384
6385 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
6386         
6387         * cs-parser.jay: Set readonly context based on special constructs.
6388         
6389         * expression.cs (LocalVariableReference.DoResolveBase): Improved
6390         readonly variable error handling.
6391         
6392         * rootcontext.cs (EmitCode): Don't verify members when error
6393         occurred.
6394         
6395         * statement.cs (LocalInfo): Add reaodnly context information.
6396         (SetReadOnlyContext, GetReadOnlyContext): New methods.
6397
6398 2005-05-13  Raja R Harinath  <rharinath@novell.com>
6399
6400         * statement.cs (Block.Resolve): Revert change below.  Modify fix
6401         for #74041 to initialize 'resolved' to false only for explicit
6402         blocks.  Fixes #74873.
6403
6404 2005-05-12  Raja R Harinath  <harinath@gmail.com>
6405
6406         Fix #74920.
6407         * typemanager.cs (unmanaged_enclosing_types): New.
6408         (IsUnmanagedType): Avoid infloops by using
6409         'unmanaged_enclosing_types' to talk with recursive invocations.
6410
6411 2005-05-13  Martin Baulig  <martin@ximian.com>
6412
6413         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
6414         instance variable, not a local.  Fix #74873.
6415         (Block.ResolveUnreachable): Set it to true here.
6416
6417 2005-05-11  Duncan Mak  <duncan@novell.com>
6418
6419         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
6420         continuing to process for 'arg'.
6421         (handle_preprocessing_directive): Check the argument of the #endif
6422         directive and report error CS1025 if there are any trailing
6423         characters.
6424
6425         According to the C# spec, having even whitespace after the #endif
6426         directive is illegal; however, because we call arg.TrimEnd ()
6427         beforehand, we have the same behavior as csc, allowing whitespace
6428         after the directive.
6429
6430         Fixes #74892.
6431
6432 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
6433
6434         Fix #74863.
6435         
6436         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
6437         (Constructor.GetObsoleteAttribute): Implemented correctly.
6438
6439 2005-05-10  Martin Baulig  <martin@ximian.com>
6440
6441         * support.cs (ReflectionParameters.ParameterModifier): Use
6442         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
6443         and `ParameterAttributes.In'.  Fixes #74884.
6444
6445 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
6446
6447         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
6448         
6449         * expression.cs (Argument.GetParameterModifier): Turned to property.
6450         (Invocation.Error_InvalidArguments): Add more descriptive errors.
6451         
6452         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
6453         its C# equivalent.
6454         
6455 2005-05-09  Raja R Harinath  <rharinath@novell.com>
6456
6457         Fix #74852.
6458         * decl.cs (MemberCache.AddMethods): Register override methods,
6459         rather than non-override methods.
6460         * typemanager.cs (RegisterOverride): New.
6461         (IsOverride): Update.
6462
6463 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
6464
6465         Fix #73105.
6466         
6467         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
6468         recursive declaration.
6469         
6470         * statement.cs (Block.ResolveMeta): Report any error in resolving.
6471         
6472 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
6473
6474         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
6475         
6476         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
6477
6478 2005-05-05  Raja R Harinath  <rharinath@novell.com>
6479
6480         Fix #74797.
6481         * decl.cs (DeclSpace.FamilyAccessible): 
6482         Use TypeManager.IsNestedFamilyAccessible.
6483
6484         Fix reopened #64812.
6485         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
6486         internal'.
6487
6488 2005-05-04  Raja R Harinath  <rharinath@novell.com>
6489             Abin Thomas  <projectmonokochi@rediffmail.com>
6490             Anoob V E  <projectmonokochi@rediffmail.com>
6491             Harilal P R  <projectmonokochi@rediffmail.com>
6492
6493         Fix #64812.
6494         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
6495         allow access to all static members.
6496
6497 2005-05-04  Martin Baulig  <martin@ximian.com>
6498
6499         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
6500
6501 2005-05-04  Martin Baulig  <martin@ximian.com>
6502
6503         Fix #74655.
6504
6505         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
6506         section at the end; make things work if `default' is not the last
6507         section.        
6508
6509 2005-05-04  Martin Baulig  <martin@ximian.com>
6510
6511         Fix #70400.
6512
6513         * statement.cs (Switch): Replaced the `got_default' field with a
6514         `default_section' one.
6515         (Switch.CheckSwitch): Set `default_section' here.
6516         (Switch.Resolve): If we're a constant switch and the constant is
6517         not found, use the default section.
6518
6519 2005-05-03  Martin Baulig  <martin@ximian.com>
6520
6521         * expression.cs (ArrayAccess.EmitGetLength): New public method.
6522
6523         * statement.cs (Foreach.ArrayForeach): New nested class.
6524         (Foreach.TemporaryVariable): New nested class.
6525         (Foreach.EmitArrayForeach): Removed; this is now in the new
6526         ArrayForeach class.
6527
6528 2005-05-03  Raja R Harinath  <rharinath@novell.com>
6529
6530         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
6531         more conservative.
6532         (VerifyPendingMethods): Revert change below.
6533
6534         * typemanager.cs (IsOverride, RegisterNonOverride): New.
6535         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
6536         that used to trigger warning -28.  Remove warning -28.
6537         * expression.cs (Invocation.OverloadResolve): Use
6538         TypeManager.IsOverride to distinguish override methods.
6539
6540         Fix #74773.
6541         * pending.cs (VerifyPendingMethods): If a base type implements the
6542         requested interface, don't bother checking individual methods of
6543         the base type.  As a side-effect, this prevents the creation of
6544         unnecessary proxies.
6545
6546 2005-05-02  Martin Baulig  <martin@ximian.com>
6547
6548         Fix #70182.
6549
6550         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
6551         Also `And' the locals if the old vector is null.
6552         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
6553         null; in this case we basically reset all the variables.        
6554
6555 2005-05-02  Martin Baulig  <martin@ximian.com>
6556
6557         Fix #74529.
6558
6559         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
6560         Added `FlowBranching branching' argument; always `and' the
6561         variables instead of `or'ing them unless we're an infinite loop.
6562
6563         * statement.cs (While.Resolve): Create a new sibling unless we're
6564         infinite.       
6565
6566 2005-05-02  Martin Baulig  <martin@ximian.com>
6567
6568         Fix #70140.
6569
6570         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
6571         arguments; use it instead of creating a new TopLevelBlock.
6572         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
6573         our ConstructorInitializer.
6574
6575         * statement.cs
6576         (TopLevelBlock.TopLevelBranching): New public property.
6577         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
6578         and create our `TopLevelBranching'.
6579
6580         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
6581         anonymous method host, use `block.TopLevelBranching' rather than
6582         creating a new branching.
6583
6584 2005-04-20  Miguel de Icaza  <miguel@novell.com>
6585
6586         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
6587         a ScopeInfo, if any of the current children is a child of the new
6588         entry, move those children there.
6589
6590 2005-04-30  Martin Baulig  <martin@ximian.com>
6591
6592         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
6593         at the beginning of a SwitchSection.  Fix #73335.
6594
6595 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
6596
6597         Fix #74378
6598         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
6599         
6600         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
6601         (FieldExpr.DoResolve): Obsolete members are ignored for field
6602         initializers.
6603         
6604 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
6605
6606         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
6607         of arrays detection.
6608
6609         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
6610         verification.
6611         (Field.VerifyClsCompliance): Volatile fields are not compliant.
6612
6613         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
6614         arrays report.
6615
6616 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
6617
6618         * cs-parser.jay: Use the prefered version of -unsafe in error
6619         message.
6620
6621 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
6622
6623         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
6624         circumstances.
6625
6626 2005-04-20  John Luke  <john.luke@gmail.com>
6627
6628         * driver.cs: fix typo in error message, --outout to --output
6629
6630 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
6631
6632         * codegen.cs (InRefOutArgumentResolving): New field.
6633         
6634         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
6635         fields outside contructor.
6636         
6637         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
6638         
6639 2005-04-19  Miguel de Icaza  <miguel@novell.com>
6640
6641         * anonymous.cs (CaptureContext.EmitParameterInstance): The
6642         parameter code was not completed ever, so it was not as up-to-date
6643         as local variables.  Must finish it.
6644
6645         The bug fix was to compare the Toplevel of the block, not the
6646         current block.  Thanks for Ben for pointing this out. 
6647
6648 2005-04-19  Raja R Harinath  <rharinath@novell.com>
6649
6650         * decl.cs (AddMethods): Use the declaring type of the problem
6651         method to determine if we want to squash a warning.
6652
6653 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
6654
6655         * attribute.cs: Removed debug output.
6656
6657         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
6658         
6659         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
6660         Report.Stderr.
6661         
6662 2005-04-18  Raja R Harinath  <rharinath@novell.com>
6663
6664         Fix #74481.
6665         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
6666         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
6667         all null comparisons against reference types.
6668
6669 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
6670
6671         Fix# 74565
6672         * class.cs (TypeContainer.CircularDepException) New nested
6673         exception class.
6674         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
6675         (TypeContainer.DefineType): Removed error, reset InTransit before
6676         exit.
6677         (Class.DefineType): Throw exception when is in Transit.
6678         Catch exception and report error.
6679         (Struct.DefineType): Throw exception when is in Transit.
6680         Catch exception and report error.
6681         (Interface.DefineType): Throw exception when is in Transit.
6682         Catch exception and report error.
6683
6684         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
6685         handle nested exception handlers.
6686
6687         * flowanalysis.cs (InTryWithCatch): New method, search for try with
6688         a catch.
6689
6690         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
6691         InFinally and InCatch storage.
6692
6693         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
6694         (Catch.Resolve): Set and Restore ec.InCatch.
6695         (Try.Resolve): Set and Restore ec.InFinally.
6696         (Try.HasCatch): True when try has catch.
6697
6698 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
6699
6700         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
6701           for the same event member, so exclude such cases from warning 419.
6702           Fixed bug #74633.
6703
6704 2005-04-16  Miguel de Icaza  <miguel@novell.com>
6705
6706         * expression.cs (Binary.ResolveOperator): Apply patch from John
6707         Luke to fix bug 59864: operators &, | and ^ on enumerations
6708         require that the same enum type on both sides.
6709
6710         * driver.cs: Add warnings to old flag usage, this is to assist
6711         people who produce Makefiles and hope that the Makefiles will be
6712         used on Windows.
6713
6714         * class.cs (TypeContainer.EmitType): Moved the definition of the
6715         special $PRIVATE$ field from the resolve phase to the Emit phase.
6716         During resolve we do not know if we are a struct with
6717         HasExplicitLayout, we know this only after the attributes for the
6718         type are emitted.
6719
6720         Set the FieldOffset to zero on the dummy field that we create for
6721         the class.   Fixes 74590.
6722
6723 2005-04-16  Raja R Harinath  <rharinath@novell.com>
6724
6725         Fix #73834.
6726         * ecore.cs (PropertyExpr.resolved): New.
6727         (DoResolve): Use it to handle a case of double resolution here.
6728         Handle a case of identical-name-and-type-name.
6729         * expression.cs (ArrayCreation.CheckIndices): Avoid double
6730         resolution by storing the results of expression resolution back
6731         into the "probes" array.
6732
6733 2005-04-15  Raja R Harinath  <rharinath@novell.com>
6734
6735         Fix cs0208-7.cs and cs0208-8.cs.
6736         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
6737         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
6738         error reporting to point out the reason a struct is not unmanaged.
6739
6740 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
6741
6742         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
6743           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
6744
6745 2005-04-13  Raja R Harinath  <rharinath@novell.com>
6746
6747         Fix #74528.
6748         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
6749         IdenticalNameAndTypeName here.
6750         (EventExpr.InstanceResolve): Likewise.
6751
6752 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
6753
6754         C# 2.0 DefaultCharSetAttribute implementation
6755         
6756         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
6757         which allows us to set GlobalNamespace for every resolve.
6758         (Attribute.ResolveArguments): Cut from Resolve.
6759         (Attribute.GetCharSetValue): Returns CharSet named argument.
6760         (Attribute.DefinePInvokeMethod): Gets default charset from
6761         module settings.
6762         (GlobalAttribute.ResolveAsTypeStep): Override.
6763         (GlobalAttribute.ResolveArguments): Override.
6764         
6765         * class.cs (TypeAttr): Is protected.
6766         
6767         * codegen.cs (ModuleClass.DefaultCharSet): New member.
6768         (ModuleClass.DefaultCharSetType): New memeber.
6769         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
6770         
6771         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
6772         charset from module.
6773         
6774         * delegate.cs (TypeAttr): Override.
6775         (Delegate.DefineType): Use this TypeAttr.
6776         
6777         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
6778         at very early stage (before types are defined) to resolve model
6779         module attributes. It will probably not work with corlib but it
6780         should be ok.
6781         
6782         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
6783         charset from module.
6784         
6785         * typemanager.cs (default_charset_type): New type.
6786
6787 2005-04-13  Raja R Harinath  <rharinath@novell.com>
6788
6789         * decl.cs (MemberCache.AddMethods): Don't warn if
6790         System.Object.Finalize has buggy MethodAttributes.
6791
6792         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
6793         removed below.
6794
6795 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
6796
6797         * doc.cs : detect ambiguous reference to overloaded members.
6798           Fixed bug #71603. MS 1.1 csc does not detect it.
6799
6800 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
6801
6802         * doc.cs : delegates must not be referenced with parameters.
6803           Fixed bug #71605.
6804
6805 2005-04-12  Miguel de Icaza  <miguel@novell.com>
6806
6807         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
6808
6809 2005-04-10  Miguel de Icaza  <miguel@novell.com>
6810
6811         * driver.cs (MainDriver): Stop processing if the CLS stage found
6812         errors. 
6813
6814         (CompilerCallableEntryPoint.InvokeCompiler): Always
6815         reset after execution;   Take a TextWriter argument for the
6816         output.
6817
6818         * report.cs: Use the error stream instead of hardcoding stderr. 
6819
6820 2005-04-09  Miguel de Icaza  <miguel@novell.com>
6821
6822         * class.cs: Reduce code paths to test, too small of an
6823         optimization to make it worth the extra testing.  Always perform
6824         it. 
6825
6826 2005-04-08  Raja R Harinath  <rharinath@novell.com>
6827
6828         Fix #74510.
6829         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
6830         operators that had errors reported on them.
6831
6832 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
6833
6834         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
6835         argument types.
6836         (Attribute.Resolve): Add named argument type checking.
6837         
6838         * class.cs (FixedField.Define): Use IsPrimitiveType
6839         
6840         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
6841         
6842         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
6843         unsafe parameter types.
6844         
6845         * statement.cs (Using.ResolveExpression): Add better error description.
6846         
6847         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
6848         
6849 2005-04-08  Raja R Harinath  <rharinath@novell.com>
6850
6851         Fix #74484.
6852         * attribute.cs (Attribute.GetAttributeUsage): Resolve
6853         AttributeUsageAttribute in the emitcontext of the attribute class,
6854         not in the emitcontext of the attributable entity it was attached to.
6855         * cs-parser.jay: Use 'current_class', not 'current_container',
6856         when creating a GlobalAttribute.
6857
6858 2005-04-08  Alp Toker  <alp@atoker.com>
6859
6860         * pending.cs: The fix to #58413 failed to compile methods implementing
6861         interfaces with/without params modifiers and vice versa, even though
6862         params modifiers aren't part of the signature. Make the modifier check
6863         less strict as in csc.
6864
6865 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
6866             Anoob V E  <projectmonokochi@rediffmail.com>
6867             Harilal P R  <projectmonokochi@rediffmail.com>
6868
6869         Fix #58413.
6870         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
6871         modifiers of pending methods.
6872         (PendingImplementation.PendingImplementation): Initialize it.
6873         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
6874         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
6875         with ParameterData.  Add check for modifiers.
6876         * class.cs (MethodData.Define): Update to changes.
6877
6878 2005-04-07  Raja R Harinath  <rharinath@novell.com>
6879
6880         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
6881
6882 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
6883
6884         * class.cs (PropertyMethod.Define): Check private accessor in abstract
6885         property.
6886         
6887         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
6888         
6889         * rootcontext.cs,
6890         * typemanager.cs: Registered RequiredAttributeAttribute.
6891         
6892 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
6893
6894         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
6895         Warning CS0169 is back at level 3.
6896         (IMethodData.SetMemberIsUsed): New method.
6897         
6898         * decl.cs (IsUsed): New value; moved from FieldBase.Status
6899         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
6900         
6901         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
6902
6903         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
6904         contants.
6905         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
6906         is used.
6907         
6908         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
6909         is used.
6910         
6911         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
6912         to avoid the problems with nested types.
6913
6914 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
6915             Anoob V.E  <projectmonokochi@rediffmail.com>
6916             Harilal P.R  <projectmonokochi@rediffmail.com>
6917             Raja R Harinath  <rharinath@novell.com>
6918
6919         Fix #73820.
6920         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
6921         attribute.
6922         * typemanager (GetConstructor): Make public.
6923
6924 2005-04-05  John Luke  <john.luke@gmail.com>
6925             Raja R Harinath  <rharinath@novell.com>
6926
6927         Fix #62232.
6928         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
6929         struct too.  Return false quicker in a few cases.
6930         (VerifyUnManaged): Use it.
6931
6932 2005-04-05  Raja R Harinath  <rharinath@novell.com>
6933
6934         Fix #74041.
6935         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
6936         not 'unreachable_seen'.
6937
6938 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
6939
6940         * attribute.cs (Attribute.GetValue): Removed unused.
6941         
6942         * codegen.cs (CodeGen.TrimExt): Removed unused.
6943         
6944         * cs-parser.jay (output): Removed unused.
6945         
6946         * cs-tokenizer.cs (hex_digits): Removed unused.
6947         
6948         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
6949         
6950         * expression.cs (Indirection.LoadExprValue): Removed unused.
6951         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
6952         
6953         * iterators.cs (Iterator.param_types): Removed unused.
6954         
6955         * statement.cs (Goto.block): Removed unused.
6956         (ToplevelBlock.did): Removed unused.
6957         (Switch.ResolveConstantSwitch): Removed unused.
6958
6959 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
6960
6961         * rootcontext.cs: Allow mcs to bootstrap with the compilation
6962         resetting thingy.
6963
6964 2005-04-01  Raja R Harinath  <rharinath@novell.com>
6965
6966         Fix #74232 and cs0208-3.cs.
6967         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
6968         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
6969         unmanaged type.  Don't use FieldBuilders when 't' is a
6970         TypeBuilder.  Use ModFlags and MemberType fields.
6971         * class.cs (MemberBase.member_type): Rename from MemberType.
6972         (MemberBase.MemberType): New property.  Determines member_type on
6973         demand.
6974         (MemberBase.DoDefine): Don't initialize MemberType here.
6975         (FieldMember.Define): Likewise.
6976
6977 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
6978
6979         Fix #74241
6980         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
6981         Attributes are emitted there.
6982         
6983 2005-04-01  Raja R Harinath  <rharinath@novell.com>
6984
6985         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
6986         keyword in 'partial enum' too.
6987         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
6988         is not allowed).
6989         Report from Kamil Skalski <nazgul@omega.pl>.
6990
6991         Fix #74309.
6992         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
6993         have partial containers too.
6994
6995         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
6996         in block' checks to Block.CheckInvariantMeaningInBlock.
6997         * statement.cs (Block.GetKnownVariableInfo): Make private.
6998         (Block.IsVariableUsedInChildBlock): Remove.
6999         (Block.IsVariableUsedInBlock): Likewise.
7000         (Block.CheckInvariantMeaningInBlock): New.  Show location of
7001         conflicting declaration.
7002         (Block.AddVariable): Make error messages less long-winded and more
7003         specific.  Show location of conflicting declaration.
7004         * parameter.cs (Parameters.Location): New readonly property.
7005
7006 2005-03-31  Raja R Harinath  <rharinath@novell.com>
7007
7008         Clean up semantics of invoking ResolveMemberAccess.
7009         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
7010         can have an instance, ensure that we pass in a non-TypeExpression
7011         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
7012         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
7013         argument.  Update to changes and simplify.
7014         (FieldExpr.Emitinstance): Remove CS0120 check.
7015         (PropertyExpr.EmitInstance): Likewise.
7016         * expression.cs (Argument.Resolve): Likewise.
7017         (Invocation.DoResolve): Update to changes in semantics of
7018         InstanceExpression.
7019
7020 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
7021
7022         Fix #74241
7023         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
7024         customization.
7025         
7026         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
7027
7028 2005-03-31  Raja R Harinath  <rharinath@novell.com>
7029
7030         Fix difference in behaviour with commandline invocation.
7031         * driver.cs (Driver.Reset): New.
7032         (CompilerCallableEntryPoint): Call it.
7033
7034         * statement.cs (If.Resolve): Avoid spurious "uninitialized
7035         variable" warnings if the boolean expression failed to resolve.
7036
7037 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
7038
7039         * attribute.cs: Fix the union of several permissions when some of them
7040         are unrestricted (so the result isn't an unrestricted permission set).
7041         Fix #74036.
7042
7043 2005-03-30  Raja R Harinath  <rharinath@novell.com>
7044
7045         * ecore.cs (MemberExpr): New class.  Convert from interface
7046         IMemberExpr.
7047         (MemberExpr.ResolveMemberAccess): Refactor and move here from
7048         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
7049         error checks.
7050         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
7051         (MethodGroupExpr.IsExplicitImpl): Remove.
7052         (Expression.GetFieldFromEvent): Remove.
7053         (SimpleName.MemberStaticCheck): Remove.
7054         (SimpleName.DoSimpleNameResolve): Update to changes.
7055         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
7056         (MemberAccess.IdenticalNameAndTypeName): Remove.
7057         (MemberAccess.error176): Move to MemberExpr.
7058         (MemberAccess.DoResolve): Update to changes.
7059         (BaseAccess.DoResolve): Likewise.
7060
7061 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
7062
7063         C# 2.0 Conditional attribute class implementation
7064         
7065         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
7066         Analyzes class whether it has attribute which has ConditionalAttribute
7067         and its condition is not defined.
7068         
7069         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
7070         (Class.IsExcluded): New method. Search for at least one defined
7071         condition in ConditionalAttribute of attribute class.
7072
7073 2005-03-30  Raja R Harinath  <rharinath@novell.com>
7074
7075         * ecore.cs (PropertyExpr): Derive from Expression, not
7076         ExpressionStatement.
7077         (PropertyExpr.EmitStatement): Remove.
7078
7079 2005-03-29  Raja R Harinath  <rharinath@novell.com>
7080
7081         Fix #74060.
7082         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
7083         internal field "value__" of an enum be private.  The examples for
7084         "value__" that I found on MSDN all used FieldAttributes.Private.
7085
7086         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
7087         Don't mention IL method attribute names.
7088
7089         Fix #47991.  Remove a TODO.
7090         * statement.cs (Block.Toplevel): Make into a field.
7091         (Block.Parameters): Move into ToplevelBlock.
7092         (Block.known_variables): Rename from child_variable_names.
7093         (Block.Block): Remove variants that take Parameters.  Initialize
7094         'Toplevel' with the immediately surrounding toplevel block.
7095         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
7096         LocalInfo parameter.
7097         (Block.GetKnownVariableInfo): New.
7098         (Block.IsVariableNameUsedInChildBlock): Update.
7099         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
7100         the block, even though it may not be in scope.
7101         (Block.AddVariable): Remove Parameters parameter.  Use
7102         Toplevel.Parameters instead.
7103         (Block.AddConstant): Remove Parameters parameter.
7104         (Block.GetParameterReference): Update to use Toplevel.Parameters.
7105         (Block.IsParamaterReference): Likewise.
7106         (Block.IsLocalParameter): Likewise.  Simplify a lot.
7107         (ToplevelBlock.Parameters): New.  Moved from Block.
7108         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
7109         initialize Parameters to a non-null value.
7110         * cs-parser.jay: Update to changes.
7111         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
7112         simple names that mean different things in the same block.  Use
7113         Block.IsVariableNameUsedInBlock.
7114
7115 2005-03-28  Raja R Harinath  <rharinath@novell.com>
7116
7117         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
7118         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
7119         GetTypeHandle.  It is possible for a reflected type to derive from
7120         a TypeBuilder (e.g., int[] derives from the TypeBuilder
7121         System.Array during mscorlib compilation).
7122         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
7123         contain a method_hash, don't create one either.  Don't create a
7124         deep copy of the base cache's method_hash.
7125         (MemberCache.SetupCache): Rename back from DeepCopy.
7126         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
7127         already initialized.  If we see an override function, add its
7128         underlying base virtual function to the member_hash too.
7129
7130         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
7131
7132 2005-03-26  Raja R Harinath  <harinath@acm.org>
7133
7134         Fix #73038.
7135         * assign.cs (Assign.DoResolve): When the RHS of an assignment
7136         fails to resolve, ensure that the LHS is still resolved as an
7137         lvalue.
7138
7139 2005-03-25  Raja R Harinath  <harinath@acm.org>
7140
7141         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
7142         ec.ContainerType.
7143         (Enum.current_ec): Remove.
7144         (Enum.LookupEnumValue): Remove EmitContext argument.
7145         Just uses the one created during DefineType.
7146         (Enum.FindMembers): Update.
7147         * expression.cs (MemberAccess.DoResolve): Update.
7148
7149 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
7150
7151         * assign.cs (Assign.DoResolve): Check for CS1717 when
7152         source and target are same (uses Equals).
7153
7154         * expression.cs (LocalVariableReference, ParameterReference,
7155         This): Implemented Equals, GetHashCode.
7156
7157         * statement.cs (Block.GetParameterReference): Removed useless
7158         local variable.
7159
7160 2005-03-22  Raja R Harinath  <rharinath@novell.com>
7161
7162         Fix cs0128.cs
7163         * statement.cs (Block.AddVariable): Ensure that we skip implicit
7164         blocks before deciding whether the error is cs0136 or cs0128.
7165
7166         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
7167         (using_alias_directive, using_namespace_directive): Pass
7168         MemberName, not an expression to Namespace.UsingAlias and
7169         Namespace.Using.
7170         (MakeName): Use the MemberName of the namespace.
7171         * namespace.cs (Namespace.MemberName): New.
7172         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
7173         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
7174         Likewise.
7175         * decl.cs (MemberName.Name): Make readonly.
7176         (MemberName.FromDotted): New "constructor".
7177         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
7178         (MemberCore.Name): Compute from MemberName on demand.
7179         (MemberCore.SetMemberName): Provide a way to change the
7180         MemberName.
7181         (MemberCore.AddToContainer): Don't take a fullname parameter.
7182         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
7183         fully qualified name of the container to the member name.
7184         (TypeContainer.AddToTypeContainer): Use a fully qualified name
7185         only if the type is a member of the root container.
7186         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
7187         MemberName.Left rather than searching for an embedded ".".
7188         (PartialContainer.CreatePart): Update to changes in RootContext.
7189         (MemberBase.ShortName): Turn into a property.  Use
7190         MemberCore.SetMemberName.
7191         (MemberBase.ExplicitInterfaceName): Remove.
7192         (MemberBase.UpdateMemberName): Remove.
7193         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
7194         (PropertyBase.SetMemberName): New override.
7195         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
7196         (Tree.GetDecl): New.
7197         (Tree.AllDecls): Rename from Decls.
7198         * attribute.cs, enum.cs, report.cs: Update to changes.
7199         * driver.cs (MainDriver): Use MemberName.FromDotted on
7200         RootContext.MainClass.
7201
7202 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
7203
7204         * class.cs (FixedField.Define): Check for CS1664 and more sanity
7205         checks.
7206
7207         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
7208
7209 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
7210
7211         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
7212         property accessor modifiers.
7213
7214         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
7215         fixed buffer attribute (CS1716).
7216         (PropertyMethod.HasCustomAccessModifier): When property accessor
7217         has custom modifier.
7218
7219         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
7220         modifiers.
7221         (PropertyExpr.DoResolveLValue): Add CS0272.
7222
7223 2005-03-17  Miguel de Icaza  <miguel@novell.com>
7224
7225         * convert.cs: When converting to a pointer, use the proper Conv.U
7226         or Conv.I depending on the source data type.
7227
7228         * cs-tokenizer.cs: Make the size for large decimal constants,
7229         fixes #72957.
7230
7231 2005-03-17  Martin Baulig  <martin@ximian.com>
7232
7233         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
7234         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
7235
7236 2005-03-17  Martin Baulig  <martin@ximian.com>
7237
7238         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
7239         to bool so we can return an error condition.
7240         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
7241         returned an error.
7242
7243 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
7244
7245         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
7246         attributes.
7247
7248 2005-03-16  Raja R Harinath  <rharinath@novell.com>
7249
7250         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
7251         Refactor to avoid traversing the list of assemblies, and to avoid
7252         string concatenation.
7253         * typemanager.cs (guid_attr_type): Remove.
7254         (negative_hits, pointers, references): Remove hashes.
7255         (type_hash): New.
7256         (GetConstructedType): New.  Uses type_hash to handle constructed
7257         types (arrays, references, pointers).
7258         (GetReferenceType, GetPointerType): Use it.
7259         (GetNestedType): New.  Uses type_hash to handle nested types of
7260         reflected types.
7261         (LookupType, LookupTypeDirect): Remove.
7262         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
7263         'types' hash and LookupTypeReflection directly.
7264         (params_string, params_object): Use GetConstructedType.
7265         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
7266         top-level types.
7267         (Namespace.Lookup): Use cached_types.
7268         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
7269         provided by old TypeManager.LookupType.
7270         * rootcontext.cs (MakeFQN): Remove.
7271         * decl.cs (DeclSpace.MakeFQN): Likewise.
7272         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
7273         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
7274         TypeManager.GetConstructedType.
7275         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
7276
7277 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
7278
7279         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
7280         indexers.
7281
7282         * cs-parser.jay: Reports CS1527 for any namespace element.
7283
7284         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
7285         Added CS0407.
7286
7287         * expression.cs (ParameterReference.IsAssigned): Changed error to
7288         CS0269.
7289         (Error_WrongNumArguments): Moved CS0245 detection here.
7290
7291         * statement.cs (Return.Resolve): Add CS1622 report.
7292
7293 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
7294
7295         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
7296
7297 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
7298
7299         * attribute.cs expression.cs: Get rid of some allocations.
7300
7301 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
7302
7303         * doc.cs : just eliminate the latest change.
7304
7305 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
7306
7307         * doc.cs : commented out the latest change. It breaks xml-030.cs
7308
7309 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
7310
7311         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
7312           fail. So invoke CreateType() in FindDocumentedType().
7313
7314 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
7315
7316         * cs-tokenizer.cs : added IsKeyword().
7317         * doc.cs : Detect keyword incorrectly used as identifier.
7318           Allow identifiers prefixed by @.
7319
7320 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
7321
7322         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
7323         It caused exception in namespace resolving (again!).
7324         
7325         * class.cs (Class.ctor): Removed exit.
7326         (PropertyMethod.ctor): ditto.
7327         
7328         * codegen.cs (Codegen.Reset): Reset static data.
7329         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
7330         
7331         * cs-tokenizer.cs (Cleanup): Removed.
7332         
7333         * driver.cs (GetSystemDir): Rewrote to one line command.
7334         It caused problem with unloaded dynamic modules.
7335         (UnixParseOption): Removed Exit.
7336         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
7337         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
7338         Now can be mcs used as library.
7339         
7340         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
7341         empty location.
7342         
7343         * location.cs (Reset): Reset static data.
7344         
7345         * namespace.cs (Reset): Reset static data.
7346         
7347         * report.cs (Report.Reset): Reset static data.
7348         
7349         * rootcontext.cs (RootContext.Reset): Reset static data.
7350         
7351         * tree.cs (RootTypes.ctor): Use Location.Null
7352         
7353         * typemanager.cs (TypeManager.Reset): Reset static data.
7354         (CoreLookupType): Removed Exit.
7355         (TypeHandle.Reset): Reset static data.
7356         
7357 2005-03-10  Raja R Harinath  <rharinath@novell.com>
7358
7359         Fix #73516.
7360         * typemanager.cs (ComputeNamespaces): Import namespaces from
7361         referenced modules too.
7362
7363 2005-03-09  Raja R Harinath  <rharinath@novell.com>
7364
7365         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
7366         than '.'.
7367
7368 2005-03-09  Raja R Harinath  <rharinath@novell.com>
7369
7370         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
7371         enclosing DeclSpace.  This ensures that a name-lookup populates
7372         more caches and there are fewer 'TypeExpression's.  Carve out
7373         nested type lookup into ...
7374         (LookupNestedTypeInHierarchy): ... this.
7375
7376 2005-03-09  Raja R Harinath  <rharinath@novell.com>
7377
7378         Clean up a few partial-class semantics.  
7379         Fixes test-357.cs and cs1618-2.cs.
7380         * cs-parser.jay (struct_declaration): Use 'current_class' as
7381         parent of newly-created struct.  Remove call to Register ().
7382         Use 'pop_current_class' to complete handing the current struct.
7383         (interface_declaration): Likewise.
7384         (class_declaration): Likewise.
7385         (enum_declaration): Use 'current_class' as parent of newly created
7386         enum.
7387         (delegate_declaration): Likewise.
7388         (pop_current_class): New function.  This is used to handle closing
7389         up the 'current_class' and 'current_container', and pointing them
7390         to the enclosing class/container.
7391         (CSharpParser): Initialize 'current_class' too.
7392         * decl.cs (MemberCore): Add check for invariant: a partial
7393         container is not a parsed entity, and thus does not enclose any
7394         parsed members.
7395         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
7396         (DeclSpace.BaseTypeExpr): Use it.
7397         (DeclSpace.LookupType): Add check for invariant.
7398         * class.cs (TypeContainer): Add check for invariant: a nested
7399         class should have the same NamespaceEntry as its enclosing class.
7400         (TypeContainer.EmitFieldInitializers): Make virtual.
7401         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
7402         MemberCore.
7403         (TypeContainer.Register): Remove.
7404         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
7405         null.  Use TypeResolveEmitContext for resolving base types and
7406         interfaces.  Move initialization of Parts.TypeBuilder here from
7407         ...
7408         (TypeContainer.DefineNestedTypes): ... here.
7409         (PartialContainer): Take a Namespace not a NamespaceEntry.
7410         (PartialContainer.Create): Don't use Register.  Call the
7411         appropriate Add... function directly.
7412         (ClassPart): Take both the PartialContainer and the enclosing
7413         class as constructor arguments.
7414         (ClassPart.EmitFieldInitializers): Override.
7415         (ClassPart.PartFindNestedTypes): Remove.
7416         (FieldBase.GetInitializerExpression): Resolve the initializer
7417         expression in the emit context of the enclosing class.
7418         * tree.cs (RootTypes): Remove Register ().
7419         
7420 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
7421
7422         * cs-parser.jay: Removed CS0134.
7423         
7424         * driver.cs: Removed CS1901.
7425         
7426         * expression.cs (SizeOf.DoResolve): Don't report CS0233
7427         for predefined types.
7428
7429 2005-03-07  Duncan Mak  <duncan@novell.com>
7430
7431         * codegen.cs (Save):  Catch UnauthorizedAccessException as
7432         well. Fixes bug #73454.
7433
7434 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
7435
7436         * cs-tokenizer.cs (xtoken): Add CS1035.
7437         
7438         * class.cs (MethodData.Define): Add CS0683.
7439         (FieldMember.ctor): Add CS0681.
7440
7441 2005-03-07  Raja R Harinath  <rharinath@novell.com>
7442
7443         * ecore.cs (SimpleName.DoResolve): Rename from
7444         SimpleName.DoResolveAllowStatic.
7445         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
7446         Pass 'intermediate' flag to MemberStaticCheck.
7447         (SimpleName.MemberStaticCheck): Skip "static check" only in case
7448         of "intermediate" lookups via MemberAccess.
7449         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
7450         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
7451
7452 2005-03-07  Raja R Harinath  <rharinath@novell.com>
7453
7454         Fix #73394.
7455         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
7456         slipped in because of variable names that are identical to a
7457         builtin type's BCL equivalent ('string String;', 'int Int32;').
7458         (PropertyExpr.EmitInstance): Likewise.
7459
7460 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
7461
7462         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
7463         
7464         * report.cs (warning_ignore_table): Made public.
7465
7466 2005-03-04  Raja R Harinath  <rharinath@novell.com>
7467
7468         Fix #73282.
7469         * class.cs (MethodData.Emit): Pass 'container' to
7470         container.GetObsoleteAttribute instead of 'container.Parent'.
7471
7472 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
7473
7474         * cs-parser.jay: Add 1534 error test.
7475
7476         * iterators.cs (Yield.CheckContext): Add error 1629.
7477         (Iterator.ctor): Save unsafe modifier.
7478         (MoveNextMethod.DoEmit): Restore unsafe context.
7479
7480         * namespace.cs (UsingAlias): Better error message.
7481
7482 2005-03-03  Dan Winship  <danw@novell.com>
7483
7484         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
7485         the warning message [#73219]
7486
7487 2005-03-03  Raja R Harinath  <rharinath@novell.com>
7488
7489         Fix compile with MCS 1.0.0.0.
7490         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
7491         w_restore to not depend on string constant folding.
7492
7493 2005-03-03  Raja R Harinath  <rharinath@novell.com>
7494
7495         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
7496         CS0246 check to users who passed 'silent = false'.
7497         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
7498         check.
7499         (SimpleName.SimpleNameResolve): Update.
7500         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
7501         (MemberAccess.IdenticalNameAndTypeName): Update.
7502         * doc.cs (FindDocumentedTypeNonArray): Update.
7503
7504 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
7505
7506         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
7507         * parameters.cs (ComputeAndDefineParameters): Remove.
7508         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
7509         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
7510         Use GetParameterInfo.
7511
7512 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
7513
7514         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
7515
7516 2005-03-02  Raja R Harinath  <rharinath@novell.com>
7517
7518         Unify DeclSpace.LookupType and DeclSpace.FindType.
7519         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
7520         is in charge of defining nested types on demand.
7521         (DeclSpace.LookupType): Use it when the current_type is a
7522         TypeBuilder.  Use LookupTypeDirect for reflected types.
7523         (DeclSpace.FindType): Remove.
7524         (DeclSpace.LookupInterfaceOrClass): Likewise.
7525         (DeclSpace.DefineTypeAndParents): Likewise.
7526         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
7527         DeclSpace.LookupType.
7528         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
7529         * typemanager.cs (LookupType): Simplify.
7530         (AddUserType): Remove type from negative_hits.
7531         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
7532         * class.cs (TypeContainer.FindMembers): Move handling of nested
7533         types ...
7534         (TypeContainer.FindMembers_NestedTypes): ... here.
7535         (TypeContainer.FindNestedType): Implement override.
7536         (ClassPart.FindNestedType): Delegate to PartialContainer.
7537         (ClassPart.PartFindNestedType): Looks up the nested types of the
7538         part alone.
7539
7540 2005-03-02  Martin Baulig  <martin@ximian.com>
7541
7542         * class.cs (TypeContainer.DoDefineMembers): We also need a default
7543         static constructor in static classes.
7544
7545 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
7546
7547         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
7548         sizeParamIndex is not specified.
7549
7550 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
7551
7552         Fix #73117
7553         * report.cs (WarningMessage.IsEnabled): Missing null check.
7554
7555 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
7556
7557         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
7558         in the fields and not in the properties.
7559
7560 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
7561
7562         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
7563         fields as well.
7564
7565 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
7566
7567         * attribute.cs: Small refactoring (improved robustness).
7568         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
7569         (ValidateGuid): Removed.
7570         (Resolve): Removed referenced to above mentioned.
7571         (GetAttributeUsage): Made private and changed to work without
7572         class assistance.
7573         (GetIndexerAttributeValue): Don't crash.
7574         (GetConditionalAttributeValue): Ditto.
7575         (GetClsCompliantAttributeValue): Ditto.
7576         (ExtractSecurityPermissionSet): All attributes exceptions are
7577         error 648.
7578         (GetPropertyValue): New helper.
7579         (GetMethodImplOptions): New method.
7580         (DefinePInvokeMethod): Reuse common code. Implemented handling of
7581         some missing properties.
7582         
7583         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
7584         (Method.ApplyAttributeBuilder): Updated.
7585         
7586         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
7587         exception.
7588
7589 2005-02-28  Raja R Harinath  <rharinath@novell.com>
7590
7591         Fix #73052.
7592         * report.cs (Report.SymbolRelatedToPreviousError): Handle
7593         non-simple types (array, pointer, reference).
7594
7595 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
7596
7597         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
7598
7599         * class.cs (MethodCore.IsDuplicateImplementation): Special error
7600         for operators.
7601         (Method.CheckBase): Catch wrong destructor here.
7602         (MethodData.Define): Add errors 550, 668.
7603
7604         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
7605
7606         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
7607
7608         * pending.cs (VerifyPendingMethods): Add error 551.
7609
7610         * typemanager.cs (CSharpName): Next error report helper.
7611
7612 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
7613
7614         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
7615         attributes. Removed useless attribute double check.
7616         It saves almost 2MBs for corlib.
7617
7618 2005-02-25  Raja R Harinath  <rharinath@novell.com>
7619
7620         Fix #72924.
7621         * statement.cs (ExpressionStatement.Resolve): Make robust to being
7622         called twice in case of error.
7623
7624 2005-02-23  Chris Toshok  <toshok@ximian.com>
7625
7626         Fix compiler portions of #72827.
7627         * statement.cs (Block.Emit): call Begin/EndScope on the
7628         EmitContext instead of the ILGenerator.
7629
7630         * codegen.cs (EmitContext.BeginScope): new method, call
7631         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
7632         we have one.)
7633         (EmitContext.BeginScope): same, but EndScope and CloseScope
7634
7635         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
7636         offset and call the superclass's OpenScope(int) with it.
7637         (SymbolWriter.CloseScope): get the current il
7638         offset and call superclass's CloseScope(int) with it.
7639
7640 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
7641
7642         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
7643         CS1677 for out and ref as well.
7644
7645         * class.cs (Method.Define): Add error CS1599 detection.
7646         
7647         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
7648         
7649         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
7650         
7651         * delegate.cs (Delegate.Define): Add error CS1599 detection.
7652         
7653         * support.cs.cs (ModifierDesc): New helper method.
7654
7655 2005-02-23  Raja R Harinath  <rharinath@novell.com>
7656             Abin Thomas  <projectmonokochi@rediffmail.com>
7657             Anoob V E  <projectmonokochi@rediffmail.com>
7658             Harilal P R  <projectmonokochi@rediffmail.com>
7659
7660         Fix #57851, #72718.
7661         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
7662         MemberLookup (used for error reporting) actually returns a result.
7663         Fix error report number (122, not 112).
7664
7665 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
7666             Anoob V E  <projectmonokochi@rediffmail.com>
7667             Harilal P R  <projectmonokochi@rediffmail.com>
7668
7669         Fix #71134.
7670         * pending.cs (PendingImplementation.GetAbstractMethods):
7671         Find NonPublic members too.
7672
7673 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
7674
7675         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
7676         Fixed error 217.
7677         
7678         * class.cs (MethodCore.CheckMethodAgainstBase):
7679         Add error 239 report.
7680
7681 2005-02-21  Raja R Harinath  <rharinath@novell.com>
7682
7683         Fix #68955.
7684         * expression.cs (Invocation.IsApplicable): Make public.
7685         (Invocation.IsParamsMethodApplicable): Likewise.
7686         * delegate.cs (Delegate.VerifyApplicability): Don't use
7687         Invocation.VerifyArgumentCompat for parameter applicability
7688         testing.  Use Invocation.IsApplicable and
7689         Invocation.IsParamsMethodApplicable.
7690
7691 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
7692
7693         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
7694         
7695         * class.cs (Operator.Define): Add error 217 report.
7696         
7697 2005-02-21  Raja R Harinath  <rharinath@novell.com>
7698
7699         * namespace.cs (UsingEntry.Resolve): Undo change below.
7700
7701 2005-02-21  Raja R Harinath  <rharinath@novell.com>
7702
7703         Fix #72756.
7704         * ecore.cs (Expression.MemberLookupFailed): Add argument to
7705         disable the error message when the extended MemberLookup also
7706         fails.
7707         (Expression.MemberLookupFinal): Update.
7708         (SimpleName.DoSimpleNameResolve): Update.
7709         * expression.cs (MemberAccess.ResolveNamespaceOrType):
7710         Don't use MemberLookupFinal.
7711         (New.DoResolve): Update.
7712         (BaseAccess.CommonResolve): Update.
7713
7714 2005-02-21  Raja R Harinath  <rharinath@novell.com>
7715
7716         Fix #72732.
7717         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
7718         occured previously, don't resolve again.
7719
7720 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
7721
7722         Fix #69949
7723         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
7724         argument. Call ResolveAttributeUsage for unresolved.
7725         when types doesn't match ctor arguments.
7726         
7727         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
7728         for nested attribute classes.
7729         (Class.attribute_usage): Removed.
7730         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
7731         for attribute class.
7732         
7733         * ecore.cs (IsAttribute): Removed.
7734         
7735         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
7736         
7737         * rootcontext.cs (RegisterAttribute): Removed, attributes are
7738         now normal types.
7739         (attribute_types): Removed.
7740         (EmitCode): Global attributes are emited as the latest.
7741
7742 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
7743
7744         * class.cs (EmitFieldInitializers): Don't emit field initializer
7745         for default values when optimilization is on.
7746         
7747         * constant.cs (Constant.IsDefaultValue): New property.
7748         
7749         * driver.cs: Add /optimize handling.
7750         
7751         * constant.cs,
7752         * ecore.cs,
7753         * literal.cs: Implement new IsDefaultValue property.
7754         
7755         * rootcontext.cs (Optimize): New field, holds /optimize option.
7756
7757 2005-02-18  Raja R Harinath  <rharinath@novell.com>
7758
7759         Fix crasher in re-opened #72347.
7760         * namespace.cs (Namespace.Lookup): Return null if
7761         DeclSpace.DefineType returns null.
7762
7763         Fix #72678.
7764         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
7765
7766 2005-02-18  Raja R Harinath  <rharinath@novell.com>
7767
7768         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
7769         now returns null if it cannot resolve to an lvalue.
7770         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
7771         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
7772         returned null.  Remove check for SimpleName.
7773         (EventExpr.DoResolveLValue): New.
7774         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
7775         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
7776         error from ...
7777         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
7778         avoid CS0131 error.
7779         (Unary.ResolveOperator): Move CS0211 check ...
7780         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
7781         CS0131 error.
7782         (Unary.DoResolveLValue): Simplify.
7783         (AddressOf.DoResolveLValue): New.
7784         (ArrayAccess.DoResolveLValue): New.
7785
7786 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
7787
7788         * attribute.cs (Attribute.Resolve): Add arguments casting for
7789         when types doesn't match ctor arguments.
7790
7791 2005-02-16  Raja R Harinath  <rharinath@novell.com>
7792
7793         Fix parts of #63202.
7794         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
7795         lookup of operator in base type.  Ensure that all checks happen
7796         when the operator resolves to an "op_..." method.
7797
7798 2005-02-15  Raja R Harinath  <rharinath@novell.com>
7799
7800         Fix #71992.
7801         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
7802         'ignore_cs0104' parameter.  Pass it to ...
7803         (NamespaceEntry.Lookup): ... this.
7804         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
7805         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
7806         (TypeLookupExpression.DoResolveAsTypeStep): Update.
7807         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
7808         Update.  Request that cs0104 errors be ignored.
7809         (ComposedCast.ResolveAsTypeStep): Update.
7810
7811 2005-02-14  Raja R Harinath  <rharinath@novell.com>
7812
7813         Fix #59209.
7814         * expression.cs (Invocation.BetterFunction): Remove support for
7815         comparing virtual functions and their overrides.
7816         (Invocation.IsOverride): New.
7817         (Invocation.OverloadResolve): Don't consider 'override' functions
7818         during candidate selection.  Store them in a lookaside list.
7819         If the selected method is a 'virtual' function, use the list to
7820         find any overrides that are closer to the LHS type.
7821
7822 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
7823
7824         * expression.cs (New.DoResolve): Add complex core type reduction.
7825         (New.Constantify): Converts complex core type syntax like 'new int ()'
7826         to simple constant.
7827         
7828 2005-02-14  Raja R Harinath  <rharinath@novell.com>
7829
7830         * decl.cs (EntryType.EntryType): New constructor to create an
7831         updated copy of a cache entry.
7832         (MemberCache.AddMethods): Use it.
7833         (MemberCache.ClearDeclaredOnly): Remove.
7834         (MemberCache.MemberCache): Update.
7835
7836 2005-02-11  Miguel de Icaza  <miguel@novell.com>
7837
7838         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
7839         variable.  This one is represents the actual low-level declaration
7840         of the method, as opposed to the semantic level `IsStatic'.   
7841
7842         An anonymous method which is hosted into a static method might be
7843         actually an instance method.  IsStatic would reflect the
7844         container, while MethodIsStatic represents the actual code
7845         generated.
7846
7847         * expression.cs (ParameterReference): Use the new MethodIsStatic
7848         instead of IsStatic.
7849
7850         * anonymous.cs (AnonymousMethod.Compatible): Pass the
7851         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
7852         set on the current EmitContext. 
7853
7854         * expression.cs (Cast): Overload DoResolveLValue so we can pass
7855         resolve our casted expression as an LValue.  This triggers the
7856         proper LValue processing that is later required by Assign.
7857
7858         This fixes 72347.
7859
7860         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
7861
7862 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
7863
7864         C# 2.0 Fixed buffer implementation
7865
7866         * anonymous.cs: Update after RegisterHelperClass renaming.
7867
7868         * attribute.cs (AttributeTester.fixed_buffer_cache):
7869         Cache of external fixed buffers.
7870         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
7871         implementation if field is fixed buffer else null.
7872
7873         * class.cs
7874         (TypeContainer.AddField): Accept FieldMember instead of Field.
7875         (FieldBase.IsFieldClsCompliant): Extracted code from
7876         VerifyClsCompliance descendant customization.
7877         (FixedField): New class handles fixed buffer fields.
7878         (FixedFieldExternal): Keeps information about imported fixed
7879         buffer.
7880         (IFixedField): Make access to internal or external fixed buffer
7881         same.
7882
7883         * cs-parser.jay: Add fixed buffer parsing.
7884
7885         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
7886         buffer.
7887
7888         * expression.cs (Indirection): Extended implementation to accept
7889         fixed buffer field.
7890         (PointerArithmetic.Emit): Get element from fixed buffer as well.
7891         (ElementAccess.MakePointerAccess): Get type as parameter.
7892         (DoResolve): Add fixed buffer field expression conversion.
7893         (DoResolveLValue): Ditto.
7894         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
7895         (ArrayPtr): Derives from FixedBufferPtr.
7896         (ArrayPtr.Emit): Add extra emit for array elements.
7897
7898         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
7899
7900         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
7901         for compiler generated types.
7902         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
7903
7904         * statement.cs (Fixed): Refactored to be easier add fixed buffer
7905         and consume less memory.
7906         (Fixed.Resolve): Add fixed buffer case.
7907
7908         * typemanager.cs (compiler_generated_attr_ctor,
7909         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
7910         (HasElementType): Add our own implementation to work on every
7911         runtime.
7912
7913 2005-02-11  Miguel de Icaza  <miguel@novell.com>
7914
7915         * anonymous.cs (CaptureContext): Track whether `this' has been
7916         referenced.   
7917
7918         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
7919         only captured `this' if it was implicitly done (instance
7920         methods/variables were used). 
7921
7922         * codegen.cs (EmitContext.CaptureThis): New method to flag that
7923         `this' must be captured.
7924
7925 2005-01-30  Miguel de Icaza  <miguel@novell.com>
7926  
7927         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
7928         is null it means that there has been no need to capture anything,
7929         so we just create a sibling.
7930
7931         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
7932
7933         Just a partial fix.  The other half is fairly elusive.
7934         
7935 2005-02-10  Raja R Harinath  <rharinath@novell.com>
7936
7937         Fix #52586, cs0121-4.cs.
7938         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
7939         and return a hashtable.
7940         (MemberCache.ClearDeclaredOnly): New.
7941         (MemberCache.MemberCache): Update to change.  Make a deep copy of
7942         the method_hash of a base type too.
7943         (MemberCache.AddMethods): Adapt to having a deep copy of the base
7944         type methods.  Overwrite entries with the same MethodHandle so
7945         that the ReflectedType is correct.  The process leaves in base
7946         virtual functions and their overrides as distinct entries.
7947         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
7948         matters since it was boxed in a ArrayList before.
7949         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
7950         modifier.
7951         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
7952         case of a virtual function and its override (choose the overload
7953         as better).
7954         (Invocation.OverloadResolve): Avoid 'override' members during
7955         'applicable_type' calculation.
7956
7957 2005-02-09  Raja R Harinath  <rharinath@novell.com>
7958
7959         Combine two near-redundant caches.
7960         * typemanager.cs (method_params): Rename from method_internal_params.
7961         (TypeManager.GetParameterData): New.  Replace
7962         Invocation.GetParameterData.
7963         (TypeManager.LookupParametersByBuilder): Remove.
7964         * expression.cs (Invocation.method_parameter_cache): Remove.
7965         (Invocation.GetParameterData): Remove.
7966         Update to changes.
7967         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
7968         Update to changes.
7969
7970 2005-02-08  Raja R Harinath  <rharinath@novell.com>
7971
7972         Fix #72015.
7973         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
7974         TypeManager.multicast_delegate_type is null, resolve it by looking
7975         up "System.MulticastDelegate".
7976         * rootcontext.cs (RootContext.ResolveCore): Simplify.
7977
7978 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
7979             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
7980             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
7981
7982         Fix cs0164.cs.
7983         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
7984         (LabeledStatement.AddReference): New.  Set 'referenced'.
7985         (Goto.Resolve): Use it.
7986
7987 2005-02-05  John Luke  <john.luke@gmail.com>
7988
7989         * driver.cs: remove duplicate -doc line in Usage ()
7990
7991 2005-02-04  Raja R Harinath  <rharinath@novell.com>
7992
7993         * location.cs (Location.AddFile): Fix CS2002 error report.
7994
7995 2005-02-02  Martin Baulig  <martin@ximian.com>
7996
7997         * delegate.cs (Delegate.DefineType): Report an internal error if
7998         TypeManager.multicast_delegate_type is null.  See bug #72015 for
7999         details.        
8000
8001 2005-02-02  Raja R Harinath  <rharinath@novell.com>
8002
8003         Fix a crasher in a variant of #31984.
8004         * const.cs (Constant.CheckBase): New override that defers the
8005         new-or-override check in case the base type hasn't been populated
8006         yet.
8007         (Constant.Define): Ensure the new-or-override check is performed.
8008
8009 2005-02-01  Duncan Mak  <duncan@ximian.com>
8010
8011         * const.cs (LookupConstantValue): Check that `ce' is not null
8012         before calling GetValue ().
8013
8014 2005-02-01  Raja R Harinath  <rharinath@novell.com>
8015
8016         Fix test-334.cs (#69519).
8017         * cs-parser.jay (using_alias_directive): Pass in an expression to
8018         NamespaceEntry.UsingAlias.
8019         (using_namespace_directive): Pass in an expression to
8020         NamespaceEntry.Using.
8021         (namespace_name): Don't flatten to a string.
8022         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
8023         (NamespaceEntry.AliasEntry.Resolve): Lookup using
8024         ResolveAsTypeStep.
8025         (NamespaceEntry.UsingEntry): Likewise.
8026         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
8027         changes.
8028         (NamespaceEntry.LookupForUsing): Remove.
8029         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
8030         names.
8031         (NamespaceEntry.Lookup): Remove support for dotted names.
8032
8033 2005-02-01  Raja R Harinath  <rharinath@novell.com>
8034
8035         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
8036         split into two.
8037         (NamespaceEntry.ImplicitParent): Compute on demand.
8038         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
8039         parallels the current.
8040         (NamespaceEntry.LookupForUsing): Use it.
8041         (NamespaceEntry.Lookup): If the current namespace-entry is
8042         implicit, don't search aliases and using tables.
8043
8044 2005-02-01  Raja R Harinath  <rharinath@novell.com>
8045
8046         Fix #31984.
8047         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
8048         BaseCache here.
8049         (TypeContainer.BaseCache): Compute on demand.
8050         (TypeContainer.FindMembers): Define constants and types if they're
8051         not already created.
8052         (FieldMember.Define): Move resetting of ec.InUnsafe before error
8053         check.
8054         * const.cs (Constant.Define): Make idempotent.
8055
8056 2005-01-29  Miguel de Icaza  <miguel@novell.com>
8057
8058         * pending.cs: Produce better code (no nops produced by using Ldarg
8059         + value).
8060         
8061         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
8062         i - 1' it should be arg + 1.
8063
8064         Fixes bug #71819.
8065
8066 2005-01-28  Raja R Harinath  <rharinath@novell.com>
8067
8068         * attribute.cs (Attribute.CheckAttributeType): Make private
8069         non-virtual.
8070         (Attribute.ResolveType): Make virtual.
8071         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
8072         handling of RootContext.Tree.Types.
8073
8074 2005-01-27  Raja R Harinath  <rharinath@novell.com>
8075
8076         Update attribute-handling to use the SimpleName/MemberAccess
8077         mechanisms.
8078         * cs-parser.jay (attribute): Pass in an expression to the
8079         constructors of Attribute and GlobalAttribute.
8080         * attribute.cs (Attribute): Take an expression for the name.
8081         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
8082         passed in attribute name expression.
8083         (Attribute.CheckAttributeType): Use it.
8084         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
8085         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
8086         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
8087         argument to prevent error messages if the lookup fails.
8088
8089 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
8090
8091         * expression.cs (Indirection): Implemented IVariable interface
8092         to support indirection in AddressOf operator.
8093         (PointerArithmetic.Emit): Add optimalization for case where
8094         result can be precomputed.
8095
8096 2005-01-26  Martin Baulig  <martin@ximian.com>
8097
8098         * class.cs (TypeContainer.AttributeTargets): Return the correct
8099         AttributeTargets depending on our `Kind' instead of throwing an
8100         exception; fixes #71632.
8101
8102 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
8103
8104         Fix #71257
8105         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
8106         constant members.
8107
8108 2005-01-25  Raja R Harinath  <rharinath@novell.com>
8109
8110         Fix #71602.
8111         * expression.cs (MemberAccess.DoResolve): Don't complain with
8112         cs0572 when the LHS of a member access has identical name and type
8113         name.
8114
8115 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
8116
8117         Fix #71651, #71675
8118         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
8119         CreatePermission.
8120         Create custom PermissionSet only for PermissionSetAttribute.
8121
8122 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
8123
8124         Fix #71649
8125         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
8126         delegates in static class.
8127
8128 2005-01-24  Martin Baulig  <martin@ximian.com>
8129
8130         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8131         merging an implicit block, just use its reachability.
8132
8133         * statement.cs (Block.Resolve): Make the unreachable code check
8134         work wrt. implicit blocks; see test-337 from #63842.
8135
8136 2005-01-21  Alp Toker  <alp@atoker.com>
8137  
8138         * cs-parser.jay: destructor_declaration's container is PartialContainer
8139         not Class when partial types are used, so use Kind prop instead of
8140         'is'.
8141         
8142 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
8143
8144         * cs-parser.jay: Improve error reporting when an interface
8145         declares new types.
8146
8147 2005-01-20  Dick Porter  <dick@ximian.com>
8148
8149         * support.cs: SeekableStreamReader fix from Sandor Dobos
8150         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
8151         chars are read.  Fixes bug 70369.
8152
8153 2005-01-20  Raja R Harinath  <rharinath@novell.com>
8154
8155         * cs-parser.jay (catch_clause): Simplify current_block handling
8156         somewhat.
8157
8158 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
8159
8160         * convert.cs (ImplicitStandardConversionExists): Synchronize the
8161         code with ImplicitStandardConversion to handle the implicit
8162         conversion of method groups into valid delegate invocations. 
8163
8164         The problem is that in parameter handling we were using this code
8165         path.  Fixes bug #64698
8166
8167 2005-01-19  Raja R Harinath  <rharinath@novell.com>
8168
8169         * cs-parser.jay: Fix several infelicities.
8170         - Avoid assigning to the parser value stack.  Code like 
8171           '$3 = null' is unclean.  Synthesize a value for the code block
8172           instead. 
8173         - Avoid using oob_stack for storing location information.  Use ...
8174         (_mark_): ... this.  New (empty) rule.  Saves the current location
8175         in $$.
8176         (foreach_statement): Avoid using oob_stack for current_block
8177         handling.  Use technique used in for_statement and
8178         using_statement.  Synthesize a value for the code block to store
8179         additional intermediate information.
8180
8181 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
8182
8183         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
8184         of a different type is only allowed to private fields of a
8185         containing type, not on fields of a base class.
8186
8187         See test-174.cs and error cs0122-9.cs
8188
8189 2005-01-13  Raja R Harinath  <rharinath@novell.com>
8190
8191         Fix test-335.cs (bug #58126).
8192         * cs-parser.jay (argument): Split out non-expression parts of the
8193         rule into 'non_simple_argument'.
8194         (invocation_expression): Support parenthesized invocations with
8195         multiple arguments, and with single non-simple arguments.
8196
8197 2005-01-13  Raja R Harinath  <rharinath@novell.com>
8198
8199         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
8200         places.
8201
8202 2005-01-12  Raja R Harinath  <rharinath@novell.com>
8203
8204         Fix cs0038-1.cs, cs1640-6.cs.
8205         * ecore.cs (Expression.Resolve): Remove special-case for
8206         SimpleName in error-handling.
8207         (Expression.almostMatchedMembers): Relax access permission to
8208         protected.
8209         (Expression.MemberLookupFailed): Handle duplicates in
8210         almostMatchedMembers list.
8211         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
8212         * expression.cs (New.DoResolve): Report CS1540 for more cases.
8213         * typemanager.cs (GetFullNameSignature): Use the MethodBase
8214         overload if the passed in MemberInfo is a MethodBase.
8215
8216 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
8217
8218         Fix #70749
8219         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
8220         for non-CAS & merge permission sets properly.
8221
8222 2005-01-11  Raja R Harinath  <rharinath@novell.com>
8223
8224         Improve standard-compliance of simple name and member access 
8225         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
8226         * ecore.cs (FullNamedExpression): New abstract base class 
8227         for Namespaces and TypeExpressions.
8228         (ResolveFlags.SimpleName): Remove.
8229         (SimpleName): Remove support for dotted names.
8230         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
8231         DeclSpace.FindType and DeclSpace.LookupType.
8232         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
8233         (Expression.ExprClassName): Make member function.
8234         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
8235         a namespace.  Remove creation of dotted "SimpleName"s.
8236         (MemberAccess.DoResolve): Likewise.
8237         * decl.cs (DeclSpace.Cache): Make private.
8238         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
8239         (DeclSpace.FindType): Update.
8240         (DeclSpace.LookupType): Move here from RootContext.  Return a 
8241         FullNamedExpression.
8242         * namespace.cs (Namespace): Derive from FullNamedExpression
8243         so that it can be part of expression resolution.
8244         (Namespace.Lookup): Return an FullNamedExpression.
8245         (NamespaceEntry.LookupAlias): Lookup aliases only in current
8246         namespace.
8247         * rootcontext.cs (NamespaceLookup): Remove.
8248         (LookupType): Move to DeclSpace.
8249         * attribute.cs (CheckAttributeType): Update.
8250         * doc.cs (FindDocumentedType): Remove allowAlias argument.
8251         (FindDocumentedTypeNonArray): Likewise.
8252
8253 2005-01-11  Raja R Harinath  <rharinath@novell.com>
8254
8255         Fix cs0509.cs, cs1632.cs.
8256         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
8257         is the same as IsInterface.
8258         (TypeContainer.GetClassBases): Likewise.
8259         * statement.cs (LabeledStatement.ig): New field.
8260         (LabeledStatement.LabelTarget): Save ILGenerator which created the
8261         label.
8262         (LabeledStatement.DoEmit): Check that the label was created with
8263         the same ILGenerator.
8264
8265 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
8266
8267         Fix #71058
8268         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
8269         accessors to its properties.
8270
8271         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
8272         from accessors to property.
8273         
8274 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
8275
8276         Fix #70722
8277         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
8278         only for overrides.
8279         
8280 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
8281
8282         * attribute.cs: Check for null and empty strings.  
8283
8284         I have lost another battle to Paolo.
8285
8286 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
8287
8288         Fix #70942
8289         * class.cs (PropertyMethod): Set Parent field in ctors.
8290         (SetMethod.InternalParameters): Add unsafe switch hack.
8291         Override MarkForDuplicationCheck where it is appropriate.
8292
8293         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
8294         It says whether container allows members with the same name.
8295         Base default is no.
8296         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
8297         Removed is_method parameter.
8298
8299 2005-01-06  Duncan Mak  <duncan@ximian.com>
8300
8301         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
8302         because the previous change led to incorrect reporting of CS1032
8303         ("Cannot define/undefine preprocessor symbols after first token in
8304         file"). Instead of using `tokens_seen' as the only flag that
8305         triggers CS1040, introduce `comments_seen'. This new flag is used
8306         to signify having seen comments on the current line, so it is
8307         unset after a newline.
8308
8309 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
8310
8311         * doc.cs : When searching for a type, find nested type too.
8312           This fixes bug #71040.
8313
8314 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
8315
8316         * doc.cs :
8317           - Warn missing member comment on those classes which also does not
8318             have doc comments. Fixed bug #71041.
8319           - Don't warn missing doc comment on default constructor.
8320             Fixed bug #71042.
8321
8322 2005-01-06  Duncan Mak  <duncan@ximian.com>
8323
8324         * cs-tokenizer.cs (xtoken): After handling traditional C-style
8325         comments, set `tokens_seen' to true. This allows us to detect
8326         misplaced preprocessor directives (i.e. not at the beginning of
8327         the a line, nor after whitespaces). In that case, report error
8328         CS1040. This fixes bug #56460.
8329
8330         * cs-parser.jay (interface_member_declaration): Add checks for
8331         IsExplicitImpl, and report CS0541 error if an interface member is
8332         defined as an explicit interface declaration.
8333
8334 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
8335
8336         Fix #70817
8337         * class.cs (PropertyMethod): Set Parent field in ctors.
8338         (SetMethod.InternalParameters): Add unsafe switch hack.
8339         
8340         * decl.cs (MemberCore.Parent): Cannot be readonly.
8341
8342 2005-01-06  Raja R Harinath  <rharinath@novell.com>
8343
8344         * decl.cs (DeclSpace.ResolveType): Remove.
8345         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
8346         Merge in code from ...
8347         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
8348         * class.cs, enum.cs: Update to changes.
8349
8350 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
8351
8352         * anonymous.cs: Ensure that we init the scope of our parent if it
8353         has not been initialized yet.
8354
8355 2004-12-30  Duncan Mak  <duncan@ximian.com>
8356
8357         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
8358         if field.FieldBuilder is null. Fixes #70758.
8359
8360         * convert.cs: Fixed some typos and updated some of the comments.
8361         (ImplicitStandardConversionExists):
8362         (TryImplicitIntConversion): If `target_type' is an interface and
8363         the type of `ic' implements this interface, return true or a new
8364         BoxedCast instead of null. This fixes #70468.
8365
8366 2004-12-29  Duncan Mak  <duncan@ximian.com>
8367
8368         * expression.cs (Argument.Emit): Check that Expr is
8369         IMemoryLocation before casting to it, and report CS1510 otherwise.
8370
8371         This fixes #70402.
8372
8373 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
8374
8375         * statement.cs (Block.ThisVariable): remove the recursion here, to
8376         make the --profile more sane.
8377
8378 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
8379
8380         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
8381         assembly, by JB Evain.
8382
8383 2004-12-17  Raja R Harinath  <rharinath@novell.com>
8384
8385         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
8386           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
8387         "parent" refers to enclosing type/class.  "base" refers to superclass.
8388
8389 2004-12-17  Raja R Harinath  <rharinath@novell.com>
8390
8391         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8392         Ensure that we only have GlobalAttributes.
8393         * attribute.cs (Attribute.Emit): Make non-virtual.
8394         (GlobalAttribute.Emit): Remove.
8395         (Attribute.Resolve): Make virtual.
8396         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
8397         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
8398         the argument. Don't create one.
8399         (Attribute.GetObsoleteAttribute): Likewise.
8400         (Attribute.GetClsCompliantAttributeValue): Likewise.
8401         * class.cs, decl.cs: Update to changes.
8402
8403 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
8404
8405         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
8406         
8407         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
8408         
8409         * statement.cs (Foreach.Resolve): Add error 186 report.
8410
8411 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
8412
8413         * expression.cs (Conditional.DoResolve): Add warning 429.
8414         
8415         * statement.cs (If.Resolve): Add warning 665.
8416
8417 2004-12-16  Raja R Harinath  <rharinath@novell.com>
8418
8419         New invariant: RootContext.Tree.Types.NamespaceEntry == null
8420         except when in the parser, and in GlobalAttribute.
8421         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
8422         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
8423         RootContext.Tree.Types.NamespaceEntry once work is done.
8424         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
8425         and resets RootContext.Tree.Types.NamespaceEntry.
8426
8427 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
8428
8429         * cs-parser.jay: Don't create a block for every variable.
8430
8431 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
8432
8433         * location.cs: Provide extra information.
8434
8435         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
8436         variables from the captured environment, it is the ldarg_0.
8437
8438 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
8439
8440         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
8441         find a conclusion.
8442         
8443         * class.cs: Changed warning level for 169 to avoid developer
8444         displeasure from warning flooding. It will be changed back when they
8445         fix most of current BCL warnings.
8446         
8447         * RootContext.cs: Pushed default WarningLevel to 3.
8448         
8449         * statement.cs: Removed unused variable.
8450
8451 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
8452
8453         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
8454         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
8455         Add error 502 report.
8456         (StaticClass.DefineType): Add error 441 report.
8457         (Class.AllowedModifiersProp): New virtual property as temporary
8458         extension to AllowedModifiers.
8459         (Class.DefineType): Add error 418 report. Moved ModFlags check here
8460         to share implementation with StaticClass and don't call virtual
8461         methods from ctor.
8462         
8463         * driver.cs (MainDriver): Add error 1558 test.
8464
8465         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
8466         report. Moved error 36 test here.
8467
8468         * statement.cs (Throw.Resolve): Add error 724 report.
8469
8470         * typemanager.cs: Add out_attribute_type core type.
8471         
8472 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
8473
8474         * class.cs (TypeContainer.VerifyClsCompliance): Add error
8475         3018 report.
8476         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
8477
8478         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
8479         3017 report.
8480         
8481         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
8482
8483         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
8484         Add error 3023 report.
8485         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
8486
8487         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
8488         implementation.
8489
8490 2004-12-12  John Luke  <john.luke@gmail.com>
8491
8492         * driver.cs (AddArgs): take -- into account when
8493         adding arguments, fixes bug 65710 
8494
8495 2004-12-12  Martin Baulig  <martin@ximian.com>
8496
8497         * expression.cs (Unary.TryReduceNegative): Added support for
8498         SByteConstant and ByteConstant.
8499         (Unary.Reduce): Check error values from TryReduceNegative().
8500
8501 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
8502
8503         * attributes.cs (Attribute.Resolve): Avoid multiple error report
8504         and report exception as error 182.
8505
8506 2004-12-10  Raja R Harinath  <rharinath@novell.com>
8507
8508         * driver.cs (Main): Fix message when there are warnings.
8509
8510 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
8511
8512         * delegate.cs: Fixed my fix from yesterday, sorry about that.
8513
8514 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
8515
8516         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
8517         Reduced number of warnings.
8518         
8519         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
8520
8521 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
8522
8523         * driver.cs: Removed message.
8524
8525         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
8526
8527 2004-12-08    <vargaz@freemail.hu>
8528
8529         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
8530
8531 2004-12-08  Martin Baulig  <martin@ximian.com>
8532
8533         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
8534         instead of a CS3002 for properties and indexer.
8535
8536 2004-12-08  Martin Baulig  <martin@ximian.com>
8537
8538         * decl.cs (MemberName.ToString): Make this work again.
8539
8540 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
8541
8542         * attribute.cs (Resolve): Add error 591 detection.
8543
8544         * class.cs (FieldMember.Define): Add error 1547 detection.
8545         (Indexer.Define): Add error 620 detection.
8546         (Operator.Define): Add error 590 detection.
8547
8548         * ecore.cs: Missing argument for error 79.
8549
8550         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
8551         detection.
8552
8553 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
8554
8555         Fix #70106
8556         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
8557         only.
8558
8559 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
8560
8561         * cs-parser.jay : handle doc comments on implicit/explicit operators.
8562           Some operator comments were suppressed.
8563         * doc.cs : Implicit/explicit operator name in doc comments are like
8564           "op_Explicit(type)~returnType", so added suffix handling.
8565
8566 2004-12-07  Martin Baulig  <martin@ximian.com>
8567
8568         * decl.cs
8569         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
8570         (MemberCore.GetClsCompliantAttributeValue): Likewise.
8571         (DeclSpace.ec): New protected field; store the EmitContext here.
8572         (DeclSpace.EmitContext): New public property; moved here from
8573         `TypeContainer'.
8574         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
8575         EmitContext.
8576
8577         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
8578         (Enum.Emit): Don't create a new EmitContext.
8579
8580         * delegate.cs (Delegate.DefineType): Always create the
8581         EmitContext.
8582
8583         * iterators.cs (Iterators.DefineIterator): Create a new
8584         EmitContext and store it in `ec'.
8585
8586 2004-08-24  Martin Baulig  <martin@ximian.com>
8587
8588         * typemanager.cs
8589         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
8590         this for accessibility checks.
8591         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
8592         IsNestedFamilyAccessible.
8593         (TypeManager.IsSubclassOf): New method, do what the name actually
8594         says.   
8595
8596 2004-12-06  Raja R Harinath  <rharinath@novell.com>
8597
8598         Fix crash on cs0657-17.cs.
8599         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8600         Use RootContext.Tree.Types, not 'new RootTypes ()'.
8601         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
8602         the case where the NamespaceEntry gets overwritten.
8603
8604 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
8605
8606         Fixed #69195, #56821
8607         * ecore.cs (ResolveBoolean): Tiny refactoring.
8608
8609         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
8610         of right expression resolving when left is false constant and
8611         operator is LogicalAnd OR true constant and operator is LogicalOr.
8612
8613         * statement.cs (ResolveUnreachable): Always reports warning.
8614
8615 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
8616
8617         * class.cs: Distinguish between 1721 and 1722 (just a little help
8618         for the programmer).
8619
8620 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
8621
8622         * delegate.cs: Only allow this on new versions of the language. 
8623
8624 2004-12-02  Duncan Mak  <duncan@ximian.com>
8625
8626         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
8627         Expression class.
8628         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
8629         here as a static method. Take an additional bool out parameter
8630         `must_do_cs1540_check' for signaling to InstanceResolve.
8631         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
8632         member field from PropertyExpr class and made it an argument of
8633         the method instead.
8634         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
8635         check for MarshalByRefObject, and report CS0122 instead of CS1540.
8636         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
8637         and `remove_accessor' as well as InstanceResolve: report CS0122
8638         where applicable.
8639
8640         Fixes #70129.
8641
8642 2004-12-03  Raja R Harinath  <rharinath@novell.com>
8643
8644         Fix test-327.cs, test-328.cs, and put in early infrastructure
8645         for eventually fixing #52697.
8646         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
8647         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
8648         from other methods.
8649         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
8650         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
8651         (VerifyUsing, error246): Update.
8652         * rootcontext.cs (RootContext.NamespaceLookup): Just use
8653         'NamespaceEntry.LookupNamespaceOrType'.
8654
8655 2004-12-03  Martin Baulig  <martin@ximian.com>
8656
8657         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8658         method as our child, call AnonymousMethod.Compatible() on it.
8659
8660 2004-12-03  Raja R Harinath  <rharinath@novell.com>
8661
8662         Disable XML documentation support in 'basic' profile.
8663         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
8664         Redirect XmlElement to System.Object.
8665         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
8666         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
8667         * mcs.exe.sources: Add doc-bootstrap.cs.
8668         * doc-bootstrap.cs: New file.  Contains empty stub implementation
8669         of doc.cs.
8670
8671 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
8672
8673         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
8674           comments are allowed.
8675
8676 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
8677
8678         * delegate.cs: Add checks for subtypes in paramaters and return values
8679         in VerifyMethod () to add support for Covariance/Contravariance
8680         in delegates.
8681         
8682 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
8683
8684         * report.cs: Remove extra closing parenthesis.
8685
8686         * convert.cs (Error_CannotImplicitConversion): If the name of the
8687         types are the same, provide some extra information.
8688
8689         * class.cs (FieldBase): Use an unused bit field from the field to
8690         encode the `has_offset' property from the FieldMember.  This saves
8691         a couple of Ks on bootstrap compilation.
8692
8693         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8694         method as our child, return the AnonymousMethod resolved
8695         expression.
8696
8697         * expression.cs (New.DoResolve): Allow return values from
8698         NewDelegate to also include AnonymousMethods.
8699
8700         Fixes #70150.
8701
8702 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
8703
8704         Fix bug #70102
8705         * attribute.cs (Resolve): Improved implementation of params
8706         attribute arguments.
8707
8708         * support.cs (ParameterData): Add HasParams to be faster.
8709
8710 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
8711
8712         all things are for /doc support:
8713
8714         * doc.cs: new file that supports XML documentation generation.
8715         * mcs.exe.sources: added doc.cs.
8716         * driver.cs:
8717           Handle /doc command line option.
8718           Report error 2006 instead of 5 for missing file name for /doc.
8719           Generate XML documentation when required, after type resolution.
8720         * cs-tokenizer.cs:
8721           Added support for picking up documentation (/// and /** ... */),
8722           including a new XmlCommentState enumeration.
8723         * cs-parser.jay:
8724           Added lines to fill Documentation element for field, constant,
8725           property, indexer, method, constructor, destructor, operator, event
8726           and class, struct, interface, delegate, enum.
8727           Added lines to warn incorrect comment.
8728         * rootcontext.cs :
8729           Added Documentation field (passed only when /doc was specified).
8730         * decl.cs:
8731           Added DocComment, DocCommentHeader, GenerateDocComment() and
8732           OnGenerateDocComment() and some supporting private members for
8733           /doc feature to MemberCore.
8734         * class.cs:
8735           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
8736         * delegate.cs:
8737           Added overriden DocCommentHeader.
8738         * enum.cs:
8739           Added overriden DocCommentHeader and GenerateDocComment().
8740
8741 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
8742
8743         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
8744         unwrapping the enumeration values, chain to
8745         DoConstantNumericPromotions again, so we can promote things to the
8746         fundamental types (takes care of enums that are bytes, sbytes).
8747
8748         Fixes bug #62054.
8749
8750 2004-12-01  Raja R Harinath  <rharinath@novell.com>
8751
8752         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
8753         Fix long-standing bug in type-lookup.  Use FindType instead of
8754         LookupType when ec.ResolvingTypeTree.
8755         (Attribute.ResolveType, Attribute.Resolve)
8756         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
8757         Update to changes.
8758         (Attributes.Search): Remove internal version.  Update.
8759         (Attributes.SearchMulti): Update.
8760         (Attributes.GetClsCompliantAttribute): Remove.
8761         (Attributes.GetIndexerNameAttribute): Remove.
8762         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
8763         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
8764         * class.cs (Indexer.Define): Likewise.
8765
8766 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
8767
8768         Fix bug #68790
8769         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
8770         MarshallByReference members access.
8771
8772         * expression.cs: Use CheckMarshallByRefAccess;
8773         Better error CS0197 message.
8774
8775         * report.cs: Print whole related error message.
8776
8777 2004-11-30  Raja R Harinath  <rharinath@novell.com>
8778
8779         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
8780         the current directory to help debugging.
8781
8782 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
8783
8784         * class (GetClassBases): Better error 60 report.
8785         (EventProperty): Disabled warning 67 detection.
8786
8787 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
8788
8789         Fix bug #60324
8790         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
8791
8792         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
8793         precise values.
8794
8795 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
8796
8797         Fix bug #49488
8798         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
8799
8800         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
8801
8802 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
8803
8804         * attribute.cs (Attribute.Resolve): Refine error reporting and
8805         report a cs0117 if the identifier does not exist, to distinguish
8806         from 0617 which is a miss-use of the actual identifier.
8807
8808         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
8809         between cs0070 and cs0079.
8810
8811         * class.cs (MemberBase.DoDefine): When reporting a wrong
8812         accessibility level, we use MethodCore to compare instead of
8813         Method (this was a regression in some refactoring effort).
8814
8815         So now we correctly report cs0056 again.
8816
8817         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
8818         testing the target_type (which was known to be object_type) and
8819         not the source type (which is anonymous_method).
8820
8821         Fixed reporting of error cs1660.
8822
8823         * expression.cs (UserCast.Source): Expose the underlying cast.
8824
8825         * statement.cs (Switch.SwitchGoverningType): Sort the list of
8826         allowed types to find a match to int32 first (most common).
8827
8828         In addition, it ignores any ImplicitUserConversions that did an
8829         internal implicit conversion (as the switch statement allows only
8830         one integral conversion to exist).
8831
8832         * class.cs (PartialContainer.Create): rename `name' to
8833         `member_name' for clarity.  Then replace the string calls with a
8834         call to MemberName.GetPartialName, as now using
8835         MemberName.ToString is an error (this is due to the side effects
8836         it had, that were fixed in the past).
8837
8838         This will restore the error reporting on a number of partial class
8839         errors that were missusing this (and getting an exception as a
8840         results, which is now just a plain textual warning, because
8841         yyparse debug output would crash otherwise).
8842
8843 2004-11-26  Raja R Harinath  <rharinath@novell.com>
8844
8845         * Makefile (PROGRAM_INSTALL_DIR): Remove.
8846
8847 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
8848
8849         * rootcontext.cs (LookupType): Make sure to cache lookups that
8850         don't give us a negative result. This saves about 5% of corlib
8851         compilation time.
8852
8853 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
8854
8855         * report.cs (AbstractMessage.Print): messages are sent to stderr
8856
8857         * class.cs (TypeContainer.GetClassBases): It is an error to have a
8858         non-interface in the list of interfaces (at this point, either
8859         parent was properly set, or a base class is being listed in the
8860         interfaces section).
8861
8862         This flags error 1722, and resolves the crash from bug 69259.
8863
8864 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
8865
8866         * statement.cs (Using.EmitExpressionFinally): make this work right
8867         for valuetypes. Fixes 69926.
8868
8869 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
8870
8871         * const.cs (Const.ChangeType): Cope with the "0 literal can be
8872         converted to an enum" here, before we try to change the underlying
8873         type.  This code exists, but it is a different code path than the
8874         one used while encoding constants.
8875
8876         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
8877         old bug: when converting from the null literal to a pointer,
8878         return an EmptyCast, not the NullLiteral.
8879
8880         This fixes #69921, the recent null_type changes probably made this
8881         bug more prominent.
8882
8883         (ImplicitReferenceConversionExists): In addition, resynchronized
8884         the code here, so it matches the same code in
8885         ImplicitReferenceConversionExists for the `from any class-type S
8886         to any interface-type T'.
8887         
8888
8889 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
8890
8891         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
8892
8893 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
8894
8895         * cs-parser.jay: Use verbosity accordingly. 
8896
8897 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
8898
8899         * expression.cs (Unary.ResolveOperator): Do not report warning;
8900         AddressOf reads from variable.
8901         
8902         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
8903
8904 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
8905
8906         Fix bug #69462
8907
8908         * attribute.cs (Attributable): Removed CheckTargets.
8909         (Attributes.Emit): Explicit attribute targets are tested here.
8910
8911         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
8912         not enabled for interfaces.
8913
8914         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
8915         (GetAssemblyName): Ouch next bug there.
8916
8917 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
8918
8919         * expression.cs: Error 275 added.
8920         
8921 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
8922
8923         Fix bug #69177 (Implemented decimal constant support)
8924
8925         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
8926         (BinaryFold): Add DecimalConstant.
8927
8928         * const.cs (Define): Decimal constant 
8929         (is not constant.
8930         (ChangeType): Add decimal type handling.
8931         (LookupConstantValue): Don't set value for decimal type but
8932         emit DecimalConstantAttribute. Needed for constant optimization.
8933
8934         * constant.cs (ToDecimal): New method.
8935         (ConvertToDecimal): New method.
8936         (IntConstant): Implemented ConvertToDecimal.
8937         (DecimalConstant.Emit): Emit optimized version for decimals in
8938         int range.
8939
8940         * expression.cs (ResolveOperator): Changed order of constant
8941         reduction to work correctly with native types which have
8942         overloaded operators.
8943         (ResolveMemberAccess): Extract constant value from attribute
8944         for decimal type.
8945
8946         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
8947
8948         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
8949         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
8950         (ChangeType): Decimal is special.
8951         (TypeToCoreType): Add decimal type.
8952
8953 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
8954
8955         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
8956         decimal types.
8957
8958 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
8959
8960         * class.cs (EventField.ApplyAttributeBuilder): Fix error
8961         test cs1667-5.cs.
8962
8963 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
8964
8965         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
8966
8967         * pending.cs (PendingImplementation): Grab only interfaces.
8968
8969 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
8970
8971         * statement.cs (ForeachHelperMethods): Add location member and
8972         error 202 detection.
8973
8974 2004-11-19  Raja R Harinath  <rharinath@novell.com>
8975
8976         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
8977         automatically handled by executable.make.
8978         (PROGRAM): Make profile-specific.
8979
8980 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
8981
8982         * expression.cs (DoResolveBase): Fixed wrong warning for out
8983         variables.
8984
8985 2004-11-18  Martin Baulig  <martin@ximian.com>
8986
8987         Merged latest changes into gmcs.  Please keep this comment in
8988         here, it makes it easier for me to see what changed in MCS since
8989         the last time I merged.
8990
8991 2004-11-17  Raja R Harinath  <rharinath@novell.com>
8992
8993         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
8994         (TypeHandle.GetMemberCache): New.
8995         (TypeHandle.TypeHandle): Update.
8996         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
8997         (TypeManager.LookupParentInterfacesCache):
8998         Rename from LookupInterfaceCache.  Optimize slightly.
8999         (TypeManager.MemberLookup_FindMembers): Update.
9000         * decl.cs (MemberCache.MemberCache): Set Container to null in the
9001         multi-type variant.
9002         (AddCacheContents): Rename from AddHashtable.
9003         * class.cs (TypeContainer.parent_container): Remove.
9004         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
9005         (TypeContainer.DoDefineMembers): Don't initialize it.
9006         Update to name changes.
9007         
9008 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
9009
9010         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
9011         that factors the code to check access modifiers on override.  
9012
9013         (PropertyBase): Use the code here.
9014
9015         Patch from Lluis S'anchez, fixes bug #69361.
9016
9017 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
9018
9019         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
9020         routine that is used to report the use of a captured variable
9021         whose address has been taken.
9022
9023         There are two checks: one when variables are being captured and
9024         the other check is when the address of a variable is taken. 
9025         
9026         (because an anonymous methods might be resolved before *or* after
9027         the address has been taken) and 
9028
9029         * expression.cs (Conditional.DoResolve): Remove the special
9030         casing that Martin added to trueExpr and falseExpr being both
9031         NullLiteral.  We get the right behavior now just by introducing
9032         the null_type into the compiler. 
9033
9034         * convert.cs (ExplicitConversion): Change the code to use
9035         null_type instead of testing `expr is NullLiteral'.
9036         (ImplicitConversionStandard): use null_type too.
9037         (ImplicitReferenceConversionExists): use null_type too.
9038         (ImplicitReferenceConversion): use null_type too.
9039
9040         * literal.cs: The type of `NullLiteral' is now null_type instead
9041         of object_type. 
9042         (Resolve): Set the type here.
9043
9044         * typemanager.cs: Introduce null_type.
9045
9046 2004-11-17  Martin Baulig  <martin@ximian.com>
9047
9048         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
9049         direction, like FindMembers() does.  Fixes #69546, testcase is in
9050         test-315.cs.    
9051
9052 2004-11-16  Martin Baulig  <martin@ximian.com>
9053
9054         This is based on a patch from Marek Safar, see bug #69082.
9055         Fixes bugs #63705 and #67130.
9056
9057         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
9058         method; create a MemberCache for an interface type and cache the
9059         result.
9060
9061         * decl.cs (IMemberContainer.ParentContainer): Removed.
9062         (IMemberContainer.ParentCache): New property.
9063         (MemberCache.SetupCacheForInterface): Removed.
9064         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
9065         to create a cache for an interface's "parent".
9066
9067         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
9068         interfaces too.
9069
9070 2004-11-16  Martin Baulig  <martin@ximian.com>
9071
9072         Merged back from gmcs; these changes already went into gmcs a
9073         couple of weeks ago.
9074
9075         * typemanager.cs
9076         (TypeManager.AddUserType): Removed the `ifaces' argument.
9077         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
9078         `TypeExpr []'.
9079         (TypeManager.AddUserInterface): Removed.
9080         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
9081         `TypeExpr []'.
9082         (TypeManager.GetInterfaces): Likewise.
9083         (TypeManager.GetExplicitInterfaces): Likewise.
9084
9085         * ecore.cs (TypeExpr.GetInterfaces): Removed.
9086
9087         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
9088         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
9089
9090 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
9091
9092         * statement.cs: Avoid adding bools to a hashtable.
9093
9094 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
9095
9096         * expression.cs (Invocation.OverloadResolve): Flag error if we are
9097         calling an unsafe method from a safe location.
9098
9099 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
9100
9101         Fix #69167
9102         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
9103
9104 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
9105
9106         * namespace.cs (VerifyUsing): use GetPartialName instead of
9107         ToString. 
9108
9109 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
9110
9111         * statement.cs (Return.Resolve): Fix regression in typo: if
9112         `in_exc', we have to request a NeedReturnLabel, this was a typo
9113         introduced in the anonymous method check-in.  Fixes #69131.
9114
9115         * Indexers were using the ShortName when defining themselves,
9116         causing a regression in the compiler bootstrap when applying the
9117         patch from 2004-11-02 (first part), now they use their full name
9118         and the bug is gone.
9119
9120 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
9121
9122         * driver.cs: Strip the path from the names of embedded resources. Fixes
9123         #68519.
9124
9125 2004-11-04  Raja R Harinath  <rharinath@novell.com>
9126
9127         Fix error message regression: cs0104-2.cs.
9128         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
9129         (AliasEntry.Resolve): Update.
9130         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
9131         'silent' flag.
9132         (RootContext.LookupType): Update.
9133
9134 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
9135
9136         * cs-parser.jay: Add support for handling accessor modifiers
9137         * class: Add support port accessor modifiers and error checking,
9138         define PropertyMethod.Define as virtual (not abstract anymore)
9139         * ecore.cs: Add checking for proeprties access with access modifiers
9140         * iterators.cs: Modify Accessor constructor call based in the modified
9141         constructor
9142 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
9143
9144         * expression.cs (StringConcat): Handle being called twice,
9145         as when we have a concat in a field init with more than two
9146         ctors in the class
9147
9148 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
9149
9150         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
9151         special case explicit implementations, we should always produce
9152         the .property or .event declaration.
9153         
9154         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
9155         since it will not return correct data if people use this
9156         unresolved in the presence of using statements (see test-313).
9157
9158         * class.cs (MethodData.Define): If we are an explicit interface
9159         implementation, set the method name to the full name of the
9160         interface plus the name of the method.  
9161
9162         Notice that using the method.MethodName.GetFullName() does not
9163         work, as it will only contain the name as declared on the source
9164         file (it can be a shorthand in the presence of using statements)
9165         and not the fully qualifed type name, for example:
9166
9167         using System;
9168
9169         class D : ICloneable {
9170                 object ICloneable.Clone ()  {
9171                 }
9172         }
9173
9174         Would produce a method called `ICloneable.Clone' instead of
9175         `System.ICloneable.Clone'.
9176
9177         * namespace.cs (Alias.Resolve): Use GetPartialName.
9178         
9179 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
9180
9181         * cs-parser.jay: Add error 1055 report.
9182
9183 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
9184
9185         * assign.cs (Assign.DoResolve): Only do the transform of
9186         assignment into a New if the types are compatible, if not, fall
9187         through and let the implicit code deal with the errors and with
9188         the necessary conversions. 
9189
9190 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
9191
9192         * cs-parser.jay: Add error 1031 report.
9193
9194         * cs-tokenizer.cs: Add location for error 1038.
9195
9196 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
9197
9198         * cs-parser.jay: Add error 1016 report.
9199
9200 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
9201
9202         * cs-parser.jay: Add errors 1575,1611 report.
9203
9204 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
9205
9206         * cs-parser.jay: Add error 1001 report.
9207
9208 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
9209
9210         Fix #68850
9211         * attribute.cs (GetMarshal): Add method argument for
9212         caller identification.
9213
9214         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
9215         agument for GetMarshal and RuntimeMissingSupport.
9216
9217 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
9218
9219         * attribute.cs (ExtractSecurityPermissionSet): Removed
9220         TypeManager.code_access_permission_type.
9221
9222         * typemanager.cs: Removed TypeManager.code_access_permission_type.
9223
9224 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
9225
9226         * expression.cs (LocalVariableReference.DoResolveLValue): Check
9227         for obsolete use of a variable here.   Fixes regression on errors
9228         cs0619-25 and cs0619-26.
9229
9230 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
9231
9232         Fix #62358, implemented security attribute encoding.
9233
9234         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
9235         Tests permitted SecurityAction for assembly or other types.
9236         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
9237         data from SecurityPermissionAttribute to PermisionSet class.
9238
9239         * class.cs (ApplyAttributeBuilder): Added special handling
9240         for System.Security.Permissions.SecurityAttribute based types.
9241
9242         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
9243         special handling for System.Security.Permissions.SecurityAttribute
9244         based types.
9245
9246         * enum.cs (ApplyAttributeBuilder): Added special handling
9247         for System.Security.Permissions.SecurityAttribute based types.
9248
9249         * parameter.cs (ApplyAttributeBuilder): Added special handling
9250         for System.Security.Permissions.SecurityAttribute based types.
9251
9252         * rootcontext.cs: Next 2 core types.
9253
9254         * typemanager.cs (TypeManager.security_permission_attr_type):
9255         Built in type for the SecurityPermission Attribute.
9256         (code_access_permission_type): Build in type.
9257
9258 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
9259
9260         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
9261         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
9262         all of this information into
9263         EmitContext.EmitCapturedVariableInstance.
9264         
9265         * codegen.cs (EmitCapturedVariableInstance): move here the
9266         funcionality of emitting an ldarg.0 in the presence of a
9267         remapping.   This centralizes the instance emit code.
9268
9269         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
9270         then emit a load of this: it means that we have reached the
9271         topmost ScopeInfo: the one that contains the pointer to the
9272         instance of the class hosting the anonymous method.
9273
9274         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
9275         captures to the topmost CaptureContext.
9276
9277 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
9278
9279         * expression.cs (LocalVariableReference): Move the knowledge about
9280         the iterators into codegen's EmitCapturedVariableInstance.
9281
9282 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
9283
9284         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
9285         all code paths return a value from an anonymous method (it is the
9286         same as the 161 error, but for anonymous methods).
9287
9288 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
9289
9290         The introduction of anonymous methods in the compiler changed
9291         various ways of doing things in the compiler.  The most
9292         significant one is the hard split between the resolution phase
9293         and the emission phases of the compiler.
9294
9295         For instance, routines that referenced local variables no
9296         longer can safely create temporary variables during the
9297         resolution phase: they must do so from the emission phase,
9298         since the variable might have been "captured", hence access to
9299         it can not be done with the local-variable operations from the runtime.
9300         
9301         * statement.cs 
9302
9303         (Block.Flags): New flag `IsTopLevel' to indicate that this block
9304         is a toplevel block.
9305
9306         (ToplevelBlock): A new kind of Block, these are the blocks that
9307         are created by the parser for all toplevel method bodies.  These
9308         include methods, accessors and anonymous methods.
9309
9310         These contain some extra information not found in regular blocks:
9311         A pointer to an optional CaptureContext (for tracking captured
9312         local variables and parameters).  A pointer to the parent
9313         ToplevelBlock.
9314         
9315         (Return.Resolve): Catch missmatches when returning a value from an
9316         anonymous method (error 1662).
9317         Invoke NeedReturnLabel from the Resolve phase instead of the emit
9318         phase.
9319
9320         (Break.Resolve): ditto.
9321
9322         (SwitchLabel): instead of defining the labels during the
9323         resolution phase, we now turned the public ILLabel and ILLabelCode
9324         labels into methods called GetILLabelCode() and GetILLabel() that
9325         only define the label during the Emit phase.
9326
9327         (GotoCase): Track the SwitchLabel instead of the computed label
9328         (its contained therein).  Emit the code by using
9329         SwitchLabel.GetILLabelCode ().
9330
9331         (LocalInfo.Flags.Captured): A new flag has been introduce to track
9332         whether the Local has been captured or not.
9333
9334         (LocalInfo.IsCaptured): New property, used to tell whether the
9335         local has been captured.
9336         
9337         * anonymous.cs: Vastly updated to contain the anonymous method
9338         support.
9339
9340         The main classes here are: CaptureContext which tracks any
9341         captured information for a toplevel block and ScopeInfo used to
9342         track the activation frames for various local variables.   
9343
9344         Each toplevel block has an optional capture context associated
9345         with it.  When a method contains an anonymous method both the
9346         toplevel method and the anonymous method will create a capture
9347         context.   When variables or parameters are captured, they are
9348         recorded on the CaptureContext that owns them, for example:
9349
9350         void Demo () {
9351              int a;
9352              MyDelegate d = delegate {
9353                  a = 1;
9354              }
9355         }
9356
9357         Here `a' will be recorded as captured on the toplevel
9358         CapturedContext, the inner captured context will not have anything
9359         (it will only have data if local variables or parameters from it
9360         are captured in a nested anonymous method.
9361
9362         The ScopeInfo is used to track the activation frames for local
9363         variables, for example:
9364
9365         for (int i = 0; i < 10; i++)
9366                 for (int j = 0; j < 10; j++){
9367                    MyDelegate d = delegate {
9368                         call (i, j);
9369                    }
9370                 }
9371
9372         At runtime this captures a single captured variable `i', but it
9373         captures 10 different versions of the variable `j'.  The variable
9374         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
9375         recorded on a child.  
9376
9377         The toplevel ScopeInfo will also track information like the `this'
9378         pointer if instance variables were referenced (this is necessary
9379         as the anonymous method lives inside a nested class in the host
9380         type of the method). 
9381
9382         (AnonymousMethod): Expanded to track the Toplevel, implement
9383         `AnonymousMethod.Compatible' to tell whether an anonymous method
9384         can be converted to a target delegate type. 
9385
9386         The routine now also produces the anonymous method content
9387
9388         (AnonymousDelegate): A helper class that derives from
9389         DelegateCreation, this is used to generate the code necessary to
9390         produce the delegate for the anonymous method that was created. 
9391
9392         * assign.cs: API adjustments for new changes in
9393         Convert.ImplicitStandardConversionExists.
9394
9395         * class.cs: Adjustments to cope with the fact that now toplevel
9396         blocks are of type `ToplevelBlock'. 
9397
9398         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
9399         insteda of standard blocks.
9400
9401         Flag errors if params arguments are passed to anonymous methods.
9402
9403         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
9404         `CurrentAnonymousMethod' which points to the current Anonymous
9405         Method.  The variable points to the AnonymousMethod class that
9406         holds the code being compiled.  It is set in the new EmitContext
9407         created for the anonymous method.
9408
9409         (EmitContext.Phase): Introduce a variable and an enumeration to
9410         assist in enforcing some rules about when and where we are allowed
9411         to invoke certain methods (EmitContext.NeedsReturnLabel is the
9412         only one that enfonces this right now).
9413
9414         (EmitContext.HaveCaptureInfo): new helper method that returns
9415         whether we have a CapturedContext initialized.
9416
9417         (EmitContext.CaptureVariable): New method used to register that a
9418         LocalInfo must be flagged for capturing. 
9419
9420         (EmitContext.CapturedParameter): New method used to register that a
9421         parameters must be flagged for capturing. 
9422         
9423         (EmitContext.CapturedField): New method used to register that a
9424         field must be flagged for capturing. 
9425
9426         (EmitContext.HaveCapturedVariables,
9427         EmitContext.HaveCapturedFields): Return whether there are captured
9428         variables or fields. 
9429
9430         (EmitContext.EmitMethodHostInstance): This is used to emit the
9431         instance for the anonymous method.  The instance might be null
9432         (static methods), this (for anonymous methods that capture nothing
9433         and happen to live side-by-side with the current method body) or a
9434         more complicated expression if the method has a CaptureContext.
9435
9436         (EmitContext.EmitTopBlock): Routine that drives the emission of
9437         code: it will first resolve the top block, then emit any metadata
9438         and then emit the code.  The split is done so that we can extract
9439         any anonymous methods and flag any captured variables/parameters.
9440         
9441         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
9442         during this phase, the ILGenerator should not be used as labels
9443         and local variables declared here might not be accessible to any
9444         code that is part of an anonymous method.  
9445
9446         Exceptions to this include the temporary variables that are
9447         created by some statements internally for holding temporary
9448         variables. 
9449         
9450         (EmitContext.EmitMeta): New routine, in charge of emitting all the
9451         metadata for a cb
9452
9453         (EmitContext.TemporaryReturn): This method is typically called
9454         from the Emit phase, and its the only place where we allow the
9455         ReturnLabel to be defined other than the EmitMeta.  The reason is
9456         that otherwise we would have to duplicate a lot of logic in the
9457         Resolve phases of various methods that today is on the Emit
9458         phase. 
9459
9460         (EmitContext.NeedReturnLabel): This no longer creates the label,
9461         as the ILGenerator is not valid during the resolve phase.
9462
9463         (EmitContext.EmitThis): Extended the knowledge in this class to
9464         work in anonymous methods in addition to iterators. 
9465
9466         (EmitContext.EmitCapturedVariableInstance): This emits whatever
9467         code is necessary on the stack to access the instance to a local
9468         variable (the variable will be accessed as a field).
9469
9470         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
9471         EmitContext.EmitAddressOfParameter): Routines to support
9472         parameters (not completed at this point). 
9473         
9474         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
9475         will also remove the parameters.
9476
9477         * convert.cs (Convert): Define a `ConstantEC' which points to a
9478         null.  This is just to prefity some code that uses
9479         ImplicitStandardConversion code and do not have an EmitContext
9480         handy.
9481
9482         The idea is to flag explicitly that at that point in time, it is
9483         known that the conversion will not trigger the delegate checking
9484         code in implicit conversions (which requires a valid
9485         EmitContext). 
9486
9487         Everywhere: pass new EmitContext parameter since
9488         ImplicitStandardConversionExists now requires it to check for
9489         anonymous method conversions. 
9490
9491         (Convert.ImplicitStandardConversionExists): If the type of an
9492         expression is the anonymous_method_type, and the type is a
9493         delegate, we invoke the AnonymousMethod.Compatible method to check
9494         whether an implicit conversion is possible. 
9495
9496         (Convert.ImplicitConversionStandard): Only do implicit method
9497         group conversions if the language level is not ISO_1.
9498
9499         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
9500         MethodInfo for the Invoke method.  used by Delegate and
9501         AnonymousDelegate.
9502
9503         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
9504         method conversions if the target type is a delegate.
9505
9506         Removed extra debugging nops.
9507
9508         (LocalVariableReference): Turn the `local_info' into a public
9509         field. 
9510
9511         Add `prepared' field, the same hack used for FieldExprs to cope
9512         with composed assignments, as Local variables do not necessarily
9513         operate purely on the stack as they used to: they can be captured
9514         fields. 
9515
9516         Add `temp' for a temporary result, like fields.
9517
9518         Refactor DoResolve and DoResolveLValue into DoResolveBase.
9519
9520         It now copes with Local variables that are captured and emits the
9521         proper instance variable to load it from a field in the captured
9522         case. 
9523
9524         (ParameterReference.DoResolveBase): During the resolve phase,
9525         capture parameters if we are in an anonymous method.
9526
9527         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
9528         anonymous method, use the EmitContext helper routines to emit the
9529         parameter reference.
9530
9531         * iterators.cs: Set RemapToProxy to true/false during the
9532         EmitDispose class.
9533
9534         * parameters.cs (GetParameterByName): New helper method. 
9535
9536         * typemanager.cs (anonymous_method_type) a new type that
9537         represents an anonyous method.  This is always an internal type,
9538         used as a fencepost to test against the anonymous-methodness of an
9539         expression. 
9540         
9541 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
9542
9543         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
9544         561 report.
9545         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
9546
9547 2004-10-18  Martin Baulig  <martin@ximian.com>
9548
9549         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
9550         `Type' directly, but call ResolveType() on it.
9551         (Catch.Resolve): Likewise.
9552         (Foreach.Resolve): Likewise.
9553
9554 2004-10-18  Martin Baulig  <martin@ximian.com>
9555
9556         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
9557         `Type' directly, but call ResolveType() on it.
9558         (Probe.DoResolve): Likewise.
9559         (ArrayCreation.LookupType): Likewise.
9560         (TypeOf.DoResolve): Likewise.
9561         (SizeOf.DoResolve): Likewise.
9562
9563 2004-10-18  Martin Baulig  <martin@ximian.com>
9564
9565         * expression.cs (Invocation.BetterFunction): Put back
9566         TypeManager.TypeToCoreType().
9567
9568 2004-10-18  Raja R Harinath  <rharinath@novell.com>
9569
9570         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
9571         the ResolveType.
9572
9573 2004-10-18  Martin Baulig  <martin@ximian.com>
9574
9575         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
9576         `Type' directly, but call ResolveType() on it.
9577
9578 2004-10-18  Martin Baulig  <martin@ximian.com>
9579
9580         * class.cs (FieldMember.Define): Don't access the TypeExpr's
9581         `Type' directly, but call ResolveType() on it.
9582         (MemberBase.DoDefine): Likewise.
9583
9584         * expression.cs (New.DoResolve): Don't access the TypeExpr's
9585         `Type' directly, but call ResolveType() on it.
9586         (ComposedCast.DoResolveAsTypeStep): Likewise.
9587
9588         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
9589         `Type' directly, but call ResolveType() on it.
9590
9591 2004-10-17  John Luke  <john.luke@gmail.com>
9592
9593         * class.cs (Operator.GetSignatureForError): use CSharpName
9594
9595         * parameter.cs (Parameter.GetSignatureForError): Returns
9596         correct name even if was not defined.
9597
9598 2004-10-13  Raja R Harinath  <rharinath@novell.com>
9599
9600         Fix #65816.
9601         * class.cs (TypeContainer.EmitContext): New property.
9602         (DefineNestedTypes): Create an emitcontext for each part.
9603         (MethodCore.DoDefineParameters): Use container's emitcontext.
9604         Pass type array to InternalParameters.
9605         (MemberBase.DoDefine): Use container's emitcontext.
9606         (FieldMember.Define): Likewise.
9607         (Event.Define): Likewise.
9608         (SetMethod.GetParameterInfo): Change argument to EmitContext.
9609         Pass type array to InternalParameters.
9610         (SetIndexerMethod.GetParameterInfo): Likewise.
9611         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
9612         * delegate.cs (Define): Pass emitcontext to
9613         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
9614         array to InternalParameters.
9615         * expression.cs (ParameterReference.DoResolveBase): Pass
9616         emitcontext to GetParameterInfo.
9617         (ComposedCast.DoResolveAsTypeStep): Remove check on
9618         ec.ResolvingTypeTree.
9619         * parameter.cs (Parameter.Resolve): Change argument to
9620         EmitContext.  Use ResolveAsTypeTerminal.
9621         (Parameter.GetSignature): Change argument to EmitContext.
9622         (Parameters.ComputeSignature): Likewise.
9623         (Parameters.ComputeParameterTypes): Likewise.
9624         (Parameters.GetParameterInfo): Likewise.
9625         (Parameters.ComputeAndDefineParameterTypes): Likewise.
9626         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
9627         * support.cs (InternalParameters..ctor): Remove variant that takes
9628         a DeclSpace.
9629         * typemanager.cs (system_intptr_expr): New.
9630         (InitExpressionTypes): Initialize it.
9631
9632 2004-10-12  Chris Toshok  <toshok@ximian.com>
9633
9634         * cs-parser.jay: fix location for try_statement and catch_clause.
9635
9636 2004-10-11  Martin Baulig  <martin@ximian.com>
9637
9638         * report.cs: Don't make --fatal abort on warnings, we have
9639         -warnaserror for that.
9640
9641 2004-10-07  Raja R Harinath  <rharinath@novell.com>
9642
9643         More DeclSpace.ResolveType avoidance.
9644         * decl.cs (MemberCore.InUnsafe): New property.
9645         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
9646         with newly created EmitContext.
9647         (FieldMember.Define): Likewise.
9648         * delegate.cs (Delegate.Define): Likewise.
9649         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
9650         only if normal name-lookup fails.
9651         (TypeExpr.DoResolve): Enable error-checking.
9652         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
9653         (SizeOf.DoResolve): Likewise.
9654         (ComposedCast.DoResolveAsTypeStep): Likewise.
9655         (StackAlloc.DoResolve): Likewise.
9656         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
9657         (Block.Unsafe): New property.
9658         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
9659         (Unsafe): Set 'unsafe' flag of contained block.
9660         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
9661         (Fixed.Resolve): Likewise.
9662         (Catch.Resolve): Likewise.
9663         (Using.ResolveLocalVariableDecls): Likewise.
9664         (Foreach.Resolve): Likewise.
9665
9666 2004-10-05  John Luke <john.luke@gmail.com>
9667
9668         * cs-parser.jay: add location to error CS0175
9669
9670 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
9671
9672         * ecore.cs (Expression.Constantity): Add support for turning null
9673         into a constant.
9674
9675         * const.cs (Const.Define): Allow constants to be reference types
9676         as long as the value is Null.
9677
9678 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
9679
9680         * namespace.cs (NamespaceEntry.Using): No matter which warning
9681         level is set, check if this namespace name has already been added.
9682
9683 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
9684
9685         * expression.cs: reftype [!=]= null should always use br[true,false].
9686         # 67410
9687
9688 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
9689
9690         Fix #67108
9691         * attribute.cs: Enum conversion moved to 
9692         GetAttributeArgumentExpression to be applied to the all
9693         expressions.
9694
9695 2004-10-01  Raja R Harinath  <rharinath@novell.com>
9696
9697         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
9698         * class.c (TypeContainer.DefineType): Flag error if
9699         base types aren't accessible due to access permissions.
9700         * decl.cs (DeclSpace.ResolveType): Move logic to
9701         Expression.ResolveAsTypeTerminal.
9702         (DeclSpace.ResolveTypeExpr): Thin layer over
9703         Expression.ResolveAsTypeTerminal.
9704         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
9705         Refactor code into NestedAccess.  Use it.
9706         (DeclSpace.NestedAccess): New.
9707         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
9708         argument to silence errors.  Check access permissions.
9709         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
9710         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
9711         (Cast.DoResolve): Likewise.
9712         (New.DoResolve): Likewise.
9713         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
9714         (TypeOf.DoResolve): Likewise.
9715
9716         * expression.cs (Invocation.BetterConversion): Return the Type of
9717         the better conversion.  Implement section 14.4.2.3 more faithfully.
9718         (Invocation.BetterFunction): Make boolean.  Make correspondence to
9719         section 14.4.2.2 explicit.
9720         (Invocation.OverloadResolve): Update.
9721         (Invocation): Remove is_base field.
9722         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
9723         (Invocation.Emit): Likewise.
9724
9725 2004-09-27  Raja R Harinath  <rharinath@novell.com>
9726
9727         * README: Update to changes.
9728
9729 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
9730
9731         * cs-parser.jay: Reverted 642 warning fix.
9732
9733 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9734
9735         Fix bug #66615
9736         * decl.cs (FindMemberWithSameName): Indexer can have more than
9737         1 argument.
9738
9739 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9740
9741         * expression.cs (LocalVariableReference.DoResolveLValue):
9742         Do not report warning 219 for out values.
9743         (EmptyExpression.Null): New member to avoid extra allocations.
9744
9745 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9746
9747         * cs-parser.jay: Fix wrong warning 642 report.
9748
9749         * cs-tokenizer.cs (CheckNextToken): New helper;
9750         Inspect next character if is same as expected.
9751
9752 2004-09-23  Martin Baulig  <martin@ximian.com>
9753
9754         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9755         (Convert.ImplicitReferenceConversionExists): Likewise.
9756
9757 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9758
9759         * class.cs (Operator.Define): Add error 448 and 559 report.
9760
9761 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9762
9763         * class.cs (MemberBase.IsTypePermitted): New protected
9764         method for checking error CS0610.
9765
9766 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9767
9768         * class.cs (TypeContainer.HasExplicitLayout): New property
9769         Returns whether container has StructLayout attribute set Explicit.
9770         (FieldMember): New abstract class for consts and fields.
9771         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
9772         (Field): Reuse FieldMember.
9773
9774         * const.cs (Const): Reuse FieldMember.
9775
9776         * rootcontext.cs: EmitConstants call moved to class.
9777
9778 2004-09-22  Martin Baulig  <martin@ximian.com>
9779
9780         Thanks to Peter Sestoft for this bug report.
9781
9782         * expression.cs (Conditional): If both the `trueExpr' and the
9783         `falseExpr' is a NullLiteral, return a NullLiteral.
9784
9785 2004-09-22  Martin Baulig  <martin@ximian.com>
9786
9787         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
9788         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
9789         for the "get_Current" call.
9790
9791 2004-09-22  Martin Baulig  <martin@ximian.com>
9792
9793         Marek and me just fixed one of our oldest bugs: #28562 :-)
9794
9795         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
9796
9797         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
9798         we're an EnumConstant, just return that.
9799         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
9800         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
9801         to get the value which'll actually be written into the attribute.
9802         However, we have to use GetValue() to access the attribute's value
9803         in the compiler.        
9804
9805 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9806
9807         * constant.cs (Constant.IsNegative): New abstract property
9808         IsNegative.
9809
9810         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
9811         (StackAlloc.DoResolve): Reused IsNegative.
9812
9813 2004-09-21  Martin Baulig  <martin@ximian.com>
9814
9815         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
9816         if we're used in an iterator, we may be called from different
9817         methods.
9818
9819         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
9820         we actually have an exception block.
9821
9822 2004-09-20  John Luke <jluke@cfl.rr.com>
9823
9824         * class.cs, cs-parser.jay: Improve the error report for 1520:
9825         report the actual line where the error happens, not where the
9826         class was declared.
9827
9828         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
9829         Pass location information that was available elsewhere.
9830
9831 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
9832
9833         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
9834         runtime to delay sign assemblies.
9835
9836 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
9837
9838         * cs-parser.jay: Do not report the stack trace, this is barely
9839         used nowadays.
9840
9841 2004-08-22  John Luke  <john.luke@gmail.com>
9842  
9843         * driver.cs : check that a resource id is not already used
9844         before adding it, report CS1508 if it is, bug #63637
9845
9846 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
9847
9848         * ecore.cs: Removed dead code.
9849
9850 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
9851
9852         * class.cs: Do not report warning CS0067 on the interfaces.
9853
9854 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
9855
9856         * cs-parser.jay: Add error 504 report.
9857
9858 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
9859
9860         * rootcontext.cs: WarningLevel is 4 by default now.
9861
9862         * statement.cs (Fixed.Resolve): Do not null
9863         VariableInfo.
9864
9865 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
9866
9867         Fixed bug #55780
9868         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
9869         deep search when property is not virtual.
9870         (PropertyExpr.ResolveAccessors): Make one call for both
9871         accessors.
9872
9873 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
9874
9875         Fixed bug #65766
9876         * statement.cs: Error 152 report constains also location.
9877
9878 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
9879
9880         Fixed bug #65766
9881         * const.cs: Explicitly set constant as static.
9882
9883 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
9884
9885         Fixed bug #64226
9886         * cs-parser.jay: Add error 1017 report.
9887
9888 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
9889
9890         Fixed bug #59980, #64224
9891         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
9892
9893         * typemanager.cs (IsSpecialMethod): Simplified
9894
9895 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
9896
9897         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
9898         condition with better params.
9899
9900 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
9901
9902         Fixed bug #65238
9903         * attribute.cs (Resolve): Property has to have both
9904         accessors.
9905
9906 2004-09-14  Martin Baulig  <martin@ximian.com>
9907
9908         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
9909
9910 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
9911
9912         Fixed bug #61902
9913         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
9914         called and is obsolete then this member suppress message
9915         when call is inside next [Obsolete] method or type.
9916
9917         * expression.cs: Use TestObsoleteMethodUsage member.
9918
9919 2004-09-14  Martin Baulig  <martin@ximian.com>
9920
9921         * cs-parser.jay: Sync a bit with the GMCS version.
9922
9923 2004-09-14  Martin Baulig  <martin@ximian.com>
9924
9925         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
9926         (CSharpParser.yacc_verbose_flag): New public field.
9927
9928         * genericparser.cs: Removed.
9929
9930 2004-09-14  Raja R Harinath  <rharinath@novell.com>
9931
9932         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
9933
9934 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
9935
9936         * class.cs (MethodCore.CheckBase): Fix bug #65757.
9937
9938 2004-09-10  Martin Baulig  <martin@ximian.com>
9939
9940         Backported my MemberName changes from GMCS into MCS.
9941
9942         - we are now using a special `MemberName' class instead of using
9943         strings; in GMCS, the `MemberName' also contains the type
9944         arguments.
9945
9946         - changed the grammar rules a bit:
9947           * the old `member_name' is now a `namespace_or_type_name':
9948             The rule is that we use `namespace_or_type_name' everywhere
9949             where we expect either a "member name" (GetEnumerator) or a
9950             "member name" with an explicit interface name
9951             (IEnumerable.GetEnumerator).
9952             In GMCS, the explicit interface name may include type arguments
9953             (IEnumerable<T>.GetEnumerator).
9954           * we use `member_name' instead of just `IDENTIFIER' for
9955             "member names":
9956             The rule is that we use `member_name' wherever a member may
9957             have type parameters in GMCS.       
9958
9959         * decl.cs (MemberName): New public class.
9960         (MemberCore.MemberName): New public readonly field.
9961         (MemberCore.ctor): Take a `MemberName' argument, not a string.
9962         (DeclSpace): Likewise.
9963
9964         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
9965         * enum.cs (Enum.ctor): Likewise.
9966
9967         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
9968         MemberName.     
9969         (AliasEntry.ctor): Take a MemberName, not an Expression.
9970         (AliasEntry.UsingAlias): Likewise.
9971
9972         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
9973         (IMethodData.MemberName): Changed type from string to MemberName.
9974         (MemberBase.ExplicitInterfaceName): Likewise.
9975         (AbstractPropertyEventMethod.SetupName): Make this private.
9976         (AbstractPropertyEventMethod.ctor): Added `string prefix'
9977         argument; compute the member name here.
9978         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
9979         on the `member.MemberName' and the `prefix'.
9980
9981         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
9982         not `type_name'.
9983         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
9984         thus, we get a `MemberName' instead of a `string'.  These
9985         declarations may have type parameters in GMCS.
9986         (interface_method_declaration, delegate_declaration): Likewise.
9987         (class_declaration, interface_declaration): Likewise.
9988         (method_header): Use `namespace_or_type_name' instead of
9989         `member_name'.  We may be an explicit interface implementation.
9990         (property_declaration, event_declaration): Likewise.
9991         (member_name): This is now just an `IDENTIFIER', not a
9992         `namespace_or_type_name'.
9993         (type_name, interface_type): Removed.
9994         (namespace_or_type_name): Return a MemberName, not an Expression.
9995         (primary_expression): Use `member_name' instead of `IDENTIFIER';
9996         call GetTypeExpression() on the MemberName to get an expression.
9997         (IndexerDeclaration.interface_type): Changed type from string to
9998         MemberName.
9999         (MakeName): Operate on MemberName's instead of string's.
10000
10001 2004-09-13  Raja R Harinath  <rharinath@novell.com>
10002
10003         Fix bug #55770.
10004         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
10005         (NamespaceEntry.Lookup): Add new argument to flag if we want the
10006         lookup to avoid symbols introduced by 'using'.
10007         * rootcontext.cs (NamespaceLookup): Update.
10008
10009 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
10010
10011         * class.cs (TypeContainer.DoDefineMembers): Do not call
10012         DefineDefaultConstructor for static classes.
10013
10014 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
10015
10016         * attribute.cs (Attribute.Resolve): Add error 653 report.
10017
10018         * class.cs (Class.ApplyAttributeBuilder): Add error 641
10019         report.
10020         (Method.ApplyAttributeBuilder): Add error 685 report.
10021         (Operator.Define): Add error 564 report.
10022
10023         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
10024
10025         * expression.cs (Invocation.DoResolve): Add error
10026         245 and 250 report.
10027
10028         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
10029         error 674 report.
10030
10031 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
10032
10033         * class.cs (ConstructorInitializer.Resolve):
10034         Wrong error number (515->516).
10035
10036 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
10037
10038         * class.cs (Indexer.Define): Add error 631 report.
10039
10040 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
10041
10042         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
10043
10044 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
10045
10046         * expression.cs (Probe.DoResolve): Add error CS0241 report.
10047
10048 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
10049
10050         * cs-parser.jay: Added error CS0241 report.
10051
10052 2004-09-10  Raja R Harinath  <rharinath@novell.com>
10053
10054         * cs-parser.jay (fixed_statement): Introduce a scope for the
10055         declaration in the 'fixed' statement.
10056
10057 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
10058
10059         * cs-parser.jay: Added CS0230 error report.
10060
10061 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
10062
10063         * cs-parser.jay: Added errors CS0231 and CS0257 report.
10064
10065 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
10066
10067         * expression.cs (Argument.Resolve): Added error CS0192 and
10068         CS0199 report.
10069
10070 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
10071
10072         C# 2.0 #pragma warning feature
10073
10074         * cs-tokenizer.cs (PreProcessPragma): New method; 
10075         Handles #pragma directive.
10076
10077         * report.cs (WarningRegions): New class; Support
10078         class for #pragma warning directive. It tests whether
10079         warning is enabled for a given line.
10080
10081 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
10082
10083         * const.cs: Add more descriptive error report, tahnks to
10084         Sebastien. 
10085
10086 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
10087
10088         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
10089
10090 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
10091
10092         * expression.cs: Apply patch from Ben: Remove dead code from
10093         ArrayCreation, and remove the TurnintoConstant call in const.cs,
10094         as that code just threw an exception anwyays.
10095
10096         * const.cs: Remove the call to the turnintoconstant, for details
10097         see bug: #63144
10098         
10099         * literal.cs: The type of the null-literal is the null type;  So
10100         we use a placeholder type (literal.cs:System.Null, defined here)
10101         for it.
10102
10103         * expression.cs (Conditional.DoResolve): Remove some old code that
10104         is no longer needed, conversions have been fixed.
10105
10106         (ArrayCreationExpression.DoResolve): Return false if we fail to
10107         resolve the inner expression.
10108
10109 2004-09-07  Raja R Harinath  <rharinath@novell.com>
10110
10111         Fix test-290.cs.
10112         * cs-parser.jay (delegate_declaration): Record a delegate
10113         declaration as a type declaration.
10114         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
10115
10116 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
10117
10118         * parameter.cs: Do not crash if the type can not be resolved. 
10119
10120         * expression.cs: Report errors with unsafe pointers, fixes #64896
10121
10122 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
10123
10124         * expression.cs: Pointer arith always needs to do a conv.i
10125         if the operand is a long. fix 65320
10126
10127 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
10128
10129         Fixed cs0619-37.cs, cs0619-38.cs
10130
10131         * enum.cs (GetObsoleteAttribute): Removed.
10132
10133         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
10134         on Enum member is double staged. The first is tested member
10135         and then enum.
10136
10137 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
10138
10139         Fixed #56986, #63631, #65231
10140
10141         * class.cs: (TypeContainer.AddToMemberContainer): New method,
10142         adds member to name container.
10143         (TypeContainer.AddToTypeContainer): New method, adds type to
10144         name container.
10145         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
10146         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
10147         AddOperator): Simplified by reusing AddToMemberContainer.
10148         (TypeContainer.UserDefinedStaticConstructor): Changed to property
10149         instead of field.
10150         (Method.CheckForDuplications): Fixed implementation to test all
10151         possibilities.
10152         (MemberBase): Detection whether member is explicit interface
10153         implementation is now in constructor.
10154         (MemberBase.UpdateMemberName): Handles IndexerName.
10155         (Accessor): Changed to keep also location information.
10156         (AbstractPropertyEventMethod): Is derived from MemberCore.
10157         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
10158         will be emited or not.
10159         (PropertyBase.AreAccessorsDuplicateImplementation):
10160         Tests whether accessors are not in collision with some method.
10161         (Operator): Is derived from MethodCore to simplify common
10162         operations.
10163
10164         * decl.cs (Flags.TestMethodDuplication): Test for duplication
10165         must be performed.
10166         (DeclSpace.AddToContainer): Adds the member to defined_names
10167         table. It tests for duplications and enclosing name conflicts.
10168
10169         * enum.cs (EnumMember): Clean up to reuse the base structures
10170
10171 2004-09-03  Martin Baulig  <martin@ximian.com>
10172
10173         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
10174         into TypeContainer, to make partial classes work again.
10175
10176 2004-09-03  Martin Baulig  <martin@ximian.com>
10177
10178         * rootcontext.cs (RootContext.V2): Removed.
10179
10180 2004-03-23  Martin Baulig  <martin@ximian.com>
10181
10182         * expression.cs (Invocation.OverloadResolve): Added `bool
10183         may_fail' argument and use it instead of the Location.IsNull() hack.
10184
10185 2004-09-03  Martin Baulig  <martin@ximian.com>
10186
10187         Merged latest changes into gmcs.  Please keep this comment in
10188         here, it makes it easier for me to see what changed in MCS since
10189         the last time I merged.
10190
10191 2004-09-03  Raja R Harinath  <rharinath@novell.com>
10192
10193         Fix #61128.
10194         * expression.cs (BetterConversion): Don't allow either conversion 
10195         to be null.  Remove redundant implicit conversion test when 'q ==
10196         null' -- when this function is invoked, we already know that the
10197         implicit conversion exists.
10198         (BetterFunction): Assume that 'best' is non-null.  Remove
10199         redundant reimplementation of IsApplicable when 'best' is null.
10200         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
10201         number of arguments.
10202         (IsAncestralType): Extract from OverloadResolve.
10203         (OverloadResolve): Make robust to the MethodGroupExpr being
10204         unsorted.  Implement all the logic of Section 14.5.5.1, and
10205         support overloading of methods from multiple applicable types.
10206         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
10207
10208         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
10209         (RealError, Warning): Append type of report to related symbol.
10210
10211 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
10212
10213         * enum.cs: Fixed CLS-Compliance checks for enum members.
10214         Error tests cs3008-8.cs, cs3014-8.cs
10215
10216 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
10217
10218         Fixed bug #62342, #63102
10219         * class.cs: ImplementIndexer uses member.IsExplicitImpl
10220         like ImplementMethod.
10221
10222 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
10223
10224         * attribute.cs (Attribute.GetAttributeArgumentExpression):
10225         Fixed bug #65170.
10226
10227 2004-09-02  Martin Baulig  <martin@ximian.com>
10228
10229         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
10230         TypeManager.GetArgumentTypes() rather than calling GetParameters()
10231         on the MethodBase.
10232
10233 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
10234
10235         C# 2.0 Static classes implemented
10236
10237         * class.cs (TypeContainer): instance_constructors,
10238         initialized_fields, initialized_static_fields,
10239         default_constructor, base_inteface_types are protected to be
10240         accessible from StaticClass.
10241         (TypeContainer.DefineDefaultConstructor): New virtual method
10242         for custom default constructor generating
10243         (StaticClass): New class to handle "Static classes" feature.
10244
10245         * cs-parser.jay: Handle static keyword on class like instance
10246         of StaticClass.
10247
10248         * driver.cs: Added "/langversion" command line switch with two
10249         options (iso-1, default).
10250
10251 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
10252
10253         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
10254
10255 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
10256
10257         * delegate.cs: Style.
10258
10259 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10260
10261         * delegate.cs: Add seperate instance expr field for miguel.
10262
10263 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10264
10265         * PointerArithmetic (Resolve): make sure we are not doing
10266         pointer arith on void*. Also, make sure we are resolved
10267         by not setting eclass until resolve.
10268
10269         All callers: Make sure that PointerArithmetic gets resolved.
10270
10271 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10272
10273         * ArrayCreation (LookupType): If the type does not resolve 
10274         to an array, give an error.
10275
10276 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
10277
10278         * statement.cs (Try.Resolve): Fixed bug #64222
10279
10280 2004-08-27  Martin Baulig  <martin@ximian.com>
10281
10282         * class.cs
10283         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
10284         crash here.     
10285
10286 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
10287
10288         * ecore.cs (Constantify): Get underlying type via
10289         System.Enum.GetUnderlyingType to avoid StackOverflow on the
10290         Windows in special cases.
10291
10292 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
10293
10294         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
10295         for obtaining also private methods.
10296         (GetRemoveMethod): Used GetRemoveMethod (true)
10297         for obtaining also private methods.
10298
10299 2004-08-24  Martin Baulig  <martin@ximian.com>
10300
10301         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
10302         MethodAttributes.HideBySig for operators.
10303
10304 2004-08-23  Martin Baulig  <martin@ximian.com>
10305
10306         Back to the old error reporting system :-)
10307
10308         * report.cs (Message): Removed.
10309         (Report.MessageData, ErrorData, WarningData): Removed.
10310         (Report.Error, Warning): Back to the old system.
10311
10312 2004-08-23  Martin Baulig  <martin@ximian.com>
10313
10314         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
10315
10316         * class.cs (TypeContainer.ParentContainer): New public virtual
10317         method; replaces the explicit interface implementation.
10318         (ClassPart.ParentContainer): Override.
10319
10320 2004-08-23  Martin Baulig  <martin@ximian.com>
10321
10322         * statement.cs (Switch): Added support for constant switches; see
10323         #59428 or test-285.cs.
10324
10325 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
10326
10327         Fixed bug #62740.
10328         * statement.cs (GetEnumeratorFilter): Removed useless
10329         logic because C# specs is strict. GetEnumerator must be
10330         public.
10331
10332 2004-08-22  Martin Baulig  <martin@ximian.com>
10333
10334         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10335         a switch and may break, reset the barrier.  Fixes #59867.
10336
10337 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
10338
10339         CLS-Compliance speed up (~5% for corlib)
10340
10341         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
10342         New method. Tests container for CLS-Compliant names
10343
10344         * class.cs (TypeContainer.VerifyClsName): New method.
10345         Checks whether container name is CLS Compliant.
10346         (Constructor): Implements IMethodData.
10347
10348         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
10349         low-case table for CLS Compliance test.
10350         (MemberCache.VerifyClsParameterConflict): New method.
10351         Checks method parameters for CS3006 error.
10352
10353         * enum.cs (EnumMember): Is derived from MemberCore.
10354         (Enum.VerifyClsName): Optimized for better performance.
10355
10356 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
10357
10358         * report.cs: Renamed Error_T to Error and changed all
10359         references.
10360
10361 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
10362
10363         * class.cs (TypeContainer.IndexerArrayList): New inner class
10364         container for indexers.
10365         (TypeContainer.DefaultIndexerName): New constant for default
10366         indexer name. Replaced all "Item" with this constant.
10367         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
10368
10369         * typemanager.cs (TypeManager.default_member_ctor): Cache here
10370         DefaultMemberAttribute constructor.
10371
10372 2004-08-05  Martin Baulig  <martin@ximian.com>
10373
10374         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
10375         Fix bug #59429.
10376
10377 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
10378
10379         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
10380         multi platforms problem.
10381
10382         * compiler.csproj: Included shared files.
10383
10384 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
10385
10386         Fix bug 60333, 55971 in the more general way
10387         * attribute.cs (Attribute.GetAttributeArgumentExpression):
10388         Added arg_type argument for constant conversion.
10389         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
10390
10391 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
10392
10393         Fix bug #59760
10394         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
10395         OperatorArrayList, MethodCoreArrayList for typecontainer
10396         containers. Changed class member types to these new types.
10397         (MethodArrayList.DefineMembers): Added test for CS0659.
10398
10399 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
10400
10401         * cfold.cs: Synchronize the folding with the code in expression.cs
10402         Binary.DoNumericPromotions for uint operands.
10403
10404         * attribute.cs: Revert patch from Raja, it introduced a regression
10405         while building Blam-1.2.1 (hard to isolate a test case).
10406
10407 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
10408
10409         Fix for #55382
10410         * class.cs:
10411         (TypeContainer.Define): Renamed to DefineContainerMembers because of
10412         name collision.
10413         (MethodCore.parent_method): New member. The method we're overriding
10414         if this is an override method.
10415         (MethodCore.CheckBase): Moved from Method class and made common.
10416         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
10417         private.
10418         (MethodCore.CheckForDuplications): New abstract method. For custom
10419         member duplication search in a container
10420         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
10421         method and its return type.
10422         (Event.conflict_symbol): New member. Symbol with same name in the
10423         parent class.
10424
10425         * decl.cs:
10426         (MemberCache.FindMemberWithSameName): New method. The method
10427         is looking for conflict with inherited symbols.
10428
10429 2004-08-04  Martin Baulig  <martin@ximian.com>
10430
10431         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
10432
10433         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
10434
10435 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
10436
10437         * report.cs (Message): New enum for better error, warning reference in
10438         the code.
10439         (MessageData): New inner abstract class. It generally handles printing of
10440         error and warning messages.
10441         Removed unused Error, Warning, Message methods.
10442
10443 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
10444
10445         Fix for cs0592-8.cs test
10446         * attribute.cs
10447         (Attributable.ValidAttributeTargets): Made public.
10448         (Attribute.ExplicitTarget): New member for explicit target value.
10449         (Attribute.CheckTargets): Now we translate explicit attribute
10450         target to Target here.
10451
10452 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
10453
10454         * ecore.cs (MethodGroupExpr): new IsBase property.
10455
10456         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
10457
10458         * delegate.cs (DelegateCreation): store a MethodGroupExpr
10459         rather than an instance expr.
10460
10461         (DelegateCreation.Emit): Use the method group rather than
10462         the instance expression. Also, if you have base.Foo as the
10463         method for a delegate, make sure to emit ldftn, not ldftnvirt.
10464
10465         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
10466
10467         (NewDelegate.DoResolve): Only check for the existance of Invoke
10468         if the method is going to be needed. Use MethodGroupExpr.
10469
10470         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
10471
10472         * expression.cs: For pointer arith., make sure to use
10473         the size of the type, not the size of the pointer to
10474         the type.
10475
10476 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
10477
10478         Fix for #60722
10479         * class.cs (Class): Added error CS0502 test.
10480
10481 2004-08-03  John Luke  <jluke@cfl.rr.com>
10482             Raja R Harinath  <rharinath@novell.com>
10483
10484         Fix for #60997.
10485         * attribute.cs (Attribute.complained_before): New flag.
10486         (Attribute.ResolveType, Attribute.Resolve),
10487         (Attribute.DefinePInvokeMethod): Set it.
10488         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
10489         
10490 2004-08-03  Martin Baulig  <martin@ximian.com>
10491
10492         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
10493         use a user-defined operator; we still need to do numeric
10494         promotions in case one argument is a builtin type and the other
10495         one has an implicit conversion to that type.  Fixes #62322.
10496
10497 2004-08-02  Martin Baulig  <martin@ximian.com>
10498
10499         * statement.cs (LocalInfo.Flags): Added `IsThis'.
10500         (LocalInfo.IsThis): New public property.
10501         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
10502
10503 2004-08-01  Martin Baulig  <martin@ximian.com>
10504
10505         * class.cs (TypeContainer.GetClassBases): Don't set the default
10506         here since we may get called from GetPartialBases().
10507         (TypeContainer.DefineType): If GetClassBases() didn't return a
10508         parent, use the default one.
10509
10510 2004-07-30  Duncan Mak  <duncan@ximian.com>
10511
10512         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
10513
10514 2004-07-30  Martin Baulig  <martin@ximian.com>
10515
10516         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
10517
10518         * class.cs (SourceMethod): New public class, derive from the
10519         symbol writer's ISourceMethod.
10520         (Method): Use the new symbol writer API.
10521
10522         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
10523         as argument and use the new symbol writer.
10524
10525         * location.cs
10526         (SourceFile): Implement the symbol writer's ISourceFile.
10527         (Location.SymbolDocument): Removed.
10528         (Location.SourceFile): New public property.
10529
10530         * symbolwriter.cs: Use the new symbol writer API.
10531
10532 2004-07-30  Raja R Harinath  <rharinath@novell.com>
10533
10534         * Makefile (install-local): Remove.  Functionality moved to
10535         executable.make.
10536
10537 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
10538
10539         * Makefile: Install mcs.exe.config file together with mcs.exe.
10540         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
10541         correct runtime version.
10542         
10543 2004-07-25  Martin Baulig  <martin@ximian.com>
10544
10545         * class.cs
10546         (TypeContainer.RegisterOrder): Removed, this was unused.
10547         (TypeContainer, interface_order): Removed.
10548         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
10549         TypeContainer as argument since we can also be called with a
10550         `PartialContainer' for a partial class/struct/interface.
10551         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
10552         of checking whether we're an `Interface' - we could be a
10553         `PartialContainer'.
10554         (PartialContainer.Register): Override; call
10555         AddClass()/AddStruct()/AddInterface() on our parent.
10556
10557         * cs-parser.jay (interface_member_declaration): Add things to the
10558         `current_container', not the `current_class'.
10559
10560         * rootcontext.cs (RegisterOrder): The overloaded version which
10561         takes an `Interface' was unused, removed.
10562
10563         * typemanager.cs (TypeManager.LookupInterface): Return a
10564         `TypeContainer', not an `Interface'.
10565         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
10566         contain a `PartialContainer' for an interface, so check it's
10567         `Kind' to figure out what it is.
10568
10569 2004-07-25  Martin Baulig  <martin@ximian.com>
10570
10571         * class.cs (Class.DefaultTypeAttributes): New public constant.
10572         (Struct.DefaultTypeAttributes): Likewise.
10573         (Interface.DefaultTypeAttributes): Likewise.
10574         (PartialContainer.TypeAttr): Override this and add the
10575         DefaultTypeAttributes.
10576
10577 2004-07-25  Martin Baulig  <martin@ximian.com>
10578
10579         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
10580         we can just use the `Parent' field instead.
10581
10582 2004-07-25  Martin Baulig  <martin@ximian.com>
10583
10584         * class.cs (TypeContainer.Emit): Renamed to EmitType().
10585
10586 2004-07-25  Martin Baulig  <martin@ximian.com>
10587
10588         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
10589         our parts before defining any methods.
10590         (TypeContainer.VerifyImplements): Make this virtual.
10591         (ClassPart.VerifyImplements): Override and call VerifyImplements()
10592         on our PartialContainer.
10593
10594 2004-07-25  Martin Baulig  <martin@ximian.com>
10595
10596         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
10597
10598         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
10599         argument, we can just use the `Parent' field instead.
10600
10601         * class.cs
10602         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
10603         (MemberBase.DoDefine): Likewise.
10604
10605 2004-07-24  Martin Baulig  <martin@ximian.com>
10606
10607         * decl.cs (MemberCore.Parent): New public field.
10608         (DeclSpace.Parent): Moved to MemberCore.
10609
10610         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
10611         (MemberBase.ctor): Added TypeContainer argument, pass it to our
10612         parent's .ctor.
10613         (FieldBase, Field, Operator): Likewise.
10614         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
10615         (EventField, Event): Likewise.
10616
10617 2004-07-23  Martin Baulig  <martin@ximian.com>
10618
10619         * class.cs (PartialContainer): New public class.
10620         (ClassPart): New public class.
10621         (TypeContainer): Added support for partial classes.
10622         (TypeContainer.GetClassBases): Splitted some of the functionality
10623         out into GetNormalBases() and GetPartialBases().
10624
10625         * cs-tokenizer.cs (Token.PARTIAL): New token.
10626         (Tokenizer.consume_identifier): Added some hacks to recognize
10627         `partial', but only if it's immediately followed by `class',
10628         `struct' or `interface'.
10629
10630         * cs-parser.jay: Added support for partial clases.
10631
10632 2004-07-23  Martin Baulig  <martin@ximian.com>
10633
10634         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
10635         a `DeclSpace' and also made it readonly.
10636         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
10637         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
10638         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
10639
10640         * cs-parser.jay: Pass the `current_class', not the
10641         `current_container' (at the moment, this is still the same thing)
10642         to a new Method, Property, Event, Indexer or Constructor.
10643
10644 2004-07-23  Martin Baulig  <martin@ximian.com>
10645
10646         * cs-parser.jay (CSharpParser): Added a new `current_class' field
10647         and removed the `current_interface' one.
10648         (struct_declaration, class_declaration, interface_declaration):
10649         Set `current_class' to the newly created class/struct/interface;
10650         set their `Bases' and call Register() before parsing their body.
10651
10652 2004-07-23  Martin Baulig  <martin@ximian.com>
10653
10654         * class.cs (Kind): New public enum.
10655         (TypeContainer): Made this class abstract.
10656         (TypeContainer.Kind): New public readonly field.
10657         (TypeContainer.CheckDef): New public method; moved here from
10658         cs-parser.jay.
10659         (TypeContainer.Register): New public abstract method.
10660         (TypeContainer.GetPendingImplementations): New public abstract
10661         method.
10662         (TypeContainer.GetClassBases): Removed the `is_class' and
10663         `is_iface' parameters.
10664         (TypeContainer.DefineNestedTypes): Formerly known as
10665         DoDefineType().
10666         (ClassOrStruct): Made this class abstract.
10667
10668         * tree.cs (RootTypes): New public type. 
10669
10670 2004-07-20  Martin Baulig  <martin@ximian.com>
10671
10672         * tree.cs (Tree.RecordNamespace): Removed.
10673         (Tree.Namespaces): Removed.
10674
10675         * rootcontext.cs (RootContext.IsNamespace): Removed.
10676
10677         * cs-parser.jay (namespace_declaration): Just create a new
10678         NamespaceEntry here.
10679
10680 2004-07-20  Martin Baulig  <martin@ximian.com>
10681
10682         * statement.cs (ExceptionStatement): New abstract class.  This is
10683         now used as a base class for everyone who's using `finally'.
10684         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
10685         our local variables before using them.
10686
10687         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
10688         virtual method.  This is used by Yield.Resolve() to "steal" an
10689         outer block's `finally' clauses.
10690         (FlowBranchingException): The .ctor now takes an ExceptionStatement
10691         argument.
10692
10693         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
10694         version which takes an ExceptionStatement.  This version must be
10695         used to create exception branchings.
10696
10697         * iterator.cs
10698         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
10699         (Iterator.EmitMoveNext): Added exception support; protect the
10700         block with a `fault' clause, properly handle 'finally' clauses.
10701         (Iterator.EmitDispose): Run all the `finally' clauses here.
10702
10703 2004-07-20  Martin Baulig  <martin@ximian.com>
10704
10705         * iterator.cs: This is the first of a set of changes in the
10706         iterator code.  Match the spec more closely: if we're an
10707         IEnumerable, then GetEnumerator() must be called.  The first time
10708         GetEnumerator() is called, it returns the current instance; all
10709         subsequent invocations (if any) must create a copy.
10710
10711 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
10712
10713         * expression.cs: Resolve the constant expression before returning
10714         it. 
10715
10716 2004-07-19  Martin Baulig  <martin@ximian.com>
10717
10718         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
10719         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
10720         the return type of the new EmitContext.
10721
10722 2004-07-18  Martin Baulig  <martin@ximian.com>
10723
10724         * class.cs (Property.Define): Fix iterators.
10725
10726         * iterators.cs (Iterator.Define): Moved the
10727         `container.AddInterator (this)' call here from the .ctor; only do
10728         it if we resolved successfully.
10729
10730 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
10731
10732         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
10733         `true' for preprocessing directives that we parse.  The return
10734         value indicates whether we should return to regular tokenizing or
10735         not, not whether it was parsed successfully.
10736
10737         In the past if we were in: #if false ... #line #endif, we would
10738         resume parsing after `#line'.  See bug 61604.
10739
10740         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
10741         building: IsEnumType should return true only for enums, not for
10742         enums or System.Enum itself.  This fixes #61593.
10743
10744         Likely what happened is that corlib was wrong: mcs depended on
10745         this bug in some places.  The bug got fixed, we had to add the
10746         hack, which caused bug 61593.
10747
10748         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
10749         that was a workaround for the older conditions.
10750
10751 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
10752
10753         * assign.cs: IAssignMethod has a new interface, as documented
10754         inline. All assignment code now uses this new api.
10755
10756         * ecore.cs, expression.cs: All classes which implement
10757         IAssignMethod now use the new interface.
10758
10759         * expression.cs (Invocation): add a hack to EmitCall so that
10760         IndexerAccess can be the target of a compound assignment without
10761         evaluating its arguments twice.
10762
10763         * statement.cs: Handle changes in Invocation api.
10764
10765 2004-07-16  Martin Baulig  <martin@ximian.com>
10766
10767         * iterators.cs: Rewrote this.  We're now using one single Proxy
10768         class for both the IEnumerable and the IEnumerator interface and
10769         `Iterator' derives from Class so we can use the high-level API.
10770
10771         * class.cs (TypeContainer.AddIterator): New method.
10772         (TypeContainer.DoDefineType): New protected virtual method, which
10773         is called from DefineType().
10774         (TypeContainer.DoDefineMembers): Call DefineType() and
10775         DefineMembers() on all our iterators.
10776         (TypeContainer.Emit): Call Emit() on all our iterators.
10777         (TypeContainer.CloseType): Call CloseType() on all our iterators.
10778
10779         * codegen.cs (EmitContext.CurrentIterator): New public field.
10780
10781 2004-07-15  Martin Baulig  <martin@ximian.com>
10782
10783         * typemanager.cs
10784         (TypeManager.not_supported_exception_type): New type.   
10785
10786 2004-07-14  Martin Baulig  <martin@ximian.com>
10787
10788         * iterators.cs: Use real error numbers.
10789
10790 2004-07-14  Martin Baulig  <martin@ximian.com>
10791
10792         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
10793         requires this to be a System.Collection.IEnumerable and not a
10794         class implementing that interface.
10795         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
10796
10797 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
10798
10799         * class.cs: Fixed previous fix, it broke some error tests.
10800
10801 2004-07-12  Martin Baulig  <martin@ximian.com>
10802
10803         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
10804         Fixes #61293.
10805
10806 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
10807
10808         * assign.cs (LocalTemporary): Add new argument: is_address,If
10809         `is_address' is true, then the value that we store is the address
10810         to the real value, and not the value itself.
10811         
10812         * ecore.cs (PropertyExpr): use the new local temporary
10813         stuff to allow us to handle X.Y += z (where X is a struct)
10814
10815 2004-07-08  Martin Baulig  <martin@ximian.com>
10816
10817         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
10818         not always return, just like we're doing in Using.Resolve().
10819
10820 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
10821
10822         * cs-parser.jay (fixed_statement): flag this as Pinned.
10823
10824 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
10825
10826         * typemanager.cs (TypeManager): Removed MakePinned method, this
10827         mechanism is replaced with the .NET 2.x compatible mechanism of
10828         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
10829
10830         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
10831         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
10832         `IsFixed' property which has a different meaning.
10833
10834 2004-07-02  Raja R Harinath  <rharinath@novell.com>
10835
10836         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
10837         visible from inside a nested class, not just the names of the
10838         immediately enclosing class.
10839         Fix for bug #60730.
10840
10841 2004-06-24  Raja R Harinath  <rharinath@novell.com>
10842
10843         * expression.cs (BetterConversion): Remove buggy special-case
10844         handling of "implicit constant expression conversions".  At this
10845         point, we already know that the conversion is possible -- we're
10846         only checking to see which is better.
10847
10848 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10849
10850         * cs-parser.jay: Added error CS0210 test.
10851
10852 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10853
10854         * cs-parser.jay: Added error CS0134 test.
10855
10856 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10857
10858         Fix bug #52507
10859         * cs-parser.jay: Added error CS0145 test.
10860
10861 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10862
10863         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
10864
10865 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
10866         
10867         * expression.cs (StackAlloc.Resolve): The argument may not
10868         be a constant; deal with this case.
10869         
10870 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
10871
10872         * attribute.cs (IndexerName_GetIndexerName): Renamed to
10873         GetIndexerAttributeValue.
10874         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
10875
10876         * class.cs (Indexer.Define): Added error tests for CS0415,
10877         CS0609.
10878
10879 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
10880
10881         * attribute.cs (Attribute.Resolve): Keep field code in sync with
10882         property code.
10883
10884 2004-06-23  Martin Baulig  <martin@ximian.com>
10885
10886         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
10887         neither return nor throw, reset the barrier as well.  Fixes #60457.
10888
10889 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
10890
10891         * class.cs : EventAttributes is now set to None by default.
10892           This fixes bug #60459.
10893
10894 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
10895
10896         Fix bug #60219
10897         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10898         Don't throw exception but return null (it's sufficient now).
10899
10900 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
10901
10902         * typemanager.cs (GetArgumentTypes): Faster implementation.
10903
10904 2004-06-18  Martin Baulig  <martin@ximian.com>
10905
10906         * attribute.cs (Attribute.Resolve): Check whether we're an
10907         EmptyCast which a Constant child.  Fixes #60333.
10908
10909 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
10910
10911         * statement.cs (EmitCollectionForeach): Account for the fact that
10912         not all valuetypes are in areas which we can take the address of.
10913         For these variables, we store to a temporary variable. Also, make
10914         sure that we dont emit a `callvirt' on a valuetype method.
10915
10916 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10917
10918         * expression.cs (StackAlloc.DoReSolve): Added test for
10919         negative parameter (CS0247).
10920
10921 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10922
10923         Fix bug #59792
10924         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
10925
10926 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10927
10928         Fix bug #59781
10929         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
10930         ulong.
10931
10932 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
10933
10934         Fix bug #58254 & cs1555.cs, cs1556.cs
10935         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
10936
10937 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
10938
10939         * cs-parser.jay: Added error CS1669 test for indexers.
10940
10941 2004-06-11  Martin Baulig  <martin@ximian.com>
10942
10943         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
10944         call this twice: for params and varargs methods.
10945
10946 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10947
10948         * class.cs:
10949         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
10950
10951 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10952
10953         * attribute.cs (Attribute.GetValidTargets): Made public.
10954
10955         * class.cs: 
10956         (AbstractPropertyEventMethod): New class for better code sharing.
10957         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
10958         CS1667 report.
10959         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
10960
10961 2004-06-11  Raja R Harinath  <rharinath@novell.com>
10962
10963         Fix bug #59477.
10964         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
10965         that the call to Resolve is part of a MemberAccess.
10966         (Expression.Resolve): Use it for SimpleName resolution.
10967         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
10968         Add 'intermediate' boolean argument.
10969         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
10970         error message when the SimpleName can be resolved ambiguously
10971         between an expression and a type.
10972         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
10973         public.
10974         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
10975         call on the left-side.
10976
10977 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10978
10979         * class.cs:
10980         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
10981
10982 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10983
10984         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
10985
10986 2004-06-11  Martin Baulig  <martin@ximian.com>
10987
10988         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
10989         varargs methods if applicable.
10990
10991 2004-06-11  Martin Baulig  <martin@ximian.com>
10992
10993         * expression.cs (Invocation.EmitCall): Don't use
10994         `method.CallingConvention == CallingConventions.VarArgs' since the
10995         method could also have `CallingConventions.HasThis'.
10996
10997 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10998
10999         * class.cs (Event.GetSignatureForError): Implemented.
11000         Fixed crash in error test cs3010.cs
11001
11002 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
11003
11004         * cs-tokenizer.cs: Change the way we track __arglist to be
11005         consistent with the other keywords.
11006
11007 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
11008
11009         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
11010         tomorrow.
11011
11012 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
11013
11014         * codegen.cs: Check that all referenced assemblies have a strongname
11015         before strongnaming the compiled assembly. If not report error CS1577.
11016         Fix bug #56563. Patch by Jackson Harper.
11017         * typemanager.cs: Added a method to return all referenced assemblies.
11018         Fix bug #56563. Patch by Jackson Harper.
11019
11020 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
11021
11022         * class.cs:
11023         (Method.ApplyAttributeBuilder): Moved and added conditional
11024         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
11025
11026         * delegate.cs:
11027         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
11028
11029 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
11030
11031         Fixed #59640
11032         * class.cs: (EventField.attribute_targets): Changed default target.
11033
11034 2004-06-08  Martin Baulig  <martin@ximian.com>
11035
11036         * expression.cs (Invocation.EmitCall): Enable varargs methods.
11037
11038 2004-06-08  Martin Baulig  <martin@ximian.com>
11039
11040         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
11041
11042 2004-06-07  Martin Baulig  <martin@ximian.com>
11043
11044         Added support for varargs methods.
11045
11046         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
11047         keyword.
11048
11049         * cs-parser.jay: Added support for `__arglist'.
11050
11051         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
11052
11053         * expression.cs (Argument.AType): Added `ArgList'.
11054         (Invocation): Added support for varargs methods.
11055         (ArglistAccess): New public class.
11056         (Arglist): New public class.
11057
11058         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
11059
11060         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
11061         a method's top-level block if the method has varargs.
11062
11063         * support.cs (ReflectionParameters, InternalParameters): Added
11064         support for varargs methods.    
11065
11066 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
11067
11068         * class.cs: Provide location in indexer error report.
11069
11070         * driver.cs: Use standard names.
11071
11072         * namespace.cs: Catch the use of using after a namespace has been
11073         declared also on using aliases.
11074
11075 2004-06-03  Raja R Harinath  <rharinath@novell.com>
11076
11077         Bug #50820.
11078         * typemanager.cs (closure_private_ok, closure_invocation_type)
11079         (closure_qualifier_type, closure_invocation_assembly)
11080         (FilterWithClosure): Move to ...
11081         (Closure): New internal nested class.
11082         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
11083         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
11084         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
11085         (MemberLookup, MemberLookupFailed): Use it.
11086         * expression.cs (New.DoResolve): Treat the lookup for the
11087         constructor as being qualified by the 'new'ed type.
11088         (Indexers.GetIndexersForTypeOrInterface): Update.
11089
11090 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
11091
11092         * attribute.cs
11093         (GetConditionalAttributeValue): New method. Returns
11094         condition of ConditionalAttribute.
11095         (SearchMulti): New method.  Returns all attributes of type 't'.
11096         Use it when attribute is AllowMultiple = true.
11097         (IsConditionalMethodExcluded): New method.
11098
11099         * class.cs
11100         (Method.IsExcluded): Implemented. Returns true if method has conditional
11101         attribute and the conditions is not defined (method is excluded).
11102         (IMethodData): Extended interface for ConditionalAttribute support.
11103         (PropertyMethod.IsExcluded): Implemented.
11104
11105         * decl.cs
11106         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
11107
11108         * expression.cs
11109         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
11110         on the method.
11111
11112 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11113
11114         * expression.cs (ArrayCreationExpression): Make this just an
11115         `expression'. It can't be a statement, so the code here was
11116         dead.
11117
11118 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
11119
11120         Fixed #59072
11121         * typemanager.cs (GetFullNameSignature): New method for
11122         MethodBase types.
11123
11124 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
11125
11126         Fixed #56452
11127         * class.cs (MemberBase.GetSignatureForError): New virtual method.
11128         Use this method when MethodBuilder is null.
11129         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
11130         Added test for error CS0626 (MONO reports error for this situation).
11131         (IMethodData.GetSignatureForError): Extended interface.
11132
11133 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
11134
11135         * attribute.cs
11136         (AttributeTester.GetObsoleteAttribute): Returns instance of
11137         ObsoleteAttribute when type is obsolete.
11138
11139         * class.cs
11140         (TypeContainer.VerifyObsoleteAttribute): Override.
11141         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
11142         (MethodCode.VerifyObsoleteAttribute): Override.
11143         (MemberBase.VerifyObsoleteAttribute): Override.
11144
11145         * decl.cs
11146         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
11147         and report proper error.
11148
11149         *delegate.cs
11150         Delegate.VerifyObsoleteAttribute): Override.
11151
11152         * ecore.cs
11153         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
11154         and report proper error.
11155         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
11156
11157         * enum.cs
11158         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
11159         and enum member.
11160
11161         * expression.cs
11162         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
11163         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
11164         Added test for ObsoleteAttribute.
11165
11166         * statement.cs
11167         (Catch): Derived from Statement.
11168
11169 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
11170  
11171         Fixed bug #59071 & cs0160.cs
11172  
11173         * statement.cs (Try.Resolve): Check here whether order of catch
11174         clauses matches their dependencies.
11175
11176 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
11177
11178         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
11179         caused a regression: #59343.  Referencing nested classes from an
11180         assembly stopped working.
11181
11182 2004-05-31  Martin Baulig  <martin@ximian.com>
11183
11184         MCS is now frozen for beta 2.
11185
11186 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11187
11188         * convert.cs: add a trivial cache for overload operator resolution.
11189
11190 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11191
11192         * decl.cs: If possible, use lookuptypedirect here. We can only do
11193         this if there is no `.' after the namespace. Avoids using
11194         LookupType, which does lots of slow processing.
11195         (FindNestedType) New method, does what it says :-).
11196         * namespace.cs: use LookupTypeDirect.
11197         * rootcontext.cs: use membercache, if possible.
11198         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
11199
11200 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11201
11202         * expression.cs:
11203         According to the spec, 
11204
11205         In a member access of the form E.I, if E is a single identifier,
11206         and if the meaning of E as a simple-name (§7.5.2) is a constant,
11207         field, property, localvariable, or parameter with the same type as
11208         the meaning of E as a type-name (§3.8), then both possible
11209         meanings of E are permitted.
11210
11211         We did not check that E as a simple-name had the same type as E as
11212         a type name.
11213
11214         This trivial check gives us 5-7% on bootstrap time.
11215
11216 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11217
11218         * expression.cs (Invocation.OverloadResolve): Avoid the
11219         use of hashtables and boxing here by allocating on demand.
11220
11221 2004-05-30  Martin Baulig  <martin@ximian.com>
11222
11223         * rootcontext.cs (RootContext.LookupType): Don't cache things if
11224         we're doing a silent lookup.  Don't try to lookup nested types in
11225         TypeManager.object_type (thanks to Ben Maurer).
11226
11227 2004-05-30  Martin Baulig  <martin@ximian.com>
11228
11229         Committing a patch from Ben Maurer.
11230
11231         * rootcontext.cs (RootContext.LookupType): Cache negative results.
11232
11233 2004-05-29  Martin Baulig  <martin@ximian.com>
11234
11235         * class.cs (IMethodData.ShouldIgnore): New method.
11236
11237         * typemanager.cs (TypeManager.MethodFlags): Don't take a
11238         `Location' argument, we don't need it anywhere.  Use
11239         `IMethodData.ShouldIgnore ()' instead of
11240         `MethodData.GetMethodFlags ()'.
11241         (TypeManager.AddMethod): Removed.
11242         (TypeManager.AddMethod2): Renamed to AddMethod.
11243
11244 2004-05-29  Martin Baulig  <martin@ximian.com>
11245
11246         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
11247
11248         * convert.cs (Convert.ImplicitReferenceConversion): If we're
11249         converting from a class type S to an interface type and we already
11250         have an object on the stack, don't box it again.  Fixes #52578.
11251
11252 2004-05-29  Martin Baulig  <martin@ximian.com>
11253
11254         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
11255         Added support for `params' parameters.  Fixes #59267.
11256
11257 2004-05-29  Martin Baulig  <martin@ximian.com>
11258
11259         * literal.cs (NullPointer): Provide a private .ctor which sets
11260         `type' to TypeManager.object_type.  Fixes #59048.
11261
11262 2004-05-29  Martin Baulig  <martin@ximian.com>
11263
11264         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
11265         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
11266
11267         * ecore.cs (EventExpr.instance_expr): Make the field private.
11268
11269 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
11270
11271         Fixed bug #50080 & cs0214-2.cs
11272         * expression.cs (Cast.DoResolve): Check unsafe context here.
11273         
11274         * statement.cs (Resolve.DoResolve): Likewise.
11275
11276 2004-05-26  Martin Baulig  <martin@ximian.com>
11277
11278         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
11279
11280         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
11281         (RootContext.LookupType): Pass down the `silent' flag.
11282
11283 2004-05-25  Martin Baulig  <martin@ximian.com>
11284
11285         * expression.cs
11286         (MethodGroupExpr.IdenticalTypeName): New public property.
11287         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
11288         expression actually refers to a type.
11289
11290 2004-05-25  Martin Baulig  <martin@ximian.com>
11291
11292         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
11293         for #56176 and made it actually work.
11294
11295 2004-05-25  Martin Baulig  <martin@ximian.com>
11296
11297         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
11298         (FieldExpr, PropertyExpr): Override and implement
11299         CacheTemporaries.  Fixes #52279.
11300
11301 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
11302
11303         * location.cs: In the new compiler listing a file twice is a
11304         warning, not an error.
11305
11306 2004-05-24  Martin Baulig  <martin@ximian.com>
11307
11308         * enum.cs (Enum.DefineType): For the `BaseType' to be a
11309         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
11310
11311 2004-05-24  Martin Baulig  <martin@ximian.com>
11312
11313         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
11314         walking the `using' list.  Fixes #53921.
11315
11316 2004-05-24  Martin Baulig  <martin@ximian.com>
11317
11318         * const.cs (Const.LookupConstantValue): Added support for
11319         EmptyCast's; fixes #55251.
11320
11321 2004-05-24  Martin Baulig  <martin@ximian.com>
11322
11323         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
11324         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
11325         which does the CS0135 check.  The reason is that we first need to
11326         check whether the variable actually exists.
11327
11328 2004-05-24  Martin Baulig  <martin@ximian.com>
11329
11330         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
11331         than RootContext.LookupType() to find the explicit interface
11332         type.  Fixes #58584.
11333
11334 2004-05-24  Raja R Harinath  <rharinath@novell.com>
11335
11336         * Makefile: Simplify.  Use executable.make.
11337         * mcs.exe.sources: New file.  List of sources of mcs.exe.
11338
11339 2004-05-24  Anders Carlsson  <andersca@gnome.org>
11340
11341         * decl.cs:
11342         * enum.cs:
11343         Use the invariant culture when doing String.Compare for CLS case
11344         sensitivity.
11345         
11346 2004-05-23  Martin Baulig  <martin@ximian.com>
11347
11348         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
11349         don't have any dots.  Fixes #52622, added cs0246-8.cs.
11350
11351         * namespace.cs (NamespaceEntry.Lookup): Likewise.
11352         
11353 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
11354
11355         * class.cs (MemberBase.Define): Reuse MemberType member for 
11356         resolved type. Other methods can use it too.
11357
11358 2004-05-23  Martin Baulig  <martin@ximian.com>
11359
11360         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
11361         the variable also exists in the current block (otherwise, we need
11362         to report a CS0103).  Fixes #58670.
11363
11364 2004-05-23  Martin Baulig  <martin@ximian.com>
11365
11366         * flowanalysis.cs (Reachability.Reachable): Compute this
11367         on-the-fly rather than storing it as a field.
11368
11369 2004-05-23  Martin Baulig  <martin@ximian.com>
11370
11371         * flowanalysis.cs (Reachability.And): Manually compute the
11372         resulting `barrier' from the reachability.      
11373        
11374 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
11375
11376         Fix bug #57835
11377         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
11378         instance of ObsoleteAttribute when symbol is obsolete.
11379
11380         * class.cs
11381         (IMethodData): Extended interface for ObsoleteAttribute support.
11382
11383 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
11384
11385         * attribute.cs: Fix bug #55970
11386
11387 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
11388
11389         Fix bug #52705
11390         * attribute.cs
11391         (GetObsoleteAttribute): New method. Creates the instance of
11392         ObsoleteAttribute.
11393         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
11394         ObsoleteAttribute when member is obsolete.
11395         (AttributeTester.Report_ObsoleteMessage): Common method for
11396         Obsolete error/warning reporting.
11397
11398         * class.cs
11399         (TypeContainer.base_classs_type): New member for storing parent type.
11400
11401         * decl.cs
11402         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
11403         for this MemberCore.
11404
11405 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
11406
11407         * attribute.cs, const.cs: Fix bug #58590
11408
11409 2004-05-21  Martin Baulig  <martin@ximian.com>
11410
11411         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
11412         out parameters if the end of the method is unreachable.  Fixes
11413         #58098. 
11414
11415 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
11416
11417         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
11418         Hari was right, why extra method.
11419
11420 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
11421
11422         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
11423
11424 2004-05-20  Martin Baulig  <martin@ximian.com>
11425
11426         Merged this back from gmcs to keep the differences to a minumum.
11427
11428         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
11429         instead of a Declspace.
11430         (Attribute.ResolveType): Likewise.
11431         (Attributes.Search): Likewise.
11432         (Attributes.Contains): Likewise.
11433         (Attributes.GetClsCompliantAttribute): Likewise.
11434
11435         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
11436         argument.
11437         (MethodData.ApplyAttributes): Take an EmitContext instead of a
11438         DeclSpace.
11439
11440 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
11441
11442         Fix bug #58688 (MCS does not report error when the same attribute
11443         is assigned twice)
11444
11445         * attribute.cs (Attribute.Emit): Distinction between null and default.
11446
11447 2004-05-19  Raja R Harinath  <rharinath@novell.com>
11448
11449         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
11450         of a top-level attribute without an attribute target.
11451         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
11452         Make non-static.
11453         (Attribute.Conditional_GetConditionName), 
11454         (Attribute.Obsolete_GetObsoleteMessage): Update.
11455         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
11456         part of ScanForIndexerName.
11457         (Attribute.CanIgnoreInvalidAttribute): New function.
11458         (Attribute.ScanForIndexerName): Move to ...
11459         (Attributes.ScanForIndexerName): ... here.
11460         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
11461         (Attributes.Search): New internal variant that can choose not to
11462         complain if types aren't resolved.  The original signature now
11463         complains.
11464         (Attributes.GetClsCompliantAttribute): Use internal variant, with
11465         complaints suppressed.
11466         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
11467         only if it not useful.
11468         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
11469         top-level for attributes that are shared between the assembly
11470         and a top-level class.
11471         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
11472         * class.cs: Update to reflect changes.
11473         (DefineIndexers): Fuse loops.
11474         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
11475         a couple more variants of attribute names.
11476
11477 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
11478
11479         Fix bug #52585 (Implemented explicit attribute declaration)
11480
11481         * attribute.cs:
11482         (Attributable.ValidAttributeTargets): New abstract method. It gets
11483         list of valid attribute targets for explicit target declaration.
11484         (Attribute.Target): It holds target itself.
11485         (AttributeSection): Removed.
11486         (Attribute.CheckTargets): New method. It checks whether attribute
11487         target is valid for the current element.
11488
11489         * class.cs:
11490         (EventProperty): New class. For events that are declared like
11491         property (with add and remove accessors).
11492         (EventField): New class. For events that are declared like field.
11493         class.cs
11494
11495         * cs-parser.jay: Implemented explicit attribute target declaration.
11496
11497         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
11498         Override ValidAttributeTargets.
11499
11500         * parameter.cs:
11501         (ReturnParameter): Class for applying custom attributes on 
11502         the return type.
11503         (ParameterAtribute): New class. Class for applying custom
11504         attributes on the parameter type.
11505
11506 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
11507
11508         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
11509         definitions. 
11510
11511         (Method): Allow UNSAFE here.
11512
11513         * modifiers.cs: Support unsafe reporting.
11514
11515 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
11516
11517         * decl.cs: Fix bug #58478.
11518
11519 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11520
11521         * statement.cs: When checking for unreachable code on an EmptyStatement,
11522         set the location. Fixes bug #58488.
11523
11524 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
11525
11526         * driver.cs: Add -pkg handling.
11527
11528         From Gonzalo: UseShelLExecute=false
11529
11530 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
11531
11532         * attribute.cs:
11533         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
11534         for attribute.
11535         (Attribute.IsClsCompliaceRequired): Moved to base for better
11536         accesibility.
11537         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
11538         when attribute is AttributeUsageAttribute.
11539         (Attribute.GetValidTargets): Simplified.
11540         (Attribute.GetAttributeUsage): New method returns AttributeUsage
11541         attribute for this type.
11542         (Attribute.ApplyAttributes): Method renamed to Emit and make
11543         non-static.
11544         (GlobalAttributeSection): New class for special handling of global
11545         attributes (assembly, module).
11546         (AttributeSection.Emit): New method.
11547
11548         * class.cs: Implemented Attributable abstract methods.
11549         (MethodCore.LabelParameters): Moved to Parameter class.
11550         (Accessor): Is back simple class.
11551         (PropertyMethod): Implemented Attributable abstract class.
11552         (DelegateMethod): Implemented Attributable abstract class.
11553         (Event): New constructor for disctintion between normal Event
11554         and Event with accessors.
11555
11556         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
11557
11558         * codegen.cs, const.cs, decl.cs, delegate.cs:
11559         (CommonAssemblyModulClass): Implemented Attributable abstract class
11560         and simplified.
11561
11562         * enum.cs: Implement IAttributeSupport interface.
11563         (EnumMember): New class for emum members. Implemented Attributable
11564         abstract class
11565
11566         * parameter.cs:
11567         (ParameterBase): Is abstract.
11568         (ReturnParameter): New class for easier [return:] attribute handling.
11569
11570         * typemanager.cs: Removed builder_to_attr.
11571
11572 2004-05-11  Raja R Harinath  <rharinath@novell.com>
11573
11574         Fix bug #57151.
11575         * attribute.cs (Attribute.GetPositionalValue): New function.
11576         * class.cs (TypeContainer.VerifyMembers): New function.
11577         (TypeContainer.Emit): Use it.
11578         (ClassOrStruct): New base class for Class and Struct.
11579         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
11580         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
11581         class.
11582         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
11583         then each non-static field should have a FieldOffset attribute.
11584         Otherwise, none of the fields should have a FieldOffset attribute.
11585         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
11586         and FieldOffset attributes.
11587         * typemanager.cs (TypeManager.struct_layout_attribute_type)
11588         (TypeManager.field_offset_attribute_type): New core types.
11589         (TypeManager.InitCoreTypes): Initialize them.
11590
11591 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
11592
11593         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
11594         Return correct type.
11595         From bug #58270.
11596
11597 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
11598
11599         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
11600         be implicitly converted to ulong.
11601         
11602         * expression.cs: The logic for allowing operator &, | and ^ worked
11603         was wrong, it worked before because we did not report an error in
11604         an else branch.  Fixes 57895.
11605
11606         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
11607         allow volatile fields to be reference types.
11608
11609 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
11610
11611         * driver.cs: Add support for /debug-
11612
11613 2004-05-07  Raja R Harinath  <rharinath@novell.com>
11614
11615         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
11616         Add a 'complain' parameter to silence errors.
11617         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
11618         silently overlooked type-resolutions.
11619         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
11620         to reflect changes.
11621         (Attributes.Search): New function.
11622         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
11623         (Attributes.GetAttributeFullName): Remove hack.
11624         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
11625         Update to reflect changes.
11626         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11627         Use Attributes.Search instead of nested loops.
11628
11629 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
11630
11631         * decl.cs:
11632         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
11633         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
11634         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
11635
11636         * report.cs: (Report.Warning): Renamed to Warning_T because of
11637         parameter collision.
11638
11639 2004-05-05  Raja R Harinath  <rharinath@novell.com>
11640
11641         * expression.cs (MemberAccess.ResolveMemberAccess):
11642         Exit with non-zero status after Report.Error.
11643         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
11644         Likewise.
11645         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
11646
11647 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
11648
11649         * support.cs: Don't hang when the file is empty.
11650
11651 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
11652
11653         * support.cs: In SeekableStreamReader, compute the preamble size of the
11654           underlying stream. Position changes should take into account that initial
11655           count of bytes.
11656
11657 2004-05-03  Todd Berman  <tberman@sevenl.net>
11658
11659         * driver.cs: remove unused GetSysVersion function.
11660
11661 2004-05-03  Todd Berman  <tberman@sevenl.net>
11662
11663         * driver.cs: Remove the hack from saturday, as well as the hack
11664         from jackson (LoadAssemblyFromGac), also adds the CWD to the
11665         link_paths to get that bit proper.
11666
11667 2004-05-01  Todd Berman  <tberman@sevenl.net>
11668
11669         * driver.cs: Try a LoadFrom before a Load, this checks the current
11670         path. This is currently a bug in mono that is be fixed, however, this
11671         provides a workaround for now. This will be removed when the bug
11672         is fixed.
11673
11674 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
11675
11676         * CryptoConvert.cs: Updated to latest version. Fix issue with 
11677         incomplete key pairs (#57941).
11678
11679 2004-05-01  Todd Berman  <tberman@sevenl.net>
11680
11681         * driver.cs: Remove '.' from path_chars, now System.* loads properly
11682         from the GAC
11683
11684 2004-04-30  Jackson Harper  <jackson@ximian.com>
11685
11686         * codegen.cs: Open keys readonly.
11687         
11688 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11689
11690         * typemanager.cs: don't report cyclic struct layout when a struct
11691         contains 2 or more fields of the same type. Failed for Pango.AttrShape
11692         which has 2 Pango.Rectangle fields.
11693
11694 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11695
11696         * expression.cs: Handle IntPtr comparisons with IL code
11697         rather than a method call.
11698
11699 2004-04-29  Martin Baulig  <martin@ximian.com>
11700
11701         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
11702         the list of PropertyInfo's in class hierarchy and find the
11703         accessor.  Fixes #56013.
11704
11705 2004-04-29  Martin Baulig  <martin@ximian.com>
11706
11707         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
11708
11709 2004-04-29  Martin Baulig  <martin@ximian.com>
11710
11711         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11712
11713         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
11714
11715 2004-04-29  Martin Baulig  <martin@ximian.com>
11716
11717         * class.cs (ConstructorInitializer.Resolve): Check whether the
11718         parent .ctor is accessible.  Fixes #52146.
11719
11720 2004-04-29  Martin Baulig  <martin@ximian.com>
11721
11722         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11723
11724         * statement.cs (Using.EmitLocalVariableDecls): Use
11725         TypeManager.idisposable_type, not typeof (IDisposable).
11726         (Foreach.EmitCollectionForeach): Added support for valuetypes.
11727
11728 2004-04-29  Martin Baulig  <martin@ximian.com>
11729
11730         * class.cs (Event.Define): Don't emit the field and don't set
11731         RTSpecialName and SpecialName for events on interfaces.  Fixes
11732         #57703. 
11733
11734 2004-04-29  Raja R Harinath  <rharinath@novell.com>
11735
11736         Refactor Attribute.ApplyAttributes.
11737         * attribute.cs (Attributable): New base class for objects that can
11738         have Attributes applied on them.
11739         (Attribute): Make AttributeUsage fields public.
11740         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
11741         (Attribute.IsInternalCall): New property.
11742         (Attribute.UsageAttr): Convert to a public read-only property.
11743         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
11744         (Attribute.ResolveType, Attribute.Resolve)
11745         (Attribute.ScanForIndexerName): Update to reflect changes.
11746         (Attribute.CheckAttributeTarget): Re-format.
11747         (Attribute.ApplyAttributes): Refactor, to various
11748         Attributable.ApplyAttributeBuilder methods.
11749         * decl.cs (MemberCore): Make Attributable.
11750         * class.cs (Accessor): Make Attributable.
11751         (MethodData.ApplyAttributes): Use proper attribute types, not
11752         attribute names.
11753         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
11754         (TypeContainer.ApplyAttributeBuilder)
11755         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
11756         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
11757         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
11758         (Operator.ApplyAttributeBuilder): New factored-out methods.
11759         * const.cs (Const.ApplyAttributeBuilder): Likewise.
11760         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
11761         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
11762         * parameter.cs (ParameterBase): New Attributable base class
11763         that can also represent Return types.
11764         (Parameter): Update to the changes.
11765
11766 2004-04-29  Jackson Harper  <jackson@ximian.com>
11767
11768         * driver.cs: Prefer the corlib system version when looking for
11769         assemblies in the GAC. This is still a hack, but its a better hack
11770         now.
11771         
11772 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
11773
11774         * decl.cs, enum.cs: Improved error 3005 reporting.
11775   
11776         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
11777         (related_symbols): New private member for list of symbols
11778         related to reported error/warning.
11779         
11780         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
11781
11782 2004-04-29  Martin Baulig  <martin@ximian.com>
11783
11784         * ecore.cs (Expression.Constantify): If we're an enum and
11785         TypeManager.TypeToCoreType() doesn't give us another type, use
11786         t.UnderlyingSystemType.  Fixes #56178.  
11787
11788 2004-04-29  Martin Baulig  <martin@ximian.com>
11789
11790         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
11791         interfaces and for each interface, only add members directly
11792         declared in that interface.  Fixes #53255.
11793
11794 2004-04-28  Martin Baulig  <martin@ximian.com>
11795
11796         * expression.cs (ConditionalLogicalOperator): Use a temporary
11797         variable for `left' to avoid that we evaluate it more than once;
11798         bug #52588.
11799
11800 2004-04-28  Martin Baulig  <martin@ximian.com>
11801
11802         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
11803         `void[]' (CS1547).
11804
11805 2004-04-28  Martin Baulig  <martin@ximian.com>
11806
11807         * statement.cs (LocalInfo.Resolve): Check whether the type is not
11808         void (CS1547).
11809
11810         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
11811         whether the type is not void (CS1547).
11812
11813 2004-04-28  Martin Baulig  <martin@ximian.com>
11814
11815         * expression.cs (Unary.DoResolveLValue): Override this and report
11816         CS0131 for anything but Operator.Indirection.
11817
11818 2004-04-28  Martin Baulig  <martin@ximian.com>
11819
11820         Committing a patch from Ben Maurer; see bug #50820.
11821
11822         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11823         check for classes.
11824
11825         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11826         classes.        
11827
11828 2004-04-28  Martin Baulig  <martin@ximian.com>
11829
11830         Committing a patch from Ben Maurer; see bug #50820.
11831
11832         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11833         check for classes.
11834
11835         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11836         classes.        
11837
11838 2004-04-28  Martin Baulig  <martin@ximian.com>
11839
11840         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
11841         (Block.AddLabel): Call DoLookupLabel() to only search in the
11842         current block.
11843
11844 2004-04-28  Martin Baulig  <martin@ximian.com>
11845
11846         * cfold.cs (ConstantFold.BinaryFold): Added special support for
11847         comparing StringConstants and NullLiterals in Equality and Inequality.
11848
11849 2004-04-28  Jackson Harper  <jackson@ximian.com>
11850
11851         * driver.cs: Attempt to load referenced assemblies from the
11852         GAC. This is the quick and dirty version of this method that
11853         doesnt take into account versions and just takes the first
11854         canidate found. Will be good enough for now as we will not have more
11855         then one version installed into the GAC until I update this method.
11856
11857 2004-04-28  Martin Baulig  <martin@ximian.com>
11858
11859         * typemanager.cs (TypeManager.CheckStructCycles): New public
11860         static method to check for cycles in the struct layout.
11861
11862         * rootcontext.cs (RootContext.PopulateTypes): Call
11863         TypeManager.CheckStructCycles() for each TypeContainer.
11864         [Note: We only need to visit each type once.]
11865
11866 2004-04-28  Martin Baulig  <martin@ximian.com>
11867
11868         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
11869
11870         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
11871         success and added `out object value'.  Use a `bool resolved' field
11872         to check whether we've already been called rather than
11873         `ConstantValue != null' since this breaks for NullLiterals.
11874
11875 2004-04-28  Raja R Harinath  <rharinath@novell.com>
11876
11877         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
11878         setting of this flag, since the 'set' method may be non-public.
11879
11880 2004-04-28  Raja R Harinath  <rharinath@novell.com>
11881
11882         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
11883         check on current_vector.Block.
11884
11885 2004-04-27  Martin Baulig  <martin@ximian.com>
11886
11887         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
11888         a field initializer.  Fixes #56459.
11889
11890 2004-04-27  Martin Baulig  <martin@ximian.com>
11891
11892         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
11893         we're not attempting to use an indexer.  Fixes #52154.
11894
11895 2004-04-27  Martin Baulig  <martin@ximian.com>
11896
11897         * statement.cs (Return): Don't create a return label if we don't
11898         need it; reverts my change from January 20th.  Thanks to Ben
11899         Maurer for this.
11900
11901 2004-04-27  Martin Baulig  <martin@ximian.com>
11902
11903         According to the spec, `goto' can only leave a nested scope, but
11904         never enter it.
11905
11906         * statement.cs (Block.LookupLabel): Only lookup in the current
11907         block, don't recurse into parent or child blocks.
11908         (Block.AddLabel): Check in parent and child blocks, report
11909         CS0140/CS0158 if we find a duplicate.
11910         (Block): Removed this indexer for label lookups.
11911         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
11912         this already does the error reporting for us.
11913
11914         * flowanalysis.cs
11915         (FlowBranching.UsageVector.Block): New public variable; may be null.
11916         (FlowBranching.CreateSibling): Added `Block' argument.
11917         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
11918         label for the target of a `goto' and check whether we're not
11919         leaving a `finally'.
11920
11921 2004-04-27  Martin Baulig  <martin@ximian.com>
11922
11923         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11924         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
11925         just for returns).
11926
11927 2004-04-27  Martin Baulig  <martin@ximian.com>
11928
11929         * statement.cs (Block.AddLabel): Also check for implicit blocks
11930         and added a CS0158 check.
11931
11932 2004-04-27  Martin Baulig  <martin@ximian.com>
11933
11934         * flowanalysis.cs (FlowBranchingLoop): New class.
11935         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
11936         UsageVector's instead of an ArrayList.
11937         (FlowBranching.Label): Likewise.
11938         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
11939         (FlowBranching.AddBreakVector): New method.
11940
11941 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
11942
11943         * attribute.cs: Small regression fix: only convert the type if we
11944         the type is different, fixes System.Drawing build.
11945
11946 2004-04-27  Martin Baulig  <martin@ximian.com>
11947
11948         * attribute.cs (Attribute.Resolve): If we have a constant value
11949         for a named field or property, implicity convert it to the correct
11950         type.
11951
11952 2004-04-27  Raja R Harinath  <rharinath@novell.com>
11953
11954         * statement.cs (Block.Block): Implicit blocks share
11955         'child_variable_names' fields with parent blocks.
11956         (Block.AddChildVariableNames): Remove.
11957         (Block.AddVariable): Mark variable as "used by a child block" in
11958         every surrounding block.
11959         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
11960         been used in a child block, complain about violation of "Invariant
11961         meaning in blocks" rule.
11962         * cs-parser.jay (declare_local_variables): Don't use
11963         AddChildVariableNames.
11964         (foreach_statement): Don't create an implicit block: 'foreach'
11965         introduces a scope.
11966
11967 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
11968
11969         * convert.cs (ImplicitNumericConversion): 0 is also positive when
11970         converting from 0L to ulong.  Fixes 57522.
11971
11972 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
11973
11974         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
11975         derived class hides via 'new' keyword field from base class (test-242.cs).
11976         TODO: Handle this in the more general way.
11977         
11978         * class.cs (CheckBase): Ditto.
11979
11980 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
11981
11982         * decl.cs (caching_flags): New member for storing cached values
11983         as bit flags.
11984         (MemberCore.Flags): New enum where bit flags for caching_flags
11985         are defined.
11986         (MemberCore.cls_compliance): Moved to caching_flags.
11987         (DeclSpace.Created): Moved to caching_flags.
11988
11989         * class.cs: Use caching_flags instead of DeclSpace.Created
11990         
11991 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
11992
11993         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
11994         if we are only a derived class, not a nested class.
11995
11996         * typemanager.cs: Same as above, but do this at the MemberLookup
11997         level (used by field and methods, properties are handled in
11998         PropertyExpr).   Allow for the qualified access if we are a nested
11999         method. 
12000
12001 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
12002
12003         * class.cs: Refactoring.
12004         (IMethodData): New inteface; Holds links to parent members
12005         to avoid member duplication (reduced memory allocation).
12006         (Method): Implemented IMethodData interface.
12007         (PropertyBase): New inner classes for get/set methods.
12008         (PropertyBase.PropertyMethod): Implemented IMethodData interface
12009         (Event): New inner classes for add/remove methods.
12010         (Event.DelegateMethod): Implemented IMethodData interface.
12011
12012         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
12013         EmitContext (related to class.cs refactoring).
12014
12015 2004-04-21  Raja R Harinath  <rharinath@novell.com>
12016
12017         * delegate.cs (Delegate.VerifyApplicability): If the number of
12018         arguments are the same as the number of parameters, first try to
12019         verify applicability ignoring  any 'params' modifier on the last
12020         parameter.
12021         Fixes #56442.
12022
12023 2004-04-16  Raja R Harinath  <rharinath@novell.com>
12024
12025         * class.cs (TypeContainer.AddIndexer): Use
12026         'ExplicitInterfaceName' to determine if interface name was
12027         explicitly specified.  'InterfaceType' is not initialized at this time.
12028         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
12029         Indexers array is already in the required order.  Initialize
12030         'IndexerName' only if there are normal indexers.
12031         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
12032         (TypeContainer.Emit): Emit DefaultMember attribute only if
12033         IndexerName is initialized.
12034         Fixes #56300.
12035
12036 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
12037
12038         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
12039         Fixes #57007
12040
12041 2004-04-15  Raja R Harinath  <rharinath@novell.com>
12042
12043         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
12044         attributes.
12045         Fix for #56456.
12046
12047         * attribute.cs (Attribute.Resolve): Check for duplicate named
12048         attributes.
12049         Fix for #56463.
12050
12051 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
12052
12053         * iterators.cs (MarkYield): track whether we are in an exception,
12054         and generate code accordingly.  Use a temporary value to store the
12055         result for our state.
12056
12057         I had ignored a bit the interaction of try/catch with iterators
12058         since their behavior was not entirely obvious, but now it is
12059         possible to verify that our behavior is the same as MS .NET 2.0
12060
12061         Fixes 54814
12062
12063 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
12064
12065         * iterators.cs: Avoid creating temporaries if there is no work to
12066         do. 
12067
12068         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
12069         Enumerations, use TypeManager.EnumToUnderlying and call
12070         recursively. 
12071
12072         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
12073         bug #57013
12074
12075         (This.Emit): Use EmitContext.EmitThis to emit our
12076         instance variable.
12077
12078         (This.EmitAssign): Ditto.
12079
12080         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
12081         codepaths, we will move all the functionality into
12082         Mono.CSharp.This 
12083
12084         (FieldExpr.EmitAssign): Ditto.
12085
12086         This fixes several hidden bugs that I uncovered while doing a code
12087         review of this today.
12088
12089         * codegen.cs (EmitThis): reworked so the semantics are more clear
12090         and also support value types "this" instances.
12091
12092         * iterators.cs: Changed so that for iterators in value types, we
12093         do not pass the value type as a parameter.  
12094
12095         Initialization of the enumerator helpers is now done in the caller
12096         instead of passing the parameters to the constructors and having
12097         the constructor set the fields.
12098
12099         The fields have now `assembly' visibility instead of private.
12100
12101 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
12102
12103         * expression.cs (Argument.Resolve): Check if fields passed as ref
12104         or out are contained in a MarshalByRefObject.
12105
12106         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
12107         another compiler type.
12108
12109 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
12110
12111         * class.cs (Indexer.Define): use the new name checking method.
12112         Also, return false on an error.
12113         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
12114         (is_identifier_[start/part]_character): make static.
12115
12116 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
12117
12118         * expression.cs (Binary.ResolveOperator): Do no append strings
12119         twice: since we can be invoked more than once (array evaluation)
12120         on the same concatenation, take care of this here.  Based on a fix
12121         from Ben (bug #56454)
12122
12123 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
12124
12125         * codegen.cs: Fix another case where CS1548 must be reported (when 
12126         delay-sign isn't specified and no private is available #56564). Fix
12127         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
12128         error when MCS is used on the MS runtime and we need to delay-sign 
12129         (which seems unsupported by AssemblyBuilder - see #56621).
12130
12131 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
12132
12133         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
12134         (TypeManager.ComputeNamespaces): Faster implementation for
12135         Microsoft runtime.
12136
12137         * compiler.csproj: Updated AssemblyName to mcs.
12138
12139 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
12140
12141         * rootcontext.cs: Add new types to the boot resolution.
12142
12143         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
12144         MulticastDelegate is not allowed.
12145
12146         * typemanager.cs: Add new types to lookup: System.TypedReference
12147         and ArgIterator.
12148
12149         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
12150         check for TypedReference or ArgIterator, they are not allowed. 
12151
12152         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
12153         makes us properly catch 1510 in some conditions (see bug 56016 for
12154         details). 
12155
12156 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
12157
12158         * CryptoConvert.cs: update from corlib version
12159         with endian fixes.
12160
12161 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
12162
12163         * class.cs (Indexer.Define): Check indexername declaration
12164
12165 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
12166
12167         * attribute.cs (IsClsCompliant): Fixed problem with handling
12168         all three states (compliant, not-compliant, undetected).
12169
12170 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
12171
12172         * attribute.cs (Attribute): Location is now public.
12173         (Resolve): Store resolved arguments (pos_values) in attribute class.
12174         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
12175         (GetClsCompliantAttributeValue): New method that gets
12176         CLSCompliantAttribute value.
12177         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
12178         if exists else null.
12179         (AttributeTester): New class for CLS-Compliant verification routines.
12180
12181         * class.cs (Emit): Add CLS-Compliant verification.
12182         (Method.GetSignatureForError): Implemented.
12183         (Constructor.GetSignatureForError): Implemented
12184         (Constructor.HasCompliantArgs): Returns if constructor has
12185         CLS-Compliant arguments.
12186         (Constructor.Emit): Override.
12187         (Construcor.IsIdentifierClsCompliant): New method; For constructors
12188         is needed to test only parameters.
12189         (FieldBase.GetSignatureForError): Implemented.
12190         (TypeContainer): New member for storing base interfaces.
12191         (TypeContainer.FindMembers): Search in base interfaces too.
12192
12193         * codegen.cs (GetClsComplianceAttribute): New method that gets
12194         assembly or module CLSCompliantAttribute value.
12195         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
12196         for assembly.
12197         (ModuleClass.Emit): Add error 3012 test.
12198
12199         * const.cs (Emit): Override and call base for CLS-Compliant tests.
12200
12201         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
12202         state for all decl types.
12203         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
12204         if CLS-Compliant tests are required.
12205         (IsClsCompliaceRequired): New method. Analyze whether code
12206         must be CLS-Compliant.
12207         (IsExposedFromAssembly): New method. Returns true when MemberCore
12208         is exposed from assembly.
12209         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
12210         value or gets cached value.
12211         (HasClsCompliantAttribute): New method. Returns true if MemberCore
12212         is explicitly marked with CLSCompliantAttribute.
12213         (IsIdentifierClsCompliant): New abstract method. This method is
12214         used to testing error 3005.
12215         (IsIdentifierAndParamClsCompliant): New method. Common helper method
12216         for identifier and parameters CLS-Compliant testing.
12217         (VerifyClsCompliance): New method. The main virtual method for
12218         CLS-Compliant verifications.
12219         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
12220         null. I don't know why is null (too many public members !).
12221         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
12222         and get value of first CLSCompliantAttribute that found.
12223
12224         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
12225         (VerifyClsCompliance): Override and add extra tests.
12226
12227         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
12228         clscheck- disable CLS-Compliant verification event if assembly is has
12229         CLSCompliantAttribute(true).
12230
12231         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
12232         ApllyAttribute is now called in emit section as in the other cases.
12233         Possible future Emit integration.
12234         (IsIdentifierClsCompliant): New override.
12235         (VerifyClsCompliance): New override.
12236         (GetEnumeratorName): Returns full enum name.
12237
12238         * parameter.cs (GetSignatureForError): Implemented.
12239
12240         * report.cs (WarningData): New struct for Warning message information.
12241         (LocationOfPreviousError): New method.
12242         (Warning): New method. Reports warning based on the warning table.
12243         (Error_T): New method. Reports error based on the error table.
12244
12245         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
12246         verifications are done here.
12247
12248         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
12249
12250         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
12251         CLSCompliantAttribute.
12252         (all_imported_types): New member holds all imported types from other
12253         assemblies.
12254         (LoadAllImportedTypes): New method fills static table with exported types
12255         from all referenced assemblies.
12256         (Modules): New property returns all assembly modules.
12257
12258 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
12259
12260         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
12261         throwing a parser error.
12262
12263         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
12264         which removes the hardcoded get_/set_ prefixes for properties, as
12265         IL allows for the properties to be named something else.  
12266
12267         Bug #56013
12268
12269         * expression.cs: Do not override operand before we know if it is
12270         non-null.  Fix 56207
12271
12272 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12273
12274         * typemanager.cs: support for pinned variables.
12275
12276 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12277
12278         * decl.cs, typemanager.cs: Avoid using an arraylist
12279         as a buffer if there is only one result set.
12280
12281 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12282
12283         * expression.cs: Make sure you cant call a static method
12284         with an instance expression, bug #56174.
12285
12286 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
12287
12288         * class.cs (IsDuplicateImplementation): Improve error reporting to
12289         flag 663 (method only differs in parameter modifier).
12290
12291         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
12292         in preprocessor directives.
12293
12294         * location.cs (LookupFile): Allow for the empty path.
12295
12296         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
12297         better approach for some of that patch, but its failing with the
12298         CharSet enumeration.  For now try/catch will do.
12299
12300         * typemanager.cs: Do not crash if a struct does not have fields.
12301         Fixes 56150.
12302
12303 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12304
12305         * expression.cs: cs0213, cant fix a fixed expression.
12306         fixes 50231.
12307
12308 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12309
12310         * cs-parser.jay: detect invalid embeded statements gracefully.
12311         bug #51113.
12312
12313 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12314
12315         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
12316         As a regex:
12317         s/
12318         the invocation type may not be a subclass of the tye of the item/
12319         The type of the item must be a subclass of the invocation item.
12320         /g
12321
12322         Fixes bug #50820.
12323
12324 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
12325
12326         * attribute.cs: Added methods to get a string and a bool from an
12327         attribute. Required to information from AssemblyKeyFileAttribute,
12328         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
12329         * codegen.cs: Modified AssemblyName creation to include support for
12330         strongnames. Catch additional exceptions to report them as CS1548.
12331         * compiler.csproj: Updated include CryptoConvert.cs.
12332         * compiler.csproj.user: Removed file - user specific configuration.
12333         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
12334         Mono.Security assembly. The original class is maintained and tested in
12335         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
12336         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
12337         like CSC 8.0 (C# v2) supports.
12338         * Makefile: Added CryptoConvert.cs to mcs sources.
12339         * rootcontext.cs: Added new options for strongnames.
12340
12341 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
12342
12343         * driver.cs: For --expect-error, report error code `2'
12344         if the program compiled with no errors, error code `1' if
12345         it compiled with an error other than the one expected.
12346
12347 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
12348
12349         * compiler.csproj: Updated for Visual Studio .NET 2003.
12350         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
12351         * compiler.sln: Updated for Visual Studio .NET 2003.
12352
12353 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
12354
12355         * expression.cs: Fix bug #47234. We basically need to apply the
12356         rule that we prefer the conversion of null to a reference type
12357         when faced with a conversion to 'object' (csc behaviour).
12358
12359 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12360
12361         * statement.cs: Shorter form for foreach, eliminates
12362         a local variable. r=Martin.
12363
12364 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12365
12366         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
12367         checks if we can use brtrue/brfalse to test for 0.
12368         * expression.cs: use the above in the test for using brtrue/brfalse.
12369         cleanup code a bit.
12370
12371 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12372
12373         * expression.cs: Rewrite string concat stuff. Benefits:
12374
12375         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
12376         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
12377         rather than a concat chain.
12378
12379         * typemanager.cs: Add lookups for more concat overloads.
12380
12381 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12382
12383         * expression.cs: Emit shorter il code for array init.
12384
12385         newarr
12386         dup
12387         // set 1
12388
12389         // set 2
12390
12391         newarr
12392         stloc.x
12393
12394         ldloc.x
12395         // set 1
12396
12397         ldloc.x
12398         // set 2
12399
12400 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
12401
12402         * statement.cs: Before, two switch blocks would be merged if the
12403         total size of the blocks (end_item - begin_item + 1) was less than
12404         two times the combined sizes of the blocks.
12405
12406         Now, it will only merge if after the merge at least half of the
12407         slots are filled.
12408
12409         fixes 55885.
12410
12411 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
12412
12413         * class.cs : csc build fix for GetMethods(). See bug #52503.
12414
12415 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
12416
12417         * expression.cs: Make sure fp comparisons work with NaN.
12418         This fixes bug #54303. Mig approved this patch a long
12419         time ago, but we were not able to test b/c the runtime
12420         had a related bug.
12421
12422 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
12423
12424         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
12425
12426 2004-03-19  Martin Baulig  <martin@ximian.com>
12427
12428         * class.cs (MemberCore.IsDuplicateImplementation): Report the
12429         error here and not in our caller.
12430
12431 2004-03-19  Martin Baulig  <martin@ximian.com>
12432
12433         * interface.cs: Completely killed this file.
12434         (Interface): We're now a TypeContainer and live in class.cs.
12435
12436         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
12437         argument; we're now also called for interfaces.
12438         (TypeContainer.DefineMembers): Allow this method being called
12439         multiple times.
12440         (TypeContainer.GetMethods): New public method; formerly known as
12441         Interface.GetMethod().  This is used by PendingImplementation.
12442         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
12443         it's now private and non-static.
12444         (Interface): Moved this here; it's now implemented similar to
12445         Class and Struct.
12446         (Method, Property, Event, Indexer): Added `bool is_interface'
12447         argument to their .ctor's.
12448         (MemberBase.IsInterface): New public field.
12449
12450         * cs-parser.jay: Create normal Method, Property, Event, Indexer
12451         instances instead of InterfaceMethod, InterfaceProperty, etc.
12452         (opt_interface_base): Removed; we now use `opt_class_base' instead.
12453         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
12454
12455 2004-03-19  Martin Baulig  <martin@ximian.com>
12456
12457         * class.cs (MethodCore.IsDuplicateImplementation): New private
12458         method which does the CS0111 checking.
12459         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
12460         Use IsDuplicateImplementation().
12461
12462 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
12463
12464         * decl.cs (FindMemberToOverride): New method to find the correct
12465         method or property to override in the base class.
12466         * class.cs
12467             - Make Method/Property use the above method to find the
12468               version in the base class.
12469             - Remove the InheritableMemberSignatureCompare as it is now
12470               dead code.
12471
12472         This patch makes large code bases much faster to compile, as it is
12473         O(n) rather than O(n^2) to do this validation.
12474
12475         Also, it fixes bug 52458 which is that nested classes are not
12476         taken into account when finding the base class member.
12477
12478         Reviewed/Approved by Martin.
12479
12480 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
12481
12482         * interface.cs: In all interface classes removed redundant
12483         member initialization.
12484
12485 2004-03-16  Martin Baulig  <martin@ximian.com>
12486
12487         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12488
12489 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
12490
12491         * decl.cs (DefineTypeAndParents): New helper method to define a
12492         type's containers before the type itself is defined;  This is a
12493         bug exposed by the recent changes to Windows.Forms when an
12494         implemented interface was defined inside a class that had not been
12495         built yet.   
12496
12497         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
12498
12499         (Check): Loop correctly to report errors modifiers
12500         (UNSAFE was not in the loop, since it was the same as TOP).
12501
12502         * interface.cs: Every interface member now takes a ModFlags,
12503         instead of a "is_new" bool, which we set on the base MemberCore. 
12504
12505         Every place where we called "UnsafeOk" in the interface, now we
12506         call the proper member (InterfaceMethod.UnsafeOK) instead to get
12507         the unsafe settings from the member declaration instead of the
12508         container interface. 
12509
12510         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
12511
12512         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12513         `set_indexer_name' to the pending bits (one per type).
12514
12515         We fixed a bug today that was picking the wrong method to
12516         override, since for properties the existing InterfaceMethod code
12517         basically ignored the method name.  Now we make sure that the
12518         method name is one of the valid indexer names.
12519
12520 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
12521  
12522         * support.cs (SeekableStreamReader): Keep track of stream byte
12523         positions and don't mix them with character offsets to the buffer.
12524
12525         Patch from Gustavo Giráldez
12526
12527 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
12528
12529         * interface.cs (InterfaceSetGetBase): Removed double member
12530         initialization, base class does it as well.
12531
12532 2004-03-13  Martin Baulig  <martin@ximian.com>
12533
12534         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
12535         when compiling corlib.
12536
12537 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
12538
12539         * convert.cs (ExplicitConversion): We were reporting an error on
12540         certain conversions (object_type source to a value type, when the
12541         expression was `null') before we had a chance to pass it through
12542         the user defined conversions.
12543
12544         * driver.cs: Replace / and \ in resource specifications to dots.
12545         Fixes 50752
12546
12547         * class.cs: Add check for duplicate operators.  Fixes 52477
12548
12549 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
12550
12551         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
12552         that are in the middle of the statements, not only at the end.
12553         Fixes #54987
12554
12555         * class.cs (TypeContainer.AddField): No longer set the
12556         `HaveStaticConstructor' flag, now we call it
12557         `UserDefineStaticConstructor' to diferentiate the slightly
12558         semantic difference.
12559
12560         The situation is that we were not adding BeforeFieldInit (from
12561         Modifiers.TypeAttr) to classes that could have it.
12562         BeforeFieldInit should be set to classes that have no static
12563         constructor. 
12564
12565         See:
12566
12567         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
12568
12569         And most importantly Zoltan's comment:
12570
12571         http://bugzilla.ximian.com/show_bug.cgi?id=44229
12572
12573         "I think beforefieldinit means 'it's ok to initialize the type sometime 
12574          before its static fields are used', i.e. initialization does not need
12575          to be triggered by the first access to the type. Setting this flag
12576          helps the JIT to compile better code, since it can run the static
12577          constructor at JIT time, and does not need to generate code to call it
12578          (possibly lots of times) at runtime. Unfortunately, mcs does not set
12579          this flag for lots of classes like String. 
12580          
12581          csc sets this flag if the type does not have an explicit static 
12582          constructor. The reasoning seems to be that if there are only static
12583          initalizers for a type, and no static constructor, then the programmer
12584          does not care when this initialization happens, so beforefieldinit
12585          can be used.
12586          
12587          This bug prevents the AOT compiler from being usable, since it 
12588          generates so many calls to mono_runtime_class_init that the AOT code
12589          is much slower than the JITted code. The JITted code is faster, 
12590          because it does not generate these calls if the vtable is type is
12591          already initialized, which is true in the majority of cases. But the
12592          AOT compiler can't do this."
12593
12594 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
12595
12596         * class.cs (MethodData.Emit): Refactor the code so symbolic
12597         information is generated for destructors;  For some reasons we
12598         were taking a code path that did not generate symbolic information
12599         before. 
12600
12601 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
12602
12603         * class.cs: Create a Constructor.CheckBase method that
12604         takes care of all validation type code. The method
12605         contains some code that was moved from Define.
12606
12607         It also includes new code that checks for duplicate ctors.
12608         This fixes bug #55148.
12609
12610 2004-03-09  Joshua Tauberer <tauberer@for.net>
12611
12612         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
12613         a { ... }-style array creation invokes EmitStaticInitializers
12614         which is not good for reference-type arrays.  String, decimal
12615         and now null constants (NullCast) are not counted toward
12616         static initializers.
12617
12618 2004-03-05  Martin Baulig  <martin@ximian.com>
12619
12620         * location.cs (SourceFile.HasLineDirective): New public field;
12621         specifies whether the file contains or is referenced by a "#line"
12622         directive.
12623         (Location.DefineSymbolDocuments): Ignore source files which
12624         either contain or are referenced by a "#line" directive.        
12625
12626 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
12627
12628         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
12629         direct access to our parent, so check the method inline there.
12630
12631 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
12632
12633         * expression.cs (Invocation.EmitCall): Miguel's last commit
12634         caused a regression. If you had:
12635
12636             T t = null;
12637             t.Foo ();
12638
12639         In Foo the implict this would be null.
12640
12641 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
12642
12643         * expression.cs (Invocation.EmitCall): If the method is not
12644         virtual, do not emit a CallVirt to it, use Call.
12645
12646         * typemanager.cs (GetFullNameSignature): Improve the method to
12647         cope with ".ctor" and replace it with the type name.
12648
12649         * class.cs (ConstructorInitializer.Resolve): Now the method takes
12650         as an argument the ConstructorBuilder where it is being defined,
12651         to catch the recursive constructor invocations.
12652
12653 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
12654
12655         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
12656         routines to check if a type is an enumerable/enumerator allow
12657         classes that implement the IEnumerable or IEnumerator interfaces.
12658
12659         * class.cs (Property, Operator): Implement IIteratorContainer, and
12660         implement SetYields.
12661
12662         (Property.Define): Do the block swapping for get_methods in the
12663         context of iterators.   We need to check if Properties also
12664         include indexers or not.
12665
12666         (Operator): Assign the Block before invoking the
12667         OperatorMethod.Define, so we can trigger the Iterator code
12668         replacement. 
12669
12670         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
12671         Property and Operator classes are not created when we parse the
12672         declarator but until we have the block completed, so we use a
12673         singleton SimpleIteratorContainer.Simple to flag whether the
12674         SetYields has been invoked.
12675
12676         We propagate this setting then to the Property or the Operator to
12677         allow the `yield' to function.
12678
12679 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
12680
12681         * codegen.cs: Implemented attribute support for modules.
12682         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
12683         Assembly/Module functionality.
12684
12685         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
12686         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
12687         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
12688
12689 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
12690
12691         * interface.cs (FindMembers): The operation is performed on all base
12692         interfaces and not only on the first. It is required for future CLS Compliance patch.
12693
12694 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
12695
12696         * statement.cs, codegen.cs:
12697         This patch deals with patterns such as:
12698
12699         public class List : IEnumerable {
12700
12701                 public MyEnumerator GetEnumerator () {
12702                         return new MyEnumerator(this);
12703                 }
12704
12705                 IEnumerator IEnumerable.GetEnumerator () {
12706                         ...
12707                 }
12708                 
12709                 public struct MyEnumerator : IEnumerator {
12710                         ...
12711                 }
12712         }
12713
12714         Before, there were a few things we did wrong:
12715         1) we would emit callvirt on a struct, which is illegal
12716         2) we emited ldarg when we needed to emit ldarga
12717         3) we would mistakenly call the interface methods on an enumerator
12718         type that derived from IEnumerator and was in another assembly. For example:
12719
12720         public class MyEnumerator : IEnumerator
12721
12722         Would have the interface methods called, even if there were public impls of the
12723         method. In a struct, this lead to invalid IL code.
12724
12725 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
12726
12727         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
12728           renamed to Emit.
12729
12730         * delegate.cs (Define): Fixed crash when delegate type is undefined.
12731
12732 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
12733
12734         * cs-parser.jay: Fix small regression: we were not testing V2
12735         compiler features correctly.
12736
12737         * interface.cs: If the emit context is null, then create one
12738
12739 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
12740
12741         * decl.cs (GetSignatureForError): New virtual method to get full name
12742           for error messages.
12743
12744         * attribute.cs (IAttributeSupport): New interface for attribute setting.
12745           Now it is possible to rewrite ApplyAttributes method to be less if/else.
12746
12747         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
12748           Duplicated members and code in these classes has been removed.
12749           Better encapsulation in these classes.
12750
12751 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
12752
12753         * assign.cs (Assign.DoResolve): When dealing with compound
12754         assignments, there is a new rule in ECMA C# 2.4 (might have been
12755         there before, but it is documented here) that states that in:
12756
12757         a op= b;
12758
12759         If b is of type int, and the `op' is a shift-operator, then the
12760         above is evaluated as:
12761
12762         a = (int) a op b 
12763
12764         * expression.cs (Binary.ResolveOperator): Instead of testing for
12765         int/uint/long/ulong, try to implicitly convert to any of those
12766         types and use that in pointer arithmetic.
12767
12768         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
12769         method to print information for from the type, not from the
12770         null-method we were given.
12771
12772 2004-02-01  Duncan Mak  <duncan@ximian.com>
12773
12774         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
12775         parsing for cmd, fixes bug #53694.
12776
12777 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
12778
12779         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
12780         in the member name duplication tests. Property and operator name duplication
12781         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
12782
12783 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
12784
12785         * interface.cs (PopulateMethod): Fixed crash when interface method
12786         returns not existing type (error test cs0246-3.cs).
12787
12788 2004-02-02  Ravi Pratap M <ravi@ximian.com>
12789
12790         * cs-parser.jay (interface_accessors): Re-write actions to also
12791         store attributes attached to get and set methods. Fix spelling
12792         while at it.
12793
12794         (inteface_property_declaration): Modify accordingly.
12795
12796         (InterfaceAccessorInfo): New helper class to store information to pass
12797         around between rules that use interface_accessors.
12798
12799         * interface.cs (Emit): Apply attributes on the get and set
12800         accessors of properties and indexers too.
12801
12802         * attribute.cs (ApplyAttributes): Modify accordingly to use the
12803         right MethodBuilder when applying attributes to the get and set accessors.
12804
12805 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
12806
12807         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
12808
12809 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
12810
12811         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
12812
12813 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
12814
12815         * cs-parser.jay: Remove YIELD token, instead use the new grammar
12816         changes that treat `yield' specially when present before `break'
12817         or `return' tokens.
12818
12819         * cs-tokenizer.cs: yield is no longer a keyword.
12820
12821 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
12822
12823         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
12824         setting for default constructors.
12825         For default constructors are almost every time set wrong Modifier. The
12826         generated IL code has been alright. But inside mcs this values was
12827         wrong and this was reason why several of my CLS Compliance tests
12828         failed.
12829
12830 2004-01-22  Martin Baulig  <martin@ximian.com>
12831
12832         * cs-parser.jay (namespace_or_type_name): Return an Expression,
12833         not a QualifiedIdentifier.  This is what `type_name_expression'
12834         was previously doing.
12835         (type_name_expression): Removed; the code is now in
12836         `namespace_or_type_name'.
12837         (qualified_identifier): Removed, use `namespace_or_type_name'
12838         instead.
12839         (QualifiedIdentifier): Removed this class.      
12840
12841 2004-01-22  Martin Baulig  <martin@ximian.com>
12842
12843         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
12844         not a string as alias name.
12845
12846 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
12847
12848         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
12849         #52730 bug, and instead compute correctly the need to use a
12850         temporary variable when requesting an address based on the
12851         static/instace modified of the field and the constructor.
12852  
12853 2004-01-21  Martin Baulig  <martin@ximian.com>
12854
12855         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
12856         class and namespace before looking up aliases.  Fixes #52517.
12857
12858 2004-01-21  Martin Baulig  <martin@ximian.com>
12859
12860         * flowanalysis.cs (UsageVector.Merge): Allow variables being
12861         assinged in a 'try'; fixes exception4.cs.
12862
12863 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12864         * class.cs : Implemented parameter-less constructor for TypeContainer
12865
12866         * decl.cs: Attributes are now stored here. New property OptAttributes
12867
12868         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
12869
12870         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
12871
12872 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12873
12874         * typemanager.cs (CSharpSignature): Now reports also inner class name.
12875           (CSharpSignature): New method for indexer and property signature.
12876
12877 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12878
12879         * pending.cs (IsVirtualFilter): Faster implementation.
12880
12881 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12882
12883         * typemanager.cs: Avoid inclusion of same assembly more than once.
12884
12885 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12886
12887         * cs-parser.jay: Fixed problem where the last assembly attribute
12888           has been applied also to following declaration (class, struct, etc.)
12889           
12890 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12891
12892         * class.cs: Added error CS0538, CS0539 reporting.
12893         Fixed crash on Microsoft runtime when field type is void.
12894
12895         * cs-parser.jay: Added error CS0537 reporting.
12896
12897         * pending.cs: Added error CS0535 reporting.
12898         Improved error report for errors CS0536, CS0534.
12899
12900 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
12901
12902         Merge a few bits from the Anonymous Method MCS tree.
12903
12904         * statement.cs (ToplevelBlock): New class for toplevel methods,
12905         will hold anonymous methods, lifted variables.
12906
12907         * cs-parser.jay: Create toplevel blocks for delegates and for
12908         regular blocks of code. 
12909
12910 2004-01-20  Martin Baulig  <martin@ximian.com>
12911
12912         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
12913         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
12914         and `NeedExplicitReturn'; added `IsLastStatement'.
12915         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
12916         have a `ReturnLabel' or we're not unreachable.
12917
12918         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
12919         child's reachability; don't just override ours with it.  Fixes
12920         #58058 (lluis's example).
12921         (FlowBranching): Added public InTryOrCatch(), InCatch(),
12922         InFinally(), InLoop(), InSwitch() and
12923         BreakCrossesTryCatchBoundary() methods.
12924
12925         * statement.cs (Return): Do all error checking in Resolve().
12926         Unless we are the last statement in a top-level block, always
12927         create a return label and jump to it.
12928         (Break, Continue): Do all error checking in Resolve(); also make
12929         sure we aren't leaving a `finally'.
12930         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
12931         statement in a top-level block.
12932         (Block.Flags): Added `IsDestructor'.
12933         (Block.IsDestructor): New public property.
12934
12935 2004-01-20  Martin Baulig  <martin@ximian.com>
12936
12937         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
12938
12939 2004-01-20  Martin Baulig  <martin@ximian.com>
12940
12941         * statement.cs (Statement.ResolveUnreachable): New public method.
12942         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
12943         (Block.Resolve): Resolve unreachable statements.
12944
12945 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
12946
12947         * expression.cs: We need to fix the case where we do
12948         not have a temp variable here.
12949
12950         * assign.cs: Only expression compound assignments need
12951         temporary variables.
12952
12953 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
12954
12955         * flowanalysis.cs: Reduce memory allocation in a few ways:
12956           - A block with no variables should not allocate a bit
12957             vector for itself.
12958           - A method with no out parameters does not need any tracking
12959             for assignment of the parameters, so we need not allocate
12960             any data for it.
12961           - The arrays:
12962                 public readonly Type[] VariableTypes;
12963                 public readonly string[] VariableNames;
12964             Are redundant. The data is already stored in the variable
12965             map, so we need not allocate another array for it.
12966           - We need to add alot of checks for if (params | locals) == null
12967             due to the first two changes.
12968
12969 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
12970
12971         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
12972         implement IMemoryLocation, we store a copy on a local variable and
12973         take the address of it.  Patch from Benjamin Jemlich
12974
12975         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
12976         to use a special "type_name_expression" rule which reduces the
12977         number of "QualifiedIdentifier" classes created, and instead
12978         directly creates MemberAccess expressions.
12979
12980 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
12981
12982         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
12983         that fixes #52853.  Null literal assignment to ValueType
12984
12985         * class.cs (MethodData.Emit): Instead of checking the name of the
12986         method to determine if its a destructor, create a new derived
12987         class from Method called Destructor, and test for that.  
12988
12989         * cs-parser.jay: Create a Destructor object instead of a Method.  
12990
12991         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
12992
12993         Fixes: 52933
12994
12995 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
12996
12997         * expression.cs (Binary.ResolveOperator): Perform an implicit
12998         conversion from MethodGroups to their delegate types on the
12999         Addition operation.
13000
13001         * delegate.cs: Introduce a new class DelegateCreation that is the
13002         base class for `NewDelegate' and `ImplicitDelegateCreation',
13003         factor some code in here.
13004
13005         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
13006         conversion from MethodGroups to compatible delegate types. 
13007
13008         * ecore.cs (Expression.Resolve): Do not flag error 654
13009         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
13010         we allow conversions from MethodGroups to delegate types now.
13011
13012         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
13013         assignments in v2 either.
13014
13015 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
13016
13017         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
13018         static read-only fields in ctors.
13019
13020         Applied patch from Benjamin Jemlich 
13021
13022         * expression.cs (UnaryMutator): Avoid leaking local variables. 
13023
13024 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
13025
13026         * cs-tokenizer.cs (IsCastToken): Allow the various native types
13027         here to return true, as they can be used like this:
13028
13029                 (XXX) int.MEMBER ()
13030
13031         Fixed 49836 and all the other dups
13032
13033 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
13034
13035         * driver.cs: Implement /win32res and /win32icon.
13036
13037 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
13038
13039         * cs-parser.jay: Add a rule to improve error handling for the
13040         common mistake of placing modifiers after the type.
13041
13042 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
13043
13044         * cs-parser.jay (interface_event_declaration): Catch
13045         initialization of events on interfaces, and report cs0068
13046
13047         * cs-parser.jay (interface_event_declaration): Catch
13048         initialization of events. 
13049
13050         * ecore.cs: Better report missing constructors.
13051
13052         * expression.cs (Binary.ResolveOperator): My previous bug fix had
13053         the error reporting done in the wrong place.  Fix.
13054
13055         * expression.cs (Binary.ResolveOperator): Catch the 
13056         operator + (E x, E y) error earlier, and later allow for implicit
13057         conversions in operator +/- (E e, U x) from U to the underlying
13058         type of E.
13059
13060         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
13061         52596, if the container class is abstract, the default constructor
13062         is protected otherwise its public (before, we were always public).
13063
13064         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
13065         fixed statement.
13066
13067         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
13068         Jemlich that fixes bug #52597, MCS was generating invalid code for
13069         idisposable structs.   Thanks to Ben for following up with this
13070         bug as well.
13071
13072 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
13073
13074         * driver.cs: Allow assemblies without code to be generated, fixes
13075         52230.
13076
13077 2004-01-07  Nick Drochak <ndrochak@gol.com>
13078
13079         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
13080
13081 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
13082
13083         * cs-parser.jay: Add rules to improve error reporting if fields or
13084         methods are declared at the namespace level (error 116)
13085
13086         * Add rules to catch event add/remove
13087
13088 2004-01-04  David Sheldon <dave-mono@earth.li>
13089
13090   * expression.cs: Added matching ")" to error message for 
13091   CS0077
13092
13093 2004-01-03 Todd Berman <tberman@gentoo.org>
13094
13095         * ecore.cs, attribute.cs:
13096         Applying fix from #52429.
13097
13098 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13099
13100         * ecore.cs, expression.cs, statement.cs:
13101         Total rewrite of how we handle branching. We
13102         now handle complex boolean expressions with fewer
13103         jumps. As well if (x == 0) no longer emits a ceq.
13104
13105         if (x is Foo) is much faster now, because we generate
13106         better code.
13107
13108         Overall, we get a pretty big improvement on our benchmark
13109         tests. The code we generate is smaller and more readable.
13110
13111         I did a full two-stage bootstrap. The patch was reviewed
13112         by Martin and Miguel.
13113
13114 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13115
13116         * cs-parser.jay: Make primary_expression not take a QI.
13117         we dont need this because the member_access rule covers
13118         us here. So we replace the rule with just IDENTIFIER.
13119
13120         This has two good effects. First, we remove a s/r conflict.
13121         Second, we allocate many fewer QualifiedIdentifier objects.
13122
13123 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13124
13125         * attribute.cs: Handle MarshalAs attributes as pseudo, and
13126         set the correct information via SRE. This prevents
13127         hanging on the MS runtime. Fixes #29374.
13128
13129 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13130
13131         * convert.cs: correctly handle conversions to value types
13132         from Enum and ValueType as unboxing conversions.
13133
13134         Fixes bug #52569. Patch by Benjamin Jemlich.
13135
13136 2004-01-02  Ravi Pratap  <ravi@ximian.com>
13137
13138         * expression.cs (BetterConversion): Prefer int -> uint
13139         over int -> ulong (csc's behaviour). This fixed bug #52046.
13140
13141 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
13142
13143         * decl.cs (MemberCache.FindMembers): now returns a
13144         MemberInfo [].
13145
13146         * typemanager.cs: In general, go with with ^^.
13147         (CopyNewMethods): take an IList.
13148         (RealMemberLookup): Only allocate an arraylist
13149         if we copy from two sets of methods.
13150
13151         This change basically does two things:
13152         1) Fewer array lists allocated due to CopyNewMethods.
13153         2) the explicit cast in MemberList costed ALOT.
13154
13155 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
13156
13157         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
13158         a hashtable to avoid needless string allocations when an identifier is
13159         used more than once (the common case).
13160
13161 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
13162
13163         * pending.cs: MS's TypeBuilder.GetInterfaces ()
13164         is broken, it will not return anything. So, we
13165         have to use the information we have in mcs to
13166         do the task.
13167
13168         * typemanager.cs: Add a cache for GetInterfaces,
13169         since this will now be used more often (due to ^^)
13170
13171         (GetExplicitInterfaces) New method that gets the
13172         declared, not effective, interfaces on a type
13173         builder (eg, if you have interface IFoo, interface
13174         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
13175         { IBar }.
13176
13177         This patch makes MCS able to bootstrap itself on
13178         Windows again.
13179
13180 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
13181
13182         * expression.cs: Remove the Nop's that Miguel put
13183         in by mistake.
13184
13185 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13186
13187         * report.cs, codegen.cs: Give the real stack trace to
13188         the error when an exception is thrown.
13189
13190 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13191
13192         * decl.cs: only allocate hashtables for ifaces if 
13193         it is an iface!
13194
13195 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13196
13197         * expression.cs: fix the error from cs0121-2.cs
13198         (a parent interface has two child interfaces that
13199         have a function with the same name and 0 params
13200         and the function is called through the parent).
13201
13202 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
13203
13204         * class.cs, rootcontext.cs, typmanager.cs: do not
13205         leak pointers.
13206
13207 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
13208
13209         * codegen.cs: remove stack for the ec flow branching.
13210         It is already a linked list, so no need.
13211
13212 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
13213
13214         * Makefile: Allow custom profiler here.
13215
13216 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
13217
13218         * typemanager.cs (LookupType):
13219           - Use a static char [], because split takes
13220             a param array for args, so it was allocating
13221             every time.
13222           - Do not store true in a hashtable, it boxes.
13223
13224 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
13225
13226         * flowanalysis.cs: bytify common enums.
13227
13228 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13229
13230         * modifiers.cs: Add a new set of flags for the
13231         flags allowed on explicit interface impls.
13232         * cs-parser.jay: catch the use of modifiers in
13233         interfaces correctly.
13234         * class.cs: catch private void IFoo.Blah ().
13235
13236         All related to bug #50572.
13237
13238 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13239
13240         * decl.cs: Rewrite the consistant accessability checking.
13241         Accessability is not linear, it must be implemented in
13242         a tableish way. Fixes #49704.
13243
13244 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13245
13246         * expression.cs: Handle negation in a checked context.
13247         We must use subtraction from zero. Fixes #38674.
13248
13249 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
13250
13251         * class.cs: Ignore static void main in DLLs.
13252         * rootcontext.cs: Handle the target type here,
13253         since we are have to access it from class.cs
13254         * driver.cs: account for the above.
13255
13256 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
13257
13258         * report.cs: Give line numbers and files if available.
13259
13260 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
13261
13262         * driver.cs: Implement /addmodule.
13263
13264         * typemanager.cs:  Change 'modules' field so it now contains Modules not
13265         ModuleBuilders.
13266
13267 2003-12-20  Martin Baulig  <martin@ximian.com>
13268
13269         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
13270         (FieldBase.IsAssigned): Removed this field.
13271         (FieldBase.SetAssigned): New public method.
13272         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
13273
13274 2003-12-20  Martin Baulig  <martin@ximian.com>
13275
13276         * expression.cs (LocalVariableReference.DoResolve): Don't set
13277         `vi.Used' if we're called from DoResolveLValue().
13278
13279         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
13280         returns the usage vector it just merged into the current one -
13281         pass this one to UsageWarning().
13282         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
13283         of the `EmitContext', don't call this recursively on our children.
13284
13285 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
13286
13287         * driver.cs: Implement /target:module.
13288
13289 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
13290
13291         * support.cs (CharArrayHashtable): New helper class.
13292
13293         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
13294         char arrays, not strings, so we can avoid creating a string in
13295         consume_identifier if the identifier is a keyword.
13296
13297 2003-12-16  Martin Baulig  <martin@ximian.com>
13298
13299         * statement.cs (LocalInfo.Assigned): Removed this property.
13300         (LocalInfo.Flags): Removed `Assigned'.
13301         (LocalInfo.IsAssigned): New public method; takes the EmitContext
13302         and uses flow analysis.
13303         (Block.UsageWarning): Made this method private.
13304         (Block.Resolve): Call UsageWarning() if appropriate.
13305
13306         * expression.cs (LocalVariableReference.DoResolve): Always set
13307         LocalInfo.Used here.
13308
13309 2003-12-13  Martin Baulig  <martin@ximian.com>
13310
13311         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
13312         any value here; we're now using flow analysis to figure out
13313         whether a statement/block returns a value.
13314
13315 2003-12-13  Martin Baulig  <martin@ximian.com>
13316
13317         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
13318         working again.
13319         (FlowBranching.MergeFinally): Don't call
13320         `branching.CheckOutParameters()' here, this is called in
13321         MergeTopBlock().
13322         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
13323         when adding the `finally' vector.       
13324
13325 2003-12-13  Martin Baulig  <martin@ximian.com>
13326
13327         * flowanalysis.cs
13328         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
13329         actually work and also fix #48962.
13330
13331 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
13332
13333         * decl.cs: Do not check System.Object for nested types,
13334         since we know it does not have any. Big bang for buck:
13335
13336         BEFORE:
13337            Run 1:   8.35 seconds
13338            Run 2:   8.32 seconds
13339            corlib:  17.99 seconds
13340         AFTER:
13341            Run 1:   8.17 seconds
13342            Run 2:   8.17 seconds
13343            corlib:  17.39 seconds
13344
13345 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
13346
13347         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
13348         time we are returning 0 members, so we save alot here.
13349
13350 2003-12-11  Martin Baulig  <martin@ximian.com>
13351
13352         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
13353         `MergeChild()', also just take the `FlowBranching' as argument;
13354         call Merge() on it and return the result.
13355         (FlowBranching.Merge): We don't need to do anything if we just
13356         have one sibling.
13357
13358 2003-12-11  Martin Baulig  <martin@ximian.com>
13359
13360         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
13361         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
13362         Maurer for this idea.
13363
13364 2003-12-11  Martin Baulig  <martin@ximian.com>
13365
13366         * flowanalysis.cs (MergeResult): This class is now gone; we now
13367         use the `UsageVector' for this.  The reason for this is that if a
13368         branching just has one sibling, we don't need to "merge" them at
13369         all - that's the next step to do.
13370         (FlowBranching.Merge): We now return a `UsageVector' instead of a
13371         `MergeResult'.
13372
13373 2003-12-11  Martin Baulig  <martin@ximian.com>
13374
13375         Reworked flow analyis and made it more precise and bug-free.  The
13376         most important change is that we're now using a special `Reachability'
13377         class instead of having "magic" meanings of `FlowReturns'.  I'll
13378         do some more cleanups and optimizations and also add some more
13379         documentation this week.
13380
13381         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
13382         largely reworked this class.
13383         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
13384         the new `Reachability' class instead of having "magic" values here.
13385         (FlowBranching): We're now using an instance of `Reachability'
13386         instead of having separate `Returns', `Breaks' etc. fields.
13387
13388         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
13389         based on flow analysis; ignore the return value of block.Emit ().
13390
13391 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
13392
13393         * driver.cs typemanager.cs: Find the mono extensions to corlib even
13394         if they are private.
13395
13396 2003-12-09  Martin Baulig  <martin@ximian.com>
13397
13398         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
13399         call them directly on the UsageVector.
13400
13401 2003-12-09  Martin Baulig  <martin@ximian.com>
13402
13403         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
13404         Changed return type from `FlowReturns' to `Reachability'.
13405
13406 2003-12-09  Martin Baulig  <martin@ximian.com>
13407
13408         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
13409         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
13410         `Reachable' fields with a single `Reachability' one.
13411
13412 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13413
13414         * class.cs (FindMembers): Remove foreach's.
13415
13416         Bootstrap times:
13417
13418         BEFORE
13419                 Run 1:   8.74 seconds
13420                 Run 2:   8.71 seconds
13421
13422         AFTER
13423                 Run 1:   8.64 seconds
13424                 Run 2:   8.58 seconds
13425
13426
13427 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13428
13429         * cs-parser.jay:
13430         * gen-treedump.cs:
13431         * statement.cs:
13432         This patch does a few things:
13433                 1. EmptyStatement is now a singleton, so it is never reallocated.
13434                 2. All blah is EmptyStatement constructs have been changed to
13435                    blah == EmptyStatement.Value, which is much faster and valid
13436                    now that EmptyStatement is a singleton.
13437                 3. When resolving a block, rather than allocating a new array for
13438                    the non-empty statements, empty statements are replaced with
13439                    EmptyStatement.Value
13440                 4. Some recursive functions have been made non-recursive.
13441         Mainly the performance impact is from (3), however (1) and (2) are needed for
13442         this to work. (4) does not make a big difference in normal situations, however
13443         it makes the profile look saner.
13444
13445         Bootstrap times:
13446
13447         BEFORE
13448         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13449         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13450         Total memory allocated: 56397 KB
13451
13452         AFTER
13453         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
13454         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
13455         Total memory allocated: 55666 KB
13456
13457 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13458
13459         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
13460         than the hashtable in a hashtable version
13461
13462         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
13463         we always end up concating a string. This results in a huge perf
13464         loss, because many strings have to be tracked by the GC. In this
13465         patch, we first use a hashtable that works with two keys, so that
13466         the strings do not need to be concat'ed.
13467
13468         Bootstrap times:
13469         BEFORE
13470                 Run 1:   8.74 seconds
13471                 Run 2:   8.71 seconds
13472
13473         AFTER
13474                 Run 1:   8.65 seconds
13475                 Run 2:   8.56 seconds
13476
13477 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13478
13479         * Makefile: Add a new target `do-time' that does a quick and simple
13480         profile, leaving easy to parse output.
13481
13482 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
13483
13484         * codegen.cs (Init): Create the dynamic assembly with 
13485         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
13486
13487 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
13488
13489         * support.cs: Make the PtrHashtable use only one
13490         instance of its comparer.
13491
13492 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
13493
13494         * typemanager.cs: Fix lookup of GetNamespaces.
13495
13496 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
13497
13498         * expression.cs: Removed redundant line.
13499
13500         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
13501         ArrayLists, use for loops with bounds.  
13502
13503         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
13504         arraylist.
13505
13506         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
13507         arraylists, use for loop with bounds.
13508
13509         The above three changes give us a 0.071 second performance
13510         improvement out of 3.294 seconds down to 3.223.  On my machine
13511         the above changes reduced the memory usage by 1,387 KB during
13512         compiler bootstrap.
13513
13514         * cs-parser.jay (QualifiedIdentifier): New class used to represent
13515         QualifiedIdentifiers.  Before we created a new string through
13516         concatenation, and mostly later on, the result would be
13517         manipulated by DecomposeQI through string manipulation.
13518
13519         This reduced the compiler memory usage for bootstrapping from
13520         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
13521         compile times in 0.05 seconds.
13522
13523 2003-11-28  Dick Porter  <dick@ximian.com>
13524
13525         * support.cs: Do string compares with the Invariant culture.
13526
13527         * rootcontext.cs: 
13528         * gen-treedump.cs: 
13529         * expression.cs: 
13530         * driver.cs: 
13531         * decl.cs: 
13532         * codegen.cs: 
13533         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
13534         the comparison is done with the Invariant culture.
13535
13536 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
13537
13538         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
13539         GetEnumerator method.
13540
13541         (ProbeCollectionType): Iterate starting at the most specific type
13542         upwards looking for a GetEnumerator
13543
13544         * expression.cs: Shift count can be up to 31 for int/uint and 63
13545         for long/ulong.
13546
13547 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
13548
13549         * statement.cs (Block.LookupLabel): Also look for the label on the
13550         children blocks.  Use a hash table to keep track of visited
13551         nodes. 
13552
13553         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
13554         we actually did transform the other operand, otherwise fall back
13555         to the common codepath that casts to long.
13556
13557         * cs-tokenizer.cs: Use the same code pattern as the int case.
13558         Maybe I should do the parsing myself, and avoid depending on the
13559         Parse routines to get this done.
13560
13561 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
13562
13563         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
13564         which fixes bug 51347.  This time test it.
13565
13566         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
13567         attributes for example can not tell the difference between these.
13568         The difference was only a syntax feature of the language. 
13569
13570         * attribute.cs: Apply attributes to delegates.
13571
13572         * delegate.cs: Call the apply attributes method.
13573
13574 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
13575
13576         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
13577         comparing 0 vs Byte.MinValue, not the value
13578
13579         (ImplicitConversionRequired): When reporting a conversion error,
13580         use error 31 to print out the constant error instead of the
13581         simpler 29.
13582
13583         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
13584         which fixes bug 51347.
13585
13586 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
13587
13588         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
13589         which fixes the -warnaserror command line option.
13590
13591 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
13592
13593         * cfold.cs (DoNumericPromotions): During constant folding of
13594         additions on UIntConstant, special case intconstants with
13595         IntConstants like we do on the expression binary operator. 
13596
13597 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
13598
13599         * convert.cs (ImplicitReferenceConversion): We were missing a case
13600         (System.Enum are not value types or class types, so we need to
13601         classify them separatedly).
13602
13603         * driver.cs: We do not support error 2007.
13604
13605 2003-11-12 Jackson Harper <jackson@ximian.com>
13606
13607         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
13608         system directory. Also use the full file name so users can
13609         libraries names mscorlib-o-tron.dll in a non system dir.
13610
13611 2003-11-10  Martin Baulig  <martin@ximian.com>
13612
13613         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
13614         (TypeManager.InitCoreTypes): Initialize them here, but instead of
13615         calling `ResolveType()' on them, directly assign their `Type'.
13616
13617 2003-11-08  Martin Baulig  <martin@ximian.com>
13618
13619         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
13620         return value and the `out parent' parameter.
13621         (TypeContainer.DefineType): Moved the CS0644 check into
13622         GetClassBases().  Don't pass the interface types to the
13623         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
13624         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
13625
13626         * ecore.cs (TypeExpr.IsAttribute): New property.
13627         (TypeExpr.GetInterfaces): New method.
13628
13629         * interface.cs (Interface.GetInterfaceTypeByName): Return a
13630         TypeExpr instead of a Type.
13631         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
13632         (Interface.DefineType): Don't pass the interface types to the
13633         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
13634         them later and then call `TypeBulider.AddInterfaceImplementation()'.
13635
13636         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
13637         instead of a `Type[]'.
13638         (TypeManager.RegisterBuilder): Likewise.
13639         (TypeManager.AddUserInterface): Likewise.
13640         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
13641         `Type[]' and also return a `TypeExpr[]'.
13642         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
13643
13644 2003-11-08  Martin Baulig  <martin@ximian.com>
13645
13646         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
13647         Expression.     
13648
13649 2003-11-08  Martin Baulig  <martin@ximian.com>
13650
13651         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
13652         TypeManager.ResolveExpressionTypes().
13653
13654         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
13655         instead of an Expression.
13656         (TypeExpr): This is now an abstract base class for `TypeExpression'.
13657         (TypeExpression): New public class; formerly known as `TypeExpr'.
13658
13659         * expression.cs (ComposedCast): Derive from TypeExpr.
13660
13661         * typemanager.cs (TypeManager.system_*_expr): These are now
13662         TypExpr's instead of Expression's.
13663         (TypeManager.ResolveExpressionTypes): New public static function;
13664         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
13665         of them.        
13666
13667 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
13668
13669         * expression.cs (New.DoResolve): Do not dereference value that
13670         might be a null return.
13671
13672         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
13673         sure that the constant value has the right type.  Fixes an
13674         unreported bug, similar to 50425.
13675
13676         * const.cs (Const.LookupConstantValue): Call
13677         ImplicitStandardConversionExists before doing a conversion to
13678         avoid havng the TypeManager.ChangeType do conversions.
13679
13680         Reduced the number of casts used
13681
13682         (Const.ChangeType): New routine to enable reuse of the constant
13683         type changing code from statement.
13684
13685         * typemanager.cs (ChangeType): Move common initialization to
13686         static global variables.
13687
13688         Fixes #50425.
13689
13690         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
13691         every value type to go through, even if it was void.  Fix that. 
13692
13693         * cs-tokenizer.cs: Use is_identifier_start_character on the start
13694         character of the define, and the is_identifier_part_character for
13695         the rest of the string.
13696
13697 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
13698
13699         * expression.cs (UnaryMutator.EmitCode): When I updated
13700         LocalVariableReference.DoResolve, I overdid it, and dropped an
13701         optimization done on local variable references.
13702
13703 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
13704
13705         * ecore.cs: Convert the return from Ldlen into an int.
13706
13707 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
13708
13709         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
13710         the accessibility, this is a special case for toplevel non-public
13711         classes (internal for instance).
13712
13713 2003-10-20  Nick Drochak <ndrochak@gol.com>
13714
13715         * ecore.cs: Fix typo and build.  Needed another right paren.
13716
13717 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
13718
13719         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
13720         `internal' case regular and protected, but not allowing protected
13721         to be evaluated later.  Bug 49840
13722
13723 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
13724
13725         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
13726         to kb.Nlast, and not the kb.nFirst to isolate the switch
13727         statement.
13728
13729         Extract the underlying type, so enumerations of long/ulong are
13730         treated like long/ulong.
13731
13732 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
13733
13734         * expression.cs (New): Overload the meaning of RequestedType to
13735         track the possible creation of the NewDelegate type, since
13736         DoResolve is invoked more than once for new constructors on field
13737         initialization.
13738
13739         See bugs: #48800 and #37014
13740
13741         * cs-parser.jay (declare_local_constants): Take an arraylist
13742         instead of a single constant.
13743
13744         (local_constant_declaration): It should take a
13745         constant_declarators, not a constant_declarator.  Fixes 49487
13746
13747         * convert.cs: Fix error report.
13748
13749 2003-10-13 Jackson Harper <jackson@ximian.com>
13750
13751         * typemanager.cs (TypeToCoreType): Add float and double this fixes
13752         bug #49611
13753
13754 2003-10-09  Martin Baulig  <martin@ximian.com>
13755
13756         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
13757         to the .ctor.
13758         (MethodCore.DoDefineParameters): Removed the TypeContainer
13759         argument; use the DeclSpace which was passed to the .ctor instead.
13760         (MethodCore.CheckParameter): Take a DeclSpace instead of a
13761         TypeContainer; we only need a DeclSpace here.
13762
13763 2003-10-09  Martin Baulig  <martin@ximian.com>
13764
13765         * class.cs (MethodData): Added additional `DeclSpace ds' argument
13766         to the .ctor.
13767         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
13768         EmitContext's .ctor.    
13769
13770 2003-10-09  Martin Baulig  <martin@ximian.com>
13771
13772         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
13773         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
13774         AsAccessible(), moved them as well.
13775
13776         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
13777
13778 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
13779
13780         * cs-parser.jay : Renamed yyName to yyNames related to jay.
13781
13782 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
13783
13784         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
13785         generation for >=, as spotted by Paolo, bug 48679.  
13786         Patch from David Waite.
13787
13788         * cs-tokenizer.cs: Add handling for #pragma.
13789
13790         * cs-parser.jay: Allow for both yield and yield return in the
13791         syntax.  The anti-cobolization of C# fight will go on!
13792
13793         * class.cs (TypeBuilder.DefineType): Catch error condition here
13794         (Parent.DefineType erroring out and returning null).
13795
13796         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13797         coping with enumerations variables, we were mistakenly processing
13798         them as a regular value type instead of built-in types.  Fixes the
13799         bug #48063
13800
13801         * typemanager.cs (IsBuiltinOrEnum): New method.
13802
13803 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
13804
13805         * cs-parser.jay: Upgrade: yield now needs the return clause.
13806
13807 2003-09-19  Martin Baulig  <martin@ximian.com>
13808
13809         * decl.cs (MemberCache.SetupCacheForInterface): Take a
13810         `MemberCache parent' argument.  Normally, an interface doesn't
13811         have a parent type except System.Object, but we use this in gmcs
13812         for generic type parameters.
13813
13814 2003-09-18  Martin Baulig  <martin@ximian.com>
13815
13816         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
13817         on `type.IsInterface'; don't check whether the type has a parent
13818         to determine whether it's an interface.
13819
13820 2003-09-15  Martin Baulig  <martin@ximian.com>
13821
13822         * class.cs (TypeContainer.DefineType): Added an error flag to
13823         avoid reporting duplicate CS0146's ("class definition is
13824         circular.").
13825
13826         * driver.cs (Driver.MainDriver): Abort if
13827         RootContext.ResolveTree() reported any errors.
13828
13829 2003-09-07  Martin Baulig  <martin@ximian.com>
13830
13831         * report.cs (Error, Warning): Added overloaded versions which take
13832         a `params object[] args' and call String.Format().
13833
13834 2003-09-07  Martin Baulig  <martin@ximian.com>
13835
13836         * decl.cs (DeclSpace..ctor): Don't call
13837         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
13838         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
13839         (DeclSpace.RecordDecl): New method.
13840
13841         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
13842
13843 2003-09-02  Ravi Pratap  <ravi@ximian.com>
13844
13845         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
13846         value attributes to be applied to ParameterBuilders.
13847
13848         * class.cs (MethodCore.LabelParameters): Make static and more
13849         generic so that it can be used from other places - like interface
13850         methods, for instance.
13851
13852         * interface.cs (Interface.Emit): Call LabelParameters before
13853         emitting attributes on the InterfaceMethod.
13854
13855 2003-08-26  Martin Baulig  <martin@ximian.com>
13856
13857         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
13858         resolving aliases; fixes #47927.
13859
13860 2003-08-26  Martin Baulig  <martin@ximian.com>
13861
13862         * statement.cs (Using.DoResolve): This is internally emitting a
13863         try/finally clause, so we need to set ec.NeedExplicitReturn if we
13864         do not always return.  Fixes #47681.
13865
13866 2003-08-26  Martin Baulig  <martin@ximian.com>
13867
13868         * decl.cs (MemberCore): Moved WarningNotHiding(),
13869         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
13870         into MemberBase.
13871         (AdditionResult): Make this nested in DeclSpace.
13872         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
13873         argument; call NamespaceEntry.Define() unless we're nested in a
13874         class or struct.
13875
13876         * namespace.cs (Namespace.DefineName): New public function.  This
13877         is called from DeclSpace's .ctor to add 
13878         (Namespace.Lookup): Include DeclSpaces in the lookup.
13879
13880         * class.cs (Operator): Derive from MemberBase, not MemberCore.
13881
13882         * const.cs (Const): Derive from MemberBase, not MemberCore.     
13883
13884 2003-08-25  Martin Baulig  <martin@ximian.com>
13885
13886         * convert.cs (Convert.ExplicitReferenceConversion): When
13887         converting from an interface type to a class, unbox if the target
13888         type is a struct type.  Fixes #47822.
13889
13890 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13891
13892         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
13893         #47854.
13894
13895 2003-08-22  Martin Baulig  <martin@ximian.com>
13896
13897         * class.cs (TypeManager.DefineType): When defining a nested type,
13898         call DefineType() on our parent; fixes #47801.
13899
13900 2003-08-22  Martin Baulig  <martin@ximian.com>
13901
13902         * class.cs (MethodData.Define): While checking if a method is an
13903         interface implementation, improve the test a bit more to fix #47654.
13904
13905 2003-08-22  Martin Baulig  <martin@ximian.com>
13906
13907         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
13908         correctly; fixes #47722.
13909
13910 2003-08-22  Martin Baulig  <martin@ximian.com>
13911
13912         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
13913         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
13914
13915         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
13916
13917 2003-08-22  Martin Baulig  <martin@ximian.com>
13918
13919         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
13920         can only be assigned in static constructors.  Fixes #47161.
13921
13922 2003-08-22  Martin Baulig  <martin@ximian.com>
13923
13924         Rewrote and improved the flow analysis code.
13925
13926         * flowbranching.cs (FlowBranching): Make this class abstract.
13927         (FlowBranching.CreateBranching): New static function to create a
13928         new flow branching.
13929         (FlowBranchingBlock, FlowBranchingException): New classes.
13930         (FlowBranching.UsageVector.Type): New public readonly field.
13931         (FlowBranching.UsageVector.Breaks): Removed the setter.
13932         (FlowBranching.UsageVector.Returns): Removed the setter.
13933         (FlowBranching.UsageVector): Added Break(), Return(),
13934         NeverReachable() and Throw() methods to modify the reachability.
13935         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
13936         done by FlowBranching.Merge().
13937         (FlowBranching.UsageVector.MergeChild): New method; merges the
13938         merge result into the current vector.
13939         (FlowBranching.Merge): New abstract method to merge a branching.
13940
13941 2003-08-12  Martin Baulig  <martin@ximian.com>
13942
13943         * expression.cs (Indirection.CacheTemporaries): Create the
13944         LocalTemporary with the pointer type, not its element type.
13945
13946 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
13947
13948         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
13949         token was a keyword or not.
13950
13951         Add `error' options where an IDENTIFIER was expected;  Provide
13952         CheckToken and CheckIdentifierToken convenience error reporting
13953         functions. 
13954
13955         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
13956
13957         * decl.cs: Rename `NamespaceEntry Namespace' public field into
13958         NameSpaceEntry NameSpaceEntry.
13959
13960         (LookupInterfaceOrClass): Avoid creating a full qualified name
13961         from namespace and name: avoid doing lookups when we know the
13962         namespace is non-existant.   Use new Tree.LookupByNamespace which
13963         looks up DeclSpaces based on their namespace, name pair.
13964
13965         * driver.cs: Provide a new `parser verbose' to display the
13966         exception thrown during parsing.  This is turned off by default
13967         now, so the output of a failure from mcs is more graceful.
13968
13969         * namespace.cs: Track all the namespaces defined in a hashtable
13970         for quick lookup.
13971
13972         (IsNamespace): New method
13973
13974 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
13975
13976         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
13977         we know that we need to concatenate (full typename can never be
13978         null). 
13979
13980         * class.cs: ditto.
13981
13982         * statement.cs: Use a bitfield;  Do not initialize to null things
13983         which are done by the constructor by default.
13984
13985         * cs-parser.jay: bug fix, parameter was 4, not 3.
13986
13987         * expression.cs: Just use the property;
13988
13989         * statement.cs: No need for GetVariableInfo method.
13990
13991 2003-08-08  Martin Baulig  <martin@ximian.com>
13992
13993         * flowanalysis.cs (FlowReturns): This is now nested in the
13994         `FlowBranching' class.
13995         (MyBitVector): Moved this here from statement.cs.
13996         (FlowBranching.SiblingType): New enum type.
13997         (FlowBranching.CreateSibling): Added `SiblingType' argument.
13998
13999 2003-08-07  Martin Baulig  <martin@ximian.com>
14000
14001         * flowanalysis.cs (FlowBranchingType): This is now nested in the
14002         `FlowBranching' class and called `BranchingType'.
14003
14004 2003-08-07  Martin Baulig  <martin@ximian.com>
14005
14006         * flowanalysis.cs: Moved all the control flow analysis code into
14007         its own file.
14008
14009 2003-08-07  Martin Baulig  <martin@ximian.com>
14010
14011         * assign.cs (Assign.DoResolve): `target' must either be an
14012         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
14013         #37319.
14014
14015 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
14016
14017         * expression.cs (BinaryMethod): This kind of expression is created by the
14018         Binary class if it determines that the operator has to be handled
14019         by a method.
14020
14021         (BinaryDelegate): This kind of expression is created if we are
14022         dealing with a + or - operator on delegates.
14023
14024         (Binary): remove method, argumetns, and DelegateOperator: when
14025         dealing with methods, 
14026
14027         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
14028
14029         * statement.cs (Block): use bitfields for the three extra booleans
14030         we had in use.   Remove unused topblock parameter.
14031
14032         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
14033
14034         * assign.cs: Drop extra unneeded tests.
14035
14036 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
14037
14038         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
14039
14040         * statement.cs (Foreach): Use VariableStorage instead of
14041         LocalBuilders.   
14042
14043         * codegen.cs (VariableStorage): New class used by clients that
14044         require a variable stored: locals or fields for variables that
14045         need to live across yield.
14046
14047         Maybe provide a convenience api for EmitThis+EmitLoad?
14048
14049         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
14050         these bad boys.
14051
14052 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
14053
14054         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
14055         RemapParameterLValue): New methods that are used to turn a
14056         precomputed FieldInfo into an expression like this:
14057
14058                 instance.FieldInfo
14059
14060         The idea is to use this instead of making LocalVariableReference
14061         have more than one meaning.
14062
14063         * cs-parser.jay: Add error production to BASE.
14064
14065         * ecore.cs: Deal with TypeManager.GetField returning null, which
14066         is now a valid return value.
14067
14068         (FieldExprNoAddress): New expression for Fields whose address can
14069         not be taken.
14070
14071         * expression.cs (LocalVariableReference): During the resolve
14072         phases, create new expressions if we are in a remapping context.
14073         Remove code that dealt with remapping here.
14074
14075         (ParameterReference): same.
14076
14077         (ProxyInstance): New expression, like the `This' expression, but
14078         it is born fully resolved.  We know what we are doing, so remove
14079         the errors that are targeted to user-provided uses of `this'.
14080
14081         * statement.cs (Foreach): our variable is now stored as an
14082         Expression;  During resolution, follow the protocol, dont just
14083         assume it will return this.
14084
14085 2003-08-06  Martin Baulig  <martin@ximian.com>
14086
14087         * support.cs (SeekableStreamReader.cs): New public class.
14088
14089         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
14090         SeekableStreamReader instead of the normal StreamReader.
14091
14092 2003-08-04  Martin Baulig  <martin@ximian.com>
14093
14094         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
14095         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
14096         deambiguate casts and delegate invocations.
14097         (parenthesized_expression): Use the new tokens to ensure this is
14098         not a cast of method invocation.
14099
14100         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
14101         when reading a `)' and Deambiguate_CloseParens () was previously
14102         called.
14103
14104         * expression.cs (ParenthesizedExpression): New class.  This is
14105         just used for the CS0075 test.
14106         (Binary.DoResolve): Check for CS0075.   
14107
14108 2003-07-29  Ravi Pratap  <ravi@ximian.com>
14109
14110         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
14111         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
14112         reference comparison.
14113
14114         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
14115         examine the ReturnType for equality - this is necessary in the
14116         cases of implicit and explicit operators whose signature also
14117         includes the return type.
14118
14119 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
14120
14121         * namespace.cs: Cache the result of the namespace computation,
14122         instead of computing it every time.
14123
14124 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
14125
14126         * decl.cs: Use a global arraylist that we reuse over invocations
14127         to avoid excesive memory consumption.  Reduces memory usage on an
14128         mcs compile by one meg (45 average).
14129
14130         * typemanager.cs (LookupTypeReflection): In .NET pointers are
14131         private, work around that.
14132
14133 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
14134
14135         * literal.cs (IntLiteral): Define Zero and One static literals. 
14136
14137         * cs-parser.jay (integer_literal): use static literals to reduce
14138         memory usage for the most used literals (0, 1 and -1).  211kb
14139         reduced in memory usage.
14140
14141         Replace all calls to `new ArrayList' with `new
14142         ArrayList(4)' which is a good average number for most allocations,
14143         and also requires only 16 bytes of memory for its buffer by
14144         default. 
14145
14146         This reduced MCS memory usage in seven megabytes for the RSS after
14147         bootstrapping.
14148
14149 2003-07-28  Ravi Pratap  <ravi@ximian.com>
14150
14151         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
14152         handle params methods the correct way by forming only one
14153         applicable set with params and normal methods in them. Earlier we
14154         were looking at params methods only if we found no normal methods
14155         which was not the correct thing to do.
14156
14157         (Invocation.BetterFunction): Take separate arguments indicating
14158         when candidate and the best method are params methods in their
14159         expanded form.
14160
14161         This fixes bugs #43367 and #46199.
14162
14163         * attribute.cs: Documentation updates.
14164
14165         (CheckAttribute): Rename to CheckAttributeTarget.
14166         (GetValidPlaces): Rename to GetValidTargets.
14167
14168         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
14169         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
14170
14171         Fixes bug #44468.
14172
14173 2003-07-28  Martin Baulig  <martin@ximian.com>
14174
14175         * class.cs (TypeContainer.DefineMembers): Use the base type's full
14176         name when looking up the base class of a nested class.  Fixes #46977.
14177
14178 2003-07-26  Martin Baulig  <martin@ximian.com>
14179
14180         * expression.cs (Indexers.Indexer): New nested struct; contains
14181         getter, setter and the indexer's type.
14182         (Indexers.Properties): This is now an ArrayList of
14183         Indexers.Indexer's.
14184         (IndexerAccess.DoResolveLValue): Correctly set the type if the
14185         indexer doesn't have any getters.
14186
14187         * assign.cs (Assign.DoResolve): Also do the implicit conversions
14188         for embedded property and indexer assignments.
14189
14190 2003-07-26  Martin Baulig  <martin@ximian.com>
14191
14192         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
14193         preprocessor directive is not the first non-whitespace character
14194         on a line.
14195
14196 2003-07-26  Martin Baulig  <martin@ximian.com>
14197
14198         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
14199         namespace parsing, follow the spec more closely.
14200
14201         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
14202         NamespaceEntry.Lookup().
14203
14204 2003-07-25  Martin Baulig  <martin@ximian.com>
14205
14206         * MethodCore.cs (OverridesSomething): New public field; it's set
14207         from TypeContainer.DefineMembers if this method overrides
14208         something (which doesn't need to be a method).  Fix #39462.
14209
14210 2003-07-25  Ravi Pratap  <ravi@ximian.com>
14211
14212         * typemanager.cs (GetMembers): Ensure that the list of members is
14213         reversed. This keeps things in sync.
14214
14215         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
14216         find an AttributeUsage attribute.
14217
14218         * expression.cs (Invocation.OverloadResolve): Perform the check
14219         which disallows Invoke to be directly called on a Delegate.
14220
14221         (Error_InvokeOnDelegate): Report error cs1533.
14222
14223 2003-07-25  Martin Baulig  <martin@ximian.com>
14224
14225         * expression.cs (Indexers.GetIndexersForType): Only look in the
14226         interface hierarchy if the requested type is already an
14227         interface.  Fixes #46788 while keeping #46502 fixed.
14228
14229 2003-07-25  Martin Baulig  <martin@ximian.com>
14230
14231         * class.cs (TypeContainer.DefineMembers): Check whether all
14232         readonly fields have been assigned and report warning CS0649 if
14233         not.
14234
14235         * statement.cs (LocalInfo.IsFixed): Always return true if this is
14236         a valuetype.
14237
14238 2003-07-24  Ravi Pratap  <ravi@ximian.com>
14239
14240         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
14241         returned from GetMethods to make things consistent with the
14242         assumptions MCS makes about ordering of methods.
14243
14244         This should comprehensively fix bug #45127 and it does :-)
14245
14246         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
14247         ordering is actually reverse.
14248
14249         * Clean up some debug messages I left lying around.
14250
14251         * interface.cs (Populate*): Get rid of code which emits attributes
14252         since the stage in which we emit attributes is the 'Emit' stage,
14253         not the define stage.
14254
14255         (Emit): Move attribute emission for interface members here.
14256
14257 2003-07-22  Ravi Pratap  <ravi@ximian.com>
14258
14259         * expression.cs (Invocation.OverloadResolve): Follow the spec more
14260         closely: we eliminate methods in base types when we have an
14261         applicable method in a top-level type.
14262
14263         Please see section 14.5.5.1 for an exact description of what goes
14264         on. 
14265
14266         This fixes bug #45127 and a host of other related to corlib compilation.
14267
14268         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
14269         array is the method corresponding to the top-level type (this is
14270         because of the changes made to icall.c) so we change this
14271         accordingly.
14272
14273         (MethodGroupExpr.Name): This too.
14274
14275         * typemanager.cs (GetElementType): New method which does the right
14276         thing when compiling corlib. 
14277
14278         * everywhere: Make use of the above in the relevant places.
14279
14280 2003-07-22  Martin Baulig  <martin@ximian.com>
14281
14282         * cs-parser.jay (invocation_expression): Moved
14283         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
14284         `cast_expression', but create a InvocationOrCast which later
14285         resolves to either an Invocation or a Cast.
14286
14287         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
14288         method; call this before EmitStatement() to make sure that this
14289         expression can be used as a statement.
14290
14291         * expression.cs (InvocationOrCast): New class; resolves to either
14292         an Invocation or a Cast.
14293
14294         * statement.cs (StatementExpression): Call ResolveStatement() on
14295         the ExpressionStatement before emitting it.
14296
14297 2003-07-21  Martin Baulig  <martin@ximian.com>
14298
14299         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
14300         `ref' and `out' attributes match; fixes #46220.
14301         (MemberAccess.ResolveMemberAccess): You can't reference a type
14302         through an expression; fixes #33180.
14303         (Indexers.GetIndexersForType): Don't return the indexers from
14304         interfaces the class implements; fixes #46502.
14305
14306 2003-07-21  Martin Baulig  <martin@ximian.com>
14307
14308         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
14309         CS0661 checks; fixes bug #30442.
14310
14311 2003-07-21  Martin Baulig  <martin@ximian.com>
14312
14313         * decl.cs (AdditionResult): Added `Error'.
14314
14315         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
14316
14317         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
14318         makes cs0031.cs actually work.
14319
14320 2003-07-20  Martin Baulig  <martin@ximian.com>
14321
14322         * namespace.cs: Fixed that bug which caused a crash when compiling
14323         the debugger's GUI.
14324
14325 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
14326
14327         * typemanager.cs (LookupTypeReflection): Never expose types which
14328         are NotPublic, NestedPrivate, NestedAssembly, or
14329         NestedFamANDAssem.  We used to return these, and later do a check
14330         that would report a meaningful error, but the problem is that we
14331         would not get the real match, if there was a name override.
14332
14333 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
14334
14335         * namespace.cs (Namespace, Name): Do not compute the namespace
14336         name dynamically, compute it in the constructor.  This reduced
14337         memory usage by 1697 KB.
14338
14339         * driver.cs: Use --pause to pause at the end.
14340
14341 2003-07-17  Peter Williams  <peter@newton.cx>
14342
14343         * Makefile: Change the name of the test target so that it doesn't
14344         conflict with the recursive test target.
14345
14346 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
14347
14348         * expression.cs (LocalVariableReference.Emit, EmitAssign,
14349         AddressOf): Do not use EmitThis, that was wrong, use the actual
14350         this pointer.
14351
14352 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
14353
14354         * class.cs (MethodData.Define): While checking if a method is an
14355         interface implementation, improve the test: If we are not public
14356         (use new test here: use the computed MethodAttributes directly,
14357         instead of the parsed modifier flags) check if the `implementing'
14358         method comes from an interface or not.
14359
14360         * pending.cs (VerifyPendingMethods): Slightly better error
14361         message.
14362
14363         * makefile: add test target that does the mcs bootstrap.
14364
14365 2003-07-16  Ravi Pratap  <ravi@ximian.com>
14366
14367         * interface.cs (Define): Do nothing here since there are no
14368         members to populate etc. Move the attribute emission out of here
14369         since this was just totally the wrong place to put it. Attribute
14370         application happens during the 'Emit' phase, not in the 'Define'
14371         phase.
14372
14373         (Emit): Add this method and move the attribute emission here
14374
14375         * rootcontext.cs (EmitCode): Call the Emit method on interface
14376         types too.
14377
14378 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
14379
14380         * expression.cs (OverloadResolve): Report error only if Location
14381         is not 'Null' which means that there was a probe going on.
14382
14383 2003-07-14  Martin Baulig  <martin@ximian.com>
14384
14385         * expression.cs (ConditionalLogicalOperator): New public class to
14386         implement user defined conditional logical operators.
14387         This is section 14.11.2 in the spec and bug #40505.
14388
14389 2003-07-14  Martin Baulig  <martin@ximian.com>
14390
14391         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
14392
14393 2003-07-14  Martin Baulig  <martin@ximian.com>
14394
14395         * codegen.cs (EmitContext.InFixedInitializer): New public field.
14396
14397         * ecore.cs (IVariable.VerifyFixed): New interface method.
14398
14399         * expression.cs (Unary.ResolveOperator): When resolving the `&'
14400         operator, check whether the variable is actually fixed.  Fixes bug
14401         #36055.  Set a variable definitely assigned when taking its
14402         address as required by the spec.
14403
14404         * statement.cs (LocalInfo.IsFixed): New field.
14405         (LocalInfo.MakePinned): Set `IsFixed' to true.
14406
14407 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
14408
14409         * attribute.cs (Attribute.Resolve): While doing a Member lookup
14410         for .ctors, ensure that we only ask for members declared in the
14411         attribute type (BindingFlags.DeclaredOnly).
14412
14413         Fixes bug #43632.
14414
14415         * expression.cs (Error_WrongNumArguments): Report error 1501
14416         correctly the way CSC does.
14417
14418 2003-07-13  Martin Baulig  <martin@ximian.com>
14419
14420         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
14421         lookup on the fully qualified name, to make things like "X.X" work
14422         where "X.X" is a fully qualified type name, but we also have a
14423         namespace "X" in the using list.  Fixes #41975.
14424
14425 2003-07-13  Martin Baulig  <martin@ximian.com>
14426
14427         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
14428         function. If we're a CompoundAssign, we need to create an embedded
14429         CompoundAssign, not an embedded Assign.
14430         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
14431         Fixes #45854.
14432
14433 2003-07-13  Martin Baulig  <martin@ximian.com>
14434
14435         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
14436         work to fix bug #46088.
14437
14438 2003-07-13  Ravi Pratap <ravi@ximian.com>
14439
14440         * class.cs (Operator.Emit): Do not emit attributes here - it is
14441         taken care of by the Method class that we delegate too. This takes
14442         care of bug #45876.
14443
14444 2003-07-10  Martin Baulig  <martin@ximian.com>
14445
14446         * expression.cs (TypeOfVoid): New class.
14447         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
14448
14449 2003-07-10  Martin Baulig  <martin@ximian.com>
14450
14451         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
14452         bug #35957.
14453
14454 2003-07-10  Martin Baulig  <martin@ximian.com>
14455
14456         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
14457         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
14458
14459         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
14460
14461         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
14462
14463 2003-07-10  Martin Baulig  <martin@ximian.com>
14464
14465         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
14466         of decimal.  Fixes #42850.
14467
14468         NOTE: I also fixed the created byte blob, but this doesn't work on
14469         the MS runtime and csc never produces any byte blobs for decimal
14470         arrays.
14471
14472 2003-07-10  Martin Baulig  <martin@ximian.com>
14473
14474         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
14475         structs; fixes #32068.
14476         (Block.AddChildVariableNames): Fixed #44302.
14477
14478 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14479
14480         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
14481
14482 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14483
14484         * attribute.cs: And this test is onger needed.
14485
14486 2003-07-08  Martin Baulig  <martin@ximian.com>
14487
14488         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
14489         inaccessible types.  Fixes #36313.
14490
14491         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
14492
14493         * namespace.cs (NamespaceEntry): Create implicit entries for all
14494         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
14495         implicit entries for N1.N2 and N1.
14496
14497 2003-07-08  Martin Baulig  <martin@ximian.com>
14498
14499         Rewrote the handling of namespaces to fix a lot of the issues
14500         wrt. `using' aliases etc.
14501
14502         * namespace.cs (Namespace): Splitted this class into a
14503         per-assembly `Namespace' and a per-file `NamespaceEntry'.
14504
14505         * typemanager.cs (TypeManager.IsNamespace): Removed.
14506         (TypeManager.ComputeNamespaces): Only compute namespaces from
14507         loaded assemblies here, not the namespaces from the assembly we're
14508         currently compiling.
14509
14510 2003-07-08  Martin Baulig  <martin@ximian.com>
14511
14512         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
14513
14514 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14515
14516         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
14517         already fixed it.  
14518
14519         I thought about the memory savings here, but LookupTypeReflection
14520         is used under already very constrained scenarios.  Compiling
14521         corlib or mcs only exposes one hit, so it would not really reduce
14522         any memory consumption.
14523
14524 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14525
14526         * typemanager.cs: fixes bug #45889 by only adding public types from
14527         other assemblies to the list of known types.
14528
14529 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14530
14531         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
14532         on the type we resolved.
14533
14534 2003-07-05  Martin Baulig  <martin@ximian.com>
14535
14536         * pending.cs (PendingImplementation.ParentImplements): Don't
14537         create the proxy if the parent is abstract.
14538
14539         * class.cs (TypeContainer.DefineIndexers): Process explicit
14540         interface implementations first.  Fixes #37714.
14541
14542 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
14543
14544         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
14545         defined recursively;  but since we modify the input parameters
14546         (left is set to `this' temporarily), we reset this value if the
14547         left_is_explicit is false, which gives the original semantics to
14548         the code.  
14549
14550         * literal.cs (NullPointer): new class used to represent a null
14551         literal in a pointer context.
14552
14553         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
14554         type is a pointer, use a NullPointer object instead of a
14555         NullLiteral.   Closes 43687
14556
14557         (ExplicitConversion): Convert pointer values using
14558         the conv opcode to the proper type.
14559
14560         * ecore.cs (New): change ValueTypeVariable property into a method,
14561         that returns whether the valuetype is suitable for being used.
14562
14563         * expression.cs (Binary.DoNumericPromotions): Only return if we
14564         the int constant was a valid uint, and we can return both left and
14565         right as uints.  If not, we continue processing, to trigger the
14566         type conversion.  This fixes 39018.
14567
14568         * statement.cs (Block.EmitMeta): During constant resolution, set
14569         the CurrentBlock property on the emitcontext, so that we resolve
14570         constants propertly.
14571
14572 2003-07-02  Martin Baulig  <martin@ximian.com>
14573
14574         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
14575         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
14576
14577         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
14578         than emitting it here.
14579
14580         * statement.cs: Fixed some more flow analysis bugs.
14581
14582 2003-07-02  Martin Baulig  <martin@ximian.com>
14583
14584         * class.cs (MethodData.Define): When implementing interface
14585         methods, set Final unless we're Virtual.
14586
14587         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
14588         check work for interface methods.
14589
14590 2003-07-01  Martin Baulig  <martin@ximian.com>
14591
14592         * ecore.cs (EmitContext.This): Replaced this property with a
14593         GetThis() method which takes a Location argument.  This ensures
14594         that we get the correct error location for a CS0188.
14595
14596 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
14597
14598         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
14599         ImplicitStandardConversion.
14600
14601         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
14602
14603 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
14604
14605         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
14606         optimization.
14607
14608 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
14609
14610         * class.cs (Constructor.Define): Turn off initlocals for unsafe
14611         constructors.
14612
14613         (MethodData.Define): Turn off initlocals for unsafe methods.
14614
14615 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
14616
14617         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
14618         complete;  Fixes #37521.
14619
14620         * delegate.cs: Use Modifiers.TypeAttr to compute the
14621         TypeAttributes, instead of rolling our own.  This makes the flags
14622         correct for the delegates.
14623
14624 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
14625
14626         * class.cs (Constructor.Define): Set the private flag for static
14627         constructors as well.
14628
14629         * cs-parser.jay (statement_expression): Set the return value to
14630         null, to avoid a crash when we catch an error.
14631
14632 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
14633
14634         * cs-parser.jay: Applied patch from Jackson that adds support for
14635         extern and unsafe modifiers to destructor declarations.
14636
14637         * expression.cs: Report error 21 if the user is trying to index a
14638         System.Array.
14639
14640         * driver.cs: Add an error message, suggested by the bug report.
14641
14642         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
14643         if we do not have a ": this ()" constructor initializer.  Fixes 45149
14644
14645 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
14646
14647         * namespace.cs: Add some information to reduce FAQs.
14648
14649 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
14650
14651         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
14652         underlying enumeration types.  Fixes #43915.
14653
14654         * expression.cs: Treat ushort/short as legal values to be used in
14655         bitwise operations.
14656
14657 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
14658
14659         * delegate.cs: transfer custom attributes for paramenters from
14660         the delegate declaration to Invoke and BeginInvoke.
14661
14662 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
14663
14664         * attribute.cs: handle custom marshalers and emit marshal info
14665         for fields, too.
14666
14667 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
14668
14669         * makefile.gnu: Added anonymous.cs to the compiler sources.
14670
14671 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
14672
14673         * iterators.cs: Change the name of the proxy class to include two
14674         underscores.
14675
14676         * cs-parser.jay: Update grammar to include anonymous methods.
14677
14678         * anonymous.cs: new file.
14679
14680 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
14681
14682         * class.cs (Field.Define): Add missing test for pointers and
14683         safety. 
14684
14685 2003-05-27  Ravi Pratap  <ravi@ximian.com>
14686
14687         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
14688         we use the stobj opcode.
14689
14690         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
14691         since it wasn't the correct fix. 
14692
14693         It still is puzzling that we are required to use stobj for IntPtr
14694         which seems to be a ValueType.
14695
14696 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
14697
14698         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
14699         during regular simple name resolution.   Now, the trick is that
14700         instead of returning for processing the simplename, we do a
14701         TypeManager.LookupType (ie, a rooted lookup as opposed to a
14702         contextual lookup type).   If a match is found, return that, if
14703         not, return for further composition.
14704
14705         This fixes long-standing 30485.
14706
14707         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14708         using the address to initialize an object, do an Stobj instead of
14709         using the regular Stelem.
14710
14711         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
14712         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
14713         Because if we are a BaseIndexerAccess that value will be true.
14714         Fixes 43643.
14715
14716         * statement.cs (GotoCase.Resolve): Return after reporting an
14717         error, do not attempt to continue. 
14718
14719         * expression.cs (PointerArithmetic.Emit): If our operand is a
14720         long, convert our constants to match the operand before
14721         multiplying.  Convert to I type before adding.   Fixes 43670.
14722
14723 2003-05-14  Ravi Pratap  <ravi@ximian.com>
14724
14725         * enum.cs (ImplicitConversionExists) : Rename to
14726         ImplicitEnumConversionExists to remove ambiguity. 
14727
14728         * ecore.cs (NullCast): New type of cast expression class which
14729         basically is very similar to EmptyCast with the difference being
14730         it still is a constant since it is used only to cast a null to
14731         something else
14732         (eg. (string) null)
14733
14734         * convert.cs (ImplicitReferenceConversion): When casting a null
14735         literal, we return a NullCast.
14736
14737         * literal.cs (NullLiteralTyped): Remove - I don't see why this
14738         should be around anymore.
14739
14740         The renaming (reported was slightly wrong). Corrections:
14741
14742         ConvertImplicitStandard -> ImplicitConversionStandard
14743         ConvertExplicitStandard -> ExplicitConversionStandard
14744
14745         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
14746         before passing them in !
14747
14748         * convert.cs (ImplicitConversionStandard): When comparing for
14749         equal expr and target types, ensure that expr is not a
14750         NullLiteral.
14751
14752         In general, we must not be checking (expr_type ==
14753         target_type) in the top level conversion methods
14754         (ImplicitConversion, ExplicitConversion etc). This checking is
14755         done in the methods that they delegate to.
14756
14757 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
14758
14759         * convert.cs: Move Error_CannotConvertType,
14760         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
14761         ImplicitNumericConversion, ImplicitConversionExists,
14762         ImplicitUserConversionExists, StandardConversionExists,
14763         FindMostEncompassedType, FindMostSpecificSource,
14764         FindMostSpecificTarget, ImplicitUserConversion,
14765         ExplicitUserConversion, GetConversionOperators,
14766         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
14767         TryImplicitIntConversion, Error_CannotConvertImplicit,
14768         ConvertImplicitRequired, ConvertNumericExplicit,
14769         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
14770         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
14771         its own file.
14772
14773         Perform the following renames:
14774
14775         StandardConversionExists -> ImplicitStandardConversionExists
14776         ConvertImplicit -> ImplicitConversion
14777         ConvertImplicitStandard -> ImplicitStandardConversion
14778         TryImplicitIntConversion -> ImplicitIntConversion
14779         ConvertImplicitRequired -> ImplicitConversionRequired
14780         ConvertNumericExplicit -> ExplicitNumericConversion
14781         ConvertReferenceExplicit -> ExplicitReferenceConversion
14782         ConvertExplicit -> ExplicitConversion
14783         ConvertExplicitStandard -> ExplicitStandardConversion
14784
14785 2003-05-19  Martin Baulig  <martin@ximian.com>
14786
14787         * statement.cs (TypeInfo.StructInfo): Made this type protected.
14788         (TypeInfo): Added support for structs having structs as fields.
14789
14790         * ecore.cs (FieldExpr): Implement IVariable.
14791         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
14792         VariableInfo for the field.
14793
14794 2003-05-18  Martin Baulig  <martin@ximian.com>
14795
14796         * expression.cs (This.DoResolve): Report a CS0027 if we're
14797         emitting a field initializer.
14798
14799 2003-05-18  Martin Baulig  <martin@ximian.com>
14800
14801         * expression.cs (This.ResolveBase): New public function.
14802         (This.DoResolve): Check for CS0188.
14803
14804         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
14805         This.Resolve().
14806
14807         * ecore.cs (MethodGroupExpr.DoResolve): Set the
14808         `instance_expression' to null if we don't have any non-static
14809         methods.
14810
14811 2003-05-18  Martin Baulig  <martin@ximian.com>
14812
14813         Reworked the way how local variables and parameters are handled by
14814         the flow analysis code.
14815
14816         * statement.cs (TypeInfo, VariableMap): New public classes.
14817         (VariableInfo): New public class.  This is now responsible for
14818         checking whether a variable has been assigned.  It is used for
14819         parameters and local variables.
14820         (Block.EmitMeta): Take the InternalParameters as argument; compute
14821         the layout of the flow vectors here.
14822         (Block.LocalMap, Block.ParameterMap): New public properties.
14823         (FlowBranching): The .ctor doesn't get the InternalParameters
14824         anymore since Block.EmitMeta() now computes the layout of the flow
14825         vector.
14826         (MyStructInfo): This class is now known as `StructInfo' and nested
14827         in `TypeInfo'; we don't access this directly anymore.
14828
14829         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
14830         property and removed IsAssigned(), IsFieldAssigned(),
14831         SetAssigned() and SetFieldAssigned(); we now call them on the
14832         VariableInfo so we don't need to duplicate this code everywhere.
14833
14834         * expression.cs (ParameterReference): Added `Block block' argument
14835         to the .ctor.
14836         (LocalVariableReference, ParameterReference, This): The new
14837         VariableInfo class is now responsible for all the definite
14838         assignment stuff.
14839
14840         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
14841         IsParameterAssigned, SetParameterAssigned): Removed.
14842
14843 2003-05-18  Martin Baulig  <martin@ximian.com>
14844
14845         * typemanager.cs (InitCoreTypes): Try calling
14846         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
14847         the 3-args-version.  Corlib now also needs our `void_type'.
14848         (GetMethod): Added overloaded version which takes an optional
14849         `bool report_errors' to allow lookups of optional methods.
14850
14851 2003-05-12  Martin Baulig  <martin@ximian.com>
14852
14853         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
14854         only used for locals and not for parameters.
14855
14856 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
14857
14858         * support.cs (InternalParameters.ParameterType): Return the
14859         ExternalType of the parameter.
14860
14861         * parameter.cs (Parameter.ExternalType): drop the two arguments,
14862         they were unused.
14863
14864 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
14865
14866         * class.cs (MethodData.Define): Do not set the `newslot' on
14867         interface members, if they are also flagged as "override".
14868
14869         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
14870         better code for ++i and i++.  This only works for static fields
14871         and local variables.
14872
14873         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
14874         want to pull the DeclSpace out of the builder_to_declspace instead
14875         of the TypeBuilder (like in TypeContainer.FindMembers).
14876
14877         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
14878         instead of LookupTypeContainer.  Fixes the crash on .NET for
14879         looking up interface members.
14880
14881         * const.cs: Create our own emit context during the Definition
14882         stage, so that constants are evaluated in the proper context, when
14883         a recursive definition happens.
14884
14885 2003-05-11  Martin Baulig  <martin@ximian.com>
14886
14887         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
14888         new block for a switch section.
14889         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
14890         the adding/lookup in the switch block.  Fixes #39828.
14891
14892 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
14893
14894         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
14895         functionality: I needed to convert the data after I had performed
14896         the add/sub operation into the operands type size.
14897
14898         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
14899         pass the type for the box operation, otherwise the resulting
14900         object would have been of type object.
14901
14902         (BoxedCast): Add constructor to specify the type to box as.
14903
14904 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
14905
14906         * iterators.cs: I was reusing the `count' variable inadvertently,
14907         take steps to not allow this to happen.
14908
14909 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
14910
14911         * attribute.cs (Attribute.Resolve): Params attributes are encoded
14912         by creating an array at the point where the params starts and
14913         putting all those arguments there, then adjusting the size of the
14914         array.
14915
14916 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
14917
14918         * expression.cs (New.AddressOf): Implement interface
14919         IMemoryLocation.  This is used when the `new' operator is used in
14920         the context of an invocation to a method on a value type.
14921
14922         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
14923         example. 
14924
14925         * namespace.cs: Also check the using aliases here.
14926
14927         * driver.cs: Move the test for using validity after the types have
14928         been entered, so we do a single pass that also includes the using
14929         aliases. 
14930
14931         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
14932         in the regular case.   CreateSiblingForFinally is doing extra
14933         error checking.
14934
14935         * attribute.cs (GetAttributeArgumentExpression): Store the result
14936         on an out value, and use the return value to indicate failure
14937         instead of using null (which is a valid return for Constant.GetValue).
14938
14939         * statement.cs: Perform the analysis flow for the increment
14940         portion after the statement, because this will be the real flow of
14941         execution.  Fixes #42385
14942
14943         * codegen.cs (EmitContext.EmitArgument,
14944         EmitContext.EmitStoreArgument): New helper functions when the
14945         RemapToProxy flag is set.
14946
14947         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
14948         function.
14949
14950         Add support for remapping parameters. 
14951
14952         * iterators.cs: Propagate parameter values;  Store parameter
14953         values in the proxy classes.
14954
14955 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
14956
14957         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
14958         need a proxy reference;  I do not know what I was thinking
14959
14960         * cs-parser.jay (constructor_initializer): catch another error,
14961         and display nice message.
14962
14963         (field_declaration): catch void field declaration
14964         to flag a better error. 
14965
14966         * class.cs (MemberBase.CheckBase): Report an error instead of a
14967         warning if a new protected member is declared in a struct. 
14968         (Field.Define): catch the error of readonly/volatile.
14969
14970         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
14971
14972         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
14973         volatile variable is taken
14974
14975 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
14976
14977         * statement.cs (Fixed.Resolve): Report an error if we are not in
14978         an unsafe context.
14979
14980 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
14981
14982         * typemanager.cs: reuse the code that handles type clashes for
14983         delegates and enumerations.
14984
14985         * class.cs (Report28): Always report.
14986
14987         * expression.cs (EncodeAsAttribute): Allow nulls here.
14988
14989 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
14990
14991         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
14992         the functionality for testing whether an expression is valid for
14993         an attribute here.  Also handle the case of arrays of elements
14994         being stored. 
14995
14996         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
14997         encoding a linear array into an array of objects that are suitable
14998         to be passed to an CustomAttributeBuilder.
14999
15000         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
15001
15002         * ecore.cs: (FieldExpr): Handle field remapping here.
15003
15004         * iteratators.cs: Pass the instance variable (if the method is an
15005         instance method) to the constructors, so we can access the field
15006         variables on the class.
15007
15008         TODO: Test this with structs.  I think the THIS variable on
15009         structs might have to be a pointer, and not a refenrece
15010
15011 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
15012
15013         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
15014         local variables to fields in a proxy class.
15015
15016         * iterators.cs (PopulateProxy): Rename our internal fields to
15017         <XXX>.  
15018         Create a <THIS> field if we are an instance method, so we can
15019         reference our parent container variables.
15020         (MapVariable): Called back from the EmitContext code to enter a
15021         new variable to field mapping into the proxy class (we just create
15022         a FieldBuilder).
15023
15024         * expression.cs
15025         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
15026         for using the remapped locals to fields.
15027
15028         I placed the code here, because that gives the same semantics to
15029         local variables, and only changes the Emit code.
15030
15031         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
15032         statements inside iterators.
15033         (VariableInfo): Add a FieldBuilder for the cases when we are
15034         remapping local variables to fields in a proxy class
15035
15036         * ecore.cs (SimpleNameResolve): Avoid testing two times for
15037         current_block != null.
15038
15039         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
15040         not cope with strings, as it has been moved to the
15041         TableSwitchEmit.  Fixed bug in switch generation.
15042
15043         * expression.cs (New.DoResolve): Provide more context for the user
15044         when reporting an error.
15045
15046         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
15047         pointers. 
15048
15049         * expression.cs (MemberAccess.DoResolve): When we get a type back,
15050         check the permissions for it.  Note than in a type-resolution
15051         context the check was already present in DeclSpace.ResolveType,
15052         but was missing from the MemberAccess.
15053
15054         (ArrayCreation.CheckIndices): warn if the user has
15055         more nested levels of expressions, but there are no more
15056         dimensions specified.  Avoids crash on bug 41906.
15057
15058 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
15059
15060         * statement.cs (Block): replace Implicit bool, for a generic
15061         flags.   
15062         New flag: `Unchecked'.  This is used during the EmitMeta phase
15063         (which is out-of-line with the regular Resolve/Emit process for a
15064         statement, as this is done ahead of time, but still gets a chance
15065         to call constant resolve).
15066
15067         (Block.Flags): new enum for adding a new flag.
15068
15069         (Block.EmitMeta): track the state of unchecked.
15070
15071         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
15072         to enable constant resolution to work there as well.
15073
15074 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
15075
15076         * typemanager.cs (ienumerable_type): Also look up
15077         System.Collections.IEnumerable. 
15078
15079 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
15080
15081         TODO: Test more than one conditional per method.
15082
15083         * class.cs (Indexer.Define): Report the location where the user is
15084         referencing the unsupported feature.
15085
15086         (MethodData): Overload the use of `conditionals' to
15087         minimize the creation of needless ArrayLists.   This saves roughly
15088         212kb on my machine.
15089
15090         (Method): Implement the new IIteratorContainer interface.
15091         (Method.SetYields): Implement the method by setting the ModFlags
15092         to contain METHOD_YIELDS.
15093
15094         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
15095         which just got set to null.
15096
15097         * iterators.cs: New file.
15098
15099         (Yield, YieldBreak): New statements.
15100
15101         * statement.cs (Return.Resolve): Flag an error if we are used in
15102         an iterator method.
15103
15104         * codegen.cs (InIterator): New flag set if the code is being
15105         compiled in an iterator method.
15106
15107         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
15108         internal modifier, and we just use it to avoid adding extra
15109         fields, as this is seldom used.  
15110
15111         * cs-parser.jay: Add yield_statement (yield and yield break).
15112
15113         * driver.cs: New flag -v2 to turn on version 2 features. 
15114
15115         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
15116         hashtable when v2 is enabled.
15117
15118 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
15119
15120         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
15121         there is already a namespace defined with this name.
15122
15123         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
15124         people upgraded their corlibs.
15125
15126         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
15127         always use fully qualified types, no need to use the compiler
15128         front end.
15129
15130         (TypeManager.IsNamespace): Use binarysearch.
15131
15132         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
15133         AddDelegate): I did not quite use the new IsValid API properly: I
15134         have to pass the short-name and the fullname.  I was passing only
15135         the basename instead of the fullname sometimes. 
15136
15137         (TypeContainer.DefineType): call NamespaceClash.
15138
15139         * interface.cs (Interface.DefineType): use NamespaceClash before
15140         defining the type.
15141
15142         * delegate.cs (Delegate.DefineType): use NamespaceClash before
15143         defining the type.
15144
15145         * enum.cs: (Enum.DefineType): use NamespaceClash before
15146         defining the type.
15147
15148         * typemanager.cs (: 3-line patch that gives us some tasty 11%
15149         speed increase.  First, use the negative_hits cache when we get a
15150         negative.  Second, add the type with its full original name
15151         instead of the new . and + encoded name (reflection uses + to
15152         separate type from a nested type).  Use LookupTypeReflection
15153         directly which bypasses the type->name hashtable (that we already
15154         know does not contain the type.
15155
15156         * decl.cs (DeclSpace.ResolveTypeExpr): track the
15157         location/container type. 
15158
15159         * driver.cs: When passing utf8, use directly the UTF8Encoding.
15160
15161 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
15162
15163         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
15164
15165         * delegate.cs (NewDelegate.Resolve): Test whether an instance
15166         method is being referenced in the method group from a static
15167         context, and report error 120 if so.
15168
15169         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
15170         Error118. 
15171
15172         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
15173         is created, we create the A namespace).
15174
15175         * cs-parser.jay: A namespace also introduces a DeclarationFound.
15176         Fixes #41591
15177
15178 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
15179
15180         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
15181         invocation to ModuleBuilder.GetType with the same values will
15182         return a new type instance, so we need to cache its return
15183         values. 
15184
15185         * expression.cs (Binary.ResolveOperator): Only allow the compare
15186         operators on enums if they are of the same type.
15187
15188         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
15189         types of ValueType on their own case.  Before we were giving them
15190         the same treatment as objects.
15191
15192         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
15193         fullname.  Short name is used to compare against container name.
15194         Fullname is used to check against defined namespace names.
15195
15196         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
15197         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
15198
15199         (Method.CheckBase): Call parent.
15200         (MemberBase.CheckBase): Check for protected members on sealed
15201         classes.
15202         (PropertyBase.CheckBase): Call parent.
15203         (Field.Define): Call parent.
15204
15205         * report.cs: Negative error codes are now mapped to 8000 - code,
15206         so that the display is render more nicely.
15207
15208         * typemanager.cs: Do not use try/catch, instead report a regular
15209         error. 
15210
15211         (GetPointerType, GetReferenceType): These methods provide
15212         mechanisms to obtain the T* and T& from a T.  We had the code
15213         previously scattered around the code base, and it also used
15214         TypeManager.LookupType that would go through plenty of caches.
15215         This one goes directly to the type source.
15216
15217         In some places we did the Type.GetType followed by
15218         ModuleBuilder.GetType, but not in others, so this unifies the
15219         processing as well.
15220
15221         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
15222         statements now that we have namespace information.
15223
15224         * typemanager.cs (IsNamespace): New method, returns whether the
15225         string presented is a namespace or not.
15226
15227         (ComputeNamespaces): New public entry point, computes the list of
15228         available namespaces, using the GetNamespaces API call in Mono, or
15229         the slower version in MS.NET.   
15230
15231         Now before we start the semantic analysis phase, we have a
15232         complete list of namespaces including everything that the user has
15233         provided.
15234
15235         Deleted old code to cache namespaces in .nsc files.
15236
15237 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
15238
15239         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
15240         class/struct location definition Location for the implicit
15241         constructor location.
15242
15243         (Operator.Define): Use the location of the operator for the
15244         implicit Method definition.
15245
15246         (Constructor.Emit): use the constructor location for the implicit
15247         base initializer constructor.
15248
15249         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
15250         and the Expression class now contains two new methods:
15251
15252         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
15253         isolate type lookup from the rest of the resolution process.
15254
15255         Since we use Expressions to hold type definitions due to the way
15256         we parse the input we have historically overloaded Resolve to
15257         perform the Type lookups if a special flag is passed.  Now this is
15258         eliminated and two methods take their place. 
15259
15260         The differences in the two methods between xStep and xTerminal is
15261         that xStep is involved in our current lookup system that uses
15262         SimpleNames to compose a name, while xTerminal is used just to
15263         catch the case where the simplename lookup failed.
15264
15265 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
15266
15267         * expression.cs (ResolveMemberAccess): Remove redundant code.
15268         TypeExpr expressions are always born fully resolved.
15269
15270         * interface.cs (PopulateMethod): Do not lookup the types twice.
15271         We were doing it once during SemanticAnalysis and once during
15272         PopulateMethod.
15273
15274         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
15275         in local variable type definitions, were being returned as a
15276         SimpleName (we decomposed everything into a string), that is
15277         because primary_expression was being used instead of a type in the
15278         grammar (reduce/reduce conflicts).
15279
15280         The part that was wrong is that we converted the expression into a
15281         string (an oversimplification in one hand, compounded with primary
15282         expressions doing string concatenation).
15283
15284         So things like:
15285
15286         A.B.C [] x;
15287
15288         Would return "A.B.C[]" as a SimpleName.  This stopped things like
15289         using clauses from working on this particular context.  And a type
15290         was being matched directly against "A.B.C[]".
15291
15292         We now use the correct approach, and allow for ComposedCast to be
15293         part of the unary expression.  So the "A.B.C []" become a composed
15294         cast of "A.B.C" (as a nested group of MemberAccess with a
15295         SimpleName at the end) plus the rank composition "[]". 
15296
15297         Also fixes 35567
15298
15299 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
15300
15301         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
15302         for the access level checking.
15303
15304         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
15305         `TypeContainer container', because I kept getting confused when I
15306         was debugging this code.
15307
15308         * expression.cs (Indexers): Instead of tracking getters/setters,
15309         we now track them in parallel.  We create one arraylist less, but
15310         most importantly it is possible now for the LValue code to find a
15311         matching get for a set.
15312
15313         (IndexerAccess.DoResolveLValue): Update the code.
15314         GetIndexersForType has been modified already to extract all the
15315         indexers from a type.  The code assumed it did not.
15316
15317         Also make the code set the correct return type for the indexer.
15318         This was fixed a long time ago for properties, but was missing for
15319         indexers.  It used to be void_type.
15320
15321         (Binary.Emit): Test first for doubles instead of
15322         floats, as they are more common.
15323
15324         (Binary.EmitBranchable): Use the .un version of the branch opcodes
15325         when dealing with floats and the <=, >= operators.  This fixes bug
15326         #39314 
15327
15328         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
15329         to load the array value by emitting a load on the foreach variable
15330         type.  This was incorrect.  
15331
15332         We now emit the code to load an element using the the array
15333         variable type, and then we emit the conversion operator.
15334
15335         Fixed #40176
15336
15337 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
15338
15339         * attribute.cs: Avoid allocation of ArrayLists in the common case.
15340
15341 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
15342
15343         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
15344         test for protection before we test for signatures. 
15345
15346         (MethodSignature.ToString): implement.
15347
15348         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
15349         to the case where we reduced into a LongConstant.
15350
15351         * decl.cs (CheckAccessLevel): If the type is an array, we can not
15352         depend on whether the information is acurrate, because the
15353         Microsoft runtime will always claim that the array type is public,
15354         regardless of the real state.
15355
15356         If the type is a pointer, another problem happens: the type is
15357         reported as non-public in Microsoft.  
15358
15359         In both cases we have to call CheckAccessLevel recursively with
15360         the underlying type as the argument to be tested.
15361
15362 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
15363
15364         * assign.cs (Assign.Emit): If we are dealing with a compound
15365         assignment expression, we should use the code path that stores the
15366         intermediate result in a temporary value.  This fixes #40903.
15367
15368         *expression.cs (Indirection.ToString): Provide ToString method for
15369         debugging. 
15370
15371 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
15372
15373         * class.cs: Null out fields holding references to Block objects so
15374         they can be garbage collected.
15375
15376         * expression.cs (OverloadResolve): Remove unused local.
15377
15378 2003-04-07  Martin Baulig  <martin@ximian.com>
15379
15380         * codegen.cs (EmitContext.CurrentFile): New public field.
15381         (EmitContext.Mark): Use the CurrentFile to check whether the
15382         location is in the correct file.
15383         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
15384
15385 2003-04-07  Martin Baulig  <martin@ximian.com>
15386
15387         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
15388
15389         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
15390         location.  [FIXME: The location argument which gets passed to this
15391         method is sometimes wrong!]
15392
15393 2003-04-07  Nick Drochak <ndrochak@gol.com>
15394
15395         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
15396
15397 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
15398
15399         * expression.cs (Indirection.EmitAssign): We were using the
15400         temporary, but returning immediately instead of continuing the
15401         EmitAssing flow.
15402
15403 2003-04-06  Martin Baulig  <martin@ximian.com>
15404
15405         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
15406         if it's a nested child, but also deriving from the outer class.
15407         See test 190.cs.
15408
15409         * typemanager.cs (IsNestedChildOf): Make this work if it's a
15410         nested child, but also deriving from the outer class.  See
15411         test-190.cs.
15412         (FilterWithClosure): We may access private members of the outer
15413         class if we're a nested child and deriving from the outer class.
15414         (RealMemberLookup): Only set `closure_private_ok' if the
15415         `original_bf' contained BindingFlags.NonPublic.
15416
15417 2003-04-05  Martin Baulig  <martin@ximian.com>
15418
15419         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
15420
15421 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
15422
15423         * class.cs (Event.Define): Do not allow abstract events to have
15424         initializers. 
15425
15426 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
15427
15428         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
15429         block in event declarations.
15430
15431         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
15432         value type, get its address.
15433
15434         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
15435         leaving a class on the stack instead of a boolean value (int
15436         0/1).  Change the code so we compare against null, and then the
15437         result against zero.
15438
15439         * class.cs (TypeContainer.GetClassBases): We were checking for the
15440         parent class being sealed too late.
15441
15442         * expression.cs (Binary.Emit): For <= and >= when dealing with
15443         floating point values, use cgt.un and clt.un instead of cgt and
15444         clt alone.
15445
15446 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
15447
15448         * statement.cs: Apply the same optimization as MS: skip the 
15449         GetEnumerator returning an IEnumerator, and use the one returning a 
15450         CharEnumerator instead. This allows us to avoid the try-finally block 
15451         and the boxing.
15452
15453 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
15454
15455         * cs-parser.jay: Attributes cannot be applied to
15456                          namespaces. Fixes #40473
15457
15458 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15459
15460         * class.cs:
15461         (Add*): check if the name is valid using the full name for constants,
15462         fields, properties and events.
15463
15464 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
15465
15466         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
15467         char constants to be part of the enumeration.
15468
15469         * expression.cs (Conditional.DoResolve): Add support for operator
15470         true. Implements the missing functionality from 14.12
15471
15472         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
15473         operator true/false as required by the spec.
15474
15475         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
15476         implicit conversion to boolean.
15477
15478         * statement.cs (Statement.ResolveBoolean): A boolean expression is
15479         also one where the type implements `operator true'. 
15480
15481         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
15482         get an expression that will invoke operator true based on an
15483         expression.  
15484
15485         (GetConversionOperators): Removed the hack that called op_True
15486         here.  
15487
15488         (Expression.ResolveBoolean): Move this from Statement.
15489
15490 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
15491
15492         * ecore.cs (FieldExpr): do not allow initialization of initonly
15493         fields on derived classes
15494
15495 2003-03-13  Martin Baulig  <martin@ximian.com>
15496
15497         * statement.cs (Block.Emit): Call ig.BeginScope() and
15498         ig.EndScope() when compiling with debugging info; call
15499         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
15500
15501 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
15502
15503         * expression.cs (Indexers): Do not construct immediately, allow
15504         for new members to be appended as we go.  Fixes 38143
15505
15506 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15507
15508         * expression.cs: save/restore context when resolving an unchecked
15509         expression.
15510
15511 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
15512
15513         * cfold.cs: Catch division by zero in modulus operator during
15514         constant folding.
15515
15516 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
15517
15518         * interface.cs (Interface.DefineMembers): Avoid defining members
15519         twice. 
15520
15521 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
15522
15523         * driver.cs: handle the +/- options for -noconfig
15524
15525         * statement.cs (Unckeched.Resolve): Also track the state of
15526         unchecked in the Resolve phase.
15527
15528 2003-02-27  Martin Baulig  <martin@ximian.com>
15529
15530         * ecore.cs (Expression.MemberLookup): Don't create a
15531         MethodGroupExpr for something which is not a method.  Fixes #38291.
15532
15533 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
15534
15535         * class.cs (MemberBase.CheckParameters): Also check that the type
15536         is unmanaged if it is a pointer.
15537
15538         * expression.cs (SizeOf.Resolve): Add location information.
15539
15540         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
15541         a managed type is declared.
15542
15543         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
15544         parameter modifiers as well.  Fixes bug 38606
15545
15546         * class.cs: Very sad.  Am backing out the speed up changes
15547         introduced by the ArrayList -> Array in the TypeContainer, as they
15548         were not actually that much faster, and introduced a bug (no error
15549         reports on duplicated methods).
15550
15551         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
15552         source first, this will guarantee that we have a valid expression
15553         before calling in lower levels functions that will require a
15554         resolved object.  Then use this original_source in the
15555         target.ResolveLValue instead of the original source that was
15556         passed to us.
15557
15558         Another change.  Use target.Resolve instead of LValueResolve.
15559         Although we are resolving for LValues, we will let the Assign code
15560         take care of that (it will be called again from Resolve).  This
15561         basically allows code like this:
15562
15563         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
15564         class Y { void A (X x) { x [0] += o; }
15565
15566         The problem was that the indexer was trying to resolve for
15567         set_Item (idx, object o) and never finding one.  The real set_Item
15568         was set_Item (idx, X).  By delaying the process we get the right
15569         semantics. 
15570
15571         Fixes bug 36505
15572
15573 2003-02-23  Martin Baulig  <martin@ximian.com>
15574
15575         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
15576         while calling DoEmit ().
15577
15578         * codegen.cs (EmitContext.Mark): Don't mark locations in other
15579         source files; if you use the #line directive inside a method, the
15580         compiler stops emitting line numbers for the debugger until it
15581         reaches the end of the method or another #line directive which
15582         restores the original file.
15583
15584 2003-02-23  Martin Baulig  <martin@ximian.com>
15585
15586         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
15587
15588 2003-02-23  Martin Baulig  <martin@ximian.com>
15589
15590         * statement.cs (Block.AddChildVariableNames): We need to call this
15591         recursively, not just for our immediate children.
15592
15593 2003-02-23  Martin Baulig  <martin@ximian.com>
15594
15595         * class.cs (Event.Define): Always make the field private, like csc does.
15596
15597         * typemanager.cs (TypeManager.RealMemberLookup): Make events
15598         actually work, fixes bug #37521.
15599
15600 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
15601
15602         * delegate.cs: When creating the various temporary "Parameters"
15603         classes, make sure that we call the ComputeAndDefineParameterTypes
15604         on those new parameters (just like we do with the formal ones), to
15605         allow them to be resolved in the context of the DeclSpace.
15606
15607         This fixes the bug that Dick observed in Bugzilla #38530.
15608
15609 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
15610
15611         * expression.cs (ResolveMemberAccess): When resolving a constant,
15612         do not attempt to pull a constant if the value was not able to
15613         generate a valid constant.
15614
15615         * const.cs (LookupConstantValue): Do not report more errors than required.
15616
15617 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15618
15619         * expression.cs: fixes bug #38328.
15620
15621 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
15622
15623         * class.cs: Changed all the various members that can be part of a
15624         class from being an ArrayList to be an Array of the right type.
15625         During the DefineType type_list, interface_list, delegate_list and
15626         enum_list are turned into types, interfaces, delegates and enums
15627         arrays.  
15628
15629         And during the member population, indexer_list, event_list,
15630         constant_list, field_list, instance_constructor_list, method_list,
15631         operator_list and property_list are turned into their real arrays.
15632
15633         Although we could probably perform this operation earlier, for
15634         good error reporting we need to keep the lists and remove the
15635         lists for longer than required.
15636
15637         This optimization was triggered by Paolo profiling the compiler
15638         speed on the output of `gen-sample-program.pl' perl script. 
15639
15640         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
15641         not crash in methods like MemberLookupFailed that use this field.  
15642
15643         This problem arises when the compiler fails to resolve a type
15644         during interface type definition for example.
15645
15646 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
15647
15648         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
15649         inherit from System.Object, so we have to stop at null, not only
15650         when reaching System.Object.
15651
15652 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
15653
15654         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
15655         DeclaredOnly because the parent indexer might have had a different
15656         name, but did not loop until the top of the hierarchy was reached.
15657
15658         The problem this one fixes is 35492: when a class implemented an
15659         indexer from an interface, we were getting the interface method
15660         (which was abstract) and we were flagging an error (can not invoke
15661         abstract method).
15662
15663         This also keeps bug 33089 functioning, and test-148 functioning.
15664
15665         * typemanager.cs (IsSpecialMethod): The correct way of figuring
15666         out if a method is special is to see if it is declared in a
15667         property or event, or whether it is one of the predefined operator
15668         names.   This should fix correctly #36804.
15669
15670 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
15671
15672         The goal here is to remove the dependency on EmptyCast.Peel ().
15673         Killing it completely.
15674
15675         The problem is that currently in a number of places where
15676         constants are expected, we have to "probe" for an EmptyCast, and
15677         Peel, which is not the correct thing to do, as this will be
15678         repetitive and will likely lead to errors. 
15679
15680         The idea is to remove any EmptyCasts that are used in casts that
15681         can be reduced to constants, so we only have to cope with
15682         constants. 
15683
15684         This bug hunt was triggered by Bug 37363 and the desire to remove
15685         the duplicate pattern where we were "peeling" emptycasts to check
15686         whether they were constants.  Now constants will always be
15687         constants.
15688
15689         * ecore.cs: Use an enumconstant here instead of wrapping with
15690         EmptyCast.  
15691
15692         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
15693         throwing me off.  By handling this we can get rid of a few hacks.
15694
15695         * statement.cs (Switch): Removed Peel() code.
15696
15697 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
15698
15699         * class.cs: Location information for error 508
15700
15701         * expression.cs (New.DoResolve): Add a guard against double
15702         resolution of an expression.  
15703
15704         The New DoResolve might be called twice when initializing field
15705         expressions (see EmitFieldInitializers, the call to
15706         GetInitializerExpression will perform a resolve on the expression,
15707         and later the assign will trigger another resolution
15708
15709         This leads to bugs (#37014)
15710
15711         * delegate.cs: The signature for EndInvoke should contain any ref
15712         or out parameters as well.  We were not doing this in the past. 
15713
15714         * class.cs (Field.Define): Do not overwrite the type definition
15715         inside the `volatile' group.  Turns out that volatile enumerations
15716         were changing the type here to perform a validity test, which
15717         broke conversions. 
15718
15719 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
15720
15721         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
15722         and structs, we do not want to load the instance variable
15723
15724         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
15725         enum_type has to be handled like an object reference (implicit
15726         conversions exists from this to object), but the regular IsClass
15727         and IsValueType tests will never return true for this one.
15728
15729         Also we use TypeManager.IsValueType instead of type.IsValueType,
15730         just for consistency with the rest of the code (this is only
15731         needed if we ever use the construct exposed by test-180.cs inside
15732         corlib, which we dont today).
15733
15734 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
15735
15736         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
15737         just InternalCall.
15738
15739 2003-02-09  Martin Baulig  <martin@ximian.com>
15740
15741         * namespace.cs (Namespace..ctor): Added SourceFile argument.
15742         (Namespace.DefineNamespaces): New static public method; this is
15743         called when we're compiling with debugging to add all namespaces
15744         to the symbol file.
15745
15746         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
15747         pass it to the Namespace's .ctor.
15748
15749         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
15750         and MethodBase arguments; pass the namespace ID to the symwriter;
15751         pass the MethodBase instead of the token to the symwriter.
15752         (SymbolWriter.DefineNamespace): New method to add a namespace to
15753         the symbol file.
15754
15755 2003-02-09  Martin Baulig  <martin@ximian.com>
15756
15757         * symbolwriter.cs: New file.  This is a wrapper around
15758         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
15759         methods here in near future.
15760
15761 2003-02-09  Martin Baulig  <martin@ximian.com>
15762
15763         * codegen.cs (EmitContext.Mark): Just pass the arguments to
15764         ILGenerator.MarkSequencePoint() which are actually used by the
15765         symbol writer.
15766
15767 2003-02-09  Martin Baulig  <martin@ximian.com>
15768
15769         * location.cs (SourceFile): New public sealed class.  This
15770         contains the name and an index which is used in the location's token.
15771         (Location): Reserve an appropriate number of bits in the token for
15772         the source file instead of walking over that list, this gives us a
15773         really huge performance improvement when compiling with debugging.
15774
15775         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
15776         `SourceFile' argument instead of a string.
15777         (Driver.ProcessFile): Add all the files via Location.AddFile(),
15778         but don't parse/tokenize here, we need to generate the list of all
15779         source files before we do that.
15780         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
15781         the files.
15782
15783         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
15784         instead of a string.
15785
15786         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
15787         of a string.
15788
15789 2003-02-09  Martin Baulig  <martin@ximian.com>
15790
15791         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
15792         filename on `#line default'.
15793
15794 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
15795
15796         * statement.cs: don't clear the pinned var when the fixed statement
15797         returns from the method (fixes bug#37752).
15798
15799 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
15800
15801         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
15802         to IsValueType.
15803
15804 2003-02-07  Martin Baulig  <martin@ximian.com>
15805
15806         * driver.cs: Removed the `--debug-args' command line argument.
15807
15808         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
15809         automatically by the AsssemblyBuilder.
15810         (CodeGen.InitializeSymbolWriter): We don't need to call any
15811         initialization function on the symbol writer anymore.  This method
15812         doesn't take any arguments.
15813
15814 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
15815
15816         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
15817         from referenced assemblies as well.
15818
15819 2003-02-02  Martin Baulig  <martin@ximian.com>
15820
15821         * class.cs (MethodData.Emit): Generate debugging info for external methods.
15822
15823 2003-02-02  Martin Baulig  <martin@ximian.com>
15824
15825         * class.cs (Constructor.Emit): Open the symbol writer before
15826         emitting the constructor initializer.
15827         (ConstructorInitializer.Emit): Call ec.Mark() to allow
15828         single-stepping through constructor initializers.
15829
15830 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
15831
15832         * class.cs: Handle error 549: do not allow virtual methods in
15833         sealed classes. 
15834
15835 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
15836
15837         * decl.cs: Check access levels when resolving types
15838
15839 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
15840
15841         * statement.cs: Add parameters and locals set in catch blocks that might 
15842         return to set vector
15843
15844 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
15845
15846         * class.cs (Operator): Set the SpecialName flags for operators.
15847
15848         * expression.cs (Invocation.DoResolve): Only block calls to
15849         accessors and operators on SpecialName methods.
15850
15851         (Cast.TryReduce): Handle conversions from char constants.
15852
15853
15854 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
15855
15856         * statement.cs: small memory and time optimization in FlowBranching.
15857
15858 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
15859
15860         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
15861         problem that the last fix but in the other sid (Set).
15862
15863         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
15864         access when there is no indexer in the hierarchy.
15865
15866 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
15867
15868         * class.cs: Combine some if statements.
15869
15870 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15871
15872         * driver.cs: fixed bug #37187.
15873
15874 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
15875
15876         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
15877         any indexer, it's needed to build a list with all the indexers in the
15878         hierarchy (AllGetters), else we have problems. Fixes #35653.
15879
15880 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
15881
15882         * class.cs (MethodData.Define): It is wrong for an interface
15883         implementation to be static in both cases: explicit and implicit.
15884         We were only handling this in one case.
15885
15886         Improve the if situation there to not have negations.
15887
15888         * class.cs (Field.Define): Turns out that we do not need to check
15889         the unsafe bit on field definition, only on usage.  Remove the test.
15890
15891 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15892
15893         * driver.cs: use assembly.Location instead of Codebase (the latest
15894         patch made mcs fail when using MS assemblies).
15895
15896 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
15897
15898         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
15899         get the path to *corlib.dll.
15900
15901 2003-01-21  Nick Drochak <ndrochak@gol.com>
15902
15903         * cs-tokenizer.cs:
15904         * pending.cs:
15905         * typemanager.cs: Remove compiler warnings
15906
15907 2003-01-20  Duncan Mak  <duncan@ximian.com>
15908
15909         * AssemblyInfo.cs: Bump the version number to 0.19.
15910
15911 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15912
15913         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
15914
15915 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
15916
15917         * class.cs (Constructor::Emit): Emit debugging info for constructors.
15918
15919 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
15920
15921         * cs-parser.jay: Small fix: we were not comparing the constructor
15922         name correctly.   Thanks to Zoltan for the initial pointer.
15923
15924 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
15925
15926         * cs-tokenizer.cs: Set file name when specified with #line
15927
15928 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
15929
15930         * cs-parser.jay: Only perform the constructor checks here if we
15931         are named like the class;  This will help provider a better
15932         error.  The constructor path is taken when a type definition is
15933         not found, but most likely the user forgot to add the type, so
15934         report that rather than the constructor error.
15935
15936 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
15937
15938         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
15939         allocations.
15940
15941 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15942
15943         * cs-parser.jay: Add cleanup call.
15944
15945 2003-01-13  Duncan Mak  <duncan@ximian.com>
15946
15947         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
15948         consistent with other methods.
15949
15950 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15951
15952         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
15953
15954 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
15955
15956         * attribute.cs: only set GuidAttr to true when we have a
15957         GuidAttribute.
15958
15959 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15960
15961         * ecore.cs:
15962         * expression.cs:
15963         * typemanager.cs: fixes to allow mcs compile corlib with the new
15964         Type.IsSubclassOf fix.
15965
15966 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
15967
15968         * expression.cs (LocalVariableReference.DoResolve): Classify a
15969         constant as a value, not as a variable.   Also, set the type for
15970         the variable.
15971
15972         * cs-parser.jay (fixed_statement): take a type instead of a
15973         pointer_type, so we can produce a better error message later.
15974
15975         * statement.cs (Fixed.Resolve): Flag types that are not pointers
15976         as an error.  
15977
15978         (For.DoEmit): Make inifinite loops have a
15979         non-conditional branch back.
15980
15981         (Fixed.DoEmit): First populate the pinned variables, then emit the
15982         statement, then clear the variables.  Before I was emitting the
15983         code once for each fixed piece.
15984
15985
15986 2003-01-08  Martin Baulig  <martin@ximian.com>
15987
15988         * statement.cs (FlowBranching.MergeChild): A break in a
15989         SWITCH_SECTION does not leave a loop.  Fixes #36155.
15990
15991 2003-01-08  Martin Baulig  <martin@ximian.com>
15992
15993         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
15994         lives in the same number space than `param_map'.  Fixes #36154.
15995
15996 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
15997
15998         * cs-parser.jay (constructor_declaration): Set the
15999         Constructor.ModFlags before probing for it.  This makes the
16000         compiler report 514, 515 and 132 (the code was there, but got
16001         broken). 
16002
16003         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
16004         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
16005         (GotoCase.Resolve): Set `Returns' to ALWAYS.
16006
16007 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
16008
16009         * enum.cs: create the enum static fields using the enum type.
16010
16011 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
16012
16013         * class.cs: don't try to create the ParamBuilder for the return
16014         type if it's not needed (and handle it breaking for the ms runtime
16015         anyway).
16016
16017 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
16018
16019         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
16020
16021 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
16022
16023         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
16024         the command.   This showed up while compiling the JANET source
16025         code, which used \r as its only newline separator.
16026
16027 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
16028
16029         * class.cs (Method.Define): If we are an operator (because it
16030         reuses our code), then set the SpecialName and HideBySig.  #36128
16031
16032 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
16033
16034         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
16035         exception, report error 120 `object reference required'.
16036
16037         * driver.cs: Add --pause option, used during to measure the size
16038         of the process as it goes with --timestamp.
16039
16040         * expression.cs (Invocation.DoResolve): Do not allow methods with
16041         SpecialName to be invoked.
16042
16043 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
16044
16045         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
16046         number before adding it.
16047
16048 2002-12-21  Ravi Pratap  <ravi@ximian.com>
16049
16050         * ecore.cs (StandardImplicitConversion): When in an unsafe
16051         context, we allow conversion between void * to any other pointer
16052         type. This fixes bug #35973.
16053
16054 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
16055
16056         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
16057         is not thrown when extensionless outputs are used 
16058
16059 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16060
16061         * rootcontext.cs: fixed compilation of corlib.
16062
16063 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
16064
16065         * attribute.cs (Attributes.Contains): Add new method.
16066
16067         * class.cs (MethodCore.LabelParameters): if the parameter is an
16068         `out' parameter, check that no attribute `[In]' has been passed.
16069
16070         * enum.cs: Handle the `value__' name in an enumeration.
16071
16072 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
16073
16074         * decl.cs: Added special case to allow overrides on "protected
16075         internal" methods
16076
16077 2002-12-18  Ravi Pratap  <ravi@ximian.com>
16078
16079         * attribute.cs (Attributes.AddAttributeSection): Rename to this
16080         since it makes much more sense.
16081
16082         (Attributes.ctor): Don't require a Location parameter.
16083
16084         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
16085
16086         * attribute.cs (ApplyAttributes): Remove extra Location parameters
16087         since we already have that information per attribute.
16088
16089         * everywhere : make appropriate changes.
16090
16091         * class.cs (LabelParameters): Write the code which actually
16092         applies attributes to the return type. We can't do this on the MS
16093         .NET runtime so we flag a warning in the case an exception is
16094         thrown.
16095
16096 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
16097
16098         * const.cs: Handle implicit null conversions here too.
16099
16100 2002-12-17  Ravi Pratap  <ravi@ximian.com>
16101
16102         * class.cs (MethodCore.LabelParameters): Remove the extra
16103         Type [] parameter since it is completely unnecessary. Instead
16104         pass in the method's attributes so that we can extract
16105         the "return" attribute.
16106
16107 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
16108
16109         * cs-parser.jay (parse): Use Report.Error to flag errors instead
16110         of ignoring it and letting the compile continue.
16111
16112         * typemanager.cs (ChangeType): use an extra argument to return an
16113         error condition instead of throwing an exception.
16114
16115 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
16116
16117         * expression.cs (Unary.TryReduce): mimic the code for the regular
16118         code path.  Perform an implicit cast in the cases where we can
16119         implicitly convert to one of the integral types, and then reduce
16120         based on that constant.   This fixes bug #35483.
16121
16122 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16123
16124         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
16125
16126 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16127
16128         * namespace.cs: fixed bug #35489.
16129
16130 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
16131
16132         * class.cs: Remove some dead code.
16133
16134         * cs-parser.jay: Estimate the number of methods needed
16135         (RootContext.MethodCount);
16136
16137         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
16138         numbers instead of StringBuilders.
16139
16140         * support.cs (PtrHashtable): Add constructor with initial size;
16141         We can now reduce reallocations of the method table.
16142
16143 2002-12-10  Ravi Pratap  <ravi@ximian.com>
16144
16145         * attribute.cs (ApplyAttributes): Keep track of the emitted
16146         attributes on a per-target basis. This fixes bug #35413.
16147
16148 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
16149
16150         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
16151         default to the Windows 1252 encoding.
16152
16153         (UnixParseOption): Support version, thanks to Alp for the missing
16154         pointer. 
16155
16156         * AssemblyInfo.cs: Add nice assembly information.
16157
16158         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
16159         (bug 35169).
16160
16161         * cs-parser.jay: Allow a trailing comma before the close bracked
16162         in the attribute_section production.
16163
16164         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
16165         address of the instance was being taken, I will take this out,
16166         because we take the address of the object immediately here.
16167
16168 2002-12-09  Ravi Pratap  <ravi@ximian.com>
16169
16170         * typemanager.cs (AreMultipleAllowed): Take care of the most
16171         obvious case where attribute type is not in the current assembly -
16172         stupid me ;-)
16173
16174 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
16175
16176         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
16177         definitions, instead of doing that afterwards.  
16178
16179         Also we use a nice little hack, depending on the constructor, we
16180         know if we are a "composed" name or a simple name.  Hence, we
16181         avoid the IndexOf test, and we avoid 
16182
16183         * codegen.cs: Add code to assist in a bug reporter to track down
16184         the source of a compiler crash. 
16185
16186 2002-12-07  Ravi Pratap  <ravi@ximian.com>
16187
16188         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
16189         types have been emitted for a given element and flag an error
16190         if something which does not have AllowMultiple set is used more
16191         than once.
16192
16193         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
16194         attribute types and their corresponding AllowMultiple properties
16195
16196         (AreMultipleAllowed): Check the property for a given type.
16197
16198         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
16199         property in the case we have a TypeContainer.
16200
16201         (Attributes.AddAttribute): Detect duplicates and just skip on
16202         adding them. This trivial fix catches a pretty gross error in our
16203         attribute emission - global attributes were being emitted twice!
16204
16205         Bugzilla bug #33187 is now fixed.
16206
16207 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
16208
16209         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
16210         instead of pp_and).
16211
16212         * expression.cs (Binary.ResolveOperator): I can only use the
16213         Concat (string, string, string) and Concat (string, string,
16214         string, string) if the child is actually a concatenation of
16215         strings. 
16216
16217 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
16218
16219         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
16220         context where we need a 2-character lookahead.
16221
16222         * pending.cs (PendingImplementation): Rework so we can keep track
16223         of interface types all the time, and flag those which were
16224         implemented by parents as optional.
16225
16226 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
16227
16228         * expression.cs (Binary.ResolveOperator): Use
16229         String.Concat(string,string,string) or
16230         String.Concat(string,string,string,string) when possible. 
16231
16232         * typemanager: More helper methods.
16233
16234
16235 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
16236
16237         * pending.cs: remove the bogus return from GetMissingInterfaces()
16238         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
16239
16240 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16241
16242         * namespace.cs: avoid duplicated 'using xxx' being added to
16243         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
16244         when we get more than one 'using' statement for the same namespace.
16245         Report a CS0105 warning for it.
16246
16247 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
16248
16249         * cs-tokenizer.cs (consume_identifier): use read directly, instead
16250         of calling getChar/putback, uses internal knowledge of it.    
16251
16252         (xtoken): Reorder tokenizer so most common patterns are checked
16253         first.  This reduces the compilation time in another 5% (from 8.11s
16254         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
16255
16256         The parsing time is 22% of the compilation in mcs, and from that
16257         64% is spent on the tokenization process.  
16258
16259         I tried using a binary search for keywords, but this is slower
16260         than the hashtable.  Another option would be to do a couple of
16261         things:
16262
16263                 * Not use a StringBuilder, instead use an array of chars,
16264                   with a set value.  Notice that this way we could catch
16265                   the 645 error without having to do it *afterwards*.
16266
16267                 * We could write a hand-parser to avoid the hashtable
16268                   compares altogether.
16269
16270         The identifier consumption process takes 37% of the tokenization
16271         time.  Another 15% is spent on is_number.  56% of the time spent
16272         on is_number is spent on Int64.Parse:
16273
16274                 * We could probably choose based on the string length to
16275                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
16276                   computations. 
16277
16278         Another 3% is spend on wrapping `xtoken' in the `token' function.
16279
16280         Handle 0xa0 as whitespace (#34752)
16281
16282 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
16283
16284         * typemanager.cs (IsCLRType): New routine to tell whether a type
16285         is one of the builtin types.  
16286
16287         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
16288         typecode in more places instead of doing pointer comparissions.
16289         We could leverage some knowledge about the way the typecodes are
16290         laid out.
16291
16292         New code to cache namespaces in assemblies, it is currently not
16293         invoked, to be used soon.
16294
16295         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
16296
16297         * expression.cs (Binary.ResolveOperator): specially handle
16298         strings, and do not perform user-defined operator overloading for
16299         built-in types.
16300
16301 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
16302
16303         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
16304         internalcall as it is a pretty simple operation;  Avoid whenever
16305         possible to call Char.IsLetter.
16306
16307         (consume_identifier): Cut by half the number of
16308         hashtable calls by merging the is_keyword and GetKeyword behavior.
16309
16310         Do not short-circuit, because if we do, we
16311         report errors (ie, #if false && true would produce an invalid
16312         directive error);
16313
16314
16315 2002-11-24  Martin Baulig  <martin@ximian.com>
16316
16317         * expression.cs (Cast.TryReduce): If we're in checked syntax,
16318         check constant ranges and report a CS0221.  Fixes #33186.
16319
16320 2002-11-24  Martin Baulig  <martin@ximian.com>
16321
16322         * cs-parser.jay: Make this work for uninitialized variable
16323         declarations in the `for' initializer.  Fixes #32416.
16324
16325 2002-11-24  Martin Baulig  <martin@ximian.com>
16326
16327         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
16328         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
16329
16330 2002-11-24  Martin Baulig  <martin@ximian.com>
16331
16332         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
16333         argument; if true, we also check for user-defined conversions.
16334         This is only needed if both arguments are of a user-defined type.
16335         Fixes #30443, added test-175.cs.
16336         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
16337
16338         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
16339
16340 2002-11-24  Martin Baulig  <martin@ximian.com>
16341
16342         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
16343         function to get the store opcode.
16344         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
16345         only emit the Ldelema if the store opcode is Stobj.  You must run
16346         both test-34 and test-167 to test this.  Fixes #34529.
16347
16348 2002-11-23  Martin Baulig  <martin@ximian.com>
16349
16350         * ecore.cs (Expression.MemberLookup): Added additional
16351         `qualifier_type' argument which is used when we're being called
16352         from MemberAccess.DoResolve() and null if we're called from a
16353         SimpleName lookup.
16354         (Expression.MemberLookupFailed): New method to report errors; this
16355         does the CS1540 check and reports the correct error message.
16356
16357         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
16358         argument for the CS1540 check and redone the way how we're dealing
16359         with private members.  See the comment in the source code for details.
16360         (FilterWithClosure): Reverted this back to revision 1.197; renamed
16361         `closure_start_type' to `closure_qualifier_type' and check whether
16362         it's not null.  It was not this filter being broken, it was just
16363         being called with the wrong arguments.
16364
16365         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
16366         and pass it the correct `qualifier_type'; this also does the error
16367         handling for us.
16368
16369 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
16370
16371         * expression.cs (Invocation.EmitParams): If the we are dealing
16372         with a non-built-in value type, load its address as well.
16373
16374         (ArrayCreation): Use a a pretty constant instead
16375         of the hardcoded value 2.   Use 6 instead of 2 for the number of
16376         static initializers.  
16377
16378         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
16379         because they are not really value types, just glorified integers. 
16380
16381         * driver.cs: Do not append .exe, the CSC compiler does not do it.
16382
16383         * ecore.cs: Remove redundant code for enumerations, make them use
16384         the same code path as everything else, fixes the casting issue
16385         with enumerations in Windows.Forms.
16386
16387         * attribute.cs: Do only cast to string if it is a string, the
16388         validation happens later.
16389
16390         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
16391         people upgrade their corlibs.
16392
16393         * ecore.cs: Oops, enumerations were not following the entire code path
16394
16395 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
16396
16397         * typemanager.cs (FilterWithClosure): Commented out the test for
16398         1540 in typemanager.cs, as it has problems when accessing
16399         protected methods from a parent class (see test-174.cs). 
16400
16401         * attribute.cs (Attribute.ValidateGuid): new method.
16402         (Attribute.Resolve): Use above.
16403
16404 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
16405
16406         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
16407
16408         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
16409         handling for enumerations, as we only needed the TypeContainer
16410         functionality to begin with (this is required for the fix below to
16411         work for enums that reference constants in a container class for
16412         example). 
16413
16414         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
16415
16416         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
16417         a valid TypeBuilder to perform lookups on.o
16418
16419         * class.cs (InheritableMemberSignatureCompare): Use true in the
16420         call to GetGetMethod and GetSetMethod, because we are comparing
16421         the signature, and we need to get the methods *even* if they are
16422         private. 
16423
16424         (PropertyBase.CheckBase): ditto.
16425
16426         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
16427         GotoCase.Resolve): Use Peel on EmpytCasts.
16428
16429         * ecore.cs (EmptyCast): drop child, add Peel method.
16430
16431 2002-11-17  Martin Baulig  <martin@ximian.com>
16432
16433         * ecore.cs (EmptyCast.Child): New public property.
16434
16435         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
16436         label resolved to an EmptyCast.  Fixes #34162.
16437         (GotoCase.Resolve): Likewise.
16438         (Block.EmitMeta): Likewise.
16439
16440 2002-11-17  Martin Baulig  <martin@ximian.com>
16441
16442         * expression.cs (Invocation.BetterConversion): Prefer int over
16443         uint; short over ushort; long over ulong for integer literals.
16444         Use ImplicitConversionExists instead of StandardConversionExists
16445         since we also need to check for user-defined implicit conversions.
16446         Fixes #34165.  Added test-173.cs.
16447
16448 2002-11-16  Martin Baulig  <martin@ximian.com>
16449
16450         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
16451         with the `true' and `false' literals.  Fixes #33151.
16452
16453 2002-11-16  Martin Baulig  <martin@ximian.com>
16454
16455         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
16456         October 22nd; don't do the cs1540 check for static members.
16457
16458         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
16459         now using our own filter here and doing the cs1540 check again.
16460
16461 2002-11-16  Martin Baulig  <martin@ximian.com>
16462
16463         * support.cs (InternalParameters): Don't crash if we don't have
16464         any fixed parameters.  Fixes #33532.
16465
16466 2002-11-16  Martin Baulig  <martin@ximian.com>
16467
16468         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
16469         when looking up static methods to make this work on Windows.
16470         Fixes #33773.
16471
16472 2002-11-16  Martin Baulig  <martin@ximian.com>
16473
16474         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
16475         a setter rather than using PropertyInfo.CanWrite.
16476
16477 2002-11-15  Nick Drochak  <ndrochak@gol.com>
16478
16479         * class.cs: Allow acces to block member by subclasses. Fixes build
16480         breaker.
16481
16482 2002-11-14  Martin Baulig  <martin@ximian.com>
16483
16484         * class.cs (Constructor.Emit): Added the extern/block check.
16485         Fixes bug #33678.
16486
16487 2002-11-14  Martin Baulig  <martin@ximian.com>
16488
16489         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
16490         iteration while looking for indexers, this is needed because the
16491         indexer may have a different name in our base classes.  Fixed the
16492         error reporting (no indexers at all, not get accessor, no
16493         overloaded match).  Fixes bug #33089.
16494         (IndexerAccess.DoResolveLValue): Likewise.
16495
16496 2002-11-14  Martin Baulig  <martin@ximian.com>
16497
16498         * class.cs (PropertyBase.CheckBase): Make this work for multiple
16499         indexers.  Fixes the first part of bug #33089.
16500         (MethodSignature.InheritableMemberSignatureCompare): Added support
16501         for properties.
16502
16503 2002-11-13  Ravi Pratap  <ravi@ximian.com>
16504
16505         * attribute.cs (Attribute.Resolve): Catch the
16506         NullReferenceException and report it since it isn't supposed to
16507         happen. 
16508
16509 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
16510
16511         * expression.cs (Binary.EmitBranchable): Also handle the cases for
16512         LogicalOr and LogicalAnd that can benefit from recursively
16513         handling EmitBranchable.  The code now should be nice for Paolo.
16514
16515 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
16516
16517         * typemanager.cs (LookupType): Added a negative-hit hashtable for
16518         the Type lookups, as we perform quite a number of lookups on
16519         non-Types.  This can be removed once we can deterministically tell
16520         whether we have a type or a namespace in advance.
16521
16522         But this might require special hacks from our corlib.
16523
16524         * TODO: updated.
16525
16526         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
16527         and double which avoids a conversion from an integer to a double.
16528
16529         * expression.cs: tiny optimization, avoid calling IsConstant,
16530         because it effectively performs the lookup twice.
16531
16532 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
16533
16534         But a bogus return here to keep the semantics of the old code
16535         until the Mono runtime is fixed.
16536
16537         * pending.cs (GetMissingInterfaces): New method used to remove all
16538         the interfaces that are already implemented by our parent
16539         classes from the list of pending methods. 
16540
16541         * interface.cs: Add checks for calls after ResolveTypeExpr.
16542
16543 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
16544
16545         * class.cs (Class.Emit): Report warning 67: event not used if the
16546         warning level is beyond 3.
16547
16548         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
16549         being a NullLiteral.
16550
16551         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
16552         specifiers. 
16553
16554         * class.cs (TypeContainer.GetClassBases): Cover a missing code
16555         path that might fail if a type can not be resolved.
16556
16557         * expression.cs (Binary.Emit): Emit unsigned versions of the
16558         operators. 
16559
16560         * driver.cs: use error 5.
16561
16562 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
16563
16564         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
16565
16566 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
16567
16568         * cs-parser.jay (switch_section): A beautiful patch from Martin
16569         Baulig that fixed 33094.
16570
16571 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
16572
16573         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
16574         Check whether the base is abstract and report an error if so.
16575
16576         * expression.cs (IndexerAccess.DoResolveLValue,
16577         IndexerAccess.DoResolve): ditto. 
16578
16579         (Invocation.DoResolve): ditto.
16580
16581         (Invocation.FullMethodDesc): Improve the report string.
16582
16583         * statement.cs (Block): Eliminate IsVariableDefined as it is
16584         basically just a wrapper for GetVariableInfo.
16585
16586         * ecore.cs (SimpleName): Use new 
16587
16588         * support.cs (ReflectionParamter.ParameterType): We unwrap the
16589         type, as we return the actual parameter ref/unref state on a
16590         different call.
16591
16592 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
16593
16594         * support.cs: Return proper flags REF/OUT fixing the previous
16595         commit.  
16596
16597         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
16598         not used to mean `ref' but `ref or out' in ParameterReference
16599
16600         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
16601         full type signature instead of calling TypeManger.CSharpName
16602         ourselves. 
16603
16604         * support.cs (InternalParameters.ParameterDesc): Do not compare
16605         directly to the modflags, because REF/OUT will actually be bitsets
16606         if set. 
16607
16608         * delegate.cs (VerifyMethod): Check also the modifiers.
16609
16610         * cs-tokenizer.cs: Fix bug where floating point values with an
16611         exponent where a sign was missing was ignored.
16612
16613         * driver.cs: Allow multiple assemblies to be specified in a single
16614         /r: argument
16615
16616 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
16617
16618         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
16619         because identifiers after a parenthesis would end up in this kind
16620         of production, and we needed to desamiguate it for having casts
16621         like:
16622
16623                 (UserDefinedType *) xxx
16624
16625 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
16626
16627         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
16628         we should set on the Bindingflags.NonPublic, but not turn on
16629         private_ok.  private_ok controls whether a Private member is
16630         returned (this is chekced on the filter routine), while the
16631         BindingFlags.NonPublic just controls whether private/protected
16632         will be allowed.   This fixes the problem part of the problem of
16633         private properties being allowed to be used in derived classes.
16634
16635         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
16636         so we can call the children DoResolveLValue method (this will
16637         properly signal errors on lvalue assignments to base properties)
16638
16639         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
16640         getter are null, and we have a property info, we know that this
16641         happened because the lookup failed, so we report an error 122 for
16642         protection level violation.
16643
16644         We also silently return if setter and getter are null in the
16645         resolve functions, this condition only happens if we have flagged
16646         the error before.  This is the other half of the problem. 
16647
16648         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
16649         not have accessibility information, that is why we were returning
16650         true in the filter function in typemanager.cs.
16651
16652         To properly report 122 (property is inaccessible because of its
16653         protection level) correctly, we report this error in ResolveAccess
16654         by failing if both the setter and the getter are lacking (ie, the
16655         lookup failed). 
16656
16657         DoResolve and DoLResolve have been modified to check for both
16658         setter/getter being null and returning silently, the reason being
16659         that I did not want to put the knowledge about this error in upper
16660         layers, like:
16661
16662         int old = Report.Errors;
16663         x = new PropertyExpr (...);
16664         if (old != Report.Errors)
16665                 return null;
16666         else
16667                 return x;
16668
16669         So the property expr is returned, but it is invalid, so the error
16670         will be flagged during the resolve process. 
16671
16672         * class.cs: Remove InheritablePropertySignatureCompare from the
16673         class, as we no longer depend on the property signature to compute
16674         whether it is possible to implement a method or not.
16675
16676         The reason is that calling PropertyInfo.GetGetMethod will return
16677         null (in .NET, in Mono it works, and we should change this), in
16678         cases where the Get Method does not exist in that particular
16679         class.
16680
16681         So this code:
16682
16683         class X { public virtual int A { get { return 1; } } }
16684         class Y : X { }
16685         class Z : Y { public override int A { get { return 2; } } }
16686
16687         Would fail in Z because the parent (Y) would not have the property
16688         defined.  So we avoid this completely now (because the alternative
16689         fix was ugly and slow), and we now depend exclusively on the
16690         method names.
16691
16692         (PropertyBase.CheckBase): Use a method-base mechanism to find our
16693         reference method, instead of using the property.
16694
16695         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
16696         routines are gone now.
16697
16698         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
16699         names, they were incorrectly named.
16700
16701         * cs-tokenizer.cs: Return are more gentle token on failure. 
16702
16703         * pending.cs (PendingImplementation.InterfaceMethod): This routine
16704         had an out-of-sync index variable, which caused it to remove from
16705         the list of pending methods the wrong method sometimes.
16706
16707 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
16708
16709         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
16710         CanWrite, because those refer to this particular instance of the
16711         property, and do not take into account the fact that we can
16712         override single members of a property.
16713
16714         Constructor requires an EmitContext.  The resolution process does
16715         not happen here, but we need to compute the accessors before,
16716         because the resolution does not always happen for properties.
16717
16718         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
16719         subclass, before we did not update this flag, but we did update
16720         bindingflags. 
16721
16722         (GetAccessors): Drop this routine, as it did not work in the
16723         presence of partially overwritten set/get methods. 
16724
16725         Notice that this broke the cs1540 detection, but that will require
16726         more thinking. 
16727
16728 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16729
16730         * class.cs:
16731         * codegen.cs:
16732         * driver.cs: issue a warning instead of an error if we don't support
16733         debugging for the platform. Also ignore a couple of errors that may
16734         arise when trying to write the symbols. Undo my previous patch.
16735
16736 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16737
16738         * driver.cs: ignore /debug switch except for Unix platforms.
16739
16740 2002-10-23  Nick Drochak  <ndrochak@gol.com>
16741
16742         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
16743
16744 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
16745
16746         * driver.cs: Do not make mcs-debug conditional, so we do not break
16747         builds that use it.
16748
16749         * statement.cs (UsageVector.MergeChildren): I would like Martin to
16750         review this patch.  But basically after all the children variables
16751         have been merged, the value of "Breaks" was not being set to
16752         new_breaks for Switch blocks.  I think that it should be set after
16753         it has executed.  Currently I set this to the value of new_breaks,
16754         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
16755         conservative, but I do not understand this code very well.
16756
16757         I did not break anything in the build, so that is good ;-)
16758
16759         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
16760
16761 2002-10-20  Mark Crichton  <crichton@gimp.org>
16762
16763         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
16764
16765 2002-10-20  Nick Drochak  <ndrochak@gol.com>
16766
16767         * cfold.cs: Fixed compile blocker.
16768
16769 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
16770
16771         * driver.cs: I was chekcing the key, not the file.
16772
16773 2002-10-19  Ravi Pratap  <ravi@ximian.com>
16774
16775         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
16776         message that we were generating - we just need to silently return
16777         a null.
16778
16779 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
16780
16781         * class.cs (Event.Define): Change my previous commit, as this
16782         breaks the debugger.  This is a temporary hack, as it seems like
16783         the compiler is generating events incorrectly to begin with.
16784
16785         * expression.cs (Binary.ResolveOperator): Added support for 
16786         "U operator - (E x, E y)"
16787
16788         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
16789         y)".
16790
16791         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
16792         init-only variables, but this path did not take into account that
16793         there might be also instance readonly variables.  Correct this
16794         problem. 
16795
16796         This fixes bug 32253
16797
16798         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
16799         delegates as well.
16800
16801         * driver.cs: Change the extension for modules to `netmodule'
16802
16803         * cs-parser.jay: Improved slightly the location tracking for
16804         the debugger symbols.
16805
16806         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
16807         modifiers that were specified instead of the hardcoded value
16808         (FamAndAssem).  This was basically ignoring the static modifier,
16809         and others.  Fixes 32429.
16810
16811         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
16812         fixed a bug in the process (32476)
16813
16814         * expression.cs (ArrayAccess.EmitAssign): Patch from
16815         hwang_rob@yahoo.ca that fixes bug 31834.3
16816
16817 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
16818
16819         * driver.cs: Make the module extension .netmodule.
16820
16821 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
16822
16823         * driver.cs: Report an error if the resource file is not found
16824         instead of crashing.
16825
16826         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
16827         false, like Emit does.
16828
16829 2002-10-16  Nick Drochak  <ndrochak@gol.com>
16830
16831         * typemanager.cs: Remove unused private member.  Also reported mcs
16832         bug to report this as a warning like csc.
16833
16834 2002-10-15  Martin Baulig  <martin@gnome.org>
16835
16836         * statement.cs (Statement.Emit): Made this a virtual method; emits
16837         the line number info and calls DoEmit().
16838         (Statement.DoEmit): New protected abstract method, formerly knows
16839         as Statement.Emit().
16840
16841         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
16842
16843 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
16844
16845         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
16846         have fixed a remaining problem: not every AddXXXX was adding a
16847         fully qualified name.  
16848
16849         Now everyone registers a fully qualified name in the DeclSpace as
16850         being defined instead of the partial name.  
16851
16852         Downsides: we are slower than we need to be due to the excess
16853         copies and the names being registered this way.  
16854
16855         The reason for this is that we currently depend (on the corlib
16856         bootstrap for instance) that types are fully qualified, because
16857         we dump all the types in the namespace, and we should really have
16858         types inserted into the proper namespace, so we can only store the
16859         basenames in the defined_names array.
16860
16861 2002-10-10  Martin Baulig  <martin@gnome.org>
16862
16863         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
16864         from bug #31834, see the bug report for a testcase which is
16865         miscompiled.
16866
16867 2002-10-10  Martin Baulig  <martin@gnome.org>
16868
16869         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
16870         flow analysis code for this.
16871
16872         * statement.cs (Do, While, For): Tell the flow analysis code about
16873         infinite loops.
16874         (FlowBranching.UsageVector): Added support for infinite loops.
16875         (Block.Resolve): Moved the dead code elimination here and use flow
16876         analysis to do it.
16877
16878 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
16879
16880         * class.cs (Field.Define): Catch cycles on struct type
16881         definitions. 
16882
16883         * typemanager.cs (IsUnmanagedtype): Do not recursively check
16884         fields if the fields are static.  We only need to check instance
16885         fields. 
16886
16887         * expression.cs (As.DoResolve): Test for reference type.
16888
16889         * statement.cs (Using.ResolveExpression): Use
16890         ConvertImplicitRequired, not ConvertImplicit which reports an
16891         error on failture
16892         (Using.ResolveLocalVariableDecls): ditto.
16893
16894         * expression.cs (Binary.ResolveOperator): Report errors in a few
16895         places where we had to.
16896
16897         * typemanager.cs (IsUnmanagedtype): Finish implementation.
16898
16899 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
16900
16901         * expression.cs: Use StoreFromPtr instead of extracting the type
16902         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
16903
16904         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
16905         an enumeration value to a System.Enum, but System.Enum is not a
16906         value type, but an class type, so we need to box.
16907
16908         (Expression.ConvertExplicit): One codepath could return
16909         errors but not flag them.  Fix this.  Fixes #31853
16910
16911         * parameter.cs (Resolve): Do not allow void as a parameter type.
16912
16913 2002-10-06  Martin Baulig  <martin@gnome.org>
16914
16915         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
16916         if it's a class type and not a struct.  Fixes #31815.
16917
16918 2002-10-06  Martin Baulig  <martin@gnome.org>
16919
16920         * statement.cs: Reworked the flow analysis code a bit to make it
16921         usable for dead code elimination.
16922
16923 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16924
16925         * cs-parser.jay: allow empty source files. Fixes bug #31781.
16926
16927 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
16928
16929         * expression.cs (ComposedCast.DoResolveType): A quick workaround
16930         to fix the test 165, will investigate deeper.
16931
16932 2002-10-04  Martin Baulig  <martin@gnome.org>
16933
16934         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
16935         finally blocks actually work.
16936         (Try.Resolve): We don't need to create a sibling for `finally' if
16937         there is no finally block.
16938
16939 2002-10-04  Martin Baulig  <martin@gnome.org>
16940
16941         * class.cs (Constructor.Define): The default accessibility for a
16942         non-default constructor is private, not public.
16943
16944 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
16945
16946         * class.cs (Constructor): Make AllowedModifiers public, add
16947         EXTERN.
16948
16949         * cs-parser.jay: Perform the modifiers test here, as the
16950         constructor for the Constructor class usually receives a zero
16951         because of the way we create it (first we create, later we
16952         customize, and we were never checking the modifiers).
16953
16954         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
16955         is a version of LookupTypeReflection that includes the type-name
16956         cache.  This can be used as a fast path for functions that know
16957         the fully qualified name and are only calling into *.GetType() to
16958         obtain a composed type.
16959
16960         This is also used by TypeManager.LookupType during its type
16961         composition.
16962
16963         (LookupType): We now also track the real type name, as sometimes
16964         we can get a quey for the real type name from things like
16965         ComposedCast.  This fixes bug 31422.
16966
16967         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
16968         complete type fullname, it does not have to go through the type
16969         resolution system to obtain the composed version of the type (for
16970         obtaining arrays or pointers).
16971
16972         (Conditional.Emit): Use the EmitBoolExpression to
16973         generate nicer code, as requested by Paolo.
16974
16975         (ArrayCreation.CheckIndices): Use the patch from
16976         hwang_rob@yahoo.ca to validate the array initializers. 
16977
16978 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
16979
16980         * class.cs (ConstructorInitializer.Emit): simplify code by using
16981         Invocation.EmitCall, and at the same time, fix the bugs in calling
16982         parent constructors that took variable arguments. 
16983
16984         * ecore.cs (Expression.ConvertNumericExplicit,
16985         Expression.ImplicitNumericConversion): Remove the code that
16986         manually wrapped decimal (InternalTypeConstructor call is now gone
16987         as well).
16988
16989         * expression.cs (Cast.TryReduce): Also handle decimal types when
16990         trying to perform a constant fold on the type.
16991
16992         * typemanager.cs (IsUnmanagedtype): Partially implemented.
16993
16994         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
16995         that only turned off an error report, and did nothing else. 
16996
16997 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
16998
16999         * driver.cs: Handle and ignore /fullpaths
17000
17001 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
17002
17003         * expression.cs (Binary.ResolveOperator): Catch the case where
17004         DoNumericPromotions returns true, 
17005
17006         (Binary.DoNumericPromotions): Simplify the code, and the tests.
17007
17008 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
17009
17010         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
17011         report error 70.
17012
17013 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
17014
17015         * ecore.cs (ConvertNumericExplicit): It is not enough that the
17016         conversion exists, but it is also required that the conversion be
17017         performed.  This manifested in "(Type64Enum) 2".  
17018
17019         * class.cs (TypeManager.AddMethod): The fix is not to change
17020         AddEnum, because that one was using a fully qualified name (every
17021         DeclSpace derivative does), but to change the AddMethod routine
17022         that was using an un-namespaced name.  This now correctly reports
17023         the duplicated name.
17024
17025         Revert patch until I can properly fix it.  The issue
17026         is that we have a shared Type space across all namespaces
17027         currently, which is wrong.
17028
17029         Options include making the Namespace a DeclSpace, and merge
17030         current_namespace/current_container in the parser.
17031
17032 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
17033
17034         * cs-parser.jay: Improve error reporting when we get a different
17035         kind of expression in local_variable_type and
17036         local_variable_pointer_type. 
17037
17038         Propagate this to avoid missleading errors being reported.
17039
17040         * ecore.cs (ImplicitReferenceConversion): treat
17041         TypeManager.value_type as a target just like object_type.   As
17042         code like this:
17043
17044         ValueType v = 1;
17045
17046         Is valid, and needs to result in the int 1 being boxed before it
17047         is assigned to the value type v.
17048
17049         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
17050         to validate the enumeration name.
17051
17052         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
17053         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
17054         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
17055
17056         * ecore.cs (TryImplicitIntConversion): When doing an
17057         implicit-enumeration-conversion, check if the type is 64-bits and
17058         perform a conversion before passing to EnumConstant.
17059
17060 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
17061
17062         * decl.cs (Error_AmbiguousTypeReference); New routine used to
17063         report ambiguous type references.  Unlike the MS version, we
17064         report what the ambiguity is.   Innovation at work ;-)
17065
17066         (DeclSpace.FindType): Require a location argument to
17067         display when we display an ambiguous error.
17068
17069         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
17070
17071         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
17072
17073         * expression.cs (EmitDynamicInitializers): Apply patch from
17074         hwang_rob@yahoo.ca that fixes the order in which we emit our
17075         initializers. 
17076
17077 2002-09-21  Martin Baulig  <martin@gnome.org>
17078
17079         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
17080         delegate takes no arguments.
17081
17082 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
17083
17084         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
17085         from integers.
17086
17087         * expression.cs: Extract the underlying type.
17088
17089         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
17090
17091         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
17092
17093 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
17094
17095         * class.cs (TypeContainer.DefineType): We can not use the nice
17096         PackingSize with the size set to 1 DefineType method, because it
17097         will not allow us to define the interfaces that the struct
17098         implements.
17099
17100         This completes the fixing of bug 27287
17101
17102         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
17103         means also structs.  This fixes part of the problem. 
17104         (Expresion.ImplicitReferenceConversionExists): ditto.
17105
17106         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
17107         error if there were no errors reported during the type lookup
17108         process, to avoid duplicates or redundant errors.  Without this
17109         you would get an ambiguous errors plus a type not found.  We have
17110         beaten the user enough with the first error.  
17111
17112         (DeclSparce.FindType): Emit a warning if we have an ambiguous
17113         reference. 
17114
17115         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
17116         during the resolution process, stop the lookup, this avoids
17117         repeated error reports (same error twice).
17118
17119         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
17120
17121         * typemanager.cs (LookupType): Redo the type lookup code to match
17122         the needs of System.Reflection.  
17123
17124         The issue is that System.Reflection requires references to nested
17125         types to begin with a "+" sign instead of a dot.  So toplevel
17126         types look like: "NameSpace.TopLevelClass", and nested ones look
17127         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
17128         levels. 
17129
17130 2002-09-19  Martin Baulig  <martin@gnome.org>
17131
17132         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
17133         says that a method always returns or always throws an exception,
17134         don't report the CS0161.
17135
17136         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
17137         set `Returns = new_returns'.
17138
17139 2002-09-19  Martin Baulig  <martin@gnome.org>
17140
17141         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
17142         to an enum constant, check for a CS0176.
17143
17144 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
17145
17146         * class.cs (TypeContainer.CheckPairedOperators): Now we check
17147         for operators that must be in pairs and report errors.
17148
17149         * ecore.cs (SimpleName.DoResolveType): During the initial type
17150         resolution process, when we define types recursively, we must
17151         check first for types in our current scope before we perform
17152         lookups in the enclosing scopes.
17153
17154         * expression.cs (MakeByteBlob): Handle Decimal blobs.
17155
17156         (Invocation.VerifyArgumentsCompat): Call
17157         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
17158         I thought we were supposed to always call this, but there are a
17159         few places in the code where we dont do it.
17160
17161 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
17162
17163         * driver.cs: Add support in -linkres and -resource to specify the
17164         name of the identifier.
17165
17166 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
17167
17168         * ecore.cs (StandardConversionExists): Sync with the conversion
17169         code: allow anything-* to void* conversions.
17170
17171         (FindMostSpecificSource): Use an Expression argument
17172         instead of a Type, because we might be handed over a Literal which
17173         gets a few more implicit conversions that plain types do not.  So
17174         this information was being lost.
17175
17176         Also, we drop the temporary type-holder expression when not
17177         required.
17178
17179 2002-09-17  Martin Baulig  <martin@gnome.org>
17180
17181         * class.cs (PropertyBase.CheckBase): Don't check the base class if
17182         this is an explicit interface implementation.
17183
17184 2002-09-17  Martin Baulig  <martin@gnome.org>
17185
17186         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
17187         different `IndexerName' attributes.
17188
17189         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
17190         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
17191         virtual CommonResolve().
17192
17193 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
17194
17195         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
17196         and convert that to the UnderlyingType.
17197
17198         * statement.cs (Foreach.Resolve): Indexers are just like variables
17199         or PropertyAccesses.
17200
17201         * cs-tokenizer.cs (consume_string): Track line numbers and columns
17202         inside quoted strings, we were not doing this before.
17203
17204 2002-09-16  Martin Baulig  <martin@gnome.org>
17205
17206         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
17207         resolve it.  This is needed for the definite assignment check of the
17208         instance expression, fixes bug #29846.
17209         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
17210
17211 2002-09-16  Nick Drochak  <ndrochak@gol.com>
17212
17213         * parameter.cs: Fix compile error.  Cannot reference static member
17214         from an instance object.  Is this an mcs bug?
17215
17216 2002-09-14  Martin Baulig  <martin@gnome.org>
17217
17218         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
17219         multiple times.  Fixes bug #30295, added test-166.cs.
17220
17221 2002-09-14  Martin Baulig  <martin@gnome.org>
17222
17223         * statement.cs (Block.Emit): Don't emit unreachable code.
17224         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
17225         `break' statements.
17226         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
17227
17228 2002-09-14  Martin Baulig  <martin@gnome.org>
17229
17230         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
17231         is set.
17232
17233 2002-09-14  Martin Baulig  <martin@gnome.org>
17234
17235         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
17236         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
17237         be false on the ms runtime.
17238
17239 2002-09-13  Martin Baulig  <martin@gnome.org>
17240
17241         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
17242         the CS0038 error message.
17243
17244 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
17245
17246         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
17247         constant inside, return it.
17248
17249 2002-09-12  Martin Baulig  <martin@gnome.org>
17250
17251         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
17252         implicit conversion can be done between enum types.
17253
17254         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
17255         check whether an implicit conversion to the current enum's UnderlyingType
17256         exists and report an error if not.
17257
17258         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
17259         without debugging support.
17260
17261         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
17262         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
17263
17264 2002-09-12  Martin Baulig  <martin@gnome.org>
17265
17266         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
17267
17268         * ecore.cs (IMemberExpr.DeclaringType): New property.
17269         (SimpleName.SimpleNameResolve): Check whether we're accessing a
17270         nonstatic member of an outer type (CS0038).
17271
17272 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
17273
17274         * driver.cs: Activate the using-error detector at warning level
17275         4 (at least for MS-compatible APIs).
17276
17277         * namespace.cs (VerifyUsing): Small buglett fix.
17278
17279         * pending.cs (PendingImplementation): pass the container pointer. 
17280
17281         * interface.cs (GetMethods): Allow for recursive definition.  Long
17282         term, I would like to move every type to support recursive
17283         definitions, not the current ordering mechanism that we have right
17284         now.
17285
17286         The situation is this: Attributes are handled before interfaces,
17287         so we can apply attributes to interfaces.  But some attributes
17288         implement interfaces, we will now handle the simple cases
17289         (recursive definitions will just get an error).  
17290
17291         * parameter.cs: Only invalidate types at the end if we fail to
17292         lookup all types.  
17293
17294 2002-09-09  Martin Baulig  <martin@gnome.org>
17295
17296         * ecore.cs (PropertyExpr.Emit): Also check for
17297         TypeManager.system_int_array_get_length so this'll also work when
17298         compiling corlib.  Fixes #30003.
17299
17300 2002-09-09  Martin Baulig  <martin@gnome.org>
17301
17302         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
17303         and throw an exception if we can't get the type's size.  Fixed #30040,
17304         added test-165.cs.
17305
17306 2002-09-09  Martin Baulig  <martin@gnome.org>
17307
17308         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
17309
17310         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
17311         context.  Fixes bug #30027.
17312
17313         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
17314         virtual functions.  Fixes bug #30043, added test-164.cs.
17315
17316 2002-09-08  Ravi Pratap  <ravi@ximian.com>
17317
17318         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
17319
17320 2002-09-08  Nick Drochak  <ndrochak@gol.com>
17321
17322         * driver.cs: Use an object to get the windows codepage since it's not a
17323         static property.
17324
17325 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
17326
17327         * statement.cs (For.Emit): for infinite loops (test == null)
17328         return whether there is a break inside, not always "true".
17329
17330         * namespace.cs (UsingEntry): New struct to hold the name of the
17331         using definition, the location where it is defined, and whether it
17332         has been used in a successful type lookup.
17333
17334         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
17335         strings.
17336
17337         * decl.cs: ditto.
17338
17339 2002-09-06  Ravi Pratap  <ravi@ximian.com>
17340
17341         * attribute.cs : Fix incorrect code which relied on catching
17342         a NullReferenceException to detect a null being passed in
17343         where an object was expected.
17344
17345 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
17346
17347         * statement.cs (Try): flag the catch variable as assigned
17348
17349         * expression.cs (Cast): Simplified by using ResolveType instead of
17350         manually resolving.
17351
17352         * statement.cs (Catch): Fix bug by using ResolveType.
17353
17354 2002-09-06  Ravi Pratap  <ravi@ximian.com>
17355
17356         * expression.cs (BetterConversion): Special case for when we have
17357         a NullLiteral as the argument and we have to choose between string
17358         and object types - we choose string the way csc does.
17359
17360         * attribute.cs (Attribute.Resolve): Catch the
17361         NullReferenceException and report error #182 since the Mono
17362         runtime no more has the bug and having this exception raised means
17363         we tried to select a constructor which takes an object and is
17364         passed a null.
17365
17366 2002-09-05  Ravi Pratap  <ravi@ximian.com>
17367
17368         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
17369         message (1502, 1503) when we can't locate a method after overload
17370         resolution. This is much more informative and closes the bug
17371         Miguel reported.
17372
17373         * interface.cs (PopulateMethod): Return if there are no argument
17374         types. Fixes a NullReferenceException bug.
17375
17376         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
17377         expressions too. Previously we were checking only in one place for
17378         positional arguments leaving out named arguments.
17379
17380         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
17381         type to the enum type is not allowed. Remove code corresponding to
17382         that.
17383
17384         (ConvertNumericExplicit): Allow explicit conversions from
17385         the underlying type to enum type. This precisely follows the spec
17386         and closes a bug filed by Gonzalo.
17387
17388 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17389
17390         * compiler.csproj:
17391         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
17392
17393 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
17394
17395         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
17396         it was important that we stored the right value after the
17397         reduction in `converted'.
17398
17399 2002-09-04  Martin Baulig  <martin@gnome.org>
17400
17401         * location.cs (Location.SymbolDocument): Use full pathnames for the
17402         source files.
17403
17404 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
17405
17406         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
17407         of the expression resolve mechanism, because that will catch the
17408         SimpleName error failures.
17409
17410         (Conditional): If we can not resolve the
17411         expression, return, do not crash.
17412
17413 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17414
17415         * cs-tokenizer.cs:
17416         (location): display token name instead of its number.
17417
17418 2002-08-28  Martin Baulig  <martin@gnome.org>
17419
17420         * expression.cs (Binary.ResolveOperator): Don't silently return
17421         but return an error if an operator cannot be applied between two
17422         enum types.
17423
17424 2002-08-28  Martin Baulig  <martin@gnome.org>
17425
17426         * class.cs (Constructor.Define): Set the permission attributes
17427         correctly instead of making all constructors public.
17428
17429 2002-08-28  Martin Baulig  <martin@gnome.org>
17430
17431         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
17432         for private members before reporting a CS0103; if we find anything,
17433         it's a CS0122.
17434
17435 2002-08-28  Martin Baulig  <martin@gnome.org>
17436
17437         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
17438         to check whether `closure_start_type == closure_invocation_type',
17439         we also need to check whether `m.DeclaringType == closure_invocation_type'
17440         before bypassing the permission checks.  We might be accessing
17441         protected/private members from the base class.
17442         (TypeManager.RealMemberLookup): Only set private_ok if private
17443         members were requested via BindingFlags.NonPublic.
17444
17445         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
17446
17447         * expression.cs (MemberAccess.ResolveMemberAccess): Set
17448         MethodGroupExpr.IsExplicitImpl if appropriate.
17449         (Invocation.DoResolve): Don't report the CS0120 for explicit
17450         interface implementations.
17451
17452 2002-08-27  Martin Baulig  <martin@gnome.org>
17453
17454         * expression.cs (Invocation.DoResolve): If this is a static
17455         method and we don't have an InstanceExpression, we must report
17456         a CS0120.
17457
17458 2002-08-25  Martin Baulig  <martin@gnome.org>
17459
17460         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
17461         `==' between a valuetype and an object.
17462
17463 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
17464
17465         * ecore.cs (TypeExpr): Provide a ToString method.
17466
17467 2002-08-24  Martin Baulig  <martin@gnome.org>
17468
17469         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
17470         now called proggie.dbg and it's a binary file.
17471
17472 2002-08-23  Martin Baulig  <martin@gnome.org>
17473
17474         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
17475
17476 2002-08-23  Martin Baulig  <martin@gnome.org>
17477
17478         * struct.cs (MyStructInfo.ctor): Make this work with empty
17479         structs; it's not allowed to use foreach() on null.
17480
17481 2002-08-23  Martin Baulig  <martin@gnome.org>
17482
17483         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
17484         writer the full pathname of the generated assembly.
17485
17486 2002-08-23  Martin Baulig  <martin@gnome.org>
17487
17488         * statements.cs (FlowBranching.UsageVector.MergeChildren):
17489         A `finally' block never returns or breaks; improved handling of
17490         unreachable code.
17491
17492 2002-08-23  Martin Baulig  <martin@gnome.org>
17493
17494         * statement.cs (Throw.Resolve): Allow `throw null'.
17495
17496 2002-08-23  Martin Baulig  <martin@gnome.org>
17497
17498         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
17499         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
17500         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
17501         MemberLookup would return a wrong event if this is an explicit
17502         interface implementation and the class has an event with the same
17503         name.
17504
17505 2002-08-23  Martin Baulig  <martin@gnome.org>
17506
17507         * statement.cs (Block.AddChildVariableNames): New public method.
17508         (Block.AddChildVariableName): Likewise.
17509         (Block.IsVariableNameUsedInChildBlock): Likewise.
17510         (Block.AddVariable): Check whether a variable name has already
17511         been used in a child block.
17512
17513         * cs-parser.jay (declare_local_variables): Mark all variable names
17514         from the current block as being used in a child block in the
17515         implicit block.
17516
17517 2002-08-23  Martin Baulig  <martin@gnome.org>
17518
17519         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
17520         find the symbol writer.
17521
17522         * driver.cs: csc also allows the arguments to /define being
17523         separated by commas, not only by semicolons.
17524
17525 2002-08-23  Martin Baulig  <martin@gnome.org>
17526
17527         * interface.cs (Interface.GetMembers): Added static check for events.
17528
17529 2002-08-15  Martin Baulig  <martin@gnome.org>
17530
17531         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
17532         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
17533
17534         * ecore.cs (Expression.MemberLookup): Added documentation and explained
17535         why the MethodData.EmitDestructor() change was necessary.
17536
17537 2002-08-20  Martin Baulig  <martin@gnome.org>
17538
17539         * class.cs (TypeContainer.FindMembers): Added static check for events.
17540
17541         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
17542
17543         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
17544         use Type.GetEvents(), not Type.FindMembers().
17545
17546 2002-08-20  Martin Baulig  <martin@gnome.org>
17547
17548         * decl.cs (MemberCache): Added a special method cache which will
17549         be used for method-only searched.  This ensures that a method
17550         search will return a MethodInfo with the correct ReflectedType for
17551         inherited methods.      
17552
17553 2002-08-20  Martin Baulig  <martin@gnome.org>
17554
17555         * decl.cs (DeclSpace.FindMembers): Made this public.
17556
17557 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17558
17559         * delegate.cs: fixed build on windows.
17560         [FIXME:  Filed as bug #29150: MCS must report these errors.]
17561
17562 2002-08-19  Ravi Pratap  <ravi@ximian.com>
17563
17564         * ecore.cs (StandardConversionExists): Return a false
17565         if we are trying to convert the void type to anything else
17566         since that is not allowed.
17567
17568         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
17569         we flag error 70 in the event an event is trying to be accessed
17570         directly from outside the declaring type.
17571
17572 2002-08-20  Martin Baulig  <martin@gnome.org>
17573
17574         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
17575         MemberCache from typemanager.cs to decl.cs.
17576
17577 2002-08-19  Martin Baulig  <martin@gnome.org>
17578
17579         * class.cs (TypeContainer): Implement IMemberContainer.
17580         (TypeContainer.DefineMembers): Create the MemberCache.
17581         (TypeContainer.FindMembers): Do better BindingFlags checking; only
17582         return public members if BindingFlags.Public was given, check
17583         whether members are static.
17584
17585 2002-08-16  Martin Baulig  <martin@gnome.org>
17586
17587         * decl.cs (DeclSpace.Define): Splitted this in Define and
17588         DefineMembers.  DefineMembers is called first and initializes the
17589         MemberCache.
17590
17591         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
17592         DefineMembers() on all our DeclSpaces.
17593
17594         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
17595         but call DefineMembers() on all nested interfaces.  We call their
17596         Define() in our new Define() function.
17597
17598         * interface.cs (Interface): Implement IMemberContainer.
17599         (Interface.Define): Moved all code except the attribute stuf to
17600         DefineMembers().
17601         (Interface.DefineMembers): Initialize the member cache.
17602
17603         * typemanager.cs (IMemberFinder): Removed this interface, we don't
17604         need this anymore since we can use MemberCache.FindMembers directly.
17605
17606 2002-08-19  Martin Baulig  <martin@gnome.org>
17607
17608         * typemanager.cs (MemberCache): When creating the cache for an
17609         interface type, add all inherited members.
17610         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
17611         to `out bool used_cache' and documented it.
17612         (TypeManager.MemberLookup): If we already used the cache in the first
17613         iteration, we don't need to do the interfaces check.
17614
17615 2002-08-19  Martin Baulig  <martin@gnome.org>
17616
17617         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
17618         here from IMemberFinder and don't implement this interface anymore.
17619         (DeclSpace.MemberCache): Moved here from IMemberFinder.
17620
17621         * typemanager.cs (IMemberFinder): This interface is now only used by
17622         classes which actually support the member cache.
17623         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
17624         since we only put DeclSpaces into this Hashtable.
17625         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
17626         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
17627
17628 2002-08-16  Martin Baulig  <martin@gnome.org>
17629
17630         * typemanager.cs (ICachingMemberFinder): Removed.
17631         (IMemberFinder.MemberCache): New property.
17632         (TypeManager.FindMembers): Merged this with RealFindMembers().
17633         This function will never be called from TypeManager.MemberLookup()
17634         so we can't use the cache here, just the IMemberFinder.
17635         (TypeManager.MemberLookup_FindMembers): Check whether the
17636         IMemberFinder has a MemberCache and call the cache's FindMembers
17637         function.
17638         (MemberCache): Rewrote larger parts of this yet another time and
17639         cleaned it up a bit.
17640
17641 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
17642
17643         * driver.cs (LoadArgs): Support quoting.
17644
17645         (Usage): Show the CSC-like command line arguments.
17646
17647         Improved a few error messages.
17648
17649 2002-08-15  Martin Baulig  <martin@gnome.org>
17650
17651         * typemanager.cs (IMemberContainer.Type): New property.
17652         (IMemberContainer.IsInterface): New property.
17653
17654         The following changes are conditional to BROKEN_RUNTIME, which is
17655         defined at the top of the file.
17656
17657         * typemanager.cs (MemberCache.MemberCache): Don't add the base
17658         class'es members, but add all members from TypeHandle.ObjectType
17659         if we're an interface.
17660         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
17661         is the current type.
17662         (MemberCache.CacheEntry.Container): Removed this field.
17663         (TypeHandle.GetMembers): Include inherited members.
17664
17665 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17666
17667         * typemanager.cs: fixed compilation and added a comment on a field that
17668         is never used.
17669
17670 2002-08-15  Martin Baulig  <martin@gnome.org>
17671
17672         * class.cs (ConstructorInitializer.Resolve): In the
17673         Expression.MemberLookup call, use the queried_type as
17674         invocation_type.
17675
17676         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
17677         declared' attribute, it's always true.
17678         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
17679         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
17680         temporary wrapper for FindMembers which tells MemberLookup whether
17681         members from the base classes are included in the return value.
17682         This will go away soon.
17683         (TypeManager.MemberLookup): Use this temporary hack here; once the
17684         new MemberCache is completed, we don't need to do the DeclaredOnly
17685         looping here anymore since the MemberCache will take care of this.
17686         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
17687         (MemberCache): When creating the MemberCache for a class, get
17688         members from the current class and all its base classes.
17689         (MemberCache.CacheEntry.Container): New field.  This is a
17690         temporary hack until the Mono runtime is fixed to distinguish
17691         between ReflectedType and DeclaringType.  It allows us to use MCS
17692         with both the MS runtime and the unfixed Mono runtime without
17693         problems and without accecting performance.
17694         (MemberCache.SearchMembers): The DeclaredOnly looping from
17695         TypeManager.MemberLookup is now done here.      
17696
17697 2002-08-14  Martin Baulig  <martin@gnome.org>
17698
17699         * statement.cs (MyStructInfo.MyStructInfo): Don't call
17700         Type.GetFields on dynamic types but get the fields from the
17701         corresponding TypeContainer.
17702         (MyStructInfo.GetStructInfo): Added check for enum types.
17703
17704         * typemanager.cs (MemberList.IsSynchronized): Implemented.
17705         (MemberList.SyncRoot): Implemented.
17706         (TypeManager.FilterWithClosure): No need to check permissions if
17707         closure_start_type == closure_invocation_type, don't crash if
17708         closure_invocation_type is null.
17709
17710 2002-08-13  Martin Baulig  <martin@gnome.org>
17711
17712         Rewrote TypeContainer.FindMembers to use a member cache.  This
17713         gives us a speed increase of about 35% for the self-hosting MCS
17714         build and of about 15-20% for the class libs (both on GNU/Linux).
17715
17716         * report.cs (Timer): New class to get enhanced profiling.  This
17717         whole class is "TIMER" conditional since it remarkably slows down
17718         compilation speed.
17719
17720         * class.cs (MemberList): New class.  This is an IList wrapper
17721         which we're now using instead of passing MemberInfo[]'s around to
17722         avoid copying this array unnecessarily.
17723         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
17724         (ICachingMemberFinder, IMemberContainer): New interface.
17725         (TypeManager.FilterWithClosure): If `criteria' is null, the name
17726         has already been checked, otherwise use it for the name comparision.
17727         (TypeManager.FindMembers): Renamed to RealMemberFinder and
17728         provided wrapper which tries to use ICachingMemberFinder.FindMembers
17729         if possible.  Returns a MemberList, not a MemberInfo [].
17730         (TypeHandle): New class, implements IMemberContainer.  We create
17731         one instance of this class per type, it contains a MemberCache
17732         which is used to do the member lookups.
17733         (MemberCache): New class.  Each instance of this class contains
17734         all members of a type and a name-based hash table.
17735         (MemberCache.FindMembers): This is our new member lookup
17736         function.  First, it looks up all members of the requested name in
17737         the hash table.  Then, it walks this list and sorts out all
17738         applicable members and returns them.
17739
17740 2002-08-13  Martin Baulig  <martin@gnome.org>
17741
17742         In addition to a nice code cleanup, this gives us a performance
17743         increase of about 1.4% on GNU/Linux - not much, but it's already
17744         half a second for the self-hosting MCS compilation.
17745
17746         * typemanager.cs (IMemberFinder): New interface.  It is used by
17747         TypeManager.FindMembers to call FindMembers on a TypeContainer,
17748         Enum, Delegate or Interface.
17749         (TypeManager.finder_to_member_finder): New PtrHashtable.
17750         (TypeManager.finder_to_container): Removed.
17751         (TypeManager.finder_to_delegate): Removed.
17752         (TypeManager.finder_to_interface): Removed.
17753         (TypeManager.finder_to_enum): Removed.
17754
17755         * interface.cs (Interface): Implement IMemberFinder.
17756
17757         * delegate.cs (Delegate): Implement IMemberFinder.
17758
17759         * enum.cs (Enum): Implement IMemberFinder.
17760
17761         * class.cs (TypeContainer): Implement IMemberFinder.
17762
17763 2002-08-12  Martin Baulig  <martin@gnome.org>
17764
17765         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
17766
17767 2002-08-12  Martin Baulig  <martin@gnome.org>
17768
17769         * ecore.cs (ITypeExpression): New interface for expressions which
17770         resolve to a type.
17771         (TypeExpression): Renamed to TypeLookupExpression.
17772         (Expression.DoResolve): If we're doing a types-only lookup, the
17773         expression must implement the ITypeExpression interface and we
17774         call DoResolveType() on it.
17775         (SimpleName): Implement the new ITypeExpression interface.
17776         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
17777         hack, the situation that we're only looking up types can't happen
17778         anymore when this method is called.  Moved the type lookup code to
17779         DoResolveType() and call it.
17780         (SimpleName.DoResolveType): This ITypeExpression interface method
17781         is now doing the types-only lookup.
17782         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
17783         (ResolveFlags): Added MaskExprClass.
17784
17785         * expression.cs (MemberAccess): Implement the ITypeExpression
17786         interface.
17787         (MemberAccess.DoResolve): Added support for a types-only lookup
17788         when we're called via ITypeExpression.DoResolveType().
17789         (ComposedCast): Implement the ITypeExpression interface.
17790
17791         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
17792         Expression.Resolve() with ResolveFlags.Type instead.
17793
17794 2002-08-12  Martin Baulig  <martin@gnome.org>
17795
17796         * interface.cs (Interface.Define): Apply attributes.
17797
17798         * attribute.cs (Attribute.ApplyAttributes): Added support for
17799         interface attributes.
17800
17801 2002-08-11  Martin Baulig  <martin@gnome.org>
17802
17803         * statement.cs (Block.Emit): Only check the "this" variable if we
17804         do not always throw an exception.
17805
17806         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
17807         whether the property has a set accessor.
17808
17809 2002-08-11  Martin Baulig  <martin@gnome.org>
17810
17811         Added control flow analysis support for structs.
17812
17813         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
17814         with control flow analysis turned off.
17815         (IVariable): New interface.
17816         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
17817         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
17818         (FieldExpr.DoResolve): Resolve the instance expression with flow
17819         analysis turned off and do the definite assignment check after the
17820         resolving when we know what the expression will resolve to.
17821
17822         * expression.cs (LocalVariableReference, ParameterReference):
17823         Implement the new IVariable interface, only call the flow analysis
17824         code if ec.DoFlowAnalysis is true.
17825         (This): Added constructor which takes a Block argument.  Implement
17826         the new IVariable interface.
17827         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
17828         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
17829         This does the definite assignment checks for struct members.
17830
17831         * class.cs (Constructor.Emit): If this is a non-static `struct'
17832         constructor which doesn't have any initializer, call
17833         Block.AddThisVariable() to tell the flow analysis code that all
17834         struct elements must be initialized before control returns from
17835         the constructor.
17836
17837         * statement.cs (MyStructInfo): New public class.
17838         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
17839         argument to this indexer.  If non-zero, check an individual struct
17840         member, not the whole struct.
17841         (FlowBranching.CheckOutParameters): Check struct members.
17842         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
17843         overloaded versions of these methods which take an additional
17844         `int field_idx' argument to check struct members.
17845         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
17846         overloaded versions of these methods which take an additional
17847         `string field_name' argument to check struct member.s
17848         (VariableInfo): Implement the IVariable interface.
17849         (VariableInfo.StructInfo): New public property.  Returns the
17850         MyStructInfo instance of the variable if it's a struct or null.
17851         (Block.AddThisVariable): New public method.  This is called from
17852         Constructor.Emit() for non-static `struct' constructor which do
17853         not have any initializer.  It creates a special variable for the
17854         "this" instance variable which will be checked by the flow
17855         analysis code to ensure that all of the struct's fields are
17856         initialized before control returns from the constructor.
17857         (UsageVector): Added support for struct members.  If a
17858         variable/parameter is a struct with N members, we reserve a slot
17859         in the usage vector for each member.  A struct is considered fully
17860         initialized if either the struct itself (slot 0) or all its
17861         members are initialized.
17862
17863 2002-08-08  Martin Baulig  <martin@gnome.org>
17864
17865         * driver.cs (Driver.MainDriver): Only report an error CS5001
17866         if there were no compilation errors.
17867
17868         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
17869         `UnsafeContext' property to determine whether the parent is in
17870         unsafe context rather than checking the parent's ModFlags:
17871         classes nested in an unsafe class are unsafe as well.
17872
17873 2002-08-08  Martin Baulig  <martin@gnome.org>
17874
17875         * statement.cs (UsageVector.MergeChildren): Distinguish between
17876         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
17877         we return.  Added test17() and test18() to test-154.cs.
17878
17879 2002-08-08  Martin Baulig  <martin@gnome.org>
17880
17881         * typemanager.cs (TypeManager.FilterWithClosure): If we have
17882         Family access, make sure the invoking type isn't a subclass of the
17883         queried type (that'd be a CS1540).
17884
17885         * ecore.cs (Expression.MemberLookup): Added overloaded version of
17886         this method which takes an additional `Type invocation_type'.
17887
17888         * expression.cs (BaseAccess.DoResolve): Use the base type as
17889         invocation and query type.
17890         (MemberAccess.DoResolve): If the lookup failed and we're about to
17891         report a CS0122, try a lookup with the ec.ContainerType - if this
17892         succeeds, we must report a CS1540.
17893
17894 2002-08-08  Martin Baulig  <martin@gnome.org>
17895
17896         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
17897         (MethodGroupExpr): Implement the IMemberExpr interface.
17898
17899         * expression (MemberAccess.ResolveMemberAccess): No need to have
17900         any special code for MethodGroupExprs anymore, they're now
17901         IMemberExprs.   
17902
17903 2002-08-08  Martin Baulig  <martin@gnome.org>
17904
17905         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
17906         Family, FamANDAssem and FamORAssem permissions.
17907         (TypeManager.IsSubclassOrNestedChildOf): New public method.
17908
17909 2002-08-08  Martin Baulig  <martin@gnome.org>
17910
17911         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
17912         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
17913         or loop block.
17914
17915 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
17916
17917         * driver.cs: implemented /resource option to embed managed resources.
17918
17919 2002-08-07  Martin Baulig  <martin@gnome.org>
17920
17921         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
17922         (FieldBase.HasFieldInitializer): New public property.
17923         (FieldBase.GetInitializerExpression): New public method.  Resolves and
17924         returns the field initializer and makes sure it is only resolved once.
17925         (TypeContainer.EmitFieldInitializers): Call
17926         FieldBase.GetInitializerExpression to get the initializer, this ensures
17927         that it isn't resolved multiple times.
17928
17929         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
17930         the resolving process (SimpleName/MemberLookup) that we're currently
17931         emitting a field initializer (which must not access any instance members,
17932         this is an error CS0236).
17933
17934         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
17935         argument, if the `IsFieldInitializer' flag is set, we must report and
17936         error CS0236 and not an error CS0120.   
17937
17938 2002-08-07  Martin Baulig  <martin@gnome.org>
17939
17940         * ecore.cs (IMemberExpr): New public interface.
17941         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
17942         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
17943         if the expression is an IMemberExpr.
17944
17945         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
17946         to be null, implicitly default to `this' if we're non-static in
17947         this case.  Simplified the code a lot by using the new IMemberExpr
17948         interface.  Also fixed bug #28176 here.
17949
17950 2002-08-06  Martin Baulig  <martin@gnome.org>
17951
17952         * cs-parser.jay (SimpleLookup): Removed.  We need to create
17953         ParameterReferences during semantic analysis so that we can do a
17954         type-only search when resolving Cast, TypeOf and SizeOf.
17955         (block): Pass the `current_local_parameters' to the Block's
17956         constructor.
17957
17958         * class.cs (ConstructorInitializer): Added `Parameters parameters'
17959         argument to the constructor.
17960         (ConstructorInitializer.Resolve): Create a temporary implicit
17961         block with the parameters.
17962
17963         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
17964         references here if we aren't doing a type-only search.
17965
17966         * statement.cs (Block): Added constructor which takes a
17967         `Parameters parameters' argument.
17968         (Block.Parameters): New public property.
17969
17970         * support.cs (InternalParameters.Parameters): Renamed `parameters'
17971         to `Parameters' and made it public readonly.
17972
17973 2002-08-06  Martin Baulig  <martin@gnome.org>
17974
17975         * ecore.cs (Expression.Warning): Made this public as well.
17976
17977         * report.cs (Report.Debug): Print the contents of collections.
17978
17979 2002-08-06  Martin Baulig  <martin@gnome.org>
17980
17981         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
17982         used to tell Resolve() which kinds of expressions it may return.
17983         (Expression.Resolve): Added overloaded version of this method which
17984         takes a `ResolveFlags flags' argument.  This can be used to tell
17985         Resolve() which kinds of expressions it may return.  Reports a
17986         CS0118 on error.
17987         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
17988         ResolveFlags.SimpleName.
17989         (Expression.Error118): Added overloaded version of this method which
17990         takes a `ResolveFlags flags' argument.  It uses the flags to determine
17991         which kinds of expressions are allowed.
17992
17993         * expression.cs (Argument.ResolveMethodGroup): New public method.
17994         Resolves an argument, but allows a MethodGroup to be returned.
17995         This is used when invoking a delegate.
17996
17997         * TODO: Updated a bit.
17998
17999 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18000
18001         Fixed compilation with csc.
18002
18003         * ecore.cs: Expression.Error made public. Is this correct? Should
18004         Warning be made public too?
18005
18006         * expression.cs: use ea.Location instead of ea.loc.
18007         [FIXME:  Filed as bug #28607: MCS must report these errors.]
18008
18009 2002-08-06  Martin Baulig  <martin@gnome.org>
18010
18011         * ecore.cs (Expression.loc): Moved the location here instead of
18012         duplicating it in all derived classes.
18013         (Expression.Location): New public property.
18014         (Expression.Error, Expression.Warning): Made them non-static and
18015         removed the location argument.
18016         (Expression.Warning): Added overloaded version which takes an
18017         `int level' argument.
18018         (Expression.Error118): Make this non-static and removed the
18019         expression and location arguments.
18020         (TypeExpr): Added location argument to the constructor.
18021
18022         * expression.cs (StaticCallExpr): Added location argument to
18023         the constructor.
18024         (Indirection, PointerArithmetic): Likewise.
18025         (CheckedExpr, UnCheckedExpr): Likewise.
18026         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
18027         (StringPtr): Likewise.
18028
18029
18030 2002-08-05  Martin Baulig  <martin@gnome.org>
18031
18032         * expression.cs (BaseAccess.DoResolve): Actually report errors.
18033
18034         * assign.cs (Assign.DoResolve): Check whether the source
18035         expression is a value or variable.
18036
18037         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
18038         while resolving the corresponding blocks.
18039
18040         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
18041         an error, don't silently return null.
18042
18043         * statement.cs (Block.AddVariable): Do the error reporting here
18044         and distinguish between CS0128 and CS0136.
18045         (Block.DoResolve): Report all unused labels (warning CS0164).
18046         (LabeledStatement): Pass the location to the constructor.
18047         (LabeledStatement.HasBeenReferenced): New property.
18048         (LabeledStatement.Resolve): Set it to true here.
18049
18050         * statement.cs (Return.Emit): Return success even after reporting
18051         a type mismatch error (CS0126 or CS0127), this is what csc does and
18052         it avoids confusing the users with any consecutive errors.
18053
18054 2002-08-05  Martin Baulig  <martin@gnome.org>
18055
18056         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
18057
18058         * const.cs (Const.LookupConstantValue): Catch circular definitions.
18059
18060         * expression.cs (MemberAccess.DoResolve): Silently return if an
18061         error has already been reported.
18062
18063         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
18064         error has already been reported.
18065
18066 2002-08-05  Martin Baulig  <martin@gnome.org>
18067
18068         * statement.cs (UsageVector): Only initialize the `parameters'
18069         vector if we actually have any "out" parameters.
18070
18071 2002-08-05  Martin Baulig  <martin@gnome.org>
18072
18073         * expression.cs (Binary.ResolveOperator): When combining delegates,
18074         they must have the same type.
18075
18076 2002-08-05  Martin Baulig  <martin@gnome.org>
18077
18078         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
18079         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
18080         work with the ms runtime and we also don't need it: if we're a
18081         PropertyBuilder and not in the `indexer_arguments' hash, then we
18082         are a property and not an indexer.
18083
18084         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
18085         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
18086         since the latter one doesn't work with the ms runtime.
18087
18088 2002-08-03  Martin Baulig  <martin@gnome.org>
18089
18090         Fixed bugs #27998 and #22735.
18091
18092         * class.cs (Method.IsOperator): New public field.
18093         (Method.CheckBase): Report CS0111 if there's already a method
18094         with the same parameters in the current class.  Report CS0508 when
18095         attempting to change the return type of an inherited method.
18096         (MethodData.Emit): Report CS0179 if a method doesn't have a body
18097         and it's not marked abstract or extern.
18098         (PropertyBase): New abstract base class for Property and Indexer.
18099         (PropertyBase.CheckBase): Moved here from Property and made it work
18100         for indexers.
18101         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
18102         the same so we can reuse it there.
18103         (Property, Indexer): Derive from PropertyBase.
18104         (MethodSignature.inheritable_property_signature_filter): New delegate
18105         to find properties and indexers.
18106
18107         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
18108         argument and improved error reporting.
18109
18110         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
18111         EmptyReadOnlyParameters and made it a property.
18112
18113         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
18114         version of this method which takes a `PropertyInfo indexer'.
18115         (TypeManager.RegisterIndexer): New method.
18116
18117         * class.cs: Added myself as author of this file :-)
18118
18119 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18120
18121         * class.cs: fixed compilation on windoze.
18122
18123 2002-08-03  Martin Baulig  <martin@gnome.org>
18124
18125         * interface.cs (Interface.GetInterfaceBases): Check whether all
18126         base interfaces are at least as accessible than the current one.
18127
18128         * class.cs (TypeContainer.GetClassBases): Check whether base types
18129         are at least as accessible than the current type.
18130         (TypeContainer.AsAccessible): Implemented and made non-static.
18131         (MemberBase.CheckParameters): Report errors if the accessibility
18132         checks fail.
18133
18134         * delegate.cs (Delegate.Delegate): The default visibility is
18135         internal for top-level types and private for nested types.
18136         (Delegate.Define): Report errors if the accessibility checks fail.
18137
18138         * enum.cs (Enum.Enum): The default visibility is internal for
18139         top-level types and private for nested types.
18140         (Enum.DefineType): Compute the correct visibility.
18141
18142         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
18143         function which takes a `bool is_toplevel' instead of a TypeContainer.
18144
18145         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
18146         builtin type.
18147
18148 2002-08-02  Martin Baulig  <martin@gnome.org>
18149
18150         * expression.cs (LocalVariableReferenc): Added constructor which
18151         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
18152         (LocalVariableReference.IsReadOnly): New property.
18153         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
18154         variable is readonly, use our own readonly flag to do this; you can
18155         use the new constructor to get a writable reference to a read-only
18156         variable.
18157
18158         * cs-parser.jay (foreach_statement, using_statement): Get a writable
18159         reference to the local variable.
18160
18161 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
18162
18163         * rootcontext.cs (ResolveCore): Also include System.Exception
18164
18165         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
18166         we reach an EmptyStatement.
18167
18168         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
18169         is also fine.
18170
18171         * expression.cs (Binary.ResolveOperator): Check error result in
18172         two places.
18173
18174         use brtrue/brfalse directly and avoid compares to null.
18175
18176 2002-08-02  Martin Baulig  <martin@gnome.org>
18177
18178         * class.cs (TypeContainer.Define): Define all nested interfaces here.
18179         Fixes bug #28407, added test-155.cs.
18180
18181 2002-08-01  Martin Baulig  <martin@gnome.org>
18182
18183         * class.cs (Event.EmitDefaultMethod): Make this work with static
18184         events.  Fixes #28311, added verify-3.cs.
18185
18186 2002-08-01  Martin Baulig  <martin@gnome.org>
18187
18188         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
18189         `is_disposable' fields.
18190         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
18191         `hm.is_disposable' if we're using the collection pattern.
18192         (Foreach.EmitCollectionForeach): Use the correct type for the
18193         enumerator's local variable, only emit the try/finally block if
18194         necessary (fixes #27713).
18195
18196 2002-08-01  Martin Baulig  <martin@gnome.org>
18197
18198         * ecore.cs (Expression.report118): Renamed to Error118 and made
18199         it public static.
18200
18201         * statement.cs (Throw.Resolve): Check whether the expression is of
18202         the correct type (CS0118) and whether the type derives from
18203         System.Exception (CS0155).
18204         (Catch.Resolve): New method.  Do the type lookup here and check
18205         whether it derives from System.Exception (CS0155).
18206         (Catch.CatchType, Catch.IsGeneral): New public properties.
18207
18208         * typemanager.cs (TypeManager.exception_type): Added.
18209
18210 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
18211
18212         * driver.cs: Updated About function.
18213
18214 2002-07-31  Martin Baulig  <martin@gnome.org>
18215
18216         Implemented Control Flow Analysis.
18217
18218         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
18219         (EmitContext.CurrentBranching): Added.
18220         (EmitContext.StartFlowBranching): Added.
18221         (EmitContext.EndFlowBranching): Added.
18222         (EmitContext.KillFlowBranching): Added.
18223         (EmitContext.IsVariableAssigned): Added.
18224         (EmitContext.SetVariableAssigned): Added.
18225         (EmitContext.IsParameterAssigned): Added.
18226         (EmitContext.SetParameterAssigned): Added.
18227         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
18228         Added control flow analysis stuff here.
18229
18230         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
18231         resolve the expression as lvalue.
18232         (LocalVariableReference.DoResolve): Check whether the variable has
18233         already been assigned.
18234         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
18235         the parameter as assigned here.
18236         (ParameterReference.DoResolve): Check whether the parameter has already
18237         been assigned.
18238         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
18239         expression as lvalue.
18240
18241         * statement.cs (FlowBranching): New class for the flow analysis code.
18242         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
18243         (LabeledStatement.IsDefined): New public property.
18244         (LabeledStatement.AddUsageVector): New public method to tell flow
18245         analyis that the label may be reached via a forward jump.
18246         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
18247         flow analysis.
18248         (VariableInfo.Number): New public field.  This is used by flow analysis
18249         to number all locals of a block.
18250         (Block.CountVariables): New public property.  This is the number of
18251         local variables in this block (including the locals from all parent
18252         blocks).
18253         (Block.EmitMeta): Number all the variables.
18254
18255         * statement.cs: Added flow analysis support to all classes.
18256
18257 2002-07-31  Martin Baulig  <martin@gnome.org>
18258
18259         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
18260         To get debugging messages, compile mcs with /define:MCS_DEBUG and
18261         then use this argument.
18262
18263         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
18264
18265         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
18266         use this to specify /define options.
18267
18268 2002-07-29  Martin Baulig  <martin@gnome.org>
18269
18270         * statement.cs (Fixed): Moved all code that does variable lookups
18271         and resolvings from Emit to Resolve.
18272
18273         * statement.cs (For): Moved all code that does variable lookups
18274         and resolvings from Emit to Resolve.
18275
18276         * statement.cs (Using): Moved all code that does variable lookups
18277         and resolvings from Emit to Resolve.
18278
18279 2002-07-29  Martin Baulig  <martin@gnome.org>
18280
18281         * attribute.cs (Attribute.Resolve): Explicitly catch a
18282         System.NullReferenceException when creating the
18283         CustromAttributeBuilder and report a different warning message.
18284
18285 2002-07-29  Martin Baulig  <martin@gnome.org>
18286
18287         * support.cs (ParameterData.ParameterName): Added method to
18288         get the name of a parameter.
18289
18290         * typemanager.cs (TypeManager.IsValueType): New public method.
18291
18292 2002-07-29  Martin Baulig  <martin@gnome.org>
18293
18294         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
18295         is a flag which specifies that it's either ref or out.
18296         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
18297         the out parameter to `out Parameter.Modifier mod', also set the
18298         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
18299
18300         * support.cs (InternalParameters.ParameterModifier): Distinguish
18301         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18302         Parameter.Modifier.ISBYREF flag if it's either ref or out.
18303
18304         * expression.cs (Argument.GetParameterModifier): Distinguish
18305         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18306         Parameter.Modifier.ISBYREF flag if it's either ref or out.
18307
18308 2002-07-29  Martin Baulig  <martin@gnome.org>
18309
18310         * expression.cs (ParameterReference.ParameterReference): Added
18311         `Location loc' argument to the constructor.
18312
18313         * cs-parser.jay: Pass location to ParameterReference.
18314
18315 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
18316
18317         * statement.cs (Try): Initialize the location.
18318
18319         * cs-parser.jay: pass location to Try.
18320
18321         * expression.cs (Unary.Reduce): Change the prototype to return
18322         whether a constant fold could be performed or not.  The result is
18323         returned in an out parameters.  In the case of Indirection and
18324         AddressOf, we want to perform the full tests.
18325
18326 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
18327
18328         * statement.cs (Statement.Emit): Flag dead code.
18329
18330 2002-07-27  Andrew Birkett  <andy@nobugs.org>
18331
18332         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
18333
18334 2002-07-27  Martin Baulig  <martin@gnome.org>
18335
18336         * class.cs (MethodData.Define): Put back call to
18337         TypeManager.AddMethod(), accidentally commented this out.
18338
18339         * report.cs (Debug): New public method to print debugging information,
18340         this is `[Conditional ("DEBUG")]'.
18341
18342 2002-07-26  Martin Baulig  <martin@gnome.org>
18343
18344         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
18345         (switch_statement): Push the current_block to the switch_stack and
18346         pop it again when we're done with the switch.
18347         (switch_section): The new block is a child of the current_block.
18348         Fixes bug #24007, added test-152.cs.
18349
18350 2002-07-27  Martin Baulig  <martin@gnome.org>
18351
18352         * expression.cs (Invocation.EmitArguments): When calling a varargs
18353         function with only its fixed arguments, we need to pass an empty
18354         array.
18355
18356 2002-07-27  Martin Baulig  <martin@gnome.org>
18357
18358         Mono 0.13 has been released.
18359
18360 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
18361
18362         * driver.cs: Rename --resource to --linkres, because that is what
18363         we do currently, we dont support --resource yet.
18364
18365         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
18366
18367 2002-07-25  Martin Baulig  <martin@gnome.org>
18368
18369         * class.cs (MethodData): New public class.  This is a `method builder'
18370         class for a method or one accessor of a Property/Indexer/Event.
18371         (MethodData.GetMethodFlags): Moved here from MemberBase.
18372         (MethodData.ApplyAttributes): Likewise.
18373         (MethodData.ApplyObsoleteAttribute): Likewise.
18374         (MethodData.ApplyConditionalAttribute): Likewise.
18375         (MethodData.ApplyDllImportAttribute): Likewise.
18376         (MethodData.CheckAbstractAndExternal): Likewise.
18377         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
18378         (MethodData.Emit): Formerly known as Method.Emit().
18379         (MemberBase): Moved everything which was specific to a single
18380         accessor/method to MethodData.
18381         (Method): Create a new MethodData and call Define() and Emit() on it.
18382         (Property, Indexer, Event): Create a new MethodData objects for each
18383         accessor and call Define() and Emit() on them.
18384
18385 2002-07-25  Martin Baulig  <martin@gnome.org>
18386
18387         Made MethodCore derive from MemberBase to reuse the code from there.
18388         MemberBase now also checks for attributes.
18389
18390         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
18391         (MemberBase.GetMethodFlags): Moved here from class Method and marked
18392         as virtual.
18393         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
18394         `CallingConventions cc' and `Attributes opt_attrs' arguments.
18395         (MemberBase.ApplyAttributes): New virtual method; applies the
18396         attributes to a method or accessor.
18397         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
18398         (MemberBase.ApplyConditionalAttribute): Likewise.
18399         (MemberBase.ApplyDllImportAttribute): Likewise.
18400         (MemberBase.CheckAbstractAndExternal): Likewise.
18401         (MethodCore.ParameterTypes): This is now a property instead of a
18402         method, it's initialized from DoDefineParameters().
18403         (MethodCore.ParameterInfo): Removed the set accessor.
18404         (MethodCore.DoDefineParameters): New protected virtual method to
18405         initialize ParameterTypes and ParameterInfo.
18406         (Method.GetReturnType): We can now simply return the MemberType.
18407         (Method.GetMethodFlags): Override the MemberBase version and add
18408         the conditional flags.
18409         (Method.CheckBase): Moved some code from Define() here, call
18410         DoDefineParameters() here.
18411         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
18412         here to avoid some larger code duplication.
18413         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
18414         ensure that abstract and external accessors don't declare a body.
18415
18416         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
18417         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
18418         lookup in the attribute's parent classes, so we need to abort as soon
18419         as we found the first match.
18420         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
18421         the attribute has no arguments.
18422
18423         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
18424         of a Method.
18425
18426 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18427
18428         * cs-parser.jay: reverted previous patch.
18429
18430 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18431
18432         * cs-parser.jay: fixed bug #22119.
18433
18434 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18435
18436         * attribute.cs: fixed compilation. The error was:
18437         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
18438         be assigned to before control leaves the current method."
18439         [FIXME:  Filed as bug #28186: MCS must report this error.]
18440
18441 2002-07-25  Martin Baulig  <martin@gnome.org>
18442
18443         * attribute.cs (Attribute.Conditional_GetConditionName): New static
18444         method to pull the condition name ouf of a Conditional attribute.
18445         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
18446         the obsolete message and error flag out of an Obsolete attribute.
18447
18448         * class.cs (Method.GetMethodFlags): New public method to get the
18449         TypeManager.MethodFlags for this method.
18450         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
18451         private methods.
18452         (Method.Define): Get and apply the Obsolete and Conditional attributes;
18453         if we're overriding a virtual function, set the new private variable
18454         `parent_method'; call the new TypeManager.AddMethod().
18455
18456         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
18457         the MethodBuilder and the Method in a PtrHashtable.
18458         (TypeManager.builder_to_method): Added for this purpose.
18459         (TypeManager.MethodFlags): Added IsObsoleteError.
18460         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
18461         Obsolete and Conditional arguments in MethodBuilders.  If we discover
18462         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
18463         the message from the attribute.
18464
18465 2002-07-24  Martin Baulig  <martin@gnome.org>
18466
18467         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
18468         preprocessor directives, ensure that the argument to #define/#undef is
18469         exactly one identifier and that it's actually an identifier.
18470
18471         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
18472         did not work ....
18473
18474 2002-07-24  Martin Baulig  <martin@gnome.org>
18475
18476         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
18477         initialize it to TypeManager.object_type in the constructor.
18478         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
18479         of the `hm.get_current' method if we're using the collection pattern.
18480         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
18481         for the explicit conversion to make it work when we're using the collection
18482         pattern and the `Current' property has a different return type than `object'.
18483         Fixes #27713.
18484
18485 2002-07-24  Martin Baulig  <martin@gnome.org>
18486
18487         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
18488         does not match, but don't report any errors.  This method is called in
18489         order for all methods in a MethodGroupExpr until a matching method is
18490         found, so we don't want to bail out if the first method doesn't match.
18491         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
18492         matches, report the 123.  Fixes #28070.
18493
18494 2002-07-24  Martin Baulig  <martin@gnome.org>
18495
18496         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
18497         TypeManager.TypeToCoreType() to the top of the method so the
18498         following equality checks will work.  Fixes #28107.
18499
18500 2002-07-24  Martin Baulig  <martin@gnome.org>
18501
18502         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
18503         operand is of type uint, and the other operand is of type sbyte,
18504         short or int, the operands are converted to type long." -
18505         Actually do what this comment already told us.  Fixes bug #28106,
18506         added test-150.cs.
18507
18508 2002-07-24  Martin Baulig  <martin@gnome.org>
18509
18510         * class.cs (MethodBase): New abstract class.  This is now a base
18511         class for Property, Indexer and Event to avoid some code duplication
18512         in their Define() and DefineMethods() methods.
18513         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
18514         generic methods for Define() and DefineMethods().
18515         (FieldBase): Derive from MemberBase, not MemberCore.
18516         (Property): Derive from MemberBase, not MemberCore.
18517         (Property.DefineMethod): Moved all the code from this method to the
18518         new MethodBase.DefineAccessor(), just call it with appropriate
18519         argumetnts.
18520         (Property.Define): Call the new Property.DoDefine(), this does some
18521         sanity checks and we don't need to duplicate the code everywhere.
18522         (Event): Derive from MemberBase, not MemberCore.
18523         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
18524         accessors, this will also make them work with interface events.
18525         (Indexer): Derive from MemberBase, not MemberCore.
18526         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
18527         (Indexer.Define): Use the new MethodBase functions.
18528
18529         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
18530         argument to the constructor.
18531         (Interface.FindMembers): Added support for interface events.
18532         (Interface.PopluateEvent): Implemented.
18533
18534         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
18535
18536 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
18537
18538         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
18539         but this is required to check for a method name being the same as
18540         the containing class.  
18541
18542         Handle this now.
18543
18544 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18545
18546         * interface.cs: initialize variable.
18547
18548 2002-07-23  Martin Baulig  <martin@gnome.org>
18549
18550         Implemented the IndexerName attribute in interfaces.
18551
18552         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
18553         name if this is an explicit interface implementation.
18554         (Indexer.InterfaceIndexerName): New public variable.  If we're
18555         implementing an interface indexer, this is the IndexerName in that
18556         interface.  Otherwise, it's the IndexerName.
18557         (Indexer.DefineMethod): If we're implementing interface indexer,
18558         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
18559         and Pending.ImplementIndexer methods.
18560         (Indexer.Define): Also define the PropertyBuilder if we're
18561         implementing an interface indexer and this is neither an explicit
18562         interface implementation nor do the IndexerName match the one in
18563         the interface.
18564
18565         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
18566         If a method is defined here, then we always need to create a proxy
18567         for it.  This is used when implementing interface indexers.
18568         (Pending.IsInterfaceIndexer): New public method.
18569         (Pending.ImplementIndexer): New public method.
18570         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
18571         This is used when implementing interface indexers to define a proxy
18572         if necessary.
18573         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
18574         define a proxy if necessary.
18575
18576         * interface.cs (Interface.IndexerName): New public variable.
18577         (Interface.PopulateIndexer): Set the IndexerName.
18578         (Interface.DefineIndexers): New private method.  Populate all the
18579         indexers and make sure their IndexerNames match.
18580
18581         * typemanager.cs (IndexerPropertyName): Added support for interface
18582         indexers.
18583
18584 2002-07-22  Martin Baulig  <martin@gnome.org>
18585
18586         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
18587         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
18588         ret if HasReturnLabel.
18589         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
18590         variables.
18591
18592         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
18593         and set the ec.LoopBeginTryCatchLevel.
18594         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
18595         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
18596         the current ec.TryCatchLevel, the branch goes out of an exception
18597         block.  In this case, we need to use Leave and not Br.
18598
18599 2002-07-22  Martin Baulig  <martin@gnome.org>
18600
18601         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
18602         block unless the block does not always return or it is contained in
18603         another try { ... } catch { ... } block.  Fixes bug #26506.
18604         Added verify-1.cs to the test suite.
18605
18606 2002-07-22  Martin Baulig  <martin@gnome.org>
18607
18608         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
18609         then we do not always return.  Fixes bug #24985.
18610
18611 2002-07-22  Martin Baulig  <martin@gnome.org>
18612
18613         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
18614         lookup on a per-class level; ie. walk up the class hierarchy until we
18615         found at least one applicable method, then choose the best among them.
18616         Fixes bug #24463 and test-29.cs.
18617
18618 2002-07-22  Martin Baulig  <martin@gnome.org>
18619
18620         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
18621         return types of the methods.  The return type is not part of the
18622         signature and we must not check it to make the `new' modifier work.
18623         Fixes bug #27999, also added test-147.cs.
18624         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
18625
18626         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
18627         on the method's return type.
18628
18629 2002-07-21  Martin Baulig  <martin@gnome.org>
18630
18631         * assign.cs: Make this work if the rightmost source is a constant and
18632         we need to do an implicit type conversion.  Also adding a few more tests
18633         to test-38.cs which should have caught this.
18634
18635         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
18636         target in the makefile for this.  The makefile.gnu is primarily intended
18637         for end-users who don't want to debug the compiler.
18638
18639 2002-07-21  Martin Baulig  <martin@gnome.org>
18640
18641         * assign.cs: Improved the Assign class so it can now handle embedded
18642         assignments (X = Y = Z = something).  As a side-effect this'll now also
18643         consume less local variables.  test-38.cs now passes with MCS, added
18644         a few new test cases to that test.
18645
18646 2002-07-20  Martin Baulig  <martin@gnome.org>
18647
18648         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
18649         instructions.  Fixes bug #27977, also added test-146.cs.
18650
18651 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18652
18653         * cs-tokenizer.cs: fixed getHex ().
18654
18655 2002-07-19  Martin Baulig  <martin@gnome.org>
18656
18657         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
18658         not Type.GetType() to lookup the array type.  This is needed when
18659         we're constructing an array of a user-defined type.
18660         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
18661         single-dimensional arrays, but also for single-dimensial arrays of
18662         type decimal.
18663
18664 2002-07-19  Martin Baulig  <martin@gnome.org>
18665
18666         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
18667         this function is called, it's not allowed to share LocalBuilders
18668         among ILGenerators.
18669
18670 2002-07-19  Martin Baulig  <martin@gnome.org>
18671
18672         * expression.cs (Argument.Resolve): Report an error 118 when trying
18673         to pass a type as argument.
18674
18675 2002-07-18  Martin Baulig  <martin@gnome.org>
18676
18677         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
18678         Conv_R_Un for the signed `long' type.
18679
18680 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
18681
18682         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
18683         `expr' for the temporary result, as that will fail if we do
18684         multiple resolves on the same expression.
18685
18686 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
18687
18688         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
18689         ec.TypeContainer for looking up aliases. 
18690
18691         * class.cs (TypeContainer): Remove LookupAlias from here.
18692
18693         * decl.cs (DeclSpace); Move here.
18694
18695 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
18696
18697         * class.cs (FindMembers): Only call filter if the constructor
18698         bulider is not null.
18699
18700         Also handle delegates in `NestedTypes' now.  Now we will perform
18701         type lookups using the standard resolution process.  This also
18702         fixes a bug.
18703
18704         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
18705         This uses Expressions (the limited kind that can be parsed by the
18706         tree) instead of strings.
18707
18708         * expression.cs (ComposedCast.ToString): Implement, used to flag
18709         errors since now we have to render expressions.
18710
18711         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
18712         FormArrayType. 
18713
18714         * ecore.cs (SimpleName.ToString): ditto.
18715
18716         * cs-parser.jay: Instead of using strings to assemble types, use
18717         Expressions to assemble the type (using SimpleName, ComposedCast,
18718         MemberAccess).  This should fix the type lookups in declarations,
18719         because we were using a different code path for this.
18720
18721         * statement.cs (Block.Resolve): Continue processing statements
18722         even when there is an error.
18723
18724 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
18725
18726         * class.cs (Event.Define): Also remove the `remove' method from
18727         the list of pending items.
18728
18729         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
18730         generate more compact code. 
18731
18732 2002-07-17  Martin Baulig  <martin@gnome.org>
18733
18734         * const.cs (Const.LookupConstantValue): Add support for constant
18735         `unchecked' and `checked' expressions.
18736         Also adding test case test-140.cs for this.
18737
18738 2002-07-17  Martin Baulig  <martin@gnome.org>
18739
18740         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
18741         check whether mi.ReturnType implements the IEnumerator interface; the
18742         `==' and the IsAssignableFrom() will fail in this situation.
18743
18744 2002-07-16  Ravi Pratap  <ravi@ximian.com>
18745
18746         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
18747         here too.
18748
18749 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18750
18751         * expression.cs: fixed bug #27811.
18752
18753 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
18754
18755         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
18756         Molaro: when we are a ref, the value already contains a pointer
18757         value, do not take the address of it.
18758
18759 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18760         * removed mb-parser.jay and mb-tokenizer.cs
18761
18762 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18763
18764         * expression.cs: check against the building corlib void type.
18765
18766 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
18767
18768         * ecore.cs: fix for valuetype static readonly fields: when 
18769         initializing them, we need their address, not the address of a copy.
18770
18771 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
18772
18773         * typemanager.cs: register also enum_type in corlib.
18774
18775 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18776
18777         * class.cs: allow calling this (but not base) initializers in structs.
18778
18779 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
18780
18781         * ecore.cs: make sure we compare against the building base types
18782         in GetTypeSize ().
18783
18784 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
18785
18786         * typemanager.cs: fix TypeToCoreType() to handle void and object
18787         (corlib gets no more typerefs after this change).
18788
18789 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
18790
18791         * expression.cs (ArrayCreation.EmitArrayArguments): use
18792         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
18793
18794         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
18795         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
18796         array indexes, the runtime actually forbids them.
18797
18798         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
18799         for array arguments here.
18800
18801         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
18802         instead of the default for ValueTypes.
18803
18804         (New.DoEmit): Use IsValueType instead of
18805         IsSubclassOf (value_type)
18806         (New.DoResolve): ditto.
18807         (Invocation.EmitCall): ditto.
18808
18809         * assign.cs (Assign): ditto.
18810
18811         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
18812         Statements *are* currently doing part of their resolution during
18813         Emit.  
18814
18815         Expressions do always resolve during resolve, but statements are
18816         only required to propagate resolution to their children.
18817
18818 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
18819
18820         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
18821
18822         (LoadAssembly): Do not add the dll if it is already specified
18823
18824         (MainDriver): Add the System directory to the link path at the end,
18825         after all the other -L arguments. 
18826
18827         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
18828         wrong opcode for loading bytes and bools (ldelem.i1 instead of
18829         ldelem.u1) and using the opposite for sbytes.
18830
18831         This fixes Digger, and we can finally run it.
18832
18833         * driver.cs (UnixParseOption): Move the option parsing here.  
18834         (CSCParseOption): Implement CSC-like parsing of options.
18835
18836         We now support both modes of operation, the old Unix way, and the
18837         new CSC-like way.  This should help those who wanted to make cross
18838         platform makefiles.
18839
18840         The only thing broken is that /r:, /reference: and /lib: are not
18841         implemented, because I want to make those have the same semantics
18842         as the CSC compiler has, and kill once and for all the confussion
18843         around this.   Will be doing this tomorrow.
18844
18845         * statement.cs (Unsafe.Resolve): The state is checked during
18846         resolve, not emit, so we have to set the flags for IsUnsfe here.
18847
18848 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
18849
18850         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
18851         not catch the Error_ObjectRefRequired in SimpleName (as it is
18852         possible to have a class/instance variable name that later gets
18853         deambiguated), we have to check this here.      
18854
18855 2002-07-10  Ravi Pratap  <ravi@ximian.com>
18856
18857         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
18858         make static and put into Expression.
18859
18860         (Event.Define): Register the private field of the event with the 
18861         TypeManager so that GetFieldFromEvent can get at it.
18862
18863         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
18864         keep track of the private field associated with an event which
18865         has no accessors.
18866
18867         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
18868         private field.
18869
18870         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
18871
18872 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
18873
18874         * expression.cs (Binary.EmitBranchable): this routine emits the
18875         Binary expression in a branchable context.  This basically means:
18876         we need to branch somewhere, not just get the value on the stack.
18877
18878         This works together with Statement.EmitBoolExpression.
18879
18880         * statement.cs (Statement.EmitBoolExpression): Use
18881         EmitBranchable. 
18882
18883 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
18884
18885         * statement.cs (For): Reduce the number of jumps in loops.
18886
18887         (For): Implement loop inversion for the For statement.
18888
18889         (Break): We can be breaking out of a Try/Catch controlled section
18890         (foreach might have an implicit try/catch clause), so we need to
18891         use Leave instead of Br.
18892
18893         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
18894         now).  If the instace expression supports IMemoryLocation, we use
18895         the AddressOf method from the IMemoryLocation to extract the
18896         address instead of emitting the instance.
18897
18898         This showed up with `This', as we were emitting the instance
18899         always (Emit) instead of the Address of This.  Particularly
18900         interesting when This is a value type, as we dont want the Emit
18901         effect (which was to load the object).
18902
18903 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
18904
18905         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
18906
18907         * statement.cs (Checked): Set the CheckedState during the resolve
18908         process too, as the ConvCast operations track the checked state on
18909         the resolve process, and not emit.
18910
18911         * cs-parser.jay (namespace_member_declaration): Flag that we have
18912         found a declaration when we do.  This is used to flag error 1529
18913
18914         * driver.cs: Report ok when we display the help only.
18915
18916 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
18917
18918         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
18919
18920 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
18921
18922         * cs-tokenizer.cs (define): We also have to track locally the
18923         defines.  AllDefines is just used for the Conditional Attribute,
18924         but we also need the local defines for the current source code. 
18925
18926 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
18927
18928         * statement.cs (While, For, Do): These loops can exit through a
18929         Break statement, use this information to tell whether the
18930         statement is the last piece of code.
18931
18932         (Break): Flag that we break.
18933
18934         * codegen.cs (EmitContexts): New `Breaks' state variable.
18935
18936 2002-07-03  Martin Baulig  <martin@gnome.org>
18937
18938         * class.cs (TypeContainer.MethodModifiersValid): Allow override
18939         modifiers in method declarations in structs.  Otherwise, you won't
18940         be able to override things like Object.Equals().
18941
18942 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
18943
18944         * class.cs (Method, Property, Indexer): Do not allow the public
18945         modifier to be used in explicit interface implementations.
18946
18947         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
18948         override modifiers in method declarations in structs
18949
18950 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
18951
18952         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
18953         integer or real overflow, report an error
18954
18955 2002-07-02  Martin Baulig  <martin@gnome.org>
18956
18957         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
18958         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
18959         to tell the runtime about our newly created System.Object and
18960         System.ValueType types.
18961
18962 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
18963
18964         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
18965         struct instead of Ldarg/Starg.
18966
18967 2002-07-02  Martin Baulig  <martin@gnome.org>
18968
18969         * expression.cs (Indirection.Indirection): Call
18970         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
18971
18972 2002-07-02  Martin Baulig  <martin@gnome.org>
18973
18974         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
18975         ValueType, call TypeManager.TypeToCoreType() on it.
18976         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
18977         the OpCodes.Newarr argument.
18978
18979 2002-07-02  Martin Baulig  <martin@gnome.org>
18980
18981         * expression.cs (Invocation.EmitCall): When compiling corlib,
18982         replace all calls to the system's System.Array type to calls to
18983         the newly created one.
18984
18985         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
18986         System.Array methods.
18987         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
18988         from the system's System.Array type which must be replaced.
18989
18990 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
18991
18992         * typemanager.cs: load unverifiable_code_ctor so we can build
18993         corlib using the correct type. Avoid using GetTypeCode() with
18994         TypeBuilders.
18995         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
18996         TypeManager.object_type to allow building corlib.
18997
18998 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
18999
19000         * ecore.cs: handle System.Enum separately in LoadFromPtr().
19001
19002 2002-07-01  Martin Baulig  <martin@gnome.org>
19003
19004         * class.cs: Make the last change actually work, we need to check
19005         whether `ifaces != null' to avoid a crash.
19006
19007 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19008
19009         * class.cs: when we build structs without fields that implement
19010         interfaces, we need to add the interfaces separately, since there is
19011         no API to both set the size and add the interfaces at type creation
19012         time.
19013
19014 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19015
19016         * expression.cs: the dimension arguments to the array constructors
19017         need to be converted if they are a long.
19018
19019 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
19020
19021         * class.cs: don't emit ldarg.0 if there is no parent constructor
19022         (fixes showstopper for corlib).
19023
19024 2002-06-29  Martin Baulig  <martin@gnome.org>
19025
19026         MCS now compiles corlib on GNU/Linux :-)
19027
19028         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
19029         ie. check for MethodImplOptions.InternalCall.
19030
19031         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
19032         and TypeManager.attribute_type are null, so we must explicitly check
19033         whether parent is not null to find out whether it's an attribute type.
19034         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
19035         and SetBuilder, not only if the property is neither abstract nor external.
19036         This is necessary to set the MethodImplOptions on the accessor methods.
19037         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
19038         SetBuilder, see Property.Emit().
19039
19040         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
19041         populate "System.Object", "System.ValueType" and "System.Attribute" since
19042         they've already been populated from BootCorlib_PopulateCoreTypes().
19043
19044 2002-06-29  Martin Baulig  <martin@gnome.org>
19045
19046         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
19047         is the NullLiteral, we also need to make sure that target_type is not
19048         an enum type.   
19049
19050 2002-06-29  Martin Baulig  <martin@gnome.org>
19051
19052         * rootcontext.cs (RootContext.ResolveCore): We must initialize
19053         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
19054         before calling BootstrapCorlib_ResolveDelegate ().
19055
19056 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19057
19058         * statement.cs: fixed build-breaker. All tests passed ok.
19059
19060 2002-06-27  Martin Baulig  <martin@gnome.org>
19061
19062         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
19063         for System.Decimal when compiling corlib.
19064
19065 2002-06-27  Martin Baulig  <martin@gnome.org>
19066
19067         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
19068         switch blocks which contain nothing but a default clause.
19069
19070 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
19071
19072        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
19073
19074 2002-06-27  Martin Baulig  <martin@gnome.org>
19075
19076         * ecore.cs (PropertyExpr.PropertyExpr): Call
19077         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
19078
19079         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
19080         is already a TypeBuilder.
19081
19082 2002-06-27  Martin Baulig  <martin@gnome.org>
19083
19084         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
19085         `target_type == TypeManager.array_type', not IsAssignableFrom() in
19086         the "from an array-type to System.Array" case.  This makes it work
19087         when compiling corlib.
19088
19089 2002-06-27  Martin Baulig  <martin@gnome.org>
19090
19091         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
19092         non-static PropertyExpr, set its InstanceExpression.  This makes
19093         the `ICollection.Count' property work in System/Array.cs.
19094
19095 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
19096
19097         * driver.cs: Made error handling more consistent.  Errors now
19098         tracked by Report class, so many methods which used to return int
19099         now return void.  Main() now prints success/failure and 
19100         errors/warnings message.
19101
19102         Renamed '--probe' compiler argument to '--expect-error'.  Removed
19103         the magic number return values (123 and 124).  Now, if the
19104         expected error occurs, the compiler exits with success (exit value
19105         0).  If the compilation completes without seeing that particular
19106         error, the compiler exits with failure (exit value 1).  The
19107         makefile in mcs/errors has been changed to handle the new behaviour.
19108
19109         * report.cs: Made 'expected error' number a property and renamed
19110         it from 'Probe' to 'ExpectedError'.
19111
19112         * genericparser.cs: Removed error handling support, since it is
19113         now all done by Report class.
19114
19115         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
19116         class, so parse() no longer returns an int.
19117
19118         * namespace.cs: Use Report.Error instead of GenericParser.error
19119
19120 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
19121
19122         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
19123         TypeContainer.AddOperator): At the front of the list put the
19124         explicit implementations, so they get resolved/defined first. 
19125
19126 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
19127
19128         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
19129         interface type is implemented by this TypeContainer.  Used during
19130         explicit interface implementation.
19131
19132         (Property.Define, Indexer.Define, Method.Define): Validate that
19133         the given interface in the explicit implementation is one of the
19134         base classes for the containing type.
19135
19136         Also if we are explicitly implementing an interface, but there is
19137         no match in the pending implementation table, report an error.
19138
19139         (Property.Define): Only define the property if we are
19140         not explicitly implementing a property from an interface.  Use the
19141         correct name also for those properties (the same CSC uses,
19142         although that is really not needed).
19143
19144         (Property.Emit): Do not emit attributes for explicitly implemented
19145         properties, as there is no TypeBuilder.
19146
19147         (Indexer.Emit): ditto.
19148
19149         Hiding then means that we do not really *implement* a pending
19150         implementation, which makes code fail.
19151
19152 2002-06-22  Martin Baulig  <martin@gnome.org>
19153
19154         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
19155         the return value of Object.GetType().  [FIXME: we need to do this whenever
19156         we get a type back from the reflection library].
19157
19158 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
19159
19160         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
19161
19162 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
19163
19164         * attribute.cs: Return null if we can not look up the type.
19165
19166         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
19167         the interface types found.
19168
19169         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
19170         interface types found.
19171
19172         * typemanager.cs (GetInterfaces): Make this routine returns alll
19173         the interfaces and work around the lame differences between
19174         System.Type and System.Reflection.Emit.TypeBuilder in the results
19175         result for GetInterfaces.
19176
19177         (ExpandInterfaces): Given an array of interface types, expand and
19178         eliminate repeated ocurrences of an interface.  This expands in
19179         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
19180         be IA, IB, IC.
19181
19182 2002-06-21  Martin Baulig  <martin@gnome.org>
19183
19184         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
19185         on System.Enum.
19186
19187 2002-06-21  Martin Baulig  <martin@gnome.org>
19188
19189         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
19190         and called with one of the core types, return the corresponding typebuilder for
19191         that type.
19192
19193         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
19194         element type.
19195
19196 2002-06-21  Martin Baulig  <martin@gnome.org>
19197
19198         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
19199         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
19200         (Expression.ConvertReferenceExplicit): Likewise.
19201
19202         * expression.cs (ElementAccess.DoResolve): Likewise.
19203         (ElementAccess.DoResolveLValue): Likewise.
19204
19205 2002-06-10  Martin Baulig  <martin@gnome.org>
19206
19207         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
19208         add the "value" parameter to the parameter list.
19209
19210         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
19211         to our caller.
19212
19213 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
19214
19215         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
19216         the argument to an int, uint, long or ulong, per the spec.  Also
19217         catch negative constants in array creation.
19218
19219 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
19220
19221         * class.cs: do not allow the same interface to appear twice in
19222         the definition list.
19223
19224 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
19225
19226         * ecore.cs: don't use ldlen with System.Array.
19227
19228 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
19229
19230         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
19231
19232 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
19233
19234         * modifiers.cs: produce correct field attributes for protected
19235         internal. Easy fix so miguel can work on ther harder stuff:-)
19236
19237 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
19238
19239         * pending.cs: New file.  Move the code from class.cs here.
19240         Support clearning the pending flag for all methods (when not doing
19241         explicit interface implementation).
19242
19243 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
19244
19245         * rootcontext.cs: added a couple more types needed to bootstrap.
19246
19247 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
19248
19249         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
19250         constructor in the type, instead of any constructor in the type
19251         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
19252         a bug in the Mono runtime when applying the params attribute). 
19253
19254 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
19255         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
19256
19257 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
19258
19259         * expression.cs (Unary.ResolveOperator): Use TypeManager
19260         to resolve the type.
19261
19262 2002-06-13  Ravi Pratap  <ravi@ximian.com>
19263
19264         * cs-parser.jay (enum_member_declaration): Pass in the attributes
19265         attached.
19266
19267         * enum.cs (AddEnumMember): Add support to store the attributes associated 
19268         with each member too.
19269
19270         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
19271         field builders too - this takes care of the enum member case.
19272
19273 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
19274
19275         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
19276         address-of operator on both value types and pointers.
19277
19278 2002-06-10  Martin Baulig  <martin@gnome.org>
19279
19280         * interface.cs (Interface.PopulateIndexer): Add the indexer's
19281         PropertyBuilder to the `property_builders' list.
19282
19283         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
19284         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
19285         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
19286         find any indexers which are inherited from an interface.
19287
19288 2002-06-09  Martin Baulig  <martin@gnome.org>
19289
19290         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
19291         the same type as the constant if necessary.  There's also a test-130.cs
19292         for this.
19293
19294         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
19295
19296         * typemanager.cs (TypeManager.ChangeType): Previously known as
19297         Enum.ChangeEnumType().
19298
19299 2002-06-09  Martin Baulig  <martin@gnome.org>
19300
19301         * expression.cs (Cast.TryReduce): Added support for consts.
19302
19303 2002-06-08  Ravi Pratap  <ravi@ximian.com>
19304
19305         * class.cs (Accessor): Hold attributes information so we can pass
19306         it along.
19307
19308         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
19309         Modify to pass in attributes attached to the methods.
19310
19311         (add_accessor_declaration, remove_accessor_declaration): Ditto.
19312
19313         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
19314         to handle the Accessor kind :-)
19315
19316         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
19317
19318 2002-06-08  Martin Baulig  <martin@gnome.org>
19319
19320         * expression.cs (Unary.TryReduceNegative): Added support for
19321         ULongConstants.
19322
19323 2002-06-08  Martin Baulig  <martin@gnome.org>
19324
19325         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
19326         name can't be found in the `defined_names' - the caller will do a
19327         MemberLookup in this case and thus find methods in System.Enum
19328         such as Enum.IsDefined().
19329
19330 2002-06-08  Martin Baulig  <martin@gnome.org>
19331
19332         * enum.cs (Enum.ChangeEnumType): This is a custom version of
19333         Convert.ChangeType() which works with TypeBuilder created types.
19334         (Enum.LookupEnumValue, Enum.Define): Use it here.
19335
19336         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
19337         `TypeBuilder.BaseType != null' check.
19338         (TypeContainer.FindMembers): Only lookup parent members if we
19339         actually have a parent.
19340         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
19341         (ConstructorInitializer.Resolve): Likewise.
19342
19343         * interface.cs (Interface.FindMembers): Added
19344         `TypeBuilder.BaseType != null' check.
19345
19346         * rootcontext.cs (RootContext.ResolveCore): Added
19347         "System.Runtime.CompilerServices.IndexerNameAttribute" to
19348         classes_second_stage.
19349
19350         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
19351         debug_type and trace_type when compiling with --nostdlib.       
19352
19353 2002-06-07  Martin Baulig  <martin@gnome.org>
19354
19355         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
19356         (AddField): Set it to true when adding a non-static field.
19357         (DefineType): Use `have_nonstatic_fields' to find out whether we
19358         have non-static fields, not `Fields != null'.
19359
19360 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
19361
19362         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
19363         dereferencing a null on the static-field code path)
19364
19365 2002-05-30  Martin Baulig  <martin@gnome.org>
19366
19367         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
19368         to take command line arguments.  Use reflection to call the new
19369         custom `Initialize' function on the symbol writer and pass it the
19370         command line arguments.
19371
19372         * driver.cs (--debug-args): New command line argument to pass command
19373         line arguments to the symbol writer.
19374
19375 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
19376
19377         * assign.cs (DoResolve): Forgot to do the implicit conversion to
19378         the target type for indexers and properties.  Thanks to Joe for
19379         catching this.
19380
19381 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
19382
19383         * typemanager.cs (MethodFlags): returns the method flags
19384         (Obsolete/ShouldIgnore) that control warning emission and whether
19385         the invocation should be made, or ignored. 
19386
19387         * expression.cs (Invocation.Emit): Remove previous hack, we should
19388         not do this on matching a base type, we should do this based on an attribute
19389
19390         Only emit calls to System.Diagnostics.Debug and
19391         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
19392         on the command line.
19393
19394         * rootcontext.cs: Global settings for tracing and debugging.
19395
19396         * cs-tokenizer.cs (define): New utility function to track
19397         defines.   Set the global settings for TRACE and DEBUG if found.
19398
19399 2002-05-25  Ravi Pratap  <ravi@ximian.com>
19400
19401         * interface.cs (Populate*): Pass in the TypeContainer as well as
19402         the DeclSpace as parameters so that we can create EmitContexts and
19403         then use that to apply attributes etc.
19404
19405         (PopulateMethod, PopulateEvent, PopulateProperty)
19406         (PopulateIndexer): Apply attributes everywhere.
19407
19408         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
19409         etc.
19410
19411         (ApplyAttributes): Update accordingly.
19412
19413         We now apply interface attributes for all members too.
19414
19415 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
19416
19417         * class.cs (Indexer.Define); Correctly check if we are explicit
19418         implementation (instead of checking the Name for a ".", we
19419         directly look up if the InterfaceType was specified).
19420
19421         Delay the creation of the PropertyBuilder.
19422
19423         Only create the PropertyBuilder if we are not an explicit
19424         interface implementation.   This means that explicit interface
19425         implementation members do not participate in regular function
19426         lookups, and hence fixes another major ambiguity problem in
19427         overload resolution (that was the visible effect).
19428
19429         (DefineMethod): Return whether we are doing an interface
19430         implementation. 
19431
19432         * typemanager.cs: Temporary hack until we get attributes in
19433         interfaces (Ravi is working on that) and we get IndexerName
19434         support in interfaces.
19435
19436         * interface.cs: Register the indexers as properties.
19437
19438         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
19439         warning, I have verified that this is a bug in the .NET runtime
19440         (JavaScript suffers of the same problem).
19441
19442         * typemanager.cs (MemberLookup): When looking up members for
19443         interfaces, the parent of an interface is the implicit
19444         System.Object (so we succeed in searches of Object methods in an
19445         interface method invocation.  Example:  IEnumerable x;  x.ToString
19446         ()) 
19447
19448 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
19449
19450         * class.cs (Event): Events should also register if they do
19451         implement the methods that an interface requires.
19452
19453         * typemanager.cs (MemberLookup); use the new GetInterfaces
19454         method. 
19455
19456         (GetInterfaces): The code used to lookup interfaces for a type is
19457         used in more than one place, factor it here. 
19458
19459         * driver.cs: Track the errors at the bottom of the file, we kept
19460         on going.
19461
19462         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
19463         instance if the method we are calling is static!
19464
19465 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
19466
19467         * attribute.cs (ApplyAttributes): Make this function filter out
19468         the IndexerName attribute (as that attribute in reality is never
19469         applied) and return the string constant for the IndexerName
19470         attribute. 
19471
19472         * class.cs (TypeContainer.Emit): Validate that all the indexers
19473         have the same IndexerName attribute, and if so, set the
19474         DefaultName attribute on the class. 
19475
19476         * typemanager.cs: The return value might contain other stuff (not
19477         only methods).  For instance, consider a method with an "Item"
19478         property and an Item method.
19479
19480         * class.cs: If there is a problem with the parameter types,
19481         return. 
19482
19483 2002-05-24  Ravi Pratap  <ravi@ximian.com>
19484
19485         * ecore.cs (ImplicitConversionExists): Wrapper function which also
19486         looks at user defined conversion after making a call to 
19487         StandardConversionExists - we need this for overload resolution.
19488
19489         * expression.cs : Update accordingly the various method calls.
19490
19491         This fixes 2 bugs filed against implicit user defined conversions 
19492
19493 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
19494
19495         * statement.cs: Track the result of the assignment.
19496
19497 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
19498
19499         * expression.cs (MemberAccess): Improved error reporting for
19500         inaccessible members.
19501
19502 2002-05-22  Martin Baulig  <martin@gnome.org>
19503
19504         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
19505         itself with debugging support.
19506
19507 2002-05-22  Martin Baulig  <martin@gnome.org>
19508
19509         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
19510         Removed, this isn't needed anymore.
19511
19512 2002-05-20  Martin Baulig  <martin@gnome.org>
19513
19514         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
19515         be underlying type for an enum.
19516
19517 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
19518
19519         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
19520         that splits out the loading of just the core types.
19521
19522         * rootcontext.cs (ResolveCore): Split the struct resolution in
19523         two, so we can load the enumeration underlying types before any
19524         enums are used.
19525
19526         * expression.cs (Is): Bandaid until we fix properly Switch (see
19527         bug #24985 for details).
19528
19529         * typemanager.cs (ImplementsInterface): The hashtable will contain
19530         a null if there are no interfaces implemented.
19531
19532 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
19533
19534         * cs-parser.jay (indexer_declarator): It is fine to have array
19535         parameters
19536
19537 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
19538
19539         * typemanager.cs: (RegisterBuilder): New function used to register
19540         TypeBuilders that implement interfaces.  Since
19541         TypeBuilder.GetInterfaces (as usual) does not work with lame
19542         Reflection.Emit. 
19543         (AddUserType): register interfaces.
19544
19545         (ImplementsInterface): Use the builder_to_ifaces hash if we are
19546         dealing with TypeBuilder.  Also, arrays are showing up as
19547         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
19548         methods can not be invoked on them!
19549
19550         * ecore.cs (ExplicitReferenceConversionExists): Made public.
19551         (ImplicitReferenceConversionExists): Split out from
19552         StandardConversionExists. 
19553
19554         * expression.cs (As): We were only implementing one of the three
19555         cases for the as operator.  We now implement them all.
19556         (Is): Implement the various other cases for Is as well.
19557
19558         * typemanager.cs (CACHE): New define used to control if we want or
19559         not the FindMembers cache.  Seems to have a negative impact on
19560         performance currently
19561
19562         (MemberLookup): Nested types have full acess to
19563         enclosing type members
19564
19565         Remove code that coped with instance/static returns for events, we
19566         now catch this in RealFindMembers.
19567
19568         (RealFindMembers): only perform static lookup if the instance
19569         lookup did not return a type or an event.  
19570
19571 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
19572
19573         * assign.cs (CompoundAssign): We pass more semantic information
19574         now to Compound Assignments than we did before: now we have all
19575         the information at hand, and now we resolve the target *before* we
19576         do the expression expansion, which allows the "CacheValue" method
19577         to have the effect we intended (before, a [x] += 1 would generate
19578         two differen ArrayAccess expressions from the ElementAccess,
19579         during the resolution process).
19580
19581         (CompoundAssign.DoResolve): Resolve target and original_source here.
19582
19583 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
19584
19585         * expression.cs (ArrayAccess): dropped debugging information. 
19586
19587         * typemanager.cs: Small bug fix: I was always returning i_members,
19588         instead of one of i_members or s_members (depending on which had
19589         the content).
19590
19591         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
19592         method is invoked before any code generation takes place, and it
19593         is a mechanism to inform that the expression will be invoked more
19594         than once, and that the method should use temporary values to
19595         avoid having side effects
19596
19597         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
19598
19599         * ecore.cs (Expression.CacheTemporaries): Provide empty default
19600         implementation.
19601
19602         * expression.cs (Indirection, ArrayAccess): Add support for
19603         CacheTemporaries in these two bad boys. 
19604
19605         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
19606         ldobj or ldind_ref.  
19607         (StoreFromPtr): Handle stobj as well.
19608
19609         * expression.cs (UnaryMutator): Share more code.
19610
19611         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
19612         down: I was not tracking the Filter function as well, which
19613         was affecting the results of the cache.
19614
19615 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
19616
19617         * attribute.cs: Remove the hack to handle the CharSet property on
19618         StructLayouts. 
19619
19620 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
19621
19622         * attribute.cs (DoResolve): More uglyness, we now only try to
19623         resolve the attribute partially, to extract the CharSet
19624         information (only if we are a StructLayout attribute).  Otherwise 
19625
19626         (GetExtraTypeInfo): Add some code to conditionally kill in the
19627         future this.   I am more and more convinced that the .NET
19628         framework has special code to handle the attribute setting on
19629         certain elements.
19630
19631         * expression.cs (IsParamsMethodApplicable): Revert my previous
19632         foreach change here, it was wrong.
19633
19634 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
19635
19636         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
19637         (pp_expr): do not abort on unknown input, just return.
19638         (eval): abort if there are pending chars.
19639
19640         * attribute.cs (Attribute.Resolve): Positional parameters are
19641         optional.  Deal with that case.
19642
19643         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
19644         the Ansi/Unicode/Auto information for the type.
19645
19646         (TypeContainer.DefineType): instantiate the EmitContext here, as
19647         we will be using it during the type definition (to resolve
19648         attributes) and during the emit phase.
19649
19650         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
19651         to pull type information out of the attributes
19652
19653         (Attribute.Resolve): track the constructor builder, and allow for
19654         multiple invocations (structs and classes will use this).
19655
19656         * ecore.cs (MemberLookupFinal): new version with all the
19657         parameters customizable.
19658
19659         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
19660         constructors.  Return if the result value is null (as the error
19661         would have been flagged already by MemberLookupFinal)
19662
19663         Do not allow instances of abstract classes or interfaces to be
19664         created.
19665
19666         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
19667         We have to compare the assembly property here when dealing with
19668         FamANDAssem and Assembly access modifiers, because we might be
19669         creating an assembly from *modules* (that means that we are not
19670         getting TypeBuilders for types defined in other modules that are
19671         part of this assembly).
19672
19673         (Method.Emit): If the method is marked abstract and has a body,
19674         emit an error. 
19675
19676         (TypeContainer.DefineMembers): If both the defined member and the
19677         parent name match are methods, then do not emit any warnings: let
19678         the Method.Define routine take care of flagging warnings.  But if
19679         there is a mismatch (method overrides something else, or method is
19680         overriwritten by something, then emit warning).
19681
19682         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
19683         set to null, this means `do not check for the return type on the
19684         signature'. 
19685
19686         (Method.Define): set the return type for the method signature to
19687         null, so that we get methods with the same name and parameters and
19688         different return types.  This is used to flag warning 114 (you are
19689         hiding a method, and you probably want to use the new/override
19690         keywords instead).
19691
19692         * typemanager.cs (MemberLookup): Implemented proper access
19693         control, closing a long standing set of bug reports.  The problem
19694         was that the Framework only has two bits: Public and NonPublic,
19695         and NonPublic includes private and protected methods, but we need
19696         to enforce the FamANDAssem, FamOrAssem and Family. 
19697
19698 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
19699
19700         * statement.cs (GotoCase): Return true: Ammounts to giving up
19701         knowledge on whether we return or not, and letting the other case
19702         be responsible for it.
19703
19704 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
19705
19706         * driver.cs: Do not load directories for each file processed, only
19707         do it if there is a pattern.
19708
19709         * ecore.cs: Report readonly assigns here as well, as we might have
19710         been resolved only by MemberAccess.
19711
19712         (SimpleName.SimpleNameResolve): Also be useful for LValue
19713         resolution.   We need this to propagate assign to local readonly variables
19714
19715         * typemanager.cs: Use a ptrhashtable for the criteria, because we
19716         do not want to reuse potential criteria memory.
19717
19718         * class.cs (MyEventBuilder): Set reflected_type;
19719
19720         * ecore.cs (Constantify): Added support for constifying bools.
19721
19722         (RootContext.LookupType): Added a cache for values looked up in
19723         the declaration space.
19724
19725         * typemanager.cs (FindMembers): Now is a front-end to
19726         RealFindMembers, and provides a two-level hashtable-based cache to
19727         the request.  
19728
19729         15% performance improvement: from 22.5 to 19.2 seconds.
19730
19731         * expression.cs (IsParamsMethodApplicable): use foreach.
19732         (Invocation.DoResolve): ditto.
19733         (New.DoResolve): ditto.
19734         (ArrayCreation.DoResolve): ditto.
19735
19736         * ecore.cs (FindMostEncompassingType): use foreach.
19737
19738         * delegate.cs (NewDelegate.DoResolve): Use foreach
19739
19740         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
19741         (RemoveMethods): use foreach.
19742
19743         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
19744         nested foreach statements instead of for, and also break out of
19745         the inner loop once a match is found.
19746
19747         (Invocation.OverloadResolve): Use foreach, simplify the code. 
19748
19749 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
19750
19751         * cfold.cs (BinaryFold): During an enumeration evaluation context,
19752         we actually unwrap the expression to allow for extra information
19753         to be extracted. 
19754
19755         * expression.cs: Use Shr_Un on unsigned operations. 
19756
19757 2002-05-08  Ravi Pratap  <ravi@ximian.com>
19758
19759         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
19760         applicable operators was not being considered correctly. This closes
19761         the bug Miguel reported.
19762
19763 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
19764
19765         * attribute.cs: check that the type derives from System.Attribute
19766         and report the correct error in that case (moved the duplicate code to
19767         its own method, too).
19768
19769 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
19770
19771         * attribute.cs: lookup attribute type name as the spec says: first the
19772         bare attribute name and then name + "Attribute" (nant compiles with
19773         mcs after this fix).
19774
19775 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
19776
19777         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
19778         Because of the way we parse things, we should try to see if a
19779         UIntConstant can fit in an integer.
19780
19781 2002-05-07  Ravi Pratap  <ravi@ximian.com>
19782
19783         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
19784         when we are in an explicit context.
19785
19786         (ConvertReferenceExplicit): When converting from Iface type S to Class
19787         T make sure the rules are implemented as an OR.
19788
19789         * parameter.cs (ParameterType): Make it a property for now although the
19790         purpose really isn't anything immediate.
19791
19792         * expression.cs (Is*Applicable): Do better checking on the parameter type
19793         of a ref/out parameter. The ones from the system assemblies are already 
19794         marked with the correct type so we don't need to do any correction.
19795
19796         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
19797         the object type is standard too so include that.
19798
19799 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19800
19801         * ecore.cs (StandardConversionExists): Augment with missing code:
19802         deal with IntConstant, LongConstants and Enumerations.
19803
19804         * assign.cs: Report the error, instead of failing silently
19805
19806         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
19807         typecontainer that they are declared, because the
19808         typecontainer/namespace will have the list of using clauses that
19809         need to be applied.
19810
19811         Assembly Attributes were escaping the normal registration
19812         mechanism. 
19813
19814         (EmitCode): Apply attributes within an EmitContext that represents
19815         the container they were declared on.
19816
19817         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
19818
19819 2002-05-06  Ravi Pratap  <ravi@ximian.com>
19820
19821         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
19822         Revamp completely - make much cleaner as we now operate only
19823         on a set of Types.
19824
19825         (FindMostSpecificSource, FindMostSpecificTarget): New methods
19826         to implement the logic detailed in the spec more correctly.
19827
19828         (UserDefinedConversion): Update accordingly.
19829
19830 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19831
19832         * statement.cs: Return flow analysis information up.
19833
19834         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
19835         and the default.
19836
19837         (token): Do not consume an extra character before calling
19838         decimal_digits.
19839
19840 2002-05-06  Piers Haken <piersh@friskit.com>
19841
19842         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
19843
19844 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19845
19846         * class.cs (Constructor.Emit): Set the IsStatic flag in the
19847         EmitContext during the instance constructor initializer
19848         resolution, to stop access to instance variables.
19849
19850         This is mandated by the spec, last paragraph of the `constructor
19851         initializers' section. 
19852
19853 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
19854
19855         * cs-parser.jay, class.cs (Accessor): new class used to represent
19856         an accessor (get or set).  In the past we used `null' to represent
19857         a missing accessor.  But this is ambiguous because there was no
19858         way to tell in abstract indexers/properties if one of them was
19859         specified.
19860
19861         Now there is a way of addressing that.
19862
19863         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
19864         instead of FindMembers.
19865
19866         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
19867         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
19868
19869         * attribute.cs: Treat indexers and properties as the same in terms
19870         of applying attributes
19871
19872         * ecore.cs (FindMostEncompassedType): Use statically initialized
19873         EmptyExpressions()s like we do elsewhere to avoid creating useless
19874         objects (and we take this out of the tight loop).
19875
19876         (GetConversionOperators): Move the code to extract the actual
19877         operators to a separate routine to clean things up.
19878
19879 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
19880
19881         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
19882         events are always registered FieldBuilders.
19883
19884         * class.cs (FieldBase): New class shared by Fields 
19885
19886         * delegate.cs: If we are a toplevel delegate, use our full name.
19887         If we are a nested delegate, then only use our tail name.
19888
19889 2002-05-02  Ravi Pratap  <ravi@ximian.com>
19890
19891         * expression.cs (IsApplicable): Ensure that we add the "&" to
19892         ref/out types before comparing it with the type of the argument.
19893
19894         (IsParamsMethodApplicable): Ditto.
19895
19896         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
19897         silly me ;-)
19898
19899         * delegate.cs : Handle the case when we have more than one applicable
19900         method. Flag an error only when we finish checking all.
19901
19902 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
19903
19904         * expression.cs: Add support for boolean static initializers.
19905
19906 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
19907
19908         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
19909
19910         * parameter.cs (ComputeParameterTypes,
19911         ComputeAndDefineParameterTypes): Better error handling: now we
19912         clear the `types' cache if we fail during any of the type lookups.
19913         We also return the status code correctly to our caller
19914
19915         * delegate.cs: If we fail to define a delegate, abort the extra
19916         steps. 
19917
19918         * expression.cs (Binary.ResolveOperator): for
19919         operator==(object,object) and operator !=(object, object) we also
19920         have to verify that there is an implicit conversion from one to
19921         the other.
19922
19923         (ArrayAccess.DoResolve): Array Access can operate on
19924         non-variables. 
19925
19926 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
19927
19928         * assign.cs (CompoundAssign): A new class used as a "flag" that
19929         the assignment actually is happening as part of a compound
19930         assignment operator.
19931
19932         During compound assignment, a few new rules exist to enable things
19933         like:
19934
19935         byte b |= 1 + 2
19936
19937         From the spec:
19938
19939         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
19940         to the type of x) if y is implicitly convertible to the type of x,
19941         and the operator is a builtin operator and the return type of the
19942         operator is explicitly convertible to the type of x. 
19943
19944         * rootcontext.cs: Reset warning level to 2.  4 catches various
19945         "interesting" features in mcs, we must clean this up at some
19946         point, but currently am trying to kill other bugs ;-)
19947
19948         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
19949         in container classes as well.  
19950
19951         * expression.cs (Binary.ResolveOperator): Handle string case
19952         before anything else (as operator overloading does emit an error
19953         before doing anything else).
19954
19955         This code could go away when we move to a table driven model, but
19956         i could not come up with a good plan last night.
19957
19958 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
19959
19960         * typemanager.cs (CSharpName): reimplementation using regex.
19961         * class.cs: added null check for fields in Emit
19962         * rootcontext.cs: set warninglevel to 4
19963
19964 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
19965
19966         * typemanager.cs (CSharpName): reimplemented with Lupus
19967         suggestion.
19968
19969 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
19970
19971         * statement.cs (If): correclty implement Resolve, because we were
19972         not catching sem errors in there.  The same process is needed
19973         everywhere else. 
19974         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
19975
19976
19977         (Statement.Warning_DeadCodeFound): Factorize code.
19978         (While): Report dead code here too.
19979
19980         (Statement): Added Resolve virtual method to allow
19981         for resolution split from the emit code.
19982
19983 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19984
19985         * statement.cs (EmitBoolExpression): No longer try to resolve the
19986         expression here.    
19987         (MakeBoolean): New utility function that resolve, implicitly
19988         converts to boolean and tags the expression. 
19989
19990
19991         (If, Do): Implement dead code elimination.
19992         (While): Implement loop inversion
19993
19994         (Do, While, For, If): Resolve the expression prior to calling our
19995         code generation.
19996
19997 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
19998
19999         * class.cs:
20000           - added method Report28 (warning: program has more than one entry point)
20001           - added method IsEntryPoint, implements paragraph 10.1 of the spec
20002           - modified method Method.Define, the part at the end of the method
20003
20004         * rootcontext.cs: added static public Location EntryPointLocation;
20005           
20006         * ../errors/cs0028.cs : Add test case for the above warning.              
20007
20008         * typemanager.cs:
20009           - modified method CSharpName to allow arrays of primitive type to
20010             be printed nicely (e.g. instead of System.Int32[][] it now prints
20011             int[][])
20012           - added method CSharpSignature: returns the signature of a method
20013             in string format to be used in reporting errors, warnings, etc.
20014
20015         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
20016         with String.Empty.
20017
20018 2002-04-26  Ravi Pratap  <ravi@ximian.com>
20019
20020         * delegate.cs (Define): Fix extremely silly bug where I was
20021         setting the type of the 'object' parameter of the BeginInvoke
20022         method to System.IAsyncResult instead of System.Object ;-)
20023
20024 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
20025
20026         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
20027         here. 
20028
20029         (Constructor.Emit): return if we fail to initialize the
20030         constructor.  Another door closed!  
20031
20032         * expression.cs (New.DoResolve): Improve error message (from -6 to
20033         1501).  Use DeclaredOnly lookup to find the exact constructor.
20034
20035         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
20036         loop.  This is useful.
20037
20038         * cs-parser.jay: Adjust the default parameters so that destructors
20039         have the proper signature.
20040
20041 2002-04-26  Martin Baulig  <martin@gnome.org>
20042
20043         * driver.cs (LoadAssembly): If `assembly' contains any characters
20044         which are only valid in path names and not in assembly names
20045         (currently slash, backslash and point), use Assembly.LoadFrom ()
20046         instead of Assembly.Load () on the `assembly' (before iteration
20047         over the link_paths).
20048
20049 2002-04-26  Martin Baulig  <martin@gnome.org>
20050
20051         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
20052
20053 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
20054
20055         * class.cs (Property): use the new typemanager.MemberLookup
20056
20057         (TypeContainer.MemberLookup): Implement using the
20058         TypeManager.MemberLookup now. 
20059
20060         * typemanager.cs: Make MemberLookup a function of the TypeManager,
20061         and return MemberInfos, so that these can be used without an
20062         EmitContext (what we had before).
20063
20064 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
20065
20066         * expression.cs: Fix the case where the argument to params if the
20067         type of the params.  I omitted handling this before.   Fixed
20068
20069 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
20070
20071         * driver.cs: Call BootCorlib_PopulateCoreType
20072
20073         * class.cs (Property.CheckBase): Check for properties only, not
20074         for all members. 
20075
20076         * interface.cs: Temporary hack: try/catch around the
20077         CustomAttributeBuilder, because I am getting an exception that I
20078         do not understand.
20079
20080         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
20081         types whose definitions are required to be there (attributes are
20082         defined before standard types).
20083
20084         Compute definitions as we boot the various types, as they are used
20085         immediately (value_type class will need object_type, but if we do
20086         not initialize object_type, we will pass a null, which will let
20087         the runtime pick the System.Object from the existing corlib, which
20088         is not what we want).
20089
20090 2002-04-22  Patrik Torstensson <totte@labs2.com>
20091
20092         * cs-tokenizer.cs: fixed a number of trim() issues.
20093
20094 2002-04-22  Ravi Pratap  <ravi@ximian.com>
20095
20096         * expression.cs (Argument.Type): Ensure that we return the correct
20097         type when we have out or ref parameters [in which case we 
20098         append a "&"].
20099
20100 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
20101
20102         * class.cs (Property, Indexer): Allow extern modifier in there. 
20103
20104         * typemanager.cs (InitBaseTypes): Initializes object_type and
20105         value_type, since those will be used early on during the bootstrap
20106         process to compile corlib.
20107
20108         (InitCoreTypes): Move code from here to InitBaseTypes.
20109
20110 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
20111
20112         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
20113         single-dimension arrays as using the ldlen opcode.  
20114
20115         Daniel Lewis discovered this optimization.  
20116
20117         * typemanager.cs: Add signature for System.Array::get_Length
20118
20119 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20120
20121         * statement.cs: report the error when the foreach does not apply to an
20122         array nor a collection.
20123
20124 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
20125
20126         * expression.cs: Add implicit conversions to the operator ~.
20127
20128         * constant.cs (DecimalConstant.Emit): Emit decimal value.
20129
20130         * typemanager.cs: Locate the decimal constructor.
20131
20132 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20133
20134         * attribute.cs: use the new property of TypeOf.
20135         * expression.cs: added 'get' property around typearg.
20136
20137         These changes fix a build breaker reported by NickD. Is this the
20138         correct way to fix?  If not, please, revert my changes and make it
20139         work :-).
20140
20141 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
20142
20143         * attribute.cs: Add support for typeof in attribute invocations.
20144         I am not sure that this is right though.
20145
20146 2002-04-14  Duncan Mak  <duncan@ximian.com>
20147
20148         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
20149         Binary.Operator.Division case.
20150
20151 2002-04-13  Ravi Pratap  <ravi@ximian.com>
20152
20153         * class.cs (DefineType): Ensure that we do a proper check on
20154         attribute types and also register it with the TypeManager.
20155
20156         (TypeContainer.Targets): The default for attribute types is
20157         AttributeTargets.All.
20158
20159         * attribute.cs (ApplyAttributes): Registering the attribute type
20160         is done elsewhere, not when we discover we have a Usage attribute.
20161
20162 2002-04-12  Ravi Pratap  <ravi@ximian.com>
20163
20164         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
20165         and get rid of is_delegate parameter.
20166
20167         * everywhere : update.
20168
20169 2002-04-12  Ravi Pratap  <ravi@ximian.com>
20170
20171         * cs-parser.jay (compilation_unit): Revamp completely to use
20172         some new ideas that I got from Rhys' grammar to solve the problems
20173         with assembly level attributes.
20174
20175         (outer_declaration): New grammar production.
20176
20177         (attribute_sections): Add.
20178
20179         (opt_attributes): Base on attribute_sections
20180
20181         (namespace_declaration): Allow opt_attributes to tackle the case
20182         when we have assembly level attributes - we are clever in this
20183         regard now ;-)
20184
20185         * attribute.cs (ApplyAttributes): Do not worry about assembly 
20186         attributes in the non-global context.
20187
20188         * rootcontext.cs (AddGlobalAttributes): Go back to using this
20189         instead of SetGlobalAttributes.
20190
20191         * class.cs, rootcontext.cs : Ensure we define and generate 
20192         attribute types before anything else.
20193
20194         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
20195         and flag the new error -20 for the case when the attribute type
20196         does not have valid targets specified. csc does not catch this.
20197
20198         * ../errors/errors.txt : update for error # -20
20199
20200 2002-04-11  Ravi Pratap  <ravi@ximian.com>
20201
20202         * support.cs (InternalParameters.ParameterModifier): Do some null
20203         checking and return sane values.
20204
20205         * class.cs (Method.Define): If we are a PInvoke method, ensure
20206         that we are static and extern. Report error # 601
20207
20208         * ../errors/cs0601.cs : Add test case for the above error.
20209
20210 2002-04-07  Ravi Pratap  <ravi@ximian.com>
20211
20212         * rootcontext.cs (attribute_types): We need to keep type of
20213         all attribute types separately and emit code for them first.
20214
20215         (RegisterAttribute) : Implement.
20216
20217         * class.cs (DefineType): Check if the current Type is a custom
20218         attribute type and register it accordingly.
20219
20220         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
20221         adding the first attribute twice and rename to
20222
20223         (SetGlobalAttributes): this.
20224
20225         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
20226         lookups.
20227
20228         * attribute.cs (ApplyAttributes): Take an additional argument telling us
20229         if we are processing global arguments. Hmm, I am unsure of this.
20230
20231 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20232
20233         * expression.cs: added static array of strings to avoid calling
20234         Enum.ToString () for Operator in Binary. Significant recover of
20235         performance.
20236
20237 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
20238
20239         * class.cs (FindMembers): Allow the Builders of the various
20240         members to be null.  If they are skip them.  This only happens
20241         during the PInvoke declaration.
20242
20243 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
20244
20245         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
20246         failure, so we do not keep going afterwards.
20247
20248         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
20249         wanted to pass `false' as the `is_delegate' argument.  If this is
20250         the case, why not use delegate_type == null to mean `is_delegate =
20251         false' and anything else as is_delegate = true.
20252
20253 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
20254
20255         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
20256         code for the section, not the beginning of the tests.
20257
20258 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
20259
20260         * cfold.cs: Handle operator + (Enum x, Underlying x) 
20261
20262         * expression.cs (Binary): same.  Warn about errors where we have
20263         Enum/Enum in operator + as well.
20264
20265 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
20266
20267         * statement.cs:
20268                 - added support for switch(bool)
20269                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
20270                 - add TableSwitchEmit() to handle table-based switch statements
20271
20272 2002-04-05  Ravi Pratap  <ravi@ximian.com>
20273
20274         * expression.cs (Invocation.OverloadResolve): Factor out code which
20275         does parameter compatibility checking with arguments so that we can 
20276         re-use the code even from Delegate.VerifyApplicability
20277
20278         (VerifyArgumentsCompat): Move above code here.
20279
20280         * delegate.cs (VerifyApplicability): Get rid of duplicate code
20281         and instead make a call to the above method.
20282
20283 2002-03-31  Ravi Pratap  <ravi@ximian.com>
20284
20285         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
20286         We use it to keep track of classes which are attribute types.
20287
20288 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
20289
20290         * delegate.cs (Delegate.Define): Correctly define the types in the
20291         presence of fixed and array parameters.
20292
20293         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
20294         doing FindMembers.
20295
20296         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
20297         include NonPublic after the first iteration.
20298
20299         * class.cs (Indexer.CheckBase): Only check if both parents are
20300         non-null. 
20301
20302         * cs-parser.jay (accessor_body): If empty, set to null.
20303
20304         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
20305         same code path here to resolve constants names that we did have in
20306         MemberAccess.DoResolve.  There is too much code duplicated here.
20307
20308 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
20309
20310         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
20311
20312         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
20313         to MakeUnionSet.
20314
20315         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
20316         tokens, numbers and strings.
20317
20318         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
20319         parenthesis.
20320
20321         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
20322         asyncronous parameters and the regular parameters.  
20323
20324         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
20325         specify the target directory.
20326
20327         * expression.cs: (This.DoResolve): Simplify
20328         (As.Emit): Optimize, do not generate IsInst if the expression is
20329         always of the given type.
20330
20331         (Is.DoResolve): Bug fix, we were reporting both always/never for
20332         the is expression.
20333
20334         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
20335         creating too many unnecessary arrays.
20336
20337 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
20338
20339         * class.cs (EmitFieldInitializer): Use Assign expression to assign
20340         fields instead of rolling our own initializer.   Takes care of all
20341         implicit conversions, and drops unnecessary static checks/argument.
20342
20343 2002-03-31  Dick Porter  <dick@ximian.com>
20344
20345         * driver.cs: use the GetDirectories() return values properly, and
20346         use "/" as path separator.
20347
20348 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
20349
20350         * expression.cs (Unary): Optimize - - expr into expr.
20351         (Binary): Optimize a + (-b) into a -b.
20352
20353         * codegen.cs (CodeGen): Made all methods static.
20354
20355 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
20356
20357         * rootcontext.cs: 
20358
20359         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
20360         TypeBuilder property.
20361
20362         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
20363         instead. 
20364
20365         * tree.cs: Removed the various RecordXXXX, and replaced with a
20366         single RecordDecl.  Removed all the accessor methods, and just
20367         left a single access point Type 
20368
20369         * enum.cs: Rename DefineEnum to DefineType.
20370
20371         * decl.cs: New abstract method `DefineType' used to unify the
20372         Defines for Enumerations, Interfaces, TypeContainers and
20373         Delegates.
20374
20375         (FindType): Moved LookupInterfaceOrClass here.  Moved the
20376         LookupBaseClasses method that used to live in class.cs and
20377         interface.cs here, and renamed to FindType.
20378
20379         * delegate.cs: Implement DefineType.  Take advantage of the
20380         refactored pattern for locating the parent builder without taking
20381         the parent_builder argument (which we know does not work if we are
20382         nested, and triggering a toplevel definition).
20383
20384 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20385
20386         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
20387         accessibility of a member has changed during override and report
20388         an error if so.
20389
20390         * class.cs (Method.Define, Property.Define): Only complain on
20391         overrides if the method is private, any other accessibility is
20392         fine (and since we just checked the permission is the same, we are
20393         good to go).
20394
20395         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
20396         and elif are processed always.  The other pre-processing
20397         directives are only processed if we are "taking" the path
20398
20399 2002-03-29  Martin Baulig  <martin@gnome.org>
20400
20401         * class.cs (Method.Emit): Only emit symbolic debugging info if the
20402         current location is not Null.
20403
20404         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
20405         a separate method so we can profile it.
20406
20407         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
20408         `span.Seconds' are just seconds, but no minutes or hours.
20409         (MainDriver): Profile the CodeGen.SaveSymbols calls.
20410
20411 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20412
20413         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
20414         Remove the gratuitous set of Final:
20415
20416                                 // If an interface implementation, then we can set Final.
20417                                 if (((flags & MethodAttributes.Abstract) == 0) &&
20418                                     implementing.DeclaringType.IsInterface)
20419                                         flags |= MethodAttributes.Final;
20420
20421         I do not know what I was smoking when I used that.
20422
20423
20424         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
20425         step into fixing the name resolution issues for delegates and
20426         unifying the toplevel name resolution.
20427
20428 2002-03-28  Martin Baulig  <martin@gnome.org>
20429
20430         * class.cs (Method.Emit): If we have a symbol writer, call its
20431         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
20432         tell it about the current method.
20433
20434         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
20435         writer that we're going to emit the first byte of IL code for a new
20436         statement (a new source line).
20437         (EmitContext.EmitTopBlock): If we have a symbol writer, call
20438         EmitContext.Mark() before emitting any code.
20439
20440         * location.cs (SymbolDocument): Return null when we're Null.
20441
20442         * statement.cs (Statement): Moved the `Location loc' variable here.
20443         (Statement.EmitBoolExpression): If we have a symbol writer, call
20444         ec.Mark() before emitting any code to tell it that we're at the
20445         beginning of a new statement.
20446         (StatementExpression): Added `Location' argument to the constructor.
20447         (Block): Added public readonly variable `StartLocation' and public
20448         variable `EndLocation'.  The latter is to be set using SetEndLocation().
20449         (Block): Added constructor which takes a start and end location.
20450         (Block.SetEndLocation): New method. This sets the end location.
20451         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
20452         local variables we create.
20453         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
20454         each statement and do also mark the begin and end of the block.
20455
20456         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
20457         tell it the current lexer.Location, use Location.Null for the end of the
20458         block.
20459         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
20460         current block, set its end location using SetEndLocation().
20461         (statement_expression): StatementExpression constructor now takes the
20462         lexer.Location as additional argument.
20463         (for_statement, declare_local_variables): Likewise.
20464         (declare_local_variables): When creating a new implicit block, use the
20465         new Block constructor and pass it the lexer.Location.
20466
20467 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20468
20469         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
20470         members also on the parent interfaces recursively.
20471
20472 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
20473
20474         * report.cs: Use new formats, since Gonzalo finished the missing
20475         bits. 
20476
20477         * expression.cs (Binary.ResolveOperator): added missing operator|
20478         operator& and operator^ for bool/bool.
20479
20480         * cs-parser.jay: CheckDef now takes a Location argument that is
20481         used to report errors more precisly (instead of reporting the end
20482         of a definition, we try to track something which is a lot closer
20483         to the source of the problem).
20484
20485         * cs-tokenizer.cs: Track global token use, so we can properly flag
20486         the use of #define/#undef after the first token has been seen.
20487
20488         Also, rename the reportXXXX to Error_DescriptiveName
20489
20490         * decl.cs (DeclSpace.IsTopLevel): Move property here from
20491         TypeContainer, so that Enum and Interface can use this too.
20492
20493         * class.cs (TypeContainer.LookupInterfaceOrClass,
20494         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
20495         `builder' argument.  Typically this was used to pass the parent
20496         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
20497         the definition).  
20498
20499         The problem is that a nested class could trigger the definition of
20500         a toplevel class, and the builder would be obviously wrong in that
20501         case. 
20502
20503         So we drop this argument, and we compute dynamically the
20504         TypeBuilder/ModuleBuilder (the correct information was available
20505         to us anyways from DeclSpace.Parent)
20506
20507         * interface.cs (Interface.DefineInterface): Drop builder
20508         parameter cleanup like class.cs
20509
20510         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
20511         like class.cs
20512
20513         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
20514         values. 
20515
20516         (Try.Emit): Propagate the returns value from the statement.
20517
20518         (Return.Emit): Even if we are leavning 
20519
20520         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
20521
20522         * modifiers.cs: Fix the computation of MethodAttributes flags.
20523
20524 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
20525
20526         * driver.cs: allow compilation of files that start with '/'.
20527         Add a default case when checking the argument of --target.
20528
20529 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
20530
20531         * interface.cs: Implement the same search algorithm for types in
20532         the interface code.
20533
20534         * delegate.cs: Do not allow multiple definition.
20535
20536         * Recovered ChangeLog that got accidentally amputated
20537
20538         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
20539
20540         * rootcontext.cs: Load manually enum to allow core classes to
20541         contain enumerations.
20542
20543         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
20544         Update to new static methods in TypeManager.
20545
20546         * typemanager.cs (GetMethod, GetConstructor): Use our
20547         implementation of FindMembers to find the members, since during
20548         corlib compilation, the types are TypeBuilders and GetMethod and
20549         GetConstructor do not work.
20550
20551         Make all methods in TypeManager static.
20552
20553         (InitCodeHelpers): Split the functionality from
20554         the InitCodeTypes function.
20555
20556         * driver.cs: Call InitCodeHelpers after we have populated the
20557         types. 
20558
20559         * cs-parser.jay (delegate_declaration): we did not used to compute
20560         the delegate name correctly for void delegates.
20561
20562 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
20563
20564         * rootcontext.cs (RootContext): Init the interface_resolve_order
20565         and type_container_resolve_order always.
20566
20567         (ResolveCore, BootstrapCorlib_ResolveClass,
20568         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
20569         compiler when compiling with --nostdlib
20570
20571         * class.cs (TypeContainer.DefineType): Check that our parent is
20572         not null.  This test is most important when we are bootstraping
20573         the core types.
20574
20575         * codegen.cs: Split out the symbol writing code.
20576
20577 2002-03-25  Martin Baulig  <martin@gnome.org>
20578
20579         * driver.cs (-g): Made -g an alias for --debug.
20580
20581 2002-03-24  Martin Baulig  <martin@gnome.org>
20582
20583         * codegen.cs (SymbolWriter): New public variable. Returns the
20584         current symbol writer.
20585         (CodeGen): Added `bool want_debugging_support' argument to the
20586          constructor. If true, tell the ModuleBuild that we want debugging
20587         support and ask it for the ISymbolWriter.
20588         (Save): If we have a symbol writer, call it's Close() method after
20589         saving the assembly.
20590
20591         * driver.c (--debug): New command line argument to create a
20592         debugger information file.
20593
20594         * location.cs (SymbolDocument): New public property. Returns an
20595         ISymbolDocumentWriter object for the current source file or null
20596         if we don't have a symbol writer.
20597
20598 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
20599
20600         * driver.cs (LoadAssembly): Correctly return when all the paths
20601         have been tried and not before.
20602
20603         * statement.cs (Switch.Emit): return the actual coverage for this
20604         statement (returns/not-returns)
20605
20606         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
20607         switch of the statement if we are the last switch section.  That
20608         kills two problems: try/catch problems (we used to emit an empty
20609         nop at the end) and switch statements where all branches would
20610         return. 
20611
20612 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
20613
20614         * driver.cs: Add default assemblies (the equivalent to the
20615         Microsoft CSC.RSP file)
20616
20617         * cs-tokenizer.cs: When updating `cols and setting it to zero,
20618         also update tokens_seen and set it to false.
20619
20620         * driver.cs: Implement --recurse for Mike.
20621
20622         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
20623         correctly splitting out the paths.
20624
20625 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
20626
20627         * interface.cs (Interface.PopulateProperty): Instead of using
20628         `parent' as the declaration space for the set parameters, use
20629         `this' 
20630
20631         * support.cs (InternalParameters): InternalParameters constructor
20632         takes a DeclSpace instead of a TypeContainer.
20633
20634         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
20635         types are being initialized, load the address of it before calling
20636         the function.  
20637
20638         (New): Provide a mechanism to disable the generation of local
20639         value type temporaries when the caller will be providing us with
20640         an address to store it.
20641
20642         (ArrayCreation.EmitDynamicInitializers): Use it.
20643
20644 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
20645
20646         * expression.cs (Invocation.EmitArguments): Only probe for array
20647         property if there is more than one argument.  Sorry about that.
20648
20649         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
20650         empty param arrays.
20651
20652         * class.cs (Method.LabelParameters): Fix incorrect code path that
20653         prevented the `ParamArrayAttribute' from being applied to the
20654         params attribute.
20655
20656 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
20657
20658         * support.cs (ReflectionParameters): Correctly compute whether the
20659         last argument is a params array.  Fixes the problem with
20660         string.Split ('a')
20661
20662         * typemanager.cs: Make the assemblies array always be non-null
20663         (empty, but non-null)
20664
20665         * tree.cs (RecordDecl): New function that abstracts the recording
20666         of names.  This reports error 101, and provides a pointer to the
20667         previous declaration.  Fixes a crash in the compiler.
20668
20669         * cs-parser.jay (constructor_declaration): Update to new grammar,
20670         and provide a constructor_body that can be empty.
20671
20672 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
20673
20674         * driver.cs: Add support for --resources.
20675
20676         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
20677         Make all types for the various array helper methods be integer.
20678
20679         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
20680         CheckState to ConvCast.
20681
20682         (ConvCast): Now it takes a `checked' state argument, to avoid
20683         depending on the emit context for the conversion, and just using
20684         the resolve time setting.
20685
20686         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
20687         instead of Invocation.EmitArguments.  We do not emit the original
20688         arguments, instead we emit those which have been converted to
20689         unsigned int expressions.
20690
20691         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
20692
20693         * codegen.cs: ditto.
20694
20695         * expression.cs (LocalVariableReference): Drop the use of the
20696         Store function that depended on the variable index.
20697
20698         * statement.cs (VariableInfo): Drop the `Idx' property from this
20699         class, as this is not taking into account the indexes for
20700         temporaries tat we generate during the execution, getting the
20701         indexes wrong.
20702
20703         * class.cs: First emit class initializers, then call the parent
20704         constructor. 
20705
20706         * expression.cs (Binary): Fix opcode emision.
20707         (UnaryMutator.EmitCode): Support checked code generation
20708
20709         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
20710         matches for events for both the Static and Instance scans,
20711         pointing to the same element.   Fix that.
20712
20713 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
20714
20715         * rootcontext.cs (ResolveTree): Always set the
20716         interface_resolve_order, because nested interfaces will be calling
20717         into us.
20718
20719         * class.cs (GetInterfaceOrClass): Track the same resolution
20720         process used by TypeManager.LookupType.  This fixes the nested
20721         type lookups in class declarations (separate path from
20722         LookupType). 
20723
20724         (TypeContainer.DefineType): Also define nested interfaces.
20725         (TypeContainer.RegisterOrder): New public function used to
20726         register the order in which child interfaces need to be closed.
20727
20728         Nested interfaces need to be closed after their parents have been
20729         created. 
20730
20731         * interface.cs (InterfaceAttr): Put all the logic for computing
20732         the interface attribute here. 
20733
20734         (DefineInterface): Register our interface order with the
20735         RootContext or with the TypeContainer depending on the case.
20736
20737 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
20738
20739         * cs-parser.jay: rework foreach statement to work with the new
20740         changes to the policy on SimpleNames.
20741
20742         * report.cs: support Stacktrace on warnings as well.
20743
20744         * makefile: drop --unsafe and /unsafe from the compile.
20745
20746 2002-03-13  Ravi Pratap  <ravi@ximian.com>
20747
20748         * ecore.cs (StandardConversionExists): Modify to take an Expression
20749         as the first parameter. Ensure we do null -> reference type conversion
20750         checking.
20751
20752         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
20753         temporary Expression objects.
20754
20755 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
20756
20757         * interface.cs: workaround bug in method overloading resolution
20758         (there is already a bugzilla bug for it).
20759
20760 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
20761
20762         We could also solve this problem by having a separate path for
20763         performing type lookups, instead of DoResolve, we could have a
20764         ResolveType entry point, and only participating pieces of the
20765         production (simplename, deref, array) would implement this. 
20766
20767         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
20768         signal SimpleName to only resolve type names and not attempt to
20769         resolve anything else.
20770
20771         * expression.cs (Cast): Set the flag.
20772
20773         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
20774
20775         * class.cs: Only report 108 if there is no `new' modifier.
20776
20777         * cs-parser.jay: rework foreach statement to work with the new
20778         changes to the policy on SimpleNames.
20779
20780         * report.cs: support Stacktrace on warnings as well.
20781
20782         * makefile: drop --unsafe and /unsafe from the compile.
20783
20784 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
20785
20786         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20787         lookups here, instead of doing that at parse time.  This means
20788         that our grammar will not introduce `LocalVariableReferences' as
20789         expressions at this point.  That solves the problem of code like
20790         this:
20791
20792         class X {
20793            static void Main ()
20794            { int X = 1;
20795             { X x = null }}}
20796
20797         This is only half the fix.  The full fix requires parameters to
20798         also be handled in this way.
20799
20800         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
20801         makes the use more obvious of the DeclSpace.  The
20802         ec.TypeContainer.TypeBuilder is now only used to pull the
20803         TypeBuilder for it.
20804
20805         My theory is that I can get rid of the TypeBuilder completely from
20806         the EmitContext, and have typecasts where it is used (from
20807         DeclSpace to where it matters).  
20808
20809         The only pending problem is that the code that implements Aliases
20810         is on TypeContainer, and probably should go in DeclSpace.
20811
20812         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20813         lookups here, instead of doing that at parse time.  This means
20814         that our grammar will not introduce `LocalVariableReferences' as
20815         expressions at this point.  That solves the problem of code like
20816         this:
20817
20818         class X {
20819            static void Main ()
20820            { int X = 1;
20821             { X x = null }}}
20822
20823         This is only half the fix.  The full fix requires parameters to
20824         also be handled in this way.
20825
20826         * class.cs (Property.DefineMethod): When implementing an interface
20827         method, set newslot, when implementing an abstract method, do not
20828         set the flag (before we tried never setting it, or always setting
20829         it, which is the difference).
20830         (Indexer.DefineMethod): same.
20831         (Method.DefineMethod): same.
20832
20833         * ecore.cs: Only set the status used flag if we get back a Field.
20834
20835         * attribute.cs: Temporary hack, so Paolo can keep working.
20836
20837 2002-03-08  Ravi Pratap  <ravi@ximian.com>
20838
20839         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
20840         the unmanaged type in the case we have a MarshalAs attribute.
20841
20842         (Resolve): Handle the case when we are parsing the special MarshalAs
20843         attribute [we need to store the unmanaged type to use later]
20844
20845         * typemanager.cs (marshal_as_attr_type): Built in type for the 
20846         MarshalAs Attribute.
20847
20848         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
20849         on parameters and accordingly set the marshalling info.
20850
20851 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
20852
20853         * class.cs: Optimizing slightly by removing redundant code after
20854         we switched to the `NoTypes' return value.
20855         (Property.DefineMethod): use NoTypes here too.
20856
20857         This fixes the bug I introduced in my last batch of changes.
20858
20859 2002-03-05  Ravi Pratap  <ravi@ximian.com>
20860
20861         * tree.cs (RecordEnum): Add. We now keep track of enums too.
20862
20863         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
20864         Enums since those are types too. 
20865
20866         * cs-parser.jay (enum_declaration): Record enums as we parse them.
20867
20868         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
20869         thanks to a call during the lookup process.
20870
20871 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
20872
20873         * statement.cs (Foreach): Lots of work to accomodate a particular
20874         kind of foreach statement that I had not kept in mind.  It is
20875         possible to have foreachs on classes that provide a GetEnumerator
20876         method that return objects that implement the "pattern" for using
20877         a foreach, there is no need to support GetEnumerator
20878         specifically. 
20879
20880         This is needed to compile nant.
20881
20882         * decl.cs: Only report 114 if the member is not `Finalize' and if
20883         the warning level is at least 2.
20884
20885         * class.cs: Moved the compare function from Method to
20886         MethodSignature. 
20887
20888         (MethodSignature.InheritableMemberSignatureCompare): Add new
20889         filter function that is used to extract inheritable methods from a
20890         class. 
20891
20892         (Method.Define): Use the new `inheritable_method_signature_filter'
20893         delegate
20894
20895         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
20896         command. 
20897
20898 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
20899
20900         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
20901
20902         * cs-parser.jay: Add opt_semicolon to the interface declaration.
20903
20904         * expression.cs: Pass location information to
20905         ConvertImplicitStandard. 
20906
20907         * class.cs: Added debugging code to track return values from
20908         interfaces. 
20909
20910 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
20911
20912         * expression.cs (Is.DoResolve): If either side of the `is' is an
20913         interface, do not flag the warning.
20914
20915         * ecore.cs (ImplicitReferenceConversion): We need a separate test
20916         for interfaces
20917
20918         * report.cs: Allow for --fatal to be used with --probe.
20919
20920         * typemanager.cs (NoTypes): Move the definition for the empty Type
20921         array here. 
20922
20923         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
20924         properties. 
20925         (TypeContainer.DefineProxy): New function used to proxy to parent
20926         implementations when implementing interfaces.
20927         (TypeContainer.ParentImplements): used to lookup if our parent
20928         implements a public function that is required by an interface.
20929         (TypeContainer.VerifyPendingMethods): Hook this up.
20930
20931         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
20932         `modules' and `assemblies' arraylists into arrays.  We only grow
20933         these are the very early start up of the program, so this improves
20934         the speedof LookupType (nicely measured).
20935
20936         * expression.cs (MakeByteBlob): Replaced unsafe code with
20937         BitConverter, as suggested by Paolo.
20938
20939         * cfold.cs (ConstantFold.Binary): Special case: perform constant
20940         folding of string concatenation, but if either side is a string,
20941         and the other is not, then return null, and let the runtime use
20942         the concatenation on the string plus the object (using
20943         `Object.ToString'). 
20944
20945 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
20946
20947         Constant Folding has been implemented now.
20948
20949         * expression.cs (Unary.Reduce): Do not throw an exception, catch
20950         the error instead on types that are not supported in one's
20951         complement. 
20952
20953         * constant.cs (Constant and all children): New set of functions to
20954         perform implict and explicit conversions.
20955
20956         * ecore.cs (EnumConstant): Implement the new functions to perform
20957         conversion by proxying to the child expression.
20958
20959         * codegen.cs: (ConstantCheckState): Constant evaluation has its
20960         own separate setting that can not be turned off from the command
20961         line using --unchecked or --checked and is only controlled using
20962         the checked/unchecked statements and expressions.  This setting is
20963         used by the constant folder to flag errors.
20964
20965         * expression.cs (CheckedExpr, UncheckedExpr): Set the
20966         ConstantCheckState as well.   
20967
20968         During Resolve, they also have to flag the state, because the
20969         constant folder runs completely in the Resolve phase.
20970
20971         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
20972         well.
20973
20974 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
20975
20976         * cfold.cs: New file, this file contains the constant folder.
20977
20978         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
20979         argument to track whether we are using the resulting address to
20980         load or store a value and provide better error messages. 
20981
20982         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
20983         new AddressOf arguments.
20984
20985         * statement.cs (Foreach.EmitCollectionForeach): Update
20986
20987         * expression.cs (Argument.Emit): Call AddressOf with proper
20988         arguments to track usage.
20989
20990         (New.DoEmit): Call AddressOf with new arguments.
20991
20992         (Unary.Emit): Adjust AddressOf call.
20993
20994 2002-03-01  Ravi Pratap  <ravi@ximian.com>
20995
20996         * cs-parser.jay (member_access): Change the case for pre-defined types
20997         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
20998         this suggestion.
20999
21000         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
21001         a method body.
21002
21003         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
21004         essentially like methods and apply attributes like MethodImplOptions to them too.
21005
21006         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
21007         not being null.
21008
21009         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
21010         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
21011         is the DeclSpace.
21012
21013         * Update code everywhere accordingly.
21014
21015         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
21016
21017         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
21018
21019 2002-02-28  Ravi Pratap  <ravi@ximian.com>
21020
21021         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
21022         try performing lookups against those instead of jumping straight into using
21023         the 'using' clauses.
21024
21025         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
21026
21027         (LookupType): Perform lookups in implicit parents too.
21028
21029         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
21030         sequence as RootContext.LookupType. 
21031
21032         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
21033         the various cases of namespace lookups into this method.
21034
21035 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
21036
21037         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
21038         in positional arguments)
21039
21040         * class.cs (Operator): Update the AllowedModifiers to contain
21041         extern. 
21042
21043         * cs-parser.jay: Update operator declaration to allow for the
21044         operator body to be empty.
21045
21046         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
21047         values. 
21048
21049 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
21050
21051         * class.cs (Method.Emit): Label parameters.
21052
21053         * driver.cs: Return 1 or 0 as the program exit code.
21054
21055 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
21056
21057         * expression.cs: Special case the `null' object when trying to
21058         auto-compute the type, as anything can be explicitly converted to
21059         that. 
21060
21061         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
21062         spotting this Paolo.
21063
21064         (Expression.ImplicitNumericConversion): Perform comparissions of
21065         the type using the underlying type in the case of an enumeration
21066         rather than using the enumeration type for the compare.
21067
21068         Cope with the underlying == type case, which is not possible to
21069         catch before. 
21070
21071         (Expression.ConvertNumericExplicit): Perform comparissions of
21072         the type using the underlying type in the case of an enumeration
21073         rather than using the enumeration type for the compare.
21074
21075         * driver.cs: If the user does not supply an extension, assume .exe
21076
21077         * cs-parser.jay (if_statement): Rewrote so that we can track the
21078         location for the if statement.
21079
21080         * expression.cs (Binary.ConstantFold): Only concat strings when
21081         the operation is "+", not everything ;-)
21082
21083         * statement.cs (Statement.EmitBoolExpression): Take a location
21084         argument. 
21085         (If, While, Do): Track location.
21086
21087         * expression.cs (Binary.ResolveOperator): In the object + string
21088         case, I was missing a call to ConvertImplicit
21089
21090 2002-02-25  Ravi Pratap  <ravi@ximian.com>
21091
21092         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
21093         Location arguments. Ensure we use RootContext.LookupType to do our work
21094         and not try to do a direct Type.GetType and ModuleBuilder.GetType
21095
21096         * interface.cs (PopulateMethod): Handle the type of the parameter being
21097         null gracefully.
21098
21099         * expression.cs (Invocation.BetterFunction): Handle the case when we 
21100         have a params method with no fixed arguments and a call is made with no
21101         arguments.
21102
21103 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
21104
21105         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
21106         the verbatim-string-literal
21107
21108         * support.cs (InternalParameters.ParameterModifier): handle null
21109         fixed parameters.
21110         (InternalParameters.ParameterType): ditto.
21111
21112         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
21113         duplicating the name of the variable parameter.
21114         (GetParameterByName): Fix bug where we were not looking up array
21115         paramters if they were the only present (thanks Paolo!).
21116         (GetParameterInfo): We only have an empty set of types if both
21117         fixed and array are set to null.
21118         (GetParameterInfo-idx): Handle FixedParameter == null
21119
21120         * cs-parser.jay: Handle the case where there is no catch
21121         statements (missing null test).
21122
21123 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
21124
21125         * driver.cs (MainDriver): Be conservative on our command line
21126         handling.
21127
21128         Catch DirectoryNotFoundException when calling GetFiles.
21129
21130         (SplitPathAndPattern): Used to split the input specification into
21131         a path and a pattern that we can feed to Directory.GetFiles.
21132
21133 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
21134
21135         * statement.cs (Fixed): Implement the last case of the Fixed
21136         statement (string handling).
21137
21138         * expression.cs (StringPtr): New class used to return a char * to
21139         a string;  Used by the Fixed statement.
21140
21141         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
21142
21143         * expression.cs (Binary.ResolveOperator): Remove redundant
21144         MemberLookup pn parent type.
21145         Optimize union call, we do not need a union if the types are the same.
21146         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
21147         type.
21148
21149         Specialize the use of MemberLookup everywhere, instead of using
21150         the default settings. 
21151
21152         (StackAlloc): Implement stackalloc keyword.
21153
21154         * cs-parser.jay: Add rule to parse stackalloc.
21155
21156         * driver.cs: Handle /h, /help, /?
21157
21158         * expression.cs (MakeByteBlob): Removed the hacks we had in place
21159         before we supported unsafe code.
21160
21161         * makefile: add --unsafe to the self compilation of mcs.
21162
21163 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
21164
21165         * expression.cs (PointerArithmetic): New class that is used to
21166         perform pointer arithmetic.
21167         (Binary.Resolve): Handle pointer arithmetic
21168         Handle pointer comparission.
21169         (ArrayPtr): Utility expression class that is used to take the
21170         address of an array.
21171
21172         (ElementAccess): Implement array access for pointers
21173
21174         * statement.cs (Fixed): Implement fixed statement for arrays, we
21175         are missing one more case before we are done.
21176
21177         * expression.cs (Indirection): Implement EmitAssign and set the
21178         ExprClass to Variable.  This allows pointer dereferences to be
21179         treated as variables, and to have values assigned to them.
21180
21181         * ecore.cs (Expression.StoreFromPtr): New utility function to
21182         store values dereferencing.
21183
21184 2002-02-20  Ravi Pratap  <ravi@ximian.com>
21185
21186         * expression.cs (Binary.ResolveOperator): Ensure that we are
21187         not trying to operate on a void type - this fixes the reported
21188         bug.
21189
21190         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
21191         the parent implementation is sealed.
21192
21193         * ../errors/cs0239.cs : Add.
21194
21195         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
21196
21197         * typemanager.cs (unverifiable_code_type): Corresponds to 
21198         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
21199         which have unsafe code in them.
21200
21201         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
21202         unsafe context.
21203
21204 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
21205
21206         * cs-tokenizer.cs: Add support for @"litreal strings"
21207
21208         Make tokenizer accept pre-processor directives
21209         on any column (remove the old C-like limitation). 
21210
21211         * rootcontext.cs (EmitCode): Emit any global attributes.
21212         (AddGlobalAttributes): Used to keep track of assembly attributes. 
21213
21214         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
21215
21216         * cs-parser.jay: Add support for global attributes.  
21217
21218 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
21219
21220         * expression.cs (Indirection): New helper class.  Unary will
21221         create Indirection classes to be able to implement the
21222         IMemoryLocation interface on it.
21223
21224 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
21225
21226         * cs-parser.jay (fixed_statement): reference the right statement.
21227
21228         * statement.cs (Fixed.Emit): Finish implementing the fixed
21229         statement for the &x case.
21230
21231 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
21232
21233         * class.cs (Property.Define, Method.Define): Remove newslot when
21234         `implementing'.  
21235
21236         * modifiers.cs: My use of NewSlot when `Abstract' was set was
21237         wrong.  NewSlot should only be used if the `new' keyword is present.
21238
21239         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
21240         locating our system dir.  Sorry about this.
21241
21242 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
21243
21244         * driver.cs (GetSystemDir): Compute correctly the location of our
21245         system assemblies.  I was using the compiler directory instead of
21246         the library directory.
21247
21248 2002-02-13  Ravi Pratap  <ravi@ximian.com>
21249
21250         * expression.cs (BetterFunction): Put back in what Miguel commented out
21251         since it is the correct fix. The problem is elsewhere ;-)
21252
21253         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
21254         parameters of the parms method are themselves compatible or not !
21255
21256         (StandardConversionExists): Fix very dangerous bug where we were forgetting
21257         to check that a class implements an interface before saying that an implicit
21258         conversion was allowed. Use ImplementsInterface to do the checking.
21259
21260 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
21261
21262         * class.cs (Method.Define): Track whether we are an explicit
21263         implementation or not.  And only call DefineMethodOverride if we
21264         are an explicit implementation.
21265
21266         (Property.DefineMethod): Ditto.
21267
21268 2002-02-11  Ravi Pratap  <ravi@ximian.com>
21269
21270         * expression.cs (BetterFunction): Catch hideous bug which was
21271          preventing us from detecting ambiguous calls due to implicit casts i.e
21272         cs0121.
21273
21274 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
21275
21276         * support.cs (Pair): Remove un-needed method.  I figured why I was
21277         getting the error in cs-parser.jay, the variable in a foreach loop
21278         is readonly, and the compiler does not really treat this as a variable.
21279
21280         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
21281         instead of EQUALS in grammar.  
21282
21283         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
21284
21285         * expression.cs (Unary.DoResolve): Check whether the argument is
21286         managed or not.
21287
21288 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
21289
21290         * support.cs: Api for Pair to set a value.  Despite the fact that
21291         the variables are public the MS C# compiler refuses to compile
21292         code that accesses the field if the variable is part of a foreach
21293         statement. 
21294
21295         * statement.cs (Fixed): Begin implementation of the fixed
21296         statement.
21297
21298         (Block.AddVariable): Return the VariableInfo on success and null
21299         on failure instead of true/false. 
21300
21301         * cs-parser.jay (foreach): Catch errors on variables already
21302         defined (we were ignoring this value before) and properly unwind
21303         the block hierarchy
21304
21305         (fixed_statement): grammar for the fixed statement.
21306
21307 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
21308
21309         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
21310         pointer types to be incretemented.
21311
21312         (SizeOf): Implement.
21313
21314         * cs-parser.jay (pointer_member_access): Implement
21315         expr->IDENTIFIER production.
21316
21317         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
21318         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
21319         on safe contexts.
21320
21321         (Unary): Implement indirection.
21322
21323         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
21324         use in non-unsafe context).
21325
21326         (SimpleName.DoResolve): Check for pointers in field access on safe
21327         contexts. 
21328
21329         (Expression.LoadFromPtr): Factor the load-indirect code in this
21330         function.  This was duplicated in UnboxCast and ParameterReference
21331
21332 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
21333
21334         * expression.cs (ComposedCast): report an error if a pointer cast
21335         is used in a safe region.
21336
21337         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
21338         pointer type casts in unsafe context.
21339
21340         * codegen.cs (EmitContext): Set up IsUnsafe.
21341
21342         * cs-parser.jay (non_expression_type): Add productions for pointer
21343         casts. 
21344
21345         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
21346         code.  We should not use force into static mode if the method is
21347         not virtual.  Fixes bug in MIS
21348
21349         * statement.cs (Do.Emit, While.Emit, For.Emit,
21350         Statement.EmitBoolExpression): Add support to Do and While to
21351         propagate infinite loop as `I do return' semantics.
21352
21353         Improve the For case to also test for boolean constants.
21354
21355         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
21356         to the list of attributes we can add.
21357
21358         Remove `EmitContext' argument.
21359
21360         * class.cs (Method.Define): Apply parameter attributes.
21361         (Constructor.Define): Apply parameter attributes.
21362         (MethodCore.LabelParameters): Move here the core of labeling
21363         parameters. 
21364
21365         * support.cs (ReflectionParameters.ParameterModifier,
21366         InternalParameters.ParameterModifier): Use IsByRef on the type and
21367         only return the OUT bit for these parameters instead of in/out/ref
21368         flags.
21369
21370         This is because I miss-understood things.  The ParameterInfo.IsIn
21371         and IsOut represent whether the parameter has the [In] and [Out]
21372         attributes set.  
21373
21374 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
21375
21376         * ecore.cs (FieldExpr.Emit): Release temporaries.
21377
21378         * assign.cs (LocalTemporary.Release): new function.
21379
21380         * codegen.cs (EmitContext.GetTemporaryStorage,
21381         EmitContext.FreeTemporaryStorage): Rework the way we deal with
21382         temporary storage.  Now we can "put back" localbuilders when we
21383         are done with them
21384
21385 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
21386
21387         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
21388         need to make a copy of the variable to generate verifiable code.
21389
21390 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
21391
21392         * driver.cs: Compute dynamically the system directory.
21393
21394         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
21395         Slower, but more generally useful.  Used by the abstract
21396         registering implementation. 
21397
21398         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
21399         the rules for the special rule on Type/instances.  First check if
21400         we have the same name, and if so, try that special static path
21401         rather than the instance path.
21402
21403 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
21404
21405         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
21406         for, while and if.
21407
21408         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
21409         Enum, ValueType, Delegate or Array for non-corlib compiles.
21410
21411         * cs-tokenizer.cs: Catch long identifiers (645)
21412
21413         * typemanager.cs (IndexerPropetyName): Ravi never tested this
21414         piece of code.
21415
21416         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
21417         fix, we were returning too early, so we were not registering
21418         pending methods from abstract classes.
21419
21420         Do not register pending methods if the class is abstract.
21421
21422         * expression.cs (Conditional.DoResolve): Report circular implicit
21423         conversions when we neecd to compute it for conditional
21424         expressions. 
21425
21426         (Is.DoResolve): If the expression is always of the provided type,
21427         flag warning 183.  If the expression can not ever be of the
21428         provided type flag warning 184.
21429
21430         * class.cs: Catch 169 as well.
21431
21432         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
21433         read. 
21434
21435 2002-01-18  Nick Drochak  <ndrochak@gol.com>
21436
21437         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
21438
21439 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
21440
21441         * interface.cs: (PopulateMethod): Check for pointers being defined
21442         only if the unsafe context is active.
21443         (PopulateProperty): ditto.
21444         (PopulateIndexer): ditto.
21445
21446         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
21447         specified.  If pointers are present, make sure that they are
21448         present in an unsafe context.
21449         (Constructor, Constructor.Define): ditto.
21450         (Field, Field.Define): ditto.
21451         (Property, Property.Define): ditto.
21452         (Event, Event.Define): ditto.
21453
21454         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
21455         hashtable if there are classes or structs defined.
21456
21457         * expression.cs (LocalVariableReference.DoResolve): Simplify this
21458         code, as the constant resolution moved.
21459
21460         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
21461         the metadata, so we can flag error 133. 
21462
21463         * decl.cs (MemberCore.UnsafeOK): New function to test that a
21464         pointer is being declared in an unsafe context.
21465
21466 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
21467
21468         * modifiers.cs (Modifiers.Check): Require a Location argument.
21469         Report error 227 for Unsafe use.
21470
21471         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
21472
21473         * statement.cs (For.Emit): If the test is null, then report that
21474         we do `return', as we wont reach anything afterwards.
21475
21476         (Switch.SwitchGoverningType): Track the expression that matched
21477         the conversion.
21478
21479         * driver.cs: Allow negative numbers as an error code to flag.
21480
21481         * cs-parser.jay: Handle 1551.
21482
21483         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
21484
21485 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
21486
21487         * cs-parser.jay: Report 1518 (type declaration can only contain
21488         class, struct, interface, enum or delegate)
21489
21490         (switch_label): Report 1523 (keywords `case' or `default' must
21491         preced code)
21492
21493         (opt_switch_sections): Report 1522 (empty switch)
21494
21495         * driver.cs: Report 1515 (response file specified multiple times)
21496         Report 1516 (Source file specified multiple times).
21497
21498         * expression.cs (Argument.Resolve): Signal 1510
21499
21500         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
21501         access not allowed in static code)
21502
21503 2002-01-11  Ravi Pratap  <ravi@ximian.com>
21504
21505         * typemanager.cs (IsPointerType): Utility method which we are going
21506         to need a lot.
21507
21508         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
21509         the object type, so we take care of that.
21510
21511         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
21512
21513         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
21514         added to non-params parameters :-)
21515
21516         * typemanager.cs (CSharpName): Include 'void' type too. 
21517
21518         (void_ptr_type): Include in the set of core types.
21519
21520         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
21521         duplicating code.
21522
21523         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
21524         an unsafe context.
21525
21526         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
21527         completely forgotten about it.
21528
21529 2002-01-10  Ravi Pratap  <ravi@ximian.com>
21530
21531         * cs-parser.jay (pointer_type): Add. This begins our implementation
21532         of parsing rules for unsafe code.
21533
21534         (unsafe_statement): Implement.
21535
21536         (embedded_statement): Modify to include the above.
21537
21538         * statement.cs (Unsafe): Implement new class for unsafe blocks.
21539
21540         * codegen.cs (EmitContext.InUnsafe): Add. This determines
21541         if the current context is an unsafe one.
21542
21543         * cs-parser.jay (local_variable_pointer_type): Since local variable types
21544         are handled differently, we need separate rules for them.
21545
21546         (local_variable_declaration): Update to use local_variable_pointer_type
21547         to allow variable declarations of unmanaged pointer types.
21548
21549         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
21550         in unsafe contexts.
21551
21552         * ../errors/cs0214.cs : Add.
21553
21554 2002-01-16  Nick Drochak  <ndrochak@gol.com>
21555
21556         * makefile: remove 'response' file when cleaning.
21557
21558 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
21559
21560         * cs-parser.jay: Report 1524.
21561
21562 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
21563
21564         * typemanager.cs (RegisterMethod): drop checking if we have
21565         registered this from here
21566
21567 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
21568
21569         * class.cs (Method.EmitDestructor): Implement calling our base
21570         destructor. 
21571
21572         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
21573         value of InFinally.
21574
21575         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
21576         this routine and will wrap the call in a try/catch block.  Deal
21577         with the case.
21578
21579 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
21580
21581         * ecore.cs (Expression.MemberLookup): instead of taking a
21582         parameter `same_type' that was used to tell whether we could
21583         access private members we compute our containing type from the
21584         EmitContext.
21585
21586         (FieldExpr): Added partial support for volatile fields.  This does
21587         not work for volatile fields exposed from assemblies, as I can not
21588         figure out how to extract the modreq from it.
21589
21590         Updated all the source files to use this.
21591
21592         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
21593         because it is referenced by MemberLookup very often. 
21594
21595 2002-01-09  Ravi Pratap  <ravi@ximian.com>
21596
21597         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
21598         TypeBuilder.GetCustomAttributes to retrieve what we need.
21599
21600         Get rid of redundant default_member_attr_type as this is the same as
21601         default_member_type which already exists.
21602
21603         * interface.cs, attribute.cs : Update accordingly.
21604
21605 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
21606
21607         * typemanager.cs: Enable IndexerPropertyName again.  It does not
21608         work for TYpeBuilders though.  Ravi, can you please fix this?
21609
21610         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
21611
21612         * expression.cs (Argument.Emit): Handle the case of ref objects
21613         being passed to ref functions;  
21614
21615         (ParameterReference.EmitLoad): Loads the content of the pointer
21616         without dereferencing.
21617
21618 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
21619
21620         * cs-tokenizer.cs: Implemented the pre-processing expressions.
21621
21622 2002-01-08  Ravi Pratap  <ravi@ximian.com>
21623
21624         * class.cs (Indexer.DefineMethod): Incorporate the interface
21625         type in the name of the method if we are doing explicit interface
21626         implementation.
21627
21628         * expression.cs (ConversionExists): Remove as it is completely obsolete.
21629
21630         (BetterConversion): Fix extremely trivial bug where we were referring to
21631         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
21632         again !
21633
21634         * ../errors/bug16.cs : Add although we have fixed it.
21635
21636 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
21637
21638         * expression.cs (BaseIndexer): Begin implementation.
21639
21640         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
21641
21642         * cs-parser.jay (indexer_declarator): Use qualified_identifier
21643         production directly to remove a shift/reduce, and implement
21644         explicit interface implementation.
21645
21646         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
21647         after a floating point suffix.
21648
21649         * expression.cs (DoNumericPromotions): Improved the conversion for
21650         uint/uint.  If we have a constant, we avoid doing a typecast to a
21651         larger type.
21652
21653         * class.cs (Indexer): Implement explicit interface implementation
21654         for indexers.
21655
21656 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
21657
21658         * class.cs: make the default instance constructor public and hidebysig.
21659
21660 2001-01-03  Ravi Pratap  <ravi@ximian.com>
21661
21662         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
21663         so we can call it from elsewhere.
21664
21665         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
21666         we emit it internally if the class has a defined indexer; otherwise the user
21667         emits it by decorating the class definition with the DefaultMemberAttribute.
21668
21669         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
21670         attribute is not used on a type which defines an indexer.
21671
21672         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
21673         character when we skip whitespace.
21674
21675         * ../errors/cs0646.cs : Add.
21676
21677 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
21678
21679         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
21680         again. 
21681
21682         * makefile: Add practical target `mcs3.exe' which builds the third
21683         generation compiler. 
21684
21685         * expression.cs (New): Fix structures constructor calling.
21686
21687         * class.cs (Property, Method, Indexer): Emit Final flag on the
21688         method if we are an interface implementation and we are not
21689         abstract. 
21690
21691         * ecore.cs (PropertyExpr): New public field `IsBase', tells
21692         whether this property is referencing a `base' method.
21693
21694         * expression.cs (Invocation.EmitCall): take an extra argument:
21695         is_base, this is used to determine whether the `call' or
21696         `callvirt' opcode should be used.
21697
21698
21699         * delegate.cs: update EmitCall.
21700
21701         * class.cs (Method.Define): Set NewSlot for the cases where we are
21702         not implementing an interface method.
21703
21704         (Property.Define): ditto.
21705
21706 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
21707
21708         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
21709         'r'.  Allows mcs to parse itself fully.
21710
21711 2002-01-02  Ravi Pratap  <ravi@ximian.com>
21712
21713         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
21714         of the number of initializers that require the InitializeArray method.
21715
21716         (CheckIndices): Store the Expression in all cases - not the plain value. Also
21717         update the above field where necessary.
21718
21719         (MakeByteBlob): Update accordingly.
21720
21721         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
21722         greater than 2.
21723
21724         (EmitDynamicInitializers): Update in accordance with the new optimization.
21725
21726         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
21727         same OpCode applies.
21728
21729         * cs-parser.jay : Fix some glaring errors I introduced.
21730
21731 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
21732
21733         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
21734         so that we can check for name clashes there too.
21735
21736         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
21737         for interface indexers.
21738
21739         * interfaces.cs (Define): Emit the default member attribute.
21740
21741         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
21742         variable was being referred to while setting the value ;-)
21743
21744 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
21745
21746         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
21747         byte-by-byte information when we know the data is zero.
21748
21749         Make the block always a multiple of 4, because
21750         DefineInitializedData has a bug.
21751
21752         * assign.cs: Fix, we should assign from the temporary, not from
21753         the source. 
21754
21755         * expression.cs (MakeByteBlob): Fix my incorrect code.
21756
21757 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
21758
21759         * typemanager.cs (EnumToUnderlying): This function is used to get
21760         the underlying type from an enumeration, because it does not
21761         always work. 
21762
21763         * constant.cs: Use the I4_S form for values between -128 and 127.
21764
21765         * statement.cs (Block.LookupLabel): Looks up a label.
21766         (Block): Drop support for labeled blocks.
21767
21768         (LabeledStatement): New kind of statement that represents a label
21769         only.
21770
21771         (Goto): Finally implement this bad boy.
21772
21773         * cs-parser.jay: Update to reflect new mechanism to implement
21774         labels.
21775
21776 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
21777
21778         * codegen.cs (EmitContext.This): a codegen property that keeps the
21779         a single instance of this instead of creating many different this
21780         instances. 
21781
21782         * delegate.cs (Delegate.DoResolve): Update to use the property;
21783
21784         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
21785
21786         * expression.cs (BaseAccess.DoResolve): Ditto.
21787
21788 2001-12-29  Ravi Pratap  <ravi@ximian.com>
21789
21790         * typemanager.cs (methodimpl_attr_type): Add to hold the type
21791         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
21792
21793         (InitCoreTypes): Update accordingly.
21794
21795         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
21796         so we can quickly store the state.
21797
21798         (ApplyAttributes): Set the correct implementation flags
21799         for InternalCall methods.
21800
21801 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
21802
21803         * expression.cs (EmitCall): if a method is not virtual, then do
21804         not use callvirt on it.
21805
21806         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
21807         user defined stuff) requires the use of stobj, which takes an
21808         address on the stack instead of an array and an index.  So emit
21809         the Ldelema operation for it.
21810
21811         (EmitStoreOpcode): Use stobj for valuetypes.
21812
21813         (UnaryMutator.EmitCode): Use the right 1 value depending on
21814         whether we are dealing with int64/uint64, float or doubles.
21815
21816         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
21817         constructors that I implemented last night.
21818
21819         (Constructor.IsDefault): Fix to work properly for static
21820         constructors.
21821
21822         * cs-parser.jay (CheckDef): report method signature errors.
21823         Update error number 103 to be 132.
21824
21825         * decl.cs: New AdditionResult enumeration value: MethodExists.
21826         Although we do this check for methods later on in the semantic
21827         analysis, catching repeated default constructors is so easy that
21828         we catch these here. 
21829
21830         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
21831         promotions code.
21832
21833         (ParameterReference.EmitAssign, Emit): handle
21834         bools as bytes.
21835
21836         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
21837         (ArrayAccess.EmitStoreOpcode): ditto.
21838
21839         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
21840
21841         * expression.cs (MakeByteBlob): Complete all the missing types
21842         (uint, short, ushort, byte, sbyte)
21843
21844         * class.cs: Only init instance field initializers on instance
21845         constructors. 
21846
21847         Rename `constructors' to instance_constructors. 
21848
21849         (TypeContainer.AddConstructor): Only add constructors to the list
21850         if it is not static.
21851
21852         Make sure that we handle default_static_constructor independently
21853         everywhere where we handle instance_constructors
21854
21855 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
21856
21857         * class.cs: Do not lookup or create a base initializer for a
21858         static constructor.
21859
21860         (ConstructorInitializer.Resolve): use the proper type to lookup
21861         for constructors.
21862
21863         * cs-parser.jay: Report error 1585 (modifiers between type and name).
21864
21865         * enum.cs, interface.cs: Remove CloseType, this is taken care by
21866         in DeclSpace. 
21867
21868         * decl.cs: CloseType is now an virtual method, the default
21869         implementation just closes this type.
21870
21871 2001-12-28  Ravi Pratap  <ravi@ximian.com>
21872
21873         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
21874         to PreserveSig by default. Also emit HideBySig on such methods.
21875
21876         Basically, set the defaults to standard values.
21877
21878         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
21879         argument, if candidate is better, it can't be worse than the best !
21880
21881         (Invocation): Re-write bits to differentiate between methods being
21882         applicable in their expanded form and their normal form - for params
21883         methods of course.
21884
21885         Get rid of use_standard everywhere as only standard conversions are allowed
21886         in overload resolution. 
21887
21888         More spec conformance.
21889
21890 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
21891
21892         * driver.cs: Add --timestamp, to see where the compiler spends
21893         most of its time.
21894
21895         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
21896         `this' in static code.
21897
21898         (SimpleName.DoResolve): Implement in terms of a helper function
21899         that allows static-references to be passed upstream to
21900         MemberAccess.
21901
21902         (Expression.ResolveWithSimpleName): Resolve specially simple
21903         names when called by MemberAccess to implement the special
21904         semantics. 
21905
21906         (Expression.ImplicitReferenceConversion): Handle conversions from
21907         Null to reference types before others, as Null's type is
21908         System.Object. 
21909
21910         * expression.cs (Invocation.EmitCall): Handle the special case of
21911         calling methods declared on a reference type from a ValueType
21912         (Base classes System.Object and System.Enum)
21913
21914         (MemberAccess.Resolve): Only perform lookups on Enumerations if
21915         the left hand side is a TypeExpr, not on every enumeration. 
21916
21917         (Binary.Resolve): If types are reference types, then do a cast to
21918         object on operators != and == of both arguments.
21919
21920         * typemanager.cs (FindMembers): Extract instance and static
21921         members if requested.
21922
21923         * interface.cs (PopulateProperty): Use void_type instead of null
21924         as the return type for the setter method.
21925
21926         (PopulateIndexer): ditto.
21927
21928 2001-12-27  Ravi Pratap  <ravi@ximian.com>
21929
21930         * support.cs (ReflectionParameters): Fix minor bug where we
21931         were examining the wrong parameter for the ParamArray attribute.
21932
21933         Cope with requests for the type of the parameter at position
21934         greater than the params parameter's. We now return the element
21935         type of the params array as that makes more sense.
21936
21937         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
21938         accordingly as we no longer have to extract the element type
21939         ourselves.
21940
21941         (Invocation.OverloadResolve): Update.
21942
21943 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
21944
21945         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
21946         against IEnumerator, test whether the return value is a descendant
21947         of the IEnumerator interface.
21948
21949         * class.cs (Indexer.Define): Use an auxiliary method to implement
21950         the other bits of the method definition.  Begin support for
21951         explicit interface implementation.
21952
21953         (Property.DefineMethod): Use TypeManager.void_type instead of null
21954         for an empty return value.
21955
21956 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
21957
21958         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
21959         dealing with a FieldExpr which is composed of a FieldBuilder, in
21960         the code path we did extract the constant, but we should have
21961         obtained the underlying value to be able to cast it (otherwise we
21962         end up in an infinite loop, this is what Ravi was running into).
21963
21964         (ArrayCreation.UpdateIndices): Arrays might be empty.
21965
21966         (MemberAccess.ResolveMemberAccess): Add support for section
21967         14.5.4.1 that deals with the special case of E.I when E is a type
21968         and something else, that I can be a reference to a static member.
21969
21970         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
21971         handle a particular array type to create byte blobs, it is just
21972         something we dont generate byteblobs for.
21973
21974         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
21975         arguments. 
21976
21977         * location.cs (Push): remove the key from the hashtable that we
21978         are about to add.   This happens for empty files.
21979
21980         * driver.cs: Dispose files after we have parsed them.
21981
21982         (tokenize): new function that only runs the tokenizer on its
21983         input, for speed testing.
21984
21985 2001-12-26  Ravi Pratap  <ravi@ximian.com>
21986
21987         * class.cs (Event.Define): Define the private field only if there
21988         are no accessors defined.
21989
21990         * expression.cs (ResolveMemberAccess): If there is no associated
21991         field with the event, that means we have an event defined with its
21992         own accessors and we should flag error cs0070 since transforming
21993         ourselves into a field is not valid in that case.
21994
21995         * ecore.cs (SimpleName.DoResolve): Same as above.
21996
21997         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
21998         and charset to sane values.
21999
22000 2001-12-25  Ravi Pratap  <ravi@ximian.com>
22001
22002         * assign.cs (DoResolve): Perform check on events only if they 
22003         are being accessed outside the declaring type.
22004
22005         * cs-parser.jay (event_declarations): Update rules to correctly
22006         set the type of the implicit parameter etc.
22007
22008         (add_accessor, remove_accessor): Set current local parameters.
22009
22010         * expression.cs (Binary): For delegate addition and subtraction,
22011         cast the return value from the method into the appropriate delegate
22012         type.
22013
22014 2001-12-24  Ravi Pratap  <ravi@ximian.com>
22015
22016         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
22017         of these as the workaround is unnecessary.
22018
22019         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
22020         delegate data - none of that is needed at all.
22021
22022         Re-write bits to extract the instance expression and the delegate method
22023         correctly.
22024
22025         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
22026         on delegates too.
22027
22028         * attribute.cs (ApplyAttributes): New method to take care of common tasks
22029         of attaching attributes instead of duplicating code everywhere.
22030
22031         * everywhere : Update code to do attribute emission using the above method.
22032
22033 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
22034
22035         * expression.cs (IsParamsMethodApplicable): if there are not
22036         parameters, return immediately.
22037
22038         * ecore.cs: The 0 literal can be implicity converted to an enum
22039         type. 
22040
22041         (SimpleName.DoResolve): First lookup the type, then lookup the
22042         members. 
22043
22044         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
22045         want to get its address.  If the InstanceExpression is not
22046         addressable, store the result in a temporary variable, then get
22047         the address of it.
22048
22049         * codegen.cs: Only display 219 errors on warning level or above. 
22050
22051         * expression.cs (ArrayAccess): Make it implement the
22052         IMemoryLocation interface.
22053
22054         (Binary.DoResolve): handle the operator == (object a, object b)
22055         and operator != (object a, object b) without incurring into a
22056         BoxedCast (because 5 != o should never be performed).
22057
22058         Handle binary enumerator operators.
22059
22060         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
22061         value type, otherwise use Ldelem_ref.
22062
22063         Use precomputed names;
22064
22065         (AddressOf): Implement address of
22066
22067         * cs-parser.jay (labeled_statement): Fix recursive block
22068         addition by reworking the production.
22069
22070         * expression.cs (New.DoEmit): New has a special case:
22071                 
22072                  If we are dealing with a ValueType, we have a few
22073                  situations to deal with:
22074                 
22075                     * The target of New is a ValueType variable, that is
22076                       easy, we just pass this as the variable reference
22077                 
22078                     * The target of New is being passed as an argument,
22079                       to a boxing operation or a function that takes a
22080                       ValueType.
22081                 
22082                       In this case, we need to create a temporary variable
22083                       that is the argument of New.
22084
22085
22086 2001-12-23  Ravi Pratap  <ravi@ximian.com>
22087
22088         * rootcontext.cs (LookupType): Check that current_type is not null before
22089         going about looking at nested types.
22090
22091         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
22092         not implement the IAssignMethod interface any more.
22093
22094         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
22095         where we tranform them into FieldExprs if they are being resolved from within
22096         the declaring type.
22097
22098         * ecore.cs (SimpleName.DoResolve): Do the same here.
22099
22100         * assign.cs (DoResolve, Emit): Clean up code considerably. 
22101
22102         * ../errors/bug10.cs : Add.
22103
22104         * ../errors/cs0070.cs : Add.
22105
22106         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
22107
22108         * assign.cs : Get rid of EventIsLocal everywhere.
22109
22110 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
22111
22112         * ecore.cs (ConvertIntLiteral): finished the implementation.
22113
22114         * statement.cs (SwitchLabel): Convert the value we are using as a
22115         key before looking up the table.
22116
22117 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
22118
22119         * codegen.cs (EmitTopBlock): Require a Location argument now.
22120
22121         * cs-parser.jay (constructor_declarator): We need to setup
22122         current_local_parameters before we parse the
22123         opt_constructor_initializer, to allow the variables to be bound
22124         to the constructor arguments.
22125
22126         * rootcontext.cs (LookupType): First lookup nested classes in our
22127         class and our parents before we go looking outside our class.
22128
22129         * expression.cs (ConstantFold): Extract/debox the values at the
22130         beginnning. 
22131
22132         * rootcontext.cs (EmitCode): Resolve the constants first before we
22133         resolve the types.  This is not really needed, but it helps debugging.
22134
22135         * statement.cs: report location.
22136
22137         * cs-parser.jay: pass location to throw statement.
22138
22139         * driver.cs: Small bug fix.
22140
22141         * report.cs: Updated format to be 4-zero filled digits.
22142
22143 2001-12-22  Ravi Pratap  <ravi@ximian.com>
22144
22145         * expression.cs (CheckIndices): Fix minor bug where the wrong
22146         variable was being referred to ;-)
22147
22148         (DoEmit): Do not call EmitStaticInitializers when the 
22149         underlying type is System.Object.
22150
22151 2001-12-21  Ravi Pratap  <ravi@ximian.com>
22152
22153         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
22154         and do the usual workaround for SRE.
22155
22156         * class.cs (MyEventBuilder.EventType): New member to get at the type
22157         of the event, quickly.
22158
22159         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
22160
22161         * assign.cs (Assign.DoResolve): Handle the case when the target
22162         is an EventExpr and perform the necessary checks.
22163
22164         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
22165         interface.
22166
22167         (SimpleName.MemberStaticCheck): Include check for EventExpr.
22168
22169         (EventExpr): Set the type in the constructor itself since we 
22170         are meant to be born fully resolved.
22171
22172         (EventExpr.Define): Revert code I wrote earlier.
22173                 
22174         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
22175         instance expression is null. The instance expression is a This in that case
22176         or a null, depending on whether it is a static method or not.
22177
22178         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
22179         refers to more than one method.
22180
22181         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
22182         and accordingly flag errors.
22183
22184 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
22185
22186         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
22187
22188 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
22189
22190         * location.cs (ToString): Provide useful rutine.
22191
22192 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
22193
22194         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
22195         objects, return the actual integral boxed.
22196
22197         * statement.cs (SwitchLabel): define an ILLabel for each
22198         SwitchLabel. 
22199
22200         (Switch.CheckSwitch): If the value is a Literal, extract
22201         the underlying literal.
22202
22203         Also in the unused hashtable we had, add the SwitchLabel so we can
22204         quickly look this value up.
22205
22206         * constant.cs: Implement a bunch of new constants.  Rewrite
22207         Literal based on this.  Made changes everywhere to adapt to this.
22208
22209         * expression.cs (Expression.MakeByteBlob): Optimize routine by
22210         dereferencing array only once, and also copes with enumrations.
22211
22212         bytes are two bytes wide, not one.
22213
22214         (Cast): Perform constant conversions.
22215
22216         * ecore.cs (TryImplicitIntConversion): Return literals instead of
22217         wrappers to the literals here.
22218
22219         * expression.cs (DoNumericPromotions): long literals can converted
22220         to ulong implicity (this is taken care of elsewhere, but I was
22221         missing this spot).
22222
22223         * ecore.cs (Expression.Literalize): Make the return type Literal,
22224         to improve type checking.
22225
22226         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
22227
22228 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
22229
22230         * literal.cs: Revert code from ravi that checked the bounds.  The
22231         bounds are sane by the definition of the type itself. 
22232
22233         * typemanager.cs: Fix implementation of ImplementsInterface.  We
22234         need to actually look up in our parent hierarchy for interfaces
22235         implemented. 
22236
22237         * const.cs: Use the underlying type for enumerations
22238
22239         * delegate.cs: Compute the basename for the delegate creation,
22240         that should fix the delegate test case, and restore the correct
22241         Type Lookup semantics in rootcontext
22242
22243         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
22244         referencing a nested type with the Reflection API is using the "+"
22245         sign. 
22246
22247         * cs-parser.jay: Do not require EOF token at the end.
22248
22249 2001-12-20  Ravi Pratap  <ravi@ximian.com>
22250
22251         * rootcontext.cs (LookupType): Concatenate type names with
22252         a '.' instead of a '+' The test suite passes again.
22253
22254         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
22255         field of the enumeration.
22256
22257         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
22258         the case when the member is an EventExpr.
22259
22260         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
22261         static has an associated instance expression.
22262
22263         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
22264
22265         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
22266
22267         * class.cs (Event.Define): Register event and perform appropriate checks
22268         for error #111.
22269
22270         We define the Add and Remove methods even if the use provides none because
22271         in that case, we provide default implementations ourselves.
22272
22273         Define a private field of the type of the event. This is done by the CSC compiler
22274         and we should be doing it too ;-)
22275
22276         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
22277         More methods we use in code we generate.
22278
22279         (multicast_delegate_type, delegate_type): Two separate types since the distinction
22280         is important.
22281
22282         (InitCoreTypes): Update accordingly for the above.
22283
22284         * class.cs (Event.Emit): Generate code for default accessors that we provide
22285
22286         (EmitDefaultMethod): Do the job in the above.
22287
22288         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
22289         appropriate place.
22290
22291 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
22292
22293         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
22294         builders even if we were missing one.
22295
22296         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
22297         pass the Basename as our class name instead of the Name.  The
22298         basename will be correctly composed for us.
22299
22300         * parameter.cs (Paramters): Now takes a Location argument.
22301
22302         * decl.cs (DeclSpace.LookupType): Removed convenience function and
22303         make all the code call directly LookupType in RootContext and take
22304         this chance to pass the Location information everywhere.
22305
22306         * Everywhere: pass Location information.
22307
22308 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
22309
22310         * class.cs (Constructor.Define): Updated way of detecting the
22311         length of the parameters.
22312
22313         (TypeContainer.DefineType): Use basename as the type name for
22314         nested types.
22315
22316         (TypeContainer.Define): Do not recursively define types here, as
22317         definition is taken care in order by the RootContext.
22318
22319         * tree.cs: Keep track of namespaces in a per-file basis.
22320
22321         * parameter.cs (Parameter.ComputeSignature): Update to use
22322         DeclSpace. 
22323
22324         (Parameters.GetSignature): ditto.
22325
22326         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
22327         instead of a TypeContainer.
22328
22329         (Interface.SemanticAnalysis): Use `this' instead of our parent to
22330         resolve names.  Because we need to be resolve in our context, not
22331         our parents.
22332
22333         * driver.cs: Implement response files.
22334
22335         * class.cs (TypeContainer.DefineType): If we are defined, do not
22336         redefine ourselves.
22337
22338         (Event.Emit): Emit the code for add/remove handlers.
22339         (Event.Define): Save the MethodBuilders for add/remove.
22340
22341         * typemanager.cs: Use pair here too.
22342
22343         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
22344         DictionaryEntry requires the first argument to be non-null.  
22345
22346         (enum_declaration): Compute full name for registering the
22347         enumeration.
22348
22349         (delegate_declaration): Instead of using
22350         formal_parameter_list, use opt_formal_parameter_list as the list
22351         can be empty.
22352
22353         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
22354         (EventParsing): New property that controls whether `add' and
22355         `remove' are returned as tokens or identifiers (for events);
22356
22357 2001-12-19  Ravi Pratap  <ravi@ximian.com>
22358
22359         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
22360         use MyEventBuilder only and let it wrap the real builder for us.
22361
22362         (MyEventBuilder): Revamp constructor etc.
22363
22364         Implement all operations that we perform on EventBuilder in precisely the same
22365         way here too.
22366
22367         (FindMembers): Update to use the EventBuilder member.
22368
22369         (Event.Emit): Update accordingly.
22370
22371 2001-12-18  Ravi Pratap  <ravi@ximian.com>
22372
22373         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
22374         by calling the appropriate methods.
22375
22376         (GetCustomAttributes): Make stubs as they cannot possibly do anything
22377         useful.
22378
22379         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
22380
22381 2001-12-17  Ravi Pratap  <ravi@ximian.com>
22382
22383         * delegate.cs (Delegate.Populate): Check that the return type
22384         and various parameters types are indeed accessible.
22385
22386         * class.cs (Constructor.Define): Same here.
22387
22388         (Field.Define): Ditto.
22389
22390         (Event.Define): Ditto.
22391
22392         (Operator.Define): Check that the underlying Method defined itself
22393         correctly - so it's MethodBuilder should not be null.
22394
22395         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
22396         expression happens to be null.
22397
22398         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
22399         members but as of now we don't seem to be able to do anything really useful with it.
22400
22401         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
22402         not the EventBuilder.
22403
22404 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
22405
22406         * cs-tokenizer.cs: Add support for defines.
22407         Add support for #if, #elif, #else, #endif
22408
22409         (eval_var): evaluates a variable.
22410         (eval): stubbed for evaluating functions.
22411
22412         * cs-parser.jay: Pass the defines information
22413
22414         * driver.cs: Add --define command line option.
22415
22416         * decl.cs: Move MemberCore here.
22417
22418         Make it the base class for DeclSpace.  This allows us to catch and
22419         report 108 and 109 for everything now.
22420
22421         * class.cs (TypeContainer.Define): Extract all the members
22422         before populating and emit the warning 108 (new keyword required
22423         to override) instead of having each member implement this.
22424
22425         (MemberCore.Define): New abstract method, we will be using this in
22426         the warning reporting engine in Populate.
22427
22428         (Operator.Define): Adjust to new MemberCore protocol. 
22429
22430         * const.cs (Const): This does not derive from Expression, it is a
22431         temporary object we use to create fields, it is a MemberCore. 
22432
22433         * class.cs (Method.Define): Allow the entry point to be in a
22434         specific class.
22435
22436         * driver.cs: Rewrite the argument handler to clean it up a bit.
22437
22438         * rootcontext.cs: Made it just an auxiliary namespace feature by
22439         making everything static.
22440
22441         * driver.cs: Adapt code to use RootContext type name instead of
22442         instance variable.
22443
22444         * delegate.cs: Remove RootContext argument.
22445
22446         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
22447         argument. 
22448
22449         * class.cs (Event.Define): The lookup can fail.
22450
22451         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
22452
22453         * expression.cs: Resolve the this instance before invoking the code.
22454
22455 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
22456
22457         * cs-parser.jay: Add a production in element_access that allows
22458         the thing to become a "type" reference.  This way we can parse
22459         things like "(string [])" as a type.
22460
22461         Note that this still does not handle the more complex rules of
22462         casts. 
22463
22464
22465         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
22466
22467         * ecore.cs: (CopyNewMethods): new utility function used to
22468         assemble the list of methods from running FindMembers.
22469
22470         (MemberLookup): Rework FindMembers so that 
22471
22472 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
22473
22474         * class.cs (TypeContainer): Remove Delegates who fail to be
22475         defined.
22476
22477         * delegate.cs (Populate): Verify that we dont get null return
22478         values.   TODO: Check for AsAccessible.
22479
22480         * cs-parser.jay: Use basename to emit error 574 (destructor should
22481         have the same name as container class), not the full name.
22482
22483         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
22484         possible representation.  
22485
22486         Also implements integer type suffixes U and L.
22487
22488 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
22489
22490         * expression.cs (ArrayCreation.DoResolve): We need to do the
22491         argument resolution *always*.
22492
22493         * decl.cs: Make this hold the namespace.  Hold the root context as
22494         well.
22495         (LookupType): Move here.
22496
22497         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
22498
22499         * location.cs (Row, Name): Fixed the code, it was always returning
22500         references to the first file.
22501
22502         * interface.cs: Register properties defined through interfaces.
22503
22504         * driver.cs: Add support for globbing on the command line
22505
22506         * class.cs (Field): Make it derive from MemberCore as well.
22507         (Event): ditto.
22508
22509 2001-12-15  Ravi Pratap  <ravi@ximian.com>
22510
22511         * class.cs (Event::Define): Check that the type of the event is a delegate
22512         type else flag error #66.
22513
22514         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
22515         same.
22516
22517         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
22518         values of EntryPoint, CharSet etc etc.
22519
22520         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
22521
22522         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
22523         be null and we should ignore this. I am not sure if this is really clean. Apparently,
22524         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
22525         which needs this to do its work.
22526
22527         * ../errors/cs0066.cs : Add.
22528
22529 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
22530
22531         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
22532         helper functions.
22533
22534         * class.cs: (MethodSignature.MethodSignature): Removed hack that
22535         clears out the parameters field.
22536         (MemberSignatureCompare): Cleanup
22537
22538         (MemberCore): New base class used to share code between MethodCore
22539         and Property.
22540
22541         (RegisterRequiredImplementations) BindingFlags.Public requires
22542         either BindingFlags.Instace or Static.  Use instance here.
22543
22544         (Property): Refactored code to cope better with the full spec.
22545
22546         * parameter.cs (GetParameterInfo): Return an empty array instead
22547         of null on error.
22548
22549         * class.cs (Property): Abstract or extern properties have no bodies.
22550
22551         * parameter.cs (GetParameterInfo): return a zero-sized array.
22552
22553         * class.cs (TypeContainer.MethodModifiersValid): Move all the
22554         method modifier validation to the typecontainer so we can reuse
22555         this on properties.
22556
22557         (MethodCore.ParameterTypes): return an empty sized array of types.
22558
22559         (Property.Define): Test property modifier validity.
22560
22561         Add tests for sealed/override too.
22562
22563         (Method.Emit): abstract or extern methods have no bodies.
22564
22565 2001-12-14  Ravi Pratap  <ravi@ximian.com>
22566
22567         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
22568         thing.
22569
22570         (Method::Define, ::Emit): Modify accordingly.
22571
22572         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
22573
22574         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
22575
22576         * makefile: Pass in /unsafe.
22577
22578 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
22579
22580         * class.cs (MakeKey): Kill routine.
22581
22582         * class.cs (TypeContainer.Define): Correctly define explicit
22583         method implementations (they require the full interface name plus
22584         the method name).
22585
22586         * typemanager.cs: Deply the PtrHashtable here and stop using the
22587         lame keys.  Things work so much better.
22588
22589         This of course broke everyone who depended on `RegisterMethod' to
22590         do the `test for existance' test.  This has to be done elsewhere.
22591
22592         * support.cs (PtrHashtable): A hashtable that avoid comparing with
22593         the object stupid Equals method (because, that like fails all over
22594         the place).  We still do not use it.
22595
22596         * class.cs (TypeContainer.SetRequiredInterface,
22597         TypeContainer.RequireMethods): Killed these two routines and moved
22598         all the functionality to RegisterRequiredImplementations.
22599
22600         (TypeContainer.RegisterRequiredImplementations): This routine now
22601         registers all the implementations required in an array for the
22602         interfaces and abstract methods.  We use an array of structures
22603         which can be computed ahead of time to reduce memory usage and we
22604         also assume that lookups are cheap as most classes will not
22605         implement too many interfaces.
22606
22607         We also avoid creating too many MethodSignatures.
22608
22609         (TypeContainer.IsInterfaceMethod): Update and optionally does not
22610         clear the "pending" bit if we find that there are problems with
22611         the declaration.
22612
22613         (TypeContainer.VerifyPendingMethods): Update to report errors of
22614         methods that look like implementations but are not.
22615
22616         (TypeContainer.Define): Add support for explicit interface method
22617         implementation. 
22618
22619 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
22620
22621         * typemanager.cs: Keep track of the parameters here instead of
22622         being a feature of the TypeContainer.
22623
22624         * class.cs: Drop the registration of parameters here, as
22625         InterfaceMethods are also interface declarations.
22626
22627         * delegate.cs: Register methods with the TypeManager not only with
22628         the TypeContainer.  This code was buggy.
22629
22630         * interface.cs: Full registation here.
22631
22632 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
22633
22634         * expression.cs: Remove reducer for binary expressions, it can not
22635         be done this way.
22636
22637         * const.cs: Put here the code that used to go into constant.cs
22638
22639         * constant.cs: Put here the code for constants, this is a new base
22640         class for Literals.
22641
22642         * literal.cs: Make Literal derive from Constant.
22643
22644 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
22645
22646         * statement.cs (Return.Emit): Report error 157 if the user
22647         attempts to return from a finally block.
22648
22649         (Return.Emit): Instead of emitting a return, jump to the end of
22650         the function.
22651
22652         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
22653         LocalBuilder to store the result of the function.  ReturnLabel is
22654         the target where we jump.
22655
22656
22657 2001-12-09  Radek Doulik  <rodo@ximian.com>
22658
22659         * cs-parser.jay: remember alias in current namespace
22660
22661         * ecore.cs (SimpleName::DoResolve): use aliases for types or
22662         namespaces
22663
22664         * class.cs (LookupAlias): lookup alias in my_namespace
22665
22666         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
22667         aliases hashtable
22668         (LookupAlias): lookup alias in this and if needed in parent
22669         namespaces
22670
22671 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
22672
22673         * support.cs: 
22674
22675         * rootcontext.cs: (ModuleBuilder) Made static, first step into
22676         making things static.  I need this to avoid passing the
22677         TypeContainer when calling ParameterType.
22678
22679         * support.cs (InternalParameters.ParameterType): Remove ugly hack
22680         that did string manipulation to compute the type and then call
22681         GetType.  Use Parameter.ParameterType instead.
22682
22683         * cs-tokenizer.cs: Consume the suffix for floating values.
22684
22685         * expression.cs (ParameterReference): figure out whether this is a
22686         reference parameter or not.  Kill an extra variable by computing
22687         the arg_idx during emission.
22688
22689         * parameter.cs (Parameters.GetParameterInfo): New overloaded
22690         function that returns whether a parameter is an out/ref value or not.
22691
22692         (Parameter.ParameterType): The type of the parameter (base,
22693         without ref/out applied).
22694
22695         (Parameter.Resolve): Perform resolution here.
22696         (Parameter.ExternalType): The full type (with ref/out applied).
22697
22698         * statement.cs (Using.Emit, Using.EmitExpression): Implement
22699         support for expressions on the using statement.
22700
22701 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
22702
22703         * statement.cs (Using.EmitLocalVariableDecls): Split the
22704         localvariable handling of the using statement.
22705
22706         (Block.EmitMeta): Keep track of variable count across blocks.  We
22707         were reusing slots on separate branches of blocks.
22708
22709         (Try.Emit): Emit the general code block, we were not emitting it. 
22710
22711         Check the type of the declaration to be an IDisposable or
22712         something that can be implicity converted to it. 
22713
22714         Emit conversions if required.
22715
22716         * ecore.cs (EmptyExpression): New utility class.
22717         (Expression.ImplicitConversionExists): New utility function.
22718
22719 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
22720
22721         * statement.cs (Using): Implement.
22722
22723         * expression.cs (LocalVariableReference): Support read only variables.
22724
22725         * statement.cs: Remove the explicit emit for the Leave opcode.
22726         (VariableInfo): Add a readonly field.
22727
22728 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
22729
22730         * ecore.cs (ConvCast): new class used to encapsulate the various
22731         explicit integer conversions that works in both checked and
22732         unchecked contexts.
22733
22734         (Expression.ConvertNumericExplicit): Use new ConvCast class to
22735         properly generate the overflow opcodes.
22736
22737 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
22738
22739         * statement.cs: The correct type for the EmptyExpression is the
22740         element_type, not the variable type.  Ravi pointed this out.
22741
22742 2001-12-04  Ravi Pratap  <ravi@ximian.com>
22743
22744         * class.cs (Method::Define): Handle PInvoke methods specially
22745         by using DefinePInvokeMethod instead of the usual one.
22746
22747         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
22748         above to do the task of extracting information and defining the method.
22749
22750 2001-12-04  Ravi Pratap  <ravi@ximian.com>
22751
22752         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
22753         of the condition for string type.
22754
22755         (Emit): Move that here. 
22756
22757         (ArrayCreation::CheckIndices): Keep string literals in their expression
22758         form.
22759
22760         (EmitDynamicInitializers): Handle strings appropriately.
22761
22762 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
22763
22764         * codegen.cs (EmitContext): Replace multiple variables with a
22765         single pointer to the current Switch statement.
22766
22767         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
22768         EmitContext.
22769
22770 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
22771
22772         * statement.cs 
22773
22774         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
22775         default'.
22776
22777         (Foreach.Emit): Foreach on arrays was not setting
22778         up the loop variables (for break/continue).
22779
22780         (GotoCase): Semi-implented.
22781
22782 2001-12-03  Ravi Pratap  <ravi@ximian.com>
22783
22784         * attribute.cs (CheckAttribute): Handle system attributes by using
22785         Attribute.GetAttributes to examine information we need.
22786
22787         (GetValidPlaces): Same here.
22788
22789         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
22790
22791         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
22792
22793         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
22794
22795         (Method::Define): Set appropriate flags if we have a DllImport attribute.
22796
22797         (Method::Emit): Handle the case when we are a PInvoke method.
22798
22799 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
22800
22801         * expression.cs: Use ResolveWithSimpleName on compound names.
22802
22803 2001-12-02  Ravi Pratap  <ravi@ximian.com>
22804
22805         * constant.cs (EmitConstant): Make sure we resolve the associated expression
22806         before trying to reduce it.
22807
22808         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
22809
22810         * constant.cs (LookupConstantValue): Implement.
22811
22812         (EmitConstant): Use the above in emitting the constant.
22813
22814         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
22815         that are user-defined by doing a LookupConstantValue on them.
22816
22817         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
22818         too, like above.
22819
22820 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
22821
22822         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
22823
22824         (BaseAccess.DoResolve): Implement.
22825
22826         (MemberAccess.DoResolve): Split this routine into a
22827         ResolveMemberAccess routine that can be used independently
22828
22829 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
22830
22831         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
22832         As that share bits of the implementation.  Is returns a boolean,
22833         while As returns the Type that is being probed.
22834
22835 2001-12-01  Ravi Pratap  <ravi@ximian.com>
22836
22837         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
22838         instead of a Literal - much easier.
22839
22840         (EnumInTransit): Remove - utterly useless :-)
22841
22842         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
22843
22844         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
22845
22846         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
22847         chain when we have no associated expression.
22848
22849 2001-11-30  Ravi Pratap  <ravi@ximian.com>
22850
22851         * constant.cs (Define): Use Location while reporting the errror.
22852
22853         Also emit a warning when 'new' is used and there is no inherited
22854         member to hide.
22855
22856         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
22857         populated.
22858
22859         (LookupEnumValue): Implement to lookup an enum member's value and define it
22860         if necessary.
22861
22862         (Populate): Re-write accordingly to use the above routine.
22863
22864 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
22865
22866         * expression.cs (This): Fix prototype for DoResolveLValue to
22867         override the base class DoResolveLValue.
22868
22869         * cs-parser.cs: Report errors cs574 and cs575 (destructor
22870         declarations) 
22871
22872         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
22873         (we need to load the address of the field here).  This fixes
22874         test-22. 
22875
22876         (FieldExpr.DoResolveLValue): Call the DoResolve
22877         function to initialize the Instance expression.
22878
22879         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
22880         correctly the GetEnumerator operation on a value type.
22881
22882         * cs-parser.jay: Add more simple parsing error catches.
22883
22884         * statement.cs (Switch): Add support for string switches.
22885         Handle null specially.
22886
22887         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
22888
22889 2001-11-28  Ravi Pratap  <ravi@ximian.com>
22890
22891         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
22892
22893         (declare_local_constant): New helper function.
22894
22895         * statement.cs (AddConstant): Keep a separate record of constants
22896
22897         (IsConstant): Implement to determine if a variable is a constant.
22898
22899         (GetConstantExpression): Implement.
22900
22901         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
22902
22903         * statement.cs (IsVariableDefined): Re-write.
22904
22905 2001-11-27  Ravi Pratap  <ravi@ximian.com>
22906
22907         * class.cs (TypeContainer::FindMembers): Look for constants
22908         in the case when we are looking for MemberTypes.Field
22909
22910         * expression.cs (MemberAccess::DoResolve): Check that in the
22911         case we are a FieldExpr and a Literal, we are not being accessed
22912         by an instance reference.
22913
22914         * cs-parser.jay (local_constant_declaration): Implement.
22915
22916         (declaration_statement): Implement for constant declarations.
22917
22918 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
22919
22920         * statement.cs (Switch): Catch double defaults.
22921
22922         (Switch): More work on the switch() statement
22923         implementation.  It works for integral values now, need to finish
22924         string support.
22925
22926
22927 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
22928
22929         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
22930         integer literals into other integer literals.  To be used by
22931         switch. 
22932
22933 2001-11-24  Ravi Pratap  <ravi@ximian.com>
22934
22935         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
22936         some memory.
22937
22938         (EmitDynamicInitializers): Cope with the above since we extract data
22939         directly from ArrayData now.
22940
22941         (ExpectInitializers): Keep track of whether initializers are mandatory
22942         or not.
22943
22944         (Bounds): Make it a hashtable to prevent the same dimension being 
22945         recorded for every element in that dimension.
22946
22947         (EmitDynamicInitializers): Fix bug which prevented the Set array method
22948         from being found.
22949
22950         Also fix bug which was causing the indices to be emitted in the reverse
22951         order.
22952
22953 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
22954
22955         * expression.cs (ArrayCreation): Implement the bits that Ravi left
22956         unfinished.  They do not work, because the underlying code is
22957         sloppy.
22958
22959 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22960
22961         * cs-parser.jay: Remove bogus fixme.
22962
22963         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
22964         on Switch statement.
22965
22966 2001-11-23  Ravi Pratap  <ravi@ximian.com>
22967
22968         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
22969         the same. 
22970
22971         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
22972         parameter. Apparently, any expression is allowed. 
22973
22974         (ValidateInitializers): Update accordingly.
22975
22976         (CheckIndices): Fix some tricky bugs thanks to recursion.
22977
22978         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
22979         I was being completely brain-dead.
22980
22981         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
22982         and re-write acordingly.
22983
22984         (DelegateInvocation): Re-write accordingly.
22985
22986         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
22987
22988         (MakeByteBlob): Handle types more correctly.
22989
22990         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
22991         initialization from expressions but it is incomplete because I am a complete
22992         Dodo :-|
22993
22994 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22995
22996         * statement.cs (If.Emit): Fix a bug that generated incorrect code
22997         on If.  Basically, we have to return `true' (ie, we do return to
22998         our caller) only if both branches of the if return.
22999
23000         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
23001         short-circuit operators, handle them as short circuit operators. 
23002
23003         (Cast.DoResolve): Resolve type.
23004         (Cast.Cast): Take an expression as the target type.
23005
23006         * cs-parser.jay (cast_expression): Remove old hack that only
23007         allowed a limited set of types to be handled.  Now we take a
23008         unary_expression and we resolve to a type during semantic
23009         analysis.
23010
23011         Use the grammar productions from Rhys to handle casts (this is
23012         not complete like Rhys syntax yet, we fail to handle that corner
23013         case that C# has regarding (-x), but we will get there.
23014
23015 2001-11-22  Ravi Pratap  <ravi@ximian.com>
23016
23017         * class.cs (EmitFieldInitializer): Take care of the case when we have a
23018         field which is an array type.
23019
23020         * cs-parser.jay (declare_local_variables): Support array initialization too.
23021
23022         * typemanager.cs (MakeKey): Implement.
23023
23024         (everywhere): Use the above appropriately.
23025
23026         * cs-parser.jay (for_statement): Update for array initialization while
23027         declaring variables.
23028
23029         * ecore.cs : The error message was correct, it's the variable's names that
23030         were misleading ;-) Make the code more readable.
23031
23032         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
23033         the correct type etc.
23034
23035         (ConvertExplicit): Handle Enum types by examining the underlying type.
23036
23037 2001-11-21  Ravi Pratap  <ravi@ximian.com>
23038
23039         * parameter.cs (GetCallingConvention): Always return
23040         CallingConventions.Standard for now.
23041
23042 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23043
23044         * expression.cs (Binary.ResolveOperator): Update the values of `l'
23045         and `r' after calling DoNumericPromotions.
23046
23047         * ecore.cs: Fix error message (the types were in the wrong order).
23048
23049         * statement.cs (Foreach.ProbeCollectionType): Need to pass
23050         BindingFlags.Instance as well 
23051
23052         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
23053         implicit int literal conversion in an empty cast so that we
23054         propagate the right type upstream.
23055
23056         (UnboxCast): new class used to unbox value types.
23057         (Expression.ConvertExplicit): Add explicit type conversions done
23058         by unboxing.
23059
23060         (Expression.ImplicitNumericConversion): Oops, forgot to test for
23061         the target type before applying the implicit LongLiterals to ULong
23062         literal cast.
23063
23064 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
23065
23066         * cs-parser.jay (for_statement): Reworked the way For works: now
23067         we declare manually any variables that are introduced in
23068         for_initializer to solve the problem of having out-of-band code
23069         emition (that is what got for broken).
23070
23071         (declaration_statement): Perform the actual variable declaration
23072         that used to be done in local_variable_declaration here.
23073
23074         (local_variable_declaration): Do not declare anything, just pass
23075         the information on a DictionaryEntry
23076
23077 2001-11-20  Ravi Pratap  <ravi@ximian.com>
23078
23079         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
23080         re-write of the logic to now make it recursive.
23081
23082         (UpdateIndices): Re-write accordingly.
23083
23084         Store element data in a separate ArrayData list in the above methods.
23085
23086         (MakeByteBlob): Implement to dump the array data into a byte array.
23087
23088 2001-11-19  Ravi Pratap  <ravi@ximian.com>
23089
23090         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
23091         into CheckIndices.
23092
23093         * constant.cs (Define): Implement.
23094
23095         (EmitConstant): Re-write fully.
23096
23097         Pass in location info.
23098
23099         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
23100         respectively.
23101
23102         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
23103         DictionaryEntry since we need location info too.
23104
23105         (constant_declaration): Update accordingly.
23106
23107         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
23108         code into another method : UpdateIndices.
23109
23110 2001-11-18  Ravi Pratap  <ravi@ximian.com>
23111
23112         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
23113         some type checking etc.
23114
23115 2001-11-17  Ravi Pratap  <ravi@ximian.com>
23116
23117         * expression.cs (ArrayCreation::ValidateInitializers): Implement
23118         bits to provide dimension info if the user skips doing that.
23119
23120         Update second constructor to store the rank correctly.
23121
23122 2001-11-16  Ravi Pratap  <ravi@ximian.com>
23123
23124         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
23125         and try to implement.
23126
23127         * ../errors/cs0150.cs : Add.
23128
23129         * ../errors/cs0178.cs : Add.
23130
23131 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
23132
23133         * statement.cs: Implement foreach on multi-dimensional arrays. 
23134
23135         * parameter.cs (Parameters.GetParameterByName): Also lookup the
23136         name of the params argument.
23137
23138         * expression.cs: Use EmitStoreOpcode to get the right opcode while
23139         initializing the array.
23140
23141         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
23142         we can use this elsewhere.
23143
23144         * statement.cs: Finish implementation of foreach for single
23145         dimension arrays.
23146
23147         * cs-parser.jay: Use an out-of-band stack to pass information
23148         around, I wonder why I need this.
23149
23150         foreach_block: Make the new foreach_block the current_block.
23151
23152         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
23153         function used to return a static Parameters structure.  Used for
23154         empty parameters, as those are created very frequently.
23155
23156         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
23157
23158 2001-11-15  Ravi Pratap  <ravi@ximian.com>
23159
23160         * interface.cs : Default modifier is private, not public. The
23161         make verify test passes again.
23162
23163 2001-11-15  Ravi Pratap  <ravi@ximian.com>
23164
23165         * support.cs (ReflectionParameters): Fix logic to determine
23166         whether the last parameter is a params one. Test 9 passes again.
23167
23168         * delegate.cs (Populate): Register the builders we define with
23169         RegisterParameterForBuilder. Test 19 passes again.
23170
23171         * cs-parser.jay (property_declaration): Reference $6 instead
23172         of $$ to get at the location.
23173
23174         (indexer_declaration): Similar stuff.
23175
23176         (attribute): Ditto.
23177
23178         * class.cs (Property): Register parameters for the Get and Set methods
23179         if they exist. Test 23 passes again.
23180
23181         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
23182         call to EmitArguments as we are sure there aren't any params arguments. 
23183         Test 32 passes again.
23184
23185         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
23186         IndexOutOfRangeException. 
23187
23188         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
23189         Test 33 now passes again.
23190
23191 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
23192
23193         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
23194         broke a bunch of things.  Will have to come up with a better way
23195         of tracking locations.
23196
23197         * statement.cs: Implemented foreach for single dimension arrays.
23198
23199 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
23200
23201         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
23202         an error.  This removes the lookup from the critical path.
23203
23204         * cs-parser.jay: Removed use of temporary_loc, which is completely
23205         broken. 
23206
23207 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
23208
23209         * support.cs (ReflectionParameters.ParameterModifier): Report
23210         whether the argument is a PARAMS argument or not.
23211
23212         * class.cs: Set the attribute `ParamArrayAttribute' on the
23213         parameter argument.
23214
23215         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
23216         and cons_param_array_attribute (ConstructorInfo for
23217         ParamArrayAttribute)., 
23218
23219         * codegen.cs: Emit the return using the `Return' statement, that
23220         way we can report the error correctly for missing return values. 
23221
23222         * class.cs (Method.Emit): Clean up.
23223
23224         * expression.cs (Argument.Resolve): Take another argument: the
23225         location where this argument is used.  Notice that this is not
23226         part of the "Argument" class as to reduce the size of the
23227         structure (we know the approximate location anyways).
23228
23229         Test if the argument is a variable-reference, if not, then
23230         complain with a 206.
23231
23232         (Argument.Emit): Emit addresses of variables.
23233
23234         (Argument.FullDesc): Simplify.
23235
23236         (Invocation.DoResolve): Update for Argument.Resolve.
23237
23238         (ElementAccess.DoResolve): ditto.
23239
23240         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
23241         method should be virtual, as this method is always virtual.
23242
23243         (NewDelegate.DoResolve): Update for Argument.Resolve.
23244
23245         * class.cs (ConstructorInitializer.DoResolve): ditto.
23246
23247         * attribute.cs (Attribute.Resolve): ditto.
23248
23249 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
23250
23251         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
23252
23253         * expression.cs (ParameterReference): Drop IStackStorage and implement
23254         IAssignMethod instead. 
23255
23256         (LocalVariableReference): ditto.
23257
23258         * ecore.cs (FieldExpr): Drop IStackStorage and implement
23259         IAssignMethod instead. 
23260
23261 2001-11-13  Miguel de Icaza <miguel@ximian.com>
23262
23263         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
23264         enumerations that are used in heavily used structures derive from
23265         byte in a laughable and pathetic attempt to reduce memory usage.
23266         This is the kind of pre-optimzations that you should not do at
23267         home without adult supervision.
23268
23269         * expression.cs (UnaryMutator): New class, used to handle ++ and
23270         -- separatedly from the other unary operators.  Cleans up the
23271         code, and kills the ExpressionStatement dependency in Unary.
23272
23273         (Unary): Removed `method' and `Arguments' from this class, making
23274         it smaller, and moving it all to SimpleCall, so I can reuse this
23275         code in other locations and avoid creating a lot of transient data
23276         strucutres when not required.
23277
23278         * cs-parser.jay: Adjust for new changes.
23279
23280 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
23281
23282         * enum.cs (Enum.Populate): If there is a failure during
23283         definition, return
23284
23285         * cs-parser.jay (opt_enum_base): we used to catch type errors
23286         here, but this is really incorrect.  The type error should be
23287         catched during semantic analysis.
23288
23289 2001-12-11  Ravi Pratap  <ravi@ximian.com>
23290
23291         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
23292         current_local_parameters as expected since I, in my stupidity, had forgotten
23293         to do this :-)
23294
23295         * attribute.cs (GetValidPlaces): Fix stupid bug.
23296
23297         * class.cs (Method::Emit): Perform check on applicability of attributes.
23298
23299         (Constructor::Emit): Ditto.
23300
23301         (Field::Emit): Ditto.
23302
23303         (Field.Location): Store location information.
23304
23305         (Property, Event, Indexer, Operator): Ditto.
23306
23307         * cs-parser.jay (field_declaration): Pass in location for each field.
23308
23309         * ../errors/cs0592.cs : Add.
23310
23311 2001-11-12  Ravi Pratap  <ravi@ximian.com>
23312
23313         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
23314
23315         (InitCoreTypes): Update accordingly.
23316
23317         (RegisterAttrType, LookupAttr): Implement.
23318
23319         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
23320         info about the same.
23321
23322         (Resolve): Update to populate the above as necessary.
23323
23324         (Error592): Helper.
23325
23326         (GetValidPlaces): Helper to the above.
23327
23328         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
23329
23330         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
23331
23332 2001-11-12  Ravi Pratap  <ravi@ximian.com>
23333
23334         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
23335
23336         * ../errors/cs0617.cs : Add.
23337
23338 2001-11-11  Ravi Pratap  <ravi@ximian.com>
23339
23340         * enum.cs (Emit): Rename to Populate to be more consistent with what
23341         we expect it to do and when exactly it is called.
23342
23343         * class.cs, rootcontext.cs : Update accordingly.
23344
23345         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
23346         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
23347
23348         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
23349
23350         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
23351         of a fieldinfo using the above, when dealing with a FieldBuilder.
23352
23353 2001-11-10  Ravi Pratap  <ravi@ximian.com>
23354
23355         * ../errors/cs0031.cs : Add.
23356
23357         * ../errors/cs1008.cs : Add.
23358
23359         * ../errrors/cs0543.cs : Add.
23360
23361         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
23362         enum type.
23363
23364         (FindMembers): Implement.
23365
23366         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
23367         enums and delegates too.
23368
23369         (enum_types): Rename to builder_to_enum.
23370
23371         (delegate_types): Rename to builder_to_delegate.
23372
23373         * delegate.cs (FindMembers): Implement.
23374
23375 2001-11-09  Ravi Pratap  <ravi@ximian.com>
23376
23377         * typemanager.cs (IsEnumType): Implement.
23378
23379         * enum.cs (Emit): Re-write parts to account for the underlying type
23380         better and perform checking etc.
23381
23382         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
23383         of the underlying type.
23384
23385         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
23386         value
23387
23388         * enum.cs (error31): Helper to report error #31.
23389
23390         * cs-parser.jay (enum_declaration): Store location of each member too.
23391
23392         * enum.cs (member_to_location): New hashtable. 
23393
23394         (AddEnumMember): Update location hashtable.
23395
23396         (Emit): Use the location of each member while reporting errors.
23397
23398 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
23399
23400         * cs-parser.jay: A for_initializer if is a
23401         local_variable_declaration really ammount to have an implicit
23402         block with the variable declaration and no initializer for for.
23403
23404         * statement.cs (For.Emit): Cope with null initializers.
23405
23406         This fixes the infinite loop on for initializers.
23407
23408 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
23409
23410         * enum.cs: More cleanup.
23411
23412         * ecore.cs: Remove dead code.
23413
23414         * class.cs (Property.Emit): More simplification.
23415         (Event.Emit): ditto.
23416
23417         Reworked to have less levels of indentation.
23418
23419 2001-11-08  Ravi Pratap  <ravi@ximian.com>
23420
23421         * class.cs (Property): Emit attributes.
23422
23423         (Field): Ditto.
23424
23425         (Event): Ditto.
23426
23427         (Indexer): Ditto.
23428
23429         (Operator): Ditto.
23430
23431         * enum.cs (Emit): Ditto.
23432
23433         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
23434         Enums too.
23435
23436         * class.cs (Field, Event, etc.): Move attribute generation into the
23437         Emit method everywhere.
23438
23439         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
23440         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
23441         as we had no way of defining nested enums !
23442
23443         * rootcontext.cs : Adjust code accordingly.
23444
23445         * typemanager.cs (AddEnumType): To keep track of enum types separately.
23446
23447 2001-11-07  Ravi Pratap  <ravi@ximian.com>
23448
23449         * expression.cs (EvalConstantExpression): Move into ecore.cs
23450
23451         * enum.cs (Enum): Rename some members and make them public and readonly
23452         according to our convention.
23453
23454         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
23455         nothing else.
23456
23457         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
23458
23459         (Enum::Emit): Write a simple version for now which doesn't try to compute
23460         expressions. I shall modify this to be more robust in just a while.
23461
23462         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
23463
23464         (TypeContainer::CloseType): Create the Enum types too.
23465
23466         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
23467
23468         * expression.cs (EvalConstantExpression): Get rid of completely.
23469
23470         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
23471         user-defined values and other cases.
23472
23473         (IsValidEnumLiteral): Helper function.
23474
23475         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
23476         out there in the case we had a literal FieldExpr.
23477
23478         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
23479
23480         (Literalize): Revamp a bit to take two arguments.
23481
23482         (EnumLiteral): New class which derives from Literal to wrap enum literals.
23483
23484 2001-11-06  Ravi Pratap  <ravi@ximian.com>
23485
23486         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
23487
23488         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
23489
23490         (Resolve): Use the above to ensure we have proper initializers.
23491
23492 2001-11-05  Ravi Pratap  <ravi@ximian.com>
23493
23494         * expression.cs (Expression::EvalConstantExpression): New method to 
23495         evaluate constant expressions.
23496
23497         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
23498
23499 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
23500
23501         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
23502         in an array.
23503
23504         (Binary.ResolveOperator): Handle operator != (object a, object b)
23505         and operator == (object a, object b);
23506
23507         (Binary.DoNumericPromotions): Indicate whether the numeric
23508         promotion was possible.
23509
23510         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
23511         Implement.  
23512
23513         Made the ArrayAccess implement interface IAssignMethod instead of
23514         IStackStore as the order in which arguments are passed reflects
23515         this.
23516
23517         * assign.cs: Instead of using expr.ExprClass to select the way of
23518         assinging, probe for the IStackStore/IAssignMethod interfaces.
23519
23520         * typemanager.cs: Load InitializeArray definition.
23521
23522         * rootcontext.cs (RootContext.MakeStaticData): Used to define
23523         static data that can be used to initialize arrays. 
23524
23525 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
23526
23527         * expression.cs: Handle operator== and operator!= for booleans.
23528
23529         (Conditioal.Reduce): Implement reducer for the ?: operator.
23530
23531         (Conditional.Resolve): Implement dead code elimination.
23532
23533         (Binary.Resolve): Catch string literals and return a new
23534         concatenated string.
23535
23536         (Unary.Reduce): Implement reduction of unary expressions.
23537
23538         * ecore.cs: Split out the expression core handling here.
23539
23540         (Expression.Reduce): New method used to perform constant folding
23541         and CSE.  This is needed to support constant-expressions. 
23542
23543         * statement.cs (Statement.EmitBoolExpression): Pass true and false
23544         targets, and optimize for !x.
23545
23546 2001-11-04  Ravi Pratap  <ravi@ximian.com>
23547
23548         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
23549         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
23550         set custom atttributes.
23551
23552         * literal.cs (Literal::GetValue): New abstract method to return the actual
23553         value of the literal, cast as an object.
23554
23555         (*Literal): Implement GetValue method.
23556
23557         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
23558         expressions to the arraylist but objects of type Argument.
23559
23560         * class.cs (TypeContainer::Emit): Emit our attributes too.
23561
23562         (Method::Emit, Constructor::Emit): Ditto.
23563
23564         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
23565         to be ignoring earlier.
23566
23567 2001-11-03  Ravi Pratap  <ravi@ximian.com>
23568
23569         * attribute.cs (AttributeSection::Define): Implement to do the business
23570         of constructing a CustomAttributeBuilder.
23571
23572         (Attribute): New trivial class. Increases readability of code.  
23573
23574         * cs-parser.jay : Update accordingly.
23575
23576         (positional_argument_list, named_argument_list, named_argument): New rules
23577
23578         (attribute_arguments): Use the above so that we are more correct.
23579
23580 2001-11-02  Ravi Pratap  <ravi@ximian.com>
23581
23582         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
23583         to perform all checks for a method with a params parameter.
23584
23585         (Invocation::OverloadResolve): Update to use the above method and therefore
23586         cope correctly with params method invocations.
23587
23588         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
23589         params too.
23590
23591         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
23592         constructors in our parent too because we can't afford to miss out on 
23593         protected ones ;-)
23594
23595         * attribute.cs (AttributeSection): New name for the class Attribute
23596
23597         Other trivial changes to improve readability.
23598
23599         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
23600         use the new class names.
23601
23602 2001-11-01  Ravi Pratap  <ravi@ximian.com>
23603
23604         * class.cs (Method::Define): Complete definition for params types too
23605
23606         (Indexer::Define): Ditto.
23607
23608         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
23609         Cope everywhere with a request for info about the array parameter.
23610
23611 2001-11-01  Ravi Pratap  <ravi@ximian.com>
23612
23613         * tree.cs (RecordNamespace): Fix up to check for the correct key.
23614
23615         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
23616         local_variable_type to extract the string corresponding to the type.
23617
23618         (local_variable_type): Fixup the action to use the new helper method.
23619
23620         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
23621         go.
23622
23623         * expression.cs : Clean out code which uses the above.
23624
23625 2001-10-31  Ravi Pratap  <ravi@ximian.com>
23626
23627         * typemanager.cs (RegisterMethod): Check if we already have an existing key
23628         and bale out if necessary by returning a false.
23629
23630         (RegisterProperty): Ditto.
23631
23632         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
23633         and print out appropriate error messages.
23634
23635         * interface.cs (everywhere): Ditto.
23636
23637         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
23638         location to constructor.
23639
23640         * class.cs (Property, Event, Indexer): Update accordingly.
23641
23642         * ../errors/cs111.cs : Added.
23643
23644         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
23645         of a method, as laid down by the spec.
23646
23647         (Invocation::OverloadResolve): Use the above method.
23648
23649 2001-10-31  Ravi Pratap  <ravi@ximian.com>
23650
23651         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
23652         now take a TypeContainer and a Parameters object.
23653
23654         (ParameterData): Modify return type of ParameterModifier method to be 
23655         Parameter.Modifier and not a string.
23656
23657         (ReflectionParameters, InternalParameters): Update accordingly.
23658
23659         * expression.cs (Argument::GetParameterModifier): Same here.
23660
23661         * support.cs (InternalParameters::ParameterType): Find a better way of determining
23662         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
23663         symbol in it at all so maybe this is only for now.
23664
23665 2001-10-30  Ravi Pratap  <ravi@ximian.com>
23666
23667         * support.cs (InternalParameters): Constructor now takes an extra argument 
23668         which is the actual Parameters class.
23669
23670         (ParameterDesc): Update to provide info on ref/out modifiers.
23671
23672         * class.cs (everywhere): Update call to InternalParameters to pass in
23673         the second argument too.
23674
23675         * support.cs (ParameterData): Add ParameterModifier, which is a method 
23676         to return the modifier info [ref/out etc]
23677
23678         (InternalParameters, ReflectionParameters): Implement the above.
23679
23680         * expression.cs (Argument::ParameterModifier): Similar function to return
23681         info about the argument's modifiers.
23682
23683         (Invocation::OverloadResolve): Update to take into account matching modifiers 
23684         too.
23685
23686         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
23687         a new SetFormalParameters object which we pass to InternalParameters.
23688
23689 2001-10-30  Ravi Pratap  <ravi@ximian.com>
23690
23691         * expression.cs (NewArray): Merge into the ArrayCreation class.
23692
23693 2001-10-29  Ravi Pratap  <ravi@ximian.com>
23694
23695         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
23696         NewUserdefinedArray into one as there wasn't much of a use in having
23697         two separate ones.
23698
23699         * expression.cs (Argument): Change field's name to ArgType from Type.
23700
23701         (Type): New readonly property which returns the proper type, taking into 
23702         account ref/out modifiers.
23703
23704         (everywhere): Adjust code accordingly for the above.
23705
23706         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
23707         whether we are emitting for a ref or out parameter.
23708
23709         * expression.cs (Argument::Emit): Use the above field to set the state.
23710
23711         (LocalVariableReference::Emit): Update to honour the flag and emit the
23712         right stuff.
23713
23714         * parameter.cs (Attributes): Set the correct flags for ref parameters.
23715
23716         * expression.cs (Argument::FullDesc): New function to provide a full desc.
23717
23718         * support.cs (ParameterData): Add method ParameterDesc to the interface.
23719
23720         (ReflectionParameters, InternalParameters): Implement the above method.
23721
23722         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
23723         reporting errors.
23724
23725         (Invocation::FullMethodDesc): Ditto. 
23726
23727 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
23728
23729         * cs-parser.jay: Add extra production for the second form of array
23730         creation. 
23731
23732         * expression.cs (ArrayCreation): Update to reflect the above
23733         change. 
23734
23735         * Small changes to prepare for Array initialization.
23736
23737 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
23738
23739         * typemanager.cs (ImplementsInterface): interface might be null;
23740         Deal with this problem;
23741
23742         Also, we do store negative hits on the cache (null values), so use
23743         this instead of calling t.GetInterfaces on the type everytime.
23744
23745 2001-10-28  Ravi Pratap  <ravi@ximian.com>
23746
23747         * typemanager.cs (IsBuiltinType): New method to help determine the same.
23748
23749         * expression.cs (New::DoResolve): Get rid of array creation code and instead
23750         split functionality out into different classes.
23751
23752         (New::FormArrayType): Move into NewBuiltinArray.
23753
23754         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
23755         quite useless.
23756
23757         (NewBuiltinArray): New class to handle creation of built-in arrays.
23758
23759         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
23760         account creation of one-dimensional arrays.
23761
23762         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
23763
23764         (NewUserdefinedArray::DoResolve): Implement.
23765
23766         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
23767
23768         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
23769         we maintain inside the TypeManager. This is necessary to perform lookups on the
23770         module builder.
23771
23772         (LookupType): Update to perform GetType on the module builders too.     
23773
23774         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
23775
23776         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
23777
23778 2001-10-23  Ravi Pratap  <ravi@ximian.com>
23779
23780         * expression.cs (New::DoResolve): Implement guts of array creation.
23781
23782         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
23783
23784 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
23785
23786         * expression.cs: Fix bug I introduced lsat night that broke
23787         Delegates. 
23788
23789         (Expression.Resolve): Report a 246 error (can not resolve name)
23790         if we find a SimpleName in the stream.
23791
23792         (Expression.ResolveLValue): Ditto.
23793
23794         (Expression.ResolveWithSimpleName): This function is a variant of
23795         ResolveName, this one allows SimpleNames to be returned without a
23796         warning.  The only consumer of SimpleNames is MemberAccess
23797
23798 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
23799
23800         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
23801         might arrive here.  I have my doubts that this is correct.
23802
23803         * statement.cs (Lock): Implement lock statement.
23804
23805         * cs-parser.jay: Small fixes to support `lock' and `using'
23806
23807         * cs-tokenizer.cs: Remove extra space
23808
23809         * driver.cs: New flag --checked, allows to turn on integer math
23810         checking. 
23811
23812         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
23813         Threading.Monitor.Exit 
23814
23815 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
23816
23817         * expression.cs (IndexerAccess::DoResolveLValue): Set the
23818         Expression Class to be IndexerAccess.
23819
23820         Notice that Indexer::DoResolve sets the eclass to Value.
23821
23822 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
23823
23824         * class.cs (TypeContainer::Emit): Emit code for indexers.
23825
23826         * assign.cs (IAssignMethod): New interface implemented by Indexers
23827         and Properties for handling assignment.
23828
23829         (Assign::Emit): Simplify and reuse code. 
23830
23831         * expression.cs (IndexerAccess, PropertyExpr): Implement
23832         IAssignMethod, clean up old code. 
23833
23834 2001-10-22  Ravi Pratap  <ravi@ximian.com>
23835
23836         * typemanager.cs (ImplementsInterface): New method to determine if a type
23837         implements a given interface. Provides a nice cache too.
23838
23839         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
23840         method.
23841
23842         (ConvertReferenceExplicit): Ditto.
23843
23844         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
23845         various methods, with correct names etc.
23846
23847         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
23848         Operator.UnaryNegation.
23849
23850         * cs-parser.jay (operator_declarator): Be a little clever in the case where
23851         we have a unary plus or minus operator.
23852
23853         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
23854         UnaryMinus.
23855
23856         * everywhere : update accordingly.
23857
23858         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
23859         respectively.
23860
23861         * class.cs (Method::Define): For the case where we are implementing a method
23862         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
23863         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
23864
23865 2001-10-21  Ravi Pratap  <ravi@ximian.com>
23866
23867         * interface.cs (FindMembers): Implement to work around S.R.E
23868         lameness.
23869
23870         * typemanager.cs (IsInterfaceType): Implement.
23871
23872         (FindMembers): Update to handle interface types too.
23873
23874         * expression.cs (ImplicitReferenceConversion): Re-write bits which
23875         use IsAssignableFrom as that is not correct - it doesn't work.
23876
23877         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
23878         and accordingly override EmitStatement.
23879
23880         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
23881         using the correct logic :-)
23882
23883 2001-10-19  Ravi Pratap  <ravi@ximian.com>
23884
23885         * ../errors/cs-11.cs : Add to demonstrate error -11 
23886
23887 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
23888
23889         * assign.cs (Assign::Resolve): Resolve right hand side first, and
23890         then pass this as a hint to ResolveLValue.
23891
23892         * expression.cs (FieldExpr): Add Location information
23893
23894         (FieldExpr::LValueResolve): Report assignment to readonly
23895         variable. 
23896
23897         (Expression::ExprClassFromMemberInfo): Pass location information.
23898
23899         (Expression::ResolveLValue): Add new method that resolves an
23900         LValue. 
23901
23902         (Expression::DoResolveLValue): Default invocation calls
23903         DoResolve. 
23904
23905         (Indexers): New class used to keep track of indexers in a given
23906         Type. 
23907
23908         (IStackStore): Renamed from LValue, as it did not really describe
23909         what this did.  Also ResolveLValue is gone from this interface and
23910         now is part of Expression.
23911
23912         (ElementAccess): Depending on the element access type
23913
23914         * typemanager.cs: Add `indexer_name_type' as a Core type
23915         (System.Runtime.CompilerServices.IndexerNameAttribute)
23916
23917         * statement.cs (Goto): Take a location.
23918
23919 2001-10-18  Ravi Pratap  <ravi@ximian.com>
23920
23921         * delegate.cs (Delegate::VerifyDelegate): New method to verify
23922         if two delegates are compatible.
23923
23924         (NewDelegate::DoResolve): Update to take care of the case when
23925         we instantiate a delegate from another delegate.
23926
23927         * typemanager.cs (FindMembers): Don't even try to look up members
23928         of Delegate types for now.
23929
23930 2001-10-18  Ravi Pratap  <ravi@ximian.com>
23931
23932         * delegate.cs (NewDelegate): New class to take care of delegate
23933         instantiation.
23934
23935         * expression.cs (New): Split the delegate related code out into 
23936         the NewDelegate class.
23937
23938         * delegate.cs (DelegateInvocation): New class to handle delegate 
23939         invocation.
23940
23941         * expression.cs (Invocation): Split out delegate related code into
23942         the DelegateInvocation class.
23943
23944 2001-10-17  Ravi Pratap  <ravi@ximian.com>
23945
23946         * expression.cs (New::DoResolve): Implement delegate creation fully
23947         and according to the spec.
23948
23949         (New::DoEmit): Update to handle delegates differently.
23950
23951         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
23952         because of which we were printing out arguments in reverse order !
23953
23954         * delegate.cs (VerifyMethod): Implement to check if the given method
23955         matches the delegate.
23956
23957         (FullDelegateDesc): Implement.
23958
23959         (VerifyApplicability): Implement.
23960
23961         * expression.cs (Invocation::DoResolve): Update to accordingly handle
23962         delegate invocations too.
23963
23964         (Invocation::Emit): Ditto.
23965
23966         * ../errors/cs1593.cs : Added.
23967
23968         * ../errors/cs1594.cs : Added.
23969
23970         * delegate.cs (InstanceExpression, TargetMethod): New properties.
23971
23972 2001-10-16  Ravi Pratap  <ravi@ximian.com>
23973
23974         * typemanager.cs (intptr_type): Core type for System.IntPtr
23975
23976         (InitCoreTypes): Update for the same.
23977
23978         (iasyncresult_type, asynccallback_type): Ditto.
23979
23980         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
23981         correct.
23982
23983         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
23984         too.
23985
23986         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
23987         the builders for the 4 members of a delegate type :-)
23988
23989         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
23990         type.
23991
23992         * expression.cs (New::DoResolve): Implement guts for delegate creation.
23993
23994         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
23995
23996 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
23997
23998         * statement.cs (Break::Emit): Implement.   
23999         (Continue::Emit): Implement.
24000
24001         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24002         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24003         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24004         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
24005         end loop
24006
24007         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
24008         properties that track the label for the current loop (begin of the
24009         loop and end of the loop).
24010
24011 2001-10-15  Ravi Pratap  <ravi@ximian.com>
24012
24013         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
24014         use of emitting anything at all.
24015
24016         * class.cs, rootcontext.cs : Get rid of calls to the same.
24017
24018         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
24019
24020         (Populate): Define the constructor correctly and set the implementation
24021         attributes.
24022
24023         * typemanager.cs (delegate_types): New hashtable to hold delegates that
24024         have been defined.
24025
24026         (AddDelegateType): Implement.
24027
24028         (IsDelegateType): Implement helper method.
24029
24030         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
24031
24032         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
24033         and accordingly handle it.
24034
24035         * delegate.cs (Populate): Take TypeContainer argument.
24036         Implement bits to define the Invoke method. However, I still haven't figured out
24037         how to take care of the native int bit :-(
24038
24039         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
24040         Qualify the name of the delegate, not its return type !
24041
24042         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
24043         conversion.
24044
24045         (StandardConversionExists): Checking for array types turns out to be recursive.
24046
24047         (ConvertReferenceExplicit): Implement array conversion.
24048
24049         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
24050
24051 2001-10-12  Ravi Pratap  <ravi@ximian.com>
24052
24053         * cs-parser.jay (delegate_declaration): Store the fully qualified
24054         name as it is a type declaration.
24055
24056         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
24057         readonly.
24058
24059         (DefineDelegate): Renamed from Define. Does the same thing essentially,
24060         as TypeContainer::DefineType.
24061
24062         (Populate): Method in which all the definition of the various methods (Invoke)
24063         etc is done.
24064
24065         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
24066         see.
24067
24068         (CloseDelegate): Finally creates the delegate.
24069
24070         * class.cs (TypeContainer::DefineType): Update to define delegates.
24071         (Populate, Emit and CloseType): Do the same thing here too.
24072
24073         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
24074         delegates in all these operations.
24075
24076 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
24077
24078         * expression.cs: LocalTemporary: a new expression used to
24079         reference a temporary that has been created.
24080
24081         * assign.cs: Handle PropertyAccess back here, so that we can
24082         provide the proper semantic access to properties.
24083
24084         * expression.cs (Expression::ConvertReferenceExplicit): Implement
24085         a few more explicit conversions. 
24086
24087         * modifiers.cs: `NEW' modifier maps to HideBySig.
24088
24089         * expression.cs (PropertyExpr): Make this into an
24090         ExpressionStatement, and support the EmitStatement code path. 
24091
24092         Perform get/set error checking, clean up the interface.
24093
24094         * assign.cs: recognize PropertyExprs as targets, and if so, turn
24095         them into toplevel access objects.
24096
24097 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
24098
24099         * expression.cs: PropertyExpr::PropertyExpr: use work around the
24100         SRE.
24101
24102         * typemanager.cs: Keep track here of our PropertyBuilders again to
24103         work around lameness in SRE.
24104
24105 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
24106
24107         * expression.cs (LValue::LValueResolve): New method in the
24108         interface, used to perform a second resolution pass for LValues. 
24109
24110         (This::DoResolve): Catch the use of this in static methods.
24111
24112         (This::LValueResolve): Implement.
24113
24114         (This::Store): Remove warning, assigning to `this' in structures
24115         is 
24116
24117         (Invocation::Emit): Deal with invocation of
24118         methods on value types.  We need to pass the address to structure
24119         methods rather than the object itself.  (The equivalent code to
24120         emit "this" for structures leaves the entire structure on the
24121         stack instead of a pointer to it). 
24122
24123         (ParameterReference::DoResolve): Compute the real index for the
24124         argument based on whether the method takes or not a `this' pointer
24125         (ie, the method is static).
24126
24127         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
24128         value types returned from functions when we need to invoke a
24129         method on the sturcture.
24130
24131
24132 2001-10-11  Ravi Pratap  <ravi@ximian.com>
24133
24134         * class.cs (TypeContainer::DefineType): Method to actually do the business of
24135         defining the type in the Modulebuilder or Typebuilder. This is to take
24136         care of nested types which need to be defined on the TypeBuilder using
24137         DefineNestedMethod.
24138
24139         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
24140         methods in RootContext, only ported to be part of TypeContainer.
24141
24142         (TypeContainer::GetInterfaceOrClass): Ditto.
24143
24144         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
24145
24146         * interface.cs (Interface::DefineInterface): New method. Does exactly
24147         what RootContext.CreateInterface did earlier, only it takes care of nested types 
24148         too.
24149
24150         (Interface::GetInterfaces): Move from RootContext here and port.
24151
24152         (Interface::GetInterfaceByName): Same here.
24153
24154         * rootcontext.cs (ResolveTree): Re-write.
24155
24156         (PopulateTypes): Re-write.
24157
24158         * class.cs (TypeContainer::Populate): Populate nested types too.
24159         (TypeContainer::Emit): Emit nested members too.
24160
24161         * typemanager.cs (AddUserType): Do not make use of the FullName property,
24162         instead just use the name argument passed in as it is already fully
24163         qualified.
24164
24165         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
24166         to TypeContainer mapping to see if a type is user-defined.
24167
24168         * class.cs (TypeContainer::CloseType): Implement. 
24169
24170         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
24171         the default constructor.
24172
24173         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
24174         twice.
24175
24176         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
24177
24178         * interface.cs (CloseType): Create the type here.
24179
24180         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
24181         the hierarchy.
24182
24183         Remove all the methods which are now in TypeContainer.
24184
24185 2001-10-10  Ravi Pratap  <ravi@ximian.com>
24186
24187         * delegate.cs (Define): Re-write bits to define the delegate
24188         correctly.
24189
24190 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
24191
24192         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
24193
24194         * expression.cs (ImplicitReferenceConversion): handle null as well
24195         as a source to convert to any reference type.
24196
24197         * statement.cs (Return): Perform any implicit conversions to
24198         expected return type.  
24199
24200         Validate use of return statement.  
24201
24202         * codegen.cs (EmitContext): Pass the expected return type here.
24203
24204         * class.cs (Method, Constructor, Property): Pass expected return
24205         type to EmitContext.
24206
24207 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
24208
24209         * expression.cs: Make DoResolve take an EmitContext instead of a
24210         TypeContainer.
24211
24212         Replaced `l' and `location' for `loc', for consistency.
24213
24214         (Error, Warning): Remove unneeded Tc argument.
24215
24216         * assign.cs, literal.cs, constant.cs: Update to new calling
24217         convention. 
24218
24219         * codegen.cs: EmitContext now contains a flag indicating whether
24220         code is being generated in a static method or not.
24221
24222         * cs-parser.jay: DecomposeQI, new function that replaces the old
24223         QualifiedIdentifier.  Now we always decompose the assembled
24224         strings from qualified_identifier productions into a group of
24225         memberaccesses.
24226
24227 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
24228
24229         * rootcontext.cs: Deal with field-less struct types correctly now
24230         by passing the size option to Define Type.
24231
24232         * class.cs: Removed hack that created one static field. 
24233
24234 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
24235
24236         * statement.cs: Moved most of the code generation here. 
24237
24238 2001-10-09  Ravi Pratap  <ravi@ximian.com>
24239
24240         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
24241         seem very right.
24242
24243         (ElementAccess): Remove useless bits for now - keep checks as the spec
24244         says.
24245
24246 2001-10-08  Ravi Pratap  <ravi@ximian.com>
24247
24248         * expression.cs (ElementAccess::DoResolve): Remove my crap code
24249         and start performing checks according to the spec.
24250
24251 2001-10-07  Ravi Pratap  <ravi@ximian.com>
24252
24253         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
24254         rank_specifiers instead.
24255
24256         (rank_specifiers): Change the order in which the rank specifiers are stored
24257
24258         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
24259
24260         * expression.cs (ElementAccess): Implement the LValue interface too.
24261
24262 2001-10-06  Ravi Pratap  <ravi@ximian.com>
24263
24264         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
24265         except that user defined conversions are not included.
24266
24267         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
24268         perform the conversion of the return type, if necessary.
24269
24270         (New::DoResolve): Check whether we are creating an array or an object
24271         and accordingly do the needful.
24272
24273         (New::Emit): Same here.
24274
24275         (New::DoResolve): Implement guts of array creation.
24276
24277         (New::FormLookupType): Helper function.
24278
24279 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
24280
24281         * codegen.cs: Removed most of the code generation here, and move the
24282         corresponding code generation bits to the statement classes. 
24283
24284         Added support for try/catch/finalize and throw.
24285
24286         * cs-parser.jay: Added support for try/catch/finalize.
24287
24288         * class.cs: Catch static methods having the flags override,
24289         virtual or abstract.
24290
24291         * expression.cs (UserCast): This user cast was not really doing
24292         what it was supposed to do.  Which is to be born in fully resolved
24293         state.  Parts of the resolution were being performed at Emit time! 
24294
24295         Fixed this code.
24296
24297 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
24298
24299         * expression.cs: Implicity convert the result from UserCast.
24300
24301 2001-10-05  Ravi Pratap  <ravi@ximian.com>
24302
24303         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
24304         prevented it from working correctly. 
24305
24306         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
24307         merely ConvertImplicit.
24308
24309 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
24310
24311         * typemanager.cs: Make the LookupTypeContainer function static,
24312         and not per-instance.  
24313
24314         * class.cs: Make static FindMembers (the one that takes a Type
24315         argument). 
24316
24317         * codegen.cs: Add EmitForeach here.
24318
24319         * cs-parser.jay: Make foreach a toplevel object instead of the
24320         inline expansion, as we need to perform semantic analysis on it. 
24321
24322 2001-10-05  Ravi Pratap  <ravi@ximian.com>
24323
24324         * expression.cs (Expression::ImplicitUserConversion): Rename to
24325         UserDefinedConversion.
24326
24327         (Expression::UserDefinedConversion): Take an extra argument specifying 
24328         whether we look for explicit user conversions too.
24329
24330         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
24331
24332         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
24333
24334         (ExplicitUserConversion): Make it a call to UserDefinedConversion
24335         with the appropriate arguments.
24336
24337         * cs-parser.jay (cast_expression): Record location too.
24338
24339         * expression.cs (Cast): Record location info.
24340
24341         (Expression::ConvertExplicit): Take location argument.
24342
24343         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
24344         to determine if we are doing explicit conversions.
24345
24346         (UserCast::Emit): Update accordingly.
24347
24348         (Expression::ConvertExplicit): Report an error if everything fails.
24349
24350         * ../errors/cs0030.cs : Add.
24351
24352 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
24353
24354         * modifiers.cs: If the ABSTRACT keyword is present, also set the
24355         virtual and newslot bits. 
24356
24357         * class.cs (TypeContainer::RegisterRequiredImplementations):
24358         Record methods we need.
24359
24360         (TypeContainer::MakeKey): Helper function to make keys for
24361         MethodBases, since the Methodbase key is useless.
24362
24363         (TypeContainer::Populate): Call RegisterRequiredImplementations
24364         before defining the methods.   
24365
24366         Create a mapping for method_builders_to_methods ahead of time
24367         instead of inside a tight loop.
24368
24369         (::RequireMethods):  Accept an object as the data to set into the
24370         hashtable so we can report interface vs abstract method mismatch.
24371
24372 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
24373
24374         * report.cs: Make all of it static.
24375
24376         * rootcontext.cs: Drop object_type and value_type computations, as
24377         we have those in the TypeManager anyways.
24378
24379         Drop report instance variable too, now it is a global.
24380
24381         * driver.cs: Use try/catch on command line handling.
24382
24383         Add --probe option to debug the error reporting system with a test
24384         suite. 
24385
24386         * report.cs: Add support for exiting program when a probe
24387         condition is reached.
24388
24389 2001-10-03  Ravi Pratap  <ravi@ximian.com>
24390
24391         * expression.cs (Binary::DoNumericPromotions): Fix the case when
24392         we do a forcible conversion regardless of type, to check if 
24393         ForceConversion returns a null.
24394
24395         (Binary::error19): Use location to report error.
24396
24397         (Unary::error23): Use location here too.
24398
24399         * ../errors/cs0019.cs : Check in.
24400
24401         * ../errors/cs0023.cs : Check in.
24402
24403         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
24404         case of a non-null MethodInfo object with a length of 0 !
24405
24406         (Binary::ResolveOperator): Flag error if overload resolution fails to find
24407         an applicable member - according to the spec :-)
24408         Also fix logic to find members in base types.
24409
24410         (Unary::ResolveOperator): Same here.
24411
24412         (Unary::report23): Change name to error23 and make first argument a TypeContainer
24413         as I was getting thoroughly confused between this and error19 :-)
24414
24415         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
24416         (::FindMostEncompassedType): Implement.
24417         (::FindMostEncompassingType): Implement.
24418         (::StandardConversionExists): Implement.
24419
24420         (UserImplicitCast): Re-vamp. We now need info about most specific
24421         source and target types so that we can do the necessary conversions.
24422
24423         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
24424         mathematical union with no duplicates.
24425
24426 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
24427
24428         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
24429         in order from base classes to child classes, so that we can in
24430         child classes look up in our parent for method names and
24431         attributes (required for handling abstract, virtual, new, override
24432         constructs: we need to instrospect our base class, and if we dont
24433         populate the classes in order, the introspection might be
24434         incorrect.  For example, a method could query its parent before
24435         the parent has any methods and would determine that the parent has
24436         no abstract methods (while it could have had them)).
24437
24438         (RootContext::CreateType): Record the order in which we define the
24439         classes.
24440
24441 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
24442
24443         * class.cs (TypeContainer::Populate): Also method definitions can
24444         fail now, keep track of this.
24445
24446         (TypeContainer::FindMembers): Implement support for
24447         DeclaredOnly/noDeclaredOnly flag.
24448
24449         (Constructor::Emit) Return the ConstructorBuilder.
24450
24451         (Method::Emit) Return the MethodBuilder. 
24452         Check for abstract or virtual methods to be public.
24453
24454         * rootcontext.cs (RootContext::CreateType): Register all the
24455         abstract methods required for the class to be complete and the
24456         interface methods that must be implemented. 
24457
24458         * cs-parser.jay: Report error 501 (method requires body if it is
24459         not marked abstract or extern).
24460
24461         * expression.cs (TypeOf::Emit): Implement.
24462
24463         * typemanager.cs: runtime_handle_type, new global type.
24464
24465         * class.cs (Property::Emit): Generate code for properties.
24466
24467 2001-10-02  Ravi Pratap  <ravi@ximian.com>
24468
24469         * expression.cs (Unary::ResolveOperator): Find operators on base type
24470         too - we now conform exactly to the spec.
24471
24472         (Binary::ResolveOperator): Same here.
24473
24474         * class.cs (Operator::Define): Fix minor quirk in the tests.
24475
24476         * ../errors/cs0215.cs : Added.
24477
24478         * ../errors/cs0556.cs : Added.
24479
24480         * ../errors/cs0555.cs : Added.
24481
24482 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
24483
24484         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
24485         single integer which is really efficient
24486
24487 2001-10-01  Ravi Pratap  <ravi@ximian.com>
24488
24489         *  expression.cs (Expression::ImplicitUserConversion): Use location
24490         even in the case when we are examining True operators.
24491  
24492         * class.cs (Operator::Define): Perform extensive checks to conform
24493         with the rules for operator overloading in the spec.
24494
24495         * expression.cs (Expression::ImplicitReferenceConversion): Implement
24496         some of the other conversions mentioned in the spec.
24497
24498         * typemanager.cs (array_type): New static member for the System.Array built-in
24499         type.
24500
24501         (cloneable_interface): For System.ICloneable interface.
24502
24503         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
24504         we start resolving the tree and populating types.
24505
24506         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
24507  
24508 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
24509
24510         * expression.cs (Expression::ExprClassFromMemberInfo,
24511         Expression::Literalize): Create literal expressions from
24512         FieldInfos which are literals.
24513
24514         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
24515         type casts, because they were wrong.  The test suite in tests
24516         caught these ones.
24517
24518         (ImplicitNumericConversion): ushort to ulong requires a widening
24519         cast. 
24520
24521         Int32 constant to long requires widening cast as well.
24522
24523         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
24524         for integers because the type on the stack is not i4.
24525
24526 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
24527
24528         * expression.cs (report118): require location argument. 
24529
24530         * parameter.cs: Do not dereference potential null value.
24531
24532         * class.cs: Catch methods that lack the `new' keyword when
24533         overriding a name.  Report warnings when `new' is used without
24534         anything being there to override.
24535
24536         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
24537
24538         * class.cs: Only add constructor to hashtable if it is non-null
24539         (as now constructors can fail on define).
24540
24541         (TypeManager, Class, Struct): Take location arguments.
24542
24543         Catch field instance initialization in structs as errors.
24544
24545         accepting_filter: a new filter for FindMembers that is static so
24546         that we dont create an instance per invocation.
24547
24548         (Constructor::Define): Catch errors where a struct constructor is
24549         parameterless 
24550
24551         * cs-parser.jay: Pass location information for various new
24552         constructs. 
24553
24554         * delegate.cs (Delegate): take a location argument.
24555
24556         * driver.cs: Do not call EmitCode if there were problesm in the
24557         Definition of the types, as many Builders wont be there. 
24558
24559         * decl.cs (Decl::Decl): Require a location argument.
24560
24561         * cs-tokenizer.cs: Handle properly hex constants that can not fit
24562         into integers, and find the most appropiate integer for it.
24563
24564         * literal.cs: Implement ULongLiteral.
24565
24566         * rootcontext.cs: Provide better information about the location of
24567         failure when CreateType fails.
24568
24569 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
24570
24571         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
24572         as well.
24573
24574         * expression.cs (Binary::CheckShiftArguments): Add missing type
24575         computation.
24576         (Binary::ResolveOperator): Add type to the logical and and logical
24577         or, Bitwise And/Or and Exclusive Or code paths, it was missing
24578         before.
24579
24580         (Binary::DoNumericPromotions): In the case where either argument
24581         is ulong (and most signed types combined with ulong cause an
24582         error) perform implicit integer constant conversions as well.
24583
24584 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
24585
24586         * expression.cs (UserImplicitCast): Method should always be
24587         non-null. 
24588         (Invocation::BetterConversion): Simplified test for IntLiteral.
24589
24590         (Expression::ImplicitNumericConversion): Split this routine out.
24591         Put the code that performs implicit constant integer conversions
24592         here. 
24593
24594         (Expression::Resolve): Become a wrapper around DoResolve so we can
24595         check eclass and type being set after resolve.
24596
24597         (Invocation::Badness): Remove this dead function
24598
24599         (Binary::ResolveOperator): Do not compute the expensive argumnets
24600         unless we have a union for it.
24601
24602         (Probe::Emit): Is needs to do an isinst and then
24603         compare against null.
24604
24605         (::CanConvert): Added Location argument.  If the Location argument
24606         is null (Location.Null), then we do not report errors.  This is
24607         used by the `probe' mechanism of the Explicit conversion.  We do
24608         not want to generate an error for something that the user
24609         explicitly requested to be casted.  But the pipeline for an
24610         explicit cast first tests for potential implicit casts.
24611
24612         So for now, if the Location is null, it means `Probe only' to
24613         avoid adding another argument.   Might have to revise this
24614         strategy later.
24615
24616         (ClassCast): New class used to type cast objects into arbitrary
24617         classes (used in Explicit Reference Conversions).
24618
24619         Implement `as' as well.
24620
24621         Reverted all the patches from Ravi below: they were broken:
24622
24623                 * The use of `level' as a mechanism to stop recursive
24624                   invocations is wrong.  That was there just to catch the
24625                   bug with a strack trace but not as a way of addressing
24626                   the problem.
24627
24628                   To fix the problem we have to *understand* what is going
24629                   on and the interactions and come up with a plan, not
24630                   just get things going.
24631
24632                 * The use of the type conversion cache that I proposed
24633                   last night had an open topic: How does this work across
24634                   protection domains.  A user defined conversion might not
24635                   be public in the location where we are applying the
24636                   conversion, a different conversion might be selected
24637                   (ie, private A->B (better) but public B->A (worse),
24638                   inside A, A->B applies, but outside it, B->A will
24639                   apply).
24640
24641                 * On top of that (ie, even if the above is solved),
24642                   conversions in a cache need to be abstract.  Ie, `To
24643                   convert from an Int to a Short use an OpcodeCast', not
24644                   `To convert from an Int to a Short use the OpcodeCast on
24645                   the variable 5' (which is what this patch was doing).
24646
24647 2001-09-28  Ravi Pratap  <ravi@ximian.com>
24648
24649         * expression.cs (Invocation::ConversionExists): Re-write to use
24650         the conversion cache
24651
24652         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
24653         cache all conversions done, not just user-defined ones.
24654
24655         (Invocation::BetterConversion): The real culprit. Use ConversionExists
24656         to determine if a conversion exists instead of acutually trying to 
24657         perform the conversion. It's faster too.
24658
24659         (Expression::ConvertExplicit): Modify to use ConversionExists to check
24660         and only then attempt the implicit conversion.
24661
24662 2001-09-28  Ravi Pratap  <ravi@ximian.com>
24663
24664         * expression.cs (ConvertImplicit): Use a cache for conversions
24665         already found. Check level of recursion and bail out if necessary.
24666
24667 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
24668
24669         * typemanager.cs (string_concat_string_string, string_concat_object_object):
24670         Export standard methods that we expect for string operations.
24671
24672         * statement.cs (Block::UsageWarning): Track usage of variables and
24673         report the errors for not used variables.
24674
24675         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
24676         operator. 
24677
24678 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
24679
24680         * codegen.cs: remove unnneded code 
24681
24682         * expression.cs: Removed BuiltinTypeAccess class
24683
24684         Fix the order in which implicit conversions are
24685         done.  
24686
24687         The previous fixed dropped support for boxed conversions (adding a
24688         test to the test suite now)
24689
24690         (UserImplicitCast::CanConvert): Remove test for source being null,
24691         that code is broken.  We should not feed a null to begin with, if
24692         we do, then we should track the bug where the problem originates
24693         and not try to cover it up here.
24694
24695         Return a resolved expression of type UserImplicitCast on success
24696         rather than true/false.  Ravi: this is what I was talking about,
24697         the pattern is to use a static method as a "constructor" for
24698         objects. 
24699
24700         Also, do not create arguments until the very last minute,
24701         otherwise we always create the arguments even for lookups that
24702         will never be performed. 
24703
24704         (UserImplicitCast::Resolve): Eliminate, objects of type
24705         UserImplicitCast are born in a fully resolved state. 
24706
24707         * typemanager.cs (InitCoreTypes): Init also value_type
24708         (System.ValueType). 
24709
24710         * expression.cs (Cast::Resolve): First resolve the child expression.
24711
24712         (LValue): Add new method AddressOf to be used by
24713         the `&' operator.  
24714
24715         Change the argument of Store to take an EmitContext instead of an
24716         ILGenerator, because things like FieldExpr need to be able to call
24717         their children expression to generate the instance code. 
24718
24719         (Expression::Error, Expression::Warning): Sugar functions for
24720         reporting errors.
24721
24722         (Expression::MemberLookup): Accept a TypeContainer instead of a
24723         Report as the first argument.
24724
24725         (Expression::ResolvePrimary): Killed.  I still want to improve
24726         this as currently the code is just not right.
24727
24728         (Expression::ResolveMemberAccess): Simplify, but it is still
24729         wrong. 
24730
24731         (Unary::Resolve): Catch errors in AddressOf operators.
24732
24733         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
24734         index to a byte for the short-version, or the compiler will choose
24735         the wrong Emit call, which generates the wrong data.
24736
24737         (ParameterReference::Emit, ::Store): same.
24738
24739         (FieldExpr::AddressOf): Implement.
24740
24741         * typemanager.cs: TypeManager: made public variable instead of
24742         property.
24743
24744         * driver.cs: document --fatal.
24745
24746         * report.cs (ErrorMessage, WarningMessage): new names for the old
24747         Error and Warning classes.
24748
24749         * cs-parser.jay (member_access): Turn built-in access to types
24750         into a normal simplename
24751
24752 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24753
24754         * expression.cs (Invocation::BetterConversion): Fix to cope
24755         with q being null, since this was introducing a bug.
24756
24757         * expression.cs (ConvertImplicit): Do built-in conversions first.
24758
24759 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24760
24761         * expression.cs (UserImplicitCast::Resolve): Fix bug.
24762
24763 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24764
24765         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
24766         I had introduced long ago (what's new ?).
24767
24768         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
24769         the work of all the checking. 
24770         (ConvertImplicit): Call CanConvert and only then create object if necessary.
24771         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
24772
24773         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
24774         that is the right way. 
24775
24776         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
24777         overloading resolution. Use everywhere instead of cutting and pasting code.
24778
24779         (Binary::ResolveOperator): Use MakeUnionSet.
24780
24781         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
24782         we have to convert to bool types. Not complete yet.
24783
24784 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
24785
24786         * typemanager.cs (TypeManager::CSharpName): support ushort.
24787
24788         * expression.cs (Expression::TryImplicitIntConversion): Attempts
24789         to provide an expression that performsn an implicit constant int
24790         conversion (section 6.1.6).
24791         (Expression::ConvertImplicitRequired): Reworked to include
24792         implicit constant expression conversions.
24793
24794         (Expression::ConvertNumericExplicit): Finished.
24795
24796         (Invocation::Emit): If InstanceExpression is null, then it means
24797         that we perform a call on this.
24798
24799 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
24800
24801         * expression.cs (Unary::Emit): Remove some dead code.
24802         (Probe): Implement Resolve and Emit for `is'.
24803         (Expression::ConvertImplicitRequired): Attempt to do constant
24804         expression conversions here.  Maybe should be moved to
24805         ConvertImplicit, but I am not sure.
24806         (Expression::ImplicitLongConstantConversionPossible,
24807         Expression::ImplicitIntConstantConversionPossible): New functions
24808         that tell whether is it possible to apply an implicit constant
24809         expression conversion.
24810
24811         (ConvertNumericExplicit): Started work on explicit numeric
24812         conversions.
24813
24814         * cs-parser.jay: Update operator constants.
24815
24816         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
24817         (Parameters::GetSignature): Hook up VerifyArgs here.
24818         (Parameters::VerifyArgs): Verifies that no two arguments have the
24819         same name. 
24820
24821         * class.cs (Operator): Update the operator names to reflect the
24822         ones that the spec expects (as we are just stringizing the
24823         operator names).
24824
24825         * expression.cs (Unary::ResolveOperator): Fix bug: Use
24826         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
24827         previous usage did only work for our methods.
24828         (Expression::ConvertImplicit): Handle decimal implicit numeric
24829         conversions as well.
24830         (Expression::InternalTypeConstructor): Used to invoke constructors
24831         on internal types for default promotions.
24832
24833         (Unary::Emit): Implement special handling for the pre/post
24834         increment/decrement for overloaded operators, as they need to have
24835         the same semantics as the other operators.
24836
24837         (Binary::ResolveOperator): ditto.
24838         (Invocation::ConversionExists): ditto.
24839         (UserImplicitCast::Resolve): ditto.
24840
24841 2001-09-26  Ravi Pratap  <ravi@ximian.com>
24842
24843         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
24844         operator, return after emitting body. Regression tests pass again !
24845
24846         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
24847         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
24848         (Invocation::OverloadResolve): Ditto.
24849         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
24850
24851         * everywhere : update calls to the above methods accordingly.
24852
24853 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
24854
24855         * assign.cs (Assign): Make it inherit from ExpressionStatement.
24856
24857         * expression.cs (ExpressionStatement): New base class used for
24858         expressions that can appear in statements, so that we can provide
24859         an alternate path to generate expression that do not leave a value
24860         on the stack.
24861
24862         (Expression::Emit, and all the derivatives): We no longer return
24863         whether a value is left on the stack or not.  Every expression
24864         after being emitted leaves a single value on the stack.
24865
24866         * codegen.cs (EmitContext::EmitStatementExpression): Use the
24867         facilties of ExpressionStatement if possible.
24868
24869         * cs-parser.jay: Update statement_expression.
24870
24871 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
24872
24873         * driver.cs: Change the wording of message
24874
24875 2001-09-25  Ravi Pratap  <ravi@ximian.com>
24876
24877         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
24878         the type of the expression to the return type of the method if
24879         we have an overloaded operator match ! The regression tests pass again !
24880         (Unary::ResolveOperator): Ditto.
24881
24882         * expression.cs (Invocation::ConversionExists): Correct the member lookup
24883         to find "op_Implicit", not "implicit" ;-)
24884         (UserImplicitCast): New class to take care of user-defined implicit conversions.
24885         (ConvertImplicit, ForceConversion): Take TypeContainer argument
24886
24887         * everywhere : Correct calls to the above accordingly.
24888
24889         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
24890         (ConvertImplicit): Do user-defined conversion if it exists.
24891
24892 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
24893
24894         * assign.cs: track location.
24895         (Resolve): Use implicit conversions on assignment.
24896
24897         * literal.cs: Oops.  Not good, Emit of short access values should
24898         pass (Bytes) or the wrong argument will be selected.
24899
24900         * expression.cs (Unary::Emit): Emit code for -expr.
24901
24902         (Unary::ResolveOperator): Handle `Substract' for non-constants
24903         (substract from zero from the non-constants).
24904         Deal with Doubles as well. 
24905
24906         (Expression::ConvertImplicitRequired): New routine that reports an
24907         error if no implicit conversion exists. 
24908
24909         (Invocation::OverloadResolve): Store the converted implicit
24910         expressions if we make them
24911
24912 2001-09-24  Ravi Pratap  <ravi@ximian.com>
24913
24914         * class.cs (ConstructorInitializer): Take a Location argument.
24915         (ConstructorBaseInitializer): Same here.
24916         (ConstructorThisInitializer): Same here.
24917
24918         * cs-parser.jay : Update all calls accordingly.
24919
24920         * expression.cs (Unary, Binary, New): Take location argument.
24921         Update accordingly everywhere.
24922
24923         * cs-parser.jay : Update all calls to the above to take a location
24924         argument.
24925
24926         * class.cs : Ditto.
24927
24928 2001-09-24  Ravi Pratap  <ravi@ximian.com>
24929
24930         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
24931         (Invocation::BetterConversion): Same here
24932         (Invocation::ConversionExists): Ditto.
24933
24934         (Invocation::ConversionExists): Implement.
24935
24936 2001-09-22  Ravi Pratap  <ravi@ximian.com>
24937
24938         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
24939         Also take an additional TypeContainer argument.
24940
24941         * All over : Pass in TypeContainer as argument to OverloadResolve.
24942
24943         * typemanager.cs (CSharpName): Update to check for the string type and return
24944         that too.
24945
24946         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
24947         a given method.
24948
24949 2001-09-21  Ravi Pratap  <ravi@ximian.com>
24950
24951         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
24952         (Invocation::BetterFunction): Implement.
24953         (Invocation::BetterConversion): Implement.
24954         (Invocation::ConversionExists): Skeleton, no implementation yet.
24955
24956         Okay, things work fine !
24957
24958 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
24959
24960         * typemanager.cs: declare and load enum_type, delegate_type and
24961         void_type. 
24962
24963         * expression.cs (Expression::Emit): Now emit returns a value that
24964         tells whether a value is left on the stack or not.  This strategy
24965         might be reveted tomorrow with a mechanism that would address
24966         multiple assignments.
24967         (Expression::report118): Utility routine to report mismatches on
24968         the ExprClass.
24969
24970         (Unary::Report23): Report impossible type/operator combination
24971         utility function.
24972
24973         (Unary::IsIncrementableNumber): Whether the type can be
24974         incremented or decremented with add.
24975         (Unary::ResolveOperator): Also allow enumerations to be bitwise
24976         complemented. 
24977         (Unary::ResolveOperator): Implement ++, !, ~,
24978
24979         (Invocation::Emit): Deal with new Emit convetion.
24980
24981         * All Expression derivatives: Updated their Emit method to return
24982         whether they leave values on the stack or not.
24983
24984         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
24985         stack for expressions that are statements. 
24986
24987 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24988
24989         * expression.cs (LValue): New interface.  Must be implemented by
24990         LValue objects.
24991         (LocalVariableReference, ParameterReference, FieldExpr): Implement
24992         LValue interface.
24993
24994         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
24995         interface for generating code, simplifies the code.
24996
24997 2001-09-20  Ravi Pratap  <ravi@ximian.com>
24998
24999         * expression.cs (everywhere): Comment out return statements in ::Resolve
25000         methods to avoid the warnings.
25001
25002 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
25003
25004         * driver.cs (parse): Report error 2001 if we can not open the
25005         source file.
25006
25007         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
25008         not resolve it.
25009
25010         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
25011         object. 
25012
25013         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
25014         otherwise nested blocks end up with the same index.
25015
25016         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
25017
25018         * expression.cs:  Instead of having FIXMEs in the Resolve
25019         functions, throw exceptions so it is obvious that we are facing a
25020         bug. 
25021
25022         * cs-parser.jay (invocation_expression): Pass Location information.
25023
25024         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
25025         Use a basename for those routines because .NET does not like paths
25026         on them. 
25027
25028         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
25029         already defined.
25030
25031 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
25032
25033         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
25034         are loading the correct data types (throws an exception if not).
25035         (TypeManager::InitCoreTypes): Use CoreLookupType
25036
25037         * expression.cs (Unary::ResolveOperator): return the child
25038         expression for expressions which are just +expr.
25039         (Unary::ResolveOperator): Return negative literals for -LITERAL
25040         expressions (otherwise they are Unary {Literal}).
25041         (Invocation::Badness): Take into account `Implicit constant
25042         expression conversions'.
25043
25044         * literal.cs (LongLiteral): Implement long literal class.
25045         (IntLiteral): export the `Value' of the intliteral. 
25046
25047 2001-09-19  Ravi Pratap  <ravi@ximian.com>
25048
25049         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
25050
25051         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
25052         instead of 'Operator'
25053
25054         * expression.cs (Binary::ResolveOperator): Update accordingly.
25055         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
25056         and 'Minus'
25057
25058         * cs-parser.jay (unary_expression): Update to use the new names.
25059
25060         * gen-treedump.cs (GetUnary): Same here.
25061
25062         * expression.cs (Unary::Resolve): Implement.
25063         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
25064         operators are found instead of making noise ;-)
25065         (Unary::ResolveOperator): New method to do precisely the same thing which
25066         Binary::ResolveOperator does for Binary expressions.
25067         (Unary.method, .Arguments): Add.
25068         (Unary::OperName): Implement.   
25069         (Unary::ForceConversion): Copy and Paste !
25070
25071         * class.cs (Operator::Define): Fix a small bug for the case when we have 
25072         a unary operator.
25073
25074         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
25075         for the inbuilt operators. Only overloading works for now ;-)
25076
25077 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
25078
25079         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
25080         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
25081
25082         * expression.cs (This::Emit): Implement. 
25083         (This::Resolve): Implement.
25084         (TypeOf:Resolve): Implement.
25085         (Expression::ResolveSimpleName): Add an implicit this to instance
25086         field references. 
25087         (MemberAccess::Resolve): Deal with Parameters and Fields. 
25088         Bind instance variable to Field expressions.
25089         (FieldExpr::Instance): New field used to track the expression that
25090         represents the object instance.
25091         (FieldExpr::Resolve): Track potential errors from MemberLookup not
25092         binding 
25093         (FieldExpr::Emit): Implement.
25094
25095         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
25096         the last instruction contains a return opcode to avoid generating
25097         the last `ret' instruction (this generates correct code, and it is
25098         nice to pass the peverify output).
25099
25100         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
25101         initializer for static and instance variables.
25102         (Constructor::Emit): Allow initializer to be null in the case of
25103         static constructors.  Only emit initializer for instance
25104         constructors. 
25105
25106         (TypeContainer::FindMembers): Return a null array if there are no
25107         matches.
25108
25109         Also fix the code for the MemberTypes.Method branch, as it was not
25110         scanning that for operators (or tried to access null variables before).
25111
25112         * assign.cs (Assign::Emit): Handle instance and static fields. 
25113
25114         * TODO: Updated.
25115
25116         * driver.cs: Stop compilation if there are parse errors.
25117
25118         * cs-parser.jay (constructor_declaration): Provide default base
25119         initializer for non-static constructors.
25120         (constructor_declarator): Do not provide a default base
25121         initializers if none was specified.
25122         Catch the fact that constructors should not have parameters.
25123
25124         * class.cs: Do not emit parent class initializers for static
25125         constructors, that should be flagged as an error.
25126
25127 2001-09-18  Ravi Pratap  <ravi@ximian.com>
25128
25129         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
25130         Move back code into TypeContainer::Populate.
25131
25132 2001-09-18  Ravi Pratap  <ravi@ximian.com>
25133
25134         * class.cs (TypeContainer::AddConstructor): Fix the check to
25135         compare against Name, not Basename. 
25136         (Operator::OpType): Change Plus and Minus to Add and Subtract.
25137
25138         * cs-parser.jay : Update accordingly.
25139
25140         * class.cs (TypeContainer::FindMembers): For the case where we are searching
25141         for methods, don't forget to look into the operators too.
25142         (RegisterMethodBuilder): Helper method to take care of this for
25143         methods, constructors and operators.
25144         (Operator::Define): Completely revamp.
25145         (Operator.OperatorMethod, MethodName): New fields.
25146         (TypeContainer::Populate): Move the registering of builders into
25147         RegisterMethodBuilder.
25148         (Operator::Emit): Re-write.
25149
25150         * expression.cs (Binary::Emit): Comment out code path to emit method
25151         invocation stuff for the case when we have a user defined operator. I am
25152         just not able to get it right !
25153
25154 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
25155
25156         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
25157         argument. 
25158
25159         (Expression::MemberLookup): Provide a version that allows to
25160         specify the MemberTypes and BindingFlags. 
25161
25162         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
25163         so it was not fetching variable information from outer blocks.
25164
25165         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
25166         Beforefieldinit as it was buggy.
25167
25168         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
25169         that Ravi put here.  
25170
25171         * class.cs (Constructor::Emit): Only emit if block is not null.
25172         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
25173         deal with this by semantically definining it as if the user had
25174         done it.
25175
25176         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
25177         constructors as we now "emit" them at a higher level.
25178
25179         (TypeContainer::DefineDefaultConstructor): Used to define the
25180         default constructors if none was provided.
25181
25182         (ConstructorInitializer): Add methods Resolve and Emit. 
25183
25184         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
25185
25186 2001-09-17  Ravi Pratap  <ravi@ximian.com>
25187
25188         * class.cs (TypeContainer::EmitDefaultConstructor): Register
25189         the default constructor builder with our hashtable for methodbuilders
25190         to methodcores.
25191
25192         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
25193         and argument_count is 0 in which case we have a match.
25194         (Binary::ResolveOperator): More null checking and miscellaneous coding
25195         style cleanup.
25196
25197 2001-09-17  Ravi Pratap  <ravi@ximian.com>
25198
25199         * rootcontext.cs (IsNameSpace): Compare against null.
25200
25201         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
25202
25203         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
25204         and Unary::Operator.
25205
25206         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
25207         accordingly.
25208
25209         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
25210         we have overloaded operators.
25211         (Binary::ResolveOperator): Implement the part which does the operator overload
25212         resolution.
25213
25214         * class.cs (Operator::Emit): Implement.
25215         (TypeContainer::Emit): Emit the operators we have too.
25216
25217         * expression.cs (Binary::Emit): Update to emit the appropriate code for
25218         the case when we have a user-defined operator.
25219
25220 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
25221
25222         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
25223
25224 2001-09-16  Ravi Pratap  <ravi@ximian.com>
25225
25226         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
25227         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
25228         (Constructor::Emit): Implement.
25229         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
25230         if we have no work to do. 
25231         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
25232         Emit method.
25233
25234         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
25235         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
25236
25237         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
25238         of parent.parent.
25239
25240 2001-09-15  Ravi Pratap  <ravi@ximian.com>
25241
25242         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
25243         in the source.
25244         (Tree::RecordNamespace): Method to do what the name says ;-)
25245         (Tree::Namespaces): Property to get at the namespaces hashtable.
25246
25247         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
25248         keep track.
25249
25250         * rootcontext.cs (IsNamespace): Fixed it :-)
25251
25252 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
25253
25254         * class.cs (TypeContainer::FindMembers): Add support for
25255         constructors. 
25256         (MethodCore): New class that encapsulates both the shared aspects
25257         of a Constructor and a Method.  
25258         (Method, Constructor): Factored pieces into MethodCore.
25259
25260         * driver.cs: Added --fatal which makes errors throw exceptions.
25261         Load System assembly as well as part of the standard library.
25262
25263         * report.cs: Allow throwing exceptions on errors for debugging.
25264
25265         * modifiers.cs: Do not use `parent', instead use the real type
25266         container to evaluate permission settings.
25267
25268         * class.cs: Put Ravi's patch back in.  He is right, and we will
25269         have to cope with the
25270
25271 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25272
25273         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
25274         FamORAssem, not FamANDAssem.
25275
25276 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
25277
25278         * driver.cs: Added --parse option that only parses its input files
25279         and terminates.
25280
25281         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
25282         incorrect.  IsTopLevel is not used to tell whether an object is
25283         root_types or not (that can be achieved by testing this ==
25284         root_types).  But to see if this is a top-level *class* (not
25285         necessarly our "toplevel" container). 
25286
25287 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25288
25289         * enum.cs (Enum::Define): Modify to call the Lookup method on the
25290         parent instead of a direct call to GetType.
25291
25292 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25293
25294         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
25295         Modifiers.TypeAttr. This should just be a call to that method.
25296
25297         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
25298         object so that we can determine if we are top-level or not.
25299
25300         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
25301         TypeContainer too.
25302
25303         * enum.cs (Enum::Define): Ditto.
25304
25305         * modifiers.cs (FieldAttr): Re-write.
25306
25307         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
25308         (TypeContainer::HaveStaticConstructor): New property to provide access
25309         to precisely that info.
25310
25311         * modifiers.cs (MethodAttr): Re-write.
25312         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
25313
25314         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
25315         of top-level types as claimed.
25316
25317 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
25318
25319         * expression.cs (MemberLookup): Fruitless attempt to lookup
25320         constructors.  Maybe I need to emit default constructors?  That
25321         might be it (currently .NET emits this for me automatically).
25322         (Invocation::OverloadResolve): Cope with Arguments == null.
25323         (Invocation::EmitArguments): new function, shared by the new
25324         constructor and us.
25325         (Invocation::Emit): Handle static and instance methods.  Emit
25326         proper call instruction for virtual or non-virtual invocations.
25327         (New::Emit): Implement.
25328         (New::Resolve): Implement.
25329         (MemberAccess:Resolve): Implement.
25330         (MethodGroupExpr::InstanceExpression): used conforming to the spec
25331         to track instances.
25332         (FieldExpr::Resolve): Set type.
25333
25334         * support.cs: Handle empty arguments.
25335                 
25336         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
25337         SimpleLookup): Auxiliary routines to help parse a qualifier
25338         identifier.  
25339
25340         Update qualifier_identifier rule.
25341
25342         * codegen.cs: Removed debugging messages.
25343
25344         * class.cs: Make this a global thing, this acts just as a "key" to
25345         objects that we might have around.
25346
25347         (Populate): Only initialize method_builders_to_methods once.
25348
25349         * expression.cs (PropertyExpr): Initialize type from the
25350         PropertyType. 
25351
25352         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
25353         Resolve pattern.  Attempt to implicitly convert value to boolean.
25354         Emit code.
25355
25356         * expression.cs: Set the type for the int32/int32 argument case.
25357         (Binary::ResolveOperator): Set the return type to boolean for
25358         comparission operators
25359
25360         * typemanager.cs: Remove debugging print code.
25361
25362         (Invocation::Resolve): resolve type.
25363
25364         * class.cs: Allocate a MemberInfo of the correct size, as the code
25365         elsewhere depends on the test to reflect the correct contents.
25366
25367         (Method::) Keep track of parameters, due to System.Reflection holes
25368
25369         (TypeContainer::Populate): Keep track of MethodBuilders to Method
25370         mapping here.
25371
25372         (TypeContainer::FindMembers): Use ArrayList and then copy an array
25373         of the exact size and return that.
25374
25375         (Class::LookupMethodByBuilder): New function that maps
25376         MethodBuilders to its methods.  Required to locate the information
25377         on methods because System.Reflection bit us again.
25378
25379         * support.cs: New file, contains an interface ParameterData and
25380         two implementations: ReflectionParameters and InternalParameters
25381         used to access Parameter information.  We will need to grow this
25382         as required.
25383
25384         * expression.cs (Invocation::GetParameterData): implement a cache
25385         and a wrapper around the ParameterData creation for methods. 
25386         (Invocation::OverloadResolve): Use new code.
25387
25388 2001-09-13  Ravi Pratap  <ravi@ximian.com>
25389
25390         * class.cs (TypeContainer::EmitField): Remove and move into 
25391         (Field::Define): here and modify accordingly.
25392         (Field.FieldBuilder): New member.
25393         (TypeContainer::Populate): Update accordingly.
25394         (TypeContainer::FindMembers): Implement.
25395
25396 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
25397
25398         * statement.cs: (VariableInfo::VariableType): New field to be
25399         initialized with the full type once it is resolved. 
25400
25401 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
25402
25403         * parameter.cs (GetParameterInfo): Use a type cache to compute
25404         things only once, and to reuse this information
25405
25406         * expression.cs (LocalVariableReference::Emit): Implement.
25407         (OpcodeCast::Emit): fix.
25408
25409         (ParameterReference::Resolve): Implement.
25410         (ParameterReference::Emit): Implement.
25411
25412         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
25413         that are expressions need to stay as Expressions.
25414
25415         * typemanager.cs (CSharpName): Returns the C# name of a type if
25416         possible. 
25417
25418         * expression.cs (Expression::ConvertImplicit): New function that
25419         implements implicit type conversions.
25420
25421         (Expression::ImplicitReferenceConversion): Implements implicit
25422         reference conversions.
25423
25424         (EmptyCast): New type for transparent casts.
25425
25426         (OpcodeCast): New type for casts of types that are performed with
25427         a sequence of bytecodes.
25428
25429         (BoxedCast): New type used for casting value types into reference
25430         types.  Emits a box opcode.
25431
25432         (Binary::DoNumericPromotions): Implements numeric promotions of
25433         and computation of the Binary::Type.
25434
25435         (Binary::EmitBranchable): Optimization.
25436
25437         (Binary::Emit): Implement code emission for expressions.
25438
25439         * typemanager.cs (TypeManager): Added two new core types: sbyte
25440         and byte.
25441
25442 2001-09-12  Ravi Pratap  <ravi@ximian.com>
25443
25444         * class.cs (TypeContainer::FindMembers): Method which does exactly
25445         what Type.FindMembers does, only we don't have to use reflection. No
25446         implementation yet.
25447
25448         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
25449         typecontainer objects as we need to get at them.
25450         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
25451
25452         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
25453         typecontainer object.
25454
25455         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
25456         of just a Report object.
25457
25458 2001-09-11  Ravi Pratap  <ravi@ximian.com>
25459
25460         * class.cs (Event::Define): Go back to using the prefixes "add_" and
25461         "remove_"
25462         (TypeContainer::Populate): Now define the delegates of the type too.
25463         (TypeContainer.Delegates): Property to access the list of delegates defined
25464         in the type.
25465
25466         * delegates.cs (Delegate::Define): Implement partially.
25467
25468         * modifiers.cs (TypeAttr): Handle more flags.
25469
25470 2001-09-11  Ravi Pratap  <ravi@ximian.com>
25471
25472         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
25473         and not <=
25474         (Operator::Define): Re-write logic to get types by using the LookupType method
25475         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
25476         (Indexer::Define): Ditto.
25477         (Event::Define): Ditto.
25478         (Property::Define): Ditto.
25479
25480 2001-09-10  Ravi Pratap  <ravi@ximian.com>
25481
25482         * class.cs (TypeContainer::Populate): Now define operators too. 
25483         (TypeContainer.Operators): New property to access the list of operators
25484         in a type.
25485         (Operator.OperatorMethodBuilder): New member to hold the method builder
25486         for the operator we are defining.
25487         (Operator::Define): Implement.
25488
25489 2001-09-10  Ravi Pratap  <ravi@ximian.com>
25490
25491         * class.cs (Event::Define): Make the prefixes of the accessor methods
25492         addOn_ and removeOn_ 
25493
25494         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
25495         of the location being passed in too. Ideally, this should go later since all
25496         error reporting should be done through the Report object.
25497
25498         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
25499         (Populate): Iterate thru the indexers we have and define them too.
25500         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
25501         for the get and set accessors.
25502         (Indexer::Define): Implement.
25503
25504 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
25505
25506         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
25507         my previous implementation, did not work.
25508
25509         * typemanager.cs: Add a couple of missing types (the longs).
25510
25511         * literal.cs: Use TypeManager.bool_type instead of getting it.
25512
25513         * expression.cs (EventExpr): New kind of expressions.
25514         (Expressio::ExprClassFromMemberInfo): finish
25515
25516 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
25517
25518         * assign.cs: Emit stores to static fields differently.
25519
25520 2001-09-08  Ravi Pratap  <ravi@ximian.com>
25521
25522         * Merge in changes and adjust code to tackle conflicts. Backed out my
25523         code in Assign::Resolve ;-) 
25524
25525 2001-09-08  Ravi Pratap  <ravi@ximian.com>
25526
25527         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
25528         instead Report.Error and also pass in the location.
25529         (CSharpParser::Lexer): New readonly property to return the reference
25530         to the Tokenizer object.
25531         (declare_local_variables): Use Report.Error with location instead of plain 
25532         old error.
25533         (CheckDef): Ditto.
25534
25535         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
25536         (Operator.CheckBinaryOperator): Ditto.
25537
25538         * cs-parser.jay (operator_declarator): Update accordingly.
25539
25540         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
25541         (CheckBinaryOperator): Same here.
25542
25543         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
25544         on the name without any prefixes of namespace names etc. This is because we
25545         already might have something already fully qualified like 
25546         'System.Console.WriteLine'
25547
25548         * assign.cs (Resolve): Begin implementation. Stuck ;-)
25549
25550 2001-09-07  Ravi Pratap  <ravi@ximian.com>
25551
25552         * cs-tokenizer.cs (location): Return a string which also contains
25553         the file name.
25554
25555         * expression.cs (ElementAccess): New class for expressions of the
25556         type 'element access.'
25557         (BaseAccess): New class for expressions of the type 'base access.'
25558         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
25559         respectively.
25560
25561         * cs-parser.jay (element_access): Implement action.
25562         (base_access): Implement actions.
25563         (checked_expression, unchecked_expression): Implement.
25564
25565         * cs-parser.jay (local_variable_type): Correct and implement.
25566         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
25567
25568         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
25569
25570         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
25571         name and the specifiers.
25572
25573         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
25574
25575         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
25576         making them all public ;-)
25577
25578         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
25579         class anyways.
25580
25581 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
25582
25583         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
25584         PropertyExprs.
25585         (FieldExpr, PropertyExprs): New resolved expressions.
25586         (SimpleName::MemberStaticCheck): Perform static checks for access
25587         to non-static fields on static methods. Maybe this should be
25588         generalized for MemberAccesses. 
25589         (SimpleName::ResolveSimpleName): More work on simple name
25590         resolution. 
25591
25592         * cs-parser.jay (primary_expression/qualified_identifier): track
25593         the parameter index.
25594
25595         * codegen.cs (CodeGen::Save): Catch save exception, report error.
25596         (EmitContext::EmitBoolExpression): Chain to expression generation
25597         instead of temporary hack.
25598         (::EmitStatementExpression): Put generic expression code generation.
25599
25600         * assign.cs (Assign::Emit): Implement variable assignments to
25601         local variables, parameters and fields.
25602
25603 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
25604
25605         * statement.cs (Block::GetVariableInfo): New method, returns the
25606         VariableInfo for a variable name in a block.
25607         (Block::GetVariableType): Implement in terms of GetVariableInfo
25608
25609         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
25610         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
25611
25612 2001-09-06  Ravi Pratap  <ravi@ximian.com>
25613
25614         * cs-parser.jay (operator_declaration): Continue on my quest : update
25615         to take attributes argument.
25616         (event_declaration): Ditto.
25617         (enum_declaration): Ditto.
25618         (indexer_declaration): Ditto.
25619
25620         * class.cs (Operator::Operator): Update constructor accordingly.
25621         (Event::Event): Ditto.
25622
25623         * delegate.cs (Delegate::Delegate): Same here.
25624
25625         * enum.cs (Enum::Enum): Same here.
25626
25627 2001-09-05  Ravi Pratap  <ravi@ximian.com>
25628
25629         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
25630
25631         * ../tests/cs0658.cs : New file to demonstrate error 0658.
25632
25633         * attribute.cs (Attributes): New class to encapsulate all attributes which were
25634         being passed around as an arraylist.
25635         (Attributes::AddAttribute): Method to add attribute sections.
25636
25637         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
25638         (struct_declaration): Update accordingly.
25639         (constant_declaration): Update.
25640         (field_declaration): Update.
25641         (method_header): Update.
25642         (fixed_parameter): Update.
25643         (parameter_array): Ditto.
25644         (property_declaration): Ditto.
25645         (destructor_declaration): Ditto.
25646
25647         * class.cs (Struct::Struct): Update constructors accordingly.
25648         (Class::Class): Ditto.
25649         (Field::Field): Ditto.
25650         (Method::Method): Ditto.
25651         (Property::Property): Ditto.
25652         (TypeContainer::OptAttribute): update property's return type.
25653
25654         * interface.cs (Interface.opt_attributes): New member.
25655         (Interface::Interface): Update to take the extra Attributes argument.
25656
25657         * parameter.cs (Parameter::Parameter): Ditto.
25658
25659         * constant.cs (Constant::Constant): Ditto.
25660
25661         * interface.cs (InterfaceMemberBase): New OptAttributes field.
25662         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
25663         the attributes as a parameter.
25664         (InterfaceProperty): Update constructor call.
25665         (InterfaceEvent): Ditto.
25666         (InterfaceMethod): Ditto.
25667         (InterfaceIndexer): Ditto.
25668
25669         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
25670         pass the attributes too.
25671         (interface_event_declaration): Ditto.
25672         (interface_property_declaration): Ditto.
25673         (interface_method_declaration): Ditto.
25674         (interface_declaration): Ditto.
25675
25676 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
25677
25678         * class.cs (Method::Define): Track the "static Main" definition to
25679         create an entry point. 
25680
25681         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
25682         EntryPoint if we find it. 
25683
25684         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
25685         (EmitContext::ig): Make this variable public.
25686
25687         * driver.cs: Make the default output file be the first file name
25688         with the .exe extension.  
25689
25690         Detect empty compilations
25691
25692         Handle various kinds of output targets.  Handle --target and
25693         rename -t to --dumper.
25694
25695         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
25696         methods inherited from Expression return now an Expression.  This
25697         will is used during the tree rewriting as we resolve them during
25698         semantic analysis.
25699
25700         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
25701         the spec.  Missing entirely is the information about
25702         accessability of elements of it.
25703
25704         (Expression::ExprClassFromMemberInfo): New constructor for
25705         Expressions that creates a fully initialized Expression based on
25706         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
25707         a Type.
25708
25709         (Invocation::Resolve): Begin implementing resolution of invocations.
25710
25711         * literal.cs (StringLiteral):  Implement Emit.
25712
25713 2001-09-05  Ravi Pratap  <ravi@ximian.com>
25714
25715         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
25716         member.
25717
25718 2001-09-04  Ravi Pratap  <ravi@ximian.com>
25719
25720         * cs-parser.jay (attribute_arguments): Implement actions.
25721         (attribute): Fix bug in production. Implement action.
25722         (attribute_list): Implement.
25723         (attribute_target): Implement.
25724         (attribute_target_specifier, opt_target_specifier): Implement
25725         (CheckAttributeTarget): New method to check if the attribute target
25726         is valid.
25727         (attribute_section): Implement.
25728         (opt_attributes): Implement.
25729
25730         * attribute.cs : New file to handle attributes.
25731         (Attribute): Class to hold attribute info.
25732
25733         * cs-parser.jay (opt_attribute_target_specifier): Remove production
25734         (attribute_section): Modify production to use 2 different rules to 
25735         achieve the same thing. 1 s/r conflict down !
25736         Clean out commented, useless, non-reducing dimension_separator rules.
25737
25738         * class.cs (TypeContainer.attributes): New member to hold list
25739         of attributes for a type.
25740         (Struct::Struct): Modify to take one more argument, the attribute list.
25741         (Class::Class): Ditto.
25742         (Field::Field): Ditto.
25743         (Method::Method): Ditto.
25744         (Property::Property): Ditto.
25745
25746         * cs-parser.jay (struct_declaration): Update constructor call to
25747         pass in the attributes too.
25748         (class_declaration): Ditto.
25749         (constant_declaration): Ditto.
25750         (field_declaration): Ditto.
25751         (method_header): Ditto.
25752         (fixed_parameter): Ditto.
25753         (parameter_array): Ditto.
25754         (property_declaration): Ditto.
25755
25756         * constant.cs (Constant::Constant): Update constructor similarly.
25757         Use System.Collections.
25758
25759         * parameter.cs (Parameter::Parameter): Update as above.
25760
25761 2001-09-02  Ravi Pratap  <ravi@ximian.com>
25762
25763         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
25764         (TypeContainer.delegates): New member to hold list of delegates.
25765
25766         * cs-parser.jay (delegate_declaration): Implement the action correctly 
25767         this time as I seem to be on crack ;-)
25768
25769 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
25770
25771         * rootcontext.cs (RootContext::IsNamespace): new function, used to
25772         tell whether an identifier represents a namespace.
25773
25774         * expression.cs (NamespaceExpr): A namespace expression, used only
25775         temporarly during expression resolution.
25776         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
25777         utility functions to resolve names on expressions.
25778
25779 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
25780
25781         * codegen.cs: Add hook for StatementExpressions. 
25782
25783         * class.cs: Fix inverted test for static flag in methods.
25784
25785 2001-09-02  Ravi Pratap  <ravi@ximian.com>
25786
25787         * class.cs (Operator::CheckUnaryOperator): Correct error number used
25788         to make it coincide with MS' number.
25789         (Operator::CheckBinaryOperator): Ditto.
25790
25791         * ../errors/errors.txt : Remove error numbers added earlier.
25792
25793         * ../errors/cs1019.cs : Test case for error # 1019
25794
25795         * ../errros/cs1020.cs : Test case for error # 1020
25796
25797         * cs-parser.jay : Clean out commented cruft.
25798         (dimension_separators, dimension_separator): Comment out. Ostensibly not
25799         used anywhere - non-reducing rule.
25800         (namespace_declarations): Non-reducing rule - comment out.
25801
25802         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
25803         with TypeContainer::AddEnum.
25804
25805         * delegate.cs : New file for delegate handling classes.
25806         (Delegate): Class for declaring delegates.
25807
25808         * makefile : Update.
25809
25810         * cs-parser.jay (delegate_declaration): Implement.
25811
25812 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
25813
25814         * class.cs (Event::Define): Implement.
25815         (Event.EventBuilder): New member.
25816
25817         * class.cs (TypeContainer::Populate): Update to define all enums and events
25818         we have.
25819         (Events): New property for the events arraylist we hold. Shouldn't we move to using
25820         readonly fields for all these cases ?
25821
25822 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
25823
25824         * class.cs (Property): Revamp to use the convention of making fields readonly.
25825         Accordingly modify code elsewhere.
25826
25827         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
25828         the Define method of the Property class.
25829
25830         * class.cs : Clean up applied patch and update references to variables etc. Fix 
25831         trivial bug.
25832         (TypeContainer::Populate): Update to define all the properties we have. Also
25833         define all enumerations.
25834
25835         * enum.cs (Define): Implement.
25836
25837 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
25838
25839         * cs-parser.jay (overloadable_operator): The semantic value is an
25840         enum of the Operator class.
25841         (operator_declarator): Implement actions.
25842         (operator_declaration): Implement.
25843
25844         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
25845         validity of definitions.
25846         (Operator::CheckBinaryOperator): Static method to check for binary operators
25847         (TypeContainer::AddOperator): New method to add an operator to a type.
25848
25849         * cs-parser.jay (indexer_declaration): Added line to actually call the
25850         AddIndexer method so it gets added ;-)
25851
25852         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
25853         already taken care of by the MS compiler ?  
25854
25855 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
25856
25857         * class.cs (Operator): New class for operator declarations.
25858         (Operator::OpType): Enum for the various operators.
25859
25860 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
25861
25862         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
25863         ostensibly handle this in semantic analysis.
25864
25865         * cs-parser.jay (general_catch_clause): Comment out
25866         (specific_catch_clauses, specific_catch_clause): Ditto.
25867         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
25868         (catch_args, opt_catch_args): New productions.
25869         (catch_clause): Rewrite to use the new productions above
25870         (catch_clauses): Modify accordingly.
25871         (opt_catch_clauses): New production to use in try_statement
25872         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
25873         and re-write the code in the actions to extract the specific and
25874         general catch clauses by being a little smart ;-)
25875
25876         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
25877         Hooray, try and catch statements parse fine !
25878
25879 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25880
25881         * statement.cs (Block::GetVariableType): Fix logic to extract the type
25882         string from the hashtable of variables.
25883
25884         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
25885         I end up making that mistake ;-)
25886         (catch_clauses): Fixed gross error which made Key and Value of the 
25887         DictionaryEntry the same : $1 !!
25888
25889 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25890
25891         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
25892
25893         * cs-parser.jay (event_declaration): Correct to remove the semicolon
25894         when the add and remove accessors are specified. 
25895
25896 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25897
25898         * cs-parser.jay (IndexerDeclaration): New helper class to hold
25899         information about indexer_declarator.
25900         (indexer_declarator): Implement actions.
25901         (parsing_indexer): New local boolean used to keep track of whether
25902         we are parsing indexers or properties. This is necessary because 
25903         implicit_parameters come into picture even for the get accessor in the 
25904         case of an indexer.
25905         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
25906
25907         * class.cs (Indexer): New class for indexer declarations.
25908         (TypeContainer::AddIndexer): New method to add an indexer to a type.
25909         (TypeContainer::indexers): New member to hold list of indexers for the
25910         type.
25911
25912 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
25913
25914         * cs-parser.jay (add_accessor_declaration): Implement action.
25915         (remove_accessor_declaration): Implement action.
25916         (event_accessors_declaration): Implement
25917         (variable_declarators): swap statements for first rule - trivial.
25918
25919         * class.cs (Event): New class to hold information about event
25920         declarations.
25921         (TypeContainer::AddEvent): New method to add an event to a type
25922         (TypeContainer::events): New member to hold list of events.
25923
25924         * cs-parser.jay (event_declaration): Implement actions.
25925
25926 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
25927
25928         * cs-parser.jay (dim_separators): Implement. Make it a string
25929         concatenating all the commas together, just as they appear.
25930         (opt_dim_separators): Modify accordingly
25931         (rank_specifiers): Update accordingly. Basically do the same
25932         thing - instead, collect the brackets here.
25933         (opt_rank_sepcifiers): Modify accordingly.
25934         (array_type): Modify to actually return the complete type string
25935         instead of ignoring the rank_specifiers.
25936         (expression_list): Implement to collect the expressions
25937         (variable_initializer): Implement. We make it a list of expressions
25938         essentially so that we can handle the array_initializer case neatly too.
25939         (variable_initializer_list): Implement.
25940         (array_initializer): Make it a list of variable_initializers
25941         (opt_array_initializer): Modify accordingly.
25942
25943         * expression.cs (New::NType): Add enumeration to help us
25944         keep track of whether we have an object/delegate creation
25945         or an array creation.
25946         (New:NewType, New::Rank, New::Indices, New::Initializers): New
25947         members to hold data about array creation.
25948         (New:New): Modify to update NewType
25949         (New:New): New Overloaded contructor for the array creation
25950         case.
25951
25952         * cs-parser.jay (array_creation_expression): Implement to call
25953         the overloaded New constructor.
25954
25955 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
25956
25957         * class.cs (TypeContainer::Constructors): Return member
25958         constructors instead of returning null.
25959
25960 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
25961
25962         * typemanager.cs (InitCoreTypes): Initialize the various core
25963         types after we have populated the type manager with the user
25964         defined types (this distinction will be important later while
25965         compiling corlib.dll)
25966
25967         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
25968         on Expression Classification.  Now all expressions have a method
25969         `Resolve' and a method `Emit'.
25970
25971         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
25972         generation from working.     Also add some temporary debugging
25973         code. 
25974
25975 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
25976
25977         * codegen.cs: Lots of code generation pieces.  This is only the
25978         beginning, will continue tomorrow with more touches of polish.  We
25979         handle the fundamentals of if, while, do, for, return.  Others are
25980         trickier and I need to start working on invocations soon.
25981
25982         * gen-treedump.cs: Bug fix, use s.Increment here instead of
25983         s.InitStatement. 
25984
25985         * codegen.cs (EmitContext): New struct, used during code
25986         emission to keep a context.   Most of the code generation will be
25987         here. 
25988
25989         * cs-parser.jay: Add embedded blocks to the list of statements of
25990         this block.  So code generation proceeds in a top down fashion.
25991
25992 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
25993
25994         * statement.cs: Add support for multiple child blocks.
25995
25996 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
25997
25998         * codegen.cs (EmitCode): New function, will emit the code for a
25999         Block of code given a TypeContainer and its ILGenerator. 
26000
26001         * statement.cs (Block): Standard public readonly optimization.
26002         (Block::Block constructors): Link children. 
26003         (Block::Child): Child Linker.
26004         (Block::EmitVariables): Emits IL variable declarations.
26005
26006         * class.cs: Drop support for MethodGroups here, delay until
26007         Semantic Analysis.
26008         (Method::): Applied the same simplification that I did before, and
26009         move from Properties to public readonly fields.
26010         (Method::ParameterTypes): Returns the parameter types for the
26011         function, and implements a cache that will be useful later when I
26012         do error checking and the semantic analysis on the methods is
26013         performed.
26014         (Constructor::GetCallingConvention): Renamed from CallingConvetion
26015         and made a method, optional argument tells whether this is a class
26016         or a structure to apply the `has-this' bit.
26017         (Method::GetCallingConvention): Implement, returns the calling
26018         convention. 
26019         (Method::Define): Defines the type, a second pass is performed
26020         later to populate the methods.
26021
26022         (Constructor::ParameterTypes): implement a cache similar to the
26023         one on Method::ParameterTypes, useful later when we do semantic
26024         analysis. 
26025
26026         (TypeContainer::EmitMethod):  New method.  Emits methods.
26027
26028         * expression.cs: Removed MethodGroup class from here.
26029
26030         * parameter.cs (Parameters::GetCallingConvention): new method.
26031
26032 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
26033
26034         * class.cs (TypeContainer::Populate): Drop RootContext from the
26035         argument. 
26036
26037         (Constructor::CallingConvention): Returns the calling convention.
26038         (Constructor::ParameterTypes): Returns the constructor parameter
26039         types. 
26040
26041         (TypeContainer::AddConstructor): Keep track of default constructor
26042         and the default static constructor.
26043
26044         (Constructor::) Another class that starts using `public readonly'
26045         instead of properties. 
26046
26047         (Constructor::IsDefault): Whether this is a default constructor. 
26048
26049         (Field::) use readonly public fields instead of properties also.
26050
26051         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
26052         track of static constructors;  If none is used, turn on
26053         BeforeFieldInit in the TypeAttributes. 
26054
26055         * cs-parser.jay (opt_argument_list): now the return can be null
26056         for the cases where there are no arguments. 
26057
26058         (constructor_declarator): If there is no implicit `base' or
26059         `this', then invoke the default parent constructor. 
26060
26061         * modifiers.cs (MethodAttr): New static function maps a set of
26062         modifiers flags into a MethodAttributes enum
26063         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
26064         MethodAttr, TypeAttr to represent the various mappings where the
26065         modifiers are used.
26066         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
26067
26068 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
26069
26070         * parameter.cs (GetParameterInfo): Fix bug where there would be no
26071         method arguments.
26072
26073         * interface.cs (PopulateIndexer): Implemented the code generator
26074         for interface indexers.
26075
26076 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
26077
26078         * interface.cs (InterfaceMemberBase): Now we track the new status
26079         here.  
26080
26081         (PopulateProperty): Implement property population.  Woohoo!  Got
26082         Methods and Properties going today. 
26083
26084         Removed all the properties for interfaces, and replaced them with
26085         `public readonly' fields. 
26086
26087 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
26088
26089         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
26090         initialize their hashtables/arraylists only when they are needed
26091         instead of doing this always.
26092
26093         * parameter.cs: Handle refs and out parameters.
26094
26095         * cs-parser.jay: Use an ArrayList to construct the arguments
26096         instead of the ParameterCollection, and then cast that to a
26097         Parameter[] array.
26098
26099         * parameter.cs: Drop the use of ParameterCollection and use
26100         instead arrays of Parameters.
26101
26102         (GetParameterInfo): Use the Type, not the Name when resolving
26103         types. 
26104
26105 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
26106
26107         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
26108         and instead use public readonly fields.
26109
26110         * class.cs: Put back walking code for type containers.
26111
26112 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
26113
26114         * class.cs (MakeConstant): Code to define constants.
26115
26116         * rootcontext.cs (LookupType): New function.  Used to locate types 
26117
26118
26119 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
26120
26121         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
26122         this System.Reflection code is.  Kudos to Microsoft
26123
26124         * typemanager.cs: Implement a type cache and avoid loading all
26125         types at boot time.  Wrap in LookupType the internals.  This made
26126         the compiler so much faster.  Wow.  I rule!
26127
26128         * driver.cs: Make sure we always load mscorlib first (for
26129         debugging purposes, nothing really important).
26130
26131         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
26132         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
26133
26134         * rootcontext.cs: Lookup types on their namespace;  Lookup types
26135         on namespaces that have been imported using the `using' keyword.
26136
26137         * class.cs (TypeContainer::TypeAttr): Virtualize.
26138         (Class::TypeAttr): Return attributes suitable for this bad boy.
26139         (Struct::TypeAttr): ditto.
26140         Handle nested classes.
26141         (TypeContainer::) Remove all the type visiting code, it is now
26142         replaced with the rootcontext.cs code
26143
26144         * rootcontext.cs (GetClassBases): Added support for structs. 
26145
26146 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
26147
26148         * interface.cs, statement.cs, class.cs, parameter.cs,
26149         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
26150         Drop use of TypeRefs, and use strings instead.
26151
26152 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
26153
26154         * rootcontext.cs: 
26155
26156         * class.cs (Struct::Struct): set the SEALED flags after
26157         checking the modifiers.
26158         (TypeContainer::TypeAttr): new property, returns the
26159         TypeAttributes for a class.  
26160
26161         * cs-parser.jay (type_list): Oops, list production was creating a
26162         new list of base types.
26163
26164         * rootcontext.cs (StdLib): New property.
26165         (GetInterfaceTypeByName): returns an interface by type name, and
26166         encapsulates error handling here.
26167         (GetInterfaces): simplified.
26168         (ResolveTree): Encapsulated all the tree resolution here.
26169         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
26170         types. 
26171
26172         * driver.cs: Add support for --nostdlib, to avoid loading the
26173         default assemblies.
26174         (Main): Do not put tree resolution here. 
26175
26176         * rootcontext.cs: Beginning of the class resolution.
26177
26178 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
26179
26180         * rootcontext.cs: Provide better error reporting. 
26181
26182         * cs-parser.jay (interface_base): set our $$ to be interfaces.
26183
26184         * rootcontext.cs (CreateInterface): Handle the case where there
26185         are no parent interfaces.
26186
26187         (CloseTypes): Routine to flush types at the end.
26188         (CreateInterface): Track types.
26189         (GetInterfaces): Returns an array of Types from the list of
26190         defined interfaces.
26191
26192         * typemanager.c (AddUserType): Mechanism to track user types (puts
26193         the type on the global type hash, and allows us to close it at the
26194         end). 
26195
26196 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
26197
26198         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
26199         RecordInterface instead.
26200
26201         * cs-parser.jay: Updated to reflect changes above.
26202
26203         * decl.cs (Definition): Keep track of the TypeBuilder type that
26204         represents this type here.  Not sure we will use it in the long
26205         run, but wont hurt for now.
26206
26207         * driver.cs: Smaller changes to accomodate the new code.
26208
26209         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
26210         when done. 
26211
26212         * rootcontext.cs (CreateInterface):  New method, used to create
26213         the System.TypeBuilder type for interfaces.
26214         (ResolveInterfaces): new entry point to resolve the interface
26215         hierarchy. 
26216         (CodeGen): Property, used to keep track of the code generator.
26217
26218 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
26219
26220         * cs-parser.jay: Add a second production for delegate_declaration
26221         with `VOID'.
26222
26223         (enum_body): Put an opt_comma here instead of putting it on
26224         enum_body or enum_member_declarations so we can handle trailing
26225         commas on enumeration members.  Gets rid of a shift/reduce.
26226
26227         (type_list): Need a COMMA in the middle.
26228
26229         (indexer_declaration): Tell tokenizer to recognize get/set
26230
26231         * Remove old targets.
26232
26233         * Re-add the parser target.
26234
26235 2001-07-13  Simon Cozens <simon@simon-cozens.org>
26236
26237         * cs-parser.jay: Add precendence rules for a number of operators
26238         ot reduce the number of shift/reduce conflicts in the grammar.
26239
26240 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
26241
26242         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
26243         and put it here.
26244
26245         Get rid of old crufty code.
26246
26247         * rootcontext.cs: Use this to keep track of the parsed
26248         representation and the defined types available to the program. 
26249
26250         * gen-treedump.cs: adjust for new convention.
26251
26252         * type.cs: Split out the type manager, and the assembly builder
26253         from here. 
26254
26255         * typemanager.cs: the type manager will live here now.
26256
26257         * cil-codegen.cs: And the code generator here. 
26258
26259 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
26260
26261         * makefile: Fixed up for easy making.
26262
26263 2001-07-13  Simon Cozens <simon@simon-cozens.org>
26264
26265         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
26266         the 
26267
26268         (unary_expression): Expand pre_increment_expression and
26269         post_decrement_expression to reduce a shift/reduce.
26270
26271 2001-07-11  Simon Cozens
26272
26273         * cs-tokenizer.cs: Hex numbers should begin with a 0.
26274
26275         Improve allow_keyword_as_indent name.
26276
26277 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
26278
26279         * Adjustments for Beta2. 
26280
26281 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
26282
26283         * decl.cs: Added `Define' abstract method.
26284         (InTransit): new property, used to catch recursive definitions. 
26285
26286         * interface.cs: Implement `Define'. 
26287
26288         * modifiers.cs: Map Modifiers.constants to
26289         System.Reflection.TypeAttribute flags.
26290
26291         * class.cs: Keep track of types and user-defined types.
26292         (BuilderInit): New method for creating an assembly
26293         (ResolveType): New function to launch the resolution process, only
26294         used by interfaces for now.
26295
26296         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
26297         that are inserted into the name space. 
26298
26299 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
26300
26301         * ARGH.  I have screwed up my tree so many times due to the use of
26302         rsync rather than using CVS.  Going to fix this at once. 
26303
26304         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
26305         load types.
26306
26307 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
26308
26309         * Experiment successful: Use System.Type rather that our own
26310         version of Type.  
26311
26312 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
26313
26314         * cs-parser.jay: Removed nsAliases from here.
26315
26316         Use new namespaces, handle `using XXX;' 
26317
26318         * namespace.cs: Reimplemented namespace handling, use a recursive
26319         definition of the class.  Now we can keep track of using clauses
26320         and catch invalid using clauses.
26321
26322 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
26323
26324         * gen-treedump.cs: Adapted for all the renaming.
26325
26326         * expression.cs (Expression): this class now has a Type property
26327         which returns an expression Type.
26328
26329         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
26330         `Type', as this has a different meaning now in the base
26331
26332 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
26333
26334         * interface.cs, class.cs: Removed from all the sources the
26335         references to signature computation, as we can not do method
26336         signature computation during the parsing time, as we are not
26337         trying to solve at that point distinguishing:
26338
26339         class X {
26340                 void a (Blah x) {}
26341                 void a (NS.Blah x) {}
26342         }
26343
26344         Which depending on the context might be valid or not, as we do not
26345         know if Blah is the same thing as NS.Blah at that point.
26346
26347         * Redid everything so the code uses TypeRefs now instead of
26348         Types.  TypeRefs are just temporary type placeholders, that need
26349         to be resolved.  They initially have a pointer to a string and the
26350         current scope in which they are used.  This is used later by the
26351         compiler to resolve the reference to an actual Type. 
26352
26353         * DeclSpace is no longer a CIR.Type, and neither are
26354         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
26355         are all DeclSpaces, but no Types. 
26356
26357         * type.cs (TypeRefManager): This implements the TypeRef manager,
26358         which keeps track of all the types that need to be resolved after
26359         the parsing has finished. 
26360
26361 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
26362
26363         * ARGH.  We are going to have to store `foreach' as a class rather
26364         than resolving it, as we need to verify error 1579 after name
26365         resolution.   *OR* we could keep a flag that says `This request to
26366         IEnumerator comes from a foreach statement' which we can then use
26367         to generate the error.
26368
26369 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
26370
26371         * class.cs (TypeContainer.AddMethod): we now add methods to the
26372         MethodGroup instead of the method hashtable.  
26373
26374         * expression.cs: Add MethodGroup abstraction, which gets us one
26375         step closer to the specification in the way we handle method
26376         declarations.  
26377
26378         * cs-parser.jay (primary_expression): qualified_identifier now
26379         tried to match up an identifier to a local variable reference or
26380         to a parameter reference.
26381
26382         current_local_parameters is now a parser global variable that
26383         points to the current parameters for the block, used during name
26384         lookup.
26385
26386         (property_declaration): Now creates an implicit `value' argument to
26387         the set accessor.
26388
26389 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
26390
26391         * parameter.cs: Do not use `param' arguments as part of the
26392         signature, per the spec.
26393
26394 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
26395
26396         * decl.cs: Base class for classes, structs and interfaces.  This
26397         is the "Declaration Space" 
26398
26399         * cs-parser.jay: Use CheckDef for checking declaration errors
26400         instead of having one on each function.
26401
26402         * class.cs: Factor out some code for handling error handling in
26403         accordance to the "Declarations" section in the "Basic Concepts"
26404         chapter in the ECMA C# spec.
26405
26406         * interface.cs: Make all interface member classes derive from
26407         InterfaceMemberBase.
26408
26409 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
26410
26411         * Many things: all interfaces are parsed and generated in
26412         gen-treedump.  Support for member variables, constructors,
26413         destructors, properties, constants is there.
26414
26415         Beginning of the IL backend, but very little done, just there for
26416         testing purposes. 
26417
26418 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
26419
26420         * cs-parser.jay: Fix labeled statement.
26421
26422         * cs-tokenizer.cs (escape): Escape " and ' always.
26423         ref_line, ref_name: keep track of the line/filename as instructed
26424         by #line by the compiler.
26425         Parse #line.
26426
26427 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
26428
26429         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
26430         to match the values in System.CodeDOM.
26431
26432         Divid renamed to Divide.
26433
26434         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
26435         statements. 
26436         (Statements.set): remove.
26437
26438         * System.CodeDOM/CodeCatchClause.cs: always have a valid
26439         statements. 
26440
26441         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
26442         falseStatements always have valid values. 
26443
26444         * cs-parser.jay: Use System.CodeDOM now.
26445