*** merged revision 58142 from mcs
[mono.git] / mcs / gmcs / ChangeLog
1 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
2
3         A fix for #77816.
4
5         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
6         host container.
7         (AnonymousMethod.ImplicitStandardConversionExists): New method.
8         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
9         Add more error reporting; Fixed issue with params.
10
11         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
12
13         * cs-parser.jay: AnonymousMethod requires host container.
14
15         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
16
17 2006-03-18  Raja R Harinath  <harinath@gmail.com>
18
19         * class.cs: Change 'TypeContainer ds' constructor argument to
20         'DeclSpace parent'.  Some classes were missed below due to
21         different naming convention.
22
23         * class.cs (MemberCore.Parent): Delete.  This makes the
24         ParentContainer changes below enforceable by the compiler.
25
26         Treat pointers to enclosing declaration space as 'DeclSpace', not
27         'TypeContainer'.
28         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
29         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
30
31         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
32         of TypeContainer.
33         (Block.AddThisVariable): Likewise.
34         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
35         (AbstractPropertyEventMethod.Emit): Likewise.
36         (AbstractPropertyEventMethod.EmitMethod): Likewise.
37         (GetMethod.Define, SetMethod.Define): Likewise.
38         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
39         (DelegateMethod.EmitMethod): Likewise.
40
41         Fix regression test-partial-13.cs.
42         Rationalize use of PartialContainer.  Ensure that the partial
43         class semantics can be tied to type-correctness, i.e., any
44         violation will cause a compile error.
45         * class.cs, const.cs: Access all fields that belong to class
46         TypeContainer via ParentContainer.  Arguments of EmitContexts and
47         Resolve()-like functions still use 'Parent'.
48
49         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
50         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
51         (PropertyMethod.CheckModifiers): Remove unused argument.
52         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
53         DeclSpace.
54
55 2006-03-28  Raja R Harinath  <rharinath@novell.com>
56
57         * decl.cs (DeclSpace.LookupGeneric): Update to changes.
58
59 2006-03-17  Raja R Harinath  <harinath@gmail.com>
60
61         Make semantics of PartialContainer simpler.
62         * decl.cs (DeclSpace.IsPartial): Remove.
63         * class.cs (TypeContainer.IsPartial): Likewise.
64         (TypeContainer..ctor): Set PartialContainer to point to self.
65         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
66         (TypeContainer.FindNestedType): Likewise.
67         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
68
69 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
70
71         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
72
73 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
74
75         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
76         classes.
77
78 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
79
80         * class.cs (Operator.Define): An error for base conversion was not
81         reported correctly.
82
83 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
84
85         A fix for #77593, #77574.
86
87         * class.cs (MethodCore.CheckBase): Another if for operator.
88
89 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
90
91         A fix for #77822.
92
93         * expression.cs (VerifyArgumentsCompat): Reverted to double error
94         reporting, it's more tricky than I thought.
95
96 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
97
98         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
99         were not resolved
100
101         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
102         (DelegateCreation.ImplicitStandardConversionExists): New method for just
103         conversion test.
104         
105         * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
106         not needed.
107
108 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
109
110         A fix for #77353.
111
112         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
113         (Event.Define): ditto
114         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
115
116         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
117         Removed redundant code and set NewSlot for Invoke method too.
118
119         * parameter.cs (Parameters.ctor): Add custom, type ctor.
120         (Parameters.MergeGenerated): New method. Use this method when you merge
121         compiler generated argument with user arguments.
122
123 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
124
125         * attribute.cs (ResolveAsTypeTerminal): Removed.
126
127         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
128         specialization for predefined types; 30% speed up.
129         Finally placed obsolete check to right place.
130         (Expression.ResolveType): Removed.
131
132         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
133         Updated after ResolveType was removed.
134
135         * expression.cs (Cast.ctor): Check void cast.
136         (Binary.ResolveAsTypeTerminal): Is never type.
137         (Conditional.ResolveAsTypeTerminal): Is never type.
138
139         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
140
141 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
142
143         * rootcontext.cs (ResolveCore): Removed System.INullableValue.
144
145 2006-03-23  Martin Baulig  <martin@ximian.com>
146
147         * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
148         type check if either of the types is an open generic type.
149
150 2006-03-23  Martin Baulig  <martin@ximian.com>
151
152         * convert.cs
153         (Convert.ExplicitTypeParameterConversion): New method; implement
154         explicit type parameter conversions.
155
156 2006-03-23  Martin Baulig  <martin@ximian.com>
157
158         * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
159         blindly allow all conversions if we do not have any constraints.
160
161 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
162
163         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
164         these two separated members to simplify the code.
165         (Attribute.Resolve): Refactored to use new fields and methods.
166         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
167         implemented obsolete attribute checking.
168         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
169         implemented obsolete checking again. It look line never ending quest ;-)
170         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
171
172         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
173
174         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
175
176         *class.cs (Property.Define): Add RegisterProperty call.
177
178         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
179         argument groups (only 2).
180
181         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
182         encoding expression to arguments.
183         (Expression.ExprClassToResolveFlags): Just turned to property.
184
185         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
186         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
187         optimized as well as implemented support for zero-length attributes.
188
189         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
190         Add caching of PropertyInfo's.
191
192 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
193
194         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
195         error multiple times.
196
197 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
198
199         New partial class implementation.
200         A fix for #77027, #77029, #77403
201
202         * attribute.cs (Attributable): Made attributes protected.
203
204         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
205         the replacements of ClassPart and PartialContainer.
206         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
207         (TypeContainer.AddInterface): Ditto.
208         (TypeContainer.AddPartial): The main method for partial classes. It checks
209         for errors and merges ModFlags and attributes. At the end class is added to
210         partial_parts list.
211         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
212         required here.
213         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
214         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
215         from the rest of partial classes.
216         (TypeContainer.GetClassBases): Simplified.
217         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
218         DefineType.
219         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
220         (TypeContainer.HasExplicitLayout): Uses Flags now.
221         (PartialContainer): Removed.
222         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
223         (StaticClass): Was merged with Class.
224         (Class.GetClassBases): class and static class bases are verified here.
225         (Class.TypeAttr): Added static attributes when class is static.
226         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
227         (MemberBase): In some cases we need to call parent container for partial
228         class. It should be eliminated but it's not easy now.
229
230         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
231
232         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
233         partial classed to accumulate class comments.
234         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
235
236         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
237
238         * driver.cs (MainDriver): Tree.GetDecl was removed.
239
240         * modifiers.cs (Modifiers): Add partial modifier.
241
242         * tree.cs (Tree.decl): Removed.
243         (RootTypes): Started to use this class more often for root types
244         specializations.
245
246 2006-03-23  Raja R Harinath  <rharinath@novell.com>
247
248         * generic.cs (TypeParameter.UpdateConstraints): Update
249         'constraints' if null.
250
251 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
252
253         A fix for #77615
254
255         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
256         external interface does not have an attribute.
257
258 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
259
260         Another prerequisites for new partial classs implementation.
261         
262         * attribute.cs (Attribute.Equal): Implemented.
263         (Attribute.Emit): Changed as attributes can be applied more than twice.
264         (Attributes.Emit): Check for duplicate attributes here.
265
266         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
267         as a parameter, clean-up.
268
269 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
270
271         A fix for #77485
272
273         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
274         contains obsolete attribute check which can in some cases look for base
275         type of current class which is not initialized yet.
276         (TypeContainer.BaseType): Replacement of ptype.
277
278         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
279
280 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
281
282         First of prerequisites for new partial classs implemention.
283         
284         * attribute.cs (Attributable): Extended by ResolveContext;
285         Attributes finally have correct context for resolving in all cases.
286         (AttachTo): Attribute owner is assigned here.
287
288         * codegen.cs (IResolveContext): Introduce new interface to hold
289         all information needed in resolving phase.
290         (EmitContext): Implements IResolveContext; more clean-up needed here.
291         
292         * decl.cs (MemberCore): Implemented IResolveContext.
293
294         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
295         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
296         parameter.cs, statement.cs, tree.cs, typemanager.cs:
297         Refactored to use new IResolveContext instead of EmitContext; cleanup
298
299 2006-03-22  Raja R Harinath  <rharinath@novell.com>
300
301         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
302         mcs to keep code differences small.
303         * attribute.cs (Attribute.GetParameterDefaultValue): New.
304         * typemanager.cs (parameter_default_value_attribute_type): New.
305         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
306         CS1908 check.
307
308 2006-03-22  Martin Baulig  <martin@ximian.com>
309
310         * generic.cs
311         (Nullable.NullableLiteral): Derive from `NullLiteral'.
312
313         * convert.cs
314         (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
315         instead of the normal `NullLiteral'.
316
317 2006-03-21  Martin Baulig  <martin@ximian.com>
318
319         Fix #77583.
320         * generic.cs (TypeManager.InferType): If `pt' is a generic
321         parameter, don't check whether `pt == at'.
322
323 2006-03-20  Raja R Harinath  <rharinath@novell.com>
324
325         Fix #77852
326         * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
327         (TypeParameter.Resolve): Update to change.
328         (ConstraintChecker.CheckConstraints): Resolve type-argument
329         constraints before use.
330
331 2006-03-16  Martin Baulig  <martin@ximian.com>
332
333         * generic.cs
334         (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
335         and don't have any instance constructors, also lookup in the base class.
336         (TypeManager.IsNullableValueType): New public method.
337
338         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
339         `BindingFlags.DeclaredOnly' flag and set `used_cache'.
340         (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
341
342         * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
343         instead of just TypeManager.IsNullableType() to determine whether
344         a lifted operator exists.
345         (UnaryMutator.DoResolve): Likewise.
346         (Conditional.DoResolve): Likewise.
347         (Binary.DoResolve): A lifted operator only exists if both operands
348         are valuetypes and at least one of them is a nullable type.
349
350 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
351
352         * iterator.cs : yield break is allowed in try statement which has
353           catch clauses. Fixed bug #77767.
354
355 2006-03-12  Martin Baulig  <martin@ximian.com>
356
357         * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
358         private IsSignatureEqual() to compare types; see the comment in
359         that method; fixes #77674.
360
361 2006-03-10  Raja R Harinath  <rharinath@novell.com>
362
363         * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
364         (Expression.ResolveAsTypeTerminal): Likewise.
365         * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
366         * expression.cs, generic.cs, iterators.cs: Likewise.
367         * parameter.cs, statement.cs, typemanager.cs: Likewise.
368
369 2006-03-09  Martin Baulig  <martin@ximian.com>
370
371         * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
372         TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
373
374 2006-03-09  Martin Baulig  <martin@ximian.com>
375
376         * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
377         `prepared' flag is set.
378
379         * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
380         (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
381         issues; see gtest-254.cs.
382
383 2006-03-07  Martin Baulig  <martin@ximian.com>
384
385         * generic.cs (TypeManager.InferType): Allow infering
386         `IEnumerable<T>' with an array of T; see gtest-251.cs.
387
388 2006-03-06  Martin Baulig  <martin@ximian.com>
389
390         * generic.cs
391         (TypeManager.InferType): Fix gtest-250.cs.
392
393         * typemanager.cs
394         (TypeManager.IsSubclassOf): Also check the base class.
395
396         * expression.cs
397         (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
398         fixes gtest-249.cs.
399
400 2006-03-01  Raja R Harinath  <rharinath@novell.com>
401
402         Fix #77679.
403         * expression.cs (ParameterReference.DoResolveBase): Change return
404         type to bool.
405         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
406         Update.
407
408         Fix #77628.
409         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
410
411         Fix #77642.
412         * typemanager.cs (GetFullNameSignature): Don't nullref on
413         protected accessors.
414
415 2006-02-16  Martin Baulig  <martin@ximian.com>
416
417         * generic.cs
418         (TypeManager.GetGenericFieldDefinition): New public method; use it
419         instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
420
421 2006-02-14  Martin Baulig  <martin@ximian.com>
422
423         * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
424
425 2006-02-14  Martin Baulig  <martin@ximian.com>
426
427         * generic.cs
428         (TypeManager.DropGenericMethodArguments): New public method; don't
429         use GetGenericMethodDefinition() on something which is not a
430         generic method.
431
432 2006-02-14  Martin Baulig  <martin@ximian.com>
433
434         * generic.cs
435         (ConstraintChecker.CheckConstraints): If a type parameter has the
436         `struct' constraint, the type must be a non-nullable valuetype.
437
438 2006-02-10  Martin Baulig  <martin@ximian.com>
439
440         * typemanager.cs
441         (TypeManager.IsOverride): Make this work for instantiated methods
442         in a generic class; fixes #77509.
443         (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
444         rather than calling it directly; fixes #77488.  
445
446 2006-02-08  Martin Baulig  <martin@ximian.com>
447
448         * generic.cs (ConstraintChecker.CheckConstraints): Move the error
449         reporting into CheckConstraint() so we can use the correctly
450         instantiated type.
451
452 2006-02-08  Martin Baulig  <martin@ximian.com>
453
454         * expression.cs (BaseAccess): Add support for generic methods.
455
456         * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
457         the new MethodGroupExpr.
458
459 2006-02-07  Martin Baulig  <martin@ximian.com>
460
461         * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
462         also reference types; fixes #77483.
463
464 2006-02-07  Martin Baulig  <martin@ximian.com>
465
466         * generic.cs
467         (TypeManager.IsGenericMethod): We now return whether something is
468         an instantiated generic method (and not a generic method def).
469         (TypeManager.IsGenericMethodDefinition): New public method.
470
471         * typemanager.cs
472         (TypeManager.CSharpSignature): Only include type arguments for
473         "real" generic methods, not for any instantiated method.
474         (TypeManager.GetMethodName): Likewise, but also allow generic
475         method definitions here.
476
477 2006-02-06  Miguel de Icaza  <miguel@novell.com>
478
479         * codegen.cs (EmitScopeInitFromBlock): check here the
480         capture_context, there is no need to make two calls to the
481         EmitContext. 
482
483         * anonymous.cs: Add some debugging messages that might help me
484         track other instances of this problem in the future (the
485         regression of test 467).
486
487         * cs-parser.jay: track the variable block, as we need to initalize
488         any captured variables declared in this block for the "catch"
489         portion of the "Try" statement.
490
491         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
492         scope initialization for captured variables. 
493
494         Also, move the emit for the variables after the block location has
495         been marked.
496
497 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
498
499        * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
500         
501 2006-02-06  Martin Baulig  <martin@ximian.com>
502
503         * class.cs (TypeContainer.DefineType): If we're a struct, pass
504         `TypeManager.value_type' as parent type to
505         ModuleBuilder.DefineType().  Fixes #77358.      
506
507 2006-02-02  Miguel de Icaza  <miguel@novell.com>
508
509         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
510         commit yesterday, the initialization for the roots is necessary.
511         What is not necessary is the scope activation.
512
513 2006-02-02  Raja R Harinath  <rharinath@novell.com>
514
515         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
516         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
517         CS0206 checks.
518         (Argument.Resolve): Remove CS0206 checks.
519
520 2006-02-01  Miguel de Icaza  <miguel@novell.com>
521
522         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
523         scopes for all the roots, the scopes will now be emitted when the
524         Blocks are entered. [This change was wrong, fixed on 2006-02-02]
525
526         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
527         code.  This reduces a lot of existing cruft.
528         
529         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
530         that the ScopeInfo is generated as we enter the scope, not at the
531         time of use, which is what we used to do before.
532
533         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
534         every time a Block is about to be emitted if we have a
535         CaptureContext. 
536
537 2006-02-01  Raja R Harinath  <rharinath@novell.com>
538
539         * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
540         attribute for mscorlib too.
541
542         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
543         (Reset): Update.
544         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
545
546         * typemanager.cs (cons_param_array_attribute): Make private.
547         (Reset): Set it to null.
548         (InitCoreHelpers): Don't initialize it.
549         (ConsParamArrayAttribute): New.  Initialize it as needed.
550         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
551
552 2006-01-31  Miguel de Icaza  <miguel@novell.com>
553
554         * expression.cs: There might be errors reported during the
555         selection of applicable methods.  If there are errors, do not
556         continue execution as it will lead the compiler to crash.
557
558 2006-01-30  Miguel de Icaza  <miguel@novell.com>
559
560         * expression.cs: Member access is not allowed on anonymous
561         methods.  Fixes #77402.
562
563 2006-01-30  Raja R Harinath  <rharinath@novell.com>
564
565         Fix #77401
566         * cs-parser.jay (VariableDeclaration): Don't set
567         current_array_type to null.
568         (field_declaration, event_declaration, declaration_statement):
569         Set it to null here.
570
571 2006-01-29  Raja R Harinath  <harinath@gmail.com>
572
573         Fix part of #77397
574         * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
575
576 2006-01-28  Raja R Harinath  <harinath@gmail.com>
577
578         * typemanager.cs (GenericParameterPosition): New.
579         * doc.cs: Use it.
580
581 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
582
583         * doc.cs : To process "include" elements, first we should create
584           another list than XmlNodeList, because it could result in node
585           removal, which could result in that the XmlNodeList gives up
586           yielding next node.
587
588 2006-01-25  Miguel de Icaza  <miguel@novell.com>
589
590         * expression.cs: Introduce an error report that we were not
591         catching before.   Gonzalo ran into it.
592
593 2006-01-23  Miguel de Icaza  <miguel@novell.com>
594
595         A fix for bug: #76957
596         
597         * iterators.cs (MoveNextMethod.CreateMethodHost): call
598         ComputeMethodHost before creating the method, this is a new
599         requirement. 
600
601         * anonymous.cs (AnonymousContainer): Now we track all the scopes
602         that this method references (RegisterScope).  The actual scope
603         where the method is hosted is computed with the ComputeMethodHost
604         before we create the method.
605
606         Moved the Deepest routine here.
607
608         (AnonymousContainer.ComputeMethodHost): New routine used to
609         compute the proper ScopeInfo that will host the anonymous method.
610
611         (ScopeInfo): Deal with multiple roots.  The problem was that we
612         did not have a unique root where all ScopeInfos could be hanged
613         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
614         of roots.  
615
616         Remove AdjustMethodScope which is now computed at the end.  Remove
617         LinkScope which did a partial link, instead link all ScopeInfos
618         before code generation from the new "LinkScopes" routine. 
619
620         Simplify all the Add* routines as they no longer need to maintain
621         the tree, they just need to record that they are using variables
622         from a ScopeInfo.
623
624         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
625         routines to produce the forest of ScopeInfo trees.
626
627         * class.cs (TypeContainer.AppendMethod): This is just like
628         AddMethod, but ensures that an interface implementation method
629         (IEnumerable.XXX) is not inserted at the beginning of the queue of
630         methods, but at the end.
631
632         We use this functionality to ensure that the generated MoveNext
633         method in the iterator class is resolved/emitted before the
634         enumerator methods created.   
635
636         This is required because the MoveNext method computes the right
637         ScopeInfo for the method.  And the other methods will eventually
638         need to resolve and fetch information computed from the anonymous
639         method. 
640
641         
642 2006-01-23  Raja R Harinath  <rharinath@novell.com>
643
644         Improve implementation of section 14.4.2.2 (Better function member).
645         * expression.cs (Invocation.MoreSpecific): Compare all type
646         arguments before deciding if one type is more specific than
647         another.  Handle array types too.  Return the more specific type.
648         (Invocation.BetterFunction): Add more tie-breaking rules from
649         section 14.4.2.2.  Perform "more specific" check after
650         other tie-breaking rules.  Compare all parameter types before
651         choosing the "more specific" method.
652
653 2006-01-21  Raja R Harinath  <harinath@gmail.com>
654             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
655
656         Fix rest of #76995.
657         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
658         the 'aliases' hash.
659         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
660         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
661
662 2006-01-18  Martin Baulig  <martin@ximian.com>
663
664         * class.cs (TypeContainer.AddToMemberContainer): Use
665         `symbol.MemberName.MethodName' instead of just `symbol.Name';
666         fixes #77124.
667
668 2006-01-18  Martin Baulig  <martin@ximian.com>
669
670         Fix #76417: a generic class may now have methods which may unify
671         for some type parameter substitutions.
672
673         * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
674         for methods which may unify anymore.
675
676         * expression.cs (Invocation.MoreSpecific): New private static
677         method; checks whether one method is more specific than another
678         according to 14.4.2.2 of the spec.
679         (Invocation.BetterFunction): Implement the tie-breaking rules from
680         14.4.2.2 of the spec: if two methods unify for some type parameter
681         substitution, we need to pick the more specific one.
682
683 2006-01-18  Raja R Harinath  <rharinath@novell.com>
684
685         Fix #76656, cs0231-2.cs.
686         * cs-parser.jay (formal_parameter_list): Make error case catch
687         more issues.
688         (parenthesized_expression_0): Add CS1026 check.
689         (invocation_expression): Remove unused { $$ = lexer.Location }.
690
691 2006-01-17  Raja R Harinath  <rharinath@novell.com>
692
693         Fix #76824.
694         * cs-parser.jay (statement_expression): Don't list out the
695         individual statement-expressions.  Convert syntax error into
696         CS0201 check.
697
698 2006-01-16  Raja R Harinath  <rharinath@novell.com>
699
700         Fix #76874.
701         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
702         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
703         CheckIntermediateModification.
704         (FieldExpr.DoResolve): Add new two-argument version that
705         allows us to resolve the InstanceExpression as an lvalue.
706         The one-argument variant is now just a wrapper.
707         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
708         Resolve the lhs as an lvalue if the it has a value type.
709         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
710         from Assign.DoResolve.
711         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
712         resolved as an lvalue.
713         (PropertyExpr.DoResolve): Update.
714         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
715         has a value type.  Move CS1612 check here from
716         CheckIntermediateModification.
717         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
718         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
719         'right_side' of a ResolveLValue on an 'out' argument.
720         (EmptyExpression.LValueMemberAccess): New.  Used as the
721         'right_side' of a propagated ResolveLValue on a value type.
722         (LocalVariableReference.DoResolveBase): Recognize
723         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
724         Add CS1654 check.
725         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
726         EmptyExpression.Null.
727
728 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
729
730         * typemanager.cs : added IsGenericParameter(). In gmcs it returns
731           Type.IsGenericParameter(). Fixed bug #77183.
732         * doc.cs : it is now identical to doc.cs in mcs.
733
734 2006-01-16  Martin Baulig  <martin@ximian.com>
735
736         * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
737
738 2006-01-16  Martin Baulig  <martin@ximian.com>
739
740         * typemanager.cs (TypeManager.CSharpSignature): Make this work for
741         ctors; fixes #77250.
742
743 2006-01-12  Miguel de Icaza  <miguel@novell.com>
744
745         This fixes the problem where we used ldfld instead of ldflda to
746         load the "THIS" pointer on captured parameters, when THIS is a
747         value type.  See bug #77205.
748         
749         * iterators.cs (CapturedThisReference.Emit): Pass false to
750         EmitThis (we do not need the address).
751
752         * codegen.cs (EmitThis): it needs to know whether we need the
753         address of `this' or not.  This is used by value types.  
754
755         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
756         every other call passes false.
757
758 2006-01-12  Raja R Harinath  <rharinath@novell.com>
759
760         Fix #77221.
761         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
762         GetOverride.
763         * expression.cs (Invocation.OverloadResolve): Update.
764         (Invocation.DoResolve): Avoid double resolution of invocation.
765
766 2006-01-11  Raja R Harinath  <rharinath@novell.com>
767
768         Fix #77180.
769         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
770         unary negation of floating point types as 0-expr; negation cannot
771         overflow in floating point types.
772
773         Fix #77204.
774         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
775         on operands of 'void' type.
776
777         Fix #77200.
778         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
779         and ExclusiveOr for boolean constants too.
780
781 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
782
783         * expression.cs: Fix Console.WriteLine ((this = x).foo);
784
785 2006-01-12  Miguel de Icaza  <miguel@novell.com>
786
787         * cs-tokenizer.cs (Position): New class used to save and restore
788         the position state in the tokenizer.  Before this patch the save
789         and restore was not complete enough so the line and columns would
790         start to drift and the debugger and stack traces will get the
791         wrong data.
792
793 2006-01-10  Martin Baulig  <martin@ximian.com>
794
795         * generic.cs
796         (TypeParameter.InflateConstraints): New public method.
797
798         * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
799         constraints; fixes #77042.
800
801 2006-01-10  Martin Baulig  <martin@ximian.com>
802
803         * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
804         instead of the `TypeBuilder' for this "<>THIS" variable; fixes
805         #77061. 
806
807 2006-01-09  Raja R Harinath  <rharinath@novell.com>
808
809         Fix #75636.
810         * expression.cs (Invocation.OverloadResolve): Replace reflected
811         override methods with their base virtual methods, rather than
812         skipping over them.
813         * typemanager.cs (TypeManager.GetOverride): New.
814
815 2005-12-21  Miguel de Icaza  <miguel@novell.com>
816
817         * driver.cs: Report the case of no source files and no -out:
818         argument provided.
819
820 2005-12-20  Raja R Harinath  <rharinath@novell.com>
821
822         Fix #77035.
823         * expression.cs (ComposedCast.GetSignatureForError): Define.
824
825 2006-01-05  Jb Evain  <jbevain@gmail.com>
826
827         * class.cs (Property.Define, Indexer.Define): do not tag the
828         properties as SpecialName | RTSpecialName.
829
830 2006-01-04  Miguel de Icaza  <miguel@novell.com>
831
832         * class.cs (MethodCore.IsDuplicateImplementation): This method was
833         doing a low-level comparission of parameter types.  It was lacking
834         a check for __argslist. 
835
836 2005-12-30  Miguel de Icaza  <miguel@novell.com>
837
838         * expression.cs (ParameterReference.DoResolveBase): Allow
839         reference parameters if they are local to this block. 
840
841         This allows the ref and out parameters of a delegate to be used in
842         an anonymous method, for example:
843
844         delegate void set (out int x);
845
846         set s = delegate (out int x){
847                 x = 0;
848         };
849
850         This is used by functionality introduced late in the C# language.
851         
852         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
853         method that take ref and out parameters. 
854
855         Fixes #77119 which was a late change in the spec.
856
857 2005-12-23  Miguel de Icaza  <miguel@novell.com>
858
859         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
860         parent if its the same scope.  Fixes #77060.
861
862 2005-12-22  Marek Safar  <marek.safar@seznam.cz>
863
864         * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
865
866 2005-12-21  Carlos Alberto Cortez <calberto.cortez@gmail.com>
867
868         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
869         errors 1726 for strong named assemblies with InternalsVisibleToAttribute 
870         that doesn't contain the full public key. This is a update of the
871         friend assemblies in .Net 2.0 release.
872         
873 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
874
875         Fix #76995
876
877         * namespace.cs (NamespaceEntry): Add extern_aliases as a
878         ListDictionary, to contain the ExternAliasEntry entries (in
879         addition to the NamespaceEntry.aliases hashtable). This field is
880         shared between the original entry and its doppelganger (bodyless 
881         copy of it).
882         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
883         extern_aliases field.
884         (NamespaceEntry.Lookup): Move the IsImplicit check after the
885         lookup in extern_aliases.
886
887 2005-12-16  Raja R Harinath  <rharinath@novell.com>
888
889         Fix #77006.
890         * class.cs (TypeContainer.Mark_HasEquals): New.
891         (TypeContainer.Mark_HasGetHashCode): New.
892         (ClassPart): Override them.
893         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
894
895         * generic.cs (GenericMethod.DefineMembers): Update to changes.
896         (TypeParameter.TypeParameter): Change type of 'parent' argument to
897         DeclSpace.
898
899         Fix #77008.
900         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
901         'parent' argument to the base constructor.
902
903         Remove all mention of TypeContainer from decl.cs.
904         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
905         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
906         (DeclSpace.DeclSpace): Likewise.
907         (DeclSpace.DefineMembers): Remove unused argument.
908         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
909         debugging check -- we don't care if the debug code throws an
910         InvalidCastException instead of an InternalErrorException.
911         * class.cs (TypeContainer.DefineMembers): Update to changes.
912         (TypeContainer.DoDefineMembers): Likewise.
913         (TypeContainer.GetMethods): Likewise.
914         (PropertyMember.Define): Likewise.
915         (MemberBase.Parent): New property that forwards to
916         MemberCore.Parent, but ensures that we get a TypeContainer.
917         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
918         (RootContext.PopulateTypes): Likewise.  Remove special case code
919         for !RootContext.StdLib: DefineMembers is idempotent.
920
921 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
922
923         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
924
925 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
926
927         * doc.cs : The search for referenced namespace was insufficient to
928           get global one as it used to do. Fixed bug #76965.
929
930 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
931
932         * doc.cs : check name in cref in the last phase that whether it is
933           namespace or not.
934
935 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
936
937         * cs-tokenizer.cs : reverted the latest change: it somehow broke
938           Mono.C5.
939
940 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
941
942         * doc.cs : so it turned out that we cannot skip override check for 
943           interface members. Fixed bug #76954.
944
945 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
946
947         * cs-tokenizer.cs : fixed bug #75984:
948           - #warning and #error should not be handled when the source line
949             is disabled.
950           - #line is not checked strictly when the source line is disabled.
951           - #define and #undef is on the other hand checked strictly at any
952             state.
953
954 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
955
956         * cs-tokenizer.cs : missing Location (actually, filename) in one of
957           CS1027 report.
958
959 2005-12-15  Raja R Harinath  <rharinath@novell.com>
960
961         * generic.cs (TypeManager.IsGeneric): Remove unused method.
962
963         * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
964         nested types.
965
966 2005-12-14  Martin Baulig  <martin@ximian.com>
967
968         * typemanager.cs (TypeManager.GetFullName): Make this public;
969         `Type.Fullname' now never returns null.
970
971         * class.cs (Method.Define): Use TypeManager.GetFullName() for
972         explicit interface implementations; we're now using the same
973         naming convention than csc does.
974
975 2005-12-14  Miguel de Icaza  <miguel@novell.com>
976
977         * convert.cs (ExplicitConversionCore): Check the return value from
978         ExplicitConversionCore which can return null on failure.  Fixes #76914
979
980 2005-12-09  Raja R Harinath  <rharinath@novell.com>
981
982         * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
983         instead of IsGenericInstance.
984         * generic.cs (TypeManager.IsEqual): Likewise.  Delete redundant
985         code that's now covered by the more general test.
986         * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
987
988         * generic.cs (DropGenericTypeArguments): New.  Captures the common
989         pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
990         * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
991         * generic.cs, report.cs, typemanager.cs: Likewise.
992
993 2005-12-08  Martin Baulig  <martin@ximian.com>
994
995         * generic.cs (TypeArguments.Resolve): Added CS1547 check.
996
997         * typemanager.cs (TypeManager.CSharpSignature): Include type
998         arguments in the signature of a generic method.
999
1000 2005-12-07  Martin Baulig  <martin@ximian.com>
1001
1002         Add support for custom attributes on type parameters.
1003
1004         * cs-parser.jay (type_arguments): Added `opt_attributes'.
1005
1006         * generic.cs (TypeParameterName): New public class; we use this
1007         instead of a `string' to store the name of a type parameter, so we
1008         can also have `Attributes'.
1009         (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
1010         array instead of a `string[]' array.
1011         (TypeParameter.ctor): We now also take an `Attributes' argument.
1012         (TypeParameter.EmitAttributes): New public method; emit our
1013         `OptAttributes' here.
1014         (GenericMethod.EmitAttributes): New public method; emit the custom
1015         attributes on all our type parameters.
1016
1017         * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
1018         our type parameters.
1019         (MethodData.Define): If we're a generic method, call
1020         EmitAttributes() on it.
1021
1022 2005-12-07  Martin Baulig  <martin@ximian.com>
1023
1024         * generic.cs
1025         (ConstraintChecker): New public abstract class; move the
1026         constraint checking here from `ConstructedType' and also do
1027         constraint checking for generic methods here.
1028
1029         * expression.cs (Invocation.OverloadResolve): Use
1030         ConstraintChecker.CheckConstraints() if we resolved to a generic
1031         method.  Fix #76806.
1032
1033 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1034
1035         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1036
1037         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1038         event initializers.
1039         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1040         (FieldBase.Initializer): Initializer is now optional.
1041         (EventField.Define): Only event field can have initializer.
1042
1043         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1044
1045         * const.cs (Const): Reuse initializer.
1046
1047         * cs-parser.jay: Updated after FieldBase changes.
1048         Added current_array_type to simplify array initializers.
1049
1050         * ecore.cs (NullCast.IsDefaultValue): Implemented.
1051
1052         * expression.cs, iterators.cs: Updated.
1053
1054         * namespace.cs (NamespaceEntry): Made UsingFound private.
1055
1056 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1057
1058         * parameterCollection.cs: Obsolete, removed.
1059         * parser.cs: Obsolete, removed.
1060
1061 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1062
1063         Fix #76849.
1064         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
1065
1066         * enum.cs (Enum.Define): Set obsolete context here.
1067
1068 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1069
1070         * doc.cs :
1071           - FindDocumentedMember() now expects 1) paramList as null
1072             when "we don't have to check the number of parameters" and
1073             2) Type.EmptyTypes when "there is no arguments".
1074           - Introduced FoundMember struct to hold the exact type which was
1075             used to find the documented member (the above change broke
1076             test-xml-044; it might be better just to use DeclaringType than
1077             what MS does, like this change does, but it depends on usage.)
1078
1079 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1080
1081         * doc.cs : documented member might be from DeclaringType for nested
1082           types. Fixed bug #76782.
1083
1084 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
1085
1086         * anonymous.cs: Have the param code handle leaving copies on the
1087         stack etc. Allows anonymous params to take part in the assignment
1088         code (++, +=, etc). Fixes bug #76550
1089
1090         * expression.cs: Handle the prepare_for_load/leave_copy by passing
1091         it down to the anon code.
1092
1093         * iterators.cs: Use dummy var here
1094
1095         * codegen.cs: Handle new vars
1096
1097 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1098
1099         Fix #76849.
1100         * class.cs (MethodData.Define): Set proper Obsolete context.
1101
1102         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1103         obsolete context.
1104         (FieldExpr.DoResolve): Ditto.
1105
1106 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1107
1108         Fix #76849.
1109         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1110         parent is not obsolete.
1111
1112 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
1113
1114         * doc.cs : (FindDocumentedMember) find parameterless members first
1115           and get CS0419 in the early stage. Fixed first case of bug #76727.
1116
1117 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
1118
1119         Fix #76859.
1120         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1121         no error was reported.
1122
1123         *expression.cs (Binary.DoResolve): left can be null.
1124
1125 2005-12-06  Raja R Harinath  <rharinath@novell.com>
1126
1127         * class.cs (MethodCore.CheckGenericOverride): Delete unused
1128         abstract method and all overrides.
1129         * support.cs (ParameterData.GenericConstraints): Delete.
1130         (ReflectionParameters.type_params): Delete.
1131         (ReflectionParameters.ReflectionParameters): Make private.
1132         (ReflectionParameters.GetConstaints): New factory method.
1133         * generic.cs (TypeParameterDefineType): Use it.
1134         (TypeManager.GetTypeParameterConstraints): Likewise.
1135
1136 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
1137
1138         Fix #76783.
1139         * class.cs (MethodData.Emit): Parameters should be labeled first.
1140
1141 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
1142
1143         Fix #76761.
1144         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1145
1146 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
1147
1148         * attribute.cs (AreParametersCompliant): Moved to Parameter.
1149
1150         * class.cs (MethodCore): Parameter clean up.
1151         (IMethodData): Added ParameterInfo.
1152         (MethodData): Parameter clean up.
1153         (Indexer.Define): Parameter clean up.
1154
1155         * anonymous.cs,
1156         * codegen.cs,
1157         * cs-parser.jay,
1158         * decl.cs,
1159         * doc.cs,
1160         * ecore.cs,
1161         * flowanalysis.cs,
1162         * iterators.cs,
1163         * pending.cs,
1164         * statement.cs,
1165         * typemanager.cs: Parameter clean up.
1166
1167         * delegate.cs (Define): Get rid of duplicated code.
1168
1169         * expression.cs (ParameterReference): Removed useless parameters
1170         and simplified.
1171         (Invocation): Ditto.
1172
1173         * parameter.cs (ParamsParameter): New class, params specialization.
1174         (ArglistParameter): Attemp to separate arglist.
1175         (Parameter): Refactored to be reusable and faster.
1176         (Parameter.Modifier): Made understandable.
1177         (Parameters): Changed to be used as a class for `this' assembly
1178         parameters. Refactored to use new specialized classes.
1179
1180         * support.cs (ParameterData): Added Types property.
1181         (InternalParameters): Deleted.
1182
1183 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1184
1185         * doc.cs : the previous patch does not actually fix the bug.
1186           PropertyInfo override check is now implemented and really fixed it.
1187         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
1188
1189 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1190
1191         * doc.cs : apply "override filter" also to properties.
1192           Fixed bug #76730.
1193
1194 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1195
1196         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
1197           no need to check overrides. For classes, omit those results from 
1198           interfaces since they must exist in the class. Fixed bug #76726.
1199
1200 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1201
1202         * typemanager.cs : (GetFullNameSignature) differentiate indexers
1203           with different parameters. Fixed the second problem in #76685.
1204
1205 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1206
1207         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
1208           get expected 'protected' access in CheckValidFamilyAccess()).
1209           Fixed bug #76692.
1210
1211 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1212
1213         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
1214           Fixed bug #76705.  CS1569 was incorrectly commented out.
1215
1216 2005-11-23  Martin Baulig  <martin@ximian.com>
1217
1218         * generic.cs (Constraints.Define): Removed.
1219         (TypeParameter.DefineConstraints): Removed.
1220         (TypeParameter.DefineType): Call SetGenericParameterAttributes()
1221         on the GenericTypeParameterBuilder here.
1222
1223 2005-11-23  Martin Baulig  <martin@ximian.com>
1224
1225         * typemanager.cs (TypeManager.GetProperty): Make this public.
1226
1227         * generic.cs (Nullable.NullableInfo.ctor): Use
1228         TypeManager.GetProperty() rather than using reflection directly.
1229
1230 2005-11-17  Martin Baulig  <martin@ximian.com>
1231
1232         * expression.cs (Indexers.GetIndexersForType): Added support for
1233         generic parameters; fixes #76587.
1234
1235 2005-11-17  Martin Baulig  <martin@ximian.com>
1236
1237         * anonymous.cs
1238         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
1239         inherit the scope from our parent.  Fixes #76653.
1240
1241 2005-11-15  Martin Baulig  <martin@ximian.com>
1242
1243         * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
1244         instead of `ScopeTypeBuilder' to refer to the "current" type.
1245         (AnonymousMethod.CreateScopeType): Correctly create the helper
1246         class if we're inside a generic type definition.
1247
1248 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1249
1250         * doc.cs : use Invocation.IsOverride() to do real override check.
1251         * expression.cs : made Invocation.IsOverride() internal.
1252
1253 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1254
1255         * doc.cs : use TypeManager.FindMembers() instead of (possible)
1256           TypeBuilder.FindMembers() and filter overriden base members out.
1257           Fixed bug #76990.
1258
1259 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1260
1261         * doc.cs : ref/out parameters are represented as '@' (instead of
1262           '&' in type FullName). Fixed bug #76630 (additionally crefs).
1263
1264 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1265
1266         * doc.cs : when there was no '.' in cref to methods in doc comment,
1267           then parameters were missing in the output. Fixed bug #76691.
1268
1269 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1270
1271         * driver.cs : don't output docs when there is an error.
1272           Fixed bug #76693.
1273
1274 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1275
1276         * doc.cs :
1277           Now it should detect indexers. Fixed primary concern in bug #76685.
1278           Fixed CS0419 message to not show the identical member signature in
1279           the message.
1280
1281 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1282
1283         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
1284           instead of Type.FindMembers() since it does not handle events.
1285           Fixed bug #71604.
1286
1287 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
1288
1289         * codegen.cs: Fixed typo (speficied -> specified).
1290
1291 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1292
1293         Fix #76369.
1294         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
1295
1296 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1297
1298         * attribute.cs: Changed error message.
1299
1300         * cs-tokenizer.cs: One more check.
1301
1302 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1303
1304         * statement.cs (Block.Resolve): Ignore empty statement.
1305
1306 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1307
1308         * report.cs: Made error/warning methods more strict to avoid
1309         their misuse.
1310
1311         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
1312         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
1313         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
1314         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
1315
1316 2005-11-11  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1317
1318         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): 
1319         Use the more explicit AssemblyName.FullName instead of 
1320         AssemblyName.Name to report errors.
1321         
1322 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1323
1324         * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
1325         with mcs.
1326
1327 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1328
1329         * class.cs,
1330         * convert.cs,
1331         * cs-parser.jay,
1332         * decl.cs,
1333         * enum.cs,
1334         * expression.cs,
1335         * generic.cs,
1336         * pending.cs,
1337         * report.cs: Fixed error reporting and typos.
1338
1339         * generic.cs (TypeParameter.GetSignatureForError): New method.
1340         (ConstructedType.GetSignatureForError): Instead of DeclarationName.
1341
1342         * typemanager.cs (GetFullName): Refactored.
1343
1344 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
1345
1346         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
1347         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
1348
1349         * class.cs (TypeContainer.IsComImport): New property.
1350         (Constructor.Define): Create proper ctor for ComImport types.
1351
1352         * expression.cs (New.CheckComImport): Fixed.
1353
1354 2005-11-07  Miguel de Icaza  <miguel@novell.com>
1355
1356         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
1357         that a parameter has been captured does not mean that we do not
1358         have to do the rest of the processing.  This fixes the second part
1359         of #76592.  If there was another anonymous method capturing
1360         values in the past, the Scope would never be set for the second
1361         method that captured the same parameter.
1362
1363         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
1364         properly manipulate the stack.   Second part of fix for #76592.
1365
1366         * expression.cs (New): Add support for invoking "new" on
1367         interfaces that have been flagged with the ComImport attribute and
1368         the CoClass.  Fixes #76637 
1369
1370         * statement.cs (Try.DoEmit): When a variable is captured, do not
1371         try to emit the vi.LocalBuilder variable as it has been captured.
1372         Create a temporary variable and store the results on the
1373         FieldBuilder.  Fixes #76642
1374
1375 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1376
1377         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
1378
1379         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
1380
1381         * expression.cs (Binary.DoResolve): Added && optimalization.
1382     
1383         * typemanager.cs (AddUserType): Removed useless argument.
1384
1385 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
1386
1387         * statement.cs (Block.variables): Uses ListDictionary.
1388
1389 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1390
1391         Fix #75969.
1392         * class.cs (PartialContainer.EmitType): Customized to emit
1393         security attributes.
1394         (ClassPart.ApplyAttributeBuilder): Transform security attribute
1395         for partial classes.
1396
1397 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1398
1399         Fix #76599.
1400         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
1401         access has to be fixed.
1402         
1403         * typemanager.cs (IsUnmanagedType): Wrong common field type.
1404
1405 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
1406
1407         Fix #76590.
1408         * ecore.cs (NullCast.Reduce): Implemented.
1409
1410         * expression.cs (ArrayCreation.CheckIndices): Correcly check
1411         constant type.
1412         
1413         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
1414         properly.
1415         (Foreach.Resolve): Catch null properly.
1416
1417 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1418  
1419         * cs-tokenizer.cs: Warning text fix.
1420
1421         * driver.cs: AllWarningNumbers exposed on public interface.
1422
1423         * report.cs (): Reviewed warning numbers.
1424         (IsValidWarning): Use binary search.
1425
1426 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1427  
1428         * driver.cs: Implemeted resource visibility.
1429         (Resources): New class for code sharing between /res: and
1430         /linkres:
1431  
1432 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1433
1434         decl.cs (CurrentTypeParameters): Fixed to be public.
1435
1436 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1437
1438         generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
1439
1440 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1441
1442         gmcs.exe.sources: Use CryptoConvert.cs from corlib.
1443
1444 2005-11-05  Kornél Pál  <kornelpal@hotmail.com>
1445
1446         * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
1447
1448 2005-11-04  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1449
1450         Add friend assembly access support.
1451         * typemanager.cs: assembly_internals_vis_attrs
1452         cache for friend assembly access. 
1453         (TypeManager.IsFriendAssembly): New method for
1454         checking friend assembly access.
1455         (TypeManager.Error_FriendAccessNameNotMatching): New
1456         helper method.
1457         (TypeManager.CompareKeyTokens): Likewise.
1458         (TypeManager.Filter): Handle friend accessible
1459         members.
1460
1461         * namespace.cs (RootNamespace.GetTypeInAssembly): Return
1462         friend accessible types.
1463
1464         * ecore.cs (Expression.IsAccessorAccessible): Handle
1465         friend accessible properties.
1466
1467         * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
1468         accessible types.
1469         
1470 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
1471
1472         Fix #76568.
1473         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
1474         folding.
1475         
1476         * convert (Convert.ImplicitReferenceConversion): NullCast holds
1477         contants only.
1478         
1479         * ecore.cs (NullCast): Child is contant only.
1480         
1481         * literal.cs (NullLiteral.Reduce): null can be converted to any
1482         reference type.
1483
1484 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
1485
1486         * driver.cs: Use Encoding.Default as default code page instead
1487           of ISO-28591.
1488
1489 2005-10-27  Raja R Harinath  <rharinath@novell.com>
1490
1491         Fix #76085.
1492         * expression.cs (Invocation.Error_InvalidArguments): Handle
1493         __arglist parameters.
1494         (Invocation.VerifyArgumentsCompat): Likewise.
1495         * support.cs (ReflectionParameters.GetSignatureForError): Print
1496         __arglist parameters.
1497         (InternalParamters.GetSignatureForError): Likewise.
1498         * parameter.cs (Parameters.GetSignatureForError): Likewise.
1499
1500 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
1501
1502         * attribute.cs (GetPropertyValue): Made public.
1503
1504         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
1505         Resolve.
1506         Add new property WrapNonExceptionThrows to handle 2.0 assembly
1507         attribute.
1508         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
1509         is not defined.
1510         
1511         * driver.cs: Reflect method name change.
1512         
1513         * statement.cs (Try.Resolve): Warn when try has both general
1514         exception handlers.
1515         
1516         * typemanager.cs: runtime_compatibility_attr_type new predefined
1517         type.
1518
1519 2005-10-26  Raja R Harinath  <harinath@gmail.com>
1520
1521         Fix #76419.
1522         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
1523         treat it as an empty parameter list.
1524
1525 2005-10-26  Raja R Harinath  <rharinath@novell.com>
1526
1527         Fix #76271.     
1528         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
1529         ResolveAsTypeStep silent.
1530         * statement.cs (Block.AddConstant): Mark block as used.
1531         (Block.ResolveMeta): Avoid piling on error messages
1532         if a constant initializer resolution fails.
1533
1534 2005-10-25  Raja R Harinath  <rharinath@novell.com>
1535
1536         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
1537         Remove.
1538         (NamespaceEntry.VerifyAllUsing): New.
1539         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
1540         behaviour.  Delegates actual resolution of alias to ...
1541         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
1542         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
1543         Update.
1544         * driver.cs (Driver.MainDriver): Update.
1545         
1546         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
1547         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
1548         property.
1549         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
1550         Remove.
1551         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
1552         RootNamespace.DefineNamespacesForAll.
1553
1554 2005-10-24  Raja R Harinath  <harinath@gmail.com>
1555
1556         * typemanager.cs (assemblies, external_aliases, modules)
1557         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
1558         (ComputeNamespaces, GetRootNamespace): Remove extra staging
1559         overhead.  Move resposibility ...
1560         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
1561         * driver.cs, attribute.cs, codegen.cs: Update to changes.
1562
1563 2005-10-23  Raja R Harinath  <harinath@gmail.com>
1564
1565         * namespace.cs (RootNamespace.all_namespaces): Renamed from
1566         cached_namespaces.  Improve usage.
1567         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
1568         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
1569         Move from GlobalRootNamespace and simplify.
1570         (RootNamespace.Global): Make instance variable.
1571         (RootNamespace.RootNamespace): Add "alias name" parameter.
1572         (GlobalRootNamespace): Simplify drastically.
1573         (Namespace.Lookup): Don't use GetNamespace.
1574         * typemanager.cs (GetRootNamespace): Rename from
1575         ComputeNamespaceForAlias.
1576         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
1577
1578 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1579
1580         * anonymous.cs (AnonymousContainer): Don't crash when container
1581         doesn't exist.
1582
1583 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1584
1585         * expression.cs (Binary.DoResolve): Warn when comparing same
1586         values.
1587
1588 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1589
1590         Fix #76486.
1591         * expression.cs (Binary.DoResolve): It looks like there are no
1592         convetsion rules in enum context.
1593
1594 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1595
1596         Add support for extern alias qualifiers.
1597         * typemanager.cs: Move some LookupTypeReflection code
1598         to namespace.cs, to have cleaner code. Added some methods
1599         to help us keep track of the extern aliased references.
1600         * driver.cs: Add suport for extern alias assemblies on command
1601         line and check for their warnings/errors. Also keep track of the
1602         extern aliased assemblies.
1603         * namespace.cs: Move the global functionality of Namespace
1604         to GlobalRootNamespace/RootNamespace. Now the global namespace
1605         is GlobalRootNamespace.Globa. Also the code moved from 
1606         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
1607         Finally added LocalAliasEntry (AliasEntry before) and
1608         ExternAliasEntry, to handle alias statements.
1609         * cs-parser.jay: Add support in the grammar for extern alias
1610         statement.
1611         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
1612         Update callings to Namespace (now in GlobalRootNamespace).
1613
1614 2005-10-25  Martin Baulig  <martin@ximian.com>
1615
1616         * convert.cs (ImplicitTypeParameterConversion): Make base
1617         interfaces actually work; fixes #76557.
1618
1619 2005-10-25  Martin Baulig  <martin@ximian.com>
1620
1621         * generic.cs
1622         (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
1623         all the type parameters; fixes #76551.
1624
1625 2005-10-25  Martin Baulig  <martin@ximian.com>
1626
1627         Fix #76472.
1628
1629         * generic.cs
1630         (GenericMethod.ctor): Added `Expression return_type' and
1631         `Parameters parameters' arguments.
1632         (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
1633         parameter and return types to check their constraints if they're
1634         generic types.
1635
1636         * codegen.cs (EmitContext.ResolvingGenericMethod): New public
1637         boolean field.
1638
1639         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
1640         constraints of a generic type if `ec.ResolvingGenericMethod'.
1641
1642         * class.cs (MethodCore.DoDefineParameters): Set
1643         `ec.ResolvingGenericMethod' if we're a generic method.
1644         (MemberBase.MemberType): Likewise.
1645
1646 2005-10-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1647
1648         * typemanager.cs (TypeManager): Added 
1649         TypeManager.internals_visible_attr_type to cache
1650         S.R.CompilerServices.InternalsVisibleToAttribute.
1651
1652         * codegen.cs (AssemblyClass): Added checks for 
1653         InternalsVisibleToAttribute in new method 
1654         CheckInternalsVisibleAttribute () and also cache the
1655         AssemblyName in AssemblyClass.Name.
1656         
1657 2005-10-24  Martin Baulig  <martin@ximian.com>
1658
1659         * typemanager.cs
1660         (TypeManager.ExpandInterfaces): Added overloaded version which
1661         just takes a `Type[]' array.
1662
1663         * generic.cs
1664         (Constraints.Resolve): Don't expand the interfaces here; ie. we
1665         just use the interfaces which were explicitly specified and not
1666         the interfaces they inherit.  Fixes #76482.
1667         (TypeParameter.FindMembers): Expand the interfaces here.
1668
1669 2005-10-21  Martin Baulig  <martin@ximian.com>
1670
1671         * generic.cs
1672         (Constraints.Resolve): Also resolve the actual types here.
1673         (Constraints.ResolveTypes): Just check the constraints here.
1674         Fixes #76363; see gtest-218.cs.
1675
1676 2005-10-21  Martin Baulig  <martin@ximian.com>
1677
1678         * convert.cs
1679         (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
1680         instead of a `BoxedCast'; fixes gtest-217.cs.
1681
1682 2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
1683
1684         * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
1685           1) "new()" is specified as generic parameter constraint and 2) the
1686           type is TypeBuilder and 3) the type is abstract even if it has a
1687           default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
1688
1689 2005-10-20  Martin Baulig  <martin@ximian.com>
1690
1691         * generic.cs
1692         (GenericConstraints.TypeParameter): New public property.
1693         (TypeParameter.ctor): Also take a `DeclSpace' argument.
1694         (TypeParameter.DeclSpace): New public property.
1695         (TypeParameter.DefineType): Inflate the constraints if our
1696         `DeclSpace' is an `Iterator'.   
1697
1698 2005-10-19  Atsushi Enomoto  <atsushi@ximian.com>
1699
1700         * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added 
1701           GenericMethod argument to compare methods' generic type arguments.
1702           Fixed bug #76382.
1703
1704 2005-10-19  Martin Baulig  <martin@ximian.com>
1705
1706         * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
1707         not ResolveType() when resolving the base type, so we're not
1708         checking the constraints here.
1709         (TypeContainer.ResolveType): Call ResolveType() on our base_type
1710         if we have any.
1711
1712 2005-10-19  Martin Baulig  <martin@ximian.com>
1713
1714         * generic.cs (ConstructedType.CheckConstraints): Committing
1715         untested fix for #76441.
1716
1717 2005-10-18  Raja R Harinath  <rharinath@novell.com>
1718
1719         Fix #76371.
1720         * class.cs (TypeContainer.DefineType): Move updating of
1721         topological sort earlier in the code.
1722         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
1723
1724 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
1725
1726         Fix #76273.
1727         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
1728         
1729         * constant.cs (Constant.TryReduce): Moved from Cast class.
1730         (Reduce): Made little bit more OO and fixed missing conversions.
1731         
1732         * ecore.cs (Reduce): Implemented.
1733         (Binary.EnumLiftUp): New method to upgrade values to enum values.
1734         
1735         * literal.cs (Reduce): Implemented.
1736         
1737         * class.cs: Reverted Miguel's wrong commit.
1738
1739 2005-10-14  Miguel de Icaza  <miguel@novell.com>
1740
1741         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
1742
1743 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
1744
1745         * cs-parser.jay, expression.cs : CS0214 was missing error location
1746           for constants. Fixed bug #76404.
1747
1748 2005-10-10  Raja R Harinath  <rharinath@novell.com>
1749
1750         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
1751         InstanceExpression.
1752         (PropertyExpr.EmitCall): Likewise.
1753         * expression.cs (Invocation.EmitArguments): Handle case where
1754         arguments == null.
1755         (Invocation.EmitCall): Avoid allocating temporary variable if
1756         there are no arguments.
1757
1758 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
1759
1760         Fix #76370.
1761         * convert.cs (ExplicitConversionCore): Fixed object->enum
1762         conversion.
1763
1764 2005-10-07  Raja R Harinath  <rharinath@novell.com>
1765
1766         Fix #76323.
1767         * convert.cs (ImplicitConversionStandard): Move conversion of
1768         void* to arbitrary pointer types ...
1769         (ExplicitConversionStandard): .. here.
1770         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
1771         error to always print typenames.
1772
1773 2005-10-07  Raja R Harinath  <rharinath@novell.com>
1774
1775         * convert.cs (GetConversionOperator): Rename from
1776         GetConversionOperators.  Move operator selection code from ...
1777         (UserDefinedConversion): ... here.
1778
1779 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
1780
1781         * convert.cs (ExplicitConversionCore): Removed duplicate enum
1782         conversion.
1783
1784 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
1785
1786         * assign.cs (Assign.DoResolve): Error method changed.
1787
1788         * cfold.cs (DoConstantNumericPromotions): Error method changed.
1789         
1790         * const.cs (ResolveValue): Reset in_transit immediately.
1791         
1792         * constant.cs: Error method changed.
1793         
1794         * convert.cs: Removed useless location parameter.
1795         (ExplicitNumericConversion): Don't do double enum check.
1796         (ExplicitConversionCore): Renamed from ExplicitConversion.
1797         (ExplicitUnsafe): Extracted from ExplicitConversion.
1798         (ExplicitConversion): Uses for error reporting.
1799         
1800         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
1801         error messages.
1802         (ResolveBoolean): Uses common error method.
1803         (CastToDecimal): Get rid of ec.
1804         (CastFromDecimal): Optimized.
1805         (ConvCast): Get rid of ec.
1806         
1807         * enum.cs (ResolveValue): Reset in_transit immediately.
1808         (Emit): Return after first error.
1809         
1810         * expression.cs: Convert changes.
1811         
1812         * literal.cs: Error method changed.
1813         
1814         * statement.cs: Error method changed.
1815
1816 2005-10-06  Raja R Harinath  <rharinath@novell.com>
1817
1818         Fix gtest-131.cs and gtest-211.cs.
1819         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
1820         Only emit code for a label if it is used.  Unreachable code can
1821         violate ECMA evaluation stack invariants.
1822
1823 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
1824
1825         * anonymous.cs: Implemented ExprClassName.
1826         
1827         * assign.cs (Assign.DoResolve): Don't chrash when type is not
1828         delegate.
1829         
1830         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
1831         check.
1832         
1833         * class.cs (StaticClass.DefineContainerMembers): Report protected
1834         members as error.
1835         
1836         * codegen.cs: if(ed) PRODUCTION.
1837         
1838         * convert.cs (Error_CannotImplicitConversion): Better error
1839         distinction.
1840         
1841         * cs-parser.jay: More error checks.
1842         
1843         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
1844         
1845         * driver.cs (CSCParseOption): Enabled wrong option check.
1846         
1847         * ecore.cs (Expression.ExprClassName): Turned to property.
1848         (MemberExpr.CheckIntermediateModification): For checking boxed
1849         value types     modification.
1850         
1851         * statement.cs (Fixed.Resolve): Expression type must be
1852         convertible to fixed type.
1853         (CollectionForeach.GetEnumeratorFilter,TryType):
1854         Small refactoring for easier error checking.
1855
1856 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
1857
1858         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
1859         attributes.
1860         
1861         * class.cs (GeneratedBaseInitializer): New class for customization
1862         compiler generated initializers.
1863         (MemberBase.DoDefine): Check Obsolete attribute here.
1864         (FieldMember.DoDefine): Ditto.
1865         
1866         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
1867         constants.
1868         
1869         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
1870         (MemberCore.GetObsoleteAttribute): Removed argument.
1871         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
1872         (MemberCore.CheckObsoleteType): New helper.
1873         
1874         * delegate.cs,
1875         * enum.cs,
1876         * statement.cs: Updates after MemberCore changes.
1877         
1878         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
1879         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
1880         
1881         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
1882         obsolete attribute for compiler construct.
1883         (As.DoResolve): Cache result.
1884         
1885         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
1886
1887 2005-10-01  Miguel de Icaza  <miguel@novell.com>
1888
1889         * expression.cs (Probe): instead of having a "Type probe_type"
1890         keep the extra information as a TypeExpr probe_type_expr since the
1891         "As" operator needs to perform some type checks.
1892
1893         * (As.DoResolve): If the type is a type parameter, ensure that it
1894         is constrained by a class.
1895
1896 2005-09-22  Miguel de Icaza  <miguel@novell.com>
1897
1898         * statement.cs (Lock): Use the TemporaryVariable class instead of
1899         manually using local variables as those do not work when variables
1900         are captured.
1901
1902         * ecore.cs: Moved the TemporaryVariable class from being a nested
1903         class inside Foreach to be a public class that can be employed in
1904         other places. 
1905
1906 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
1907
1908         * cs-parser.jay: interface_accessors replaced by
1909         accessor_declarations.
1910
1911         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
1912         location.
1913         
1914         * statement.cs (GotoCase.Resolve): Convert null constant to
1915         null case.
1916         (SwitchLabel.ResolveAndReduce): Ditto.
1917         (SwitchLabel.NullStringCase): Custom null stamp.
1918         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
1919         
1920         typemanager.cs (CSharpSignature): Don't skip first argument
1921         for full names.
1922
1923 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
1924
1925         * cfold.cs, constant.cs, convert.cs, ecore.cs,
1926         expression.cs, iterators.cs, literal.cs: Store constants and
1927         literals location.
1928         
1929         * class.cs (MemberBase.ShortName): Pass location.
1930         
1931         * cs-parser.jay: Some location fixes.
1932         
1933         * ecore.cs (Expression.Location): Made virtual.
1934
1935 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
1936
1937         Fix #72930.
1938         * const.cs (Const.ResolveValue): Check for assigning non-null
1939         value to reference type.
1940
1941 2005-09-26  Raja R Harinath  <rharinath@novell.com>
1942
1943         Fix #76133.
1944         * expression.cs (This.VerifyFixed): In a value type T, the type of
1945         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
1946         value type R, 'this' is treated as a value parameter.
1947
1948 2005-09-05  Miguel de Icaza  <miguel@novell.com>
1949
1950         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
1951         if the underlying types are the same, otherwise we need to produce
1952         code that will do the proper cast.
1953
1954         This was exposed by Marek's constant rewrite which produced
1955         invalid code for the call site:
1956
1957         enum X : long { a }
1958         void Method (X v) {}
1959
1960         Method ((X) 5)
1961
1962         This fixes test-49.cs
1963
1964 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
1965
1966         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
1967           Type/Object should be allowed as well. Fixed bug #75968.
1968
1969 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
1970
1971         * expression.cs : (Binary.DoResolve): when one is enum constant and
1972           another is constant 0, then return enum one *as enum type*.
1973           Fixed bug 74846.
1974
1975 2005-10-04  Martin Baulig  <martin@ximian.com>
1976
1977         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
1978         `SetMemberIsUsed()' work for generics, too.
1979
1980 2005-10-04  Martin Baulig  <martin@ximian.com>
1981
1982         * expression.cs (DelegateInvocation.EmitStatement): Make this work
1983         for corlib.  Fixes #75691.
1984
1985 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
1986
1987         Fix #76255.
1988         * driver.cs: Fix compilation files with full root path.
1989
1990 2005-09-25  Miguel de Icaza  <miguel@novell.com>
1991
1992         * report.cs (SymbolRelatedToPreviousError): Format the output so
1993         it does not use an open parenthesis that is never closed. 
1994
1995         * driver.cs: Follow coding guidelines
1996
1997 2005-09-18  Miguel de Icaza  <miguel@novell.com>
1998
1999         * driver.cs: Set InEmacs based on the environment variable EMACS. 
2000
2001         * location.cs (InEmacs): in this mode, do not report column
2002         location as it confuses Emacs.
2003
2004 2005-10-03  Raja R Harinath  <rharinath@novell.com>
2005
2006         * support.cs (SeekableStreamReader.Position): Don't error out when
2007         the requested position is just beyond the end of the current
2008         buffered data.
2009
2010 2005-09-28  Raja R Harinath  <rharinath@novell.com>
2011
2012         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
2013         try to keep in sync with the byte count of the underlying Stream.
2014         However, this limits us to a window size of 2048 characters: i.e.,
2015         the maximum lookahead of our lexer/parser can be 2048 characters.
2016
2017 2005-09-22  Martin Baulig  <martin@ximian.com>
2018
2019         * driver.cs: Removed a debugging FIXME.
2020
2021 2005-09-21  Raja R Harinath  <rharinath@novell.com>
2022
2023         * cs-parser.jay (type_arguments): Add CS1644 check.
2024         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
2025
2026 2005-09-15  Raja R Harinath  <rharinath@novell.com>
2027
2028         * Makefile (PROGRAM): Make profile specific.
2029         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
2030         the current directory.
2031
2032         Fix test-455.cs.
2033         * expression.cs (Invocation.EmitCall): Remove optimization on
2034         this_call since it doesn't handle 'this' being a value type.
2035
2036 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
2037
2038         * driver.cs: Ensure file handles are closed after parsing
2039
2040 2005-09-05  Miguel de Icaza  <miguel@novell.com>
2041
2042         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2043         if the underlying types are the same, otherwise we need to produce
2044         code that will do the proper cast.
2045
2046         This was exposed by Marek's constant rewrite which produced
2047         invalid code for the call site:
2048
2049         enum X : long { a }
2050         void Method (X v) {}
2051
2052         Method ((X) 5)
2053
2054         This fixes test-49.cs
2055
2056 2005-09-05  Martin Baulig  <martin@ximian.com>
2057
2058         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
2059         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
2060
2061         * cs-parser.jay (delegate_declaration): Small fix for #75852.
2062
2063 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2064
2065         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
2066           to be a pointer type due to the spec 25.2, so check if declaring
2067           type is generic type definition. Fixed bug #75772.
2068
2069 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2070
2071         Fixed bug #75957.
2072         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
2073           both types are not defined by methods.
2074         * expression.cs : (Invocation.IsApplicable): it should work when
2075           the argument type is equal to the parameter type, not only when
2076           ImplicitConversionExists() returns true.
2077
2078 2005-09-02  Raja R Harinath  <rharinath@novell.com>
2079
2080         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2081         internal.
2082
2083         Fix #75941.
2084         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2085         flow-branching for LocalVariableReferences in case we were invoked
2086         from a MemberAccess.
2087         * expression.cs (LocalVariableReference.VerifyAssigned): New.
2088         Carved out of ...
2089         (LocalVariableReference.DoResolveBase): ... this.
2090         (MemberAccess.Resolve): Do the check that was disabled during
2091         SimpleNameResolve.
2092
2093 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2094
2095         * class.cs :
2096           (PartialContainer.Create): check abstract/sealed/static strictly
2097           but abstract/sealed can exist only at one side. Fixed bug #75883.
2098
2099 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
2100
2101         Fix #75945.
2102         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2103         specified, don't default to UnmanagedType.I4.
2104
2105 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2106
2107         * expression.cs : conditional operator should check possibly
2108           incorrect assign expression. Fixed bug #75946.
2109
2110 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2111
2112         Fix #75934.
2113         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2114         (ScopeInfo.EmitScopeType): Use it to construct field names from
2115         names of captured locals.
2116
2117         Fix #75929.
2118         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2119         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2120         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
2121         (ExplicitConversion): Remove enum cases already handled by
2122         implicit conversion.  Move implicit conversion check to the beginning.
2123         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2124         * expression.cs (ArrayCreation.EmitDynamicInitializers):
2125         Don't treat System.Enum as a struct.
2126
2127 2005-08-30  Jb Evain  <jbevain@gmail.com>
2128
2129         * attribute.cs: handles as expression in parameters.
2130
2131 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2132
2133         Fix #75802.
2134         * class.cs (TypeContainer.VerifyClsName): Don't use a
2135         PartialContainer when verifying CLS compliance.
2136         (AbstractPropertyEventMethod): Set Parent here, ...
2137         (PropertyMethod): ... not here.
2138
2139 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
2140
2141         * attribute.cs : escaped attribute name should not be allowed to be
2142           resolved (e.g. @class as classAttribute). Fixed bug #75930.
2143
2144 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2145
2146         Fix #75927.
2147         * convert.cs (ImplicitStandardConversionExists): Allow zero also
2148         when converting a long constant to unsigned long.
2149         * expression.cs (Invocation.OverloadResolve): Add sanity check to
2150         detect where IsApplicable and VerifyArgumentsCompat disagree.
2151
2152 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2153         and Carlos Alberto Cortez  <carlos@unixmexico.org>
2154
2155         Fix #75848.
2156         * class.cs (TypeContainer.CanElideInitializer): New helper.
2157         (TypeContainer.EmitFieldInitializers): Use it to determine if we
2158         can safely emitting the initializer of a field.
2159
2160 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2161
2162         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2163           allowed inside a switch (without loop). Fixed bug #75433.
2164
2165 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
2166
2167         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2168         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2169
2170 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2171
2172         * driver.cs : kinda reverting the default encoding changes (not exact 
2173           revert since I noticed that "codepage:reset" might not work fine).
2174
2175 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2176
2177         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2178           Location. Now getter and setter store location correctly.
2179           (errors/cs0111-12.cs now reports the expected location.)
2180
2181 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2182
2183         * driver.cs : Use default encoding on the environment.
2184           Removed (now that) extra parameter for SeekableStreamReader.
2185         * support.cs : (SeekableStreamReader) third .ctor() argument for
2186           StreamReader is not required (always true). preamble size could
2187           be acquired in simpler and safe way.
2188
2189 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
2190
2191         * cs-parser.jay: report CS0642 at warning level 3
2192           and report CS0642 for an if else statement also
2193           fixes bug #74745. Patch by John Luke (and a bit
2194           modified by me).
2195           Removed extra CS0642 warning check for "while",
2196           "for" and "fixed".
2197         * statement.cs: In Block.Resolve(), CS0642 check
2198           is reimplemented to check a sequence of an empty
2199           statement and a block.
2200
2201           Both fix bug #66777.
2202
2203 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
2204
2205         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2206         detection until I fix it.
2207         
2208         * cs-tokenizer.cs: Changed error message.
2209         
2210         * cs-parser.jay: Fixed 2 error locations.
2211         
2212         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2213         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2214         properties.
2215         
2216         * enum.cs (GetSignatureForError): Fixed.
2217         
2218         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2219         method detection.
2220         
2221         * class.cs,
2222         * typemanager.cs (RegisterProperty): Removed.
2223         
2224         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2225
2226 2005-08-24  Raja R Harinath  <rharinath@novell.com>
2227
2228         Fix #75874.
2229         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2230         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2231
2232 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2233
2234         * expression.cs : tiny fix is required for not warning positive ulong.
2235           See test-441.cs.
2236
2237 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2238
2239         * expression.cs : add CS0652 check for constant and integral
2240           expression. Fixed bug #53974.
2241
2242 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2243
2244         * expression.cs : in DoNumericPromotions(), check if there is implicit
2245           conversion overload for string (to check CS0034). Fixed bug #52492.
2246
2247 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2248
2249         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2250
2251 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2252
2253         * ecore.cs : report location when it is *not* Null.
2254
2255 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2256
2257         * codegen.cs,
2258           ecore.cs,
2259           flowanalysis.cs,
2260           expression.cs:
2261           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2262           correctly. Fixed bug #75721.
2263
2264 2005-08-23  Raja R Harinath  <rharinath@novell.com>
2265
2266         * support.cs (SeekableStreamReader.Position): Avoid an expensive
2267         loop that performs 'min (pos, char_count)'.
2268
2269         Fix #75862.
2270         * expression.cs (Unary.ResolveOperator): Don't discard implicit
2271         converted value in Operator.OnesComplement.
2272
2273 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
2274
2275         * anonymous.cs: If the anon method is pulled into a helper class,
2276         it needs to be `internal' not `private'. Fixes runtime behavior on
2277         msft. bug #75704
2278
2279 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
2280
2281         Fix #75803
2282         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2283         is a partial class.
2284
2285 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
2286
2287         The big constants rewrite
2288         Fix #75746, #75685 and more
2289         As a side effect saved 1MB for MWF ;-)
2290         
2291         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
2292         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
2293         enum based for corlib compilation.
2294         
2295         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
2296         subtractions.
2297         
2298         * class.cs (FixedField.Define): Use ResolveAsConstant.
2299         
2300         * const.cs (IConstant): Interface constants and enums.
2301         (Const.ResolveValue): New method for constant resolvning.
2302         (ExternalConstant): Constants from imported assemblies.
2303         
2304         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
2305         conversion; like enums.
2306         (Constant.ToType): Converts this constant to different type.
2307         (Constant.Increment): Adds 1.
2308         
2309         * convert.cs (ImplicitConversionRequired): Simplified.
2310         
2311         * cs-parser.jay: Create EnumMember directly.
2312         
2313         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
2314         
2315         * doc.cs (GenerateEnumDocComment): Removed.
2316         
2317         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
2318         (ConvertIntLiteral): Removed.
2319         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
2320         
2321         * enum.cs (EnumMember): Implement IConstant.
2322         (Enum.IsValidEnumConstant): Removed.
2323         (Enum.GetNextDefaultValue): Removed.
2324         (Enum.FindMembers): Updated.
2325         (Enum.GenerateDocComment): Iterate enum members.
2326         
2327         * expression.cs (Cast.TryReduce): Handle enums correctly.
2328         (New.Constantify): Made public.
2329         (MemberAccess.DoResolve): Removed contant specific if(s).
2330         
2331         * literal.cs (NullLiteral): Implement new abstract methods.
2332         
2333         * statement.cs (GotoCase.Resolve): Use new constant methods.
2334         (SwitchLabel.ResolveAndReduce): Use new constant methods.
2335         
2336         * typemanager.cs (LookupEnum): Removed.
2337         (IsEnumType): Fixed to work with corlib.
2338         (RegisterConstant): Removed.
2339         (LookupConstant): Removed.
2340         (GetConstant): Changed to work with IConstant.
2341
2342 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
2343
2344         * location.cs : Fixed overflown (>255) column number.
2345
2346 2005-08-03  Raja R Harinath  <rharinath@novell.com>
2347
2348         First cut of the qualified-alias-member feature.
2349         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
2350         token.
2351         * cs-parser.jay (DOUBLE_COLON): New token.
2352         (namespace_or_type_name): Add rule for recognizing
2353         qualified-alias-members.
2354         (primary_expression): Likewise.
2355         (element_access): Allow QualifiedAliasMember as a possible
2356         type-bearing expression.
2357         (local_variable_type, local_variable_pointer_type): Likewise.
2358         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
2359         aliases in the current and enclosing namespace declarations.
2360         (NamespaceEntry.UsingAlias): Add CS0440 warning.
2361         * decl.cs (MemberName.is_double_colon): New.
2362         (MemberName.MemberName): Add new constructor for alias-member.
2363         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
2364         * expression.cs (QualifiedAliasMember): New expression type.
2365
2366 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2367
2368         * location.cs : it borked when no argument was specified.
2369
2370 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2371
2372         * location.cs : tiny ToString() format fix.
2373
2374 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2375
2376         * statement.cs : oops, it was missing.
2377
2378 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2379
2380         A set of fixes for precise line/column location.
2381
2382         * location.cs :
2383           "token" field now holds a file/line "delta", a line number offset 
2384           from the segment, and a column number. See also:
2385           http://lists.ximian.com/pipermail/mono-devel-list/2004-
2386           December/009508.html
2387           Removed static IsNull. Use instance IsNull property instead.
2388         * cs-tokenizer.cs :
2389           For some tokens it stores Location. For Identifier it stores
2390           LocatedToken which is a pair of string name and location.
2391           Column numbers are adjusted only at getChar().
2392         * report.cs :
2393           Use Location.ToString() for reporting (it now contains column).
2394         * cs-parser.jay :
2395           Largely modified to use LocatedToken instead of
2396           string (IDENTIFIER), and to acquire Location from some tokens.
2397         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2398           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2399           codegen.cs :
2400           Now MemberName holds Location. DeclSpace.ctor() receives Location
2401           as a parameter. Removed extra parameters to all derived classes.
2402           Replaced Location.IsNull() with instance property.
2403         * assign.cs, expression.cs :
2404           Added .ctor() overload that omits Location.
2405         * attribute.cs :
2406           Added "nameEscaped" flag that indicates the identifier was escaped
2407           in the source file. This fixes bug #57047.
2408
2409 2005-09-02  Martin Baulig  <martin@ximian.com>
2410
2411         * class.cs: Make CS3005 a warning, not an error.
2412
2413 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
2414
2415         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2416         New method, looking for lo-case imported cls type.
2417
2418         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2419         here.
2420
2421         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2422
2423         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2424
2425         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2426         all_imported_types.
2427         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2428
2429         Optimized to save 3.5 MB for SWF compilation.
2430
2431 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2432
2433         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
2434         (PartialContainer.Create): Moved logic AddToContainer.
2435         (PartialContainer.MarkForDuplicationCheck): Shares name.
2436         
2437         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
2438         place.
2439         
2440         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
2441         initialization.
2442         (Namespace.GetSignatureForError): New method.
2443         
2444         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
2445         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
2446
2447 2005-08-01  Raja R Harinath  <rharinath@novell.com>
2448
2449         Fix #75669.
2450         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
2451         member lookup rather than qualifier_type, since qualifier_type can
2452         be null.
2453
2454 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2455
2456         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
2457         enum member.
2458
2459 2005-07-31  Miguel de Icaza  <miguel@novell.com>
2460
2461         * statement.cs: Copy the local exception into the exception
2462         captured local.  Fixes 75674
2463
2464 2005-07-31  Raja R Harinath  <harinath@gmail.com>
2465
2466         Fix #75658.
2467         * expression.cs (Invocation.OverloadResolve): Don't report error
2468         CS1501 if error CS1502 has been reported.
2469         (New.DoResolve): Delegate CS1501 reporting to
2470         Invocation.OverloadResolve.
2471
2472         Fix #75656.
2473         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
2474         invariant-meaning-in-block property in an enclosing block if
2475         necessary.
2476
2477 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
2478
2479         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
2480         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
2481         (Switch.CheckSwitch): Just save 50kb for SWF.
2482
2483 2005-07-27  Martin Baulig  <martin@ximian.com>
2484
2485         * anonymous.cs (CaptureContext.AddField): Added
2486         `AnonymousContainer am' argument; compute its toplevel scope if
2487         it's not already computed.  Fixes #75649.
2488
2489 2005-07-26  Raja R Harinath  <rharinath@novell.com>
2490
2491         Fix #75628.
2492         * class.cs (Constructor.Emit): Reset block to null if the block
2493         resolve fails.
2494
2495 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
2496
2497         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
2498
2499 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
2500
2501         * class.cs (MethodData.Define): Check whether accessor implementing
2502         interface is public.
2503
2504         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
2505
2506 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
2507
2508         Fix #57245
2509         * namespace.cs (LookupType): Moved same type check to...
2510         
2511         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
2512         with the same name.
2513
2514 2005-07-21  Raja R Harinath  <rharinath@novell.com>
2515
2516         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
2517         already found a typebuilder.
2518         * class.cs (MethodCore.IsDuplicateImplementation): Compare
2519         MemberNames, not strings.
2520
2521         * const.cs (Error_ExpressionMustBeConst): 
2522         Rename from Error_EpressionMustBeConst.
2523         * const.cs, class.cs, statement.cd: Update.
2524
2525 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
2526
2527         Fix #65573
2528
2529         * const.cs (Const.LookupConstantValue): Report missing contant expression
2530         everytime.
2531         (Error_EpressionMustBeConstant): Only one error method.
2532
2533         * class.cs, statement.c: Updated.
2534
2535 2005-07-20  Raja R Harinath  <rharinath@novell.com>
2536
2537         * statement.cs (Block.Flags): Add back HasVarargs.
2538         (Block.flags): Make protected.
2539         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
2540
2541         * typemanager.cs (types, typecontainers, user_types): Remove.
2542         (UserTypes, TypeContainers): Likewise.
2543         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
2544         (CleanUp, Reset): Update.
2545         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
2546         (GetNestedType): Use Type.GetNestedType.
2547         (CoreLookupType): Take two arguments, the namespace and the
2548         basename of the type.  Update to use the Namespace.Lookup
2549         mechanism.
2550         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
2551         (RealMemberLookup): Use IsNestedChildOf instead of playing with
2552         string concatenation and substring matches.
2553         * class.cs, enum.cs, delegate.cs: Update to changes.
2554
2555 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
2556
2557         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
2558         Expression and made virtual.
2559
2560         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
2561         (ImplicitStandardConversionExists): Fixed `byte' typo ?
2562
2563         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
2564
2565         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
2566         error message.
2567
2568         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
2569         change.
2570
2571 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
2572
2573         Fix #57707
2574         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
2575         AssemblyCultureAttribute is not used on executable.
2576
2577         * rootcontext.cs,
2578         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
2579
2580 2005-07-16  Raja R Harinath  <rharinath@novell.com>
2581
2582         Fix #60638.
2583         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
2584         New.  Reports CS0252/CS0253.
2585         Mostly taken from preliminary patch by Duncak Mak.
2586         (Binary.DoResolveOperator): Store results of operator lookup.
2587         Use them to detect if we need to warn about unintended reference
2588         comparisons.
2589
2590 2005-07-15  Raja R Harinath  <rharinath@novell.com>
2591
2592         Fix #72969.
2593         * namespace.cs (Namespace.Lookup): Add back location parameter.
2594         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
2595         * delegate.cs, ecore.cs, expression.cs: Update to changes.
2596
2597         * codegen.cs (EmitContext.DeclSpace): Make readonly.
2598         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
2599         (Namespace.LookupType): ... this.
2600         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
2601         of namespaces.
2602         * typemanager.cs (LookupTypeReflection): Remove buggy code that
2603         purported to handle pointers.
2604         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
2605         CoreLookupType.
2606
2607 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
2608
2609         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2610         type as namespace.
2611
2612 2005-07-15  Raja R Harinath  <rharinath@novell.com>
2613
2614         * namespace.cs (Namespace.Lookup): Drop location parameter.
2615         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
2616         (NamespaceEntry.Lookup): ... this.
2617         (NamespaceEntry.Error_AmbiguousTypeReference):
2618         Move here from DeclSpace.
2619         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
2620         names ...
2621         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
2622         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
2623         Move to NamespaceEntry.
2624         * delegate.cs, expression.cs: Update to changes.
2625
2626 2005-08-31  Martin Baulig  <martin@ximian.com>
2627
2628         Committing a patch from Atsushi Enomoto for #75850.
2629
2630         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
2631         Prefer a generic enumerator over a non-generic one.
2632
2633 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
2634
2635         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2636         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2637
2638 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2639
2640         * driver.cs : reverting default encoding change as well as mcs.
2641
2642 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2643
2644         * driver.cs, support.cs : merged r48826.
2645           Marek Safer wrote:
2646           > could you integrate your mcs changes to gmcs otherwise
2647           > gmcs cannot compile some files.
2648
2649 2005-08-20  Martin Baulig  <martin@ximian.com>
2650
2651         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2652         scope if we don't already have it.
2653
2654         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2655         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2656         fixes #75867.
2657
2658 2005-07-31  Miguel de Icaza  <miguel@novell.com>
2659
2660         * statement.cs: Copy the local exception into the exception
2661         captured local.  Fixes 75674
2662
2663 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
2664
2665         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2666         type as namespace.
2667
2668 2005-08-12  Martin Baulig  <martin@ximian.com>
2669
2670         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
2671         for nested types here to avoid hitting the cache too early.
2672
2673 2005-08-09  Miguel de Icaza  <miguel@novell.com>
2674
2675         * enum.cs: On the new compiler CLS error 3005 is now a warning not
2676         an error. 
2677
2678 2005-08-03  Martin Baulig  <martin@ximian.com>
2679
2680         Make iterators in generic methods work; see gtest-191.cs.
2681
2682         * generic.cs
2683         (Constraints.Resolve): Protect against being called twice.
2684
2685         * class.cs
2686         (TypeContainer.GetClassBases): Make this `protected virtual'.
2687
2688         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
2689         (Iterator.GetClassBases): Override this and compute the base
2690         classes here.
2691         (Iterator.DefineNestedTypes): If we're a generic method, all our
2692         method type parameters become class type parameters on the proxy
2693         class.
2694
2695         * statement.cs
2696         (ToplevelBlock.Parameters): Make this a property, not a field.
2697         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
2698
2699 2005-08-03  Martin Baulig  <martin@ximian.com>
2700
2701         * typemanager.cs (TypeManager.IsSubclassOf): Use
2702         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
2703         (TypeManager.GetFullName_recursed): Improved.
2704
2705 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2706
2707         Fix #75417
2708         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
2709         Private accessor case, using TypeManager.IsPrivateAccessible instead of
2710         invocation_type == mi.DeclaringType, since the first one also checks
2711         other condition used by generic instances.
2712         
2713 2005-07-27  Martin Baulig  <martin@ximian.com>
2714
2715         * anonymous.cs (CaptureContext.AddField): Added
2716         `AnonymousContainer am' argument; compute its toplevel scope if
2717         it's not already computed.  Fixes #75649.
2718
2719 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
2720
2721         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
2722         CheckAttributeType and refactored.
2723         (Attribute.ResolvePossibleAttributeType): Changed to reuse
2724         ResolveAsTypeTerminal error handling.
2725         (ResolveAsTypeTerminal): Introduced because of global attributes extra
2726         handling.
2727         (GetSignatureForError): Print errors in same way.
2728
2729         * class.cs,
2730         * codegen.cs: Reflect attribute GetSignatureForError change.
2731
2732         * ecore.cs,
2733         * expression.cs: Add silent parameter to ResolveAsTypeStep.
2734
2735         * namespace.cs (UsingEntry): Refactored to make fields private.
2736
2737         * assign.cs,
2738         statement.cs: Error_UnexpectedKind has extra parameter.
2739
2740 2005-07-14  Raja R Harinath  <rharinath@novell.com>
2741
2742         * ecore.cs (IAlias): Remove.
2743         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
2744         that implement the interface.
2745         * namespace.cs (Namespace): Likewise.
2746         (Namespace.declspaces): Renamed from 'defined_names'.
2747         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
2748         DeclSpace instead of an IAlias.
2749         * tree.cs (Tree.AddDecl): Update.
2750
2751 2005-07-12  Raja R Harinath  <rharinath@novell.com>
2752
2753         * statement.cs (Block.Flags); Remove HasVarargs.
2754         (Block.HasVarargs): Move to ToplevelBlock.
2755         (Block.ThisVariable, Block.AddThisVariable): Likewise.
2756         (Block.Variables): Make protected.  Initialize variable hashtable
2757         if necessary.
2758         (Block.AddVariable): Update.
2759         (Block.Resolve): Update to changes.
2760         (ToplevelBlock.HasVarargs): New boolean.
2761         (ToplevelBlock.ThisVariable): Move here from Block.
2762         (ToplevelBlock.AddThisVariable): Likewise.
2763         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
2764         * expression.cs (This.ResolveBase): Update to changes.
2765         (ArglistAccess.DoResolve): Likewise.
2766
2767 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
2768
2769         Fix #75321
2770         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
2771
2772         * class.cs (TypeContainer.VerifyMembers): Distinguish between
2773         not used and not used & assigned.
2774         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
2775
2776 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
2777
2778         Fix #75053
2779         * expression.cs (Is.DoResolve): null is never provided type.
2780
2781 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
2782
2783         Fix #52496
2784         * cs-parser.jay: Less strict event error rule to catch more errors.
2785
2786 2005-07-11  Martin Baulig  <martin@ximian.com>
2787
2788         * generic.cs (ConstructedType.CheckConstraints): Improve the check
2789         for the constructor constraint: we do not only have to check
2790         whether the class has a public constructor, but also ensure that
2791         it's parameterless.  Fixes #75492.
2792
2793 2005-07-11  Martin Baulig  <martin@ximian.com>
2794
2795         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
2796         between type parameters if they either have the reference type
2797         constraint or the class constraint.
2798
2799 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
2800
2801         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
2802
2803 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
2804
2805         Fix #74975
2806         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
2807         (ExtractSecurityPermissionSet): Cope with self referencing security
2808         attributes properly.
2809
2810         * driver.cs (SetOutputFile): Made public property OutputFile.
2811
2812 2005-07-07  Raja R Harinath  <rharinath@novell.com>
2813
2814         Fix #75486.
2815         * class.cs (TypeContainer.first_nonstatic_field): Rename from
2816         has_nonstatic_fields.  Make into a FieldBase pointer.
2817         (TypeContainer.AddField): Add CS0282 check.
2818         (TypeContainer.EmitType): Update.
2819
2820 2005-07-06  Miguel de Icaza  <miguel@novell.com>
2821
2822         * cs-tokenizer.cs (consume_identifier): Do not create strings to
2823         compare if they start with __.
2824
2825 2005-07-06  Raja R Harinath  <rharinath@novell.com>
2826
2827         * statement.cs (Switch.SwitchGoverningType): Only look at
2828         UserCasts that don't need implicit standard conversions to one of
2829         the allowed switch types (Fixes test-322.cs).
2830         (LocalInfo.Resolve): Re-enable sanity-test.
2831
2832 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
2833
2834         * cs-tokenizer.cs (consume_identifier): Detect double undescores
2835         
2836         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
2837         
2838         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
2839
2840 2005-07-06  Raja R Harinath  <rharinath@novell.com>
2841
2842         Fix #75472.
2843         * ecore.cs (SimpleName.GetSignatureForError): Add.
2844         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
2845         (MemberAccess.GetSignatureForError): Add.
2846
2847 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
2848  
2849         The big error and warning messages review.
2850         
2851         * anonymous.cs,
2852         * assign.cs,
2853         * attribute.cs,
2854         * class.cs,
2855         * codegen.cs,
2856         * convert.cs,
2857         * cs-parser.jay,
2858         * cs-tokenizer.cs,
2859         * decl.cs,
2860         * delegate.cs,
2861         * doc.cs,
2862         * driver.cs,
2863         * ecore.cs,
2864         * enum.cs,
2865         * expression.cs,
2866         * flowanalysis.cs,
2867         * iterators.cs,
2868         * literal.cs,
2869         * location.cs,
2870         * modifiers.cs,
2871         * namespace.cs,
2872         * parameter.cs,
2873         * pending.cs,
2874         * report.cs,
2875         * rootcontext.cs,
2876         * statement.cs,
2877         * support.cs,
2878         * tree.cs,
2879         * typemanager.cs: Updated.
2880         
2881         * class.cs: (MethodCore.SetYields): Moved here to share.
2882         (PropertyMethod.Define): Moved iterator setup here.
2883         
2884         * iterators.cs: Add orig_method to have full access to parent
2885         container.
2886
2887 2005-07-05  Raja R Harinath  <rharinath@novell.com>
2888
2889         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
2890         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
2891         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
2892         variable of struct type.
2893         * expression.cs (Unary.ResolveOperator): Update to change.
2894         (Indirection.VerifyFixed): Likewise.
2895         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
2896         (ParameterReference.VerifyFixed): Value parameters are fixed.
2897         (This.VerifyFixed): Treat 'this' as a value parameter.
2898         * statement.cs (LocalInfo.IsFixed): Remove.
2899
2900 2005-07-01  Martin Baulig  <martin@ximian.com>
2901
2902         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
2903         `ec.EmitThis ()' to get the correct scope.
2904
2905 2005-07-01  Martin Baulig  <martin@ximian.com>
2906
2907         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
2908         instance is a ParameterReference; fixes #75299.
2909
2910 2005-06-30  Raja R Harinath  <rharinath@novell.com>
2911
2912         Fix #75412.
2913         * expression.cs (Indexers.map): Remove.
2914         (Indexers.Append): Filter out inaccessible setters and getters.
2915         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
2916
2917         Fix #75283.
2918         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
2919         Refactored from ...
2920         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
2921         (FieldExpr.Emit, PropertyExpr.Emit): Update.
2922         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
2923         * expression.cs (Invocation.EmitCall): Add CS0120 check.
2924
2925 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
2926
2927         Fix #75322
2928         * class.cs (FieldBase.GetInitializerExpression): One more field
2929         for backup.
2930
2931 2005-06-28  Miguel de Icaza  <miguel@novell.com>
2932
2933         * pending.cs: Do not define a proxy if the base method is virtual,
2934         it will be picked up by the runtime (bug 75270).
2935
2936 2005-07-08  Martin Baulig  <martin@ximian.com>
2937
2938         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
2939         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
2940
2941 2005-07-07  Martin Baulig  <martin@ximian.com>
2942
2943         * generic.cs (ConstructedType.CheckConstraint): Use
2944         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
2945         called recursively; fixes #75329.
2946
2947 2005-07-06  Martin Baulig  <martin@ximian.com>
2948
2949         * generic.cs (TypeManager.InferTypeArguments): Added support for
2950         anonymous methods; fixes #75461.
2951
2952 2005-07-01  Martin Baulig  <martin@ximian.com>
2953
2954         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
2955         `ec.EmitThis ()' to get the correct scope.
2956
2957 2005-07-01  Martin Baulig  <martin@ximian.com>
2958
2959         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
2960         instance is `This'; fixes #75299.
2961
2962 2005-06-30  Martin Baulig  <martin@ximian.com>
2963
2964         * class.cs (Indexer): Implement IIteratorContainer; added support
2965         for iterators in indexers.
2966
2967         * codegen.cs
2968         (EmitContext.CurrentIterator): Make this a property, not a field.
2969
2970         * anonymous.cs (AnonymousContainer.Iterator): New public property.
2971
2972 2005-06-28  Miguel de Icaza  <miguel@novell.com>
2973
2974         * pending.cs: Do not define a proxy if the base method is virtual,
2975         it will be picked up by the runtime (bug 75270).
2976
2977 2005-06-28  Martin Baulig  <martin@ximian.com>
2978
2979         * cs-parser.jay (interface_method_declaration): Avoid a
2980         reduce/reduce conflict by moving some of the code into a separate
2981         `interface_method_declaration_body' rule; fixes #75368.
2982
2983 2005-06-28  Martin Baulig  <martin@ximian.com>
2984
2985         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
2986         array check after the check for TypeBuilder's.
2987
2988 2005-06-21  Raja R Harinath  <rharinath@novell.com>
2989
2990         * convert.cs (FindMostEncompassedType): Add two trivial special
2991         cases (number_of_types == 0 || number_of_types == 1).
2992         (FindMostEncompasingType): Likewise.
2993
2994 2005-06-17  Raja R Harinath  <rharinath@novell.com>
2995
2996         Some cleanups preparing for the fix of #75283.
2997         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
2998         error testing.
2999         (EventExpr.InstanceResolve): Likewise.
3000         (EventExpr.DoResolve): Remove redundant checks.
3001
3002 2005-06-08  Miguel de Icaza  <miguel@novell.com>
3003
3004         * class.cs: Small fix.
3005
3006 2005-06-08  Raja R Harinath  <rharinath@novell.com>
3007
3008         Fix #75160.
3009         * class.cs (GetPartialBases): Fix return value check of
3010         part.GetClassBases.
3011
3012 2005-06-07  Raja R Harinath  <rharinath@novell.com>
3013
3014         Ensure that partial classes are registered in their enclosing
3015         namespace.  Initial part of fix of #75160.
3016         * tree.cs (Tree.RecordDecl): Add new namespace argument.
3017         Register declspace with namespace here, not in
3018         DeclSpace.RecordDecl.
3019         * cs-parser.jay: Pass namespace to RecordDecl.
3020         * class.cs (PartialContainer.Create): Likewise.
3021         (ClassPart.DefineType): New sanity-check.  Throws an exception if
3022         called.
3023         * decl.cs (Declspace.RecordDecl): Remove.
3024         * namespace.cs (NamespaceEntry.DefineName): Remove.
3025
3026 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3027
3028         * rootcontext.cs: Reset TargetExt as well.
3029
3030 2005-06-03  Raja R Harinath  <rharinath@novell.com>
3031
3032         * ecore.cs (Expression.Resolve): Emit CS0654 error when
3033         -langversion:ISO-1.
3034
3035 2005-06-02  Raja R Harinath  <rharinath@novell.com>
3036
3037         Fix #75080, cs0119.cs.
3038         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
3039         of ...
3040         (Expression.Resolve): ... this.  Use it.  Remove bogus code
3041         allowing ExprClass.Type and ExprClass.Namespace for
3042         ResolveFlags.VariableOrValue.
3043         (Expression.Resolve) [1-argument variant]: Change default resolve
3044         flags based on language version.
3045         (Expression.Error_UnexpectedKind): Use a simple string array
3046         rather than an ArrayList.
3047         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3048         not ExprClass.Type.
3049         (TypeOfVoid.DoResolve): Likewise.
3050         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
3051         flags argument -- it always has the same value.
3052
3053 2005-05-31  Raja R Harinath  <rharinath@novell.com>
3054
3055         Fix #75081.
3056         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3057         Use it in the error message.
3058         * assign.cs, expression.cs, statement.cs: Update.
3059
3060 2005-05-30  Raja R Harinath  <rharinath@novell.com>
3061
3062         Fix #75088.
3063         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3064         the "almostMatchedMember" case too.
3065         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3066         that failed the accessibility checks to 'almost_match'.
3067
3068 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
3069
3070         * attribute.cs: Use internal MethodBuilder methods to set
3071         ExactSpelling and SetLastError on PInvoke methods, instead
3072         of passing them via charset.  Fixes #75060.
3073
3074 2005-05-27  Raja R Harinath  <rharinath@novell.com>
3075
3076         * parameter.cs (Parameter): Remove TODO comment.
3077         (Parameter.DefineParameter): Remove Location parameter.
3078         (Parameters.LabelParameters): Likewise.
3079         * class.cs (Constructor.Emit): Update to change.
3080         (MethodData.Emit): Likewise.
3081         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
3082         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3083
3084 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
3085
3086         * parameter.cs,
3087           Removed Parameters.Location and added Parameter.Location instead.
3088           Removed Location parameter from Emit() and GetSignature().
3089         * anonymous.cs,
3090           class.cs,
3091           cs-parser.jay,
3092           delegate.cs,
3093           iterators.cs,
3094           statement.cs :
3095           Modified all related calls.
3096
3097 2005-06-21  Martin Baulig  <martin@ximian.com>
3098
3099         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
3100         left-hand side is not a nullable type; fixes #75328.
3101
3102 2005-06-21  Martin Baulig  <martin@ximian.com>
3103
3104         * typemanager.cs
3105         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
3106         (TypeManager.GetFullNameSignature): Likewise.
3107
3108         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
3109         `source.FullName' and `target.FullName' to check whether there are
3110         two conflicting definitions.
3111
3112 2005-06-21  Martin Baulig  <martin@ximian.com>
3113
3114         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
3115         a BoxedCast - also for reference types - to be compatible with csc.
3116
3117 2005-06-21  Martin Baulig  <martin@ximian.com>
3118
3119         * expression.cs (MemberAccess.DoResolve): Add support for nested
3120         types in a generic instance; fixes #75320.
3121
3122 2005-06-20  Martin Baulig  <martin@ximian.com>
3123
3124         * generic.cs (TypeManager.InferType): Also walk the class
3125         hierarchy for generic instances; fixes #75261.
3126
3127 2005-06-17  Martin Baulig  <martin@ximian.com>
3128
3129         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
3130         to make things work for corlib.
3131
3132 2005-06-15  Martin Baulig  <martin@ximian.com>
3133
3134         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
3135         obsolete `SecurityAction' values.
3136
3137 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3138
3139         * rootcontext.cs: Reset TargetExt as well.
3140         
3141 2005-06-09  Martin Baulig  <martin@ximian.com>
3142
3143         * delegate.cs (Delegate.VerifyMethod): Added
3144         `MethodGroupExpr old_mg' argument; inherit its
3145         `HasTypeParameters'; fix #75085.
3146
3147 2005-06-09  Martin Baulig  <martin@ximian.com>
3148
3149         * expression.cs (Invocation.OverloadResolve): Correctly handle
3150         generic methods for the SetMemberIsUsed(); fix #75064.
3151
3152 2005-06-09  Martin Baulig  <martin@ximian.com>
3153
3154         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
3155         fixes #75062.
3156
3157 2005-06-08  Martin Baulig  <martin@ximian.com>
3158
3159         * cs-parser.jay (nullable_type_or_conditional): If we put the
3160         nullable back and our `type' is a `ComposedCast', remove the
3161         nullable from it.  Fixes #75156.
3162
3163         * expression.cs (ComposedCast.RemoveNullable): New public method.
3164
3165 2005-06-08  Martin Baulig  <martin@ximian.com>
3166
3167         The big Iterators rewrite :-)
3168
3169         * iterators.cs: Rewrite this to use the anonymous methods framework.
3170
3171         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3172         before the TypeContainers; see 2test-21.cs.
3173
3174         * class.cs
3175         (TypeContainer.DefineType): Don't create a new EmitContext if we
3176         already have one (this only happens if we're an Iterator).
3177         (TypeContainer.Define): Also call Define() on all our iterators.
3178         (Method.CreateEmitContext): Added support for iterators.
3179
3180         * anonymous.cs
3181         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3182         (AnonymousContainer.CreateMethodHost): Moved here from
3183         AnonymousMethod and made abstract.
3184         (AnonymousContainer.CreateScopeType): New abstract method.
3185         (AnonymousContainer.IsIterator): New public property.
3186         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3187         get the ScopeTypeBuilder rather than manually defining it here. 
3188         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3189         iterators here.
3190
3191         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3192         before RootContext.DefineTypes().
3193
3194         * codegen.cs (EmitContext.RemapToProxy): Removed.
3195         (EmitContext.CurrentAnonymousMethod): Changed type from
3196         AnonymousMethod -> AnonymousContainer.
3197         (EmitContext.ResolveTopBlock): Protect from being called twice.
3198         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3199         (EmitContext.EmitThis): Removed the iterators hacks; use the
3200         anonymous methods framework for that.
3201
3202         * statement.cs
3203         (ToplevelBlock.Container): Make this a property, not a field.
3204         (ToplevelBlock.ReParent): New public method; move the
3205         ToplevelBlock into a new container.
3206         (Foreach.TemporaryVariable): Simplify.
3207
3208 2005-06-05  Martin Baulig  <martin@ximian.com>
3209
3210         * statement.cs (LocalInfo.CompilerGenerated): New flag.
3211         (Block.AddTemporaryVariable): New public method; creates a new
3212         `LocalInfo' for a temporary variable.
3213         (Block.EmitMeta): Create the LocalBuilders for all the temporary
3214         variables here.
3215         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3216         non-iterator variables.
3217
3218 2005-06-05  Martin Baulig  <martin@ximian.com>
3219
3220         * statement.cs (Foreach.TemporaryVariable): Create the
3221         LocalBuilder in the Emit phase and not in Resolve since in some
3222         situations, we don't have an ILGenerator during Resolve; see
3223         2test-19.cs for an example.
3224
3225 2005-06-04  Martin Baulig  <martin@ximian.com>
3226
3227         The big Foreach rewrite - Part II.
3228
3229         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3230         with `PropertyInfo ienumerator_getcurrent'.
3231
3232         * codegen.cs (VariableStorage): Removed.
3233
3234         * statement.cs
3235         (Foreach): Derive from Statement, not ExceptionStatement.
3236         (Foreach.CollectionForeach): New nested class.  Moved all the code
3237         dealing with collection foreach here.
3238         (Foreach.ForeachHelperMethods): Removed.
3239         (Foreach.TemporaryVariable): Implement IMemoryLocation.
3240
3241 2005-05-23  Martin Baulig  <martin@ximian.com>
3242
3243         * statement.cs (Try.DoResolve): Don't create a `finally' if we
3244         don't need to.  Fix #75014.
3245
3246 2005-05-26  Raja R Harinath  <rharinath@novell.com>
3247
3248         Improve user-defined conversion handling.
3249         * convert.cs (GetConversionOperators): Rewrite.  Return only the
3250         applicable operators.
3251         (AddConversionOperators): New.  Helper for GetConversionOperators.
3252         (FindMostEncompassedType, FindMostEncompassingType): Verify that
3253         there is only one most encompassed/encompassing type.
3254         (FindMostSpecificSource, FindMostSpecificTarget): Remove
3255         "applicable operator" handling.
3256         (UserConversion): Move cache here from GetConversionOperators.
3257         Directly cache the chosen operator, rather than the whole
3258         MethodGroup.
3259         (ExplicitNumericConversion): Fix buggy implementation of Decimal
3260         case.  Allow conversion of decimal to sbyte and byte too.
3261         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3262         New static methods.  Used to avoid allocating EmptyExpressions in
3263         convert.cs.
3264
3265 2005-05-24  Duncan Mak  <duncan@novell.com>
3266
3267         * ecore.cs (CastFromDecimal): New class for casting a decimal to
3268         another class, used in Convert.ExplicitNumericConversion.
3269         (CastToDecimal): New class, similar to above, but casts to
3270         System.Decimal, used in Convert.ImplicitNumericConversion and also
3271         in explicit convesion from double/float to decimal.
3272
3273         * convert.cs (ImplicitNumericConversion): Handle implicit
3274         conversions to System.Decimal.
3275         (ExplicitNumericConversion): handle explicit conversions to
3276         System.Decimal.
3277
3278         This fixes #68711.
3279         
3280 2005-05-20  Miguel de Icaza  <miguel@novell.com>
3281
3282         * typemanager.cs: Do not throw an exception in the TypeBuilder
3283         case, we take care of it on the TypeCode.
3284
3285 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
3286         
3287         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
3288         is back.
3289         
3290         * cs-parser.jay: Catch more lexical errors.
3291         
3292         * report.cs: Add one more Error method.
3293         
3294         * rootcontext.cs,
3295         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
3296
3297 2005-05-20  Martin Baulig  <martin@ximian.com>
3298
3299         * class.cs (TypeContainer.CircularDepException): Removed.
3300         (TypeContainer.DefineType): Removed the `InTransit' stuff.
3301         (TypeContainer.CheckRecursiveDefinition): Check for circular class
3302         (CS0146) and interface (CS0529) dependencies here.
3303
3304 2005-05-20  Martin Baulig  <martin@ximian.com>
3305
3306         * expression.cs (New.DoResolve): Move the CS0712 check above the
3307         CS0144 check; otherwise it can never be reached.
3308
3309 2005-05-20  Martin Baulig  <martin@ximian.com>
3310
3311         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
3312
3313 2005-05-20  Martin Baulig  <martin@ximian.com>
3314
3315         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
3316
3317         * typemanager.cs (TypeManager.IsAttributeType): New public method.
3318
3319 2005-05-19  Martin Baulig  <martin@ximian.com>
3320
3321         * delegate.cs
3322         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
3323         to disable error reporting.
3324
3325         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
3326         here since we don't want to report an error; see the new test-336.cs.
3327
3328 2005-05-19  Raja R Harinath  <rharinath@novell.com>
3329
3330         * statement.cs (ToplevelBlock.GetParameterReference)
3331         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
3332         Move here from class Block.
3333         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
3334         * expression.cs (ParameterReference.DoResolveBase): Likewise.
3335
3336 2005-05-18  Martin Baulig  <martin@ximian.com>
3337
3338         Fix #74978.
3339
3340         * flowanalysis.cs
3341         (FlowBranching.Reachability): Add non-static public And() and Or()
3342         methods.
3343         (FlowBranchingSwitch): New class; do the `break_origins' thing
3344         like in FlowBranchingLoop.
3345         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
3346         reachability, not just locals and parameters.
3347         (FlowBranching.MergeChild): Remove some of the hacks for loop and
3348         switch; MergeBreakOrigins() now takes care of that.
3349
3350 2005-05-18  Martin Baulig  <martin@ximian.com>
3351
3352         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3353         a loop and may leave it, reset the barrier; fixes #74974.
3354
3355 2005-05-16  Raja R Harinath  <rharinath@novell.com>
3356
3357         Fix test-382.cs.  Emit values of decimal constants.
3358         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3359         Carved out of ...
3360         (TypeContainer.AddField): ... this.
3361         (TypeContainer.EmitFieldInitializers): Allow the list of fields
3362         with initializers to include 'Const's.
3363         (ClassPart.RegisterFieldForInitialization): Forward to
3364         PartialContainer.
3365         * const.cs (Const.Const): Pass initializer to base class.
3366         (Const.Define): In case of decimal constants, register them for
3367         initialization in a static constructor.
3368
3369 2005-05-14  Martin Baulig  <martin@ximian.com>
3370
3371         * statement.cs (Block.Resolve): Correctly handle unreachable code;
3372         do not call ResolveUnreachable() on unreachable statements in
3373         here, see the comment in the source code.
3374
3375 2005-05-13  Raja R Harinath  <rharinath@novell.com>
3376
3377         Fix #74934.
3378         * expression.cs (BinaryResolveOperator): If one of the operands of
3379         an equality comparison is 'null' and the other is a pointer type,
3380         convert the null to a NullPointer.
3381         * convert.cs (ImplicitReferenceConversion): If the expression is a
3382         NullLiteral and the target type is a pointer type, return a
3383         NullPointer instead.
3384         (ImplicitConversionStandard): Likewise.
3385
3386 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
3387         
3388         * cs-parser.jay: Set readonly context based on special constructs.
3389         
3390         * expression.cs (LocalVariableReference.DoResolveBase): Improved
3391         readonly variable error handling.
3392         
3393         * rootcontext.cs (EmitCode): Don't verify members when error
3394         occurred.
3395         
3396         * statement.cs (LocalInfo): Add reaodnly context information.
3397         (SetReadOnlyContext, GetReadOnlyContext): New methods.
3398
3399 2005-05-17  Martin Baulig  <martin@ximian.com>
3400
3401         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3402         #70970. 
3403
3404 2005-05-13  Martin Baulig  <martin@ximian.com>
3405
3406         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
3407         handle unreachable blocks.
3408
3409 2005-05-13  Martin Baulig  <martin@ximian.com>
3410
3411         * class.cs
3412         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
3413         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
3414         #74905. 
3415
3416 2005-05-13  Martin Baulig  <martin@ximian.com>
3417
3418         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3419         instance variable, not a local.  Fix #74873.
3420         (Block.ResolveUnreachable): Set it to true here.
3421
3422 2005-05-12  Martin Baulig  <martin@ximian.com>
3423
3424         * cs-parser.jay (property_declaration): Pass the `current_class',
3425         not the `current_container' to Property's .ctor.  Fixes #74912.
3426
3427 2005-05-11  Martin Baulig  <martin@ximian.com>
3428
3429         * typemanager.cs (Closure): Copy this from MCS and merge all the
3430         GMCS-specific changes into it.
3431
3432 2005-05-12  Raja R Harinath  <harinath@gmail.com>
3433
3434         Fix #74920.
3435         * typemanager.cs (unmanaged_enclosing_types): New.
3436         (IsUnmanagedType): Avoid infloops by using
3437         'unmanaged_enclosing_types' to talk with recursive invocations.
3438
3439 2005-05-11  Duncan Mak  <duncan@novell.com>
3440
3441         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3442         continuing to process for 'arg'.
3443         (handle_preprocessing_directive): Check the argument of the #endif
3444         directive and report error CS1025 if there are any trailing
3445         characters.
3446
3447         According to the C# spec, having even whitespace after the #endif
3448         directive is illegal; however, because we call arg.TrimEnd ()
3449         beforehand, we have the same behavior as csc, allowing whitespace
3450         after the directive.
3451
3452         Fixes #74892.
3453
3454 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
3455
3456         Fix #74863.
3457         
3458         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3459         (Constructor.GetObsoleteAttribute): Implemented correctly.
3460
3461 2005-05-10  Martin Baulig  <martin@ximian.com>
3462
3463         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
3464         resolve the type; fixes #74864.
3465         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
3466         in DoResolve(); fixes #74862.
3467
3468 2005-05-10  Martin Baulig  <martin@ximian.com>
3469
3470         * support.cs (ReflectionParameters.ParameterModifier): Use
3471         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3472         and `ParameterAttributes.In'.  Fixes #74884.
3473
3474 2005-05-10  Martin Baulig  <martin@ximian.com>
3475
3476         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
3477         the cache if we're just looking for `MemberTypes.NestedType' in a
3478         generic instance.
3479
3480         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3481         constraints if we're still resolving the type tree.
3482         (Expression.MemberLookup): If we're resolving the type tree, only
3483         look for `MemberTypes.NestedType' since we're only interested in
3484         getting types.
3485
3486         * class.cs (TypeContainer.DefineType): Don't resolve the type
3487         parameters here; do this later in ResolveType() after the type
3488         tree has been resolved.
3489         (TypeContainer.ResolveType): New public method; this is called
3490         after the type tree is resolved and before the types are being
3491         populated.  We resolve the generic constraints here.
3492         (TypeContainer.DoDefineMember): Check the constraints on our base
3493         class and interfaces.
3494
3495         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
3496         set the `ResolvingTypeTree' flag on the EmitContext.
3497
3498         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
3499
3500 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
3501
3502         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3503         
3504         * expression.cs (Argument.GetParameterModifier): Turned to property.
3505         (Invocation.Error_InvalidArguments): Add more descriptive errors.
3506         
3507         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3508         its C# equivalent.
3509         
3510 2005-05-09  Raja R Harinath  <rharinath@novell.com>
3511
3512         Fix #74852.
3513         * decl.cs (MemberCache.AddMethods): Register override methods,
3514         rather than non-override methods.
3515         * typemanager.cs (RegisterOverride): New.
3516         (IsOverride): Update.
3517
3518 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3519
3520         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
3521
3522 2005-05-06  Martin Baulig  <martin@ximian.com>
3523
3524         * attribute.cs
3525         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
3526         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
3527
3528 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3529
3530         Fix #73105.
3531         
3532         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3533         recursive declaration.
3534         
3535         * statement.cs (Block.ResolveMeta): Report any error in resolving.
3536         
3537 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
3538
3539         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
3540         
3541         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
3542
3543 2005-05-05  Raja R Harinath  <rharinath@novell.com>
3544
3545         Fix #74797.
3546         * decl.cs (DeclSpace.FamilyAccessible): 
3547         Use TypeManager.IsNestedFamilyAccessible.
3548
3549         Fix reopened #64812.
3550         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
3551         internal'.
3552
3553 2005-05-04  Raja R Harinath  <rharinath@novell.com>
3554             Abin Thomas  <projectmonokochi@rediffmail.com>
3555             Anoob V E  <projectmonokochi@rediffmail.com>
3556             Harilal P R  <projectmonokochi@rediffmail.com>
3557
3558         Fix #64812.
3559         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
3560         allow access to all static members.
3561
3562 2005-05-04  Martin Baulig  <martin@ximian.com>
3563
3564         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
3565
3566 2005-05-04  Martin Baulig  <martin@ximian.com>
3567
3568         Fix #74655.
3569
3570         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
3571         section at the end; make things work if `default' is not the last
3572         section.        
3573
3574 2005-05-04  Martin Baulig  <martin@ximian.com>
3575
3576         Fix #70400.
3577
3578         * statement.cs (Switch): Replaced the `got_default' field with a
3579         `default_section' one.
3580         (Switch.CheckSwitch): Set `default_section' here.
3581         (Switch.Resolve): If we're a constant switch and the constant is
3582         not found, use the default section.
3583
3584 2005-05-03  Martin Baulig  <martin@ximian.com>
3585
3586         * expression.cs (ArrayAccess.EmitGetLength): New public method.
3587
3588         * statement.cs (Foreach.ArrayForeach): New nested class.
3589         (Foreach.TemporaryVariable): New nested class.
3590         (Foreach.EmitArrayForeach): Removed; this is now in the new
3591         ArrayForeach class.
3592
3593 2005-05-03  Raja R Harinath  <rharinath@novell.com>
3594
3595         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
3596         more conservative.
3597         (VerifyPendingMethods): Revert change below.
3598
3599         * typemanager.cs (IsOverride, RegisterNonOverride): New.
3600         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
3601         that used to trigger warning -28.  Remove warning -28.
3602         * expression.cs (Invocation.OverloadResolve): Use
3603         TypeManager.IsOverride to distinguish override methods.
3604
3605         Fix #74773.
3606         * pending.cs (VerifyPendingMethods): If a base type implements the
3607         requested interface, don't bother checking individual methods of
3608         the base type.  As a side-effect, this prevents the creation of
3609         unnecessary proxies.
3610
3611 2005-05-02  Martin Baulig  <martin@ximian.com>
3612
3613         Fix #70182.
3614
3615         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3616         Also `And' the locals if the old vector is null.
3617         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
3618         null; in this case we basically reset all the variables.        
3619
3620 2005-05-02  Martin Baulig  <martin@ximian.com>
3621
3622         Fix #74529.
3623
3624         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
3625         Added `FlowBranching branching' argument; always `and' the
3626         variables instead of `or'ing them unless we're an infinite loop.
3627
3628         * statement.cs (While.Resolve): Create a new sibling unless we're
3629         infinite.       
3630
3631 2005-05-02  Martin Baulig  <martin@ximian.com>
3632
3633         Fix #70140.
3634
3635         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
3636         arguments; use it instead of creating a new TopLevelBlock.
3637         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
3638         our ConstructorInitializer.
3639
3640         * statement.cs
3641         (TopLevelBlock.TopLevelBranching): New public property.
3642         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
3643         and create our `TopLevelBranching'.
3644
3645         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
3646         anonymous method host, use `block.TopLevelBranching' rather than
3647         creating a new branching.
3648
3649 2005-04-20  Miguel de Icaza  <miguel@novell.com>
3650
3651         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
3652         a ScopeInfo, if any of the current children is a child of the new
3653         entry, move those children there.
3654
3655 2005-04-30  Martin Baulig  <martin@ximian.com>
3656
3657         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
3658         at the beginning of a SwitchSection.  Fix #73335.
3659
3660 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
3661
3662         Fix #74378
3663         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
3664         
3665         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
3666         (FieldExpr.DoResolve): Obsolete members are ignored for field
3667         initializers.
3668         
3669 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
3670
3671         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
3672         of arrays detection.
3673
3674         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
3675         verification.
3676         (Field.VerifyClsCompliance): Volatile fields are not compliant.
3677
3678         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
3679         arrays report.
3680
3681 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
3682
3683         * cs-parser.jay: Use the prefered version of -unsafe in error
3684         message.
3685
3686 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
3687
3688         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
3689         circumstances.
3690
3691 2005-04-20  John Luke  <john.luke@gmail.com>
3692
3693         * driver.cs: fix typo in error message, --outout to --output
3694
3695 2005-04-30  Martin Baulig  <martin@ximian.com>
3696
3697         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
3698         handle the .NET 2.x security attributes.
3699
3700 2005-04-30  Martin Baulig  <martin@ximian.com>
3701
3702         * typemanager.cs
3703         (TypeManager.ExpandInterfaces): Don't add things twice.
3704
3705         * class.cs
3706         (TypeContainer.VerifyClsCompliance): Allow generic instances.
3707
3708 2005-04-29  Martin Baulig  <martin@ximian.com>
3709
3710         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
3711
3712         * anonymous.cs: Added support for anonymous generic methods.
3713
3714 2005-04-29  Martin Baulig  <martin@ximian.com>
3715
3716         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
3717         generic instances.
3718
3719 2005-04-29  Martin Baulig  <martin@ximian.com>
3720
3721         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
3722
3723         * expression.cs (New.DoResolve): Fix the CS0304 check.
3724
3725 2005-04-29  Martin Baulig  <martin@ximian.com>
3726
3727         * typemanager.cs (TypeManager.GetFullName): Updated to the new
3728         naming schema.
3729
3730         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
3731         explicit interface implementation, compare the interface types.
3732         (MethodData.Define): Use the new naming scheme from the latest
3733         .NET 2.x beta2.
3734         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
3735
3736         * decl.cs (MemberName.GetMemberName): Removed.
3737         (MemberName.MethodName, FullName): New properties.
3738
3739 2005-04-25  Raja R Harinath  <rharinath@novell.com>
3740
3741         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
3742
3743 2005-04-22  Martin Baulig  <martin@ximian.com>
3744
3745         * generic.cs (GenericMethod): Create the EmitContext in the
3746         `Define()'; in `Define(MethodBuilder)', create the type parameters
3747         before calling `Define()'.  Fixes #73933.
3748
3749 2005-04-22  Martin Baulig  <martin@ximian.com>
3750
3751         * generic.cs
3752         (Constraints.Resolve): Make things work wrt. the new type lookup system.
3753         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
3754
3755         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
3756         ConstructedType, check its constraints.
3757
3758 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
3759
3760         * codegen.cs (InRefOutArgumentResolving): New field.
3761         
3762         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
3763         fields outside contructor.
3764         
3765         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
3766         
3767 2005-04-19  Miguel de Icaza  <miguel@novell.com>
3768
3769         * anonymous.cs (CaptureContext.EmitParameterInstance): The
3770         parameter code was not completed ever, so it was not as up-to-date
3771         as local variables.  Must finish it.
3772
3773         The bug fix was to compare the Toplevel of the block, not the
3774         current block.  Thanks for Ben for pointing this out. 
3775
3776 2005-04-19  Raja R Harinath  <rharinath@novell.com>
3777
3778         * decl.cs (AddMethods): Use the declaring type of the problem
3779         method to determine if we want to squash a warning.
3780
3781 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
3782
3783         * attribute.cs: Removed debug output.
3784
3785         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
3786         
3787         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
3788         Report.Stderr.
3789         
3790 2005-04-18  Raja R Harinath  <rharinath@novell.com>
3791
3792         Fix #74481.
3793         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
3794         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
3795         all null comparisons against reference types.
3796
3797 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
3798
3799         Fix# 74565
3800         * class.cs (TypeContainer.CircularDepException) New nested
3801         exception class.
3802         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
3803         (TypeContainer.DefineType): Removed error, reset InTransit before
3804         exit.
3805         (Class.DefineType): Throw exception when is in Transit.
3806         Catch exception and report error.
3807         (Struct.DefineType): Throw exception when is in Transit.
3808         Catch exception and report error.
3809         (Interface.DefineType): Throw exception when is in Transit.
3810         Catch exception and report error.
3811
3812         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
3813         handle nested exception handlers.
3814
3815         * flowanalysis.cs (InTryWithCatch): New method, search for try with
3816         a catch.
3817
3818         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
3819         InFinally and InCatch storage.
3820
3821         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
3822         (Catch.Resolve): Set and Restore ec.InCatch.
3823         (Try.Resolve): Set and Restore ec.InFinally.
3824         (Try.HasCatch): True when try has catch.
3825
3826 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
3827
3828         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
3829           for the same event member, so exclude such cases from warning 419.
3830           Fixed bug #74633.
3831
3832 2005-04-16  Miguel de Icaza  <miguel@novell.com>
3833
3834         * expression.cs (Binary.ResolveOperator): Apply patch from John
3835         Luke to fix bug 59864: operators &, | and ^ on enumerations
3836         require that the same enum type on both sides.
3837
3838         * driver.cs: Add warnings to old flag usage, this is to assist
3839         people who produce Makefiles and hope that the Makefiles will be
3840         used on Windows.
3841
3842         * class.cs (TypeContainer.EmitType): Moved the definition of the
3843         special $PRIVATE$ field from the resolve phase to the Emit phase.
3844         During resolve we do not know if we are a struct with
3845         HasExplicitLayout, we know this only after the attributes for the
3846         type are emitted.
3847
3848         Set the FieldOffset to zero on the dummy field that we create for
3849         the class.   Fixes 74590.
3850
3851 2005-04-16  Raja R Harinath  <rharinath@novell.com>
3852
3853         Fix #73834.
3854         * ecore.cs (PropertyExpr.resolved): New.
3855         (DoResolve): Use it to handle a case of double resolution here.
3856         Handle a case of identical-name-and-type-name.
3857         * expression.cs (ArrayCreation.CheckIndices): Avoid double
3858         resolution by storing the results of expression resolution back
3859         into the "probes" array.
3860
3861 2005-04-15  Raja R Harinath  <rharinath@novell.com>
3862
3863         Fix cs0208-7.cs and cs0208-8.cs.
3864         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
3865         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
3866         error reporting to point out the reason a struct is not unmanaged.
3867
3868 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
3869
3870         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
3871           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
3872
3873 2005-04-13  Raja R Harinath  <rharinath@novell.com>
3874
3875         Fix #74528.
3876         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
3877         IdenticalNameAndTypeName here.
3878         (EventExpr.InstanceResolve): Likewise.
3879
3880 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
3881
3882         C# 2.0 DefaultCharSetAttribute implementation
3883         
3884         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
3885         which allows us to set GlobalNamespace for every resolve.
3886         (Attribute.ResolveArguments): Cut from Resolve.
3887         (Attribute.GetCharSetValue): Returns CharSet named argument.
3888         (Attribute.DefinePInvokeMethod): Gets default charset from
3889         module settings.
3890         (GlobalAttribute.ResolveAsTypeStep): Override.
3891         (GlobalAttribute.ResolveArguments): Override.
3892         
3893         * class.cs (TypeAttr): Is protected.
3894         
3895         * codegen.cs (ModuleClass.DefaultCharSet): New member.
3896         (ModuleClass.DefaultCharSetType): New memeber.
3897         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
3898         
3899         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
3900         charset from module.
3901         
3902         * delegate.cs (TypeAttr): Override.
3903         (Delegate.DefineType): Use this TypeAttr.
3904         
3905         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
3906         at very early stage (before types are defined) to resolve model
3907         module attributes. It will probably not work with corlib but it
3908         should be ok.
3909         
3910         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
3911         charset from module.
3912         
3913         * typemanager.cs (default_charset_type): New type.
3914
3915 2005-04-13  Raja R Harinath  <rharinath@novell.com>
3916
3917         * decl.cs (MemberCache.AddMethods): Don't warn if
3918         System.Object.Finalize has buggy MethodAttributes.
3919
3920         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
3921         removed below.
3922
3923 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
3924
3925         * doc.cs : detect ambiguous reference to overloaded members.
3926           Fixed bug #71603. MS 1.1 csc does not detect it.
3927
3928 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
3929
3930         * doc.cs : delegates must not be referenced with parameters.
3931           Fixed bug #71605.
3932
3933 2005-04-12  Miguel de Icaza  <miguel@novell.com>
3934
3935         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
3936
3937 2005-04-10  Miguel de Icaza  <miguel@novell.com>
3938
3939         * driver.cs (MainDriver): Stop processing if the CLS stage found
3940         errors. 
3941
3942         (CompilerCallableEntryPoint.InvokeCompiler): Always
3943         reset after execution;   Take a TextWriter argument for the
3944         output.
3945
3946         * report.cs: Use the error stream instead of hardcoding stderr. 
3947
3948 2005-04-09  Miguel de Icaza  <miguel@novell.com>
3949
3950         * class.cs: Reduce code paths to test, too small of an
3951         optimization to make it worth the extra testing.  Always perform
3952         it. 
3953
3954 2005-04-08  Raja R Harinath  <rharinath@novell.com>
3955
3956         Fix #74510.
3957         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
3958         operators that had errors reported on them.
3959
3960 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
3961
3962         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
3963         argument types.
3964         (Attribute.Resolve): Add named argument type checking.
3965         
3966         * class.cs (FixedField.Define): Use IsPrimitiveType
3967         
3968         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
3969         
3970         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
3971         unsafe parameter types.
3972         
3973         * statement.cs (Using.ResolveExpression): Add better error description.
3974         
3975         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
3976         
3977 2005-04-08  Raja R Harinath  <rharinath@novell.com>
3978
3979         Fix #74484.
3980         * attribute.cs (Attribute.GetAttributeUsage): Resolve
3981         AttributeUsageAttribute in the emitcontext of the attribute class,
3982         not in the emitcontext of the attributable entity it was attached to.
3983         * cs-parser.jay: Use 'current_class', not 'current_container',
3984         when creating a GlobalAttribute.
3985
3986 2005-04-08  Alp Toker  <alp@atoker.com>
3987
3988         * pending.cs: The fix to #58413 failed to compile methods implementing
3989         interfaces with/without params modifiers and vice versa, even though
3990         params modifiers aren't part of the signature. Make the modifier check
3991         less strict as in csc.
3992
3993 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
3994             Anoob V E  <projectmonokochi@rediffmail.com>
3995             Harilal P R  <projectmonokochi@rediffmail.com>
3996
3997         Fix #58413.
3998         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
3999         modifiers of pending methods.
4000         (PendingImplementation.PendingImplementation): Initialize it.
4001         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4002         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4003         with ParameterData.  Add check for modifiers.
4004         * class.cs (MethodData.Define): Update to changes.
4005
4006 2005-04-07  Raja R Harinath  <rharinath@novell.com>
4007
4008         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4009
4010 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
4011
4012         * class.cs (PropertyMethod.Define): Check private accessor in abstract
4013         property.
4014         
4015         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4016         
4017         * rootcontext.cs,
4018         * typemanager.cs: Registered RequiredAttributeAttribute.
4019         
4020 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
4021
4022         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4023         Warning CS0169 is back at level 3.
4024         (IMethodData.SetMemberIsUsed): New method.
4025         
4026         * decl.cs (IsUsed): New value; moved from FieldBase.Status
4027         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4028         
4029         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4030
4031         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4032         contants.
4033         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4034         is used.
4035         
4036         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4037         is used.
4038         
4039         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4040         to avoid the problems with nested types.
4041
4042 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
4043             Anoob V.E  <projectmonokochi@rediffmail.com>
4044             Harilal P.R  <projectmonokochi@rediffmail.com>
4045             Raja R Harinath  <rharinath@novell.com>
4046
4047         Fix #73820.
4048         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4049         attribute.
4050         * typemanager (GetConstructor): Make public.
4051
4052 2005-04-05  John Luke  <john.luke@gmail.com>
4053             Raja R Harinath  <rharinath@novell.com>
4054
4055         Fix #62232.
4056         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4057         struct too.  Return false quicker in a few cases.
4058         (VerifyUnManaged): Use it.
4059
4060 2005-04-05  Raja R Harinath  <rharinath@novell.com>
4061
4062         Fix #74041.
4063         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4064         not 'unreachable_seen'.
4065
4066 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
4067
4068         * attribute.cs (Attribute.GetValue): Removed unused.
4069         
4070         * codegen.cs (CodeGen.TrimExt): Removed unused.
4071         
4072         * cs-parser.jay (output): Removed unused.
4073         
4074         * cs-tokenizer.cs (hex_digits): Removed unused.
4075         
4076         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4077         
4078         * expression.cs (Indirection.LoadExprValue): Removed unused.
4079         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4080         
4081         * iterators.cs (Iterator.param_types): Removed unused.
4082         
4083         * statement.cs (Goto.block): Removed unused.
4084         (ToplevelBlock.did): Removed unused.
4085         (Switch.ResolveConstantSwitch): Removed unused.
4086
4087 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
4088
4089         * rootcontext.cs: Allow mcs to bootstrap with the compilation
4090         resetting thingy.
4091
4092 2005-04-19  Martin Baulig  <martin@ximian.com>
4093
4094         Merged r42462 from MCS and made it work for GMCS.
4095
4096         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
4097
4098         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
4099
4100 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4101
4102         Fix #74232 and cs0208-3.cs.
4103         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4104         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4105         unmanaged type.  Don't use FieldBuilders when 't' is a
4106         TypeBuilder.  Use ModFlags and MemberType fields.
4107         * class.cs (MemberBase.member_type): Rename from MemberType.
4108         (MemberBase.MemberType): New property.  Determines member_type on
4109         demand.
4110         (MemberBase.DoDefine): Don't initialize MemberType here.
4111         (FieldMember.Define): Likewise.
4112
4113 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
4114
4115         Fix #74241
4116         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4117         Attributes are emitted there.
4118         
4119 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4120
4121         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4122         keyword in 'partial enum' too.
4123         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4124         is not allowed).
4125         Report from Kamil Skalski <nazgul@omega.pl>.
4126
4127         Fix #74309.
4128         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4129         have partial containers too.
4130
4131         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4132         in block' checks to Block.CheckInvariantMeaningInBlock.
4133         * statement.cs (Block.GetKnownVariableInfo): Make private.
4134         (Block.IsVariableUsedInChildBlock): Remove.
4135         (Block.IsVariableUsedInBlock): Likewise.
4136         (Block.CheckInvariantMeaningInBlock): New.  Show location of
4137         conflicting declaration.
4138         (Block.AddVariable): Make error messages less long-winded and more
4139         specific.  Show location of conflicting declaration.
4140         * parameter.cs (Parameters.Location): New readonly property.
4141
4142 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4143
4144         Clean up semantics of invoking ResolveMemberAccess.
4145         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4146         can have an instance, ensure that we pass in a non-TypeExpression
4147         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
4148         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4149         argument.  Update to changes and simplify.
4150         (FieldExpr.Emitinstance): Remove CS0120 check.
4151         (PropertyExpr.EmitInstance): Likewise.
4152         * expression.cs (Argument.Resolve): Likewise.
4153         (Invocation.DoResolve): Update to changes in semantics of
4154         InstanceExpression.
4155
4156 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
4157
4158         Fix #74241
4159         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4160         customization.
4161         
4162         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4163
4164 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4165
4166         Fix difference in behaviour with commandline invocation.
4167         * driver.cs (Driver.Reset): New.
4168         (CompilerCallableEntryPoint): Call it.
4169
4170         * statement.cs (If.Resolve): Avoid spurious "uninitialized
4171         variable" warnings if the boolean expression failed to resolve.
4172
4173 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
4174
4175         * attribute.cs: Fix the union of several permissions when some of them
4176         are unrestricted (so the result isn't an unrestricted permission set).
4177         Fix #74036.
4178
4179 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4180
4181         * ecore.cs (MemberExpr): New class.  Convert from interface
4182         IMemberExpr.
4183         (MemberExpr.ResolveMemberAccess): Refactor and move here from
4184         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
4185         error checks.
4186         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4187         (MethodGroupExpr.IsExplicitImpl): Remove.
4188         (Expression.GetFieldFromEvent): Remove.
4189         (SimpleName.MemberStaticCheck): Remove.
4190         (SimpleName.DoSimpleNameResolve): Update to changes.
4191         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4192         (MemberAccess.IdenticalNameAndTypeName): Remove.
4193         (MemberAccess.error176): Move to MemberExpr.
4194         (MemberAccess.DoResolve): Update to changes.
4195         (BaseAccess.DoResolve): Likewise.
4196
4197 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
4198
4199         C# 2.0 Conditional attribute class implementation
4200         
4201         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4202         Analyzes class whether it has attribute which has ConditionalAttribute
4203         and its condition is not defined.
4204         
4205         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4206         (Class.IsExcluded): New method. Search for at least one defined
4207         condition in ConditionalAttribute of attribute class.
4208
4209 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4210
4211         * ecore.cs (PropertyExpr): Derive from Expression, not
4212         ExpressionStatement.
4213         (PropertyExpr.EmitStatement): Remove.
4214
4215 2005-03-29  Raja R Harinath  <rharinath@novell.com>
4216
4217         Fix #74060.
4218         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4219         internal field "value__" of an enum be private.  The examples for
4220         "value__" that I found on MSDN all used FieldAttributes.Private.
4221
4222         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4223         Don't mention IL method attribute names.
4224
4225         Fix #47991.  Remove a TODO.
4226         * statement.cs (Block.Toplevel): Make into a field.
4227         (Block.Parameters): Move into ToplevelBlock.
4228         (Block.known_variables): Rename from child_variable_names.
4229         (Block.Block): Remove variants that take Parameters.  Initialize
4230         'Toplevel' with the immediately surrounding toplevel block.
4231         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
4232         LocalInfo parameter.
4233         (Block.GetKnownVariableInfo): New.
4234         (Block.IsVariableNameUsedInChildBlock): Update.
4235         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
4236         the block, even though it may not be in scope.
4237         (Block.AddVariable): Remove Parameters parameter.  Use
4238         Toplevel.Parameters instead.
4239         (Block.AddConstant): Remove Parameters parameter.
4240         (Block.GetParameterReference): Update to use Toplevel.Parameters.
4241         (Block.IsParamaterReference): Likewise.
4242         (Block.IsLocalParameter): Likewise.  Simplify a lot.
4243         (ToplevelBlock.Parameters): New.  Moved from Block.
4244         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
4245         initialize Parameters to a non-null value.
4246         * cs-parser.jay: Update to changes.
4247         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4248         simple names that mean different things in the same block.  Use
4249         Block.IsVariableNameUsedInBlock.
4250
4251 2005-03-28  Raja R Harinath  <rharinath@novell.com>
4252
4253         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4254
4255 2005-03-26  Raja R Harinath  <harinath@acm.org>
4256
4257         Fix #73038.
4258         * assign.cs (Assign.DoResolve): When the RHS of an assignment
4259         fails to resolve, ensure that the LHS is still resolved as an
4260         lvalue.
4261
4262 2005-03-25  Raja R Harinath  <harinath@acm.org>
4263
4264         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4265         ec.ContainerType.
4266         (Enum.current_ec): Remove.
4267         (Enum.LookupEnumValue): Remove EmitContext argument.
4268         Just uses the one created during DefineType.
4269         (Enum.FindMembers): Update.
4270         * expression.cs (MemberAccess.DoResolve): Update.
4271
4272 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
4273
4274         * assign.cs (Assign.DoResolve): Check for CS1717 when
4275         source and target are same (uses Equals).
4276
4277         * expression.cs (LocalVariableReference, ParameterReference,
4278         This): Implemented Equals, GetHashCode.
4279
4280         * statement.cs (Block.GetParameterReference): Removed useless
4281         local variable.
4282
4283 2005-03-22  Raja R Harinath  <rharinath@novell.com>
4284
4285         Fix cs0128.cs
4286         * statement.cs (Block.AddVariable): Ensure that we skip implicit
4287         blocks before deciding whether the error is cs0136 or cs0128.
4288
4289         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4290         (using_alias_directive, using_namespace_directive): Pass
4291         MemberName, not an expression to Namespace.UsingAlias and
4292         Namespace.Using.
4293         (MakeName): Use the MemberName of the namespace.
4294         * namespace.cs (Namespace.MemberName): New.
4295         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4296         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4297         Likewise.
4298         * decl.cs (MemberName.Name): Make readonly.
4299         (MemberName.FromDotted): New "constructor".
4300         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4301         (MemberCore.Name): Compute from MemberName on demand.
4302         (MemberCore.SetMemberName): Provide a way to change the
4303         MemberName.
4304         (MemberCore.AddToContainer): Don't take a fullname parameter.
4305         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4306         fully qualified name of the container to the member name.
4307         (TypeContainer.AddToTypeContainer): Use a fully qualified name
4308         only if the type is a member of the root container.
4309         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4310         MemberName.Left rather than searching for an embedded ".".
4311         (PartialContainer.CreatePart): Update to changes in RootContext.
4312         (MemberBase.ShortName): Turn into a property.  Use
4313         MemberCore.SetMemberName.
4314         (MemberBase.ExplicitInterfaceName): Remove.
4315         (MemberBase.UpdateMemberName): Remove.
4316         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4317         (PropertyBase.SetMemberName): New override.
4318         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4319         (Tree.GetDecl): New.
4320         (Tree.AllDecls): Rename from Decls.
4321         * attribute.cs, enum.cs, report.cs: Update to changes.
4322         * driver.cs (MainDriver): Use MemberName.FromDotted on
4323         RootContext.MainClass.
4324
4325 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
4326
4327         * class.cs (FixedField.Define): Check for CS1664 and more sanity
4328         checks.
4329
4330         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4331
4332 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
4333
4334         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4335         property accessor modifiers.
4336
4337         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4338         fixed buffer attribute (CS1716).
4339         (PropertyMethod.HasCustomAccessModifier): When property accessor
4340         has custom modifier.
4341
4342         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4343         modifiers.
4344         (PropertyExpr.DoResolveLValue): Add CS0272.
4345
4346 2005-03-17  Miguel de Icaza  <miguel@novell.com>
4347
4348         * convert.cs: When converting to a pointer, use the proper Conv.U
4349         or Conv.I depending on the source data type.
4350
4351         * cs-tokenizer.cs: Make the size for large decimal constants,
4352         fixes #72957.
4353
4354 2005-03-17  Martin Baulig  <martin@ximian.com>
4355
4356         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4357         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
4358
4359 2005-03-17  Martin Baulig  <martin@ximian.com>
4360
4361         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4362         to bool so we can return an error condition.
4363         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4364         returned an error.
4365
4366 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
4367
4368         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4369         attributes.
4370
4371 2005-03-16  Raja R Harinath  <rharinath@novell.com>
4372
4373         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4374         Refactor to avoid traversing the list of assemblies, and to avoid
4375         string concatenation.
4376         * typemanager.cs (guid_attr_type): Remove.
4377         (negative_hits, pointers, references): Remove hashes.
4378         (type_hash): New.
4379         (GetConstructedType): New.  Uses type_hash to handle constructed
4380         types (arrays, references, pointers).
4381         (GetReferenceType, GetPointerType): Use it.
4382         (GetNestedType): New.  Uses type_hash to handle nested types of
4383         reflected types.
4384         (LookupType, LookupTypeDirect): Remove.
4385         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
4386         'types' hash and LookupTypeReflection directly.
4387         (params_string, params_object): Use GetConstructedType.
4388         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
4389         top-level types.
4390         (Namespace.Lookup): Use cached_types.
4391         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4392         provided by old TypeManager.LookupType.
4393         * rootcontext.cs (MakeFQN): Remove.
4394         * decl.cs (DeclSpace.MakeFQN): Likewise.
4395         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4396         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4397         TypeManager.GetConstructedType.
4398         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4399
4400 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
4401
4402         * cs-parser.jay: Fix build.
4403
4404 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
4405
4406         * class.cs (TypeContainer.CircularDepException) New nested
4407         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
4408
4409         * cs-parser.jay: Reports CS1527 for any namespace element.
4410
4411         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4412         Added CS0407.
4413
4414         * expression.cs (ParameterReference.IsAssigned): Changed error to
4415         CS0269.
4416         (Error_WrongNumArguments): Moved CS0245 detection here.
4417
4418         * statement.cs (Return.Resolve): Add CS1622 report.
4419
4420 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
4421
4422         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4423
4424 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
4425
4426         * attribute.cs expression.cs: Get rid of some allocations.
4427
4428 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
4429
4430         * doc.cs : just eliminate the latest change.
4431
4432 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4433
4434         * doc.cs : commented out the latest change. It breaks xml-030.cs
4435
4436 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4437
4438         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4439           fail. So invoke CreateType() in FindDocumentedType().
4440
4441 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4442
4443         * cs-tokenizer.cs : added IsKeyword().
4444         * doc.cs : Detect keyword incorrectly used as identifier.
4445           Allow identifiers prefixed by @.
4446
4447 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
4448
4449         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4450         It caused exception in namespace resolving (again!).
4451         
4452         * class.cs (Class.ctor): Removed exit.
4453         (PropertyMethod.ctor): ditto.
4454         
4455         * codegen.cs (Codegen.Reset): Reset static data.
4456         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4457         
4458         * cs-tokenizer.cs (Cleanup): Removed.
4459         
4460         * driver.cs (GetSystemDir): Rewrote to one line command.
4461         It caused problem with unloaded dynamic modules.
4462         (UnixParseOption): Removed Exit.
4463         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4464         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4465         Now can be mcs used as library.
4466         
4467         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4468         empty location.
4469         
4470         * location.cs (Reset): Reset static data.
4471         
4472         * namespace.cs (Reset): Reset static data.
4473         
4474         * report.cs (Report.Reset): Reset static data.
4475         
4476         * rootcontext.cs (RootContext.Reset): Reset static data.
4477         
4478         * tree.cs (RootTypes.ctor): Use Location.Null
4479         
4480         * typemanager.cs (TypeManager.Reset): Reset static data.
4481         (CoreLookupType): Removed Exit.
4482         (TypeHandle.Reset): Reset static data.
4483         
4484 2005-03-10  Raja R Harinath  <rharinath@novell.com>
4485
4486         Fix #73516.
4487         * typemanager.cs (ComputeNamespaces): Import namespaces from
4488         referenced modules too.
4489
4490 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4491
4492         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4493         than '.'.
4494
4495 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4496
4497         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4498         enclosing DeclSpace.  This ensures that a name-lookup populates
4499         more caches and there are fewer 'TypeExpression's.  Carve out
4500         nested type lookup into ...
4501         (LookupNestedTypeInHierarchy): ... this.
4502
4503 2005-04-15  Martin Baulig  <martin@ximian.com>
4504
4505         Merged r41590 from MCS and make it work in the generics land.
4506
4507         * generic.cs (TypeParameter.UpdateConstraints): Removed the
4508         `check' argument.
4509
4510         * class.cs (PartialContainer.UpdateConstraints): Removed.
4511         (PartialContainer.CheckConstraints): Removed.
4512         (PartialContainer.SetParameterInfo): Store the constraints here.
4513         (PartialContainer.DefineTypeParameters): New public method;
4514         resolve the type parameter's constraints here.  Note that the
4515         PartialContainer doesn't have an EmitContext anymore, so we must
4516         do this in the ClassPart.
4517
4518 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4519
4520         Clean up a few partial-class semantics.  
4521         Fixes test-357.cs and cs1618-2.cs.
4522         * cs-parser.jay (struct_declaration): Use 'current_class' as
4523         parent of newly-created struct.  Remove call to Register ().
4524         Use 'pop_current_class' to complete handing the current struct.
4525         (interface_declaration): Likewise.
4526         (class_declaration): Likewise.
4527         (enum_declaration): Use 'current_class' as parent of newly created
4528         enum.
4529         (delegate_declaration): Likewise.
4530         (pop_current_class): New function.  This is used to handle closing
4531         up the 'current_class' and 'current_container', and pointing them
4532         to the enclosing class/container.
4533         (CSharpParser): Initialize 'current_class' too.
4534         * decl.cs (MemberCore): Add check for invariant: a partial
4535         container is not a parsed entity, and thus does not enclose any
4536         parsed members.
4537         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4538         (DeclSpace.BaseTypeExpr): Use it.
4539         (DeclSpace.LookupType): Add check for invariant.
4540         * class.cs (TypeContainer): Add check for invariant: a nested
4541         class should have the same NamespaceEntry as its enclosing class.
4542         (TypeContainer.EmitFieldInitializers): Make virtual.
4543         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4544         MemberCore.
4545         (TypeContainer.Register): Remove.
4546         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4547         null.  Use TypeResolveEmitContext for resolving base types and
4548         interfaces.  Move initialization of Parts.TypeBuilder here from
4549         ...
4550         (TypeContainer.DefineNestedTypes): ... here.
4551         (PartialContainer): Take a Namespace not a NamespaceEntry.
4552         (PartialContainer.Create): Don't use Register.  Call the
4553         appropriate Add... function directly.
4554         (ClassPart): Take both the PartialContainer and the enclosing
4555         class as constructor arguments.
4556         (ClassPart.EmitFieldInitializers): Override.
4557         (ClassPart.PartFindNestedTypes): Remove.
4558         (FieldBase.GetInitializerExpression): Resolve the initializer
4559         expression in the emit context of the enclosing class.
4560         * tree.cs (RootTypes): Remove Register ().
4561         
4562 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
4563
4564         * cs-parser.jay: Removed CS0134.
4565         
4566         * driver.cs: Removed CS1901.
4567         
4568         * expression.cs (SizeOf.DoResolve): Don't report CS0233
4569         for predefined types.
4570
4571 2005-03-07  Duncan Mak  <duncan@novell.com>
4572
4573         * codegen.cs (Save):  Catch UnauthorizedAccessException as
4574         well. Fixes bug #73454.
4575
4576 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
4577
4578         * cs-tokenizer.cs (xtoken): Add CS1035.
4579         
4580         * class.cs (MethodData.Define): Add CS0683.
4581         (FieldMember.ctor): Add CS0681.
4582
4583 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4584
4585         * ecore.cs (SimpleName.DoResolve): Rename from
4586         SimpleName.DoResolveAllowStatic.
4587         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4588         Pass 'intermediate' flag to MemberStaticCheck.
4589         (SimpleName.MemberStaticCheck): Skip "static check" only in case
4590         of "intermediate" lookups via MemberAccess.
4591         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
4592         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4593
4594 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4595
4596         Fix #73394.
4597         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4598         slipped in because of variable names that are identical to a
4599         builtin type's BCL equivalent ('string String;', 'int Int32;').
4600         (PropertyExpr.EmitInstance): Likewise.
4601
4602 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
4603
4604         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4605         
4606         * report.cs (warning_ignore_table): Made public.
4607
4608 2005-03-04  Raja R Harinath  <rharinath@novell.com>
4609
4610         Fix #73282.
4611         * class.cs (MethodData.Emit): Pass 'container' to
4612         container.GetObsoleteAttribute instead of 'container.Parent'.
4613
4614 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
4615
4616         * cs-parser.jay: Add 1534 error test.
4617
4618         * iterators.cs (Yield.CheckContext): Add error 1629.
4619         (Iterator.ctor): Save unsafe modifier.
4620         (MoveNextMethod.DoEmit): Restore unsafe context.
4621
4622         * namespace.cs (UsingAlias): Better error message.
4623
4624 2005-03-03  Dan Winship  <danw@novell.com>
4625
4626         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
4627         the warning message [#73219]
4628
4629 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4630
4631         Fix compile with MCS 1.0.0.0.
4632         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
4633         w_restore to not depend on string constant folding.
4634
4635 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4636
4637         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
4638         CS0246 check to users who passed 'silent = false'.
4639         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
4640         check.
4641         (SimpleName.SimpleNameResolve): Update.
4642         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
4643         (MemberAccess.IdenticalNameAndTypeName): Update.
4644         * doc.cs (FindDocumentedTypeNonArray): Update.
4645
4646 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
4647
4648         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
4649         * parameters.cs (ComputeAndDefineParameters): Remove.
4650         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
4651         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
4652         Use GetParameterInfo.
4653
4654 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
4655
4656         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
4657
4658 2005-03-02  Raja R Harinath  <rharinath@novell.com>
4659
4660         Unify DeclSpace.LookupType and DeclSpace.FindType.
4661         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
4662         is in charge of defining nested types on demand.
4663         (DeclSpace.LookupType): Use it when the current_type is a
4664         TypeBuilder.  Use LookupTypeDirect for reflected types.
4665         (DeclSpace.FindType): Remove.
4666         (DeclSpace.LookupInterfaceOrClass): Likewise.
4667         (DeclSpace.DefineTypeAndParents): Likewise.
4668         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
4669         DeclSpace.LookupType.
4670         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
4671         * typemanager.cs (LookupType): Simplify.
4672         (AddUserType): Remove type from negative_hits.
4673         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
4674         * class.cs (TypeContainer.FindMembers): Move handling of nested
4675         types ...
4676         (TypeContainer.FindMembers_NestedTypes): ... here.
4677         (TypeContainer.FindNestedType): Implement override.
4678         (ClassPart.FindNestedType): Delegate to PartialContainer.
4679         (ClassPart.PartFindNestedType): Looks up the nested types of the
4680         part alone.
4681
4682 2005-04-14  Martin Baulig  <martin@ximian.com>
4683
4684         * generic.cs (ConstructedType): Moved all the type lookup and
4685         nested class logic into SimpleName.
4686         (ConstructedType.ResolveConstructedType): Our underlying type is
4687         already fully resolved; all the type lookup stuff is in
4688         SimpleName.
4689
4690         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
4691         constructed types here instead of in ConstructedType.
4692
4693         * decl.cs (MemberName.GetTypeExpression): Always create a
4694         SimpleName, not a ConstructedType.
4695         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
4696
4697 2005-03-02  Martin Baulig  <martin@ximian.com>
4698
4699         * class.cs (TypeContainer.DoDefineMembers): We also need a default
4700         static constructor in static classes.
4701
4702 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
4703
4704         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
4705         sizeParamIndex is not specified.
4706
4707 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
4708
4709         Fix #73117
4710         * report.cs (WarningMessage.IsEnabled): Missing null check.
4711
4712 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4713
4714         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
4715         in the fields and not in the properties.
4716
4717 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
4718
4719         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
4720         fields as well.
4721
4722 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4723
4724         * attribute.cs: Small refactoring (improved robustness).
4725         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
4726         (ValidateGuid): Removed.
4727         (Resolve): Removed referenced to above mentioned.
4728         (GetAttributeUsage): Made private and changed to work without
4729         class assistance.
4730         (GetIndexerAttributeValue): Don't crash.
4731         (GetConditionalAttributeValue): Ditto.
4732         (GetClsCompliantAttributeValue): Ditto.
4733         (ExtractSecurityPermissionSet): All attributes exceptions are
4734         error 648.
4735         (GetPropertyValue): New helper.
4736         (GetMethodImplOptions): New method.
4737         (DefinePInvokeMethod): Reuse common code. Implemented handling of
4738         some missing properties.
4739         
4740         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
4741         (Method.ApplyAttributeBuilder): Updated.
4742         
4743         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
4744         exception.
4745
4746 2005-02-28  Raja R Harinath  <rharinath@novell.com>
4747
4748         Fix #73052.
4749         * report.cs (Report.SymbolRelatedToPreviousError): Handle
4750         non-simple types (array, pointer, reference).
4751
4752 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4753
4754         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
4755
4756         * class.cs (MethodCore.IsDuplicateImplementation): Special error
4757         for operators.
4758         (Method.CheckBase): Catch wrong destructor here.
4759         (MethodData.Define): Add errors 550, 668.
4760
4761         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
4762
4763         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
4764
4765         * pending.cs (VerifyPendingMethods): Add error 551.
4766
4767         * typemanager.cs (CSharpName): Next error report helper.
4768
4769 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
4770
4771         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
4772         attributes. Removed useless attribute double check.
4773         It saves almost 2MBs for corlib.
4774
4775 2005-02-25  Raja R Harinath  <rharinath@novell.com>
4776
4777         Fix #72924.
4778         * statement.cs (ExpressionStatement.Resolve): Make robust to being
4779         called twice in case of error.
4780
4781 2005-02-23  Chris Toshok  <toshok@ximian.com>
4782
4783         Fix compiler portions of #72827.
4784         * statement.cs (Block.Emit): call Begin/EndScope on the
4785         EmitContext instead of the ILGenerator.
4786
4787         * codegen.cs (EmitContext.BeginScope): new method, call
4788         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
4789         we have one.)
4790         (EmitContext.BeginScope): same, but EndScope and CloseScope
4791
4792         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
4793         offset and call the superclass's OpenScope(int) with it.
4794         (SymbolWriter.CloseScope): get the current il
4795         offset and call superclass's CloseScope(int) with it.
4796
4797 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
4798
4799         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
4800         CS1677 for out and ref as well.
4801
4802         * class.cs (Method.Define): Add error CS1599 detection.
4803         
4804         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
4805         
4806         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
4807         
4808         * delegate.cs (Delegate.Define): Add error CS1599 detection.
4809         
4810         * support.cs.cs (ModifierDesc): New helper method.
4811
4812 2005-02-23  Raja R Harinath  <rharinath@novell.com>
4813             Abin Thomas  <projectmonokochi@rediffmail.com>
4814             Anoob V E  <projectmonokochi@rediffmail.com>
4815             Harilal P R  <projectmonokochi@rediffmail.com>
4816
4817         Fix #57851, #72718.
4818         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
4819         MemberLookup (used for error reporting) actually returns a result.
4820         Fix error report number (122, not 112).
4821
4822 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
4823             Anoob V E  <projectmonokochi@rediffmail.com>
4824             Harilal P R  <projectmonokochi@rediffmail.com>
4825
4826         Fix #71134.
4827         * pending.cs (PendingImplementation.GetAbstractMethods):
4828         Find NonPublic members too.
4829
4830 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
4831
4832         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
4833         Fixed error 217.
4834         
4835         * class.cs (MethodCore.CheckMethodAgainstBase):
4836         Add error 239 report.
4837
4838 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
4839
4840         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
4841         
4842         * class.cs (Operator.Define): Add error 217 report.
4843         
4844 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4845
4846         Fix #68955.
4847         * expression.cs (Invocation.IsApplicable): Make public.
4848         (Invocation.IsParamsMethodApplicable): Likewise.
4849         * delegate.cs (Delegate.VerifyApplicability): Don't use
4850         Invocation.VerifyArgumentCompat for parameter applicability
4851         testing.  Use Invocation.IsApplicable and
4852         Invocation.IsParamsMethodApplicable.
4853
4854 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
4855
4856         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
4857         
4858         * class.cs (Operator.Define): Add error 217 report.
4859         
4860 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4861
4862         * namespace.cs (UsingEntry.Resolve): Undo change below.
4863
4864 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4865
4866         Fix #72756.
4867         * ecore.cs (Expression.MemberLookupFailed): Add argument to
4868         disable the error message when the extended MemberLookup also
4869         fails.
4870         (Expression.MemberLookupFinal): Update.
4871         (SimpleName.DoSimpleNameResolve): Update.
4872         * expression.cs (MemberAccess.ResolveNamespaceOrType):
4873         Don't use MemberLookupFinal.
4874         (New.DoResolve): Update.
4875         (BaseAccess.CommonResolve): Update.
4876
4877 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4878
4879         Fix #72732.
4880         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
4881         occured previously, don't resolve again.
4882
4883 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
4884
4885         Fix #69949
4886         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
4887         argument. Call ResolveAttributeUsage for unresolved.
4888         when types doesn't match ctor arguments.
4889         
4890         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
4891         for nested attribute classes.
4892         (Class.attribute_usage): Removed.
4893         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
4894         for attribute class.
4895         
4896         * ecore.cs (IsAttribute): Removed.
4897         
4898         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
4899         
4900         * rootcontext.cs (RegisterAttribute): Removed, attributes are
4901         now normal types.
4902         (attribute_types): Removed.
4903         (EmitCode): Global attributes are emited as the latest.
4904
4905 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
4906
4907         * class.cs (EmitFieldInitializers): Don't emit field initializer
4908         for default values when optimilization is on.
4909         
4910         * constant.cs (Constant.IsDefaultValue): New property.
4911         
4912         * driver.cs: Add /optimize handling.
4913         
4914         * constant.cs,
4915         * ecore.cs,
4916         * literal.cs: Implement new IsDefaultValue property.
4917         
4918         * rootcontext.cs (Optimize): New field, holds /optimize option.
4919
4920 2005-02-18  Raja R Harinath  <rharinath@novell.com>
4921
4922         Fix crasher in re-opened #72347.
4923         * namespace.cs (Namespace.Lookup): Return null if
4924         DeclSpace.DefineType returns null.
4925
4926         Fix #72678.
4927         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
4928
4929 2005-02-18  Raja R Harinath  <rharinath@novell.com>
4930
4931         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
4932         now returns null if it cannot resolve to an lvalue.
4933         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
4934         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
4935         returned null.  Remove check for SimpleName.
4936         (EventExpr.DoResolveLValue): New.
4937         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
4938         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
4939         error from ...
4940         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
4941         avoid CS0131 error.
4942         (Unary.ResolveOperator): Move CS0211 check ...
4943         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
4944         CS0131 error.
4945         (Unary.DoResolveLValue): Simplify.
4946         (AddressOf.DoResolveLValue): New.
4947         (ArrayAccess.DoResolveLValue): New.
4948
4949 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
4950
4951         * attribute.cs (Attribute.Resolve): Add arguments casting for
4952         when types doesn't match ctor arguments.
4953
4954 2005-02-16  Raja R Harinath  <rharinath@novell.com>
4955
4956         Fix parts of #63202.
4957         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
4958         lookup of operator in base type.  Ensure that all checks happen
4959         when the operator resolves to an "op_..." method.
4960
4961 2005-02-15  Raja R Harinath  <rharinath@novell.com>
4962
4963         Fix #71992.
4964         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
4965         'ignore_cs0104' parameter.  Pass it to ...
4966         (NamespaceEntry.Lookup): ... this.
4967         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
4968         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
4969         (TypeLookupExpression.DoResolveAsTypeStep): Update.
4970         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
4971         Update.  Request that cs0104 errors be ignored.
4972         (ComposedCast.ResolveAsTypeStep): Update.
4973
4974 2005-02-14  Raja R Harinath  <rharinath@novell.com>
4975
4976         Fix #59209.
4977         * expression.cs (Invocation.BetterFunction): Remove support for
4978         comparing virtual functions and their overrides.
4979         (Invocation.IsOverride): New.
4980         (Invocation.OverloadResolve): Don't consider 'override' functions
4981         during candidate selection.  Store them in a lookaside list.
4982         If the selected method is a 'virtual' function, use the list to
4983         find any overrides that are closer to the LHS type.
4984
4985 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
4986
4987         * expression.cs (New.DoResolve): Add complex core type reduction.
4988         (New.Constantify): Converts complex core type syntax like 'new int ()'
4989         to simple constant.
4990         
4991 2005-02-14  Raja R Harinath  <rharinath@novell.com>
4992
4993         * decl.cs (EntryType.EntryType): New constructor to create an
4994         updated copy of a cache entry.
4995         (MemberCache.AddMethods): Use it.
4996         (MemberCache.ClearDeclaredOnly): Remove.
4997         (MemberCache.MemberCache): Update.
4998
4999 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5000
5001         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5002         variable.  This one is represents the actual low-level declaration
5003         of the method, as opposed to the semantic level `IsStatic'.   
5004
5005         An anonymous method which is hosted into a static method might be
5006         actually an instance method.  IsStatic would reflect the
5007         container, while MethodIsStatic represents the actual code
5008         generated.
5009
5010         * expression.cs (ParameterReference): Use the new MethodIsStatic
5011         instead of IsStatic.
5012
5013         * anonymous.cs (AnonymousMethod.Compatible): Pass the
5014         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5015         set on the current EmitContext. 
5016
5017         * expression.cs (Cast): Overload DoResolveLValue so we can pass
5018         resolve our casted expression as an LValue.  This triggers the
5019         proper LValue processing that is later required by Assign.
5020
5021         This fixes 72347.
5022
5023         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5024
5025 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
5026
5027         C# 2.0 Fixed buffer implementation
5028
5029         * anonymous.cs: Update after RegisterHelperClass renaming.
5030
5031         * attribute.cs (AttributeTester.fixed_buffer_cache):
5032         Cache of external fixed buffers.
5033         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5034         implementation if field is fixed buffer else null.
5035
5036         * class.cs
5037         (TypeContainer.AddField): Accept FieldMember instead of Field.
5038         (FieldBase.IsFieldClsCompliant): Extracted code from
5039         VerifyClsCompliance descendant customization.
5040         (FixedField): New class handles fixed buffer fields.
5041         (FixedFieldExternal): Keeps information about imported fixed
5042         buffer.
5043         (IFixedField): Make access to internal or external fixed buffer
5044         same.
5045
5046         * cs-parser.jay: Add fixed buffer parsing.
5047
5048         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5049         buffer.
5050
5051         * expression.cs (Indirection): Extended implementation to accept
5052         fixed buffer field.
5053         (PointerArithmetic.Emit): Get element from fixed buffer as well.
5054         (ElementAccess.MakePointerAccess): Get type as parameter.
5055         (DoResolve): Add fixed buffer field expression conversion.
5056         (DoResolveLValue): Ditto.
5057         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5058         (ArrayPtr): Derives from FixedBufferPtr.
5059         (ArrayPtr.Emit): Add extra emit for array elements.
5060
5061         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5062
5063         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5064         for compiler generated types.
5065         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5066
5067         * statement.cs (Fixed): Refactored to be easier add fixed buffer
5068         and consume less memory.
5069         (Fixed.Resolve): Add fixed buffer case.
5070
5071         * typemanager.cs (compiler_generated_attr_ctor,
5072         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5073         (HasElementType): Add our own implementation to work on every
5074         runtime.
5075
5076 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5077
5078         * anonymous.cs (CaptureContext): Track whether `this' has been
5079         referenced.   
5080
5081         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
5082         only captured `this' if it was implicitly done (instance
5083         methods/variables were used). 
5084
5085         * codegen.cs (EmitContext.CaptureThis): New method to flag that
5086         `this' must be captured.
5087
5088 2005-01-30  Miguel de Icaza  <miguel@novell.com>
5089  
5090         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5091         is null it means that there has been no need to capture anything,
5092         so we just create a sibling.
5093
5094         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5095
5096         Just a partial fix.  The other half is fairly elusive.
5097         
5098 2005-02-10  Raja R Harinath  <rharinath@novell.com>
5099
5100         Fix #52586, cs0121-4.cs.
5101         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
5102         and return a hashtable.
5103         (MemberCache.ClearDeclaredOnly): New.
5104         (MemberCache.MemberCache): Update to change.  Make a deep copy of
5105         the method_hash of a base type too.
5106         (MemberCache.AddMethods): Adapt to having a deep copy of the base
5107         type methods.  Overwrite entries with the same MethodHandle so
5108         that the ReflectedType is correct.  The process leaves in base
5109         virtual functions and their overrides as distinct entries.
5110         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
5111         matters since it was boxed in a ArrayList before.
5112         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5113         modifier.
5114         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
5115         case of a virtual function and its override (choose the overload
5116         as better).
5117         (Invocation.OverloadResolve): Avoid 'override' members during
5118         'applicable_type' calculation.
5119
5120 2005-03-28  Raja R Harinath  <rharinath@novell.com>
5121
5122         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5123         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5124         GetTypeHandle.  It is possible for a reflected type to derive from
5125         a TypeBuilder (e.g., int[] derives from the TypeBuilder
5126         System.Array during mscorlib compilation).
5127         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5128         contain a method_hash, don't create one either.  Don't create a
5129         deep copy of the base cache's method_hash.
5130         (MemberCache.SetupCache): Rename back from DeepCopy.
5131         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5132         already initialized.  If we see an override function, add its
5133         underlying base virtual function to the member_hash too.
5134
5135 2005-02-09  Raja R Harinath  <rharinath@novell.com>
5136
5137         Combine two near-redundant caches.
5138         * typemanager.cs (method_params): Rename from method_internal_params.
5139         (TypeManager.GetParameterData): New.  Replace
5140         Invocation.GetParameterData.
5141         (TypeManager.LookupParametersByBuilder): Remove.
5142         * expression.cs (Invocation.method_parameter_cache): Remove.
5143         (Invocation.GetParameterData): Remove.
5144         Update to changes.
5145         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5146         Update to changes.
5147
5148 2005-02-08  Raja R Harinath  <rharinath@novell.com>
5149
5150         Fix #72015.
5151         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5152         TypeManager.multicast_delegate_type is null, resolve it by looking
5153         up "System.MulticastDelegate".
5154         * rootcontext.cs (RootContext.ResolveCore): Simplify.
5155
5156 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
5157             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
5158             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
5159
5160         Fix cs0164.cs.
5161         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5162         (LabeledStatement.AddReference): New.  Set 'referenced'.
5163         (Goto.Resolve): Use it.
5164
5165 2005-02-05  John Luke  <john.luke@gmail.com>
5166
5167         * driver.cs: remove duplicate -doc line in Usage ()
5168
5169 2005-02-04  Raja R Harinath  <rharinath@novell.com>
5170
5171         * location.cs (Location.AddFile): Fix CS2002 error report.
5172
5173 2005-02-02  Martin Baulig  <martin@ximian.com>
5174
5175         * delegate.cs (Delegate.DefineType): Report an internal error if
5176         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5177         details.        
5178
5179 2005-02-02  Raja R Harinath  <rharinath@novell.com>
5180
5181         Fix a crasher in a variant of #31984.
5182         * const.cs (Constant.CheckBase): New override that defers the
5183         new-or-override check in case the base type hasn't been populated
5184         yet.
5185         (Constant.Define): Ensure the new-or-override check is performed.
5186
5187 2005-02-01  Duncan Mak  <duncan@ximian.com>
5188
5189         * const.cs (LookupConstantValue): Check that `ce' is not null
5190         before calling GetValue ().
5191
5192 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5193
5194         Fix test-334.cs (#69519).
5195         * cs-parser.jay (using_alias_directive): Pass in an expression to
5196         NamespaceEntry.UsingAlias.
5197         (using_namespace_directive): Pass in an expression to
5198         NamespaceEntry.Using.
5199         (namespace_name): Don't flatten to a string.
5200         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5201         (NamespaceEntry.AliasEntry.Resolve): Lookup using
5202         ResolveAsTypeStep.
5203         (NamespaceEntry.UsingEntry): Likewise.
5204         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5205         changes.
5206         (NamespaceEntry.LookupForUsing): Remove.
5207         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5208         names.
5209         (NamespaceEntry.Lookup): Remove support for dotted names.
5210
5211 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5212
5213         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5214         split into two.
5215         (NamespaceEntry.ImplicitParent): Compute on demand.
5216         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5217         parallels the current.
5218         (NamespaceEntry.LookupForUsing): Use it.
5219         (NamespaceEntry.Lookup): If the current namespace-entry is
5220         implicit, don't search aliases and using tables.
5221
5222 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5223
5224         Fix #31984.
5225         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5226         BaseCache here.
5227         (TypeContainer.BaseCache): Compute on demand.
5228         (TypeContainer.FindMembers): Define constants and types if they're
5229         not already created.
5230         (FieldMember.Define): Move resetting of ec.InUnsafe before error
5231         check.
5232         * const.cs (Constant.Define): Make idempotent.
5233
5234 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5235
5236         * pending.cs: Produce better code (no nops produced by using Ldarg
5237         + value).
5238         
5239         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5240         i - 1' it should be arg + 1.
5241
5242         Fixes bug #71819.
5243
5244 2005-01-28  Raja R Harinath  <rharinath@novell.com>
5245
5246         * attribute.cs (Attribute.CheckAttributeType): Make private
5247         non-virtual.
5248         (Attribute.ResolveType): Make virtual.
5249         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5250         handling of RootContext.Tree.Types.
5251
5252 2005-01-27  Raja R Harinath  <rharinath@novell.com>
5253
5254         Update attribute-handling to use the SimpleName/MemberAccess
5255         mechanisms.
5256         * cs-parser.jay (attribute): Pass in an expression to the
5257         constructors of Attribute and GlobalAttribute.
5258         * attribute.cs (Attribute): Take an expression for the name.
5259         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
5260         passed in attribute name expression.
5261         (Attribute.CheckAttributeType): Use it.
5262         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5263         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5264         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
5265         argument to prevent error messages if the lookup fails.
5266
5267 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
5268
5269         * expression.cs (Indirection): Implemented IVariable interface
5270         to support indirection in AddressOf operator.
5271         (PointerArithmetic.Emit): Add optimalization for case where
5272         result can be precomputed.
5273
5274 2005-01-26  Martin Baulig  <martin@ximian.com>
5275
5276         * class.cs (TypeContainer.AttributeTargets): Return the correct
5277         AttributeTargets depending on our `Kind' instead of throwing an
5278         exception; fixes #71632.
5279
5280 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
5281
5282         Fix #71257
5283         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5284         constant members.
5285
5286 2005-03-17  Martin Baulig  <martin@ximian.com>
5287
5288         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5289         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
5290
5291 2005-03-17  Martin Baulig  <martin@ximian.com>
5292
5293         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5294         to bool so we can return an error condition.
5295         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5296         returned an error.
5297
5298 2005-03-17  Martin Baulig  <martin@ximian.com>
5299
5300         * generic.cs (TypeMananager.IsIEnumerable): New public method.
5301
5302         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
5303         converting from an array-type of T to `IEnumerable<T>'.
5304
5305 2005-03-16  Martin Baulig  <martin@ximian.com>
5306
5307         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
5308         (Nullable.LiftedUnaryMutator): New public class.
5309
5310         * expression.cs (UnaryMutator.DoResolve): Added support for
5311         Nullable Types.
5312
5313 2005-03-14  Martin Baulig  <martin@ximian.com>
5314
5315         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
5316
5317 2005-03-14  Martin Baulig  <martin@ximian.com>
5318
5319         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
5320         the comparision operators `<', `>', `<=' and `>='.
5321
5322 2005-03-13  Martin Baulig  <martin@ximian.com>
5323
5324         * generic.cs
5325         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
5326         avoid confusion with the `NullLiteral'.
5327         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
5328
5329 2005-03-13  Martin Baulig  <martin@ximian.com>
5330
5331         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
5332         comparing arbitrary types with the null literal.
5333
5334 2005-03-13  Martin Baulig  <martin@ximian.com>
5335
5336         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
5337         boolean operators '&&', '||', '&' and '|'.
5338         (Nullable.OperatorTrueOrFalse): New public class.
5339
5340         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
5341         instead of a `StaticCallExpr'; added support for nullables.
5342
5343 2005-03-10  Martin Baulig  <martin@ximian.com>
5344
5345         * expression.cs
5346         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
5347         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
5348
5349 2005-03-07  Martin Baulig  <martin@ximian.com>
5350
5351         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
5352         it work if `expr' is not an IMemoryLocation.
5353         (Nullable.Lifted): Implement IMemoryLocation.
5354         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
5355         target type.
5356
5357 2005-03-05  Martin Baulig  <martin@ximian.com>
5358
5359         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
5360         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
5361         (Nullable): Added support for lifted unary and binary operators.
5362
5363         * expression.cs (Unary.DoResolve): Added support for nullable types.
5364         (Binary.DoResolve): Likewise.
5365         (Conditional.DoResolve): Likewise.
5366
5367 2005-03-02  Martin Baulig  <martin@ximian.com>
5368
5369         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
5370
5371         * class.cs (ClassPart.SetParameterInfo): Override this.
5372         (PartialContainer.SetParameterInfo): Override this.
5373         (TypeContainer.CheckConstraints): New protected method.
5374         (PartialContainer.CheckConstraints): Override this and check
5375         whether the same contraints were specified in all parts of a
5376         partial generic type definition.
5377         (PartialContainer.UpdateConstraints): New public method.
5378
5379         * generic.cs (TypeParameter.UpdateConstraints): New public method.
5380
5381 2005-03-02  Martin Baulig  <martin@ximian.com>
5382
5383         Committing a patch from Carlos Alberto Cortez to fix #72887.
5384
5385         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
5386         casts from `T []' to `int []'.
5387
5388 2005-03-02  Martin Baulig  <martin@ximian.com>
5389
5390         * generic.cs (TypeManager.IsEqual): Make this symmetric.
5391
5392         * expression.cs (Binary.ResolveOperator): When resolving a
5393         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
5394         `=='.  Fixes #71866.  See gen-127.cs.
5395
5396 2005-03-02  Martin Baulig  <martin@ximian.com>
5397
5398         * class.cs (TypeContainer.DoDefineMembers): We also need a default
5399         static constructor in static classes.
5400
5401 2005-03-02  Martin Baulig  <martin@ximian.com>
5402
5403         * generic.cs
5404         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
5405         (Nullable.LiftedConversion): Added support for user-defined
5406         conversions.
5407
5408         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
5409
5410         * cs-parser.jay: Use ComposedCast everywhere instead of
5411         NullableType, so we don't need to check for NullableType
5412         everywhere.
5413         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
5414         case where we'll be resolved into a `parenthesized_expression_0'
5415         afterwards.
5416
5417         * convert.cs
5418         (Convert.UserDefinedConversion): Added nullable conversions.
5419
5420 2005-02-28  Martin Baulig  <martin@ximian.com>
5421
5422         * generic.cs (TypeManager.IsNullableType): New static method.
5423         (Nullable): New abstract class.
5424         (Nullable.NullLiteral): New public class.
5425         (Nullable.LiftedConversion): New public class.
5426
5427         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
5428         `builtin_types opt_nullable'.
5429
5430         * convert.cs
5431         (Convert.ImplicitConversionStandard): Added nullable conversions.
5432         (Convert.ExplicitConversionStandard): Likewise.
5433         (Convert.ExplicitConversion): Likewise.
5434
5435 2005-02-26  Martin Baulig  <martin@ximian.com>
5436
5437         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
5438         begin with a "?", for instance "?[]".  Don't do a type lookup if
5439         `dim' is empty.
5440
5441 2005-02-25  Martin Baulig  <martin@ximian.com>
5442
5443         The first part of Nullable Types :-)
5444
5445         * generic.cs (NullableType): New public class.
5446         (NullCoalescingOperator): New public class.
5447         (TypeArguments.Resolve): Add a CS0306 check.
5448
5449         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
5450         (opt_nullable): New rule.
5451         (type): Added `opt_nullable' to `namespace_or_type_name',
5452         `builtin_types' and `pointer_type'.
5453         (array_type): Added `opt_nullable'.
5454         (opt_rank_specifier_or_nullable): New rule; this is the
5455         combination of `opt_rank_specifier' and `opt_nullable'.
5456         (opt_error): New rule; catch errors here.
5457         (nullable_type_or_conditional): New rule; we use this to check for
5458         nullable and still detect the conditional operator.
5459         (local_variable_type): Use `opt_rank_specifier_or_nullable'
5460         instead `opt_rank_specifier'.
5461
5462         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
5463         for nullables.
5464
5465 2005-02-24  Martin Baulig  <martin@ximian.com>
5466
5467         * README, README.Changes: Removed; they're old and obsolete.
5468
5469 2005-02-22  Martin Baulig  <martin@ximian.com>
5470
5471         * generic.cs (TypeParameter.Resolve): If resolving the constraints
5472         returned an error, set `constraints' to null to avoid a crash
5473         later on.
5474         (TypeParameter.ResolveType): Likewise.
5475
5476 2005-02-22  Martin Baulig  <martin@ximian.com>
5477
5478         * generic.cs
5479         (Constraints.ResolveTypes): Protect against being called twice.
5480         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
5481         (TypeParameter.ResolveType): New public method; calls
5482         constraints.ResolveTypes().
5483         (TypeParameter.DefineType): Moved constraints.ResolveType() out
5484         into the new ResolveType().
5485         (GenericMethod.Define): Call ResolveType() on all our
5486         TypeParameter's.        
5487
5488 2005-02-21  Martin Baulig  <martin@ximian.com>
5489
5490         * generic.cs
5491         (TypeManager.generic_nullable_type): New static public field.
5492         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
5493
5494         * rootcontext.cs
5495         (RootContext.ResolveCore): Resolve "System.Nullable`1".
5496
5497 2005-02-15  Martin Baulig  <martin@ximian.com>
5498
5499         * generic.cs (ConstructedType.Constraints): Correctly check
5500         constraints if the argument type is a type parameter; fixes
5501         #72326. 
5502
5503 2005-02-02  Martin Baulig  <martin@ximian.com>
5504
5505         * delegate.cs (Delegate.DefineType): Report an internal error if
5506         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5507         details.        
5508
5509 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5510
5511         * pending.cs: Produce better code (no nops produced by using Ldarg
5512         + value).
5513         
5514         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5515         i - 1' it should be arg + 1.
5516
5517         Fixes bug #71819.
5518         
5519 2005-01-26  Martin Baulig  <martin@ximian.com>
5520
5521         * cs-parser.jay (indexer_declarator): Don't report an error if we
5522         have type parameters since we can be an explicit interface
5523         implementation; fixes #71449.
5524
5525 2005-01-26  Martin Baulig  <martin@ximian.com>
5526
5527         * class.cs (TypeContainer.AttributeTargets): Return the correct
5528         AttributeTargets depending on our `Kind' instead of throwing an
5529         exception; fixes #71632.
5530
5531 2005-01-26  Martin Baulig  <martin@ximian.com>
5532
5533         * delegate.cs (Delegate.DefineType): Correctly define our type
5534         parameters.  Fixes #71483.
5535
5536 2005-01-25  Raja R Harinath  <rharinath@novell.com>
5537
5538         Fix #71602.
5539         * expression.cs (MemberAccess.DoResolve): Don't complain with
5540         cs0572 when the LHS of a member access has identical name and type
5541         name.
5542
5543 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
5544
5545         Fix #71651, #71675
5546         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5547         CreatePermission.
5548         Create custom PermissionSet only for PermissionSetAttribute.
5549
5550 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
5551
5552         Fix #71649
5553         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5554         delegates in static class.
5555
5556 2005-01-24  Martin Baulig  <martin@ximian.com>
5557
5558         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5559         merging an implicit block, just use its reachability.
5560
5561         * statement.cs (Block.Resolve): Make the unreachable code check
5562         work wrt. implicit blocks; see test-337 from #63842.
5563
5564 2005-01-21  Alp Toker  <alp@atoker.com>
5565  
5566         * cs-parser.jay: destructor_declaration's container is PartialContainer
5567         not Class when partial types are used, so use Kind prop instead of
5568         'is'.
5569         
5570 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
5571
5572         * cs-parser.jay: Improve error reporting when an interface
5573         declares new types.
5574
5575 2005-01-20  Dick Porter  <dick@ximian.com>
5576
5577         * support.cs: SeekableStreamReader fix from Sandor Dobos
5578         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5579         chars are read.  Fixes bug 70369.
5580
5581 2005-01-20  Raja R Harinath  <rharinath@novell.com>
5582
5583         * cs-parser.jay (catch_clause): Simplify current_block handling
5584         somewhat.
5585
5586 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
5587
5588         * convert.cs (ImplicitStandardConversionExists): Synchronize the
5589         code with ImplicitStandardConversion to handle the implicit
5590         conversion of method groups into valid delegate invocations. 
5591
5592         The problem is that in parameter handling we were using this code
5593         path.  Fixes bug #64698
5594
5595 2005-01-19  Raja R Harinath  <rharinath@novell.com>
5596
5597         * cs-parser.jay: Fix several infelicities.
5598         - Avoid assigning to the parser value stack.  Code like 
5599           '$3 = null' is unclean.  Synthesize a value for the code block
5600           instead. 
5601         - Avoid using oob_stack for storing location information.  Use ...
5602         (_mark_): ... this.  New (empty) rule.  Saves the current location
5603         in $$.
5604         (foreach_statement): Avoid using oob_stack for current_block
5605         handling.  Use technique used in for_statement and
5606         using_statement.  Synthesize a value for the code block to store
5607         additional intermediate information.
5608
5609 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
5610
5611         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5612         of a different type is only allowed to private fields of a
5613         containing type, not on fields of a base class.
5614
5615         See test-174.cs and error cs0122-9.cs
5616
5617 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5618
5619         Fix test-335.cs (bug #58126).
5620         * cs-parser.jay (argument): Split out non-expression parts of the
5621         rule into 'non_simple_argument'.
5622         (invocation_expression): Support parenthesized invocations with
5623         multiple arguments, and with single non-simple arguments.
5624
5625 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5626
5627         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5628         places.
5629
5630 2005-01-12  Raja R Harinath  <rharinath@novell.com>
5631
5632         Fix cs0038-1.cs, cs1640-6.cs.
5633         * ecore.cs (Expression.Resolve): Remove special-case for
5634         SimpleName in error-handling.
5635         (Expression.almostMatchedMembers): Relax access permission to
5636         protected.
5637         (Expression.MemberLookupFailed): Handle duplicates in
5638         almostMatchedMembers list.
5639         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5640         * expression.cs (New.DoResolve): Report CS1540 for more cases.
5641         * typemanager.cs (GetFullNameSignature): Use the MethodBase
5642         overload if the passed in MemberInfo is a MethodBase.
5643
5644 2005-01-25  Martin Baulig  <martin@ximian.com>
5645
5646         * doc.cs
5647         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
5648
5649 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
5650
5651         Fix #70749
5652         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5653         for non-CAS & merge permission sets properly.
5654
5655 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5656
5657         Improve standard-compliance of simple name and member access 
5658         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
5659         * ecore.cs (FullNamedExpression): New abstract base class 
5660         for Namespaces and TypeExpressions.
5661         (ResolveFlags.SimpleName): Remove.
5662         (SimpleName): Remove support for dotted names.
5663         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
5664         DeclSpace.FindType and DeclSpace.LookupType.
5665         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5666         (Expression.ExprClassName): Make member function.
5667         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5668         a namespace.  Remove creation of dotted "SimpleName"s.
5669         (MemberAccess.DoResolve): Likewise.
5670         * decl.cs (DeclSpace.Cache): Make private.
5671         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5672         (DeclSpace.FindType): Update.
5673         (DeclSpace.LookupType): Move here from RootContext.  Return a 
5674         FullNamedExpression.
5675         * namespace.cs (Namespace): Derive from FullNamedExpression
5676         so that it can be part of expression resolution.
5677         (Namespace.Lookup): Return an FullNamedExpression.
5678         (NamespaceEntry.LookupAlias): Lookup aliases only in current
5679         namespace.
5680         * rootcontext.cs (NamespaceLookup): Remove.
5681         (LookupType): Move to DeclSpace.
5682         * attribute.cs (CheckAttributeType): Update.
5683         * doc.cs (FindDocumentedType): Remove allowAlias argument.
5684         (FindDocumentedTypeNonArray): Likewise.
5685
5686 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5687
5688         Fix cs0509.cs, cs1632.cs.
5689         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5690         is the same as IsInterface.
5691         (TypeContainer.GetClassBases): Likewise.
5692         * statement.cs (LabeledStatement.ig): New field.
5693         (LabeledStatement.LabelTarget): Save ILGenerator which created the
5694         label.
5695         (LabeledStatement.DoEmit): Check that the label was created with
5696         the same ILGenerator.
5697
5698 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5699
5700         Fix #71058
5701         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
5702         accessors to its properties.
5703
5704         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
5705         from accessors to property.
5706         
5707 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5708
5709         Fix #70722
5710         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
5711         only for overrides.
5712         
5713 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
5714
5715         * attribute.cs: Check for null and empty strings.  
5716
5717         I have lost another battle to Paolo.
5718
5719 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
5720
5721         Fix #70942
5722         * class.cs (PropertyMethod): Set Parent field in ctors.
5723         (SetMethod.InternalParameters): Add unsafe switch hack.
5724         Override MarkForDuplicationCheck where it is appropriate.
5725
5726         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
5727         It says whether container allows members with the same name.
5728         Base default is no.
5729         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
5730         Removed is_method parameter.
5731
5732 2005-01-06  Duncan Mak  <duncan@ximian.com>
5733
5734         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
5735         because the previous change led to incorrect reporting of CS1032
5736         ("Cannot define/undefine preprocessor symbols after first token in
5737         file"). Instead of using `tokens_seen' as the only flag that
5738         triggers CS1040, introduce `comments_seen'. This new flag is used
5739         to signify having seen comments on the current line, so it is
5740         unset after a newline.
5741
5742 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5743
5744         * doc.cs : When searching for a type, find nested type too.
5745           This fixes bug #71040.
5746
5747 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5748
5749         * doc.cs :
5750           - Warn missing member comment on those classes which also does not
5751             have doc comments. Fixed bug #71041.
5752           - Don't warn missing doc comment on default constructor.
5753             Fixed bug #71042.
5754
5755 2005-01-06  Duncan Mak  <duncan@ximian.com>
5756
5757         * cs-tokenizer.cs (xtoken): After handling traditional C-style
5758         comments, set `tokens_seen' to true. This allows us to detect
5759         misplaced preprocessor directives (i.e. not at the beginning of
5760         the a line, nor after whitespaces). In that case, report error
5761         CS1040. This fixes bug #56460.
5762
5763         * cs-parser.jay (interface_member_declaration): Add checks for
5764         IsExplicitImpl, and report CS0541 error if an interface member is
5765         defined as an explicit interface declaration.
5766
5767 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
5768
5769         Fix #70817
5770         * class.cs (PropertyMethod): Set Parent field in ctors.
5771         (SetMethod.InternalParameters): Add unsafe switch hack.
5772         
5773         * decl.cs (MemberCore.Parent): Cannot be readonly.
5774
5775 2005-01-06  Raja R Harinath  <rharinath@novell.com>
5776
5777         * decl.cs (DeclSpace.ResolveType): Remove.
5778         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
5779         Merge in code from ...
5780         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
5781         * class.cs, enum.cs: Update to changes.
5782
5783 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
5784
5785         * anonymous.cs: Ensure that we init the scope of our parent if it
5786         has not been initialized yet.
5787
5788 2004-12-30  Duncan Mak  <duncan@ximian.com>
5789
5790         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
5791         if field.FieldBuilder is null. Fixes #70758.
5792
5793         * convert.cs: Fixed some typos and updated some of the comments.
5794         (ImplicitStandardConversionExists):
5795         (TryImplicitIntConversion): If `target_type' is an interface and
5796         the type of `ic' implements this interface, return true or a new
5797         BoxedCast instead of null. This fixes #70468.
5798
5799 2004-12-29  Duncan Mak  <duncan@ximian.com>
5800
5801         * expression.cs (Argument.Emit): Check that Expr is
5802         IMemoryLocation before casting to it, and report CS1510 otherwise.
5803
5804         This fixes #70402.
5805
5806 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
5807
5808         * statement.cs (Block.ThisVariable): remove the recursion here, to
5809         make the --profile more sane.
5810
5811 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
5812
5813         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
5814         assembly, by JB Evain.
5815
5816 2004-12-17  Raja R Harinath  <rharinath@novell.com>
5817
5818         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
5819           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
5820         "parent" refers to enclosing type/class.  "base" refers to superclass.
5821
5822 2004-12-17  Raja R Harinath  <rharinath@novell.com>
5823
5824         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5825         Ensure that we only have GlobalAttributes.
5826         * attribute.cs (Attribute.Emit): Make non-virtual.
5827         (GlobalAttribute.Emit): Remove.
5828         (Attribute.Resolve): Make virtual.
5829         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
5830         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
5831         the argument. Don't create one.
5832         (Attribute.GetObsoleteAttribute): Likewise.
5833         (Attribute.GetClsCompliantAttributeValue): Likewise.
5834         * class.cs, decl.cs: Update to changes.
5835
5836 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
5837
5838         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
5839         
5840         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
5841         
5842         * statement.cs (Foreach.Resolve): Add error 186 report.
5843
5844 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
5845
5846         * expression.cs (Conditional.DoResolve): Add warning 429.
5847         
5848         * statement.cs (If.Resolve): Add warning 665.
5849
5850 2004-12-16  Raja R Harinath  <rharinath@novell.com>
5851
5852         New invariant: RootContext.Tree.Types.NamespaceEntry == null
5853         except when in the parser, and in GlobalAttribute.
5854         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
5855         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
5856         RootContext.Tree.Types.NamespaceEntry once work is done.
5857         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
5858         and resets RootContext.Tree.Types.NamespaceEntry.
5859
5860 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
5861
5862         * cs-parser.jay: Don't create a block for every variable.
5863
5864 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
5865
5866         * location.cs: Provide extra information.
5867
5868         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
5869         variables from the captured environment, it is the ldarg_0.
5870
5871 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
5872
5873         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
5874         find a conclusion.
5875         
5876         * class.cs: Changed warning level for 169 to avoid developer
5877         displeasure from warning flooding. It will be changed back when they
5878         fix most of current BCL warnings.
5879         
5880         * RootContext.cs: Pushed default WarningLevel to 3.
5881         
5882         * statement.cs: Removed unused variable.
5883
5884 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
5885
5886         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
5887         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
5888         Add error 502 report.
5889         (StaticClass.DefineType): Add error 441 report.
5890         (Class.AllowedModifiersProp): New virtual property as temporary
5891         extension to AllowedModifiers.
5892         (Class.DefineType): Add error 418 report. Moved ModFlags check here
5893         to share implementation with StaticClass and don't call virtual
5894         methods from ctor.
5895         
5896         * driver.cs (MainDriver): Add error 1558 test.
5897
5898         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
5899         report. Moved error 36 test here.
5900
5901         * statement.cs (Throw.Resolve): Add error 724 report.
5902
5903         * typemanager.cs: Add out_attribute_type core type.
5904         
5905 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
5906
5907         * class.cs (TypeContainer.VerifyClsCompliance): Add error
5908         3018 report.
5909         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
5910
5911         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
5912         3017 report.
5913         
5914         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
5915
5916         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
5917         Add error 3023 report.
5918         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
5919
5920         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
5921         implementation.
5922
5923 2004-12-12  John Luke  <john.luke@gmail.com>
5924
5925         * driver.cs (AddArgs): take -- into account when
5926         adding arguments, fixes bug 65710 
5927
5928 2004-12-12  Martin Baulig  <martin@ximian.com>
5929
5930         * expression.cs (Unary.TryReduceNegative): Added support for
5931         SByteConstant and ByteConstant.
5932         (Unary.Reduce): Check error values from TryReduceNegative().
5933
5934 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
5935
5936         * attributes.cs (Attribute.Resolve): Avoid multiple error report
5937         and report exception as error 182.
5938
5939 2004-12-10  Raja R Harinath  <rharinath@novell.com>
5940
5941         * driver.cs (Main): Fix message when there are warnings.
5942
5943 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
5944
5945         * delegate.cs: Fixed my fix from yesterday, sorry about that.
5946
5947 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
5948
5949         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
5950         Reduced number of warnings.
5951         
5952         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
5953
5954 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
5955
5956         * driver.cs: Removed message.
5957
5958         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
5959
5960 2004-12-08    <vargaz@freemail.hu>
5961
5962         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
5963
5964 2004-12-08  Martin Baulig  <martin@ximian.com>
5965
5966         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5967         instead of a CS3002 for properties and indexer.
5968
5969 2004-12-08  Martin Baulig  <martin@ximian.com>
5970
5971         * decl.cs (MemberName.ToString): Make this work again.
5972
5973 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
5974
5975         * attribute.cs (Resolve): Add error 591 detection.
5976
5977         * class.cs (FieldMember.Define): Add error 1547 detection.
5978         (Indexer.Define): Add error 620 detection.
5979         (Operator.Define): Add error 590 detection.
5980
5981         * ecore.cs: Missing argument for error 79.
5982
5983         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
5984         detection.
5985
5986 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
5987
5988         Fix #70106
5989         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
5990         only.
5991
5992 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
5993
5994         * cs-parser.jay : handle doc comments on implicit/explicit operators.
5995           Some operator comments were suppressed.
5996         * doc.cs : Implicit/explicit operator name in doc comments are like
5997           "op_Explicit(type)~returnType", so added suffix handling.
5998
5999 2005-01-21  Alp Toker  <alp@atoker.com>
6000
6001         * cs-parser.jay: destructor_declaration's container is PartialContainer
6002         not Class when partial types are used, so use Kind prop instead of 'is'.
6003
6004 2004-12-12  Martin Baulig  <martin@ximian.com>
6005
6006         * expression.cs (Unary.TryReduceNegative): Added support for
6007         SByteConstant and ByteConstant.
6008         (Unary.Reduce): Check error values from TryReduceNegative().
6009
6010 2004-12-11  Martin Baulig  <martin@ximian.com>
6011
6012         * support.cs (ReflectionParameters.ParameterName): If we have a
6013         `gpd', call `ParameterName' on it.
6014
6015         * parameter.cs (Parameter.GetParameterAttributes): New static method.
6016
6017         * pending.cs (PendingImplementation.DefineProxy): Call
6018         DefineParameter() for all of the MethodBuilder's arguments.
6019
6020 2004-12-09  Martin Baulig  <martin@ximian.com>
6021
6022         * doc.cs (DocUtil): Make this a static class.
6023
6024 2004-12-09  Martin Baulig  <martin@ximian.com>
6025
6026         * expression.cs (Invocation.InferType): Moved the type inference
6027         implementation into TypeManager.
6028
6029         * generics.cs (TypeManager): Moved the type inference
6030         implementation here.
6031
6032 2004-12-09  Martin Baulig  <martin@ximian.com>
6033
6034         * typemanager.cs (TypeManager): Make this a partial class.
6035
6036         * generics.cs
6037         (TypeManager): Move the generics part of `TypeManager' here.
6038
6039 2004-12-08  Martin Baulig  <martin@ximian.com>
6040
6041         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6042         instead of a CS3002 for properties and indexer.  Added CS3024
6043         check for generic interfaces.
6044
6045         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
6046         instances are not CLS-compliant.
6047
6048 2004-12-08  Martin Baulig  <martin@ximian.com>
6049
6050         * cs-parser.jay
6051         (void_pointer_expression): New rule for `void*', `void**' etc.
6052         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
6053
6054 2004-12-08  Martin Baulig  <martin@ximian.com>
6055
6056         * expression.cs (Invocation.InferType): Removed the hack for
6057         MethodCore.MayUnify().  
6058
6059         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
6060         this actually work.
6061
6062         * class.cs (MethodCore.MayUnify): Use
6063         TypeManager.MayBecomeEqualGenericTypes().       
6064
6065 2004-12-08  Martin Baulig  <martin@ximian.com>
6066
6067         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
6068         parameter, box it.  Fixes #69233.
6069
6070 2004-12-08  Martin Baulig  <martin@ximian.com>
6071
6072         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
6073         have the ctor constraint.  Fixes #68326.
6074
6075 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6076
6077         * cs-parser.jay : interface comment was not consumed because of
6078           extra opt_semicolon before doc handling.
6079
6080 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6081
6082         Fix test-327.cs, test-328.cs, and put in early infrastructure
6083         for eventually fixing #52697.
6084         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6085         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6086         from other methods.
6087         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6088         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6089         (VerifyUsing, error246): Update.
6090         * rootcontext.cs (RootContext.NamespaceLookup): Just use
6091         'NamespaceEntry.LookupNamespaceOrType'.
6092
6093 2004-12-07  Martin Baulig  <martin@ximian.com>
6094
6095         * driver.cs: Call it "BETA SOFTWARE" :-)
6096
6097 2004-12-06  Raja R Harinath  <rharinath@novell.com>
6098
6099         Fix crash on cs0657-17.cs.
6100         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6101         Use RootContext.Tree.Types, not 'new RootTypes ()'.
6102         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6103         the case where the NamespaceEntry gets overwritten.
6104
6105 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
6106
6107         Fixed #69195, #56821
6108         * ecore.cs (ResolveBoolean): Tiny refactoring.
6109
6110         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6111         of right expression resolving when left is false constant and
6112         operator is LogicalAnd OR true constant and operator is LogicalOr.
6113
6114         * statement.cs (ResolveUnreachable): Always reports warning.
6115
6116 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
6117
6118         * class.cs: Distinguish between 1721 and 1722 (just a little help
6119         for the programmer).
6120
6121 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
6122
6123         * delegate.cs: Only allow this on new versions of the language. 
6124
6125 2004-12-02  Duncan Mak  <duncan@ximian.com>
6126
6127         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6128         Expression class.
6129         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6130         here as a static method. Take an additional bool out parameter
6131         `must_do_cs1540_check' for signaling to InstanceResolve.
6132         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6133         member field from PropertyExpr class and made it an argument of
6134         the method instead.
6135         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6136         check for MarshalByRefObject, and report CS0122 instead of CS1540.
6137         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6138         and `remove_accessor' as well as InstanceResolve: report CS0122
6139         where applicable.
6140
6141         Fixes #70129.
6142
6143 2004-12-07  Martin Baulig  <martin@ximian.com>
6144
6145         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
6146         and CS0692 where appropriate.
6147
6148 2004-12-06  Martin Baulig  <martin@ximian.com>
6149
6150         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
6151         IsDuplicateImplementation() and improved it.
6152
6153         * expression.cs (Invocation.InferTypeArguments): Added
6154         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
6155         and removed the "ref" modifier from `infered_types'.
6156
6157         * decl.cs (MemberName.ToString): Removed the exception.
6158
6159 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
6160
6161         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6162           comments are allowed.
6163
6164 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6165
6166         * delegate.cs: Add checks for subtypes in paramaters and return values
6167         in VerifyMethod () to add support for Covariance/Contravariance
6168         in delegates.
6169         
6170 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6171
6172         * report.cs: Remove extra closing parenthesis.
6173
6174         * convert.cs (Error_CannotImplicitConversion): If the name of the
6175         types are the same, provide some extra information.
6176
6177 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
6178
6179         Fix bug #70102
6180         * attribute.cs (Resolve): Improved implementation of params
6181         attribute arguments.
6182
6183         * support.cs (ParameterData): Add HasParams to be faster.
6184
6185 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
6186
6187         all things are for /doc support:
6188
6189         * doc.cs: new file that supports XML documentation generation.
6190         * mcs.exe.sources: added doc.cs.
6191         * driver.cs:
6192           Handle /doc command line option.
6193           Report error 2006 instead of 5 for missing file name for /doc.
6194           Generate XML documentation when required, after type resolution.
6195         * cs-tokenizer.cs:
6196           Added support for picking up documentation (/// and /** ... */),
6197           including a new XmlCommentState enumeration.
6198         * cs-parser.jay:
6199           Added lines to fill Documentation element for field, constant,
6200           property, indexer, method, constructor, destructor, operator, event
6201           and class, struct, interface, delegate, enum.
6202           Added lines to warn incorrect comment.
6203         * rootcontext.cs :
6204           Added Documentation field (passed only when /doc was specified).
6205         * decl.cs:
6206           Added DocComment, DocCommentHeader, GenerateDocComment() and
6207           OnGenerateDocComment() and some supporting private members for
6208           /doc feature to MemberCore.
6209         * class.cs:
6210           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6211         * delegate.cs:
6212           Added overriden DocCommentHeader.
6213         * enum.cs:
6214           Added overriden DocCommentHeader and GenerateDocComment().
6215
6216 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
6217
6218         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6219         unwrapping the enumeration values, chain to
6220         DoConstantNumericPromotions again, so we can promote things to the
6221         fundamental types (takes care of enums that are bytes, sbytes).
6222
6223         Fixes bug #62054.
6224
6225 2004-12-01  Raja R Harinath  <rharinath@novell.com>
6226
6227         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6228         Fix long-standing bug in type-lookup.  Use FindType instead of
6229         LookupType when ec.ResolvingTypeTree.
6230         (Attribute.ResolveType, Attribute.Resolve)
6231         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6232         Update to changes.
6233         (Attributes.Search): Remove internal version.  Update.
6234         (Attributes.SearchMulti): Update.
6235         (Attributes.GetClsCompliantAttribute): Remove.
6236         (Attributes.GetIndexerNameAttribute): Remove.
6237         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6238         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6239         * class.cs (Indexer.Define): Likewise.
6240
6241 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
6242
6243         Fix bug #68790
6244         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6245         MarshallByReference members access.
6246
6247         * expression.cs: Use CheckMarshallByRefAccess;
6248         Better error CS0197 message.
6249
6250         * report.cs: Print whole related error message.
6251
6252 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6253
6254         * class (GetClassBases): Better error 60 report.
6255         (EventProperty): Disabled warning 67 detection.
6256
6257 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6258
6259         Fix bug #60324
6260         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6261
6262         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6263         precise values.
6264
6265 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6266
6267         Fix bug #49488
6268         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6269
6270         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6271
6272 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
6273
6274         * attribute.cs (Attribute.Resolve): Refine error reporting and
6275         report a cs0117 if the identifier does not exist, to distinguish
6276         from 0617 which is a miss-use of the actual identifier.
6277
6278         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6279         between cs0070 and cs0079.
6280
6281         * class.cs (MemberBase.DoDefine): When reporting a wrong
6282         accessibility level, we use MethodCore to compare instead of
6283         Method (this was a regression in some refactoring effort).
6284
6285         So now we correctly report cs0056 again.
6286
6287         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6288         testing the target_type (which was known to be object_type) and
6289         not the source type (which is anonymous_method).
6290
6291         Fixed reporting of error cs1660.
6292
6293         * expression.cs (UserCast.Source): Expose the underlying cast.
6294
6295         * statement.cs (Switch.SwitchGoverningType): Sort the list of
6296         allowed types to find a match to int32 first (most common).
6297
6298         In addition, it ignores any ImplicitUserConversions that did an
6299         internal implicit conversion (as the switch statement allows only
6300         one integral conversion to exist).
6301
6302         * class.cs (PartialContainer.Create): rename `name' to
6303         `member_name' for clarity.  Then replace the string calls with a
6304         call to MemberName.GetPartialName, as now using
6305         MemberName.ToString is an error (this is due to the side effects
6306         it had, that were fixed in the past).
6307
6308         This will restore the error reporting on a number of partial class
6309         errors that were missusing this (and getting an exception as a
6310         results, which is now just a plain textual warning, because
6311         yyparse debug output would crash otherwise).
6312
6313 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6314
6315         * Makefile (PROGRAM_INSTALL_DIR): Remove.
6316
6317 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6318
6319         * rootcontext.cs (LookupType): Make sure to cache lookups that
6320         don't give us a negative result. This saves about 5% of corlib
6321         compilation time.
6322
6323 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6324
6325         * report.cs (AbstractMessage.Print): messages are sent to stderr
6326
6327         * class.cs (TypeContainer.GetClassBases): It is an error to have a
6328         non-interface in the list of interfaces (at this point, either
6329         parent was properly set, or a base class is being listed in the
6330         interfaces section).
6331
6332         This flags error 1722, and resolves the crash from bug 69259.
6333
6334 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6335
6336         * statement.cs (Using.EmitExpressionFinally): make this work right
6337         for valuetypes. Fixes 69926.
6338
6339 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6340
6341         * const.cs (Const.ChangeType): Cope with the "0 literal can be
6342         converted to an enum" here, before we try to change the underlying
6343         type.  This code exists, but it is a different code path than the
6344         one used while encoding constants.
6345
6346         (ImplicitReferenceConversionExists): In addition, resynchronized
6347         the code here, so it matches the same code in
6348         ImplicitReferenceConversionExists for the `from any class-type S
6349         to any interface-type T'.       
6350
6351 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
6352
6353         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6354
6355 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
6356
6357         * cs-parser.jay: Use verbosity accordingly. 
6358
6359 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6360
6361         * expression.cs (Unary.ResolveOperator): Do not report warning;
6362         AddressOf reads from variable.
6363         
6364         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6365
6366 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6367
6368         Fix bug #69462
6369
6370         * attribute.cs (Attributable): Removed CheckTargets.
6371         (Attributes.Emit): Explicit attribute targets are tested here.
6372
6373         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6374         not enabled for interfaces.
6375
6376         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6377         (GetAssemblyName): Ouch next bug there.
6378
6379 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6380
6381         * expression.cs: Error 275 added.
6382         
6383 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
6384
6385         Fix bug #69177 (Implemented decimal constant support)
6386
6387         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6388         (BinaryFold): Add DecimalConstant.
6389
6390         * const.cs (Define): Decimal constant 
6391         (is not constant.
6392         (ChangeType): Add decimal type handling.
6393         (LookupConstantValue): Don't set value for decimal type but
6394         emit DecimalConstantAttribute. Needed for constant optimization.
6395
6396         * constant.cs (ToDecimal): New method.
6397         (ConvertToDecimal): New method.
6398         (IntConstant): Implemented ConvertToDecimal.
6399         (DecimalConstant.Emit): Emit optimized version for decimals in
6400         int range.
6401
6402         * expression.cs (ResolveOperator): Changed order of constant
6403         reduction to work correctly with native types which have
6404         overloaded operators.
6405         (ResolveMemberAccess): Extract constant value from attribute
6406         for decimal type.
6407
6408         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6409
6410         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6411         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6412         (ChangeType): Decimal is special.
6413         (TypeToCoreType): Add decimal type.
6414
6415 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6416
6417         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6418         decimal types.
6419
6420 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6421
6422         * class.cs (EventField.ApplyAttributeBuilder): Fix error
6423         test cs1667-5.cs.
6424
6425 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6426
6427         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6428
6429         * pending.cs (PendingImplementation): Grab only interfaces.
6430
6431 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6432
6433         * statement.cs (ForeachHelperMethods): Add location member and
6434         error 202 detection.
6435
6436 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
6437
6438         * expression.cs (DoResolveBase): Fixed wrong warning for out
6439         variables.
6440
6441 2004-12-04  Martin Baulig  <martin@ximian.com>
6442
6443         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
6444         to check whether the conversion is ok.
6445
6446         * typemanager.cs (TypeManager.GetTypeArguments): Just return
6447         `Type.EmptyTypes' if we're not a generic TypeContainer.
6448
6449 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6450
6451         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6452         old bug: when converting from the null literal to a pointer,
6453         return an EmptyCast, not the NullLiteral.
6454
6455         This fixes #69921, the recent null_type changes probably made this
6456         bug more prominent.
6457
6458 2004-12-03  Martin Baulig  <martin@ximian.com>
6459
6460         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6461         method as our child, call AnonymousMethod.Compatible() on it.
6462
6463 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6464
6465         * class.cs (FieldBase): Use an unused bit field from the field to
6466         encode the `has_offset' property from the FieldMember.  This saves
6467         a couple of Ks on bootstrap compilation.
6468
6469         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6470         method as our child, return the AnonymousMethod resolved
6471         expression.
6472
6473         * expression.cs (New.DoResolve): Allow return values from
6474         NewDelegate to also include AnonymousMethods.
6475
6476         Fixes #70150.
6477
6478 2004-11-29  Raja R Harinath  <rharinath@novell.com>
6479
6480         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
6481         cs1648 report.
6482         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
6483         System.Runtime.InteropServices._Exception, since it's a base
6484         interface of the core type System.Exception in the net_2_0 profile.
6485
6486 2004-11-27  Martin Baulig  <martin@ximian.com>
6487
6488         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
6489
6490 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6491
6492         * Makefile: Convert to use executable.make.
6493         * gmcs.exe.sources: New.
6494
6495 2004-11-25  Martin Baulig  <martin@ximian.com>
6496
6497         * expression.cs (Invocation.InferType): Added support for byref types.
6498
6499 2004-11-25  Martin Baulig  <martin@ximian.com>
6500
6501         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
6502         in TypeManager.TypeToCoreType().
6503
6504 2004-11-25  Martin Baulig  <martin@ximian.com>
6505
6506         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
6507         "Dispose" method from the `current_type'.
6508         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
6509         DoDefineMembers() instead of using the MethodBuilder; this is
6510         required for generic iterators.
6511
6512         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
6513
6514 2004-11-24  Martin Baulig  <martin@ximian.com>
6515
6516         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
6517
6518 2004-11-20  Martin Baulig  <martin@ximian.com>
6519
6520         * expression.cs (Invocation.InferType): Correctly infer generic
6521         instances; see gen-103.cs.
6522         (Invocation.InferTypeArguments): If a generic method doesn't have
6523         any unbound type parameters, we don't need to infer anything.
6524
6525 2004-11-19  Raja R Harinath  <rharinath@novell.com>
6526
6527         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
6528
6529 2004-11-17  Raja R Harinath  <rharinath@novell.com>
6530
6531         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6532         (TypeHandle.GetMemberCache): New.
6533         (TypeHandle.TypeHandle): Update.
6534         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6535         (TypeManager.LookupParentInterfacesCache):
6536         Rename from LookupInterfaceCache.  Optimize slightly.
6537         (TypeManager.MemberLookup_FindMembers): Update.
6538         * decl.cs (MemberCache.MemberCache): Set Container to null in the
6539         multi-type variant.
6540         (AddCacheContents): Rename from AddHashtable.
6541         * class.cs (TypeContainer.parent_container): Remove.
6542         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6543         (TypeContainer.DoDefineMembers): Don't initialize it.
6544         Update to name changes.
6545         
6546 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
6547
6548         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6549         that factors the code to check access modifiers on override.  
6550
6551         (PropertyBase): Use the code here.
6552
6553         Patch from Lluis S'anchez, fixes bug #69361.
6554
6555 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
6556
6557         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6558         routine that is used to report the use of a captured variable
6559         whose address has been taken.
6560
6561         There are two checks: one when variables are being captured and
6562         the other check is when the address of a variable is taken. 
6563         
6564         (because an anonymous methods might be resolved before *or* after
6565         the address has been taken) and 
6566
6567         * expression.cs (Conditional.DoResolve): Remove the special
6568         casing that Martin added to trueExpr and falseExpr being both
6569         NullLiteral.  We get the right behavior now just by introducing
6570         the null_type into the compiler. 
6571
6572         * convert.cs (ExplicitConversion): Change the code to use
6573         null_type instead of testing `expr is NullLiteral'.
6574         (ImplicitConversionStandard): use null_type too.
6575         (ImplicitReferenceConversionExists): use null_type too.
6576         (ImplicitReferenceConversion): use null_type too.
6577
6578         * literal.cs: The type of `NullLiteral' is now null_type instead
6579         of object_type. 
6580         (Resolve): Set the type here.
6581
6582         * typemanager.cs: Introduce null_type.
6583
6584 2004-11-18  Martin Baulig  <martin@ximian.com>
6585
6586         * rootcontext.cs
6587         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
6588
6589 2004-11-18  Martin Baulig  <martin@ximian.com>
6590
6591         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
6592
6593 2004-11-18  Martin Baulig  <martin@ximian.com>
6594
6595         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
6596         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
6597         call ResolveConstructedType() on it to resolve it without checking
6598         constraints.
6599         (Constraints.ResolveTypes): Check them here.
6600         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
6601         but don't check constraints.
6602         (ConstructedType.ResolveAsTypeTerminal): Override this and also
6603         check constraints here.
6604         (ConstructedType.ResolveConstructedType): New public method.  This
6605         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
6606         resolve ourselves without checking constraints.
6607
6608         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
6609
6610 2004-11-18  Martin Baulig  <martin@ximian.com>
6611
6612         * decl.cs
6613         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
6614
6615         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
6616
6617 2004-11-18  Martin Baulig  <martin@ximian.com>
6618
6619         * ecore.cs (TypeExpr.ResolveType): Removed.
6620         (Expression.ResolveAsTypeTerminal): We always return a fully
6621         resolved `TypeExpr', so we can just access its `Type'.
6622
6623         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
6624
6625 2004-11-17  Martin Baulig  <martin@ximian.com>
6626
6627         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
6628         sure we don't return any unresolved TypeExpr's.
6629         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
6630         a `TypeExpr'.
6631         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
6632
6633         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
6634         unresolved `ConstructedType's.
6635
6636 2004-11-17  Martin Baulig  <martin@ximian.com>
6637
6638         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
6639
6640 2004-11-17  Martin Baulig  <martin@ximian.com>
6641
6642         * ecore.cs
6643         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
6644
6645         * decl.cs (DeclSpace.ResolveType): Removed.
6646         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
6647
6648 2004-11-17  Martin Baulig  <martin@ximian.com>
6649
6650         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6651         direction, like FindMembers() does.  Fixes #69546, testcase is in
6652         test-315.cs.    
6653
6654 2004-11-16  Martin Baulig  <martin@ximian.com>
6655
6656         This is based on a patch from Marek Safar, see bug #69082.
6657         Fixes bugs #63705 and #67130.
6658
6659         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6660         method; create a MemberCache for an interface type and cache the
6661         result.
6662
6663         * decl.cs (IMemberContainer.ParentContainer): Removed.
6664         (IMemberContainer.ParentCache): New property.
6665         (MemberCache.SetupCacheForInterface): Removed.
6666         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6667         to create a cache for an interface's "parent".
6668
6669         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6670         interfaces too.
6671
6672 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
6673
6674         * statement.cs: Avoid adding bools to a hashtable.
6675
6676 2004-11-15  Martin Baulig  <martin@ximian.com>
6677
6678         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
6679
6680 2004-11-11  Martin Baulig  <martin@ximian.com>
6681
6682         * typemanager.cs (TypeManager.GetMethodName): New method.
6683
6684         * class.cs (MethodData.Define): Include the generic arity in the
6685         name of an explicit interface; also add it to the method name.
6686
6687         * pending.cs (PendingImplementation.InterfaceMethod): The method
6688         name now includes the generic arity.
6689
6690 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
6691
6692         * expression.cs (Invocation.OverloadResolve): Flag error if we are
6693         calling an unsafe method from a safe location.
6694
6695 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
6696
6697         Fix #69167
6698         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6699
6700 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
6701
6702         * namespace.cs (VerifyUsing): use GetPartialName instead of
6703         ToString. 
6704
6705 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
6706
6707         * statement.cs (Return.Resolve): Fix regression in typo: if
6708         `in_exc', we have to request a NeedReturnLabel, this was a typo
6709         introduced in the anonymous method check-in.  Fixes #69131.
6710
6711         * Indexers were using the ShortName when defining themselves,
6712         causing a regression in the compiler bootstrap when applying the
6713         patch from 2004-11-02 (first part), now they use their full name
6714         and the bug is gone.
6715
6716 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
6717
6718         * driver.cs: Strip the path from the names of embedded resources. Fixes
6719         #68519.
6720
6721 2004-11-04  Raja R Harinath  <rharinath@novell.com>
6722
6723         Fix error message regression: cs0104-2.cs.
6724         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6725         (AliasEntry.Resolve): Update.
6726         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
6727         'silent' flag.
6728         (RootContext.LookupType): Update.
6729
6730 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
6731
6732         * cs-parser.jay: Add support for handling accessor modifiers
6733         * class: Add support port accessor modifiers and error checking,
6734         define PropertyMethod.Define as virtual (not abstract anymore)
6735         * ecore.cs: Add checking for proeprties access with access modifiers
6736         * iterators.cs: Modify Accessor constructor call based in the modified
6737         constructor
6738 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
6739
6740         * expression.cs (StringConcat): Handle being called twice,
6741         as when we have a concat in a field init with more than two
6742         ctors in the class
6743
6744 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
6745
6746         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6747         special case explicit implementations, we should always produce
6748         the .property or .event declaration.
6749         
6750         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6751         since it will not return correct data if people use this
6752         unresolved in the presence of using statements (see test-313).
6753
6754         * class.cs (MethodData.Define): If we are an explicit interface
6755         implementation, set the method name to the full name of the
6756         interface plus the name of the method.  
6757
6758         Notice that using the method.MethodName.GetFullName() does not
6759         work, as it will only contain the name as declared on the source
6760         file (it can be a shorthand in the presence of using statements)
6761         and not the fully qualifed type name, for example:
6762
6763         using System;
6764
6765         class D : ICloneable {
6766                 object ICloneable.Clone ()  {
6767                 }
6768         }
6769
6770         Would produce a method called `ICloneable.Clone' instead of
6771         `System.ICloneable.Clone'.
6772
6773         * namespace.cs (Alias.Resolve): Use GetPartialName.
6774         
6775 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6776
6777         * cs-parser.jay: Add error 1055 report.
6778
6779 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
6780
6781         * assign.cs (Assign.DoResolve): Only do the transform of
6782         assignment into a New if the types are compatible, if not, fall
6783         through and let the implicit code deal with the errors and with
6784         the necessary conversions. 
6785
6786 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6787
6788         * cs-parser.jay: Add error 1031 report.
6789
6790         * cs-tokenizer.cs: Add location for error 1038.
6791
6792 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6793
6794         * cs-parser.jay: Add error 1016 report.
6795
6796 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6797
6798         * cs-parser.jay: Add errors 1575,1611 report.
6799
6800 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6801
6802         * cs-parser.jay: Add error 1001 report.
6803
6804 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6805
6806         Fix #68850
6807         * attribute.cs (GetMarshal): Add method argument for
6808         caller identification.
6809
6810         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
6811         agument for GetMarshal and RuntimeMissingSupport.
6812
6813 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6814
6815         * attribute.cs (ExtractSecurityPermissionSet): Removed
6816         TypeManager.code_access_permission_type.
6817
6818         * typemanager.cs: Removed TypeManager.code_access_permission_type.
6819
6820 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
6821
6822         * expression.cs (LocalVariableReference.DoResolveLValue): Check
6823         for obsolete use of a variable here.   Fixes regression on errors
6824         cs0619-25 and cs0619-26.
6825
6826 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
6827
6828         Fix #62358, implemented security attribute encoding.
6829
6830         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
6831         Tests permitted SecurityAction for assembly or other types.
6832         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
6833         data from SecurityPermissionAttribute to PermisionSet class.
6834
6835         * class.cs (ApplyAttributeBuilder): Added special handling
6836         for System.Security.Permissions.SecurityAttribute based types.
6837
6838         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
6839         special handling for System.Security.Permissions.SecurityAttribute
6840         based types.
6841
6842         * enum.cs (ApplyAttributeBuilder): Added special handling
6843         for System.Security.Permissions.SecurityAttribute based types.
6844
6845         * parameter.cs (ApplyAttributeBuilder): Added special handling
6846         for System.Security.Permissions.SecurityAttribute based types.
6847
6848         * rootcontext.cs: Next 2 core types.
6849
6850         * typemanager.cs (TypeManager.security_permission_attr_type):
6851         Built in type for the SecurityPermission Attribute.
6852         (code_access_permission_type): Build in type.
6853
6854 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
6855
6856         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
6857         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
6858         all of this information into
6859         EmitContext.EmitCapturedVariableInstance.
6860         
6861         * codegen.cs (EmitCapturedVariableInstance): move here the
6862         funcionality of emitting an ldarg.0 in the presence of a
6863         remapping.   This centralizes the instance emit code.
6864
6865         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
6866         then emit a load of this: it means that we have reached the
6867         topmost ScopeInfo: the one that contains the pointer to the
6868         instance of the class hosting the anonymous method.
6869
6870         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
6871         captures to the topmost CaptureContext.
6872
6873 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
6874
6875         * expression.cs (LocalVariableReference): Move the knowledge about
6876         the iterators into codegen's EmitCapturedVariableInstance.
6877
6878 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
6879
6880         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
6881         all code paths return a value from an anonymous method (it is the
6882         same as the 161 error, but for anonymous methods).
6883
6884 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
6885
6886         The introduction of anonymous methods in the compiler changed
6887         various ways of doing things in the compiler.  The most
6888         significant one is the hard split between the resolution phase
6889         and the emission phases of the compiler.
6890
6891         For instance, routines that referenced local variables no
6892         longer can safely create temporary variables during the
6893         resolution phase: they must do so from the emission phase,
6894         since the variable might have been "captured", hence access to
6895         it can not be done with the local-variable operations from the runtime.
6896         
6897         * statement.cs 
6898
6899         (Block.Flags): New flag `IsTopLevel' to indicate that this block
6900         is a toplevel block.
6901
6902         (ToplevelBlock): A new kind of Block, these are the blocks that
6903         are created by the parser for all toplevel method bodies.  These
6904         include methods, accessors and anonymous methods.
6905
6906         These contain some extra information not found in regular blocks:
6907         A pointer to an optional CaptureContext (for tracking captured
6908         local variables and parameters).  A pointer to the parent
6909         ToplevelBlock.
6910         
6911         (Return.Resolve): Catch missmatches when returning a value from an
6912         anonymous method (error 1662).
6913         Invoke NeedReturnLabel from the Resolve phase instead of the emit
6914         phase.
6915
6916         (Break.Resolve): ditto.
6917
6918         (SwitchLabel): instead of defining the labels during the
6919         resolution phase, we now turned the public ILLabel and ILLabelCode
6920         labels into methods called GetILLabelCode() and GetILLabel() that
6921         only define the label during the Emit phase.
6922
6923         (GotoCase): Track the SwitchLabel instead of the computed label
6924         (its contained therein).  Emit the code by using
6925         SwitchLabel.GetILLabelCode ().
6926
6927         (LocalInfo.Flags.Captured): A new flag has been introduce to track
6928         whether the Local has been captured or not.
6929
6930         (LocalInfo.IsCaptured): New property, used to tell whether the
6931         local has been captured.
6932         
6933         * anonymous.cs: Vastly updated to contain the anonymous method
6934         support.
6935
6936         The main classes here are: CaptureContext which tracks any
6937         captured information for a toplevel block and ScopeInfo used to
6938         track the activation frames for various local variables.   
6939
6940         Each toplevel block has an optional capture context associated
6941         with it.  When a method contains an anonymous method both the
6942         toplevel method and the anonymous method will create a capture
6943         context.   When variables or parameters are captured, they are
6944         recorded on the CaptureContext that owns them, for example:
6945
6946         void Demo () {
6947              int a;
6948              MyDelegate d = delegate {
6949                  a = 1;
6950              }
6951         }
6952
6953         Here `a' will be recorded as captured on the toplevel
6954         CapturedContext, the inner captured context will not have anything
6955         (it will only have data if local variables or parameters from it
6956         are captured in a nested anonymous method.
6957
6958         The ScopeInfo is used to track the activation frames for local
6959         variables, for example:
6960
6961         for (int i = 0; i < 10; i++)
6962                 for (int j = 0; j < 10; j++){
6963                    MyDelegate d = delegate {
6964                         call (i, j);
6965                    }
6966                 }
6967
6968         At runtime this captures a single captured variable `i', but it
6969         captures 10 different versions of the variable `j'.  The variable
6970         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
6971         recorded on a child.  
6972
6973         The toplevel ScopeInfo will also track information like the `this'
6974         pointer if instance variables were referenced (this is necessary
6975         as the anonymous method lives inside a nested class in the host
6976         type of the method). 
6977
6978         (AnonymousMethod): Expanded to track the Toplevel, implement
6979         `AnonymousMethod.Compatible' to tell whether an anonymous method
6980         can be converted to a target delegate type. 
6981
6982         The routine now also produces the anonymous method content
6983
6984         (AnonymousDelegate): A helper class that derives from
6985         DelegateCreation, this is used to generate the code necessary to
6986         produce the delegate for the anonymous method that was created. 
6987
6988         * assign.cs: API adjustments for new changes in
6989         Convert.ImplicitStandardConversionExists.
6990
6991         * class.cs: Adjustments to cope with the fact that now toplevel
6992         blocks are of type `ToplevelBlock'. 
6993
6994         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
6995         insteda of standard blocks.
6996
6997         Flag errors if params arguments are passed to anonymous methods.
6998
6999         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7000         `CurrentAnonymousMethod' which points to the current Anonymous
7001         Method.  The variable points to the AnonymousMethod class that
7002         holds the code being compiled.  It is set in the new EmitContext
7003         created for the anonymous method.
7004
7005         (EmitContext.Phase): Introduce a variable and an enumeration to
7006         assist in enforcing some rules about when and where we are allowed
7007         to invoke certain methods (EmitContext.NeedsReturnLabel is the
7008         only one that enfonces this right now).
7009
7010         (EmitContext.HaveCaptureInfo): new helper method that returns
7011         whether we have a CapturedContext initialized.
7012
7013         (EmitContext.CaptureVariable): New method used to register that a
7014         LocalInfo must be flagged for capturing. 
7015
7016         (EmitContext.CapturedParameter): New method used to register that a
7017         parameters must be flagged for capturing. 
7018         
7019         (EmitContext.CapturedField): New method used to register that a
7020         field must be flagged for capturing. 
7021
7022         (EmitContext.HaveCapturedVariables,
7023         EmitContext.HaveCapturedFields): Return whether there are captured
7024         variables or fields. 
7025
7026         (EmitContext.EmitMethodHostInstance): This is used to emit the
7027         instance for the anonymous method.  The instance might be null
7028         (static methods), this (for anonymous methods that capture nothing
7029         and happen to live side-by-side with the current method body) or a
7030         more complicated expression if the method has a CaptureContext.
7031
7032         (EmitContext.EmitTopBlock): Routine that drives the emission of
7033         code: it will first resolve the top block, then emit any metadata
7034         and then emit the code.  The split is done so that we can extract
7035         any anonymous methods and flag any captured variables/parameters.
7036         
7037         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7038         during this phase, the ILGenerator should not be used as labels
7039         and local variables declared here might not be accessible to any
7040         code that is part of an anonymous method.  
7041
7042         Exceptions to this include the temporary variables that are
7043         created by some statements internally for holding temporary
7044         variables. 
7045         
7046         (EmitContext.EmitMeta): New routine, in charge of emitting all the
7047         metadata for a cb
7048
7049         (EmitContext.TemporaryReturn): This method is typically called
7050         from the Emit phase, and its the only place where we allow the
7051         ReturnLabel to be defined other than the EmitMeta.  The reason is
7052         that otherwise we would have to duplicate a lot of logic in the
7053         Resolve phases of various methods that today is on the Emit
7054         phase. 
7055
7056         (EmitContext.NeedReturnLabel): This no longer creates the label,
7057         as the ILGenerator is not valid during the resolve phase.
7058
7059         (EmitContext.EmitThis): Extended the knowledge in this class to
7060         work in anonymous methods in addition to iterators. 
7061
7062         (EmitContext.EmitCapturedVariableInstance): This emits whatever
7063         code is necessary on the stack to access the instance to a local
7064         variable (the variable will be accessed as a field).
7065
7066         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7067         EmitContext.EmitAddressOfParameter): Routines to support
7068         parameters (not completed at this point). 
7069         
7070         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
7071         will also remove the parameters.
7072
7073         * convert.cs (Convert): Define a `ConstantEC' which points to a
7074         null.  This is just to prefity some code that uses
7075         ImplicitStandardConversion code and do not have an EmitContext
7076         handy.
7077
7078         The idea is to flag explicitly that at that point in time, it is
7079         known that the conversion will not trigger the delegate checking
7080         code in implicit conversions (which requires a valid
7081         EmitContext). 
7082
7083         Everywhere: pass new EmitContext parameter since
7084         ImplicitStandardConversionExists now requires it to check for
7085         anonymous method conversions. 
7086
7087         (Convert.ImplicitStandardConversionExists): If the type of an
7088         expression is the anonymous_method_type, and the type is a
7089         delegate, we invoke the AnonymousMethod.Compatible method to check
7090         whether an implicit conversion is possible. 
7091
7092         (Convert.ImplicitConversionStandard): Only do implicit method
7093         group conversions if the language level is not ISO_1.
7094
7095         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7096         MethodInfo for the Invoke method.  used by Delegate and
7097         AnonymousDelegate.
7098
7099         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7100         method conversions if the target type is a delegate.
7101
7102         Removed extra debugging nops.
7103
7104         (LocalVariableReference): Turn the `local_info' into a public
7105         field. 
7106
7107         Add `prepared' field, the same hack used for FieldExprs to cope
7108         with composed assignments, as Local variables do not necessarily
7109         operate purely on the stack as they used to: they can be captured
7110         fields. 
7111
7112         Add `temp' for a temporary result, like fields.
7113
7114         Refactor DoResolve and DoResolveLValue into DoResolveBase.
7115
7116         It now copes with Local variables that are captured and emits the
7117         proper instance variable to load it from a field in the captured
7118         case. 
7119
7120         (ParameterReference.DoResolveBase): During the resolve phase,
7121         capture parameters if we are in an anonymous method.
7122
7123         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7124         anonymous method, use the EmitContext helper routines to emit the
7125         parameter reference.
7126
7127         * iterators.cs: Set RemapToProxy to true/false during the
7128         EmitDispose class.
7129
7130         * parameters.cs (GetParameterByName): New helper method. 
7131
7132         * typemanager.cs (anonymous_method_type) a new type that
7133         represents an anonyous method.  This is always an internal type,
7134         used as a fencepost to test against the anonymous-methodness of an
7135         expression. 
7136         
7137 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
7138
7139         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7140         561 report.
7141         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7142
7143 2004-11-10  Martin Baulig  <martin@ximian.com>
7144
7145         * expression.cs (Invocation.BetterFunction): If two methods have
7146         equal parameter types, but only one of them is generic, the
7147         non-generic one wins.
7148         (New.DoResolve): Don't set `is_struct' to false if we're a generic
7149         instance; just use `Type.IsValueType' to determine whether
7150         something is a struct or not.
7151         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
7152         so we can be called multiple times.
7153
7154 2004-11-10  Martin Baulig  <martin@ximian.com>
7155
7156         * generic.cs (TypeParameter.DefineConstraints): New public method.
7157         (TypeParameter.CheckAccessLevel): Override this and return true.
7158         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
7159         override ResolveType() anymore.
7160         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
7161
7162 2004-11-10  Martin Baulig  <martin@ximian.com>
7163
7164         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
7165         call DeclSpace.ResolveNestedType() on it.
7166
7167 2004-11-10  Martin Baulig  <martin@ximian.com>
7168
7169         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
7170         non-null, call ParameterModifier() on it.
7171
7172 2004-11-10  Martin Baulig  <martin@ximian.com>
7173
7174         * iterators.cs
7175         (Iterators): Added `current_type' and `this_type' fields.
7176         (Iterators.DefineIterator): Create a new EmitContext and store it
7177         in `ec'; compute `this_type'.
7178
7179 2004-11-10  Martin Baulig  <martin@ximian.com>
7180
7181         * typemanager.cs
7182         (TypeManager.IsPrivateAccessible): New public method.
7183         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
7184
7185 2004-11-10  Martin Baulig  <martin@ximian.com>
7186
7187         * class.cs (TypeContainer.DefineType): Call
7188         TypeBuilder.DefineGenericParameters() before resolving the type
7189         parameters.
7190         (MethodData.parent_method): New protected field.
7191         (MethodData..ctor): Added `MethodInfo parent_method' argument.
7192         (MethodData.Define): Compute `parent_method'.
7193
7194         * decl.cs
7195         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7196         (MemberCore.GetClsCompliantAttributeValue): Likewise.
7197         (DeclSpace.ec): New protected field; store the EmitContext here.
7198         (DeclSpace.EmitContext): New public property.
7199         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
7200         (DeclSpace.ResolveNestedType): New public method.
7201         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
7202         (DeclSpace.NestedAccessible): Added `Type tb' argument.
7203         (DeclSpace.FamilyAccessible): Likewise.
7204         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
7205         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7206         EmitContext.
7207
7208         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
7209         field.
7210
7211         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7212         (Enum.Emit): Don't create a new EmitContext.
7213
7214 2004-10-18  Martin Baulig  <martin@ximian.com>
7215
7216         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7217         `Type' directly, but call ResolveType() on it.
7218         (Catch.Resolve): Likewise.
7219         (Foreach.Resolve): Likewise.
7220
7221 2004-10-18  Martin Baulig  <martin@ximian.com>
7222
7223         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7224         `Type' directly, but call ResolveType() on it.
7225         (Probe.DoResolve): Likewise.
7226         (ArrayCreation.LookupType): Likewise.
7227         (TypeOf.DoResolve): Likewise.
7228         (SizeOf.DoResolve): Likewise.
7229
7230 2004-10-18  Raja R Harinath  <rharinath@novell.com>
7231
7232         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7233         the ResolveType.
7234
7235 2004-10-17  John Luke  <john.luke@gmail.com>
7236
7237         * class.cs (Operator.GetSignatureForError): use CSharpName
7238
7239         * parameter.cs (Parameter.GetSignatureForError): Returns
7240         correct name even if was not defined.
7241
7242 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7243
7244         Fix #65816.
7245         * class.cs (TypeContainer.EmitContext): New property.
7246         (DefineNestedTypes): Create an emitcontext for each part.
7247         (MethodCore.DoDefineParameters): Use container's emitcontext.
7248         Pass type array to InternalParameters.
7249         (MemberBase.DoDefine): Use container's emitcontext.
7250         (FieldMember.Define): Likewise.
7251         (Event.Define): Likewise.
7252         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7253         Pass type array to InternalParameters.
7254         (SetIndexerMethod.GetParameterInfo): Likewise.
7255         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7256         * delegate.cs (Define): Pass emitcontext to
7257         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7258         array to InternalParameters.
7259         * expression.cs (ParameterReference.DoResolveBase): Pass
7260         emitcontext to GetParameterInfo.
7261         (ComposedCast.DoResolveAsTypeStep): Remove check on
7262         ec.ResolvingTypeTree.
7263         * parameter.cs (Parameter.Resolve): Change argument to
7264         EmitContext.  Use ResolveAsTypeTerminal.
7265         (Parameter.GetSignature): Change argument to EmitContext.
7266         (Parameters.ComputeSignature): Likewise.
7267         (Parameters.ComputeParameterTypes): Likewise.
7268         (Parameters.GetParameterInfo): Likewise.
7269         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7270         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7271         * support.cs (InternalParameters..ctor): Remove variant that takes
7272         a DeclSpace.
7273         * typemanager.cs (system_intptr_expr): New.
7274         (InitExpressionTypes): Initialize it.
7275
7276 2004-10-12  Chris Toshok  <toshok@ximian.com>
7277
7278         * cs-parser.jay: fix location for try_statement and catch_clause.
7279
7280 2004-10-18  Martin Baulig  <martin@ximian.com>
7281
7282         * class.cs (FieldMember.Define): Don't access the TypeExpr's
7283         `Type' directly, but call ResolveType() on it.
7284         (MemberBase.DoDefine): Likewise.
7285
7286         * expression.cs (New.DoResolve): Don't access the TypeExpr's
7287         `Type' directly, but call ResolveType() on it.
7288         (ComposedCast.DoResolveAsTypeStep): Likewise.
7289
7290         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7291         `Type' directly, but call ResolveType() on it.
7292
7293 2004-10-17  John Luke  <john.luke@gmail.com>
7294
7295         * class.cs (Operator.GetSignatureForError): use CSharpName
7296
7297         * parameter.cs (Parameter.GetSignatureForError): Returns
7298         correct name even if was not defined.
7299
7300 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7301
7302         Fix #65816.
7303         * class.cs (TypeContainer.EmitContext): New property.
7304         (DefineNestedTypes): Create an emitcontext for each part.
7305         (MethodCore.DoDefineParameters): Use container's emitcontext.
7306         Pass type array to InternalParameters.
7307         (MemberBase.DoDefine): Use container's emitcontext.
7308         (FieldMember.Define): Likewise.
7309         (Event.Define): Likewise.
7310         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7311         Pass type array to InternalParameters.
7312         (SetIndexerMethod.GetParameterInfo): Likewise.
7313         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7314         * delegate.cs (Define): Pass emitcontext to
7315         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7316         array to InternalParameters.
7317         * expression.cs (ParameterReference.DoResolveBase): Pass
7318         emitcontext to GetParameterInfo.
7319         (ComposedCast.DoResolveAsTypeStep): Remove check on
7320         ec.ResolvingTypeTree.
7321         * parameter.cs (Parameter.Resolve): Change argument to
7322         EmitContext.  Use ResolveAsTypeTerminal.
7323         (Parameter.GetSignature): Change argument to EmitContext.
7324         (Parameters.ComputeSignature): Likewise.
7325         (Parameters.ComputeParameterTypes): Likewise.
7326         (Parameters.GetParameterInfo): Likewise.
7327         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7328         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7329         * support.cs (InternalParameters..ctor): Remove variant that takes
7330         a DeclSpace.
7331         * typemanager.cs (system_intptr_expr): New.
7332         (InitExpressionTypes): Initialize it.
7333
7334 2004-10-12  Chris Toshok  <toshok@ximian.com>
7335
7336         * cs-parser.jay: fix location for try_statement and catch_clause.
7337
7338 2004-10-07  Raja R Harinath  <rharinath@novell.com>
7339
7340         More DeclSpace.ResolveType avoidance.
7341         * decl.cs (MemberCore.InUnsafe): New property.
7342         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
7343         with newly created EmitContext.
7344         (FieldMember.Define): Likewise.
7345         * delegate.cs (Delegate.Define): Likewise.
7346         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7347         only if normal name-lookup fails.
7348         (TypeExpr.DoResolve): Enable error-checking.
7349         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7350         (SizeOf.DoResolve): Likewise.
7351         (ComposedCast.DoResolveAsTypeStep): Likewise.
7352         (StackAlloc.DoResolve): Likewise.
7353         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7354         (Block.Unsafe): New property.
7355         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7356         (Unsafe): Set 'unsafe' flag of contained block.
7357         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7358         (Fixed.Resolve): Likewise.
7359         (Catch.Resolve): Likewise.
7360         (Using.ResolveLocalVariableDecls): Likewise.
7361         (Foreach.Resolve): Likewise.
7362
7363 2004-10-05  John Luke <john.luke@gmail.com>
7364
7365         * cs-parser.jay: add location to error CS0175
7366
7367 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
7368
7369         * ecore.cs (Expression.Constantity): Add support for turning null
7370         into a constant.
7371
7372         * const.cs (Const.Define): Allow constants to be reference types
7373         as long as the value is Null.
7374
7375 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
7376
7377         * namespace.cs (NamespaceEntry.Using): No matter which warning
7378         level is set, check if this namespace name has already been added.
7379
7380 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
7381
7382         * expression.cs: reftype [!=]= null should always use br[true,false].
7383         # 67410
7384
7385 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
7386
7387         Fix #67108
7388         * attribute.cs: Enum conversion moved to 
7389         GetAttributeArgumentExpression to be applied to the all
7390         expressions.
7391
7392 2004-10-01  Raja R Harinath  <rharinath@novell.com>
7393
7394         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7395         * class.c (TypeContainer.DefineType): Flag error if
7396         base types aren't accessible due to access permissions.
7397         * decl.cs (DeclSpace.ResolveType): Move logic to
7398         Expression.ResolveAsTypeTerminal.
7399         (DeclSpace.ResolveTypeExpr): Thin layer over
7400         Expression.ResolveAsTypeTerminal.
7401         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7402         Refactor code into NestedAccess.  Use it.
7403         (DeclSpace.NestedAccess): New.
7404         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7405         argument to silence errors.  Check access permissions.
7406         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7407         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7408         (Cast.DoResolve): Likewise.
7409         (New.DoResolve): Likewise.
7410         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7411         (TypeOf.DoResolve): Likewise.
7412
7413         * expression.cs (Invocation.BetterConversion): Return the Type of
7414         the better conversion.  Implement section 14.4.2.3 more faithfully.
7415         (Invocation.BetterFunction): Make boolean.  Make correspondence to
7416         section 14.4.2.2 explicit.
7417         (Invocation.OverloadResolve): Update.
7418         (Invocation): Remove is_base field.
7419         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
7420         (Invocation.Emit): Likewise.
7421
7422 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
7423
7424         * cs-parser.jay: Reverted 642 warning fix.
7425
7426 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7427
7428         Fix bug #66615
7429         * decl.cs (FindMemberWithSameName): Indexer can have more than
7430         1 argument.
7431
7432 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7433
7434         * expression.cs (LocalVariableReference.DoResolveLValue):
7435         Do not report warning 219 for out values.
7436         (EmptyExpression.Null): New member to avoid extra allocations.
7437
7438 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7439
7440         * cs-parser.jay: Fix wrong warning 642 report.
7441
7442         * cs-tokenizer.cs (CheckNextToken): New helper;
7443         Inspect next character if is same as expected.
7444
7445 2004-09-23  Martin Baulig  <martin@ximian.com>
7446
7447         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7448         (Convert.ImplicitReferenceConversionExists): Likewise.
7449
7450 2004-11-09  Raja R Harinath  <rharinath@novell.com>
7451
7452         * Makefile (DISTFILES): Comment out a few missing files.
7453
7454 2004-10-29  Raja R Harinath  <rharinath@novell.com>
7455
7456         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
7457         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
7458         (gmcs.exe): Invoke bootstrap-libs.
7459         (clean-local): Clean the net_2_0_bootstrap profile too.
7460         (PROGRAM_INSTALL_DIR): New.
7461         (install-local): Use it.
7462
7463 2004-10-13  Martin Baulig  <martin@ximian.com>
7464
7465         * generic.cs (TypeManager.InflatedConstraints): New nested class.
7466         (TypeParameter.DefineType): If we're a method type parameter and
7467         that method is overriding something, "inflate" its constraints.
7468
7469 2004-10-12  Martin Baulig  <martin@ximian.com>
7470
7471         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
7472         and have type arguments, create and resolve a ConstructedType.
7473
7474 2004-10-12  Martin Baulig  <martin@ximian.com>
7475
7476         * decl.cs (MemberCache.FindMemberToOverride): Use
7477         TypeManager.IsEqual() to compare the parameters and Type.Equals()
7478         to compare the invocationType.
7479
7480         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
7481         When comparing two type parameters, only do the signature-only
7482         comparision for method type parameters.
7483
7484 2004-10-11  Martin Baulig  <martin@ximian.com>
7485
7486         * report.cs: Don't make --fatal abort on warnings, we have
7487         -warnaserror for that.
7488
7489 2004-10-11  Martin Baulig  <martin@ximian.com>
7490
7491         * typemanager.cs
7492         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
7493         (TypeManager.IsEqual): Call ourself recursively instead of using
7494         Type.IsEqual(). 
7495
7496 2004-10-11  Martin Baulig  <martin@ximian.com>
7497
7498         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
7499         on our own type parameters, not on the ones we inherit from a containing
7500         class.
7501
7502         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
7503         the comparision.
7504
7505         * generic.cs (TypeParameter.Define): We may only be called once.
7506
7507         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
7508         instead of TypeManager.IsEqual().
7509
7510 2004-09-28  Martin Baulig  <martin@ximian.com>
7511
7512         * generic.cs
7513         (GenericConstraints.EffectiveBaseClass): New public property.
7514         (TypeParameter.GenericConstraints): New public property.
7515         (ConstructedType.CheckConstraints): Improved.
7516
7517         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
7518         (Convert.TypeParameterConversion): New private method; use this in
7519         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
7520         for all conversions related to type parameters.
7521
7522 2004-09-24  Martin Baulig  <martin@ximian.com>
7523
7524         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
7525         type parameter conversions for type parameters which are known to
7526         be reference types.
7527
7528 2004-09-24  Martin Baulig  <martin@ximian.com>
7529
7530         * generic.cs (GenericConstraints): Added `IsReferenceType' and
7531         `IsValueType' properties.
7532
7533         * support.cs (ReflectionConstraints): Use
7534         Type.GetGenericParameterConstraints() instead of the old hack.
7535
7536 2004-09-24  Martin Baulig  <martin@ximian.com>
7537
7538         * generic.cs (GenericConstraints): Moved here and made it an
7539         abstract class.
7540
7541         * support.cs (GenericConstraints): Moved to generic.cs.
7542
7543 2004-09-24  Martin Baulig  <martin@ximian.com>
7544
7545         * support.cs
7546         (ReflectionConstraints): Un-nested this class and made it public.
7547
7548         * typemanager.cs
7549         (TypeManager.GetTypeParameterConstraints): New public method.
7550         (TypeManager.HasConstructorConstraint): Use the attributes.
7551
7552 2004-09-24  Martin Baulig  <martin@ximian.com>
7553
7554         * support.cs (GenericConstraints): Replaced `HasConstructor',
7555         `IsReferenceType' and `IsValueType' with `Attributes'.
7556         (ReflectionParameters.ReflectionConstraints): Removed the Create()
7557         method and made the .ctor public.
7558
7559         * generic.cs (Constraints.Attributes): New public property.
7560         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
7561         `IsReferenceType' -> `HasReferenceTypeConstraint' and
7562         `IsValueType' -> `HasValueTypeConstraint'.
7563
7564 2004-09-23  Martin Baulig  <martin@ximian.com>
7565
7566         * generic.cs (Constraints): Reflect latest runtime changes.
7567
7568 2004-09-23  Martin Baulig  <martin@ximian.com>
7569
7570         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7571         (Convert.ImplicitReferenceConversionExists): Likewise.
7572
7573 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7574
7575         * class.cs (Operator.Define): Add error 448 and 559 report.
7576         
7577 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7578
7579         * class.cs (MemberBase.IsTypePermitted): New protected
7580         method for checking error CS0610.
7581
7582 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7583
7584         * class.cs (TypeContainer.HasExplicitLayout): New property
7585         Returns whether container has StructLayout attribute set Explicit.
7586         (FieldMember): New abstract class for consts and fields.
7587         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7588         (Field): Reuse FieldMember.
7589
7590         * const.cs (Const): Reuse FieldMember.
7591
7592         * rootcontext.cs: EmitConstants call moved to class.
7593
7594 2004-09-22  Martin Baulig  <martin@ximian.com>
7595
7596         Marek and me just fixed one of our oldest bugs: #28562 :-)
7597
7598         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7599
7600         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7601         we're an EnumConstant, just return that.
7602         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7603         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
7604         to get the value which'll actually be written into the attribute.
7605         However, we have to use GetValue() to access the attribute's value
7606         in the compiler.        
7607
7608 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7609
7610         * constant.cs (Constant.IsNegative): New abstract property
7611         IsNegative.
7612
7613         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7614         (StackAlloc.DoResolve): Reused IsNegative.
7615
7616 2004-09-22  Martin Baulig  <martin@ximian.com>
7617
7618         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
7619         public method; like LookupTypeContainer, but also works for
7620         generic instances.
7621
7622         * report.cs (Report.SymbolRelatedToPreviousError): Use
7623         TypeManager.LookupGenericTypeContainer().       
7624
7625 2004-09-22  Martin Baulig  <martin@ximian.com>
7626
7627         Thanks to Peter Sestoft for this bug report.
7628
7629         * expression.cs (Conditional): If both the `trueExpr' and the
7630         `falseExpr' is a NullLiteral, return a NullLiteral.
7631
7632 2004-09-22  Martin Baulig  <martin@ximian.com>
7633
7634         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7635         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7636         for the "get_Current" call.
7637
7638 2004-09-21  Martin Baulig  <martin@ximian.com>
7639
7640         * convert.cs (Convert.ImplicitReferenceConversion): When
7641         converting to an interface type, first check whether we're
7642         converting from a reference type.
7643
7644 2004-09-14  Martin Baulig  <martin@ximian.com>
7645
7646         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7647
7648 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7649
7650         Fixed bug #61902
7651         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7652         called and is obsolete then this member suppress message
7653         when call is inside next [Obsolete] method or type.
7654
7655         * expression.cs: Use TestObsoleteMethodUsage member.
7656
7657 2004-09-14  Martin Baulig  <martin@ximian.com>
7658
7659         * genericparser.cs: Removed.
7660
7661 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
7662
7663         * class.cs (MethodCore.CheckBase): Fix bug #65757.
7664
7665 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
7666
7667         * attribute.cs (Attribute.Resolve): Add error 653 report.
7668
7669         * class.cs (Class.ApplyAttributeBuilder): Add error 641
7670         report.
7671         (Method.ApplyAttributeBuilder): Add error 685 report.
7672         (Operator.Define): Add error 564 report.
7673
7674         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7675
7676         * expression.cs (Invocation.DoResolve): Add error
7677         245 and 250 report.
7678
7679         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7680         error 674 report.
7681
7682 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7683
7684         * class.cs (ConstructorInitializer.Resolve):
7685         Wrong error number (515->516).
7686
7687 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7688
7689         * class.cs (Indexer.Define): Add error 631 report.
7690
7691 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7692
7693         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7694
7695 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7696
7697         * expression.cs (Probe.DoResolve): Add error CS0241 report.
7698
7699 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
7700
7701         * cs-parser.jay: Added error CS0241 report.
7702
7703 2004-09-10  Raja R Harinath  <rharinath@novell.com>
7704
7705         * cs-parser.jay (fixed_statement): Introduce a scope for the
7706         declaration in the 'fixed' statement.
7707
7708 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7709
7710         * cs-parser.jay: Added CS0230 error report.
7711
7712 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7713
7714         * cs-parser.jay: Added errors CS0231 and CS0257 report.
7715
7716 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7717
7718         * expression.cs (Argument.Resolve): Added error CS0192 and
7719         CS0199 report.
7720
7721 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7722
7723         C# 2.0 #pragma warning feature
7724
7725         * cs-tokenizer.cs (PreProcessPragma): New method; 
7726         Handles #pragma directive.
7727
7728         * report.cs (WarningRegions): New class; Support
7729         class for #pragma warning directive. It tests whether
7730         warning is enabled for a given line.
7731
7732 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
7733
7734         * const.cs: Add more descriptive error report, tahnks to
7735         Sebastien. 
7736
7737 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
7738
7739         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7740
7741 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
7742
7743         * expression.cs: Apply patch from Ben: Remove dead code from
7744         ArrayCreation, and remove the TurnintoConstant call in const.cs,
7745         as that code just threw an exception anwyays.
7746
7747         * const.cs: Remove the call to the turnintoconstant, for details
7748         see bug: #63144
7749         
7750         * literal.cs: The type of the null-literal is the null type;  So
7751         we use a placeholder type (literal.cs:System.Null, defined here)
7752         for it.
7753
7754         * expression.cs (Conditional.DoResolve): Remove some old code that
7755         is no longer needed, conversions have been fixed.
7756
7757         (ArrayCreationExpression.DoResolve): Return false if we fail to
7758         resolve the inner expression.
7759
7760 2004-09-07  Raja R Harinath  <rharinath@novell.com>
7761
7762         Fix test-290.cs.
7763         * cs-parser.jay (delegate_declaration): Record a delegate
7764         declaration as a type declaration.
7765         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7766
7767 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
7768
7769         * parameter.cs: Do not crash if the type can not be resolved. 
7770
7771         * expression.cs: Report errors with unsafe pointers, fixes #64896
7772
7773 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7774
7775         * expression.cs: Pointer arith always needs to do a conv.i
7776         if the operand is a long. fix 65320
7777
7778 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7779
7780         Fixed cs0619-37.cs, cs0619-38.cs
7781
7782         * enum.cs (GetObsoleteAttribute): Removed.
7783
7784         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7785         on Enum member is double staged. The first is tested member
7786         and then enum.
7787
7788 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7789
7790         Fixed #56986, #63631, #65231
7791
7792         * class.cs: (TypeContainer.AddToMemberContainer): New method,
7793         adds member to name container.
7794         (TypeContainer.AddToTypeContainer): New method, adds type to
7795         name container.
7796         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
7797         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
7798         AddOperator): Simplified by reusing AddToMemberContainer.
7799         (TypeContainer.UserDefinedStaticConstructor): Changed to property
7800         instead of field.
7801         (Method.CheckForDuplications): Fixed implementation to test all
7802         possibilities.
7803         (MemberBase): Detection whether member is explicit interface
7804         implementation is now in constructor.
7805         (MemberBase.UpdateMemberName): Handles IndexerName.
7806         (Accessor): Changed to keep also location information.
7807         (AbstractPropertyEventMethod): Is derived from MemberCore.
7808         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
7809         will be emited or not.
7810         (PropertyBase.AreAccessorsDuplicateImplementation):
7811         Tests whether accessors are not in collision with some method.
7812         (Operator): Is derived from MethodCore to simplify common
7813         operations.
7814
7815         * decl.cs (Flags.TestMethodDuplication): Test for duplication
7816         must be performed.
7817         (DeclSpace.AddToContainer): Adds the member to defined_names
7818         table. It tests for duplications and enclosing name conflicts.
7819
7820         * enum.cs (EnumMember): Clean up to reuse the base structures
7821
7822 2004-09-03  Martin Baulig  <martin@ximian.com>
7823
7824         Merged latest changes into gmcs.  Please keep this comment in
7825         here, it makes it easier for me to see what changed in MCS since
7826         the last time I merged.
7827
7828 2004-09-03  Martin Baulig  <martin@ximian.com>
7829
7830         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7831         into TypeContainer, to make partial classes work again.
7832
7833 2004-09-03  Martin Baulig  <martin@ximian.com>
7834
7835         * rootcontext.cs (RootContext.V2): Removed.
7836
7837 2004-03-23  Martin Baulig  <martin@ximian.com>
7838
7839         * expression.cs (Invocation.OverloadResolve): Added `bool
7840         may_fail' argument and use it instead of the Location.IsNull() hack.
7841
7842 2004-09-09  Martin Baulig  <martin@ximian.com>
7843
7844         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
7845
7846 2004-09-09  Martin Baulig  <martin@ximian.com>
7847
7848         * generic.cs (TypeParameter.DefineType): Added support for
7849         explicit interface methods.
7850
7851 2004-09-09  Martin Baulig  <martin@ximian.com>
7852
7853         * README.Changes: New document.  Started to list important changes
7854         between MCS and GMCS here.
7855
7856 2004-09-08  Martin Baulig  <martin@ximian.com>
7857
7858         * class.cs
7859         (TypeContainer.CheckRecursiveDefinition): New protected method.
7860         (TypeContainer.DefineType): Move the CS0146 check into
7861         CheckRecursiveDefinition().     
7862
7863 2004-09-06  Martin Baulig  <martin@ximian.com>
7864
7865         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
7866         types for the constructor constraint.
7867
7868 2004-09-03  Martin Baulig  <martin@ximian.com>
7869
7870         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7871         into TypeContainer, to make partial classes work again.
7872
7873 2004-09-03  Martin Baulig  <martin@ximian.com>
7874
7875         * rootcontext.cs (RootContext.V2): Removed.
7876
7877 2004-03-23  Martin Baulig  <martin@ximian.com>
7878
7879         * expression.cs (Invocation.OverloadResolve): Added `bool
7880         may_fail' argument and use it instead of the Location.IsNull() hack.
7881
7882 2004-09-03  Martin Baulig  <martin@ximian.com>
7883
7884         Merged latest changes into gmcs.  Please keep this comment in
7885         here, it makes it easier for me to see what changed in MCS since
7886         the last time I merged.
7887
7888 2004-09-03  Raja R Harinath  <rharinath@novell.com>
7889
7890         Fix #61128.
7891         * expression.cs (BetterConversion): Don't allow either conversion 
7892         to be null.  Remove redundant implicit conversion test when 'q ==
7893         null' -- when this function is invoked, we already know that the
7894         implicit conversion exists.
7895         (BetterFunction): Assume that 'best' is non-null.  Remove
7896         redundant reimplementation of IsApplicable when 'best' is null.
7897         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
7898         number of arguments.
7899         (IsAncestralType): Extract from OverloadResolve.
7900         (OverloadResolve): Make robust to the MethodGroupExpr being
7901         unsorted.  Implement all the logic of Section 14.5.5.1, and
7902         support overloading of methods from multiple applicable types.
7903         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
7904
7905         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
7906         (RealError, Warning): Append type of report to related symbol.
7907
7908 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
7909
7910         * enum.cs: Fixed CLS-Compliance checks for enum members.
7911         Error tests cs3008-8.cs, cs3014-8.cs
7912
7913 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
7914
7915         Fixed bug #62342, #63102
7916         * class.cs: ImplementIndexer uses member.IsExplicitImpl
7917         like ImplementMethod.
7918
7919 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
7920
7921         * attribute.cs (Attribute.GetAttributeArgumentExpression):
7922         Fixed bug #65170.
7923
7924 2004-09-02  Martin Baulig  <martin@ximian.com>
7925
7926         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7927         TypeManager.GetArgumentTypes() rather than calling GetParameters()
7928         on the MethodBase.
7929
7930 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
7931
7932         C# 2.0 Static classes implemented
7933
7934         * class.cs (TypeContainer): instance_constructors,
7935         initialized_fields, initialized_static_fields,
7936         default_constructor, base_inteface_types are protected to be
7937         accessible from StaticClass.
7938         (TypeContainer.DefineDefaultConstructor): New virtual method
7939         for custom default constructor generating
7940         (StaticClass): New class to handle "Static classes" feature.
7941
7942         * cs-parser.jay: Handle static keyword on class like instance
7943         of StaticClass.
7944
7945         * driver.cs: Added "/langversion" command line switch with two
7946         options (iso-1, default).
7947
7948 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
7949
7950         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
7951
7952 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
7953
7954         * delegate.cs: Style.
7955
7956 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7957
7958         * delegate.cs: Add seperate instance expr field for miguel.
7959
7960 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7961
7962         * PointerArithmetic (Resolve): make sure we are not doing
7963         pointer arith on void*. Also, make sure we are resolved
7964         by not setting eclass until resolve.
7965
7966         All callers: Make sure that PointerArithmetic gets resolved.
7967
7968 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7969
7970         * ArrayCreation (LookupType): If the type does not resolve 
7971         to an array, give an error.
7972
7973 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
7974
7975         * statement.cs (Try.Resolve): Fixed bug #64222
7976
7977 2004-08-27  Martin Baulig  <martin@ximian.com>
7978
7979         * class.cs
7980         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7981         crash here.     
7982
7983 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
7984
7985         * ecore.cs (Constantify): Get underlying type via
7986         System.Enum.GetUnderlyingType to avoid StackOverflow on the
7987         Windows in special cases.
7988
7989 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
7990
7991         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
7992         for obtaining also private methods.
7993         (GetRemoveMethod): Used GetRemoveMethod (true)
7994         for obtaining also private methods.
7995
7996 2004-09-02  Martin Baulig  <martin@ximian.com>
7997
7998         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7999         TypeManager.GetArgumentTypes() rather than calling GetParameters()
8000         on the MethodBase.
8001
8002 2004-08-27  Martin Baulig  <martin@ximian.com>
8003
8004         * class.cs
8005         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8006         crash here.     
8007
8008 2004-08-25  Martin Baulig  <martin@ximian.com>
8009
8010         * support.cs (ReflectionParameters..ctor): If this is a generic
8011         method, retrieve and store its type parameters.
8012         (InternalParameters..ctor): Added `TypeParameter[]' argument.
8013         (ReflectionParameters.GenericConstraints): The argument specifies
8014         the type parameter, not the method parameter.
8015         (InternalParameters.GenericConstraints): Likewise.
8016
8017         * generic.cs (TypeParameter.DefineType): Correctly handle
8018         constraints wrt. generic methods in interfaces and their
8019         implementations.        
8020
8021 2004-08-24  Martin Baulig  <martin@ximian.com>
8022
8023         * generic.cs (TypeParameter.IsSubclassOf): New public method.
8024         (Constraints.IsSubclassOf): New internal method.
8025
8026         * typemanager.cs (TypeManager.FindMembers): Added special support
8027         for GenericTypeParameterBuilder's.      
8028         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
8029         type parameters.
8030
8031 2004-08-24  Martin Baulig  <martin@ximian.com>
8032
8033         * typemanager.cs
8034         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
8035         this for accessibility checks.
8036         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
8037         IsNestedFamilyAccessible.
8038         (TypeManager.IsSubclassOf): New method, do what the name actually
8039         says.   
8040
8041 2004-08-24  Martin Baulig  <martin@ximian.com>
8042
8043         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
8044         as a SimpleName, include the generic arity.
8045
8046 2004-08-24  Martin Baulig  <martin@ximian.com>
8047
8048         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8049         MethodAttributes.HideBySig for operators.
8050
8051 2004-08-23  Martin Baulig  <martin@ximian.com>
8052
8053         Back to the old error reporting system :-)
8054
8055         * report.cs (Message): Removed.
8056         (Report.MessageData, ErrorData, WarningData): Removed.
8057         (Report.Error, Warning): Back to the old system.
8058
8059 2004-08-23  Martin Baulig  <martin@ximian.com>
8060
8061         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8062
8063         * class.cs (TypeContainer.ParentContainer): New public virtual
8064         method; replaces the explicit interface implementation.
8065         (ClassPart.ParentContainer): Override.
8066
8067 2004-08-23  Martin Baulig  <martin@ximian.com>
8068
8069         * statement.cs (Switch): Added support for constant switches; see
8070         #59428 or test-285.cs.
8071
8072 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8073
8074         Fixed bug #62740.
8075         * statement.cs (GetEnumeratorFilter): Removed useless
8076         logic because C# specs is strict. GetEnumerator must be
8077         public.
8078
8079 2004-08-22  Martin Baulig  <martin@ximian.com>
8080
8081         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8082         a switch and may break, reset the barrier.  Fixes #59867.
8083
8084 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8085
8086         CLS-Compliance speed up (~5% for corlib)
8087
8088         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8089         New method. Tests container for CLS-Compliant names
8090
8091         * class.cs (TypeContainer.VerifyClsName): New method.
8092         Checks whether container name is CLS Compliant.
8093         (Constructor): Implements IMethodData.
8094
8095         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8096         low-case table for CLS Compliance test.
8097         (MemberCache.VerifyClsParameterConflict): New method.
8098         Checks method parameters for CS3006 error.
8099
8100         * enum.cs (EnumMember): Is derived from MemberCore.
8101         (Enum.VerifyClsName): Optimized for better performance.
8102
8103 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8104
8105         * report.cs: Renamed Error_T to Error and changed all
8106         references.
8107
8108 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8109
8110         * class.cs (TypeContainer.IndexerArrayList): New inner class
8111         container for indexers.
8112         (TypeContainer.DefaultIndexerName): New constant for default
8113         indexer name. Replaced all "Item" with this constant.
8114         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8115
8116         * typemanager.cs (TypeManager.default_member_ctor): Cache here
8117         DefaultMemberAttribute constructor.
8118
8119 2004-08-05  Martin Baulig  <martin@ximian.com>
8120
8121         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8122         Fix bug #59429.
8123
8124 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
8125
8126         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8127         multi platforms problem.
8128
8129         * compiler.csproj: Included shared files.
8130
8131 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8132
8133         Fix bug 60333, 55971 in the more general way
8134         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8135         Added arg_type argument for constant conversion.
8136         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8137
8138 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8139
8140         Fix bug #59760
8141         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
8142         OperatorArrayList, MethodCoreArrayList for typecontainer
8143         containers. Changed class member types to these new types.
8144         (MethodArrayList.DefineMembers): Added test for CS0659.
8145
8146 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
8147
8148         * cfold.cs: Synchronize the folding with the code in expression.cs
8149         Binary.DoNumericPromotions for uint operands.
8150
8151         * attribute.cs: Revert patch from Raja, it introduced a regression
8152         while building Blam-1.2.1 (hard to isolate a test case).
8153
8154 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8155
8156         Fix for #55382
8157         * class.cs:
8158         (TypeContainer.Define): Renamed to DefineContainerMembers because of
8159         name collision.
8160         (MethodCore.parent_method): New member. The method we're overriding
8161         if this is an override method.
8162         (MethodCore.CheckBase): Moved from Method class and made common.
8163         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8164         private.
8165         (MethodCore.CheckForDuplications): New abstract method. For custom
8166         member duplication search in a container
8167         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8168         method and its return type.
8169         (Event.conflict_symbol): New member. Symbol with same name in the
8170         parent class.
8171
8172         * decl.cs:
8173         (MemberCache.FindMemberWithSameName): New method. The method
8174         is looking for conflict with inherited symbols.
8175
8176 2004-08-04  Martin Baulig  <martin@ximian.com>
8177
8178         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8179
8180         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8181
8182 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8183
8184         * report.cs (Message): New enum for better error, warning reference in
8185         the code.
8186         (MessageData): New inner abstract class. It generally handles printing of
8187         error and warning messages.
8188         Removed unused Error, Warning, Message methods.
8189
8190 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8191
8192         Fix for cs0592-8.cs test
8193         * attribute.cs
8194         (Attributable.ValidAttributeTargets): Made public.
8195         (Attribute.ExplicitTarget): New member for explicit target value.
8196         (Attribute.CheckTargets): Now we translate explicit attribute
8197         target to Target here.
8198
8199 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
8200
8201         * ecore.cs (MethodGroupExpr): new IsBase property.
8202
8203         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8204
8205         * delegate.cs (DelegateCreation): store a MethodGroupExpr
8206         rather than an instance expr.
8207
8208         (DelegateCreation.Emit): Use the method group rather than
8209         the instance expression. Also, if you have base.Foo as the
8210         method for a delegate, make sure to emit ldftn, not ldftnvirt.
8211
8212         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
8213
8214         (NewDelegate.DoResolve): Only check for the existance of Invoke
8215         if the method is going to be needed. Use MethodGroupExpr.
8216
8217         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
8218
8219         * expression.cs: For pointer arith., make sure to use
8220         the size of the type, not the size of the pointer to
8221         the type.
8222
8223 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8224
8225         Fix for #60722
8226         * class.cs (Class): Added error CS0502 test.
8227
8228 2004-08-03  John Luke  <jluke@cfl.rr.com>
8229             Raja R Harinath  <rharinath@novell.com>
8230
8231         Fix for #60997.
8232         * attribute.cs (Attribute.complained_before): New flag.
8233         (Attribute.ResolveType, Attribute.Resolve),
8234         (Attribute.DefinePInvokeMethod): Set it.
8235         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8236         
8237 2004-08-03  Martin Baulig  <martin@ximian.com>
8238
8239         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8240         use a user-defined operator; we still need to do numeric
8241         promotions in case one argument is a builtin type and the other
8242         one has an implicit conversion to that type.  Fixes #62322.
8243
8244 2004-08-18  Martin Baulig  <martin@ximian.com>
8245
8246         * class.cs (Method.Define): Use the correct method name when
8247         creating the MethodBuilder for a generic method.
8248
8249 2004-08-17  Martin Baulig  <martin@ximian.com>
8250
8251         * generic.cs (Constraints): Support type parameter constraints.
8252
8253 2004-08-16  Martin Baulig  <martin@ximian.com>
8254
8255         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
8256         (Token.GENERIC_DIMENSION): New token; this is returned if we
8257         encounter an unbound generic type in a typeof() expression.
8258
8259         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
8260         this token is only generated while parsing a typeof() expression.
8261         (typeof_expression): Removed the old unbound_type hack.
8262
8263         * generic.cs (TypeArguments.IsUnbound): New public property.
8264
8265         * decl.cs (MemberName): Added support for unbound types.
8266
8267 2004-08-14  Martin Baulig  <martin@ximian.com>
8268
8269         * typemanager.cs
8270         (TypeManager.IsEqualGenericInstance): New static method.
8271         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
8272         just used to check accessibility, so follow the rules of 26.1.6.        
8273
8274         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
8275         ConstructedType instead of a TypeExpression if we have type arguments.
8276
8277         * cs-parser.jay (typeof_expression): Support unbound generic types.
8278
8279         * ecore.cs (UnboundTypeExpression): New public class.
8280
8281 2004-08-12  Martin Baulig  <martin@ximian.com>
8282
8283         * typemanager.cs (TypeManager.IsNestedChildOf): Use
8284         TypeManager.IsEqual() rather than `=='.
8285
8286         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
8287         generic instances as well.
8288
8289 2004-08-12  Martin Baulig  <martin@ximian.com>
8290
8291         * expression.cs (Invocation.InferType): We can only infer method
8292         type parameters.  Fixes #62647.
8293
8294 2004-08-11  Martin Baulig  <martin@ximian.com>
8295
8296         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
8297         before resolving the base classes.
8298
8299 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8300
8301         * Makefile: install .mdb file too.
8302
8303 2004-08-05  Martin Baulig  <martin@ximian.com>
8304
8305         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
8306         initializer, the current type is just the TypeBuilder, not the
8307         instantiated generic type.
8308         (FieldExpr.IsFieldInitializer): New public property.
8309
8310 2004-08-04  Martin Baulig  <martin@ximian.com>
8311
8312         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8313
8314         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8315
8316 2004-08-03  Martin Baulig  <martin@ximian.com>
8317
8318         * class.cs (MethodData.Define): If we're an explicit
8319         implementation, remove the generic arity from the type name.
8320
8321 2004-08-03  Martin Baulig  <martin@ximian.com>
8322
8323         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8324         use a user-defined operator; we still need to do numeric
8325         promotions in case one argument is a builtin type and the other
8326         one has an implicit conversion to that type.  Fixes #62322.
8327
8328 2004-08-02  Martin Baulig  <martin@ximian.com>
8329
8330         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
8331         `TypeExpr[]' array.
8332         (TypeContainer.GetClassBases): Return the unexpanded list of
8333         interfaces; we expand them later.
8334         (TypeContainer.DefineType): After creating the TypeBuilder, call
8335         TypeManager.ExpandInterfaces() to get an expanded and resolved
8336         list of interfaces.
8337
8338         * ecore.cs (TypeExpr.GetInterfaces): Removed
8339
8340         * generics.cs (Constraints.InterfaceConstraints): Remove.
8341         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
8342         register the interface constraints.
8343
8344         * typemanager.cs
8345         (TypeManager.AddUserType): Removed the `ifaces' argument.
8346         (TypeManager.AddTypeParameter): Likewise.
8347         (TypeManager.AddUserInterface): Removed, was unused.
8348         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
8349         `TypeExpr[]' array for the interfaces.
8350         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
8351         has been defined, returns a list of the resolved interfaces types.
8352         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
8353         (TypeManager.GetExplicitInterfaces): Likewise.  
8354
8355 2004-08-02  Martin Baulig  <martin@ximian.com>
8356
8357         * expression.cs (Invocation.EmitCall): If we're invoking a method
8358         on a type parameter, use the new `Constrained' prefix opcode.
8359
8360 2004-08-02  Martin Baulig  <martin@ximian.com>
8361
8362         * statement.cs (LocalInfo.Flags): Added `IsThis'.
8363         (LocalInfo.IsThis): New public property.
8364         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8365
8366 2004-08-01  Martin Baulig  <martin@ximian.com>
8367
8368         * class.cs (TypeContainer.GetClassBases): Don't set the default
8369         here since we may get called from GetPartialBases().
8370         (TypeContainer.DefineType): If GetClassBases() didn't return a
8371         parent, use the default one.
8372
8373 2004-07-30  Martin Baulig  <martin@ximian.com>
8374
8375         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8376
8377         * class.cs (SourceMethod): New public class, derive from the
8378         symbol writer's ISourceMethod.
8379         (Method): Use the new symbol writer API.
8380
8381         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8382         as argument and use the new symbol writer.
8383
8384         * location.cs
8385         (SourceFile): Implement the symbol writer's ISourceFile.
8386         (Location.SymbolDocument): Removed.
8387         (Location.SourceFile): New public property.
8388
8389         * symbolwriter.cs: Use the new symbol writer API.
8390
8391 2004-07-30  Raja R Harinath  <rharinath@novell.com>
8392
8393         * Makefile (install-local): Remove.  Functionality moved to
8394         executable.make.
8395
8396 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
8397
8398         * Makefile: Install mcs.exe.config file together with mcs.exe.
8399         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8400         correct runtime version.
8401         
8402 2004-07-25  Martin Baulig  <martin@ximian.com>
8403
8404         * class.cs
8405         (TypeContainer.RegisterOrder): Removed, this was unused.
8406         (TypeContainer, interface_order): Removed.
8407         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8408         TypeContainer as argument since we can also be called with a
8409         `PartialContainer' for a partial class/struct/interface.
8410         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8411         of checking whether we're an `Interface' - we could be a
8412         `PartialContainer'.
8413         (PartialContainer.Register): Override; call
8414         AddClass()/AddStruct()/AddInterface() on our parent.
8415
8416         * cs-parser.jay (interface_member_declaration): Add things to the
8417         `current_container', not the `current_class'.
8418
8419         * rootcontext.cs (RegisterOrder): The overloaded version which
8420         takes an `Interface' was unused, removed.
8421
8422         * typemanager.cs (TypeManager.LookupInterface): Return a
8423         `TypeContainer', not an `Interface'.
8424         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8425         contain a `PartialContainer' for an interface, so check it's
8426         `Kind' to figure out what it is.
8427
8428 2004-07-25  Martin Baulig  <martin@ximian.com>
8429
8430         * class.cs (Class.DefaultTypeAttributes): New public constant.
8431         (Struct.DefaultTypeAttributes): Likewise.
8432         (Interface.DefaultTypeAttributes): Likewise.
8433         (PartialContainer.TypeAttr): Override this and add the
8434         DefaultTypeAttributes.
8435
8436 2004-07-25  Martin Baulig  <martin@ximian.com>
8437
8438         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8439         we can just use the `Parent' field instead.
8440
8441 2004-07-25  Martin Baulig  <martin@ximian.com>
8442
8443         * class.cs (TypeContainer.Emit): Renamed to EmitType().
8444
8445 2004-07-25  Martin Baulig  <martin@ximian.com>
8446
8447         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8448         our parts before defining any methods.
8449         (TypeContainer.VerifyImplements): Make this virtual.
8450         (ClassPart.VerifyImplements): Override and call VerifyImplements()
8451         on our PartialContainer.
8452
8453 2004-07-25  Martin Baulig  <martin@ximian.com>
8454
8455         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8456
8457         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8458         argument, we can just use the `Parent' field instead.
8459
8460         * class.cs
8461         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
8462         (MemberBase.DoDefine): Likewise.
8463
8464 2004-07-24  Martin Baulig  <martin@ximian.com>
8465
8466         * decl.cs (MemberCore.Parent): New public field.
8467         (DeclSpace.Parent): Moved to MemberCore.
8468
8469         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8470         (MemberBase.ctor): Added TypeContainer argument, pass it to our
8471         parent's .ctor.
8472         (FieldBase, Field, Operator): Likewise.
8473         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8474         (EventField, Event): Likewise.
8475
8476 2004-07-23  Martin Baulig  <martin@ximian.com>
8477
8478         * class.cs (PartialContainer): New public class.
8479         (ClassPart): New public class.
8480         (TypeContainer): Added support for partial classes.
8481         (TypeContainer.GetClassBases): Splitted some of the functionality
8482         out into GetNormalBases() and GetPartialBases().
8483
8484         * cs-tokenizer.cs (Token.PARTIAL): New token.
8485         (Tokenizer.consume_identifier): Added some hacks to recognize
8486         `partial', but only if it's immediately followed by `class',
8487         `struct' or `interface'.
8488
8489         * cs-parser.jay: Added support for partial clases.
8490
8491 2004-07-23  Martin Baulig  <martin@ximian.com>
8492
8493         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8494         a `DeclSpace' and also made it readonly.
8495         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8496         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8497         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8498
8499         * cs-parser.jay: Pass the `current_class', not the
8500         `current_container' (at the moment, this is still the same thing)
8501         to a new Method, Property, Event, Indexer or Constructor.
8502
8503 2004-07-23  Martin Baulig  <martin@ximian.com>
8504
8505         * cs-parser.jay (CSharpParser): Added a new `current_class' field
8506         and removed the `current_interface' one.
8507         (struct_declaration, class_declaration, interface_declaration):
8508         Set `current_class' to the newly created class/struct/interface;
8509         set their `Bases' and call Register() before parsing their body.
8510
8511 2004-07-23  Martin Baulig  <martin@ximian.com>
8512
8513         * class.cs (Kind): New public enum.
8514         (TypeContainer): Made this class abstract.
8515         (TypeContainer.Kind): New public readonly field.
8516         (TypeContainer.CheckDef): New public method; moved here from
8517         cs-parser.jay.
8518         (TypeContainer.Register): New public abstract method.
8519         (TypeContainer.GetPendingImplementations): New public abstract
8520         method.
8521         (TypeContainer.GetClassBases): Removed the `is_class' and
8522         `is_iface' parameters.
8523         (TypeContainer.DefineNestedTypes): Formerly known as
8524         DoDefineType().
8525         (ClassOrStruct): Made this class abstract.
8526
8527         * tree.cs (RootTypes): New public type. 
8528
8529 2004-07-20  Martin Baulig  <martin@ximian.com>
8530
8531         * tree.cs (Tree.RecordNamespace): Removed.
8532         (Tree.Namespaces): Removed.
8533
8534         * rootcontext.cs (RootContext.IsNamespace): Removed.
8535
8536         * cs-parser.jay (namespace_declaration): Just create a new
8537         NamespaceEntry here.
8538
8539 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
8540
8541         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
8542         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
8543         entry to make sure it runs in the correct runtime version.
8544         
8545 2004-07-18  Martin Baulig  <martin@ximian.com>
8546
8547         * generic.cs (ConstructedType.CheckConstraints): Improved
8548         constraints checking.
8549
8550 2004-07-18  Martin Baulig  <martin@ximian.com>
8551
8552         * expression.cs (Invocation.BetterMethod): Call
8553         TypeManager.TypeToCoreType() on all types and removed my previous
8554         hack; we're already doig the right thing here.
8555
8556 2004-07-17  Martin Baulig  <martin@ximian.com>
8557
8558         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
8559
8560 2004-07-16  Martin Baulig  <martin@ximian.com>
8561
8562         * iterators.cs: Added generics support.
8563
8564 2004-07-16  Martin Baulig  <martin@ximian.com>
8565
8566         * iterators.cs: Rewrote this.  We're now using one single Proxy
8567         class for both the IEnumerable and the IEnumerator interface and
8568         `Iterator' derives from Class so we can use the high-level API.
8569
8570         * class.cs (TypeContainer.AddIterator): New method.
8571         (TypeContainer.DoDefineType): New protected virtual method, which
8572         is called from DefineType().
8573         (TypeContainer.DoDefineMembers): Call DefineType() and
8574         DefineMembers() on all our iterators.
8575         (TypeContainer.Emit): Call Emit() on all our iterators.
8576         (TypeContainer.CloseType): Call CloseType() on all our iterators.
8577
8578         * codegen.cs (EmitContext.CurrentIterator): New public field.
8579
8580 2004-07-15  Martin Baulig  <martin@ximian.com>
8581
8582         * typemanager.cs
8583         (TypeManager.not_supported_exception_type): New type.   
8584
8585 2004-07-14  Martin Baulig  <martin@ximian.com>
8586
8587         * typemanager.cs
8588         (TypeManager.generic_ienumerable_type): New type.
8589         (TypeManager.generic_ienumerator_type): New type.
8590
8591         * rootcontext.cs
8592         (RootContext.interfaces_first_stage): Added
8593         "System.Collections.Generic.IEnumerator`1" and
8594         "System.Collections.Generic.IEnumerable`1".     
8595
8596 2004-07-14  Martin Baulig  <martin@ximian.com>
8597
8598         * iterators.cs: Use real error numbers.
8599
8600 2004-07-14  Martin Baulig  <martin@ximian.com>
8601
8602         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8603         requires this to be a System.Collection.IEnumerable and not a
8604         class implementing that interface.
8605         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
8606
8607 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
8608
8609         * class.cs: Fixed previous fix, it broke some error tests.
8610
8611 2004-07-12  Martin Baulig  <martin@ximian.com>
8612
8613         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8614         Fixes #61293.
8615
8616 2004-07-14  Martin Baulig  <martin@ximian.com>
8617
8618         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
8619         an exclamation mark (!) for the generic arity to reflect the
8620         latest spec changes; ie. use "System.Collections.Generic.IList`1".
8621
8622 2004-07-13  Martin Baulig  <martin@ximian.com>
8623
8624         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
8625         specifiers being part of a type argument.
8626
8627 2004-07-13  Martin Baulig  <martin@ximian.com>
8628
8629         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
8630         name for generic types.
8631
8632 2004-07-13  Martin Baulig  <martin@ximian.com>
8633
8634         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
8635         bit to fix #60119.
8636
8637 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
8638
8639         * assign.cs (LocalTemporary): Add new argument: is_address,If
8640         `is_address' is true, then the value that we store is the address
8641         to the real value, and not the value itself.
8642         
8643         * ecore.cs (PropertyExpr): use the new local temporary
8644         stuff to allow us to handle X.Y += z (where X is a struct)
8645
8646 2004-07-08  Martin Baulig  <martin@ximian.com>
8647
8648         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8649         not always return, just like we're doing in Using.Resolve().
8650
8651 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
8652
8653         * cs-parser.jay (fixed_statement): flag this as Pinned.
8654
8655 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
8656
8657         * typemanager.cs (TypeManager): Removed MakePinned method, this
8658         mechanism is replaced with the .NET 2.x compatible mechanism of
8659         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8660
8661         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
8662         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8663         `IsFixed' property which has a different meaning.
8664
8665 2004-07-02  Raja R Harinath  <rharinath@novell.com>
8666
8667         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8668         visible from inside a nested class, not just the names of the
8669         immediately enclosing class.
8670         Fix for bug #60730.
8671
8672 2004-06-24  Raja R Harinath  <rharinath@novell.com>
8673
8674         * expression.cs (BetterConversion): Remove buggy special-case
8675         handling of "implicit constant expression conversions".  At this
8676         point, we already know that the conversion is possible -- we're
8677         only checking to see which is better.
8678
8679 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8680
8681         * cs-parser.jay: Added error CS0210 test.
8682
8683 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8684
8685         * cs-parser.jay: Added error CS0134 test.
8686
8687 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8688
8689         Fix bug #52507
8690         * cs-parser.jay: Added error CS0145 test.
8691
8692 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8693
8694         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8695
8696 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
8697         
8698         * expression.cs (StackAlloc.Resolve): The argument may not
8699         be a constant; deal with this case.
8700         
8701 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
8702
8703         * attribute.cs (IndexerName_GetIndexerName): Renamed to
8704         GetIndexerAttributeValue.
8705         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8706
8707         * class.cs (Indexer.Define): Added error tests for CS0415,
8708         CS0609.
8709
8710 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
8711
8712         * attribute.cs (Attribute.Resolve): Keep field code in sync with
8713         property code.
8714
8715 2004-06-23  Martin Baulig  <martin@ximian.com>
8716
8717         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8718         neither return nor throw, reset the barrier as well.  Fixes #60457.
8719
8720 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
8721
8722         * class.cs : EventAttributes is now set to None by default.
8723           This fixes bug #60459.
8724
8725 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8726
8727         Fix bug #60219
8728         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8729         Don't throw exception but return null (it's sufficient now).
8730
8731 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8732
8733         * typemanager.cs (GetArgumentTypes): Faster implementation.
8734
8735 2004-06-18  Martin Baulig  <martin@ximian.com>
8736
8737         * attribute.cs (Attribute.Resolve): Check whether we're an
8738         EmptyCast which a Constant child.  Fixes #60333.
8739
8740 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
8741
8742         * statement.cs (EmitCollectionForeach): Account for the fact that
8743         not all valuetypes are in areas which we can take the address of.
8744         For these variables, we store to a temporary variable. Also, make
8745         sure that we dont emit a `callvirt' on a valuetype method.
8746
8747 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8748
8749         * expression.cs (StackAlloc.DoReSolve): Added test for
8750         negative parameter (CS0247).
8751
8752 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8753
8754         Fix bug #59792
8755         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8756
8757 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8758
8759         Fix bug #59781
8760         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8761         ulong.
8762
8763 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8764
8765         Fix bug #58254 & cs1555.cs, cs1556.cs
8766         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8767
8768 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8769
8770         * cs-parser.jay: Added error CS1669 test for indexers.
8771
8772 2004-06-18  Martin Baulig  <martin@ximian.com>
8773
8774         * generics.cs (GenericMethod.ctor): Don't take an Attributes
8775         argument.  Fixes #60441.
8776
8777 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
8778         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
8779         The name needs to have the actual name of the method in order
8780         for other tests (such as the one in OverloadResolve for Invoke
8781         on a delegate) to work. As well, it does not really help
8782         error reporting because the method group had multiple methods.
8783         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
8784         Make profiling work.
8785         
8786 2004-06-13  Martin Baulig  <martin@ximian.com>
8787
8788         * cs-parser.jay: Don't allow generic attributes.
8789
8790 2004-06-13  Martin Baulig  <martin@ximian.com>
8791
8792         * class.cs (MemberBase.DoDefineBase): New protected method.
8793         (MemberBase.DoDefine): Compute the `flags' in the new
8794         DoDefineBase() which must be called first.
8795         (Method.Define): Call DoDefineBase() first so we have the flags
8796         when defining the generic method.
8797
8798         * cs-parser.jay (interface_method_declaration): Support generic methods.
8799
8800 2004-06-13  Martin Baulig  <martin@ximian.com>
8801
8802         * decl.cs (TypeName): Removed.
8803         (MemberName): Removed TypeName and MemberNow; now we just have
8804         MemberName.
8805
8806         * cs-parser.jay: Don't distinguish between type arguments and type
8807         parameters in the grammar and simplified the rules a bit.  The
8808         reduce/reduce conflicts are now gone (except the one we inherited
8809         from mcs).
8810
8811 2004-06-11  Martin Baulig  <martin@ximian.com>
8812
8813         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
8814         call this twice: for params and varargs methods.
8815
8816 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8817
8818         * class.cs:
8819         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
8820
8821 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8822
8823         * attribute.cs (Attribute.GetValidTargets): Made public.
8824
8825         * class.cs: 
8826         (AbstractPropertyEventMethod): New class for better code sharing.
8827         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
8828         CS1667 report.
8829         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
8830
8831 2004-06-09  Martin Baulig  <martin@ximian.com>
8832
8833         * cs-parser.jay: Removed a reduce/reduce conflict.
8834
8835 2004-06-03  Martin Baulig  <martin@ximian.com>
8836
8837         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
8838         GetSimpleName() and return a SimpleName.
8839
8840         * ecore.cs (SimpleName.Arguments): New public field.
8841         (SimpleName): Added overloaded ctor which takes an additional
8842         TypeArguments argument.
8843         (SimpleName.SimpleNameResolve): Added support for generic methods.
8844         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
8845         formerly in MemberAccess.DoResolve(), but we also need it in
8846         SimpleNameResolve().
8847
8848         * expression.cs (MemberAccess.DoResolve): Use the new
8849         MethodGroupExpr.ResolveGeneric().       
8850
8851 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8852
8853         * decl.cs: If possible, use lookuptypedirect here. We can only do
8854         this if there is no `.' after the namespace. Avoids using
8855         LookupType, which does lots of slow processing.
8856         (FindNestedType) New method, does what it says :-).
8857         * namespace.cs: use LookupTypeDirect.
8858         * rootcontext.cs: use membercache, if possible.
8859         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8860
8861 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8862
8863         * expression.cs:
8864         According to the spec, 
8865
8866         In a member access of the form E.I, if E is a single identifier,
8867         and if the meaning of E as a simple-name (§7.5.2) is a constant,
8868         field, property, localvariable, or parameter with the same type as
8869         the meaning of E as a type-name (§3.8), then both possible
8870         meanings of E are permitted.
8871
8872         We did not check that E as a simple-name had the same type as E as
8873         a type name.
8874
8875         This trivial check gives us 5-7% on bootstrap time.
8876
8877 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8878
8879         * expression.cs (Invocation.OverloadResolve): Avoid the
8880         use of hashtables and boxing here by allocating on demand.
8881
8882 2004-05-30  Martin Baulig  <martin@ximian.com>
8883
8884         * rootcontext.cs (RootContext.LookupType): Don't cache things if
8885         we're doing a silent lookup.  Don't try to lookup nested types in
8886         TypeManager.object_type (thanks to Ben Maurer).
8887
8888 2004-05-30  Martin Baulig  <martin@ximian.com>
8889
8890         Committing a patch from Ben Maurer.
8891
8892         * rootcontext.cs (RootContext.LookupType): Cache negative results.
8893
8894 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8895
8896         * convert.cs: add a trivial cache for overload operator resolution.
8897
8898 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
8899
8900         * attribute.cs
8901         (AttributeTester.GetObsoleteAttribute): Returns instance of
8902         ObsoleteAttribute when type is obsolete.
8903
8904         * class.cs
8905         (TypeContainer.VerifyObsoleteAttribute): Override.
8906         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
8907         (MethodCode.VerifyObsoleteAttribute): Override.
8908         (MemberBase.VerifyObsoleteAttribute): Override.
8909
8910         * decl.cs
8911         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
8912         and report proper error.
8913
8914         *delegate.cs
8915         (Delegate.VerifyObsoleteAttribute): Override.
8916
8917         * ecore.cs
8918         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
8919         and report proper error.
8920         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
8921
8922         * enum.cs
8923         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
8924         and enum member.
8925
8926         * expression.cs
8927         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
8928         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
8929         Added test for ObsoleteAttribute.
8930
8931         * statement.cs
8932         (Catch): Derived from Statement.
8933
8934 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8935
8936         * decl.cs: If possible, use lookuptypedirect here. We can only do
8937         this if there is no `.' after the namespace. Avoids using
8938         LookupType, which does lots of slow processing.
8939         (FindNestedType) New method, does what it says :-).
8940         * namespace.cs: use LookupTypeDirect.
8941         * rootcontext.cs: use membercache, if possible.
8942         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8943
8944 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8945
8946         * expression.cs:
8947         According to the spec, 
8948
8949         In a member access of the form E.I, if E is a single identifier,
8950         and if the meaning of E as a simple-name (§7.5.2) is a constant,
8951         field, property, localvariable, or parameter with the same type as
8952         the meaning of E as a type-name (§3.8), then both possible
8953         meanings of E are permitted.
8954
8955         We did not check that E as a simple-name had the same type as E as
8956         a type name.
8957
8958         This trivial check gives us 5-7% on bootstrap time.
8959
8960 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
8961
8962         Fixed bug #59071 & cs0160.cs
8963         * statement.cs (Try.Resolve): Check here whether order of catch
8964         clauses matches their dependencies.
8965
8966 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
8967
8968         Fixed bug #58624
8969         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
8970         unsafe type.
8971
8972 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8973
8974         * expression.cs (Invocation.OverloadResolve): Avoid the
8975         use of hashtables and boxing here by allocating on demand.
8976
8977 2004-05-30  Martin Baulig  <martin@ximian.com>
8978
8979         * rootcontext.cs (RootContext.LookupType): Don't cache things if
8980         we're doing a silent lookup.  Don't try to lookup nested types in
8981         TypeManager.object_type (thanks to Ben Maurer).
8982
8983 2004-05-30  Martin Baulig  <martin@ximian.com>
8984
8985         Committing a patch from Ben Maurer.
8986
8987         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
8988
8989 2004-05-29  Martin Baulig  <martin@ximian.com>
8990
8991         * class.cs (IMethodData.ShouldIgnore): New method.
8992
8993         * typemanager.cs (TypeManager.MethodFlags): Don't take a
8994         `Location' argument, we don't need it anywhere.  Use
8995         `IMethodData.ShouldIgnore ()' instead of
8996         `MethodData.GetMethodFlags ()'.
8997         (TypeManager.AddMethod): Removed.
8998         (TypeManager.AddMethod2): Renamed to AddMethod.
8999
9000 2004-05-29  Martin Baulig  <martin@ximian.com>
9001
9002         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9003
9004         * convert.cs (Convert.ImplicitReferenceConversion): If we're
9005         converting from a class type S to an interface type and we already
9006         have an object on the stack, don't box it again.  Fixes #52578.
9007
9008 2004-05-29  Martin Baulig  <martin@ximian.com>
9009
9010         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9011         Added support for `params' parameters.  Fixes #59267.
9012
9013 2004-05-29  Martin Baulig  <martin@ximian.com>
9014
9015         * literal.cs (NullPointer): Provide a private .ctor which sets
9016         `type' to TypeManager.object_type.  Fixes #59048.
9017
9018 2004-05-29  Martin Baulig  <martin@ximian.com>
9019
9020         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9021         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
9022
9023         * ecore.cs (EventExpr.instance_expr): Make the field private.
9024
9025 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
9026
9027         Fixed bug #50080 & cs0214-2.cs
9028         * expression.cs (Cast.DoResolve): Check unsafe context here.
9029         
9030         * statement.cs (Resolve.DoResolve): Likewise.
9031
9032 2004-05-26  Martin Baulig  <martin@ximian.com>
9033
9034         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9035
9036         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9037         (RootContext.LookupType): Pass down the `silent' flag.
9038
9039 2004-05-25  Martin Baulig  <martin@ximian.com>
9040
9041         * expression.cs
9042         (MethodGroupExpr.IdenticalTypeName): New public property.
9043         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9044         expression actually refers to a type.
9045
9046 2004-05-25  Martin Baulig  <martin@ximian.com>
9047
9048         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9049         for #56176 and made it actually work.
9050
9051 2004-05-25  Martin Baulig  <martin@ximian.com>
9052
9053         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9054         (FieldExpr, PropertyExpr): Override and implement
9055         CacheTemporaries.  Fixes #52279.
9056
9057 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
9058
9059         * location.cs: In the new compiler listing a file twice is a
9060         warning, not an error.
9061
9062 2004-05-24  Martin Baulig  <martin@ximian.com>
9063
9064         * enum.cs (Enum.DefineType): For the `BaseType' to be a
9065         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
9066
9067 2004-05-24  Martin Baulig  <martin@ximian.com>
9068
9069         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9070         walking the `using' list.  Fixes #53921.
9071
9072 2004-05-24  Martin Baulig  <martin@ximian.com>
9073
9074         * const.cs (Const.LookupConstantValue): Added support for
9075         EmptyCast's; fixes #55251.
9076
9077 2004-05-24  Martin Baulig  <martin@ximian.com>
9078
9079         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9080         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9081         which does the CS0135 check.  The reason is that we first need to
9082         check whether the variable actually exists.
9083
9084 2004-05-24  Martin Baulig  <martin@ximian.com>
9085
9086         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9087         than RootContext.LookupType() to find the explicit interface
9088         type.  Fixes #58584.
9089
9090 2004-05-24  Raja R Harinath  <rharinath@novell.com>
9091
9092         * Makefile: Simplify.  Use executable.make.
9093         * mcs.exe.sources: New file.  List of sources of mcs.exe.
9094
9095 2004-05-24  Anders Carlsson  <andersca@gnome.org>
9096
9097         * decl.cs:
9098         * enum.cs:
9099         Use the invariant culture when doing String.Compare for CLS case
9100         sensitivity.
9101         
9102 2004-05-23  Martin Baulig  <martin@ximian.com>
9103
9104         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9105         don't have any dots.  Fixes #52622, added cs0246-8.cs.
9106
9107         * namespace.cs (NamespaceEntry.Lookup): Likewise.
9108
9109 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9110
9111         * class.cs (MemberBase.Define): Reuse MemberType member for 
9112         resolved type. Other methods can use it too.
9113
9114 2004-05-23  Martin Baulig  <martin@ximian.com>
9115
9116         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9117         the variable also exists in the current block (otherwise, we need
9118         to report a CS0103).  Fixes #58670.
9119
9120 2004-05-23  Martin Baulig  <martin@ximian.com>
9121
9122         * flowanalysis.cs (Reachability.Reachable): Compute this
9123         on-the-fly rather than storing it as a field.
9124
9125 2004-05-23  Martin Baulig  <martin@ximian.com>
9126
9127         * flowanalysis.cs (Reachability.And): Manually compute the
9128         resulting `barrier' from the reachability.      
9129        
9130 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9131
9132         Fix bug #57835
9133         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9134         instance of ObsoleteAttribute when symbol is obsolete.
9135
9136         * class.cs
9137         (IMethodData): Extended interface for ObsoleteAttribute support.
9138
9139 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9140
9141         * attribute.cs: Fix bug #55970
9142
9143 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9144
9145         Fix bug #52705
9146         * attribute.cs
9147         (GetObsoleteAttribute): New method. Creates the instance of
9148         ObsoleteAttribute.
9149         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9150         ObsoleteAttribute when member is obsolete.
9151         (AttributeTester.Report_ObsoleteMessage): Common method for
9152         Obsolete error/warning reporting.
9153
9154         * class.cs
9155         (TypeContainer.base_classs_type): New member for storing parent type.
9156
9157         * decl.cs
9158         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9159         for this MemberCore.
9160
9161 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9162
9163         * attribute.cs, const.cs: Fix bug #58590
9164
9165 2004-05-21  Martin Baulig  <martin@ximian.com>
9166
9167         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9168         out parameters if the end of the method is unreachable.  Fixes
9169         #58098. 
9170
9171 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9172
9173         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9174         Hari was right, why extra method.
9175
9176 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9177
9178         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9179
9180 2004-05-20  Martin Baulig  <martin@ximian.com>
9181
9182         * delegate.cs: Convert this file to Unix mode - like the original
9183         version in mcs is.
9184
9185 2004-05-20  Martin Baulig  <martin@ximian.com>
9186
9187         * attribute.cs: Convert this file to Unix mode - like the original
9188         version in mcs is.
9189
9190 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
9191
9192        Fix bug #58688 (MCS does not report error when the same attribute
9193        is assigned twice)
9194
9195        * attribute.cs (Attribute.Emit): Distinction between null and default.
9196
9197 2004-05-19  Raja R Harinath  <rharinath@novell.com>
9198
9199        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9200        of a top-level attribute without an attribute target.
9201        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
9202        Make non-static.
9203        (Attribute.Conditional_GetConditionName), 
9204        (Attribute.Obsolete_GetObsoleteMessage): Update.
9205        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
9206        part of ScanForIndexerName.
9207        (Attribute.CanIgnoreInvalidAttribute): New function.
9208        (Attribute.ScanForIndexerName): Move to ...
9209        (Attributes.ScanForIndexerName): ... here.
9210        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9211        (Attributes.Search): New internal variant that can choose not to
9212        complain if types aren't resolved.  The original signature now
9213        complains.
9214        (Attributes.GetClsCompliantAttribute): Use internal variant, with
9215        complaints suppressed.
9216        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9217        only if it not useful.
9218        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9219        top-level for attributes that are shared between the assembly
9220        and a top-level class.
9221        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9222        * class.cs: Update to reflect changes.
9223        (DefineIndexers): Fuse loops.
9224        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
9225        a couple more variants of attribute names.
9226
9227 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
9228
9229         Fix bug #52585 (Implemented explicit attribute declaration)
9230
9231         * attribute.cs:
9232         (Attributable.ValidAttributeTargets): New abstract method. It gets
9233         list of valid attribute targets for explicit target declaration.
9234         (Attribute.Target): It holds target itself.
9235         (AttributeSection): Removed.
9236         (Attribute.CheckTargets): New method. It checks whether attribute
9237         target is valid for the current element.
9238
9239         * class.cs:
9240         (EventProperty): New class. For events that are declared like
9241         property (with add and remove accessors).
9242         (EventField): New class. For events that are declared like field.
9243         class.cs
9244
9245         * cs-parser.jay: Implemented explicit attribute target declaration.
9246
9247         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
9248         Override ValidAttributeTargets.
9249
9250         * parameter.cs:
9251         (ReturnParameter): Class for applying custom attributes on 
9252         the return type.
9253         (ParameterAtribute): New class. Class for applying custom
9254         attributes on the parameter type.
9255
9256 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
9257
9258         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9259         definitions. 
9260
9261         (Method): Allow UNSAFE here.
9262
9263         * modifiers.cs: Support unsafe reporting.
9264
9265 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
9266
9267         * decl.cs: Fix bug #58478.
9268
9269 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9270
9271         * statement.cs: When checking for unreachable code on an EmptyStatement,
9272         set the location. Fixes bug #58488.
9273
9274 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
9275
9276         * driver.cs: Add -pkg handling.
9277
9278         From Gonzalo: UseShelLExecute=false
9279
9280 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
9281
9282         * attribute.cs:
9283         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9284         for attribute.
9285         (Attribute.IsClsCompliaceRequired): Moved to base for better
9286         accesibility.
9287         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9288         when attribute is AttributeUsageAttribute.
9289         (Attribute.GetValidTargets): Simplified.
9290         (Attribute.GetAttributeUsage): New method returns AttributeUsage
9291         attribute for this type.
9292         (Attribute.ApplyAttributes): Method renamed to Emit and make
9293         non-static.
9294         (GlobalAttributeSection): New class for special handling of global
9295         attributes (assembly, module).
9296         (AttributeSection.Emit): New method.
9297
9298         * class.cs: Implemented Attributable abstract methods.
9299         (MethodCore.LabelParameters): Moved to Parameter class.
9300         (Accessor): Is back simple class.
9301         (PropertyMethod): Implemented Attributable abstract class.
9302         (DelegateMethod): Implemented Attributable abstract class.
9303         (Event): New constructor for disctintion between normal Event
9304         and Event with accessors.
9305
9306         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9307
9308         * codegen.cs, const.cs, decl.cs, delegate.cs:
9309         (CommonAssemblyModulClass): Implemented Attributable abstract class
9310         and simplified.
9311
9312         * enum.cs: Implement IAttributeSupport interface.
9313         (EnumMember): New class for emum members. Implemented Attributable
9314         abstract class
9315
9316         * parameter.cs:
9317         (ParameterBase): Is abstract.
9318         (ReturnParameter): New class for easier [return:] attribute handling.
9319
9320         * typemanager.cs: Removed builder_to_attr.
9321
9322 2004-05-11  Raja R Harinath  <rharinath@novell.com>
9323
9324         Fix bug #57151.
9325         * attribute.cs (Attribute.GetPositionalValue): New function.
9326         * class.cs (TypeContainer.VerifyMembers): New function.
9327         (TypeContainer.Emit): Use it.
9328         (ClassOrStruct): New base class for Class and Struct.
9329         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
9330         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9331         class.
9332         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9333         then each non-static field should have a FieldOffset attribute.
9334         Otherwise, none of the fields should have a FieldOffset attribute.
9335         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
9336         and FieldOffset attributes.
9337         * typemanager.cs (TypeManager.struct_layout_attribute_type)
9338         (TypeManager.field_offset_attribute_type): New core types.
9339         (TypeManager.InitCoreTypes): Initialize them.
9340
9341 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
9342
9343         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9344         Return correct type.
9345         From bug #58270.
9346
9347 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
9348
9349         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9350         be implicitly converted to ulong.
9351         
9352         * expression.cs: The logic for allowing operator &, | and ^ worked
9353         was wrong, it worked before because we did not report an error in
9354         an else branch.  Fixes 57895.
9355
9356         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9357         allow volatile fields to be reference types.
9358
9359 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
9360
9361         * driver.cs: Add support for /debug-
9362
9363 2004-05-07  Raja R Harinath  <rharinath@novell.com>
9364
9365         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
9366         Add a 'complain' parameter to silence errors.
9367         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
9368         silently overlooked type-resolutions.
9369         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9370         to reflect changes.
9371         (Attributes.Search): New function.
9372         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9373         (Attributes.GetAttributeFullName): Remove hack.
9374         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
9375         Update to reflect changes.
9376         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9377         Use Attributes.Search instead of nested loops.
9378
9379 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
9380
9381         * decl.cs:
9382         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9383         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9384         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9385
9386         * report.cs: (Report.Warning): Renamed to Warning_T because of
9387         parameter collision.
9388
9389 2004-05-05  Raja R Harinath  <rharinath@novell.com>
9390
9391         * expression.cs (MemberAccess.ResolveMemberAccess):
9392         Exit with non-zero status after Report.Error.
9393         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9394         Likewise.
9395         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9396
9397 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9398
9399         * support.cs: Don't hang when the file is empty.
9400
9401 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9402
9403         * support.cs: In SeekableStreamReader, compute the preamble size of the
9404           underlying stream. Position changes should take into account that initial
9405           count of bytes.
9406
9407 2004-05-03  Todd Berman  <tberman@sevenl.net>
9408
9409         * driver.cs: remove unused GetSysVersion function.
9410
9411 2004-05-03  Todd Berman  <tberman@sevenl.net>
9412
9413         * driver.cs: Remove the hack from saturday, as well as the hack
9414         from jackson (LoadAssemblyFromGac), also adds the CWD to the
9415         link_paths to get that bit proper.
9416
9417 2004-05-01  Todd Berman  <tberman@sevenl.net>
9418
9419         * driver.cs: Try a LoadFrom before a Load, this checks the current
9420         path. This is currently a bug in mono that is be fixed, however, this
9421         provides a workaround for now. This will be removed when the bug
9422         is fixed.
9423
9424 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
9425
9426         * CryptoConvert.cs: Updated to latest version. Fix issue with 
9427         incomplete key pairs (#57941).
9428
9429 2004-05-01  Todd Berman  <tberman@sevenl.net>
9430
9431         * driver.cs: Remove '.' from path_chars, now System.* loads properly
9432         from the GAC
9433
9434 2004-04-30  Jackson Harper  <jackson@ximian.com>
9435
9436         * codegen.cs: Open keys readonly.
9437         
9438 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9439
9440         * typemanager.cs: don't report cyclic struct layout when a struct
9441         contains 2 or more fields of the same type. Failed for Pango.AttrShape
9442         which has 2 Pango.Rectangle fields.
9443
9444 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9445
9446         * expression.cs: Handle IntPtr comparisons with IL code
9447         rather than a method call.
9448
9449 2004-04-29  Martin Baulig  <martin@ximian.com>
9450
9451         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
9452         the list of PropertyInfo's in class hierarchy and find the
9453         accessor.  Fixes #56013.
9454
9455 2004-04-29  Martin Baulig  <martin@ximian.com>
9456
9457         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9458
9459 2004-04-29  Martin Baulig  <martin@ximian.com>
9460
9461         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9462
9463         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9464
9465 2004-04-29  Martin Baulig  <martin@ximian.com>
9466
9467         * class.cs (ConstructorInitializer.Resolve): Check whether the
9468         parent .ctor is accessible.  Fixes #52146.
9469
9470 2004-04-29  Martin Baulig  <martin@ximian.com>
9471
9472         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9473
9474         * statement.cs (Using.EmitLocalVariableDecls): Use
9475         TypeManager.idisposable_type, not typeof (IDisposable).
9476         (Foreach.EmitCollectionForeach): Added support for valuetypes.
9477
9478 2004-04-29  Martin Baulig  <martin@ximian.com>
9479
9480         * class.cs (Event.Define): Don't emit the field and don't set
9481         RTSpecialName and SpecialName for events on interfaces.  Fixes
9482         #57703. 
9483
9484 2004-04-29  Raja R Harinath  <rharinath@novell.com>
9485
9486         Refactor Attribute.ApplyAttributes.
9487         * attribute.cs (Attributable): New base class for objects that can
9488         have Attributes applied on them.
9489         (Attribute): Make AttributeUsage fields public.
9490         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9491         (Attribute.IsInternalCall): New property.
9492         (Attribute.UsageAttr): Convert to a public read-only property.
9493         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9494         (Attribute.ResolveType, Attribute.Resolve)
9495         (Attribute.ScanForIndexerName): Update to reflect changes.
9496         (Attribute.CheckAttributeTarget): Re-format.
9497         (Attribute.ApplyAttributes): Refactor, to various
9498         Attributable.ApplyAttributeBuilder methods.
9499         * decl.cs (MemberCore): Make Attributable.
9500         * class.cs (Accessor): Make Attributable.
9501         (MethodData.ApplyAttributes): Use proper attribute types, not
9502         attribute names.
9503         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9504         (TypeContainer.ApplyAttributeBuilder)
9505         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9506         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
9507         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9508         (Operator.ApplyAttributeBuilder): New factored-out methods.
9509         * const.cs (Const.ApplyAttributeBuilder): Likewise.
9510         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9511         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9512         * parameter.cs (ParameterBase): New Attributable base class
9513         that can also represent Return types.
9514         (Parameter): Update to the changes.
9515
9516 2004-04-29  Jackson Harper  <jackson@ximian.com>
9517
9518         * driver.cs: Prefer the corlib system version when looking for
9519         assemblies in the GAC. This is still a hack, but its a better hack
9520         now.
9521         
9522 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
9523
9524         * decl.cs, enum.cs: Improved error 3005 reporting.
9525   
9526         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9527         (related_symbols): New private member for list of symbols
9528         related to reported error/warning.
9529         
9530         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9531
9532 2004-04-29  Martin Baulig  <martin@ximian.com>
9533
9534         * ecore.cs (Expression.Constantify): If we're an enum and
9535         TypeManager.TypeToCoreType() doesn't give us another type, use
9536         t.UnderlyingSystemType.  Fixes #56178.  
9537
9538 2004-04-29  Martin Baulig  <martin@ximian.com>
9539
9540         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9541         interfaces and for each interface, only add members directly
9542         declared in that interface.  Fixes #53255.
9543
9544 2004-04-28  Martin Baulig  <martin@ximian.com>
9545
9546         * expression.cs (ConditionalLogicalOperator): Use a temporary
9547         variable for `left' to avoid that we evaluate it more than once;
9548         bug #52588.
9549
9550 2004-04-28  Martin Baulig  <martin@ximian.com>
9551
9552         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9553         `void[]' (CS1547).
9554
9555 2004-04-28  Martin Baulig  <martin@ximian.com>
9556
9557         * statement.cs (LocalInfo.Resolve): Check whether the type is not
9558         void (CS1547).
9559
9560         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9561         whether the type is not void (CS1547).
9562
9563 2004-04-28  Martin Baulig  <martin@ximian.com>
9564
9565         * expression.cs (Unary.DoResolveLValue): Override this and report
9566         CS0131 for anything but Operator.Indirection.
9567
9568 2004-04-28  Martin Baulig  <martin@ximian.com>
9569
9570         Committing a patch from Ben Maurer; see bug #50820.
9571
9572         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9573         check for classes.
9574
9575         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9576         classes.        
9577
9578 2004-04-28  Martin Baulig  <martin@ximian.com>
9579
9580         Committing a patch from Ben Maurer; see bug #50820.
9581
9582         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9583         check for classes.
9584
9585         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9586         classes.        
9587
9588 2004-04-28  Martin Baulig  <martin@ximian.com>
9589
9590         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9591         (Block.AddLabel): Call DoLookupLabel() to only search in the
9592         current block.
9593
9594 2004-04-28  Martin Baulig  <martin@ximian.com>
9595
9596         * cfold.cs (ConstantFold.BinaryFold): Added special support for
9597         comparing StringConstants and NullLiterals in Equality and Inequality.
9598
9599 2004-04-28  Jackson Harper  <jackson@ximian.com>
9600
9601         * driver.cs: Attempt to load referenced assemblies from the
9602         GAC. This is the quick and dirty version of this method that
9603         doesnt take into account versions and just takes the first
9604         canidate found. Will be good enough for now as we will not have more
9605         then one version installed into the GAC until I update this method.
9606
9607 2004-04-28  Martin Baulig  <martin@ximian.com>
9608
9609         * typemanager.cs (TypeManager.CheckStructCycles): New public
9610         static method to check for cycles in the struct layout.
9611
9612         * rootcontext.cs (RootContext.PopulateTypes): Call
9613         TypeManager.CheckStructCycles() for each TypeContainer.
9614         [Note: We only need to visit each type once.]
9615
9616 2004-04-28  Martin Baulig  <martin@ximian.com>
9617
9618         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9619
9620         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9621         success and added `out object value'.  Use a `bool resolved' field
9622         to check whether we've already been called rather than
9623         `ConstantValue != null' since this breaks for NullLiterals.
9624
9625 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9626
9627         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9628         setting of this flag, since the 'set' method may be non-public.
9629
9630 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9631
9632         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9633         check on current_vector.Block.
9634
9635 2004-04-27  Martin Baulig  <martin@ximian.com>
9636
9637         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9638         a field initializer.  Fixes #56459.
9639
9640 2004-04-27  Martin Baulig  <martin@ximian.com>
9641
9642         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9643         we're not attempting to use an indexer.  Fixes #52154.
9644
9645 2004-04-27  Martin Baulig  <martin@ximian.com>
9646
9647         * statement.cs (Return): Don't create a return label if we don't
9648         need it; reverts my change from January 20th.  Thanks to Ben
9649         Maurer for this.
9650
9651 2004-04-27  Martin Baulig  <martin@ximian.com>
9652
9653         According to the spec, `goto' can only leave a nested scope, but
9654         never enter it.
9655
9656         * statement.cs (Block.LookupLabel): Only lookup in the current
9657         block, don't recurse into parent or child blocks.
9658         (Block.AddLabel): Check in parent and child blocks, report
9659         CS0140/CS0158 if we find a duplicate.
9660         (Block): Removed this indexer for label lookups.
9661         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9662         this already does the error reporting for us.
9663
9664         * flowanalysis.cs
9665         (FlowBranching.UsageVector.Block): New public variable; may be null.
9666         (FlowBranching.CreateSibling): Added `Block' argument.
9667         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
9668         label for the target of a `goto' and check whether we're not
9669         leaving a `finally'.
9670
9671 2004-04-27  Martin Baulig  <martin@ximian.com>
9672
9673         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9674         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9675         just for returns).
9676
9677 2004-04-27  Martin Baulig  <martin@ximian.com>
9678
9679         * statement.cs (Block.AddLabel): Also check for implicit blocks
9680         and added a CS0158 check.
9681
9682 2004-04-27  Martin Baulig  <martin@ximian.com>
9683
9684         * flowanalysis.cs (FlowBranchingLoop): New class.
9685         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9686         UsageVector's instead of an ArrayList.
9687         (FlowBranching.Label): Likewise.
9688         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9689         (FlowBranching.AddBreakVector): New method.
9690
9691 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
9692
9693         * attribute.cs: Small regression fix: only convert the type if we
9694         the type is different, fixes System.Drawing build.
9695
9696 2004-04-27  Martin Baulig  <martin@ximian.com>
9697
9698         * attribute.cs (Attribute.Resolve): If we have a constant value
9699         for a named field or property, implicity convert it to the correct
9700         type.
9701
9702 2004-04-27  Raja R Harinath  <rharinath@novell.com>
9703
9704         * statement.cs (Block.Block): Implicit blocks share
9705         'child_variable_names' fields with parent blocks.
9706         (Block.AddChildVariableNames): Remove.
9707         (Block.AddVariable): Mark variable as "used by a child block" in
9708         every surrounding block.
9709         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9710         been used in a child block, complain about violation of "Invariant
9711         meaning in blocks" rule.
9712         * cs-parser.jay (declare_local_variables): Don't use
9713         AddChildVariableNames.
9714         (foreach_statement): Don't create an implicit block: 'foreach'
9715         introduces a scope.
9716
9717 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
9718
9719         * convert.cs (ImplicitNumericConversion): 0 is also positive when
9720         converting from 0L to ulong.  Fixes 57522.
9721
9722 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9723
9724         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9725         derived class hides via 'new' keyword field from base class (test-242.cs).
9726         TODO: Handle this in the more general way.
9727         
9728         * class.cs (CheckBase): Ditto.
9729
9730 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9731
9732         * decl.cs (caching_flags): New member for storing cached values
9733         as bit flags.
9734         (MemberCore.Flags): New enum where bit flags for caching_flags
9735         are defined.
9736         (MemberCore.cls_compliance): Moved to caching_flags.
9737         (DeclSpace.Created): Moved to caching_flags.
9738
9739         * class.cs: Use caching_flags instead of DeclSpace.Created
9740         
9741 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
9742
9743         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9744         if we are only a derived class, not a nested class.
9745
9746         * typemanager.cs: Same as above, but do this at the MemberLookup
9747         level (used by field and methods, properties are handled in
9748         PropertyExpr).   Allow for the qualified access if we are a nested
9749         method. 
9750
9751 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
9752
9753         * class.cs: Refactoring.
9754         (IMethodData): New inteface; Holds links to parent members
9755         to avoid member duplication (reduced memory allocation).
9756         (Method): Implemented IMethodData interface.
9757         (PropertyBase): New inner classes for get/set methods.
9758         (PropertyBase.PropertyMethod): Implemented IMethodData interface
9759         (Event): New inner classes for add/remove methods.
9760         (Event.DelegateMethod): Implemented IMethodData interface.
9761
9762         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9763         EmitContext (related to class.cs refactoring).
9764
9765 2004-04-21  Raja R Harinath  <rharinath@novell.com>
9766
9767         * delegate.cs (Delegate.VerifyApplicability): If the number of
9768         arguments are the same as the number of parameters, first try to
9769         verify applicability ignoring  any 'params' modifier on the last
9770         parameter.
9771         Fixes #56442.
9772
9773 2004-04-08  Martin Baulig  <martin@ximian.com>
9774
9775         Merged latest changes into gmcs.  Please keep this comment in
9776         here, it makes it easier for me to see what changed in MCS since
9777         the last time I merged.
9778
9779 2004-04-16  Raja R Harinath  <rharinath@novell.com>
9780
9781         * class.cs (TypeContainer.AddIndexer): Use
9782         'ExplicitInterfaceName' to determine if interface name was
9783         explicitly specified.  'InterfaceType' is not initialized at this time.
9784         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
9785         Indexers array is already in the required order.  Initialize
9786         'IndexerName' only if there are normal indexers.
9787         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
9788         (TypeContainer.Emit): Emit DefaultMember attribute only if
9789         IndexerName is initialized.
9790         Fixes #56300.
9791
9792 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
9793
9794         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
9795         Fixes #57007
9796
9797 2004-04-15  Raja R Harinath  <rharinath@novell.com>
9798
9799         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
9800         attributes.
9801         Fix for #56456.
9802
9803         * attribute.cs (Attribute.Resolve): Check for duplicate named
9804         attributes.
9805         Fix for #56463.
9806
9807 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
9808
9809         * iterators.cs (MarkYield): track whether we are in an exception,
9810         and generate code accordingly.  Use a temporary value to store the
9811         result for our state.
9812
9813         I had ignored a bit the interaction of try/catch with iterators
9814         since their behavior was not entirely obvious, but now it is
9815         possible to verify that our behavior is the same as MS .NET 2.0
9816
9817         Fixes 54814
9818
9819 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
9820
9821         * iterators.cs: Avoid creating temporaries if there is no work to
9822         do. 
9823
9824         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
9825         Enumerations, use TypeManager.EnumToUnderlying and call
9826         recursively. 
9827
9828         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
9829         bug #57013
9830
9831         (This.Emit): Use EmitContext.EmitThis to emit our
9832         instance variable.
9833
9834         (This.EmitAssign): Ditto.
9835
9836         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
9837         codepaths, we will move all the functionality into
9838         Mono.CSharp.This 
9839
9840         (FieldExpr.EmitAssign): Ditto.
9841
9842         This fixes several hidden bugs that I uncovered while doing a code
9843         review of this today.
9844
9845         * codegen.cs (EmitThis): reworked so the semantics are more clear
9846         and also support value types "this" instances.
9847
9848         * iterators.cs: Changed so that for iterators in value types, we
9849         do not pass the value type as a parameter.  
9850
9851         Initialization of the enumerator helpers is now done in the caller
9852         instead of passing the parameters to the constructors and having
9853         the constructor set the fields.
9854
9855         The fields have now `assembly' visibility instead of private.
9856
9857 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
9858
9859         * expression.cs (Argument.Resolve): Check if fields passed as ref
9860         or out are contained in a MarshalByRefObject.
9861
9862         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
9863         another compiler type.
9864
9865 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
9866
9867         * class.cs (Indexer.Define): use the new name checking method.
9868         Also, return false on an error.
9869         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
9870         (is_identifier_[start/part]_character): make static.
9871
9872 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
9873
9874         * expression.cs (Binary.ResolveOperator): Do no append strings
9875         twice: since we can be invoked more than once (array evaluation)
9876         on the same concatenation, take care of this here.  Based on a fix
9877         from Ben (bug #56454)
9878
9879 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
9880
9881         * codegen.cs: Fix another case where CS1548 must be reported (when 
9882         delay-sign isn't specified and no private is available #56564). Fix
9883         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
9884         error when MCS is used on the MS runtime and we need to delay-sign 
9885         (which seems unsupported by AssemblyBuilder - see #56621).
9886
9887 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
9888
9889         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
9890         (TypeManager.ComputeNamespaces): Faster implementation for
9891         Microsoft runtime.
9892
9893         * compiler.csproj: Updated AssemblyName to mcs.
9894
9895 2004-05-11  Jackson Harper  <jackson@ximian.com>
9896
9897         * Makefile: Preserve MONO_PATH
9898         
9899 2004-05-11  Jackson Harper  <jackson@ximian.com>
9900
9901         * Makefile: Use mono and mcs to build gmcs
9902         
9903 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
9904
9905         * codegen.cs: Add patch from Robert Shade
9906         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
9907         sync with mcs.
9908
9909 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
9910
9911         * CryptoConvert.cs: Updated to latest version. Fix issue with 
9912         incomplete key pairs (#57941).
9913
9914 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
9915
9916         * codegen.cs: Fix another case where CS1548 must be reported (when 
9917         delay-sign isn't specified and no private is available #56564). Fix
9918         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
9919         error when MCS is used on the MS runtime and we need to delay-sign 
9920         (which seems unsupported by AssemblyBuilder - see #56621).
9921
9922 2004-04-29  Jackson Harper  <jackson@ximian.com>
9923
9924         * Makefile: Set MONO_PATH to use the bootstrap corlib
9925         * driver.cs: Check the GAC for referenced assemblies.
9926                 
9927 2004-04-29  Martin Baulig  <martin@ximian.com>
9928
9929         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
9930
9931 2004-04-07  Martin Baulig  <martin@ximian.com>
9932
9933         * expression.cs (Binary.ResolveOperator): Added special case for
9934         Equality/Inequality between a type parameter and a null literal.
9935
9936 2004-04-07  Martin Baulig  <martin@ximian.com>
9937
9938         * convert.cs: Check null literal -> type parameter conversions.
9939
9940 2004-04-07  Martin Baulig  <martin@ximian.com>
9941
9942         * generic.cs (ConstructedType.CheckConstraints): Enforce the
9943         `class' and `struct' constraints.
9944
9945 2004-04-07  Martin Baulig  <martin@ximian.com>
9946
9947         * generic.cs (SpecialConstraint): New public enum.
9948         (Constraints.Resolve): Added support for the `class' and `struct'
9949         constraints.
9950
9951         * cs-parser.jay (type_parameter_constraint): Added support for the
9952         `class' and `struct' constraints.
9953
9954 2004-04-07  Martin Baulig  <martin@ximian.com>
9955
9956         * support.cs (GenericConstraints): Replaced `Types' by
9957         `ClassConstraint' and `InterfaceConstraints'; added
9958         `HasClassConstraint'.   
9959
9960 2004-04-07  Martin Baulig  <martin@ximian.com>
9961
9962         * generic.cs
9963         (Constraints.InterfaceConstraints): New public property.
9964         (Constraints.Types): Make this property public
9965         (TypeParameter): Implement IMemberContainer.
9966         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
9967         instead of a TypeBuilder/MethodBuilder; pass the interface
9968         constraints to TypeManager.AddTypeParameter().
9969         (TypeParameter.DefineType): Just take an EmitContext and no
9970         TypeBuilder/MethodBuilder.  Use the new public API.
9971
9972         * typemanager.cs (TypeManager.AddTypeParameter): Added
9973         `TypeExpr[]' argument; add the interfaces to the
9974         `builder_to_ifaces' hash.
9975         (TypeManager.LookupMemberContainer): For
9976         GenericTypeParameterBuilders, get the TypeParameter from the
9977         `builder_to_type_param'.
9978         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
9979         the TypeParameter and call FindMembers on it.
9980
9981 2004-04-07  Martin Baulig  <martin@ximian.com>
9982
9983         * class.cs
9984         (MethodCore.GenericMethod): Moved this field here from Method.
9985         (MethodCore.IsDuplicateImplementation): Take the number of type
9986         parameters into account if we're a generic method.
9987
9988         * expression.cs (Invocation.InferTypeArguments): Don't return true
9989         if `arguments' is null; we still need to check whether we actually
9990         don't need to infer anything in this case.
9991         (MemberAccess): Merged the functionality from GenericMemberAccess
9992         into this class.
9993
9994         * generic.cs (GenericMemberAccess): Removed.
9995
9996 2004-04-05  Martin Baulig  <martin@ximian.com>
9997
9998         * decl.cs (MemberCore): For generic classes, interfaces and
9999         structs, `Name' now includes the number of type parameters
10000         ("Stack!1.Node!1").
10001         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
10002         encode the number of type arguments in the type name.
10003
10004         * expression.cs (Expression.MemberLookup): Removed the
10005         `num_type_args' argument; we now encode the number of type
10006         arguments in the type name.
10007
10008         * ecore.cs (SimpleName): Encode the number of type arguments in
10009         the type name itself.
10010
10011         * generic.cs (ConstructedType): Likewise.
10012
10013         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
10014         `MemberName'; we now include the number of type parameters in the
10015         type name.
10016
10017         * typemanager.cs (TypeManager.CheckGeneric): Removed.
10018         (TypeManager.MemberLookup): Removed the
10019         `num_type_args' argument; we now encode the number of type
10020         arguments in the type name.     
10021
10022 2004-04-03  Martin Baulig  <martin@ximian.com>
10023
10024         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
10025         (MemberCore.MemberName): Moved here from MemberBase.
10026         (DeclSpace.SetParameterInfo): Just take the constraints as an
10027         ArrayList; we already have the type parameters in our
10028         `MemberName'; also do the CS0080 reporting here.
10029
10030         * cs-parser.jay (struct_declaration): Use `member_name' instead of
10031         `IDENTIFIER opt_type_parameter_list'; when constructing our
10032         `MemberName', it'll already include our type parameters.
10033         (class_declaration, interface_declaration): Likewise.
10034         (delegate_declaration): Likewise.
10035         (MakeName): Take a MemberName and return a MemberName.
10036         The following two changes are required to avoid shift/reduce conflicts:
10037         (member_name): Don't include a TypeName anymore; ie. this is now
10038         just 'IDENTIFIER opt_type_parameter_list'.
10039         (property_declaration, event_declaration): Use a
10040         `namespace_or_type_name' instead of a `member_name'.            
10041
10042 2004-04-03  Martin Baulig  <martin@ximian.com>
10043
10044         * decl.cs (MemberName): Renamed to `TypeName' and created a new
10045         `MemberName' class.
10046         (TypeName): Formerly known as MemberName.
10047
10048         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
10049         instead of a `MemberName'.
10050
10051         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
10052         (member_name): New rule; create a MemberName.
10053
10054 2004-04-02  Martin Baulig  <martin@ximian.com>
10055
10056         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
10057         (CS0305 and CS0308).
10058
10059 2004-04-02  Martin Baulig  <martin@ximian.com>
10060
10061         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
10062         support for nested types.
10063
10064 2004-04-02  Martin Baulig  <martin@ximian.com>
10065
10066         * ecore.cs (IAlias): New public interface.
10067         (TypeExpr, TypeExpression): Implement IAlias.
10068         (TypeAliasExpression): New public class.
10069
10070         * namespace.cs (Namespace): Implement IAlias.
10071         (Namespace.Lookup): Return an IAlias instead on an object.
10072         (Namespace.DefineName): Take an IAlias instead of an object.
10073         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
10074         an object.
10075         (NamespaceEntry.UsingAlias): Take a Membername instead of an
10076         Expression.
10077         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
10078         object.
10079         (NamespaceEntry.Lookup): Likewise.
10080
10081         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
10082         instead of a Type.      
10083
10084         * decl.cs (DeclSpace): Implement IAlias.
10085         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
10086
10087         * generic.cs (ConstructedType): Improved error checking.
10088
10089 2004-04-02  Martin Baulig  <martin@ximian.com>
10090
10091         * convert.cs: Added type parameter conversions.
10092
10093         * ecore.cs
10094         (UnboxCast.Emit): Emit an `unbox.any' for type params.
10095         (ClassCast.Emit): If the source type is a type parameter, box it.
10096         If the target type is a type parameter, emit an `unbox.any'
10097         instead of a `classcast'.1      
10098
10099 2004-04-01  Martin Baulig  <martin@ximian.com>
10100
10101         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
10102
10103 2004-04-01  Martin Baulig  <martin@ximian.com>
10104
10105         * generic.cs (ConstructedType.CheckConstraints): Use
10106         Convert.ImplicitStandardConversionExists(); user-defined implicit
10107         conversions are not allowed according to the spec.
10108
10109 2004-03-30  Martin Baulig  <martin@ximian.com>
10110
10111         * expression.cs (New): Added support for type parameters.
10112
10113         * typemanager.cs
10114         (TypeManager.activator_type): New public static field.
10115         (TypeManager.activator_create_instance): Likewise.
10116
10117 2004-03-30  Martin Baulig  <martin@ximian.com>
10118
10119         * typemanager.cs (TypeManager.HasConstructorConstraint): New
10120         public method.
10121
10122 2004-03-30  Martin Baulig  <martin@ximian.com>
10123
10124         * generic.cs (ConstructedType.CheckConstraints): Actually follow
10125         the spec here: the argument type must be convertible to the
10126         constraints.
10127
10128 2004-03-30  Martin Baulig  <martin@ximian.com>
10129
10130         * generic.cs
10131         (TypeParameter.Define, TypeParameter.DefineMethod): Call
10132         TypeManager.AddTypeParameter().
10133         (ConstructedType.CheckConstraints): Re-enable this and actually
10134         check whether we have a constructor constraint.
10135
10136         * typemanager.cs
10137         (TypeManager.builder_to_type_param): New static field.
10138         (TypeManager.AddTypeParameter): New static method.
10139         (TypeManager.LookupTypeParameter): New public method.
10140
10141 2004-03-30  Martin Baulig  <martin@ximian.com>
10142
10143         * generic.cs (TypeParameter.DefineType): Return a boolean and use
10144         the new API to actually define the constructor constraint.
10145
10146         * typemanager.cs
10147         (TypeManager.new_constraint_attr_type): New static field.
10148         (TypeManager.InitCoreTypes): Initialize it.
10149
10150 2004-03-30  Martin Baulig  <martin@ximian.com>
10151
10152         * generic.cs (Constraints): Completed error checking, use correct
10153         error numbers.
10154
10155 2004-03-29  Martin Baulig  <martin@ximian.com>
10156
10157         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
10158
10159         * expression.cs (Invocation.InferTypeArguments): Added overloaded
10160         public version which takes a `ParameterData pd' instead of an
10161         `ArrayList args'.
10162
10163 2004-03-29  Martin Baulig  <martin@ximian.com>
10164
10165         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
10166         not a MethodInfo.       
10167
10168 2004-03-29  Martin Baulig  <martin@ximian.com>
10169
10170         * expression.cs (Argument.ResolveMethodGroup): If we're a
10171         ConstructedType, call GetMemberAccess() on it.  
10172
10173 2004-03-29  Martin Baulig  <martin@ximian.com>
10174
10175         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
10176         (MethodCore.CheckGenericOverride): When overriding a generic
10177         method, check whether the constraints match.
10178
10179         * support.cs (GenericConstraints): New public interface.
10180         (ParameterData.GenericConstraints): New public method.
10181
10182         * parameter.cs (Parameter.Resolve): Check whether we're a generic
10183         method parameter and compute our constraints if appropriate.
10184         (Parameter.GenericConstraints): New public property.
10185
10186         * generic.cs (Constraints): Implement GenericConstraints.
10187
10188 2004-03-29  Martin Baulig  <martin@ximian.com>
10189
10190         * decl.cs (MemberCache.FindMemberToOverride): Use
10191         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
10192
10193 2004-03-29  Martin Baulig  <martin@ximian.com>
10194
10195         * generic.cs (GenericMethod.Define): Resolve our type parameters.
10196
10197 2004-03-29  Martin Baulig  <martin@ximian.com>
10198
10199         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
10200         not allowed on non-generic declarations").
10201
10202 2004-03-29  Martin Baulig  <martin@ximian.com>
10203
10204         * expression.cs (Invocation.InferTypeArguments): Added overloaded
10205         public version of this method.
10206
10207         * class.cs (MethodCore.IsDuplicateImplementation): Use
10208         Invocation.InferTypeArguments() to check this.
10209
10210 2004-03-29  Martin Baulig  <martin@ximian.com>
10211
10212         * convert.cs: Use TypeManager.IsDelegateType() instead of
10213         comparing types correctly.
10214
10215 2004-03-29  Martin Baulig  <martin@ximian.com>
10216
10217         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
10218         types directly to make it work for generic instances.
10219
10220         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
10221
10222 2004-03-29  Martin Baulig  <martin@ximian.com>
10223
10224         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
10225         support for arrays.     
10226
10227 2004-03-24  Martin Baulig  <martin@ximian.com>
10228
10229         * decl.cs (DeclSpace.FindType): Also use
10230         TypeManager.CheckGeneric() for types from the using clauses.
10231
10232 2004-03-23  Martin Baulig  <martin@ximian.com>
10233
10234         * expression.cs (Invocation.OverloadResolve): Added `bool
10235         may_fail' argument and use it instead of the Location.IsNull() hack.
10236
10237 2004-03-23  Martin Baulig  <martin@ximian.com>
10238
10239         * expression.cs (Invocation.InferType): Use correct type inference
10240         rules here.     
10241
10242 2004-03-23  Martin Baulig  <martin@ximian.com>
10243
10244         * ecore.cs (MethodGroupExpr.Name): Use
10245         TypeManager.CSharpSignature() instead of just the name.
10246
10247         * expression.cs (Invocation.OverloadResolve): Provide better error
10248         reporting.
10249         (Invocation.DoResolve): OverloadResolve() never returns null
10250         without reporting an error, so removed the error -6 reporting here.
10251
10252 2004-03-23  Martin Baulig  <martin@ximian.com>
10253
10254         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
10255         generic methods.
10256
10257         * cs-parser.jay (delegate_declaration): Support generic delegates.
10258
10259         * delegate.cs: Support generic delegates.
10260
10261 2004-03-22  Martin Baulig  <martin@ximian.com>
10262
10263         * expression.cs (Invocation.InferParamsTypeArguments): New static
10264         method; does type inference for params arguments.
10265
10266 2004-03-21  Martin Baulig  <martin@ximian.com>
10267
10268         * typemanager.cs (TypeManager.IsGenericMethod): New public static
10269         method; checks whether a method is a generic method.    
10270
10271         * expression.cs (Invocation.InferTypeArguments): New static method;
10272         infer type arguments for generic method invocation.
10273
10274         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
10275         property; we set this to true if we're resolving a generic method
10276         invocation and the user specified type arguments, ie. we're not
10277         doing type inference.
10278
10279 2004-03-20  Martin Baulig  <martin@ximian.com>
10280
10281         * class.cs (MethodData.DeclaringType): New public property.
10282         (MethodData.Define): Set DeclaringType here.
10283         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
10284         instead of OperatorMethodBuilder.DeclaringType.
10285
10286 2004-03-20  Martin Baulig  <martin@ximian.com>
10287
10288         * cs-tokenizer.cs (xtoken): Return a special
10289         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
10290
10291         * cs-parser.jay (default_value_expression): Switch to the new
10292         syntax (14.5.13).
10293
10294 2004-03-19  Martin Baulig  <martin@ximian.com>
10295
10296         * decl.cs (MemberName): New class.  We use this to "construct"
10297         namespace_or_type_name's.
10298
10299         * generics.cs (TypeArguments.GetDeclarations): New public method;
10300         returns the type arguments as a string[] and reports a CS0081 if
10301         one of them is not an identifier.
10302
10303         * class.cs (MemberBase): The .ctor now takes the name as a
10304         MemberName instead of a string.
10305         (MemberBase.ExplicitInterfaceName): Changed type from string to
10306         Expression.
10307         (MemberBase.DoDefine): If we're an explicit implementation, the
10308         InterfaceType may be a generic instance.
10309
10310         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
10311         (namespace_name): Call MemberName.GetName () to transform the
10312         MemberName into a string and ensure we don't have any type
10313         arguments.
10314         (type_name): Call MemberName.GetTypeExpression() to transfrom the
10315         MemberName into an expression.
10316         (method_header): Use namespace_or_type_name instead of member_name.     
10317
10318 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
10319
10320         * rootcontext.cs: Add new types to the boot resolution.
10321
10322         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
10323         MulticastDelegate is not allowed.
10324
10325         * typemanager.cs: Add new types to lookup: System.TypedReference
10326         and ArgIterator.
10327
10328         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
10329         check for TypedReference or ArgIterator, they are not allowed. 
10330
10331         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
10332         makes us properly catch 1510 in some conditions (see bug 56016 for
10333         details). 
10334
10335 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
10336
10337         * CryptoConvert.cs: update from corlib version
10338         with endian fixes.
10339
10340 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
10341
10342         * class.cs (Indexer.Define): Check indexername declaration
10343
10344 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
10345
10346         * attribute.cs (IsClsCompliant): Fixed problem with handling
10347         all three states (compliant, not-compliant, undetected).
10348
10349 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
10350
10351         * attribute.cs (Attribute): Location is now public.
10352         (Resolve): Store resolved arguments (pos_values) in attribute class.
10353         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
10354         (GetClsCompliantAttributeValue): New method that gets
10355         CLSCompliantAttribute value.
10356         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
10357         if exists else null.
10358         (AttributeTester): New class for CLS-Compliant verification routines.
10359
10360         * class.cs (Emit): Add CLS-Compliant verification.
10361         (Method.GetSignatureForError): Implemented.
10362         (Constructor.GetSignatureForError): Implemented
10363         (Constructor.HasCompliantArgs): Returns if constructor has
10364         CLS-Compliant arguments.
10365         (Constructor.Emit): Override.
10366         (Construcor.IsIdentifierClsCompliant): New method; For constructors
10367         is needed to test only parameters.
10368         (FieldBase.GetSignatureForError): Implemented.
10369         (TypeContainer): New member for storing base interfaces.
10370         (TypeContainer.FindMembers): Search in base interfaces too.
10371
10372         * codegen.cs (GetClsComplianceAttribute): New method that gets
10373         assembly or module CLSCompliantAttribute value.
10374         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10375         for assembly.
10376         (ModuleClass.Emit): Add error 3012 test.
10377
10378         * const.cs (Emit): Override and call base for CLS-Compliant tests.
10379
10380         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10381         state for all decl types.
10382         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10383         if CLS-Compliant tests are required.
10384         (IsClsCompliaceRequired): New method. Analyze whether code
10385         must be CLS-Compliant.
10386         (IsExposedFromAssembly): New method. Returns true when MemberCore
10387         is exposed from assembly.
10388         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10389         value or gets cached value.
10390         (HasClsCompliantAttribute): New method. Returns true if MemberCore
10391         is explicitly marked with CLSCompliantAttribute.
10392         (IsIdentifierClsCompliant): New abstract method. This method is
10393         used to testing error 3005.
10394         (IsIdentifierAndParamClsCompliant): New method. Common helper method
10395         for identifier and parameters CLS-Compliant testing.
10396         (VerifyClsCompliance): New method. The main virtual method for
10397         CLS-Compliant verifications.
10398         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10399         null. I don't know why is null (too many public members !).
10400         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10401         and get value of first CLSCompliantAttribute that found.
10402
10403         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10404         (VerifyClsCompliance): Override and add extra tests.
10405
10406         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10407         clscheck- disable CLS-Compliant verification event if assembly is has
10408         CLSCompliantAttribute(true).
10409
10410         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10411         ApllyAttribute is now called in emit section as in the other cases.
10412         Possible future Emit integration.
10413         (IsIdentifierClsCompliant): New override.
10414         (VerifyClsCompliance): New override.
10415         (GetEnumeratorName): Returns full enum name.
10416
10417         * parameter.cs (GetSignatureForError): Implemented.
10418
10419         * report.cs (WarningData): New struct for Warning message information.
10420         (LocationOfPreviousError): New method.
10421         (Warning): New method. Reports warning based on the warning table.
10422         (Error_T): New method. Reports error based on the error table.
10423
10424         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10425         verifications are done here.
10426
10427         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10428
10429         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10430         CLSCompliantAttribute.
10431         (all_imported_types): New member holds all imported types from other
10432         assemblies.
10433         (LoadAllImportedTypes): New method fills static table with exported types
10434         from all referenced assemblies.
10435         (Modules): New property returns all assembly modules.
10436
10437 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
10438
10439         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10440         throwing a parser error.
10441
10442         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10443         which removes the hardcoded get_/set_ prefixes for properties, as
10444         IL allows for the properties to be named something else.  
10445
10446         Bug #56013
10447
10448         * expression.cs: Do not override operand before we know if it is
10449         non-null.  Fix 56207
10450
10451 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10452
10453         * typemanager.cs: support for pinned variables.
10454
10455 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10456
10457         * decl.cs, typemanager.cs: Avoid using an arraylist
10458         as a buffer if there is only one result set.
10459
10460 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10461
10462         * expression.cs: Make sure you cant call a static method
10463         with an instance expression, bug #56174.
10464
10465 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
10466
10467         * class.cs (IsDuplicateImplementation): Improve error reporting to
10468         flag 663 (method only differs in parameter modifier).
10469
10470         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10471         in preprocessor directives.
10472
10473         * location.cs (LookupFile): Allow for the empty path.
10474
10475         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
10476         better approach for some of that patch, but its failing with the
10477         CharSet enumeration.  For now try/catch will do.
10478
10479         * typemanager.cs: Do not crash if a struct does not have fields.
10480         Fixes 56150.
10481
10482 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10483
10484         * expression.cs: cs0213, cant fix a fixed expression.
10485         fixes 50231.
10486
10487 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10488
10489         * cs-parser.jay: detect invalid embeded statements gracefully.
10490         bug #51113.
10491
10492 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10493
10494         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10495         As a regex:
10496         s/
10497         the invocation type may not be a subclass of the tye of the item/
10498         The type of the item must be a subclass of the invocation item.
10499         /g
10500
10501         Fixes bug #50820.
10502
10503 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
10504
10505         * attribute.cs: Added methods to get a string and a bool from an
10506         attribute. Required to information from AssemblyKeyFileAttribute,
10507         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10508         * codegen.cs: Modified AssemblyName creation to include support for
10509         strongnames. Catch additional exceptions to report them as CS1548.
10510         * compiler.csproj: Updated include CryptoConvert.cs.
10511         * compiler.csproj.user: Removed file - user specific configuration.
10512         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
10513         Mono.Security assembly. The original class is maintained and tested in
10514         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10515         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10516         like CSC 8.0 (C# v2) supports.
10517         * Makefile: Added CryptoConvert.cs to mcs sources.
10518         * rootcontext.cs: Added new options for strongnames.
10519
10520 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
10521
10522         * driver.cs: For --expect-error, report error code `2'
10523         if the program compiled with no errors, error code `1' if
10524         it compiled with an error other than the one expected.
10525
10526 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
10527
10528         * compiler.csproj: Updated for Visual Studio .NET 2003.
10529         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10530         * compiler.sln: Updated for Visual Studio .NET 2003.
10531
10532 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
10533
10534         * expression.cs: Fix bug #47234. We basically need to apply the
10535         rule that we prefer the conversion of null to a reference type
10536         when faced with a conversion to 'object' (csc behaviour).
10537
10538 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10539
10540         * statement.cs: Shorter form for foreach, eliminates
10541         a local variable. r=Martin.
10542
10543 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10544
10545         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10546         checks if we can use brtrue/brfalse to test for 0.
10547         * expression.cs: use the above in the test for using brtrue/brfalse.
10548         cleanup code a bit.
10549
10550 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10551
10552         * expression.cs: Rewrite string concat stuff. Benefits:
10553
10554         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10555         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10556         rather than a concat chain.
10557
10558         * typemanager.cs: Add lookups for more concat overloads.
10559
10560 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10561
10562         * expression.cs: Emit shorter il code for array init.
10563
10564         newarr
10565         dup
10566         // set 1
10567
10568         // set 2
10569
10570         newarr
10571         stloc.x
10572
10573         ldloc.x
10574         // set 1
10575
10576         ldloc.x
10577         // set 2
10578
10579 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
10580
10581         * statement.cs: Before, two switch blocks would be merged if the
10582         total size of the blocks (end_item - begin_item + 1) was less than
10583         two times the combined sizes of the blocks.
10584
10585         Now, it will only merge if after the merge at least half of the
10586         slots are filled.
10587
10588         fixes 55885.
10589
10590 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
10591
10592         * class.cs : csc build fix for GetMethods(). See bug #52503.
10593
10594 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
10595
10596         * expression.cs: Make sure fp comparisons work with NaN.
10597         This fixes bug #54303. Mig approved this patch a long
10598         time ago, but we were not able to test b/c the runtime
10599         had a related bug.
10600
10601 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
10602
10603         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
10604
10605 2004-03-19  Martin Baulig  <martin@ximian.com>
10606
10607         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
10608         two overloads may unify for some type parameter substitutions and
10609         report a CS0408 if appropriate.
10610
10611 2004-03-19  Martin Baulig  <martin@ximian.com>
10612
10613         * class.cs (MemberCore.IsDuplicateImplementation): Report the
10614         error here and not in our caller.
10615
10616 2004-03-19  Martin Baulig  <martin@ximian.com>
10617
10618         * interface.cs: Completely killed this file.
10619         (Interface): We're now a TypeContainer and live in class.cs.
10620
10621         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
10622         argument; we're now also called for interfaces.
10623         (TypeContainer.DefineMembers): Allow this method being called
10624         multiple times.
10625         (TypeContainer.GetMethods): New public method; formerly known as
10626         Interface.GetMethod().  This is used by PendingImplementation.
10627         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
10628         it's now private and non-static.
10629         (Interface): Moved this here; it's now implemented similar to
10630         Class and Struct.
10631         (Method, Property, Event, Indexer): Added `bool is_interface'
10632         argument to their .ctor's.
10633         (MemberBase.IsInterface): New public field.
10634
10635         * cs-parser.jay: Create normal Method, Property, Event, Indexer
10636         instances instead of InterfaceMethod, InterfaceProperty, etc.
10637         (opt_interface_base): Removed; we now use `opt_class_base' instead.
10638         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
10639
10640 2004-03-19  Martin Baulig  <martin@ximian.com>
10641
10642         * class.cs (MethodCore.IsDuplicateImplementation): New private
10643         method which does the CS0111 checking.
10644         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
10645         Use IsDuplicateImplementation().
10646
10647 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
10648
10649         * decl.cs (FindMemberToOverride): New method to find the correct
10650         method or property to override in the base class.
10651         * class.cs
10652             - Make Method/Property use the above method to find the
10653               version in the base class.
10654             - Remove the InheritableMemberSignatureCompare as it is now
10655               dead code.
10656
10657         This patch makes large code bases much faster to compile, as it is
10658         O(n) rather than O(n^2) to do this validation.
10659
10660         Also, it fixes bug 52458 which is that nested classes are not
10661         taken into account when finding the base class member.
10662
10663         Reviewed/Approved by Martin.
10664
10665 2004-03-17  Martin Baulig  <martin@ximian.com>
10666
10667         * expression.cs (MemberAccess.DoResolve): Take the parent's number
10668         of type arguments into account; use the `real_num_type_args'
10669         approach like in DoResolveAsTypeStep().
10670
10671         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
10672         nested types.
10673
10674 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
10675
10676         * interface.cs: In all interface classes removed redundant
10677         member initialization.
10678
10679 2004-03-16  Martin Baulig  <martin@ximian.com>
10680
10681         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10682
10683 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
10684
10685         * decl.cs (DefineTypeAndParents): New helper method to define a
10686         type's containers before the type itself is defined;  This is a
10687         bug exposed by the recent changes to Windows.Forms when an
10688         implemented interface was defined inside a class that had not been
10689         built yet.   
10690
10691         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10692
10693         (Check): Loop correctly to report errors modifiers
10694         (UNSAFE was not in the loop, since it was the same as TOP).
10695
10696         * interface.cs: Every interface member now takes a ModFlags,
10697         instead of a "is_new" bool, which we set on the base MemberCore. 
10698
10699         Every place where we called "UnsafeOk" in the interface, now we
10700         call the proper member (InterfaceMethod.UnsafeOK) instead to get
10701         the unsafe settings from the member declaration instead of the
10702         container interface. 
10703
10704         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
10705
10706         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10707         `set_indexer_name' to the pending bits (one per type).
10708
10709         We fixed a bug today that was picking the wrong method to
10710         override, since for properties the existing InterfaceMethod code
10711         basically ignored the method name.  Now we make sure that the
10712         method name is one of the valid indexer names.
10713
10714 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
10715  
10716         * support.cs (SeekableStreamReader): Keep track of stream byte
10717         positions and don't mix them with character offsets to the buffer.
10718
10719         Patch from Gustavo Giráldez
10720
10721 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
10722
10723         * interface.cs (InterfaceSetGetBase): Removed double member
10724         initialization, base class does it as well.
10725
10726 2004-03-13  Martin Baulig  <martin@ximian.com>
10727
10728         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10729         when compiling corlib.
10730
10731 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
10732
10733         * convert.cs (ExplicitConversion): We were reporting an error on
10734         certain conversions (object_type source to a value type, when the
10735         expression was `null') before we had a chance to pass it through
10736         the user defined conversions.
10737
10738         * driver.cs: Replace / and \ in resource specifications to dots.
10739         Fixes 50752
10740
10741         * class.cs: Add check for duplicate operators.  Fixes 52477
10742
10743 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
10744
10745         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10746         that are in the middle of the statements, not only at the end.
10747         Fixes #54987
10748
10749         * class.cs (TypeContainer.AddField): No longer set the
10750         `HaveStaticConstructor' flag, now we call it
10751         `UserDefineStaticConstructor' to diferentiate the slightly
10752         semantic difference.
10753
10754         The situation is that we were not adding BeforeFieldInit (from
10755         Modifiers.TypeAttr) to classes that could have it.
10756         BeforeFieldInit should be set to classes that have no static
10757         constructor. 
10758
10759         See:
10760
10761         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10762
10763         And most importantly Zoltan's comment:
10764
10765         http://bugzilla.ximian.com/show_bug.cgi?id=44229
10766
10767         "I think beforefieldinit means 'it's ok to initialize the type sometime 
10768          before its static fields are used', i.e. initialization does not need
10769          to be triggered by the first access to the type. Setting this flag
10770          helps the JIT to compile better code, since it can run the static
10771          constructor at JIT time, and does not need to generate code to call it
10772          (possibly lots of times) at runtime. Unfortunately, mcs does not set
10773          this flag for lots of classes like String. 
10774          
10775          csc sets this flag if the type does not have an explicit static 
10776          constructor. The reasoning seems to be that if there are only static
10777          initalizers for a type, and no static constructor, then the programmer
10778          does not care when this initialization happens, so beforefieldinit
10779          can be used.
10780          
10781          This bug prevents the AOT compiler from being usable, since it 
10782          generates so many calls to mono_runtime_class_init that the AOT code
10783          is much slower than the JITted code. The JITted code is faster, 
10784          because it does not generate these calls if the vtable is type is
10785          already initialized, which is true in the majority of cases. But the
10786          AOT compiler can't do this."
10787
10788 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
10789
10790         * class.cs (MethodData.Emit): Refactor the code so symbolic
10791         information is generated for destructors;  For some reasons we
10792         were taking a code path that did not generate symbolic information
10793         before. 
10794
10795 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
10796
10797         * class.cs: Create a Constructor.CheckBase method that
10798         takes care of all validation type code. The method
10799         contains some code that was moved from Define.
10800
10801         It also includes new code that checks for duplicate ctors.
10802         This fixes bug #55148.
10803
10804 2004-03-09  Joshua Tauberer <tauberer@for.net>
10805
10806         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
10807         a { ... }-style array creation invokes EmitStaticInitializers
10808         which is not good for reference-type arrays.  String, decimal
10809         and now null constants (NullCast) are not counted toward
10810         static initializers.
10811
10812 2004-03-05  Martin Baulig  <martin@ximian.com>
10813
10814         * location.cs (SourceFile.HasLineDirective): New public field;
10815         specifies whether the file contains or is referenced by a "#line"
10816         directive.
10817         (Location.DefineSymbolDocuments): Ignore source files which
10818         either contain or are referenced by a "#line" directive.        
10819
10820 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
10821
10822         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10823         direct access to our parent, so check the method inline there.
10824
10825 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
10826
10827         * expression.cs (Invocation.EmitCall): Miguel's last commit
10828         caused a regression. If you had:
10829
10830             T t = null;
10831             t.Foo ();
10832
10833         In Foo the implict this would be null.
10834
10835 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
10836
10837         * expression.cs (Invocation.EmitCall): If the method is not
10838         virtual, do not emit a CallVirt to it, use Call.
10839
10840         * typemanager.cs (GetFullNameSignature): Improve the method to
10841         cope with ".ctor" and replace it with the type name.
10842
10843         * class.cs (ConstructorInitializer.Resolve): Now the method takes
10844         as an argument the ConstructorBuilder where it is being defined,
10845         to catch the recursive constructor invocations.
10846
10847 2004-03-16  Martin Baulig  <martin@ximian.com>
10848
10849         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
10850         ConstructedType, call ResolveType() on it to get the type rather
10851         than just using `expr.Type'.
10852
10853 2004-03-16  Martin Baulig  <martin@ximian.com>
10854
10855         * generics.cs (ConstructedType.GetMemberAccess): Take the
10856         EmitContext instead on the TypeExpr and use
10857         ec.TypeContainer.CurrentType/ec.ContainerType.
10858
10859 2004-03-16  Martin Baulig  <martin@ximian.com>
10860
10861         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
10862         parameters before aliases.
10863
10864 2004-03-16  Martin Baulig  <martin@ximian.com>
10865
10866         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
10867         New oublic function; checks whether two generic instances may become
10868         equal under some instantiations (26.3.1).
10869
10870         * class.cs (TypeContainer.Define): Call
10871         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
10872         error.
10873
10874 2004-03-16  Martin Baulig  <martin@ximian.com>
10875
10876         * class.cs (TypeContainer.GetClassBases): Moved
10877         Error_TypeParameterAsBase() here and also check whether the base
10878         class is not an attribute.
10879
10880 2004-03-16  Martin Baulig  <martin@ximian.com>
10881
10882         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10883
10884 2004-03-16  Martin Baulig  <martin@ximian.com>
10885
10886         * class.cs (Error_TypeParameterAsBase): Use correct error number
10887         here (CS0689).  
10888
10889 2004-03-16  Martin Baulig  <martin@ximian.com>
10890
10891         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
10892         for generics.
10893
10894         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
10895         error reporting.
10896
10897 2004-03-15  Martin Baulig  <martin@ximian.com>
10898
10899         * typemanager.cs (TypeManager.GetFullName): New public method.
10900         (TypeManager.MemberLookup): Added `int_num_type_arguments'
10901         argument; only return members with the correct number of type
10902         arguments.
10903         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
10904         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
10905         whether the number of type arguments matches.
10906
10907         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
10908         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
10909
10910         * expression.cs (MemberAccess): Added public `NumTypeArguments'
10911         field; it's set by the protected .ctor when we're actually a
10912         GenericMemberAccess.
10913         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
10914         arguments and pass it to MemberLookupFinal ().
10915
10916         * ecore.cs (Expression.MemberLookup): Added `int
10917         num_type_arguments' argument; only return members with the correct
10918         number of type arguments.
10919         (Expression.MemberLookupFailed): Check whether the MemberLookup
10920         failed because we did not have the correct number of type
10921         arguments; report CS0305 in this case.
10922
10923         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
10924         `e.ResolveAsTypeTerminal()' already did so.
10925
10926 2004-03-15  Martin Baulig  <martin@ximian.com>
10927
10928         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
10929         we're a ConstructedType; in this case, the caller must report an
10930         error (for instance CS0131).
10931
10932         * generic.cs (TypeArguments): Added Location argument to the .ctor.
10933         (TypeArguments.Resolve): Actually report errors here.
10934
10935 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
10936
10937         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10938         `set_indexer_name' to the pending bits (one per type).
10939
10940         We fixed a bug today that was picking the wrong method to
10941         override, since for properties the existing InterfaceMethod code
10942         basically ignored the method name.  Now we make sure that the
10943         method name is one of the valid indexer names.
10944
10945 2004-03-15  Martin Baulig  <martin@ximian.com>
10946
10947         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
10948         for generic instances.
10949
10950 2004-03-13  Martin Baulig  <martin@ximian.com>
10951
10952         * class.cs (TypeContainer.DefineType): Call
10953         TypeManager.AddUserType() immediately after creating the
10954         TypeBuilder; pass all type parameters when creating the
10955         CurrentType.
10956
10957         * decl.cs (DeclSpace.FindNestedType): New public method.
10958         (DeclSpace.FindType): Added `int num_type_args' argument; only
10959         return types with the correct number of type parameters.
10960         (DeclSpace.CountTypeParams): New public property.
10961
10962         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
10963         the number of type parameters; defaults to zero.
10964
10965         * generic.cs (TypeArguments.Count): New public property.
10966         (ConstructedType.DoResolveAsTypeStep): First call
10967         ds.FindNestedType() to find out whether we're nested in the
10968         current generic type; in this case, we inherit all type parameters
10969         from the current class.
10970
10971         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
10972         num_type_args' argument.
10973         (RootContext.LookupType): Added overloaded version which takes the
10974         number of type arguments; only return types with the correct
10975         number of type arguments.
10976
10977         * typemanager.cs (TypeManager.CheckGeneric): New public function;
10978         checks whether `Type t' has `int num_type_args'.
10979
10980 2004-03-13  Martin Baulig  <martin@ximian.com>
10981
10982         * generic.cs (GenericMethod.DefineType): New method; calls
10983         DefineType() on all the type parameters.
10984
10985         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
10986         (MethodData.Define): If we're a generic method, call
10987         GenericMethod.DefineType() to define the type parameters.       
10988
10989 2004-03-10  Martin Baulig  <martin@ximian.com>
10990
10991         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
10992         instead of IsAssignableFrom.    
10993
10994 2004-03-10  Martin Baulig  <martin@ximian.com>
10995
10996         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
10997
10998         * support.cs (ParameterData.HasArrayParameter): New property.
10999         (ReflectionParameters.ctor): Take a MethodBase instead of a
11000         ParameterInfo[].  If we have any type parameters, get the generic
11001         method definition and ask it whether we have variable arguments.
11002
11003 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
11004
11005         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
11006         routines to check if a type is an enumerable/enumerator allow
11007         classes that implement the IEnumerable or IEnumerator interfaces.
11008
11009         * class.cs (Property, Operator): Implement IIteratorContainer, and
11010         implement SetYields.
11011
11012         (Property.Define): Do the block swapping for get_methods in the
11013         context of iterators.   We need to check if Properties also
11014         include indexers or not.
11015
11016         (Operator): Assign the Block before invoking the
11017         OperatorMethod.Define, so we can trigger the Iterator code
11018         replacement. 
11019
11020         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
11021         Property and Operator classes are not created when we parse the
11022         declarator but until we have the block completed, so we use a
11023         singleton SimpleIteratorContainer.Simple to flag whether the
11024         SetYields has been invoked.
11025
11026         We propagate this setting then to the Property or the Operator to
11027         allow the `yield' to function.
11028
11029 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
11030
11031         * codegen.cs: Implemented attribute support for modules.
11032         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
11033         Assembly/Module functionality.
11034
11035         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
11036         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
11037         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
11038
11039 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
11040
11041         * interface.cs (FindMembers): The operation is performed on all base
11042         interfaces and not only on the first. It is required for future CLS Compliance patch.
11043
11044 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11045
11046         * statement.cs, codegen.cs:
11047         This patch deals with patterns such as:
11048
11049         public class List : IEnumerable {
11050
11051                 public MyEnumerator GetEnumerator () {
11052                         return new MyEnumerator(this);
11053                 }
11054
11055                 IEnumerator IEnumerable.GetEnumerator () {
11056                         ...
11057                 }
11058                 
11059                 public struct MyEnumerator : IEnumerator {
11060                         ...
11061                 }
11062         }
11063
11064         Before, there were a few things we did wrong:
11065         1) we would emit callvirt on a struct, which is illegal
11066         2) we emited ldarg when we needed to emit ldarga
11067         3) we would mistakenly call the interface methods on an enumerator
11068         type that derived from IEnumerator and was in another assembly. For example:
11069
11070         public class MyEnumerator : IEnumerator
11071
11072         Would have the interface methods called, even if there were public impls of the
11073         method. In a struct, this lead to invalid IL code.
11074
11075 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
11076
11077         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11078           renamed to Emit.
11079
11080         * delegate.cs (Define): Fixed crash when delegate type is undefined.
11081
11082 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
11083
11084         * cs-parser.jay: Fix small regression: we were not testing V2
11085         compiler features correctly.
11086
11087         * interface.cs: If the emit context is null, then create one
11088
11089 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
11090
11091         * decl.cs (GetSignatureForError): New virtual method to get full name
11092           for error messages.
11093
11094         * attribute.cs (IAttributeSupport): New interface for attribute setting.
11095           Now it is possible to rewrite ApplyAttributes method to be less if/else.
11096
11097         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11098           Duplicated members and code in these classes has been removed.
11099           Better encapsulation in these classes.
11100
11101 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
11102
11103         * assign.cs (Assign.DoResolve): When dealing with compound
11104         assignments, there is a new rule in ECMA C# 2.4 (might have been
11105         there before, but it is documented here) that states that in:
11106
11107         a op= b;
11108
11109         If b is of type int, and the `op' is a shift-operator, then the
11110         above is evaluated as:
11111
11112         a = (int) a op b 
11113
11114         * expression.cs (Binary.ResolveOperator): Instead of testing for
11115         int/uint/long/ulong, try to implicitly convert to any of those
11116         types and use that in pointer arithmetic.
11117
11118         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11119         method to print information for from the type, not from the
11120         null-method we were given.
11121
11122 2004-02-01  Duncan Mak  <duncan@ximian.com>
11123
11124         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11125         parsing for cmd, fixes bug #53694.
11126
11127 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
11128
11129         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11130         in the member name duplication tests. Property and operator name duplication
11131         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11132
11133 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
11134
11135         * interface.cs (PopulateMethod): Fixed crash when interface method
11136         returns not existing type (error test cs0246-3.cs).
11137
11138 2004-02-02  Ravi Pratap M <ravi@ximian.com>
11139
11140         * cs-parser.jay (interface_accessors): Re-write actions to also
11141         store attributes attached to get and set methods. Fix spelling
11142         while at it.
11143
11144         (inteface_property_declaration): Modify accordingly.
11145
11146         (InterfaceAccessorInfo): New helper class to store information to pass
11147         around between rules that use interface_accessors.
11148
11149         * interface.cs (Emit): Apply attributes on the get and set
11150         accessors of properties and indexers too.
11151
11152         * attribute.cs (ApplyAttributes): Modify accordingly to use the
11153         right MethodBuilder when applying attributes to the get and set accessors.
11154
11155 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
11156
11157         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11158
11159 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
11160
11161         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11162
11163 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
11164
11165         * cs-parser.jay: Remove YIELD token, instead use the new grammar
11166         changes that treat `yield' specially when present before `break'
11167         or `return' tokens.
11168
11169         * cs-tokenizer.cs: yield is no longer a keyword.
11170
11171 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
11172
11173         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11174         setting for default constructors.
11175         For default constructors are almost every time set wrong Modifier. The
11176         generated IL code has been alright. But inside mcs this values was
11177         wrong and this was reason why several of my CLS Compliance tests
11178         failed.
11179
11180 2004-02-27  Martin Baulig  <martin@ximian.com>
11181
11182         * generics.cs (ConstructedType.ResolveType): Make the nested type
11183         stuff actually work.
11184
11185 2004-02-25  Martin Baulig  <martin@ximian.com>
11186
11187         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
11188         property; returns the type parameters just from the current type,
11189         ie. with the ones from outer classes.
11190         (DeclSpace.LookupGeneric): First search in the current class, then
11191         in outer classes.
11192         (DeclSpace.initialize_type_params): When hiding a type parameter
11193         from an outer class, put it into the `type_param_list' anyways.
11194
11195         * expression.cs (MemberAccess.expr): Made this field protected.
11196
11197         * class.cs (TypeContainer.Define): The `CurrentType' just contains
11198         the type parameters from the current class.
11199
11200         * generic.cs (ConstructedType.ResolveType): Support nested generic
11201         types by taking the type parameters which we inherit from outer
11202         classes into account.
11203         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
11204         support for nested generic types.
11205
11206 2004-02-23  Martin Baulig  <martin@ximian.com>
11207
11208         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
11209         field and check whether we're nested inside a generic type.
11210         (DeclSpace.ResolveType): If we're resolving to a generic type
11211         definition, create a ConstructedType and return its resolved type.
11212         (DeclSpace.initialize_type_params): New private method;
11213         initializes the `type_param_list' field from the type parameters
11214         from this and all enclosing classes.
11215         (DeclSpace.TypeParameters): Call initialize_type_params() unless
11216         we're already initialized.
11217
11218 2004-02-23  Martin Baulig  <martin@ximian.com>
11219
11220         * class.cs (Method.Define): Create the generic method before
11221         calling DoDefine().
11222         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
11223         the TypeContainer one); we use this for generic methods.
11224
11225         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
11226         parent's TypeBuilder.
11227
11228 2004-02-18  Martin Baulig  <martin@ximian.com>
11229
11230         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
11231         to check for equality.
11232
11233 2004-02-05  Martin Baulig  <martin@ximian.com>
11234
11235         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
11236         `ec.TypeContainer.CurrentType', use it instead of
11237         `ec.ContainerType' to check whether we're in the type's ctor.
11238
11239 2004-01-29  Martin Baulig  <martin@ximian.com>
11240
11241         * expression.cs (Invocation.DoResolve): If we're a
11242         `ConstructedType', then we're actually a generic method, so
11243         rewrite the expr as a GenericMemberAccess.
11244
11245         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
11246         here; manually parse it into a string.
11247
11248 2004-01-28  Martin Baulig  <martin@ximian.com>
11249
11250         * typemanager.cs (TypeManager.IsEqual): New static method.
11251         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
11252         check for equality instead of using `=='.
11253
11254 2004-01-26  Martin Baulig  <martin@ximian.com>
11255
11256         * decl.cs (DeclSpace.CurrentType): New public field.
11257
11258         * expression.cs (This.ResolveBase): If we have an
11259         `ec.TypeContainer.CurrentType', use it instead of
11260         `ec.ContainerType'.
11261
11262         * class.cs (TypeContainer.DefineType): If we're a generic type,
11263         create the `CurrentType' (unresolved).
11264         (TypeContainer.GenericType): New private field.
11265         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
11266         it and store it in `GenericType' before creating the MemberCache.
11267         (TypeContainer.GetMembers): If we have a `GenericType', call
11268         TypeManager.FindMembers() on it.
11269
11270         * interface.cs (Interface.GenericType): New private field.
11271         (Interface.DefineType): If we're a generic type, create the
11272         `CurrentType' (unresolved).
11273         (Interface.DefineMembers): If we have a `CurrentType', resolve it
11274         and store it in `GenericType' before creating the MemberCache.
11275         (Interface.GetMembers): If we have a `GenericType', call
11276         TypeManager.FindMembers() on it.
11277
11278 2004-01-22  Martin Baulig  <martin@ximian.com>
11279
11280         * cs-parser.jay (namespace_or_type_name): Return an Expression,
11281         not a QualifiedIdentifier.  This is what `type_name_expression'
11282         was previously doing.
11283         (type_name_expression): Removed; the code is now in
11284         `namespace_or_type_name'.
11285         (qualified_identifier): Removed, use `namespace_or_type_name'
11286         instead.
11287         (QualifiedIdentifier): Removed this class.      
11288
11289 2004-01-22  Martin Baulig  <martin@ximian.com>
11290
11291         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11292         not a string as alias name.
11293
11294 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
11295
11296         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11297         #52730 bug, and instead compute correctly the need to use a
11298         temporary variable when requesting an address based on the
11299         static/instace modified of the field and the constructor.
11300  
11301 2004-01-21  Martin Baulig  <martin@ximian.com>
11302
11303         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11304         class and namespace before looking up aliases.  Fixes #52517.
11305
11306 2004-01-21  Martin Baulig  <martin@ximian.com>
11307
11308         * flowanalysis.cs (UsageVector.Merge): Allow variables being
11309         assinged in a 'try'; fixes exception4.cs.
11310
11311 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11312         * class.cs : Implemented parameter-less constructor for TypeContainer
11313
11314         * decl.cs: Attributes are now stored here. New property OptAttributes
11315
11316         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
11317
11318         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
11319
11320 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11321
11322         * typemanager.cs (CSharpSignature): Now reports also inner class name.
11323           (CSharpSignature): New method for indexer and property signature.
11324
11325 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11326
11327         * pending.cs (IsVirtualFilter): Faster implementation.
11328
11329 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11330
11331         * typemanager.cs: Avoid inclusion of same assembly more than once.
11332
11333 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11334
11335         * cs-parser.jay: Fixed problem where the last assembly attribute
11336           has been applied also to following declaration (class, struct, etc.)
11337           
11338 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11339
11340         * class.cs: Added error CS0538, CS0539 reporting.
11341         Fixed crash on Microsoft runtime when field type is void.
11342
11343         * cs-parser.jay: Added error CS0537 reporting.
11344
11345         * pending.cs: Added error CS0535 reporting.
11346         Improved error report for errors CS0536, CS0534.
11347
11348 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
11349
11350         Merge a few bits from the Anonymous Method MCS tree.
11351
11352         * statement.cs (ToplevelBlock): New class for toplevel methods,
11353         will hold anonymous methods, lifted variables.
11354
11355         * cs-parser.jay: Create toplevel blocks for delegates and for
11356         regular blocks of code. 
11357
11358 2004-01-20  Martin Baulig  <martin@ximian.com>
11359
11360         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11361         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11362         and `NeedExplicitReturn'; added `IsLastStatement'.
11363         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11364         have a `ReturnLabel' or we're not unreachable.
11365
11366         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
11367         child's reachability; don't just override ours with it.  Fixes
11368         #58058 (lluis's example).
11369         (FlowBranching): Added public InTryOrCatch(), InCatch(),
11370         InFinally(), InLoop(), InSwitch() and
11371         BreakCrossesTryCatchBoundary() methods.
11372
11373         * statement.cs (Return): Do all error checking in Resolve().
11374         Unless we are the last statement in a top-level block, always
11375         create a return label and jump to it.
11376         (Break, Continue): Do all error checking in Resolve(); also make
11377         sure we aren't leaving a `finally'.
11378         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
11379         statement in a top-level block.
11380         (Block.Flags): Added `IsDestructor'.
11381         (Block.IsDestructor): New public property.
11382
11383 2004-01-20  Martin Baulig  <martin@ximian.com>
11384
11385         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11386
11387 2004-01-20  Martin Baulig  <martin@ximian.com>
11388
11389         * statement.cs (Statement.ResolveUnreachable): New public method.
11390         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11391         (Block.Resolve): Resolve unreachable statements.
11392
11393 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11394
11395         * expression.cs: We need to fix the case where we do
11396         not have a temp variable here.
11397
11398         * assign.cs: Only expression compound assignments need
11399         temporary variables.
11400
11401 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11402
11403         * flowanalysis.cs: Reduce memory allocation in a few ways:
11404           - A block with no variables should not allocate a bit
11405             vector for itself.
11406           - A method with no out parameters does not need any tracking
11407             for assignment of the parameters, so we need not allocate
11408             any data for it.
11409           - The arrays:
11410                 public readonly Type[] VariableTypes;
11411                 public readonly string[] VariableNames;
11412             Are redundant. The data is already stored in the variable
11413             map, so we need not allocate another array for it.
11414           - We need to add alot of checks for if (params | locals) == null
11415             due to the first two changes.
11416
11417 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
11418
11419         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11420         implement IMemoryLocation, we store a copy on a local variable and
11421         take the address of it.  Patch from Benjamin Jemlich
11422
11423         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11424         to use a special "type_name_expression" rule which reduces the
11425         number of "QualifiedIdentifier" classes created, and instead
11426         directly creates MemberAccess expressions.
11427
11428 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
11429
11430         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11431         that fixes #52853.  Null literal assignment to ValueType
11432
11433         * class.cs (MethodData.Emit): Instead of checking the name of the
11434         method to determine if its a destructor, create a new derived
11435         class from Method called Destructor, and test for that.  
11436
11437         * cs-parser.jay: Create a Destructor object instead of a Method.  
11438
11439         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11440
11441         Fixes: 52933
11442
11443 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
11444
11445         * expression.cs (Binary.ResolveOperator): Perform an implicit
11446         conversion from MethodGroups to their delegate types on the
11447         Addition operation.
11448
11449         * delegate.cs: Introduce a new class DelegateCreation that is the
11450         base class for `NewDelegate' and `ImplicitDelegateCreation',
11451         factor some code in here.
11452
11453         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11454         conversion from MethodGroups to compatible delegate types. 
11455
11456         * ecore.cs (Expression.Resolve): Do not flag error 654
11457         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11458         we allow conversions from MethodGroups to delegate types now.
11459
11460         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11461         assignments in v2 either.
11462
11463 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
11464
11465         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11466         static read-only fields in ctors.
11467
11468         Applied patch from Benjamin Jemlich 
11469
11470         * expression.cs (UnaryMutator): Avoid leaking local variables. 
11471
11472 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
11473
11474         * cs-tokenizer.cs (IsCastToken): Allow the various native types
11475         here to return true, as they can be used like this:
11476
11477                 (XXX) int.MEMBER ()
11478
11479         Fixed 49836 and all the other dups
11480
11481 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
11482
11483         * driver.cs: Implement /win32res and /win32icon.
11484
11485 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
11486
11487         * cs-parser.jay: Add a rule to improve error handling for the
11488         common mistake of placing modifiers after the type.
11489
11490 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
11491
11492         * cs-parser.jay (interface_event_declaration): Catch
11493         initialization of events on interfaces, and report cs0068
11494
11495         * cs-parser.jay (interface_event_declaration): Catch
11496         initialization of events. 
11497
11498         * ecore.cs: Better report missing constructors.
11499
11500         * expression.cs (Binary.ResolveOperator): My previous bug fix had
11501         the error reporting done in the wrong place.  Fix.
11502
11503         * expression.cs (Binary.ResolveOperator): Catch the 
11504         operator + (E x, E y) error earlier, and later allow for implicit
11505         conversions in operator +/- (E e, U x) from U to the underlying
11506         type of E.
11507
11508         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11509         52596, if the container class is abstract, the default constructor
11510         is protected otherwise its public (before, we were always public).
11511
11512         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11513         fixed statement.
11514
11515         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11516         Jemlich that fixes bug #52597, MCS was generating invalid code for
11517         idisposable structs.   Thanks to Ben for following up with this
11518         bug as well.
11519
11520 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
11521
11522         * driver.cs: Allow assemblies without code to be generated, fixes
11523         52230.
11524
11525 2004-01-07  Nick Drochak <ndrochak@gol.com>
11526
11527         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11528
11529 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
11530
11531         * cs-parser.jay: Add rules to improve error reporting if fields or
11532         methods are declared at the namespace level (error 116)
11533
11534         * Add rules to catch event add/remove
11535
11536 2004-01-04  David Sheldon <dave-mono@earth.li>
11537
11538   * expression.cs: Added matching ")" to error message for 
11539   CS0077
11540
11541 2004-01-03 Todd Berman <tberman@gentoo.org>
11542
11543         * ecore.cs, attribute.cs:
11544         Applying fix from #52429.
11545
11546 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11547
11548         * ecore.cs, expression.cs, statement.cs:
11549         Total rewrite of how we handle branching. We
11550         now handle complex boolean expressions with fewer
11551         jumps. As well if (x == 0) no longer emits a ceq.
11552
11553         if (x is Foo) is much faster now, because we generate
11554         better code.
11555
11556         Overall, we get a pretty big improvement on our benchmark
11557         tests. The code we generate is smaller and more readable.
11558
11559         I did a full two-stage bootstrap. The patch was reviewed
11560         by Martin and Miguel.
11561
11562 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11563
11564         * cs-parser.jay: Make primary_expression not take a QI.
11565         we dont need this because the member_access rule covers
11566         us here. So we replace the rule with just IDENTIFIER.
11567
11568         This has two good effects. First, we remove a s/r conflict.
11569         Second, we allocate many fewer QualifiedIdentifier objects.
11570
11571 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11572
11573         * attribute.cs: Handle MarshalAs attributes as pseudo, and
11574         set the correct information via SRE. This prevents
11575         hanging on the MS runtime. Fixes #29374.
11576
11577 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11578
11579         * convert.cs: correctly handle conversions to value types
11580         from Enum and ValueType as unboxing conversions.
11581
11582         Fixes bug #52569. Patch by Benjamin Jemlich.
11583
11584 2004-01-02  Ravi Pratap  <ravi@ximian.com>
11585
11586         * expression.cs (BetterConversion): Prefer int -> uint
11587         over int -> ulong (csc's behaviour). This fixed bug #52046.
11588
11589 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11590
11591         * decl.cs (MemberCache.FindMembers): now returns a
11592         MemberInfo [].
11593
11594         * typemanager.cs: In general, go with with ^^.
11595         (CopyNewMethods): take an IList.
11596         (RealMemberLookup): Only allocate an arraylist
11597         if we copy from two sets of methods.
11598
11599         This change basically does two things:
11600         1) Fewer array lists allocated due to CopyNewMethods.
11601         2) the explicit cast in MemberList costed ALOT.
11602
11603 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
11604
11605         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
11606         a hashtable to avoid needless string allocations when an identifier is
11607         used more than once (the common case).
11608
11609 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11610
11611         * pending.cs: MS's TypeBuilder.GetInterfaces ()
11612         is broken, it will not return anything. So, we
11613         have to use the information we have in mcs to
11614         do the task.
11615
11616         * typemanager.cs: Add a cache for GetInterfaces,
11617         since this will now be used more often (due to ^^)
11618
11619         (GetExplicitInterfaces) New method that gets the
11620         declared, not effective, interfaces on a type
11621         builder (eg, if you have interface IFoo, interface
11622         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
11623         { IBar }.
11624
11625         This patch makes MCS able to bootstrap itself on
11626         Windows again.
11627
11628 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11629
11630         * expression.cs: Remove the Nop's that Miguel put
11631         in by mistake.
11632
11633 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11634
11635         * report.cs, codegen.cs: Give the real stack trace to
11636         the error when an exception is thrown.
11637
11638 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11639
11640         * decl.cs: only allocate hashtables for ifaces if 
11641         it is an iface!
11642
11643 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11644
11645         * expression.cs: fix the error from cs0121-2.cs
11646         (a parent interface has two child interfaces that
11647         have a function with the same name and 0 params
11648         and the function is called through the parent).
11649
11650 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11651
11652         * class.cs, rootcontext.cs, typmanager.cs: do not
11653         leak pointers.
11654
11655 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11656
11657         * codegen.cs: remove stack for the ec flow branching.
11658         It is already a linked list, so no need.
11659
11660 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11661
11662         * Makefile: Allow custom profiler here.
11663
11664 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11665
11666         * typemanager.cs (LookupType):
11667           - Use a static char [], because split takes
11668             a param array for args, so it was allocating
11669             every time.
11670           - Do not store true in a hashtable, it boxes.
11671
11672 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11673
11674         * flowanalysis.cs: bytify common enums.
11675
11676 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11677
11678         * modifiers.cs: Add a new set of flags for the
11679         flags allowed on explicit interface impls.
11680         * cs-parser.jay: catch the use of modifiers in
11681         interfaces correctly.
11682         * class.cs: catch private void IFoo.Blah ().
11683
11684         All related to bug #50572.
11685
11686 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11687
11688         * decl.cs: Rewrite the consistant accessability checking.
11689         Accessability is not linear, it must be implemented in
11690         a tableish way. Fixes #49704.
11691
11692 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11693
11694         * expression.cs: Handle negation in a checked context.
11695         We must use subtraction from zero. Fixes #38674.
11696
11697 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11698
11699         * class.cs: Ignore static void main in DLLs.
11700         * rootcontext.cs: Handle the target type here,
11701         since we are have to access it from class.cs
11702         * driver.cs: account for the above.
11703
11704 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11705
11706         * report.cs: Give line numbers and files if available.
11707
11708 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
11709
11710         * driver.cs: Implement /addmodule.
11711
11712         * typemanager.cs:  Change 'modules' field so it now contains Modules not
11713         ModuleBuilders.
11714
11715 2003-12-20  Martin Baulig  <martin@ximian.com>
11716
11717         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11718         (FieldBase.IsAssigned): Removed this field.
11719         (FieldBase.SetAssigned): New public method.
11720         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11721
11722 2003-12-20  Martin Baulig  <martin@ximian.com>
11723
11724         * expression.cs (LocalVariableReference.DoResolve): Don't set
11725         `vi.Used' if we're called from DoResolveLValue().
11726
11727         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11728         returns the usage vector it just merged into the current one -
11729         pass this one to UsageWarning().
11730         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11731         of the `EmitContext', don't call this recursively on our children.
11732
11733 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
11734
11735         * driver.cs: Implement /target:module.
11736
11737 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
11738
11739         * support.cs (CharArrayHashtable): New helper class.
11740
11741         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
11742         char arrays, not strings, so we can avoid creating a string in
11743         consume_identifier if the identifier is a keyword.
11744
11745 2003-12-16  Martin Baulig  <martin@ximian.com>
11746
11747         * statement.cs (LocalInfo.Assigned): Removed this property.
11748         (LocalInfo.Flags): Removed `Assigned'.
11749         (LocalInfo.IsAssigned): New public method; takes the EmitContext
11750         and uses flow analysis.
11751         (Block.UsageWarning): Made this method private.
11752         (Block.Resolve): Call UsageWarning() if appropriate.
11753
11754         * expression.cs (LocalVariableReference.DoResolve): Always set
11755         LocalInfo.Used here.
11756
11757 2003-12-13  Martin Baulig  <martin@ximian.com>
11758
11759         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11760         any value here; we're now using flow analysis to figure out
11761         whether a statement/block returns a value.
11762
11763 2003-12-13  Martin Baulig  <martin@ximian.com>
11764
11765         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
11766         working again.
11767         (FlowBranching.MergeFinally): Don't call
11768         `branching.CheckOutParameters()' here, this is called in
11769         MergeTopBlock().
11770         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
11771         when adding the `finally' vector.       
11772
11773 2003-12-13  Martin Baulig  <martin@ximian.com>
11774
11775         * flowanalysis.cs
11776         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
11777         actually work and also fix #48962.
11778
11779 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11780
11781         * decl.cs: Do not check System.Object for nested types,
11782         since we know it does not have any. Big bang for buck:
11783
11784         BEFORE:
11785            Run 1:   8.35 seconds
11786            Run 2:   8.32 seconds
11787            corlib:  17.99 seconds
11788         AFTER:
11789            Run 1:   8.17 seconds
11790            Run 2:   8.17 seconds
11791            corlib:  17.39 seconds
11792
11793 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
11794
11795         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
11796         time we are returning 0 members, so we save alot here.
11797
11798 2003-12-11  Martin Baulig  <martin@ximian.com>
11799
11800         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
11801         `MergeChild()', also just take the `FlowBranching' as argument;
11802         call Merge() on it and return the result.
11803         (FlowBranching.Merge): We don't need to do anything if we just
11804         have one sibling.
11805
11806 2003-12-11  Martin Baulig  <martin@ximian.com>
11807
11808         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
11809         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
11810         Maurer for this idea.
11811
11812 2003-12-11  Martin Baulig  <martin@ximian.com>
11813
11814         * flowanalysis.cs (MergeResult): This class is now gone; we now
11815         use the `UsageVector' for this.  The reason for this is that if a
11816         branching just has one sibling, we don't need to "merge" them at
11817         all - that's the next step to do.
11818         (FlowBranching.Merge): We now return a `UsageVector' instead of a
11819         `MergeResult'.
11820
11821 2003-12-11  Martin Baulig  <martin@ximian.com>
11822
11823         Reworked flow analyis and made it more precise and bug-free.  The
11824         most important change is that we're now using a special `Reachability'
11825         class instead of having "magic" meanings of `FlowReturns'.  I'll
11826         do some more cleanups and optimizations and also add some more
11827         documentation this week.
11828
11829         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
11830         largely reworked this class.
11831         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
11832         the new `Reachability' class instead of having "magic" values here.
11833         (FlowBranching): We're now using an instance of `Reachability'
11834         instead of having separate `Returns', `Breaks' etc. fields.
11835
11836         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
11837         based on flow analysis; ignore the return value of block.Emit ().
11838
11839 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
11840
11841         * driver.cs typemanager.cs: Find the mono extensions to corlib even
11842         if they are private.
11843
11844 2003-12-09  Martin Baulig  <martin@ximian.com>
11845
11846         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
11847         call them directly on the UsageVector.
11848
11849 2003-12-09  Martin Baulig  <martin@ximian.com>
11850
11851         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
11852         Changed return type from `FlowReturns' to `Reachability'.
11853
11854 2003-12-09  Martin Baulig  <martin@ximian.com>
11855
11856         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
11857         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
11858         `Reachable' fields with a single `Reachability' one.
11859
11860 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11861
11862         * class.cs (FindMembers): Remove foreach's.
11863
11864         Bootstrap times:
11865
11866         BEFORE
11867                 Run 1:   8.74 seconds
11868                 Run 2:   8.71 seconds
11869
11870         AFTER
11871                 Run 1:   8.64 seconds
11872                 Run 2:   8.58 seconds
11873
11874
11875 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11876
11877         * cs-parser.jay:
11878         * gen-treedump.cs:
11879         * statement.cs:
11880         This patch does a few things:
11881                 1. EmptyStatement is now a singleton, so it is never reallocated.
11882                 2. All blah is EmptyStatement constructs have been changed to
11883                    blah == EmptyStatement.Value, which is much faster and valid
11884                    now that EmptyStatement is a singleton.
11885                 3. When resolving a block, rather than allocating a new array for
11886                    the non-empty statements, empty statements are replaced with
11887                    EmptyStatement.Value
11888                 4. Some recursive functions have been made non-recursive.
11889         Mainly the performance impact is from (3), however (1) and (2) are needed for
11890         this to work. (4) does not make a big difference in normal situations, however
11891         it makes the profile look saner.
11892
11893         Bootstrap times:
11894
11895         BEFORE
11896         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11897         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11898         Total memory allocated: 56397 KB
11899
11900         AFTER
11901         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
11902         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
11903         Total memory allocated: 55666 KB
11904
11905 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11906
11907         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
11908         than the hashtable in a hashtable version
11909
11910         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
11911         we always end up concating a string. This results in a huge perf
11912         loss, because many strings have to be tracked by the GC. In this
11913         patch, we first use a hashtable that works with two keys, so that
11914         the strings do not need to be concat'ed.
11915
11916         Bootstrap times:
11917         BEFORE
11918                 Run 1:   8.74 seconds
11919                 Run 2:   8.71 seconds
11920
11921         AFTER
11922                 Run 1:   8.65 seconds
11923                 Run 2:   8.56 seconds
11924
11925 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11926
11927         * Makefile: Add a new target `do-time' that does a quick and simple
11928         profile, leaving easy to parse output.
11929
11930 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
11931
11932         * codegen.cs (Init): Create the dynamic assembly with 
11933         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
11934
11935 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11936
11937         * support.cs: Make the PtrHashtable use only one
11938         instance of its comparer.
11939
11940 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
11941
11942         * typemanager.cs: Fix lookup of GetNamespaces.
11943
11944 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
11945
11946         * expression.cs: Removed redundant line.
11947
11948         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
11949         ArrayLists, use for loops with bounds.  
11950
11951         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
11952         arraylist.
11953
11954         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
11955         arraylists, use for loop with bounds.
11956
11957         The above three changes give us a 0.071 second performance
11958         improvement out of 3.294 seconds down to 3.223.  On my machine
11959         the above changes reduced the memory usage by 1,387 KB during
11960         compiler bootstrap.
11961
11962         * cs-parser.jay (QualifiedIdentifier): New class used to represent
11963         QualifiedIdentifiers.  Before we created a new string through
11964         concatenation, and mostly later on, the result would be
11965         manipulated by DecomposeQI through string manipulation.
11966
11967         This reduced the compiler memory usage for bootstrapping from
11968         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
11969         compile times in 0.05 seconds.
11970
11971 2003-11-28  Dick Porter  <dick@ximian.com>
11972
11973         * support.cs: Do string compares with the Invariant culture.
11974
11975         * rootcontext.cs: 
11976         * gen-treedump.cs: 
11977         * expression.cs: 
11978         * driver.cs: 
11979         * decl.cs: 
11980         * codegen.cs: 
11981         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
11982         the comparison is done with the Invariant culture.
11983
11984 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
11985
11986         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
11987         GetEnumerator method.
11988
11989         (ProbeCollectionType): Iterate starting at the most specific type
11990         upwards looking for a GetEnumerator
11991
11992         * expression.cs: Shift count can be up to 31 for int/uint and 63
11993         for long/ulong.
11994
11995 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
11996
11997         * statement.cs (Block.LookupLabel): Also look for the label on the
11998         children blocks.  Use a hash table to keep track of visited
11999         nodes. 
12000
12001         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
12002         we actually did transform the other operand, otherwise fall back
12003         to the common codepath that casts to long.
12004
12005         * cs-tokenizer.cs: Use the same code pattern as the int case.
12006         Maybe I should do the parsing myself, and avoid depending on the
12007         Parse routines to get this done.
12008
12009 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
12010
12011         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12012         which fixes bug 51347.  This time test it.
12013
12014         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
12015         attributes for example can not tell the difference between these.
12016         The difference was only a syntax feature of the language. 
12017
12018         * attribute.cs: Apply attributes to delegates.
12019
12020         * delegate.cs: Call the apply attributes method.
12021
12022 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
12023
12024         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
12025         comparing 0 vs Byte.MinValue, not the value
12026
12027         (ImplicitConversionRequired): When reporting a conversion error,
12028         use error 31 to print out the constant error instead of the
12029         simpler 29.
12030
12031         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12032         which fixes bug 51347.
12033
12034 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
12035
12036         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
12037         which fixes the -warnaserror command line option.
12038
12039 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
12040
12041         * cfold.cs (DoNumericPromotions): During constant folding of
12042         additions on UIntConstant, special case intconstants with
12043         IntConstants like we do on the expression binary operator. 
12044
12045 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
12046
12047         * convert.cs (ImplicitReferenceConversion): We were missing a case
12048         (System.Enum are not value types or class types, so we need to
12049         classify them separatedly).
12050
12051         * driver.cs: We do not support error 2007.
12052
12053 2003-11-12 Jackson Harper <jackson@ximian.com>
12054
12055         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
12056         system directory. Also use the full file name so users can
12057         libraries names mscorlib-o-tron.dll in a non system dir.
12058         
12059 2004-01-04  David Sheldon <dave-mono@earth.li>
12060
12061         * expression.cs: Added matching ")" to error message for CS0077.
12062
12063 2003-12-19  Martin Baulig  <martin@ximian.com>
12064
12065         * typemanager.cs (TypeManager.IsEqualGenericType): New public
12066         static method; see documentation in the method.
12067         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
12068
12069         * convert.cs (Convert.ImplicitReferenceConversion,
12070         Convert.ImplicitReferenceConversionExists): Add support for
12071         generic type declarations; see gen-36.cs.
12072
12073 2003-12-19  Martin Baulig  <martin@ximian.com>
12074
12075         * pending.cs (Pending.InterfaceMethod): Use
12076         `Type.IsAssignableFrom()' instead of `=='.
12077
12078 2003-12-18  Martin Baulig  <martin@ximian.com>
12079
12080         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
12081         byref types first.
12082
12083         * convert.cs (Convert.ImplicitStandardConversionExists): Use
12084         `expr_type.Equals (target_type)' instead of `=='.
12085
12086 2003-12-08  Martin Baulig  <martin@ximian.com>
12087
12088         * generics.cs (Constraints.Types): Removed.
12089         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
12090         to Type's.
12091         (Constraints.ResolveTypes): New public method; resolves the
12092         TypeExpr's to Type's.
12093         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
12094         longer takes the constraints.
12095         (TypeParameter.DefineMethod): Likewise.
12096         (TypeParameter.DefineType): New public method.  Calls
12097         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
12098         the constraints.
12099
12100 2003-12-08  Martin Baulig  <martin@ximian.com>
12101
12102         * convert.cs (Convert.ImplicitConversionStandard): Use
12103         `expr_type.Equals (target_type)' instead of `=='.
12104
12105 2003-12-08  Martin Baulig  <martin@ximian.com>
12106
12107         * typemanager.cs (TypeManager.GetReferenceType): Call
12108         `Type.MakeByRefType ()'.
12109
12110 2003-12-08  Martin Baulig  <martin@ximian.com>
12111
12112         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
12113         just has some special meaning in some situations.  For instance,
12114         it is allowed to use `where' as the name of a variable etc.
12115
12116 2003-12-04  Martin Baulig  <martin@ximian.com>
12117
12118         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12119         `Type.MakeArrayType()' for array types.
12120
12121 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
12122
12123         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
12124         debugging message.
12125
12126         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
12127         corlib to compile.
12128
12129 2003-11-16  Martin Baulig  <martin@ximian.com>
12130
12131         * codegen.cs (EmitContext.IsGeneric): Removed.
12132
12133         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
12134         ResolveGeneric() on the DeclSpace.
12135
12136 2003-11-16  Martin Baulig  <martin@ximian.com>
12137
12138         * generic.cs (TypeArguments.Resolve):
12139         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
12140         `ResolveType()' on it to get the Type.
12141
12142 2003-11-15  Martin Baulig  <martin@ximian.com>
12143
12144         * generic.cs (ConstructedType.GetInterfaces): Override this.
12145
12146 2003-11-14  Martin Baulig  <martin@ximian.com>
12147
12148         * interface.cs (Interface.DefineType): Define all type parameters
12149         before adding the interfaces we inherit.
12150
12151 2003-11-11  Martin Baulig  <martin@ximian.com>
12152
12153         * generic.cs (ConstructedType.ResolveType): Always call
12154         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
12155
12156 2003-11-10  Martin Baulig  <martin@ximian.com>
12157
12158         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
12159         (TypeManager.InitCoreTypes): Initialize them here, but instead of
12160         calling `ResolveType()' on them, directly assign their `Type'.
12161
12162 2003-11-08  Martin Baulig  <martin@ximian.com>
12163
12164         * generic.cs (ConstructedType): Override `IsClass' etc.
12165
12166 2003-11-08  Martin Baulig  <martin@ximian.com>
12167
12168         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
12169         return value and the `out parent' parameter.
12170         (TypeContainer.DefineType): Moved the CS0644 check into
12171         GetClassBases().  Don't pass the interface types to the
12172         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
12173         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
12174
12175         * ecore.cs (TypeExpr.IsAttribute): New property.
12176         (TypeExpr.GetInterfaces): New method.
12177
12178         * interface.cs (Interface.GetInterfaceTypeByName): Return a
12179         TypeExpr instead of a Type.
12180         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
12181         (Interface.DefineType): Don't pass the interface types to the
12182         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
12183         them later and then call `TypeBulider.AddInterfaceImplementation()'.
12184
12185         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
12186         instead of a `Type[]'.
12187         (TypeManager.RegisterBuilder): Likewise.
12188         (TypeManager.AddUserInterface): Likewise.
12189         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
12190         `Type[]' and also return a `TypeExpr[]'.
12191         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
12192
12193 2003-11-08  Martin Baulig  <martin@ximian.com>
12194
12195         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12196         Expression.     
12197
12198 2003-11-08  Martin Baulig  <martin@ximian.com>
12199
12200         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12201         TypeManager.ResolveExpressionTypes().
12202
12203         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12204         instead of an Expression.
12205         (TypeExpr): This is now an abstract base class for `TypeExpression'.
12206         (TypeExpression): New public class; formerly known as `TypeExpr'.
12207
12208         * expression.cs (ComposedCast): Derive from TypeExpr.
12209
12210         * typemanager.cs (TypeManager.system_*_expr): These are now
12211         TypExpr's instead of Expression's.
12212         (TypeManager.ResolveExpressionTypes): New public static function;
12213         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12214         of them.        
12215
12216 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
12217
12218         * expression.cs (New.DoResolve): Do not dereference value that
12219         might be a null return.
12220
12221         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12222         sure that the constant value has the right type.  Fixes an
12223         unreported bug, similar to 50425.
12224
12225         * const.cs (Const.LookupConstantValue): Call
12226         ImplicitStandardConversionExists before doing a conversion to
12227         avoid havng the TypeManager.ChangeType do conversions.
12228
12229         Reduced the number of casts used
12230
12231         (Const.ChangeType): New routine to enable reuse of the constant
12232         type changing code from statement.
12233
12234         * typemanager.cs (ChangeType): Move common initialization to
12235         static global variables.
12236
12237         Fixes #50425.
12238
12239         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12240         every value type to go through, even if it was void.  Fix that. 
12241
12242         * cs-tokenizer.cs: Use is_identifier_start_character on the start
12243         character of the define, and the is_identifier_part_character for
12244         the rest of the string.
12245
12246 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
12247
12248         * expression.cs (UnaryMutator.EmitCode): When I updated
12249         LocalVariableReference.DoResolve, I overdid it, and dropped an
12250         optimization done on local variable references.
12251
12252 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
12253
12254         * ecore.cs: Convert the return from Ldlen into an int.
12255
12256 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
12257
12258         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12259         the accessibility, this is a special case for toplevel non-public
12260         classes (internal for instance).
12261
12262 2003-10-20  Nick Drochak <ndrochak@gol.com>
12263
12264         * ecore.cs: Fix typo and build.  Needed another right paren.
12265
12266 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
12267
12268         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
12269         `internal' case regular and protected, but not allowing protected
12270         to be evaluated later.  Bug 49840
12271
12272 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
12273
12274         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12275         to kb.Nlast, and not the kb.nFirst to isolate the switch
12276         statement.
12277
12278         Extract the underlying type, so enumerations of long/ulong are
12279         treated like long/ulong.
12280
12281 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
12282
12283         * expression.cs (New): Overload the meaning of RequestedType to
12284         track the possible creation of the NewDelegate type, since
12285         DoResolve is invoked more than once for new constructors on field
12286         initialization.
12287
12288         See bugs: #48800 and #37014
12289
12290         * cs-parser.jay (declare_local_constants): Take an arraylist
12291         instead of a single constant.
12292
12293         (local_constant_declaration): It should take a
12294         constant_declarators, not a constant_declarator.  Fixes 49487
12295
12296         * convert.cs: Fix error report.
12297
12298 2003-10-13 Jackson Harper <jackson@ximian.com>
12299
12300         * typemanager.cs (TypeToCoreType): Add float and double this fixes
12301         bug #49611
12302         
12303 2003-11-03  Martin Baulig  <martin@ximian.com>
12304
12305         * expression.cs (ArrayAccess.GetStoreOpcode): Added
12306         `out bool has_type_arg'; if set, we need to pass the type to
12307         ig.Emit().
12308         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
12309         Stelem_Any/Ldelem_Any for generic parameters.   
12310
12311 2003-11-02  Martin Baulig  <martin@ximian.com>
12312
12313         * expression.cs (Invocation.EmitCall): Use
12314         `TypeManager.IsValueType()' to check whether it's a value type.
12315         Don't set `struct_call' when calling a method on a type parameter.
12316
12317 2003-11-02  Martin Baulig  <martin@ximian.com>
12318
12319         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
12320         and removed the TypeBuilder argument.
12321
12322         * typemanager.cs (TypeManager.IsValueType): Return
12323         `t.IsGenericParameter || t.IsValueType'.
12324
12325 2003-10-25  Martin Baulig  <martin@ximian.com>
12326
12327         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
12328         call ConstructedType.Resolve() on it.
12329
12330         * generic.cs (ConstructedType.Resolve): Set `type' on success.
12331
12332 2003-10-25  Martin Baulig  <martin@ximian.com>
12333
12334         * class.cs (TypeContainer.GetClassBases): Changed
12335         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
12336         CS8214 reporting here.
12337         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
12338         instead of a `Type' for our parent.  In case of a recursive
12339         declaration (see tests/gen-23.cs for an example), our parent is a
12340         ConstructedType and it doesn't have its type set.  So, first
12341         create our own TypeBuilder, then call constructed.Resolve() to get
12342         the parent's type and finally TypeBuilder.SetParent() it.
12343
12344         * ecore.cs (TypeExpr.Name): New public virtual property.
12345
12346         * generic.cs
12347         (ConstructedType): We're now a TypeExpr and not just an Expression.
12348         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
12349         arguments here; this is done later.
12350         (ConstructedType.Resolve): New public method to resolve the type
12351         arguments and bind them.
12352
12353 2003-10-21  Martin Baulig  <martin@ximian.com>
12354
12355         * convert.cs: Use `TypeManager.IsValueType' instead of
12356         'type.IsValueType' everywhere.
12357
12358         * typemanager.cs (TypeManager.IsValueType): Return true for type
12359         parameters.  The reason for this is that we need to box a type
12360         parameter when converting it to a reference type.
12361
12362         * cs-parser.jay: Added support for default value expressions.
12363
12364         * generics.cs (DefaultValueExpression): New public class.       
12365
12366 2003-10-17  Martin Baulig  <martin@ximian.com>
12367
12368         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
12369         TypeContainer so we can also use this for Interfaces.
12370         (TypeParameter.Resolve): Likewise.
12371
12372         * interface.cs (Interface.DefineType): Added support for generic
12373         interfaces.
12374
12375         * cs-parser.jay: Added support for generic structs and interfaces.
12376
12377 2003-10-17  Martin Baulig  <martin@ximian.com>
12378
12379         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
12380         call generic methods :-)
12381
12382 2003-10-16  Martin Baulig  <martin@ximian.com>
12383
12384         * cs-parser.jay (namespace_or_type_name): Only create a
12385         GenericMemberAccess if we actually have type arguments.
12386
12387 2003-10-13  Martin Baulig  <martin@ximian.com>
12388
12389         * class.cs (Method.Define): If we're a generic method, call
12390         TypeBuilder.DefineGenericMethod () before resolving
12391         the parameters.
12392         (MethodData): Added .ctor which takes an additional MethodBuilder
12393         argument; this is used for generic methods.
12394         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
12395         we already have a MethodBuilder.
12396
12397 2003-10-10  Martin Baulig  <martin@ximian.com>
12398
12399         * class.cs (Method): Added .ctor which takes a `GenericMethod'
12400         instead of a `DeclSpace'.  This is used for generic methods.
12401
12402         * cs-parser.jay (method_header): Added support for generic
12403         methods; create a `GenericMethod' instance and pass it to the
12404         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
12405         parameters and locals.
12406
12407         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
12408         since we already have the location.  Check whether we're a generic
12409         type declaration or a generic method and create the correct type
12410         parameter.
12411
12412         * generic.cs (TypeParameter.DefineMethod): New public method.
12413         (GenericMethod): New public class; derives from DeclSpace and is
12414         used for generic methods.       
12415
12416 2003-10-09  Martin Baulig  <martin@ximian.com>
12417
12418         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12419         to the .ctor.
12420         (MethodCore.DoDefineParameters): Removed the TypeContainer
12421         argument; use the DeclSpace which was passed to the .ctor instead.
12422         (MethodCore.CheckParameter): Take a DeclSpace instead of a
12423         TypeContainer; we only need a DeclSpace here.
12424
12425 2003-10-09  Martin Baulig  <martin@ximian.com>
12426
12427         * class.cs (MethodData): Added additional `DeclSpace ds' argument
12428         to the .ctor.
12429         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12430         EmitContext's .ctor.    
12431
12432 2003-10-09  Martin Baulig  <martin@ximian.com>
12433
12434         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12435         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12436         AsAccessible(), moved them as well.
12437
12438         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12439
12440 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
12441
12442         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12443         generation for >=, as spotted by Paolo, bug 48679.  
12444         Patch from David Waite.
12445
12446         * cs-tokenizer.cs: Add handling for #pragma.
12447
12448         * cs-parser.jay: Allow for both yield and yield return in the
12449         syntax.  The anti-cobolization of C# fight will go on!
12450
12451         * class.cs (TypeBuilder.DefineType): Catch error condition here
12452         (Parent.DefineType erroring out and returning null).
12453
12454         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12455         coping with enumerations variables, we were mistakenly processing
12456         them as a regular value type instead of built-in types.  Fixes the
12457         bug #48063
12458
12459         * typemanager.cs (IsBuiltinOrEnum): New method.
12460
12461 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
12462
12463         * cs-parser.jay: Upgrade: yield now needs the return clause.
12464
12465 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12466
12467         * cs-parser.jay : Renamed yyName to yyNames related to jay.
12468
12469 2003-09-29  Martin Baulig  <martin@ximian.com>
12470
12471         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
12472         inflated generic methods.
12473
12474         * generics.cs (ConstructedType): Distinguish between open and
12475         closed constructed types; correctly resolve the arguments.
12476
12477 2003-09-22  Martin Baulig  <martin@ximian.com>
12478
12479         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
12480         all type arguments meet their constraints.
12481
12482 2003-09-19  Martin Baulig  <martin@ximian.com>
12483
12484         * decl.cs (MemberCache.SetupCacheForInterface): Take a
12485         `MemberCache parent' argument.  Normally, an interface doesn't
12486         have a parent type except System.Object, but we use this in gmcs
12487         for generic type parameters.
12488
12489 2003-09-18  Martin Baulig  <martin@ximian.com>
12490
12491         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12492         on `type.IsInterface'; don't check whether the type has a parent
12493         to determine whether it's an interface.
12494
12495 2003-09-17  Martin Baulig  <martin@ximian.com>
12496
12497         * generic.cs (ConstructedType.ToString): Always use `name' as the
12498         type name.
12499
12500 2003-09-15  Martin Baulig  <martin@ximian.com>
12501
12502         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
12503
12504         * generic.cs (Constraints.Resolve): New public method; this is
12505         called to resolve the constraint types and to check whether all
12506         the constraints are correct.
12507         (Constraints.Types): New public property.
12508         (TypeParameter.Resolve): New public method; resolves all the
12509         type's constraints.
12510
12511         * class.cs (TypeContainer.DefineType): Call
12512         TypeParameter.Resolve() before actually defining the type.
12513
12514 2003-09-15  Martin Baulig  <martin@ximian.com>
12515
12516         * class.cs (TypeContainer.DefineType): Added an error flag to
12517         avoid reporting duplicate CS0146's ("class definition is
12518         circular.").
12519
12520         * driver.cs (Driver.MainDriver): Abort if
12521         RootContext.ResolveTree() reported any errors.
12522
12523 2003-09-07  Martin Baulig  <martin@ximian.com>
12524
12525         * report.cs (Error, Warning): Added overloaded versions which take
12526         a `params object[] args' and call String.Format().
12527
12528 2003-09-07  Martin Baulig  <martin@ximian.com>
12529
12530         * decl.cs (DeclSpace..ctor): Don't call
12531         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12532         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
12533         (DeclSpace.RecordDecl): New method.
12534
12535         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12536
12537 2003-09-02  Ravi Pratap  <ravi@ximian.com>
12538
12539         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12540         value attributes to be applied to ParameterBuilders.
12541
12542         * class.cs (MethodCore.LabelParameters): Make static and more
12543         generic so that it can be used from other places - like interface
12544         methods, for instance.
12545
12546         * interface.cs (Interface.Emit): Call LabelParameters before
12547         emitting attributes on the InterfaceMethod.
12548
12549 2003-09-07  Martin Baulig  <martin@ximian.com>
12550
12551         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
12552         if the number of type parameters doesn't match.
12553
12554 2003-09-04  Martin Baulig  <martin@ximian.com>
12555
12556         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
12557         for arrays of generic type params (ie. `!0[]').
12558
12559 2003-09-04  Martin Baulig  <martin@ximian.com>
12560
12561         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
12562         for the moment.
12563
12564 2003-09-04  Martin Baulig  <martin@ximian.com>
12565
12566         * decl.cs (DeclSpace.LookupGeneric): New method.
12567         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
12568         moment.
12569
12570         * generic.cs (TypeParameterExpr): Take a TypeParameter as
12571         argument, not just a string.
12572         (TypeParameter.Define): New public method; this is called to
12573         actually define the generic parameter; after this, you can use the
12574         new `Type' property to get the type.
12575
12576 2003-09-04  Martin Baulig  <martin@ximian.com>
12577
12578         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
12579         is now an ArrayList; initialize the result of the `TypeParameters'
12580         property here.
12581         (DeclSpace.GetGenericData): Removed.
12582         (DeclSpace.LookupGeneric): Temporarily removed; we need to
12583         implement this in a different way.
12584         (DeclSpace.GetTypeParameters): Removed; there's now a
12585         `TypeParameters' property.
12586         (DeclSpace.TypeParameters): New public property.
12587
12588         * generic.cs (Constraints): Make this class public.
12589         (TypeParameter): New public class.
12590
12591 2003-09-04  Martin Baulig  <martin@ximian.com>
12592
12593         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
12594         generic parameters.
12595
12596         * class.cs (TypeContainer.DefineType): Call
12597         TypeBuilder.DefineGenericParameter () on all generic parameters if
12598         this is a generic type.
12599
12600 2003-08-28  Martin Baulig  <martin@ximian.com>
12601
12602         * sample-stack.il: Compile this with ilasm: "ilasm /dll
12603         sample-stack.il".
12604
12605         * sample-hello.cs: Compile this with gmcs: "gmcs
12606         /r:sample-stack.dll sample-hello.cs".
12607
12608 2003-08-28  Martin Baulig  <martin@ximian.com>
12609
12610         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
12611         the parameters to the generic type.
12612
12613 2003-08-28  Martin Baulig  <martin@ximian.com>
12614
12615         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
12616
12617 2003-08-28  Martin Baulig  <martin@ximian.com>
12618
12619         * cs-parser.jay (opt_type_argument_list): Use
12620         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
12621         (primary_expression): Replace `qualified_identifier' with `type_name'.
12622         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
12623
12624         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
12625         parser to check whether it is syntactically a type parameter list;
12626         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
12627         this case.
12628
12629 2003-08-26  Martin Baulig  <martin@ximian.com>
12630
12631         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12632         resolving aliases; fixes #47927.
12633
12634 2003-08-26  Martin Baulig  <martin@ximian.com>
12635
12636         * statement.cs (Using.DoResolve): This is internally emitting a
12637         try/finally clause, so we need to set ec.NeedExplicitReturn if we
12638         do not always return.  Fixes #47681.
12639
12640 2003-08-26  Martin Baulig  <martin@ximian.com>
12641
12642         * decl.cs (MemberCore): Moved WarningNotHiding(),
12643         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
12644         into MemberBase.
12645         (AdditionResult): Make this nested in DeclSpace.
12646         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
12647         argument; call NamespaceEntry.Define() unless we're nested in a
12648         class or struct.
12649
12650         * namespace.cs (Namespace.DefineName): New public function.  This
12651         is called from DeclSpace's .ctor to add 
12652         (Namespace.Lookup): Include DeclSpaces in the lookup.
12653
12654         * class.cs (Operator): Derive from MemberBase, not MemberCore.
12655
12656         * const.cs (Const): Derive from MemberBase, not MemberCore.     
12657
12658 2003-08-25  Martin Baulig  <martin@ximian.com>
12659
12660         * convert.cs (Convert.ExplicitReferenceConversion): When
12661         converting from an interface type to a class, unbox if the target
12662         type is a struct type.  Fixes #47822.
12663
12664 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12665
12666         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
12667         #47854.
12668
12669 2003-08-22  Martin Baulig  <martin@ximian.com>
12670
12671         * class.cs (TypeManager.DefineType): When defining a nested type,
12672         call DefineType() on our parent; fixes #47801.
12673
12674 2003-08-22  Martin Baulig  <martin@ximian.com>
12675
12676         * class.cs (MethodData.Define): While checking if a method is an
12677         interface implementation, improve the test a bit more to fix #47654.
12678
12679 2003-08-22  Martin Baulig  <martin@ximian.com>
12680
12681         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
12682         correctly; fixes #47722.
12683
12684 2003-08-22  Martin Baulig  <martin@ximian.com>
12685
12686         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
12687         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
12688
12689         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
12690
12691 2003-08-22  Martin Baulig  <martin@ximian.com>
12692
12693         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
12694         can only be assigned in static constructors.  Fixes #47161.
12695
12696 2003-08-22  Martin Baulig  <martin@ximian.com>
12697
12698         Rewrote and improved the flow analysis code.
12699
12700         * flowbranching.cs (FlowBranching): Make this class abstract.
12701         (FlowBranching.CreateBranching): New static function to create a
12702         new flow branching.
12703         (FlowBranchingBlock, FlowBranchingException): New classes.
12704         (FlowBranching.UsageVector.Type): New public readonly field.
12705         (FlowBranching.UsageVector.Breaks): Removed the setter.
12706         (FlowBranching.UsageVector.Returns): Removed the setter.
12707         (FlowBranching.UsageVector): Added Break(), Return(),
12708         NeverReachable() and Throw() methods to modify the reachability.
12709         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
12710         done by FlowBranching.Merge().
12711         (FlowBranching.UsageVector.MergeChild): New method; merges the
12712         merge result into the current vector.
12713         (FlowBranching.Merge): New abstract method to merge a branching.
12714
12715 2003-08-12  Martin Baulig  <martin@ximian.com>
12716
12717         * expression.cs (Indirection.CacheTemporaries): Create the
12718         LocalTemporary with the pointer type, not its element type.
12719
12720 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
12721
12722         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
12723         token was a keyword or not.
12724
12725         Add `error' options where an IDENTIFIER was expected;  Provide
12726         CheckToken and CheckIdentifierToken convenience error reporting
12727         functions. 
12728
12729         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
12730
12731         * decl.cs: Rename `NamespaceEntry Namespace' public field into
12732         NameSpaceEntry NameSpaceEntry.
12733
12734         (LookupInterfaceOrClass): Avoid creating a full qualified name
12735         from namespace and name: avoid doing lookups when we know the
12736         namespace is non-existant.   Use new Tree.LookupByNamespace which
12737         looks up DeclSpaces based on their namespace, name pair.
12738
12739         * driver.cs: Provide a new `parser verbose' to display the
12740         exception thrown during parsing.  This is turned off by default
12741         now, so the output of a failure from mcs is more graceful.
12742
12743         * namespace.cs: Track all the namespaces defined in a hashtable
12744         for quick lookup.
12745
12746         (IsNamespace): New method
12747
12748 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
12749
12750         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
12751         we know that we need to concatenate (full typename can never be
12752         null). 
12753
12754         * class.cs: ditto.
12755
12756         * statement.cs: Use a bitfield;  Do not initialize to null things
12757         which are done by the constructor by default.
12758
12759         * cs-parser.jay: bug fix, parameter was 4, not 3.
12760
12761         * expression.cs: Just use the property;
12762
12763         * statement.cs: No need for GetVariableInfo method.
12764
12765 2003-08-08  Martin Baulig  <martin@ximian.com>
12766
12767         * flowanalysis.cs (FlowReturns): This is now nested in the
12768         `FlowBranching' class.
12769         (MyBitVector): Moved this here from statement.cs.
12770         (FlowBranching.SiblingType): New enum type.
12771         (FlowBranching.CreateSibling): Added `SiblingType' argument.
12772
12773 2003-08-07  Martin Baulig  <martin@ximian.com>
12774
12775         * flowanalysis.cs (FlowBranchingType): This is now nested in the
12776         `FlowBranching' class and called `BranchingType'.
12777
12778 2003-08-07  Martin Baulig  <martin@ximian.com>
12779
12780         * flowanalysis.cs: Moved all the control flow analysis code into
12781         its own file.
12782
12783 2003-08-07  Martin Baulig  <martin@ximian.com>
12784
12785         * assign.cs (Assign.DoResolve): `target' must either be an
12786         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
12787         #37319.
12788
12789 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
12790
12791         * expression.cs (BinaryMethod): This kind of expression is created by the
12792         Binary class if it determines that the operator has to be handled
12793         by a method.
12794
12795         (BinaryDelegate): This kind of expression is created if we are
12796         dealing with a + or - operator on delegates.
12797
12798         (Binary): remove method, argumetns, and DelegateOperator: when
12799         dealing with methods, 
12800
12801         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
12802
12803         * statement.cs (Block): use bitfields for the three extra booleans
12804         we had in use.   Remove unused topblock parameter.
12805
12806         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
12807
12808         * assign.cs: Drop extra unneeded tests.
12809
12810 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
12811
12812         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
12813
12814         * statement.cs (Foreach): Use VariableStorage instead of
12815         LocalBuilders.   
12816
12817         * codegen.cs (VariableStorage): New class used by clients that
12818         require a variable stored: locals or fields for variables that
12819         need to live across yield.
12820
12821         Maybe provide a convenience api for EmitThis+EmitLoad?
12822
12823         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
12824         these bad boys.
12825
12826 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
12827
12828         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
12829         RemapParameterLValue): New methods that are used to turn a
12830         precomputed FieldInfo into an expression like this:
12831
12832                 instance.FieldInfo
12833
12834         The idea is to use this instead of making LocalVariableReference
12835         have more than one meaning.
12836
12837         * cs-parser.jay: Add error production to BASE.
12838
12839         * ecore.cs: Deal with TypeManager.GetField returning null, which
12840         is now a valid return value.
12841
12842         (FieldExprNoAddress): New expression for Fields whose address can
12843         not be taken.
12844
12845         * expression.cs (LocalVariableReference): During the resolve
12846         phases, create new expressions if we are in a remapping context.
12847         Remove code that dealt with remapping here.
12848
12849         (ParameterReference): same.
12850
12851         (ProxyInstance): New expression, like the `This' expression, but
12852         it is born fully resolved.  We know what we are doing, so remove
12853         the errors that are targeted to user-provided uses of `this'.
12854
12855         * statement.cs (Foreach): our variable is now stored as an
12856         Expression;  During resolution, follow the protocol, dont just
12857         assume it will return this.
12858
12859 2003-08-06  Martin Baulig  <martin@ximian.com>
12860
12861         * support.cs (SeekableStreamReader.cs): New public class.
12862
12863         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
12864         SeekableStreamReader instead of the normal StreamReader.
12865
12866 2003-08-04  Martin Baulig  <martin@ximian.com>
12867
12868         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
12869         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
12870         deambiguate casts and delegate invocations.
12871         (parenthesized_expression): Use the new tokens to ensure this is
12872         not a cast of method invocation.
12873
12874         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
12875         when reading a `)' and Deambiguate_CloseParens () was previously
12876         called.
12877
12878         * expression.cs (ParenthesizedExpression): New class.  This is
12879         just used for the CS0075 test.
12880         (Binary.DoResolve): Check for CS0075.   
12881
12882 2003-07-29  Ravi Pratap  <ravi@ximian.com>
12883
12884         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
12885         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
12886         reference comparison.
12887
12888         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
12889         examine the ReturnType for equality - this is necessary in the
12890         cases of implicit and explicit operators whose signature also
12891         includes the return type.
12892
12893 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
12894
12895         * namespace.cs: Cache the result of the namespace computation,
12896         instead of computing it every time.
12897
12898 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
12899
12900         * decl.cs: Use a global arraylist that we reuse over invocations
12901         to avoid excesive memory consumption.  Reduces memory usage on an
12902         mcs compile by one meg (45 average).
12903
12904         * typemanager.cs (LookupTypeReflection): In .NET pointers are
12905         private, work around that.
12906
12907 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
12908
12909         * literal.cs (IntLiteral): Define Zero and One static literals. 
12910
12911         * cs-parser.jay (integer_literal): use static literals to reduce
12912         memory usage for the most used literals (0, 1 and -1).  211kb
12913         reduced in memory usage.
12914
12915         Replace all calls to `new ArrayList' with `new
12916         ArrayList(4)' which is a good average number for most allocations,
12917         and also requires only 16 bytes of memory for its buffer by
12918         default. 
12919
12920         This reduced MCS memory usage in seven megabytes for the RSS after
12921         bootstrapping.
12922
12923 2003-07-28  Ravi Pratap  <ravi@ximian.com>
12924
12925         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
12926         handle params methods the correct way by forming only one
12927         applicable set with params and normal methods in them. Earlier we
12928         were looking at params methods only if we found no normal methods
12929         which was not the correct thing to do.
12930
12931         (Invocation.BetterFunction): Take separate arguments indicating
12932         when candidate and the best method are params methods in their
12933         expanded form.
12934
12935         This fixes bugs #43367 and #46199.
12936
12937         * attribute.cs: Documentation updates.
12938
12939         (CheckAttribute): Rename to CheckAttributeTarget.
12940         (GetValidPlaces): Rename to GetValidTargets.
12941
12942         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
12943         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
12944
12945         Fixes bug #44468.
12946
12947 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
12948
12949         * codegen.cs: Compute IsGeneric correctly.
12950
12951         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
12952         resolution. 
12953
12954         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
12955         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
12956         regressions, and I was chasing more bugs than I required.
12957
12958         * interface.cs: Use expressions for base type names (like classes
12959         and structs have been doing for a while now), and resolve that.
12960         This patch should probably go into head as well.
12961
12962         This makes it one less user of FindType.
12963
12964 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
12965
12966         This compiler can not self host currently.  Need to fix that.
12967         
12968         * Makefile: compile to `gmcs.exe'
12969
12970         * driver.cs: Turn on v2 by default on gmcs.
12971
12972         * generic.cs (ConstructedType): Does no longer take a container
12973         type argument;  That will be taken care of later.
12974
12975         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
12976         Use SimpleName to resolve for now, so we can continue the work on
12977         the parser, until we get Type.GetType that understands generics.
12978
12979         (ConstructedType.ToString): Implement
12980
12981         (TypeArguments.Resolve): Resolve the child expressions as types. 
12982         
12983         * cs-parser.jay: Rename interface_constraints to
12984         type_parameter_constraints
12985
12986         (namespace_or_type_name): Only use constructed types for the basic
12987         construction, we will deal with identifier<...> later.
12988
12989         (type/type_name): No longer call DecomposeQI, as
12990         namespace_or_type_name is always decoded now.
12991         
12992 2003-07-22  Ravi Pratap  <ravi@ximian.com>
12993
12994         * expression.cs (Invocation.OverloadResolve): Follow the spec more
12995         closely: we eliminate methods in base types when we have an
12996         applicable method in a top-level type.
12997
12998         Please see section 14.5.5.1 for an exact description of what goes
12999         on. 
13000
13001         This fixes bug #45127 and a host of other related to corlib compilation.
13002
13003         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
13004         array is the method corresponding to the top-level type (this is
13005         because of the changes made to icall.c) so we change this
13006         accordingly.
13007
13008         (MethodGroupExpr.Name): This too.
13009
13010         * typemanager.cs (GetElementType): New method which does the right
13011         thing when compiling corlib. 
13012
13013         * everywhere: Make use of the above in the relevant places.
13014
13015 2003-07-22  Martin Baulig  <martin@ximian.com>
13016
13017         * cs-parser.jay (invocation_expression): Moved
13018         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
13019         `cast_expression', but create a InvocationOrCast which later
13020         resolves to either an Invocation or a Cast.
13021
13022         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
13023         method; call this before EmitStatement() to make sure that this
13024         expression can be used as a statement.
13025
13026         * expression.cs (InvocationOrCast): New class; resolves to either
13027         an Invocation or a Cast.
13028
13029         * statement.cs (StatementExpression): Call ResolveStatement() on
13030         the ExpressionStatement before emitting it.
13031
13032 2003-07-21  Martin Baulig  <martin@ximian.com>
13033
13034         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
13035         `ref' and `out' attributes match; fixes #46220.
13036         (MemberAccess.ResolveMemberAccess): You can't reference a type
13037         through an expression; fixes #33180.
13038         (Indexers.GetIndexersForType): Don't return the indexers from
13039         interfaces the class implements; fixes #46502.
13040
13041 2003-07-21  Martin Baulig  <martin@ximian.com>
13042
13043         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
13044         CS0661 checks; fixes bug #30442.
13045
13046 2003-07-21  Martin Baulig  <martin@ximian.com>
13047
13048         * decl.cs (AdditionResult): Added `Error'.
13049
13050         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
13051
13052         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
13053         cs0031.cs actually work.
13054
13055  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
13056  
13057         * cs-parser.jay (namespace_name): do not use
13058         namespace_or_type_name, use qualified_identifier, because
13059         namespace_or_type_name will soon return a composed expression
13060         instead of a string.
13061  
13062         (namespace_or_type_name): Instead of returning a string, now this
13063         production returns an expression.
13064  
13065         * codegen.cs (EmitContext): Setup IsGeneric property based on
13066         whether our DeclSpace is generic, our the method is generic.
13067  
13068         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
13069         the method is generic.
13070  
13071         * cs-parser.jay (type_arguments, opt_type_argument_list,
13072         type_parameters, type_parameter_list, opt_type_parameter_list,
13073         type_parameter,, opt_type_parameter_constraints_clauses,
13074         type_parameter_constraints_clauses,
13075         type_parameter_constraint_clause, type_parameter_constraint,
13076         interface_constraints): Add new production
13077  
13078         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
13079         DeclSpace is generic or not.
13080  
13081         (DeclSpace.SetParameterInfo): New routine, used to set the
13082         parameter info for a type.
13083  
13084         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
13085         returns a GenericTypeExpr
13086  
13087         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
13088         generic, lookup the generic argument.
13089  
13090         * attribute.cs: Do not allow TypeParameterExpressions in
13091         Attributes.
13092  
13093         * class.cs: Do not allow the Main method to be defined in a
13094         Generic container.
13095  
13096         * expression.cs (SizeOf): Do not allow generic types to be used as
13097         arguments to sizeof.
13098  
13099         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
13100         it: whether a type is generic or not.  Only works for types we are
13101         currently building for now.
13102         
13103 2003-07-20  Martin Baulig  <martin@ximian.com>
13104
13105         * namespace.cs: Fixed that bug which caused a crash when compiling
13106         the debugger's GUI.
13107
13108 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
13109
13110         * typemanager.cs (LookupTypeReflection): Never expose types which
13111         are NotPublic, NestedPrivate, NestedAssembly, or
13112         NestedFamANDAssem.  We used to return these, and later do a check
13113         that would report a meaningful error, but the problem is that we
13114         would not get the real match, if there was a name override.
13115
13116 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
13117
13118         * namespace.cs (Namespace, Name): Do not compute the namespace
13119         name dynamically, compute it in the constructor.  This reduced
13120         memory usage by 1697 KB.
13121
13122         * driver.cs: Use --pause to pause at the end.
13123
13124 2003-07-17  Peter Williams  <peter@newton.cx>
13125
13126         * Makefile: Change the name of the test target so that it doesn't
13127         conflict with the recursive test target.
13128
13129 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
13130
13131         * expression.cs (LocalVariableReference.Emit, EmitAssign,
13132         AddressOf): Do not use EmitThis, that was wrong, use the actual
13133         this pointer.
13134
13135 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
13136
13137         * class.cs (MethodData.Define): While checking if a method is an
13138         interface implementation, improve the test: If we are not public
13139         (use new test here: use the computed MethodAttributes directly,
13140         instead of the parsed modifier flags) check if the `implementing'
13141         method comes from an interface or not.
13142
13143         * pending.cs (VerifyPendingMethods): Slightly better error
13144         message.
13145
13146         * makefile: add test target that does the mcs bootstrap.
13147
13148 2003-07-16  Ravi Pratap  <ravi@ximian.com>
13149
13150         * interface.cs (Define): Do nothing here since there are no
13151         members to populate etc. Move the attribute emission out of here
13152         since this was just totally the wrong place to put it. Attribute
13153         application happens during the 'Emit' phase, not in the 'Define'
13154         phase.
13155
13156         (Emit): Add this method and move the attribute emission here
13157
13158         * rootcontext.cs (EmitCode): Call the Emit method on interface
13159         types too.
13160
13161 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13162
13163         * expression.cs (OverloadResolve): Report error only if Location
13164         is not 'Null' which means that there was a probe going on.
13165
13166 2003-07-14  Martin Baulig  <martin@ximian.com>
13167
13168         * expression.cs (ConditionalLogicalOperator): New public class to
13169         implement user defined conditional logical operators.
13170         This is section 14.11.2 in the spec and bug #40505.
13171
13172 2003-07-14  Martin Baulig  <martin@ximian.com>
13173
13174         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
13175
13176 2003-07-14  Martin Baulig  <martin@ximian.com>
13177
13178         * codegen.cs (EmitContext.InFixedInitializer): New public field.
13179
13180         * ecore.cs (IVariable.VerifyFixed): New interface method.
13181
13182         * expression.cs (Unary.ResolveOperator): When resolving the `&'
13183         operator, check whether the variable is actually fixed.  Fixes bug
13184         #36055.  Set a variable definitely assigned when taking its
13185         address as required by the spec.
13186
13187         * statement.cs (LocalInfo.IsFixed): New field.
13188         (LocalInfo.MakePinned): Set `IsFixed' to true.
13189
13190 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13191
13192         * attribute.cs (Attribute.Resolve): While doing a Member lookup
13193         for .ctors, ensure that we only ask for members declared in the
13194         attribute type (BindingFlags.DeclaredOnly).
13195
13196         Fixes bug #43632.
13197
13198         * expression.cs (Error_WrongNumArguments): Report error 1501
13199         correctly the way CSC does.
13200
13201 2003-07-13  Martin Baulig  <martin@ximian.com>
13202
13203         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
13204         lookup on the fully qualified name, to make things like "X.X" work
13205         where "X.X" is a fully qualified type name, but we also have a
13206         namespace "X" in the using list.  Fixes #41975.
13207
13208 2003-07-13  Martin Baulig  <martin@ximian.com>
13209
13210         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
13211         function. If we're a CompoundAssign, we need to create an embedded
13212         CompoundAssign, not an embedded Assign.
13213         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
13214         Fixes #45854.
13215
13216 2003-07-13  Martin Baulig  <martin@ximian.com>
13217
13218         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
13219         work to fix bug #46088.
13220
13221 2003-07-13  Ravi Pratap <ravi@ximian.com>
13222
13223         * class.cs (Operator.Emit): Do not emit attributes here - it is
13224         taken care of by the Method class that we delegate too. This takes
13225         care of bug #45876.
13226
13227 2003-07-10  Martin Baulig  <martin@ximian.com>
13228
13229         * expression.cs (TypeOfVoid): New class.
13230         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
13231
13232 2003-07-10  Martin Baulig  <martin@ximian.com>
13233
13234         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
13235         bug #35957.
13236
13237 2003-07-10  Martin Baulig  <martin@ximian.com>
13238
13239         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
13240         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
13241
13242         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
13243
13244         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
13245
13246 2003-07-10  Martin Baulig  <martin@ximian.com>
13247
13248         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
13249         of decimal.  Fixes #42850.
13250
13251         NOTE: I also fixed the created byte blob, but this doesn't work on
13252         the MS runtime and csc never produces any byte blobs for decimal
13253         arrays.
13254
13255 2003-07-10  Martin Baulig  <martin@ximian.com>
13256
13257         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
13258         structs; fixes #32068.
13259         (Block.AddChildVariableNames): Fixed #44302.
13260
13261 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13262
13263         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
13264
13265 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13266
13267         * attribute.cs: And this test is onger needed.
13268
13269 2003-07-08  Martin Baulig  <martin@ximian.com>
13270
13271         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
13272         inaccessible types.  Fixes #36313.
13273
13274         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
13275
13276         * namespace.cs (NamespaceEntry): Create implicit entries for all
13277         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
13278         implicit entries for N1.N2 and N1.
13279
13280 2003-07-08  Martin Baulig  <martin@ximian.com>
13281
13282         Rewrote the handling of namespaces to fix a lot of the issues
13283         wrt. `using' aliases etc.
13284
13285         * namespace.cs (Namespace): Splitted this class into a
13286         per-assembly `Namespace' and a per-file `NamespaceEntry'.
13287
13288         * typemanager.cs (TypeManager.IsNamespace): Removed.
13289         (TypeManager.ComputeNamespaces): Only compute namespaces from
13290         loaded assemblies here, not the namespaces from the assembly we're
13291         currently compiling.
13292
13293 2003-07-08  Martin Baulig  <martin@ximian.com>
13294
13295         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
13296
13297 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13298
13299         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
13300         already fixed it.  
13301
13302         I thought about the memory savings here, but LookupTypeReflection
13303         is used under already very constrained scenarios.  Compiling
13304         corlib or mcs only exposes one hit, so it would not really reduce
13305         any memory consumption.
13306
13307 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13308
13309         * typemanager.cs: fixes bug #45889 by only adding public types from
13310         other assemblies to the list of known types.
13311
13312 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13313
13314         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
13315         on the type we resolved.
13316
13317 2003-07-05  Martin Baulig  <martin@ximian.com>
13318
13319         * pending.cs (PendingImplementation.ParentImplements): Don't
13320         create the proxy if the parent is abstract.
13321
13322         * class.cs (TypeContainer.DefineIndexers): Process explicit
13323         interface implementations first.  Fixes #37714.
13324
13325 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
13326
13327         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
13328         defined recursively;  but since we modify the input parameters
13329         (left is set to `this' temporarily), we reset this value if the
13330         left_is_explicit is false, which gives the original semantics to
13331         the code.  
13332
13333         * literal.cs (NullPointer): new class used to represent a null
13334         literal in a pointer context.
13335
13336         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
13337         type is a pointer, use a NullPointer object instead of a
13338         NullLiteral.   Closes 43687
13339
13340         (ExplicitConversion): Convert pointer values using
13341         the conv opcode to the proper type.
13342
13343         * ecore.cs (New): change ValueTypeVariable property into a method,
13344         that returns whether the valuetype is suitable for being used.
13345
13346         * expression.cs (Binary.DoNumericPromotions): Only return if we
13347         the int constant was a valid uint, and we can return both left and
13348         right as uints.  If not, we continue processing, to trigger the
13349         type conversion.  This fixes 39018.
13350
13351         * statement.cs (Block.EmitMeta): During constant resolution, set
13352         the CurrentBlock property on the emitcontext, so that we resolve
13353         constants propertly.
13354
13355 2003-07-02  Martin Baulig  <martin@ximian.com>
13356
13357         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
13358         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
13359
13360         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13361         than emitting it here.
13362
13363         * statement.cs: Fixed some more flow analysis bugs.
13364
13365 2003-07-02  Martin Baulig  <martin@ximian.com>
13366
13367         * class.cs (MethodData.Define): When implementing interface
13368         methods, set Final unless we're Virtual.
13369
13370         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
13371         check work for interface methods.
13372
13373 2003-07-01  Martin Baulig  <martin@ximian.com>
13374
13375         * ecore.cs (EmitContext.This): Replaced this property with a
13376         GetThis() method which takes a Location argument.  This ensures
13377         that we get the correct error location for a CS0188.
13378
13379 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
13380
13381         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13382         ImplicitStandardConversion.
13383
13384         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13385
13386 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
13387
13388         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13389         optimization.
13390
13391 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
13392
13393         * class.cs (Constructor.Define): Turn off initlocals for unsafe
13394         constructors.
13395
13396         (MethodData.Define): Turn off initlocals for unsafe methods.
13397
13398 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
13399
13400         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13401         complete;  Fixes #37521.
13402
13403         * delegate.cs: Use Modifiers.TypeAttr to compute the
13404         TypeAttributes, instead of rolling our own.  This makes the flags
13405         correct for the delegates.
13406
13407 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
13408
13409         * class.cs (Constructor.Define): Set the private flag for static
13410         constructors as well.
13411
13412         * cs-parser.jay (statement_expression): Set the return value to
13413         null, to avoid a crash when we catch an error.
13414
13415 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
13416
13417         * cs-parser.jay: Applied patch from Jackson that adds support for
13418         extern and unsafe modifiers to destructor declarations.
13419
13420         * expression.cs: Report error 21 if the user is trying to index a
13421         System.Array.
13422
13423         * driver.cs: Add an error message, suggested by the bug report.
13424
13425         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13426         if we do not have a ": this ()" constructor initializer.  Fixes 45149
13427
13428 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
13429
13430         * namespace.cs: Add some information to reduce FAQs.
13431
13432 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
13433
13434         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13435         underlying enumeration types.  Fixes #43915.
13436
13437         * expression.cs: Treat ushort/short as legal values to be used in
13438         bitwise operations.
13439
13440 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13441
13442         * delegate.cs: transfer custom attributes for paramenters from
13443         the delegate declaration to Invoke and BeginInvoke.
13444
13445 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13446
13447         * attribute.cs: handle custom marshalers and emit marshal info
13448         for fields, too.
13449
13450 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
13451
13452         * makefile.gnu: Added anonymous.cs to the compiler sources.
13453
13454 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
13455
13456         * iterators.cs: Change the name of the proxy class to include two
13457         underscores.
13458
13459         * cs-parser.jay: Update grammar to include anonymous methods.
13460
13461         * anonymous.cs: new file.
13462
13463 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
13464
13465         * class.cs (Field.Define): Add missing test for pointers and
13466         safety. 
13467
13468 2003-05-27  Ravi Pratap  <ravi@ximian.com>
13469
13470         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13471         we use the stobj opcode.
13472
13473         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13474         since it wasn't the correct fix. 
13475
13476         It still is puzzling that we are required to use stobj for IntPtr
13477         which seems to be a ValueType.
13478
13479 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
13480
13481         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13482         during regular simple name resolution.   Now, the trick is that
13483         instead of returning for processing the simplename, we do a
13484         TypeManager.LookupType (ie, a rooted lookup as opposed to a
13485         contextual lookup type).   If a match is found, return that, if
13486         not, return for further composition.
13487
13488         This fixes long-standing 30485.
13489
13490         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13491         using the address to initialize an object, do an Stobj instead of
13492         using the regular Stelem.
13493
13494         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13495         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13496         Because if we are a BaseIndexerAccess that value will be true.
13497         Fixes 43643.
13498
13499         * statement.cs (GotoCase.Resolve): Return after reporting an
13500         error, do not attempt to continue. 
13501
13502         * expression.cs (PointerArithmetic.Emit): If our operand is a
13503         long, convert our constants to match the operand before
13504         multiplying.  Convert to I type before adding.   Fixes 43670.
13505
13506 2003-05-14  Ravi Pratap  <ravi@ximian.com>
13507
13508         * enum.cs (ImplicitConversionExists) : Rename to
13509         ImplicitEnumConversionExists to remove ambiguity. 
13510
13511         * ecore.cs (NullCast): New type of cast expression class which
13512         basically is very similar to EmptyCast with the difference being
13513         it still is a constant since it is used only to cast a null to
13514         something else
13515         (eg. (string) null)
13516
13517         * convert.cs (ImplicitReferenceConversion): When casting a null
13518         literal, we return a NullCast.
13519
13520         * literal.cs (NullLiteralTyped): Remove - I don't see why this
13521         should be around anymore.
13522
13523         The renaming (reported was slightly wrong). Corrections:
13524
13525         ConvertImplicitStandard -> ImplicitConversionStandard
13526         ConvertExplicitStandard -> ExplicitConversionStandard
13527
13528         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13529         before passing them in !
13530
13531         * convert.cs (ImplicitConversionStandard): When comparing for
13532         equal expr and target types, ensure that expr is not a
13533         NullLiteral.
13534
13535         In general, we must not be checking (expr_type ==
13536         target_type) in the top level conversion methods
13537         (ImplicitConversion, ExplicitConversion etc). This checking is
13538         done in the methods that they delegate to.
13539
13540 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
13541
13542         * convert.cs: Move Error_CannotConvertType,
13543         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13544         ImplicitNumericConversion, ImplicitConversionExists,
13545         ImplicitUserConversionExists, StandardConversionExists,
13546         FindMostEncompassedType, FindMostSpecificSource,
13547         FindMostSpecificTarget, ImplicitUserConversion,
13548         ExplicitUserConversion, GetConversionOperators,
13549         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13550         TryImplicitIntConversion, Error_CannotConvertImplicit,
13551         ConvertImplicitRequired, ConvertNumericExplicit,
13552         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13553         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13554         its own file.
13555
13556         Perform the following renames:
13557
13558         StandardConversionExists -> ImplicitStandardConversionExists
13559         ConvertImplicit -> ImplicitConversion
13560         ConvertImplicitStandard -> ImplicitStandardConversion
13561         TryImplicitIntConversion -> ImplicitIntConversion
13562         ConvertImplicitRequired -> ImplicitConversionRequired
13563         ConvertNumericExplicit -> ExplicitNumericConversion
13564         ConvertReferenceExplicit -> ExplicitReferenceConversion
13565         ConvertExplicit -> ExplicitConversion
13566         ConvertExplicitStandard -> ExplicitStandardConversion
13567
13568 2003-05-19  Martin Baulig  <martin@ximian.com>
13569
13570         * statement.cs (TypeInfo.StructInfo): Made this type protected.
13571         (TypeInfo): Added support for structs having structs as fields.
13572
13573         * ecore.cs (FieldExpr): Implement IVariable.
13574         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13575         VariableInfo for the field.
13576
13577 2003-05-18  Martin Baulig  <martin@ximian.com>
13578
13579         * expression.cs (This.DoResolve): Report a CS0027 if we're
13580         emitting a field initializer.
13581
13582 2003-05-18  Martin Baulig  <martin@ximian.com>
13583
13584         * expression.cs (This.ResolveBase): New public function.
13585         (This.DoResolve): Check for CS0188.
13586
13587         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13588         This.Resolve().
13589
13590         * ecore.cs (MethodGroupExpr.DoResolve): Set the
13591         `instance_expression' to null if we don't have any non-static
13592         methods.
13593
13594 2003-05-18  Martin Baulig  <martin@ximian.com>
13595
13596         Reworked the way how local variables and parameters are handled by
13597         the flow analysis code.
13598
13599         * statement.cs (TypeInfo, VariableMap): New public classes.
13600         (VariableInfo): New public class.  This is now responsible for
13601         checking whether a variable has been assigned.  It is used for
13602         parameters and local variables.
13603         (Block.EmitMeta): Take the InternalParameters as argument; compute
13604         the layout of the flow vectors here.
13605         (Block.LocalMap, Block.ParameterMap): New public properties.
13606         (FlowBranching): The .ctor doesn't get the InternalParameters
13607         anymore since Block.EmitMeta() now computes the layout of the flow
13608         vector.
13609         (MyStructInfo): This class is now known as `StructInfo' and nested
13610         in `TypeInfo'; we don't access this directly anymore.
13611
13612         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13613         property and removed IsAssigned(), IsFieldAssigned(),
13614         SetAssigned() and SetFieldAssigned(); we now call them on the
13615         VariableInfo so we don't need to duplicate this code everywhere.
13616
13617         * expression.cs (ParameterReference): Added `Block block' argument
13618         to the .ctor.
13619         (LocalVariableReference, ParameterReference, This): The new
13620         VariableInfo class is now responsible for all the definite
13621         assignment stuff.
13622
13623         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13624         IsParameterAssigned, SetParameterAssigned): Removed.
13625
13626 2003-05-18  Martin Baulig  <martin@ximian.com>
13627
13628         * typemanager.cs (InitCoreTypes): Try calling
13629         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13630         the 3-args-version.  Corlib now also needs our `void_type'.
13631         (GetMethod): Added overloaded version which takes an optional
13632         `bool report_errors' to allow lookups of optional methods.
13633
13634 2003-05-12  Martin Baulig  <martin@ximian.com>
13635
13636         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13637         only used for locals and not for parameters.
13638
13639 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
13640
13641         * support.cs (InternalParameters.ParameterType): Return the
13642         ExternalType of the parameter.
13643
13644         * parameter.cs (Parameter.ExternalType): drop the two arguments,
13645         they were unused.
13646
13647 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
13648
13649         * class.cs (MethodData.Define): Do not set the `newslot' on
13650         interface members, if they are also flagged as "override".
13651
13652         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
13653         better code for ++i and i++.  This only works for static fields
13654         and local variables.
13655
13656         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
13657         want to pull the DeclSpace out of the builder_to_declspace instead
13658         of the TypeBuilder (like in TypeContainer.FindMembers).
13659
13660         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
13661         instead of LookupTypeContainer.  Fixes the crash on .NET for
13662         looking up interface members.
13663
13664         * const.cs: Create our own emit context during the Definition
13665         stage, so that constants are evaluated in the proper context, when
13666         a recursive definition happens.
13667
13668 2003-05-11  Martin Baulig  <martin@ximian.com>
13669
13670         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
13671         new block for a switch section.
13672         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
13673         the adding/lookup in the switch block.  Fixes #39828.
13674
13675 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
13676
13677         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
13678         functionality: I needed to convert the data after I had performed
13679         the add/sub operation into the operands type size.
13680
13681         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
13682         pass the type for the box operation, otherwise the resulting
13683         object would have been of type object.
13684
13685         (BoxedCast): Add constructor to specify the type to box as.
13686
13687 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
13688
13689         * iterators.cs: I was reusing the `count' variable inadvertently,
13690         take steps to not allow this to happen.
13691
13692 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
13693
13694         * attribute.cs (Attribute.Resolve): Params attributes are encoded
13695         by creating an array at the point where the params starts and
13696         putting all those arguments there, then adjusting the size of the
13697         array.
13698
13699 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
13700
13701         * expression.cs (New.AddressOf): Implement interface
13702         IMemoryLocation.  This is used when the `new' operator is used in
13703         the context of an invocation to a method on a value type.
13704
13705         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
13706         example. 
13707
13708         * namespace.cs: Also check the using aliases here.
13709
13710         * driver.cs: Move the test for using validity after the types have
13711         been entered, so we do a single pass that also includes the using
13712         aliases. 
13713
13714         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
13715         in the regular case.   CreateSiblingForFinally is doing extra
13716         error checking.
13717
13718         * attribute.cs (GetAttributeArgumentExpression): Store the result
13719         on an out value, and use the return value to indicate failure
13720         instead of using null (which is a valid return for Constant.GetValue).
13721
13722         * statement.cs: Perform the analysis flow for the increment
13723         portion after the statement, because this will be the real flow of
13724         execution.  Fixes #42385
13725
13726         * codegen.cs (EmitContext.EmitArgument,
13727         EmitContext.EmitStoreArgument): New helper functions when the
13728         RemapToProxy flag is set.
13729
13730         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
13731         function.
13732
13733         Add support for remapping parameters. 
13734
13735         * iterators.cs: Propagate parameter values;  Store parameter
13736         values in the proxy classes.
13737
13738 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
13739
13740         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
13741         need a proxy reference;  I do not know what I was thinking
13742
13743         * cs-parser.jay (constructor_initializer): catch another error,
13744         and display nice message.
13745
13746         (field_declaration): catch void field declaration
13747         to flag a better error. 
13748
13749         * class.cs (MemberBase.CheckBase): Report an error instead of a
13750         warning if a new protected member is declared in a struct. 
13751         (Field.Define): catch the error of readonly/volatile.
13752
13753         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
13754
13755         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
13756         volatile variable is taken
13757
13758 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
13759
13760         * statement.cs (Fixed.Resolve): Report an error if we are not in
13761         an unsafe context.
13762
13763 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
13764
13765         * typemanager.cs: reuse the code that handles type clashes for
13766         delegates and enumerations.
13767
13768         * class.cs (Report28): Always report.
13769
13770         * expression.cs (EncodeAsAttribute): Allow nulls here.
13771
13772 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
13773
13774         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
13775         the functionality for testing whether an expression is valid for
13776         an attribute here.  Also handle the case of arrays of elements
13777         being stored. 
13778
13779         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
13780         encoding a linear array into an array of objects that are suitable
13781         to be passed to an CustomAttributeBuilder.
13782
13783         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
13784
13785         * ecore.cs: (FieldExpr): Handle field remapping here.
13786
13787         * iteratators.cs: Pass the instance variable (if the method is an
13788         instance method) to the constructors, so we can access the field
13789         variables on the class.
13790
13791         TODO: Test this with structs.  I think the THIS variable on
13792         structs might have to be a pointer, and not a refenrece
13793
13794 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
13795
13796         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
13797         local variables to fields in a proxy class.
13798
13799         * iterators.cs (PopulateProxy): Rename our internal fields to
13800         <XXX>.  
13801         Create a <THIS> field if we are an instance method, so we can
13802         reference our parent container variables.
13803         (MapVariable): Called back from the EmitContext code to enter a
13804         new variable to field mapping into the proxy class (we just create
13805         a FieldBuilder).
13806
13807         * expression.cs
13808         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
13809         for using the remapped locals to fields.
13810
13811         I placed the code here, because that gives the same semantics to
13812         local variables, and only changes the Emit code.
13813
13814         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
13815         statements inside iterators.
13816         (VariableInfo): Add a FieldBuilder for the cases when we are
13817         remapping local variables to fields in a proxy class
13818
13819         * ecore.cs (SimpleNameResolve): Avoid testing two times for
13820         current_block != null.
13821
13822         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
13823         not cope with strings, as it has been moved to the
13824         TableSwitchEmit.  Fixed bug in switch generation.
13825
13826         * expression.cs (New.DoResolve): Provide more context for the user
13827         when reporting an error.
13828
13829         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
13830         pointers. 
13831
13832         * expression.cs (MemberAccess.DoResolve): When we get a type back,
13833         check the permissions for it.  Note than in a type-resolution
13834         context the check was already present in DeclSpace.ResolveType,
13835         but was missing from the MemberAccess.
13836
13837         (ArrayCreation.CheckIndices): warn if the user has
13838         more nested levels of expressions, but there are no more
13839         dimensions specified.  Avoids crash on bug 41906.
13840
13841 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
13842
13843         * statement.cs (Block): replace Implicit bool, for a generic
13844         flags.   
13845         New flag: `Unchecked'.  This is used during the EmitMeta phase
13846         (which is out-of-line with the regular Resolve/Emit process for a
13847         statement, as this is done ahead of time, but still gets a chance
13848         to call constant resolve).
13849
13850         (Block.Flags): new enum for adding a new flag.
13851
13852         (Block.EmitMeta): track the state of unchecked.
13853
13854         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
13855         to enable constant resolution to work there as well.
13856
13857 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
13858
13859         * typemanager.cs (ienumerable_type): Also look up
13860         System.Collections.IEnumerable. 
13861
13862 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
13863
13864         TODO: Test more than one conditional per method.
13865
13866         * class.cs (Indexer.Define): Report the location where the user is
13867         referencing the unsupported feature.
13868
13869         (MethodData): Overload the use of `conditionals' to
13870         minimize the creation of needless ArrayLists.   This saves roughly
13871         212kb on my machine.
13872
13873         (Method): Implement the new IIteratorContainer interface.
13874         (Method.SetYields): Implement the method by setting the ModFlags
13875         to contain METHOD_YIELDS.
13876
13877         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
13878         which just got set to null.
13879
13880         * iterators.cs: New file.
13881
13882         (Yield, YieldBreak): New statements.
13883
13884         * statement.cs (Return.Resolve): Flag an error if we are used in
13885         an iterator method.
13886
13887         * codegen.cs (InIterator): New flag set if the code is being
13888         compiled in an iterator method.
13889
13890         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
13891         internal modifier, and we just use it to avoid adding extra
13892         fields, as this is seldom used.  
13893
13894         * cs-parser.jay: Add yield_statement (yield and yield break).
13895
13896         * driver.cs: New flag -v2 to turn on version 2 features. 
13897
13898         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
13899         hashtable when v2 is enabled.
13900
13901 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
13902
13903         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
13904         there is already a namespace defined with this name.
13905
13906         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
13907         people upgraded their corlibs.
13908
13909         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
13910         always use fully qualified types, no need to use the compiler
13911         front end.
13912
13913         (TypeManager.IsNamespace): Use binarysearch.
13914
13915         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
13916         AddDelegate): I did not quite use the new IsValid API properly: I
13917         have to pass the short-name and the fullname.  I was passing only
13918         the basename instead of the fullname sometimes. 
13919
13920         (TypeContainer.DefineType): call NamespaceClash.
13921
13922         * interface.cs (Interface.DefineType): use NamespaceClash before
13923         defining the type.
13924
13925         * delegate.cs (Delegate.DefineType): use NamespaceClash before
13926         defining the type.
13927
13928         * enum.cs: (Enum.DefineType): use NamespaceClash before
13929         defining the type.
13930
13931         * typemanager.cs (: 3-line patch that gives us some tasty 11%
13932         speed increase.  First, use the negative_hits cache when we get a
13933         negative.  Second, add the type with its full original name
13934         instead of the new . and + encoded name (reflection uses + to
13935         separate type from a nested type).  Use LookupTypeReflection
13936         directly which bypasses the type->name hashtable (that we already
13937         know does not contain the type.
13938
13939         * decl.cs (DeclSpace.ResolveTypeExpr): track the
13940         location/container type. 
13941
13942         * driver.cs: When passing utf8, use directly the UTF8Encoding.
13943
13944 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
13945
13946         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
13947
13948         * delegate.cs (NewDelegate.Resolve): Test whether an instance
13949         method is being referenced in the method group from a static
13950         context, and report error 120 if so.
13951
13952         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
13953         Error118. 
13954
13955         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
13956         is created, we create the A namespace).
13957
13958         * cs-parser.jay: A namespace also introduces a DeclarationFound.
13959         Fixes #41591
13960
13961 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
13962
13963         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
13964         invocation to ModuleBuilder.GetType with the same values will
13965         return a new type instance, so we need to cache its return
13966         values. 
13967
13968         * expression.cs (Binary.ResolveOperator): Only allow the compare
13969         operators on enums if they are of the same type.
13970
13971         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
13972         types of ValueType on their own case.  Before we were giving them
13973         the same treatment as objects.
13974
13975         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
13976         fullname.  Short name is used to compare against container name.
13977         Fullname is used to check against defined namespace names.
13978
13979         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
13980         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
13981
13982         (Method.CheckBase): Call parent.
13983         (MemberBase.CheckBase): Check for protected members on sealed
13984         classes.
13985         (PropertyBase.CheckBase): Call parent.
13986         (Field.Define): Call parent.
13987
13988         * report.cs: Negative error codes are now mapped to 8000 - code,
13989         so that the display is render more nicely.
13990
13991         * typemanager.cs: Do not use try/catch, instead report a regular
13992         error. 
13993
13994         (GetPointerType, GetReferenceType): These methods provide
13995         mechanisms to obtain the T* and T& from a T.  We had the code
13996         previously scattered around the code base, and it also used
13997         TypeManager.LookupType that would go through plenty of caches.
13998         This one goes directly to the type source.
13999
14000         In some places we did the Type.GetType followed by
14001         ModuleBuilder.GetType, but not in others, so this unifies the
14002         processing as well.
14003
14004         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
14005         statements now that we have namespace information.
14006
14007         * typemanager.cs (IsNamespace): New method, returns whether the
14008         string presented is a namespace or not.
14009
14010         (ComputeNamespaces): New public entry point, computes the list of
14011         available namespaces, using the GetNamespaces API call in Mono, or
14012         the slower version in MS.NET.   
14013
14014         Now before we start the semantic analysis phase, we have a
14015         complete list of namespaces including everything that the user has
14016         provided.
14017
14018         Deleted old code to cache namespaces in .nsc files.
14019
14020 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
14021
14022         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
14023         class/struct location definition Location for the implicit
14024         constructor location.
14025
14026         (Operator.Define): Use the location of the operator for the
14027         implicit Method definition.
14028
14029         (Constructor.Emit): use the constructor location for the implicit
14030         base initializer constructor.
14031
14032         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
14033         and the Expression class now contains two new methods:
14034
14035         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
14036         isolate type lookup from the rest of the resolution process.
14037
14038         Since we use Expressions to hold type definitions due to the way
14039         we parse the input we have historically overloaded Resolve to
14040         perform the Type lookups if a special flag is passed.  Now this is
14041         eliminated and two methods take their place. 
14042
14043         The differences in the two methods between xStep and xTerminal is
14044         that xStep is involved in our current lookup system that uses
14045         SimpleNames to compose a name, while xTerminal is used just to
14046         catch the case where the simplename lookup failed.
14047
14048 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
14049
14050         * expression.cs (ResolveMemberAccess): Remove redundant code.
14051         TypeExpr expressions are always born fully resolved.
14052
14053         * interface.cs (PopulateMethod): Do not lookup the types twice.
14054         We were doing it once during SemanticAnalysis and once during
14055         PopulateMethod.
14056
14057         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
14058         in local variable type definitions, were being returned as a
14059         SimpleName (we decomposed everything into a string), that is
14060         because primary_expression was being used instead of a type in the
14061         grammar (reduce/reduce conflicts).
14062
14063         The part that was wrong is that we converted the expression into a
14064         string (an oversimplification in one hand, compounded with primary
14065         expressions doing string concatenation).
14066
14067         So things like:
14068
14069         A.B.C [] x;
14070
14071         Would return "A.B.C[]" as a SimpleName.  This stopped things like
14072         using clauses from working on this particular context.  And a type
14073         was being matched directly against "A.B.C[]".
14074
14075         We now use the correct approach, and allow for ComposedCast to be
14076         part of the unary expression.  So the "A.B.C []" become a composed
14077         cast of "A.B.C" (as a nested group of MemberAccess with a
14078         SimpleName at the end) plus the rank composition "[]". 
14079
14080         Also fixes 35567
14081
14082 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
14083
14084         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
14085         for the access level checking.
14086
14087         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
14088         `TypeContainer container', because I kept getting confused when I
14089         was debugging this code.
14090
14091         * expression.cs (Indexers): Instead of tracking getters/setters,
14092         we now track them in parallel.  We create one arraylist less, but
14093         most importantly it is possible now for the LValue code to find a
14094         matching get for a set.
14095
14096         (IndexerAccess.DoResolveLValue): Update the code.
14097         GetIndexersForType has been modified already to extract all the
14098         indexers from a type.  The code assumed it did not.
14099
14100         Also make the code set the correct return type for the indexer.
14101         This was fixed a long time ago for properties, but was missing for
14102         indexers.  It used to be void_type.
14103
14104         (Binary.Emit): Test first for doubles instead of
14105         floats, as they are more common.
14106
14107         (Binary.EmitBranchable): Use the .un version of the branch opcodes
14108         when dealing with floats and the <=, >= operators.  This fixes bug
14109         #39314 
14110
14111         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14112         to load the array value by emitting a load on the foreach variable
14113         type.  This was incorrect.  
14114
14115         We now emit the code to load an element using the the array
14116         variable type, and then we emit the conversion operator.
14117
14118         Fixed #40176
14119
14120 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
14121
14122         * attribute.cs: Avoid allocation of ArrayLists in the common case.
14123
14124 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
14125
14126         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
14127         test for protection before we test for signatures. 
14128
14129         (MethodSignature.ToString): implement.
14130
14131         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
14132         to the case where we reduced into a LongConstant.
14133
14134         * decl.cs (CheckAccessLevel): If the type is an array, we can not
14135         depend on whether the information is acurrate, because the
14136         Microsoft runtime will always claim that the array type is public,
14137         regardless of the real state.
14138
14139         If the type is a pointer, another problem happens: the type is
14140         reported as non-public in Microsoft.  
14141
14142         In both cases we have to call CheckAccessLevel recursively with
14143         the underlying type as the argument to be tested.
14144
14145 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
14146
14147         * assign.cs (Assign.Emit): If we are dealing with a compound
14148         assignment expression, we should use the code path that stores the
14149         intermediate result in a temporary value.  This fixes #40903.
14150
14151         *expression.cs (Indirection.ToString): Provide ToString method for
14152         debugging. 
14153
14154 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
14155
14156         * class.cs: Null out fields holding references to Block objects so
14157         they can be garbage collected.
14158
14159         * expression.cs (OverloadResolve): Remove unused local.
14160
14161 2003-04-07  Martin Baulig  <martin@ximian.com>
14162
14163         * codegen.cs (EmitContext.CurrentFile): New public field.
14164         (EmitContext.Mark): Use the CurrentFile to check whether the
14165         location is in the correct file.
14166         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
14167
14168 2003-04-07  Martin Baulig  <martin@ximian.com>
14169
14170         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
14171
14172         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
14173         location.  [FIXME: The location argument which gets passed to this
14174         method is sometimes wrong!]
14175
14176 2003-04-07  Nick Drochak <ndrochak@gol.com>
14177
14178         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
14179
14180 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
14181
14182         * expression.cs (Indirection.EmitAssign): We were using the
14183         temporary, but returning immediately instead of continuing the
14184         EmitAssing flow.
14185
14186 2003-04-06  Martin Baulig  <martin@ximian.com>
14187
14188         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
14189         if it's a nested child, but also deriving from the outer class.
14190         See test 190.cs.
14191
14192         * typemanager.cs (IsNestedChildOf): Make this work if it's a
14193         nested child, but also deriving from the outer class.  See
14194         test-190.cs.
14195         (FilterWithClosure): We may access private members of the outer
14196         class if we're a nested child and deriving from the outer class.
14197         (RealMemberLookup): Only set `closure_private_ok' if the
14198         `original_bf' contained BindingFlags.NonPublic.
14199
14200 2003-04-05  Martin Baulig  <martin@ximian.com>
14201
14202         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
14203         probe if its a type parameter, and if so, flag an error.
14204
14205         * decl.cs: Move here the SetParameterInfo code from class.cs.
14206         Handle IsGeneric here.
14207
14208         Handle a variety of errors in the parameter info definition.
14209
14210         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
14211         type parameters here.
14212
14213         * cs-parser.jay (class_declaration): report errors for parameters
14214         here as well.
14215
14216 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
14217
14218         * generic.cs: New file, contains support code for generics.
14219
14220         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
14221         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
14222
14223         Update parser for the above removals.
14224
14225         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
14226         now taken care of in the parser.
14227
14228 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
14229
14230         * class.cs (Event.Define): Do not allow abstract events to have
14231         initializers. 
14232
14233 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
14234
14235         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
14236         block in event declarations.
14237
14238         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
14239         value type, get its address.
14240
14241         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
14242         leaving a class on the stack instead of a boolean value (int
14243         0/1).  Change the code so we compare against null, and then the
14244         result against zero.
14245
14246         * class.cs (TypeContainer.GetClassBases): We were checking for the
14247         parent class being sealed too late.
14248
14249         * expression.cs (Binary.Emit): For <= and >= when dealing with
14250         floating point values, use cgt.un and clt.un instead of cgt and
14251         clt alone.
14252
14253 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
14254
14255         * statement.cs: Apply the same optimization as MS: skip the 
14256         GetEnumerator returning an IEnumerator, and use the one returning a 
14257         CharEnumerator instead. This allows us to avoid the try-finally block 
14258         and the boxing.
14259
14260 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
14261
14262         * cs-parser.jay: Attributes cannot be applied to
14263                          namespaces. Fixes #40473
14264
14265 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14266
14267         * class.cs:
14268         (Add*): check if the name is valid using the full name for constants,
14269         fields, properties and events.
14270
14271 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
14272
14273         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
14274         char constants to be part of the enumeration.
14275
14276         * expression.cs (Conditional.DoResolve): Add support for operator
14277         true. Implements the missing functionality from 14.12
14278
14279         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
14280         operator true/false as required by the spec.
14281
14282         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
14283         implicit conversion to boolean.
14284
14285         * statement.cs (Statement.ResolveBoolean): A boolean expression is
14286         also one where the type implements `operator true'. 
14287
14288         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
14289         get an expression that will invoke operator true based on an
14290         expression.  
14291
14292         (GetConversionOperators): Removed the hack that called op_True
14293         here.  
14294
14295         (Expression.ResolveBoolean): Move this from Statement.
14296
14297 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
14298
14299         * ecore.cs (FieldExpr): do not allow initialization of initonly
14300         fields on derived classes
14301
14302 2003-03-13  Martin Baulig  <martin@ximian.com>
14303
14304         * statement.cs (Block.Emit): Call ig.BeginScope() and
14305         ig.EndScope() when compiling with debugging info; call
14306         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
14307
14308 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
14309
14310         * expression.cs (Indexers): Do not construct immediately, allow
14311         for new members to be appended as we go.  Fixes 38143
14312
14313 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14314
14315         * expression.cs: save/restore context when resolving an unchecked
14316         expression.
14317
14318 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
14319
14320         * cfold.cs: Catch division by zero in modulus operator during
14321         constant folding.
14322
14323 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
14324
14325         * interface.cs (Interface.DefineMembers): Avoid defining members
14326         twice. 
14327
14328 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
14329
14330         * driver.cs: handle the +/- options for -noconfig
14331
14332         * statement.cs (Unckeched.Resolve): Also track the state of
14333         unchecked in the Resolve phase.
14334
14335 2003-02-27  Martin Baulig  <martin@ximian.com>
14336
14337         * ecore.cs (Expression.MemberLookup): Don't create a
14338         MethodGroupExpr for something which is not a method.  Fixes #38291.
14339
14340 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
14341
14342         * class.cs (MemberBase.CheckParameters): Also check that the type
14343         is unmanaged if it is a pointer.
14344
14345         * expression.cs (SizeOf.Resolve): Add location information.
14346
14347         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
14348         a managed type is declared.
14349
14350         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
14351         parameter modifiers as well.  Fixes bug 38606
14352
14353         * class.cs: Very sad.  Am backing out the speed up changes
14354         introduced by the ArrayList -> Array in the TypeContainer, as they
14355         were not actually that much faster, and introduced a bug (no error
14356         reports on duplicated methods).
14357
14358         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
14359         source first, this will guarantee that we have a valid expression
14360         before calling in lower levels functions that will require a
14361         resolved object.  Then use this original_source in the
14362         target.ResolveLValue instead of the original source that was
14363         passed to us.
14364
14365         Another change.  Use target.Resolve instead of LValueResolve.
14366         Although we are resolving for LValues, we will let the Assign code
14367         take care of that (it will be called again from Resolve).  This
14368         basically allows code like this:
14369
14370         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
14371         class Y { void A (X x) { x [0] += o; }
14372
14373         The problem was that the indexer was trying to resolve for
14374         set_Item (idx, object o) and never finding one.  The real set_Item
14375         was set_Item (idx, X).  By delaying the process we get the right
14376         semantics. 
14377
14378         Fixes bug 36505
14379
14380 2003-02-23  Martin Baulig  <martin@ximian.com>
14381
14382         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14383         while calling DoEmit ().
14384
14385         * codegen.cs (EmitContext.Mark): Don't mark locations in other
14386         source files; if you use the #line directive inside a method, the
14387         compiler stops emitting line numbers for the debugger until it
14388         reaches the end of the method or another #line directive which
14389         restores the original file.
14390
14391 2003-02-23  Martin Baulig  <martin@ximian.com>
14392
14393         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14394
14395 2003-02-23  Martin Baulig  <martin@ximian.com>
14396
14397         * statement.cs (Block.AddChildVariableNames): We need to call this
14398         recursively, not just for our immediate children.
14399
14400 2003-02-23  Martin Baulig  <martin@ximian.com>
14401
14402         * class.cs (Event.Define): Always make the field private, like csc does.
14403
14404         * typemanager.cs (TypeManager.RealMemberLookup): Make events
14405         actually work, fixes bug #37521.
14406
14407 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
14408
14409         * delegate.cs: When creating the various temporary "Parameters"
14410         classes, make sure that we call the ComputeAndDefineParameterTypes
14411         on those new parameters (just like we do with the formal ones), to
14412         allow them to be resolved in the context of the DeclSpace.
14413
14414         This fixes the bug that Dick observed in Bugzilla #38530.
14415
14416 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
14417
14418         * expression.cs (ResolveMemberAccess): When resolving a constant,
14419         do not attempt to pull a constant if the value was not able to
14420         generate a valid constant.
14421
14422         * const.cs (LookupConstantValue): Do not report more errors than required.
14423
14424 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14425
14426         * expression.cs: fixes bug #38328.
14427
14428 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14429
14430         * class.cs: Changed all the various members that can be part of a
14431         class from being an ArrayList to be an Array of the right type.
14432         During the DefineType type_list, interface_list, delegate_list and
14433         enum_list are turned into types, interfaces, delegates and enums
14434         arrays.  
14435
14436         And during the member population, indexer_list, event_list,
14437         constant_list, field_list, instance_constructor_list, method_list,
14438         operator_list and property_list are turned into their real arrays.
14439
14440         Although we could probably perform this operation earlier, for
14441         good error reporting we need to keep the lists and remove the
14442         lists for longer than required.
14443
14444         This optimization was triggered by Paolo profiling the compiler
14445         speed on the output of `gen-sample-program.pl' perl script. 
14446
14447         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
14448         not crash in methods like MemberLookupFailed that use this field.  
14449
14450         This problem arises when the compiler fails to resolve a type
14451         during interface type definition for example.
14452
14453 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14454
14455         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14456         inherit from System.Object, so we have to stop at null, not only
14457         when reaching System.Object.
14458
14459 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
14460
14461         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14462         DeclaredOnly because the parent indexer might have had a different
14463         name, but did not loop until the top of the hierarchy was reached.
14464
14465         The problem this one fixes is 35492: when a class implemented an
14466         indexer from an interface, we were getting the interface method
14467         (which was abstract) and we were flagging an error (can not invoke
14468         abstract method).
14469
14470         This also keeps bug 33089 functioning, and test-148 functioning.
14471
14472         * typemanager.cs (IsSpecialMethod): The correct way of figuring
14473         out if a method is special is to see if it is declared in a
14474         property or event, or whether it is one of the predefined operator
14475         names.   This should fix correctly #36804.
14476
14477 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
14478
14479         The goal here is to remove the dependency on EmptyCast.Peel ().
14480         Killing it completely.
14481
14482         The problem is that currently in a number of places where
14483         constants are expected, we have to "probe" for an EmptyCast, and
14484         Peel, which is not the correct thing to do, as this will be
14485         repetitive and will likely lead to errors. 
14486
14487         The idea is to remove any EmptyCasts that are used in casts that
14488         can be reduced to constants, so we only have to cope with
14489         constants. 
14490
14491         This bug hunt was triggered by Bug 37363 and the desire to remove
14492         the duplicate pattern where we were "peeling" emptycasts to check
14493         whether they were constants.  Now constants will always be
14494         constants.
14495
14496         * ecore.cs: Use an enumconstant here instead of wrapping with
14497         EmptyCast.  
14498
14499         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14500         throwing me off.  By handling this we can get rid of a few hacks.
14501
14502         * statement.cs (Switch): Removed Peel() code.
14503
14504 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
14505
14506         * class.cs: Location information for error 508
14507
14508         * expression.cs (New.DoResolve): Add a guard against double
14509         resolution of an expression.  
14510
14511         The New DoResolve might be called twice when initializing field
14512         expressions (see EmitFieldInitializers, the call to
14513         GetInitializerExpression will perform a resolve on the expression,
14514         and later the assign will trigger another resolution
14515
14516         This leads to bugs (#37014)
14517
14518         * delegate.cs: The signature for EndInvoke should contain any ref
14519         or out parameters as well.  We were not doing this in the past. 
14520
14521         * class.cs (Field.Define): Do not overwrite the type definition
14522         inside the `volatile' group.  Turns out that volatile enumerations
14523         were changing the type here to perform a validity test, which
14524         broke conversions. 
14525
14526 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
14527
14528         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14529         and structs, we do not want to load the instance variable
14530
14531         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14532         enum_type has to be handled like an object reference (implicit
14533         conversions exists from this to object), but the regular IsClass
14534         and IsValueType tests will never return true for this one.
14535
14536         Also we use TypeManager.IsValueType instead of type.IsValueType,
14537         just for consistency with the rest of the code (this is only
14538         needed if we ever use the construct exposed by test-180.cs inside
14539         corlib, which we dont today).
14540
14541 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
14542
14543         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14544         just InternalCall.
14545
14546 2003-02-09  Martin Baulig  <martin@ximian.com>
14547
14548         * namespace.cs (Namespace..ctor): Added SourceFile argument.
14549         (Namespace.DefineNamespaces): New static public method; this is
14550         called when we're compiling with debugging to add all namespaces
14551         to the symbol file.
14552
14553         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14554         pass it to the Namespace's .ctor.
14555
14556         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14557         and MethodBase arguments; pass the namespace ID to the symwriter;
14558         pass the MethodBase instead of the token to the symwriter.
14559         (SymbolWriter.DefineNamespace): New method to add a namespace to
14560         the symbol file.
14561
14562 2003-02-09  Martin Baulig  <martin@ximian.com>
14563
14564         * symbolwriter.cs: New file.  This is a wrapper around
14565         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
14566         methods here in near future.
14567
14568 2003-02-09  Martin Baulig  <martin@ximian.com>
14569
14570         * codegen.cs (EmitContext.Mark): Just pass the arguments to
14571         ILGenerator.MarkSequencePoint() which are actually used by the
14572         symbol writer.
14573
14574 2003-02-09  Martin Baulig  <martin@ximian.com>
14575
14576         * location.cs (SourceFile): New public sealed class.  This
14577         contains the name and an index which is used in the location's token.
14578         (Location): Reserve an appropriate number of bits in the token for
14579         the source file instead of walking over that list, this gives us a
14580         really huge performance improvement when compiling with debugging.
14581
14582         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14583         `SourceFile' argument instead of a string.
14584         (Driver.ProcessFile): Add all the files via Location.AddFile(),
14585         but don't parse/tokenize here, we need to generate the list of all
14586         source files before we do that.
14587         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
14588         the files.
14589
14590         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14591         instead of a string.
14592
14593         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14594         of a string.
14595
14596 2003-02-09  Martin Baulig  <martin@ximian.com>
14597
14598         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14599         filename on `#line default'.
14600
14601 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14602
14603         * statement.cs: don't clear the pinned var when the fixed statement
14604         returns from the method (fixes bug#37752).
14605
14606 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14607
14608         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
14609         to IsValueType.
14610
14611 2003-02-07  Martin Baulig  <martin@ximian.com>
14612
14613         * driver.cs: Removed the `--debug-args' command line argument.
14614
14615         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14616         automatically by the AsssemblyBuilder.
14617         (CodeGen.InitializeSymbolWriter): We don't need to call any
14618         initialization function on the symbol writer anymore.  This method
14619         doesn't take any arguments.
14620
14621 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
14622
14623         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14624         from referenced assemblies as well.
14625
14626 2003-02-02  Martin Baulig  <martin@ximian.com>
14627
14628         * class.cs (MethodData.Emit): Generate debugging info for external methods.
14629
14630 2003-02-02  Martin Baulig  <martin@ximian.com>
14631
14632         * class.cs (Constructor.Emit): Open the symbol writer before
14633         emitting the constructor initializer.
14634         (ConstructorInitializer.Emit): Call ec.Mark() to allow
14635         single-stepping through constructor initializers.
14636
14637 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
14638
14639         * class.cs: Handle error 549: do not allow virtual methods in
14640         sealed classes. 
14641
14642 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14643
14644         * decl.cs: Check access levels when resolving types
14645
14646 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14647
14648         * statement.cs: Add parameters and locals set in catch blocks that might 
14649         return to set vector
14650
14651 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
14652
14653         * class.cs (Operator): Set the SpecialName flags for operators.
14654
14655         * expression.cs (Invocation.DoResolve): Only block calls to
14656         accessors and operators on SpecialName methods.
14657
14658         (Cast.TryReduce): Handle conversions from char constants.
14659
14660
14661 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14662
14663         * statement.cs: small memory and time optimization in FlowBranching.
14664
14665 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
14666
14667         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14668         problem that the last fix but in the other sid (Set).
14669
14670         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14671         access when there is no indexer in the hierarchy.
14672
14673 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14674
14675         * class.cs: Combine some if statements.
14676
14677 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14678
14679         * driver.cs: fixed bug #37187.
14680
14681 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
14682
14683         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
14684         any indexer, it's needed to build a list with all the indexers in the
14685         hierarchy (AllGetters), else we have problems. Fixes #35653.
14686
14687 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
14688
14689         * class.cs (MethodData.Define): It is wrong for an interface
14690         implementation to be static in both cases: explicit and implicit.
14691         We were only handling this in one case.
14692
14693         Improve the if situation there to not have negations.
14694
14695         * class.cs (Field.Define): Turns out that we do not need to check
14696         the unsafe bit on field definition, only on usage.  Remove the test.
14697
14698 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14699
14700         * driver.cs: use assembly.Location instead of Codebase (the latest
14701         patch made mcs fail when using MS assemblies).
14702
14703 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
14704
14705         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
14706         get the path to *corlib.dll.
14707
14708 2003-01-21  Nick Drochak <ndrochak@gol.com>
14709
14710         * cs-tokenizer.cs:
14711         * pending.cs:
14712         * typemanager.cs: Remove compiler warnings
14713
14714 2003-01-20  Duncan Mak  <duncan@ximian.com>
14715
14716         * AssemblyInfo.cs: Bump the version number to 0.19.
14717
14718 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14719
14720         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
14721
14722 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
14723
14724         * class.cs (Constructor::Emit): Emit debugging info for constructors.
14725
14726 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
14727
14728         * cs-parser.jay: Small fix: we were not comparing the constructor
14729         name correctly.   Thanks to Zoltan for the initial pointer.
14730
14731 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
14732
14733         * cs-tokenizer.cs: Set file name when specified with #line
14734
14735 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
14736
14737         * cs-parser.jay: Only perform the constructor checks here if we
14738         are named like the class;  This will help provider a better
14739         error.  The constructor path is taken when a type definition is
14740         not found, but most likely the user forgot to add the type, so
14741         report that rather than the constructor error.
14742
14743 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
14744
14745         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
14746         allocations.
14747
14748 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14749
14750         * cs-parser.jay: Add cleanup call.
14751
14752 2003-01-13  Duncan Mak  <duncan@ximian.com>
14753
14754         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
14755         consistent with other methods.
14756
14757 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14758
14759         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
14760
14761 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
14762
14763         * attribute.cs: only set GuidAttr to true when we have a
14764         GuidAttribute.
14765
14766 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14767
14768         * ecore.cs:
14769         * expression.cs:
14770         * typemanager.cs: fixes to allow mcs compile corlib with the new
14771         Type.IsSubclassOf fix.
14772
14773 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
14774
14775         * expression.cs (LocalVariableReference.DoResolve): Classify a
14776         constant as a value, not as a variable.   Also, set the type for
14777         the variable.
14778
14779         * cs-parser.jay (fixed_statement): take a type instead of a
14780         pointer_type, so we can produce a better error message later.
14781
14782         * statement.cs (Fixed.Resolve): Flag types that are not pointers
14783         as an error.  
14784
14785         (For.DoEmit): Make inifinite loops have a
14786         non-conditional branch back.
14787
14788         (Fixed.DoEmit): First populate the pinned variables, then emit the
14789         statement, then clear the variables.  Before I was emitting the
14790         code once for each fixed piece.
14791
14792
14793 2003-01-08  Martin Baulig  <martin@ximian.com>
14794
14795         * statement.cs (FlowBranching.MergeChild): A break in a
14796         SWITCH_SECTION does not leave a loop.  Fixes #36155.
14797
14798 2003-01-08  Martin Baulig  <martin@ximian.com>
14799
14800         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
14801         lives in the same number space than `param_map'.  Fixes #36154.
14802
14803 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
14804
14805         * cs-parser.jay (constructor_declaration): Set the
14806         Constructor.ModFlags before probing for it.  This makes the
14807         compiler report 514, 515 and 132 (the code was there, but got
14808         broken). 
14809
14810         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
14811         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
14812         (GotoCase.Resolve): Set `Returns' to ALWAYS.
14813
14814 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
14815
14816         * enum.cs: create the enum static fields using the enum type.
14817
14818 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
14819
14820         * class.cs: don't try to create the ParamBuilder for the return
14821         type if it's not needed (and handle it breaking for the ms runtime
14822         anyway).
14823
14824 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
14825
14826         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
14827
14828 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
14829
14830         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
14831         the command.   This showed up while compiling the JANET source
14832         code, which used \r as its only newline separator.
14833
14834 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
14835
14836         * class.cs (Method.Define): If we are an operator (because it
14837         reuses our code), then set the SpecialName and HideBySig.  #36128
14838
14839 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
14840
14841         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
14842         exception, report error 120 `object reference required'.
14843
14844         * driver.cs: Add --pause option, used during to measure the size
14845         of the process as it goes with --timestamp.
14846
14847         * expression.cs (Invocation.DoResolve): Do not allow methods with
14848         SpecialName to be invoked.
14849
14850 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
14851
14852         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
14853         number before adding it.
14854
14855 2002-12-21  Ravi Pratap  <ravi@ximian.com>
14856
14857         * ecore.cs (StandardImplicitConversion): When in an unsafe
14858         context, we allow conversion between void * to any other pointer
14859         type. This fixes bug #35973.
14860
14861 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
14862
14863         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
14864         is not thrown when extensionless outputs are used 
14865
14866 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14867
14868         * rootcontext.cs: fixed compilation of corlib.
14869
14870 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
14871
14872         * attribute.cs (Attributes.Contains): Add new method.
14873
14874         * class.cs (MethodCore.LabelParameters): if the parameter is an
14875         `out' parameter, check that no attribute `[In]' has been passed.
14876
14877         * enum.cs: Handle the `value__' name in an enumeration.
14878
14879 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
14880
14881         * decl.cs: Added special case to allow overrides on "protected
14882         internal" methods
14883
14884 2002-12-18  Ravi Pratap  <ravi@ximian.com>
14885
14886         * attribute.cs (Attributes.AddAttributeSection): Rename to this
14887         since it makes much more sense.
14888
14889         (Attributes.ctor): Don't require a Location parameter.
14890
14891         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
14892
14893         * attribute.cs (ApplyAttributes): Remove extra Location parameters
14894         since we already have that information per attribute.
14895
14896         * everywhere : make appropriate changes.
14897
14898         * class.cs (LabelParameters): Write the code which actually
14899         applies attributes to the return type. We can't do this on the MS
14900         .NET runtime so we flag a warning in the case an exception is
14901         thrown.
14902
14903 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
14904
14905         * const.cs: Handle implicit null conversions here too.
14906
14907 2002-12-17  Ravi Pratap  <ravi@ximian.com>
14908
14909         * class.cs (MethodCore.LabelParameters): Remove the extra
14910         Type [] parameter since it is completely unnecessary. Instead
14911         pass in the method's attributes so that we can extract
14912         the "return" attribute.
14913
14914 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
14915
14916         * cs-parser.jay (parse): Use Report.Error to flag errors instead
14917         of ignoring it and letting the compile continue.
14918
14919         * typemanager.cs (ChangeType): use an extra argument to return an
14920         error condition instead of throwing an exception.
14921
14922 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
14923
14924         * expression.cs (Unary.TryReduce): mimic the code for the regular
14925         code path.  Perform an implicit cast in the cases where we can
14926         implicitly convert to one of the integral types, and then reduce
14927         based on that constant.   This fixes bug #35483.
14928
14929 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14930
14931         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
14932
14933 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14934
14935         * namespace.cs: fixed bug #35489.
14936
14937 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
14938
14939         * class.cs: Remove some dead code.
14940
14941         * cs-parser.jay: Estimate the number of methods needed
14942         (RootContext.MethodCount);
14943
14944         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
14945         numbers instead of StringBuilders.
14946
14947         * support.cs (PtrHashtable): Add constructor with initial size;
14948         We can now reduce reallocations of the method table.
14949
14950 2002-12-10  Ravi Pratap  <ravi@ximian.com>
14951
14952         * attribute.cs (ApplyAttributes): Keep track of the emitted
14953         attributes on a per-target basis. This fixes bug #35413.
14954
14955 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
14956
14957         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
14958         default to the Windows 1252 encoding.
14959
14960         (UnixParseOption): Support version, thanks to Alp for the missing
14961         pointer. 
14962
14963         * AssemblyInfo.cs: Add nice assembly information.
14964
14965         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
14966         (bug 35169).
14967
14968         * cs-parser.jay: Allow a trailing comma before the close bracked
14969         in the attribute_section production.
14970
14971         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
14972         address of the instance was being taken, I will take this out,
14973         because we take the address of the object immediately here.
14974
14975 2002-12-09  Ravi Pratap  <ravi@ximian.com>
14976
14977         * typemanager.cs (AreMultipleAllowed): Take care of the most
14978         obvious case where attribute type is not in the current assembly -
14979         stupid me ;-)
14980
14981 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
14982
14983         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
14984         definitions, instead of doing that afterwards.  
14985
14986         Also we use a nice little hack, depending on the constructor, we
14987         know if we are a "composed" name or a simple name.  Hence, we
14988         avoid the IndexOf test, and we avoid 
14989
14990         * codegen.cs: Add code to assist in a bug reporter to track down
14991         the source of a compiler crash. 
14992
14993 2002-12-07  Ravi Pratap  <ravi@ximian.com>
14994
14995         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
14996         types have been emitted for a given element and flag an error
14997         if something which does not have AllowMultiple set is used more
14998         than once.
14999
15000         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
15001         attribute types and their corresponding AllowMultiple properties
15002
15003         (AreMultipleAllowed): Check the property for a given type.
15004
15005         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
15006         property in the case we have a TypeContainer.
15007
15008         (Attributes.AddAttribute): Detect duplicates and just skip on
15009         adding them. This trivial fix catches a pretty gross error in our
15010         attribute emission - global attributes were being emitted twice!
15011
15012         Bugzilla bug #33187 is now fixed.
15013
15014 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
15015
15016         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
15017         instead of pp_and).
15018
15019         * expression.cs (Binary.ResolveOperator): I can only use the
15020         Concat (string, string, string) and Concat (string, string,
15021         string, string) if the child is actually a concatenation of
15022         strings. 
15023
15024 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
15025
15026         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
15027         context where we need a 2-character lookahead.
15028
15029         * pending.cs (PendingImplementation): Rework so we can keep track
15030         of interface types all the time, and flag those which were
15031         implemented by parents as optional.
15032
15033 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
15034
15035         * expression.cs (Binary.ResolveOperator): Use
15036         String.Concat(string,string,string) or
15037         String.Concat(string,string,string,string) when possible. 
15038
15039         * typemanager: More helper methods.
15040
15041
15042 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
15043
15044         * pending.cs: remove the bogus return from GetMissingInterfaces()
15045         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
15046
15047 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15048
15049         * namespace.cs: avoid duplicated 'using xxx' being added to
15050         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
15051         when we get more than one 'using' statement for the same namespace.
15052         Report a CS0105 warning for it.
15053
15054 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
15055
15056         * cs-tokenizer.cs (consume_identifier): use read directly, instead
15057         of calling getChar/putback, uses internal knowledge of it.    
15058
15059         (xtoken): Reorder tokenizer so most common patterns are checked
15060         first.  This reduces the compilation time in another 5% (from 8.11s
15061         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
15062
15063         The parsing time is 22% of the compilation in mcs, and from that
15064         64% is spent on the tokenization process.  
15065
15066         I tried using a binary search for keywords, but this is slower
15067         than the hashtable.  Another option would be to do a couple of
15068         things:
15069
15070                 * Not use a StringBuilder, instead use an array of chars,
15071                   with a set value.  Notice that this way we could catch
15072                   the 645 error without having to do it *afterwards*.
15073
15074                 * We could write a hand-parser to avoid the hashtable
15075                   compares altogether.
15076
15077         The identifier consumption process takes 37% of the tokenization
15078         time.  Another 15% is spent on is_number.  56% of the time spent
15079         on is_number is spent on Int64.Parse:
15080
15081                 * We could probably choose based on the string length to
15082                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
15083                   computations. 
15084
15085         Another 3% is spend on wrapping `xtoken' in the `token' function.
15086
15087         Handle 0xa0 as whitespace (#34752)
15088
15089 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
15090
15091         * typemanager.cs (IsCLRType): New routine to tell whether a type
15092         is one of the builtin types.  
15093
15094         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
15095         typecode in more places instead of doing pointer comparissions.
15096         We could leverage some knowledge about the way the typecodes are
15097         laid out.
15098
15099         New code to cache namespaces in assemblies, it is currently not
15100         invoked, to be used soon.
15101
15102         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
15103
15104         * expression.cs (Binary.ResolveOperator): specially handle
15105         strings, and do not perform user-defined operator overloading for
15106         built-in types.
15107
15108 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
15109
15110         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
15111         internalcall as it is a pretty simple operation;  Avoid whenever
15112         possible to call Char.IsLetter.
15113
15114         (consume_identifier): Cut by half the number of
15115         hashtable calls by merging the is_keyword and GetKeyword behavior.
15116
15117         Do not short-circuit, because if we do, we
15118         report errors (ie, #if false && true would produce an invalid
15119         directive error);
15120
15121
15122 2002-11-24  Martin Baulig  <martin@ximian.com>
15123
15124         * expression.cs (Cast.TryReduce): If we're in checked syntax,
15125         check constant ranges and report a CS0221.  Fixes #33186.
15126
15127 2002-11-24  Martin Baulig  <martin@ximian.com>
15128
15129         * cs-parser.jay: Make this work for uninitialized variable
15130         declarations in the `for' initializer.  Fixes #32416.
15131
15132 2002-11-24  Martin Baulig  <martin@ximian.com>
15133
15134         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
15135         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
15136
15137 2002-11-24  Martin Baulig  <martin@ximian.com>
15138
15139         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
15140         argument; if true, we also check for user-defined conversions.
15141         This is only needed if both arguments are of a user-defined type.
15142         Fixes #30443, added test-175.cs.
15143         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
15144
15145         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
15146
15147 2002-11-24  Martin Baulig  <martin@ximian.com>
15148
15149         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
15150         function to get the store opcode.
15151         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
15152         only emit the Ldelema if the store opcode is Stobj.  You must run
15153         both test-34 and test-167 to test this.  Fixes #34529.
15154
15155 2002-11-23  Martin Baulig  <martin@ximian.com>
15156
15157         * ecore.cs (Expression.MemberLookup): Added additional
15158         `qualifier_type' argument which is used when we're being called
15159         from MemberAccess.DoResolve() and null if we're called from a
15160         SimpleName lookup.
15161         (Expression.MemberLookupFailed): New method to report errors; this
15162         does the CS1540 check and reports the correct error message.
15163
15164         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
15165         argument for the CS1540 check and redone the way how we're dealing
15166         with private members.  See the comment in the source code for details.
15167         (FilterWithClosure): Reverted this back to revision 1.197; renamed
15168         `closure_start_type' to `closure_qualifier_type' and check whether
15169         it's not null.  It was not this filter being broken, it was just
15170         being called with the wrong arguments.
15171
15172         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
15173         and pass it the correct `qualifier_type'; this also does the error
15174         handling for us.
15175
15176 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
15177
15178         * expression.cs (Invocation.EmitParams): If the we are dealing
15179         with a non-built-in value type, load its address as well.
15180
15181         (ArrayCreation): Use a a pretty constant instead
15182         of the hardcoded value 2.   Use 6 instead of 2 for the number of
15183         static initializers.  
15184
15185         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
15186         because they are not really value types, just glorified integers. 
15187
15188         * driver.cs: Do not append .exe, the CSC compiler does not do it.
15189
15190         * ecore.cs: Remove redundant code for enumerations, make them use
15191         the same code path as everything else, fixes the casting issue
15192         with enumerations in Windows.Forms.
15193
15194         * attribute.cs: Do only cast to string if it is a string, the
15195         validation happens later.
15196
15197         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
15198         people upgrade their corlibs.
15199
15200         * ecore.cs: Oops, enumerations were not following the entire code path
15201
15202 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
15203
15204         * typemanager.cs (FilterWithClosure): Commented out the test for
15205         1540 in typemanager.cs, as it has problems when accessing
15206         protected methods from a parent class (see test-174.cs). 
15207
15208         * attribute.cs (Attribute.ValidateGuid): new method.
15209         (Attribute.Resolve): Use above.
15210
15211 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
15212
15213         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
15214
15215         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
15216         handling for enumerations, as we only needed the TypeContainer
15217         functionality to begin with (this is required for the fix below to
15218         work for enums that reference constants in a container class for
15219         example). 
15220
15221         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
15222
15223         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
15224         a valid TypeBuilder to perform lookups on.o
15225
15226         * class.cs (InheritableMemberSignatureCompare): Use true in the
15227         call to GetGetMethod and GetSetMethod, because we are comparing
15228         the signature, and we need to get the methods *even* if they are
15229         private. 
15230
15231         (PropertyBase.CheckBase): ditto.
15232
15233         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
15234         GotoCase.Resolve): Use Peel on EmpytCasts.
15235
15236         * ecore.cs (EmptyCast): drop child, add Peel method.
15237
15238 2002-11-17  Martin Baulig  <martin@ximian.com>
15239
15240         * ecore.cs (EmptyCast.Child): New public property.
15241
15242         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
15243         label resolved to an EmptyCast.  Fixes #34162.
15244         (GotoCase.Resolve): Likewise.
15245         (Block.EmitMeta): Likewise.
15246
15247 2002-11-17  Martin Baulig  <martin@ximian.com>
15248
15249         * expression.cs (Invocation.BetterConversion): Prefer int over
15250         uint; short over ushort; long over ulong for integer literals.
15251         Use ImplicitConversionExists instead of StandardConversionExists
15252         since we also need to check for user-defined implicit conversions.
15253         Fixes #34165.  Added test-173.cs.
15254
15255 2002-11-16  Martin Baulig  <martin@ximian.com>
15256
15257         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
15258         with the `true' and `false' literals.  Fixes #33151.
15259
15260 2002-11-16  Martin Baulig  <martin@ximian.com>
15261
15262         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
15263         October 22nd; don't do the cs1540 check for static members.
15264
15265         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
15266         now using our own filter here and doing the cs1540 check again.
15267
15268 2002-11-16  Martin Baulig  <martin@ximian.com>
15269
15270         * support.cs (InternalParameters): Don't crash if we don't have
15271         any fixed parameters.  Fixes #33532.
15272
15273 2002-11-16  Martin Baulig  <martin@ximian.com>
15274
15275         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
15276         when looking up static methods to make this work on Windows.
15277         Fixes #33773.
15278
15279 2002-11-16  Martin Baulig  <martin@ximian.com>
15280
15281         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
15282         a setter rather than using PropertyInfo.CanWrite.
15283
15284 2002-11-15  Nick Drochak  <ndrochak@gol.com>
15285
15286         * class.cs: Allow acces to block member by subclasses. Fixes build
15287         breaker.
15288
15289 2002-11-14  Martin Baulig  <martin@ximian.com>
15290
15291         * class.cs (Constructor.Emit): Added the extern/block check.
15292         Fixes bug #33678.
15293
15294 2002-11-14  Martin Baulig  <martin@ximian.com>
15295
15296         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
15297         iteration while looking for indexers, this is needed because the
15298         indexer may have a different name in our base classes.  Fixed the
15299         error reporting (no indexers at all, not get accessor, no
15300         overloaded match).  Fixes bug #33089.
15301         (IndexerAccess.DoResolveLValue): Likewise.
15302
15303 2002-11-14  Martin Baulig  <martin@ximian.com>
15304
15305         * class.cs (PropertyBase.CheckBase): Make this work for multiple
15306         indexers.  Fixes the first part of bug #33089.
15307         (MethodSignature.InheritableMemberSignatureCompare): Added support
15308         for properties.
15309
15310 2002-11-13  Ravi Pratap  <ravi@ximian.com>
15311
15312         * attribute.cs (Attribute.Resolve): Catch the
15313         NullReferenceException and report it since it isn't supposed to
15314         happen. 
15315
15316 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
15317
15318         * expression.cs (Binary.EmitBranchable): Also handle the cases for
15319         LogicalOr and LogicalAnd that can benefit from recursively
15320         handling EmitBranchable.  The code now should be nice for Paolo.
15321
15322 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
15323
15324         * typemanager.cs (LookupType): Added a negative-hit hashtable for
15325         the Type lookups, as we perform quite a number of lookups on
15326         non-Types.  This can be removed once we can deterministically tell
15327         whether we have a type or a namespace in advance.
15328
15329         But this might require special hacks from our corlib.
15330
15331         * TODO: updated.
15332
15333         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
15334         and double which avoids a conversion from an integer to a double.
15335
15336         * expression.cs: tiny optimization, avoid calling IsConstant,
15337         because it effectively performs the lookup twice.
15338
15339 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
15340
15341         But a bogus return here to keep the semantics of the old code
15342         until the Mono runtime is fixed.
15343
15344         * pending.cs (GetMissingInterfaces): New method used to remove all
15345         the interfaces that are already implemented by our parent
15346         classes from the list of pending methods. 
15347
15348         * interface.cs: Add checks for calls after ResolveTypeExpr.
15349
15350 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
15351
15352         * class.cs (Class.Emit): Report warning 67: event not used if the
15353         warning level is beyond 3.
15354
15355         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
15356         being a NullLiteral.
15357
15358         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
15359         specifiers. 
15360
15361         * class.cs (TypeContainer.GetClassBases): Cover a missing code
15362         path that might fail if a type can not be resolved.
15363
15364         * expression.cs (Binary.Emit): Emit unsigned versions of the
15365         operators. 
15366
15367         * driver.cs: use error 5.
15368
15369 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
15370
15371         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
15372
15373 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
15374
15375         * cs-parser.jay (switch_section): A beautiful patch from Martin
15376         Baulig that fixed 33094.
15377
15378 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
15379
15380         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15381         Check whether the base is abstract and report an error if so.
15382
15383         * expression.cs (IndexerAccess.DoResolveLValue,
15384         IndexerAccess.DoResolve): ditto. 
15385
15386         (Invocation.DoResolve): ditto.
15387
15388         (Invocation.FullMethodDesc): Improve the report string.
15389
15390         * statement.cs (Block): Eliminate IsVariableDefined as it is
15391         basically just a wrapper for GetVariableInfo.
15392
15393         * ecore.cs (SimpleName): Use new 
15394
15395         * support.cs (ReflectionParamter.ParameterType): We unwrap the
15396         type, as we return the actual parameter ref/unref state on a
15397         different call.
15398
15399 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
15400
15401         * support.cs: Return proper flags REF/OUT fixing the previous
15402         commit.  
15403
15404         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
15405         not used to mean `ref' but `ref or out' in ParameterReference
15406
15407         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15408         full type signature instead of calling TypeManger.CSharpName
15409         ourselves. 
15410
15411         * support.cs (InternalParameters.ParameterDesc): Do not compare
15412         directly to the modflags, because REF/OUT will actually be bitsets
15413         if set. 
15414
15415         * delegate.cs (VerifyMethod): Check also the modifiers.
15416
15417         * cs-tokenizer.cs: Fix bug where floating point values with an
15418         exponent where a sign was missing was ignored.
15419
15420         * driver.cs: Allow multiple assemblies to be specified in a single
15421         /r: argument
15422
15423 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
15424
15425         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
15426         because identifiers after a parenthesis would end up in this kind
15427         of production, and we needed to desamiguate it for having casts
15428         like:
15429
15430                 (UserDefinedType *) xxx
15431
15432 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
15433
15434         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
15435         we should set on the Bindingflags.NonPublic, but not turn on
15436         private_ok.  private_ok controls whether a Private member is
15437         returned (this is chekced on the filter routine), while the
15438         BindingFlags.NonPublic just controls whether private/protected
15439         will be allowed.   This fixes the problem part of the problem of
15440         private properties being allowed to be used in derived classes.
15441
15442         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
15443         so we can call the children DoResolveLValue method (this will
15444         properly signal errors on lvalue assignments to base properties)
15445
15446         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
15447         getter are null, and we have a property info, we know that this
15448         happened because the lookup failed, so we report an error 122 for
15449         protection level violation.
15450
15451         We also silently return if setter and getter are null in the
15452         resolve functions, this condition only happens if we have flagged
15453         the error before.  This is the other half of the problem. 
15454
15455         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15456         not have accessibility information, that is why we were returning
15457         true in the filter function in typemanager.cs.
15458
15459         To properly report 122 (property is inaccessible because of its
15460         protection level) correctly, we report this error in ResolveAccess
15461         by failing if both the setter and the getter are lacking (ie, the
15462         lookup failed). 
15463
15464         DoResolve and DoLResolve have been modified to check for both
15465         setter/getter being null and returning silently, the reason being
15466         that I did not want to put the knowledge about this error in upper
15467         layers, like:
15468
15469         int old = Report.Errors;
15470         x = new PropertyExpr (...);
15471         if (old != Report.Errors)
15472                 return null;
15473         else
15474                 return x;
15475
15476         So the property expr is returned, but it is invalid, so the error
15477         will be flagged during the resolve process. 
15478
15479         * class.cs: Remove InheritablePropertySignatureCompare from the
15480         class, as we no longer depend on the property signature to compute
15481         whether it is possible to implement a method or not.
15482
15483         The reason is that calling PropertyInfo.GetGetMethod will return
15484         null (in .NET, in Mono it works, and we should change this), in
15485         cases where the Get Method does not exist in that particular
15486         class.
15487
15488         So this code:
15489
15490         class X { public virtual int A { get { return 1; } } }
15491         class Y : X { }
15492         class Z : Y { public override int A { get { return 2; } } }
15493
15494         Would fail in Z because the parent (Y) would not have the property
15495         defined.  So we avoid this completely now (because the alternative
15496         fix was ugly and slow), and we now depend exclusively on the
15497         method names.
15498
15499         (PropertyBase.CheckBase): Use a method-base mechanism to find our
15500         reference method, instead of using the property.
15501
15502         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15503         routines are gone now.
15504
15505         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15506         names, they were incorrectly named.
15507
15508         * cs-tokenizer.cs: Return are more gentle token on failure. 
15509
15510         * pending.cs (PendingImplementation.InterfaceMethod): This routine
15511         had an out-of-sync index variable, which caused it to remove from
15512         the list of pending methods the wrong method sometimes.
15513
15514 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
15515
15516         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15517         CanWrite, because those refer to this particular instance of the
15518         property, and do not take into account the fact that we can
15519         override single members of a property.
15520
15521         Constructor requires an EmitContext.  The resolution process does
15522         not happen here, but we need to compute the accessors before,
15523         because the resolution does not always happen for properties.
15524
15525         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15526         subclass, before we did not update this flag, but we did update
15527         bindingflags. 
15528
15529         (GetAccessors): Drop this routine, as it did not work in the
15530         presence of partially overwritten set/get methods. 
15531
15532         Notice that this broke the cs1540 detection, but that will require
15533         more thinking. 
15534
15535 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15536
15537         * class.cs:
15538         * codegen.cs:
15539         * driver.cs: issue a warning instead of an error if we don't support
15540         debugging for the platform. Also ignore a couple of errors that may
15541         arise when trying to write the symbols. Undo my previous patch.
15542
15543 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15544
15545         * driver.cs: ignore /debug switch except for Unix platforms.
15546
15547 2002-10-23  Nick Drochak  <ndrochak@gol.com>
15548
15549         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15550
15551 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
15552
15553         * driver.cs: Do not make mcs-debug conditional, so we do not break
15554         builds that use it.
15555
15556         * statement.cs (UsageVector.MergeChildren): I would like Martin to
15557         review this patch.  But basically after all the children variables
15558         have been merged, the value of "Breaks" was not being set to
15559         new_breaks for Switch blocks.  I think that it should be set after
15560         it has executed.  Currently I set this to the value of new_breaks,
15561         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15562         conservative, but I do not understand this code very well.
15563
15564         I did not break anything in the build, so that is good ;-)
15565
15566         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15567
15568 2002-10-20  Mark Crichton  <crichton@gimp.org>
15569
15570         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
15571
15572 2002-10-20  Nick Drochak  <ndrochak@gol.com>
15573
15574         * cfold.cs: Fixed compile blocker.
15575
15576 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
15577
15578         * driver.cs: I was chekcing the key, not the file.
15579
15580 2002-10-19  Ravi Pratap  <ravi@ximian.com>
15581
15582         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15583         message that we were generating - we just need to silently return
15584         a null.
15585
15586 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
15587
15588         * class.cs (Event.Define): Change my previous commit, as this
15589         breaks the debugger.  This is a temporary hack, as it seems like
15590         the compiler is generating events incorrectly to begin with.
15591
15592         * expression.cs (Binary.ResolveOperator): Added support for 
15593         "U operator - (E x, E y)"
15594
15595         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15596         y)".
15597
15598         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15599         init-only variables, but this path did not take into account that
15600         there might be also instance readonly variables.  Correct this
15601         problem. 
15602
15603         This fixes bug 32253
15604
15605         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15606         delegates as well.
15607
15608         * driver.cs: Change the extension for modules to `netmodule'
15609
15610         * cs-parser.jay: Improved slightly the location tracking for
15611         the debugger symbols.
15612
15613         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15614         modifiers that were specified instead of the hardcoded value
15615         (FamAndAssem).  This was basically ignoring the static modifier,
15616         and others.  Fixes 32429.
15617
15618         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15619         fixed a bug in the process (32476)
15620
15621         * expression.cs (ArrayAccess.EmitAssign): Patch from
15622         hwang_rob@yahoo.ca that fixes bug 31834.3
15623
15624 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
15625
15626         * driver.cs: Make the module extension .netmodule.
15627
15628 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
15629
15630         * driver.cs: Report an error if the resource file is not found
15631         instead of crashing.
15632
15633         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15634         false, like Emit does.
15635
15636 2002-10-16  Nick Drochak  <ndrochak@gol.com>
15637
15638         * typemanager.cs: Remove unused private member.  Also reported mcs
15639         bug to report this as a warning like csc.
15640
15641 2002-10-15  Martin Baulig  <martin@gnome.org>
15642
15643         * statement.cs (Statement.Emit): Made this a virtual method; emits
15644         the line number info and calls DoEmit().
15645         (Statement.DoEmit): New protected abstract method, formerly knows
15646         as Statement.Emit().
15647
15648         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15649
15650 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
15651
15652         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15653         have fixed a remaining problem: not every AddXXXX was adding a
15654         fully qualified name.  
15655
15656         Now everyone registers a fully qualified name in the DeclSpace as
15657         being defined instead of the partial name.  
15658
15659         Downsides: we are slower than we need to be due to the excess
15660         copies and the names being registered this way.  
15661
15662         The reason for this is that we currently depend (on the corlib
15663         bootstrap for instance) that types are fully qualified, because
15664         we dump all the types in the namespace, and we should really have
15665         types inserted into the proper namespace, so we can only store the
15666         basenames in the defined_names array.
15667
15668 2002-10-10  Martin Baulig  <martin@gnome.org>
15669
15670         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15671         from bug #31834, see the bug report for a testcase which is
15672         miscompiled.
15673
15674 2002-10-10  Martin Baulig  <martin@gnome.org>
15675
15676         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
15677         flow analysis code for this.
15678
15679         * statement.cs (Do, While, For): Tell the flow analysis code about
15680         infinite loops.
15681         (FlowBranching.UsageVector): Added support for infinite loops.
15682         (Block.Resolve): Moved the dead code elimination here and use flow
15683         analysis to do it.
15684
15685 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
15686
15687         * class.cs (Field.Define): Catch cycles on struct type
15688         definitions. 
15689
15690         * typemanager.cs (IsUnmanagedtype): Do not recursively check
15691         fields if the fields are static.  We only need to check instance
15692         fields. 
15693
15694         * expression.cs (As.DoResolve): Test for reference type.
15695
15696         * statement.cs (Using.ResolveExpression): Use
15697         ConvertImplicitRequired, not ConvertImplicit which reports an
15698         error on failture
15699         (Using.ResolveLocalVariableDecls): ditto.
15700
15701         * expression.cs (Binary.ResolveOperator): Report errors in a few
15702         places where we had to.
15703
15704         * typemanager.cs (IsUnmanagedtype): Finish implementation.
15705
15706 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
15707
15708         * expression.cs: Use StoreFromPtr instead of extracting the type
15709         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
15710
15711         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
15712         an enumeration value to a System.Enum, but System.Enum is not a
15713         value type, but an class type, so we need to box.
15714
15715         (Expression.ConvertExplicit): One codepath could return
15716         errors but not flag them.  Fix this.  Fixes #31853
15717
15718         * parameter.cs (Resolve): Do not allow void as a parameter type.
15719
15720 2002-10-06  Martin Baulig  <martin@gnome.org>
15721
15722         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
15723         if it's a class type and not a struct.  Fixes #31815.
15724
15725 2002-10-06  Martin Baulig  <martin@gnome.org>
15726
15727         * statement.cs: Reworked the flow analysis code a bit to make it
15728         usable for dead code elimination.
15729
15730 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15731
15732         * cs-parser.jay: allow empty source files. Fixes bug #31781.
15733
15734 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15735
15736         * expression.cs (ComposedCast.DoResolveType): A quick workaround
15737         to fix the test 165, will investigate deeper.
15738
15739 2002-10-04  Martin Baulig  <martin@gnome.org>
15740
15741         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
15742         finally blocks actually work.
15743         (Try.Resolve): We don't need to create a sibling for `finally' if
15744         there is no finally block.
15745
15746 2002-10-04  Martin Baulig  <martin@gnome.org>
15747
15748         * class.cs (Constructor.Define): The default accessibility for a
15749         non-default constructor is private, not public.
15750
15751 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15752
15753         * class.cs (Constructor): Make AllowedModifiers public, add
15754         EXTERN.
15755
15756         * cs-parser.jay: Perform the modifiers test here, as the
15757         constructor for the Constructor class usually receives a zero
15758         because of the way we create it (first we create, later we
15759         customize, and we were never checking the modifiers).
15760
15761         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
15762         is a version of LookupTypeReflection that includes the type-name
15763         cache.  This can be used as a fast path for functions that know
15764         the fully qualified name and are only calling into *.GetType() to
15765         obtain a composed type.
15766
15767         This is also used by TypeManager.LookupType during its type
15768         composition.
15769
15770         (LookupType): We now also track the real type name, as sometimes
15771         we can get a quey for the real type name from things like
15772         ComposedCast.  This fixes bug 31422.
15773
15774         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
15775         complete type fullname, it does not have to go through the type
15776         resolution system to obtain the composed version of the type (for
15777         obtaining arrays or pointers).
15778
15779         (Conditional.Emit): Use the EmitBoolExpression to
15780         generate nicer code, as requested by Paolo.
15781
15782         (ArrayCreation.CheckIndices): Use the patch from
15783         hwang_rob@yahoo.ca to validate the array initializers. 
15784
15785 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
15786
15787         * class.cs (ConstructorInitializer.Emit): simplify code by using
15788         Invocation.EmitCall, and at the same time, fix the bugs in calling
15789         parent constructors that took variable arguments. 
15790
15791         * ecore.cs (Expression.ConvertNumericExplicit,
15792         Expression.ImplicitNumericConversion): Remove the code that
15793         manually wrapped decimal (InternalTypeConstructor call is now gone
15794         as well).
15795
15796         * expression.cs (Cast.TryReduce): Also handle decimal types when
15797         trying to perform a constant fold on the type.
15798
15799         * typemanager.cs (IsUnmanagedtype): Partially implemented.
15800
15801         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
15802         that only turned off an error report, and did nothing else. 
15803
15804 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
15805
15806         * driver.cs: Handle and ignore /fullpaths
15807
15808 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
15809
15810         * expression.cs (Binary.ResolveOperator): Catch the case where
15811         DoNumericPromotions returns true, 
15812
15813         (Binary.DoNumericPromotions): Simplify the code, and the tests.
15814
15815 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
15816
15817         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
15818         report error 70.
15819
15820 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
15821
15822         * ecore.cs (ConvertNumericExplicit): It is not enough that the
15823         conversion exists, but it is also required that the conversion be
15824         performed.  This manifested in "(Type64Enum) 2".  
15825
15826         * class.cs (TypeManager.AddMethod): The fix is not to change
15827         AddEnum, because that one was using a fully qualified name (every
15828         DeclSpace derivative does), but to change the AddMethod routine
15829         that was using an un-namespaced name.  This now correctly reports
15830         the duplicated name.
15831
15832         Revert patch until I can properly fix it.  The issue
15833         is that we have a shared Type space across all namespaces
15834         currently, which is wrong.
15835
15836         Options include making the Namespace a DeclSpace, and merge
15837         current_namespace/current_container in the parser.
15838
15839 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
15840
15841         * cs-parser.jay: Improve error reporting when we get a different
15842         kind of expression in local_variable_type and
15843         local_variable_pointer_type. 
15844
15845         Propagate this to avoid missleading errors being reported.
15846
15847         * ecore.cs (ImplicitReferenceConversion): treat
15848         TypeManager.value_type as a target just like object_type.   As
15849         code like this:
15850
15851         ValueType v = 1;
15852
15853         Is valid, and needs to result in the int 1 being boxed before it
15854         is assigned to the value type v.
15855
15856         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
15857         to validate the enumeration name.
15858
15859         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
15860         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
15861         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
15862
15863         * ecore.cs (TryImplicitIntConversion): When doing an
15864         implicit-enumeration-conversion, check if the type is 64-bits and
15865         perform a conversion before passing to EnumConstant.
15866
15867 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
15868
15869         * decl.cs (Error_AmbiguousTypeReference); New routine used to
15870         report ambiguous type references.  Unlike the MS version, we
15871         report what the ambiguity is.   Innovation at work ;-)
15872
15873         (DeclSpace.FindType): Require a location argument to
15874         display when we display an ambiguous error.
15875
15876         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
15877
15878         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
15879
15880         * expression.cs (EmitDynamicInitializers): Apply patch from
15881         hwang_rob@yahoo.ca that fixes the order in which we emit our
15882         initializers. 
15883
15884 2002-09-21  Martin Baulig  <martin@gnome.org>
15885
15886         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
15887         delegate takes no arguments.
15888
15889 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
15890
15891         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
15892         from integers.
15893
15894         * expression.cs: Extract the underlying type.
15895
15896         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
15897
15898         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
15899
15900 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
15901
15902         * class.cs (TypeContainer.DefineType): We can not use the nice
15903         PackingSize with the size set to 1 DefineType method, because it
15904         will not allow us to define the interfaces that the struct
15905         implements.
15906
15907         This completes the fixing of bug 27287
15908
15909         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
15910         means also structs.  This fixes part of the problem. 
15911         (Expresion.ImplicitReferenceConversionExists): ditto.
15912
15913         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
15914         error if there were no errors reported during the type lookup
15915         process, to avoid duplicates or redundant errors.  Without this
15916         you would get an ambiguous errors plus a type not found.  We have
15917         beaten the user enough with the first error.  
15918
15919         (DeclSparce.FindType): Emit a warning if we have an ambiguous
15920         reference. 
15921
15922         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
15923         during the resolution process, stop the lookup, this avoids
15924         repeated error reports (same error twice).
15925
15926         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
15927
15928         * typemanager.cs (LookupType): Redo the type lookup code to match
15929         the needs of System.Reflection.  
15930
15931         The issue is that System.Reflection requires references to nested
15932         types to begin with a "+" sign instead of a dot.  So toplevel
15933         types look like: "NameSpace.TopLevelClass", and nested ones look
15934         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
15935         levels. 
15936
15937 2002-09-19  Martin Baulig  <martin@gnome.org>
15938
15939         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
15940         says that a method always returns or always throws an exception,
15941         don't report the CS0161.
15942
15943         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
15944         set `Returns = new_returns'.
15945
15946 2002-09-19  Martin Baulig  <martin@gnome.org>
15947
15948         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
15949         to an enum constant, check for a CS0176.
15950
15951 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
15952
15953         * class.cs (TypeContainer.CheckPairedOperators): Now we check
15954         for operators that must be in pairs and report errors.
15955
15956         * ecore.cs (SimpleName.DoResolveType): During the initial type
15957         resolution process, when we define types recursively, we must
15958         check first for types in our current scope before we perform
15959         lookups in the enclosing scopes.
15960
15961         * expression.cs (MakeByteBlob): Handle Decimal blobs.
15962
15963         (Invocation.VerifyArgumentsCompat): Call
15964         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
15965         I thought we were supposed to always call this, but there are a
15966         few places in the code where we dont do it.
15967
15968 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
15969
15970         * driver.cs: Add support in -linkres and -resource to specify the
15971         name of the identifier.
15972
15973 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
15974
15975         * ecore.cs (StandardConversionExists): Sync with the conversion
15976         code: allow anything-* to void* conversions.
15977
15978         (FindMostSpecificSource): Use an Expression argument
15979         instead of a Type, because we might be handed over a Literal which
15980         gets a few more implicit conversions that plain types do not.  So
15981         this information was being lost.
15982
15983         Also, we drop the temporary type-holder expression when not
15984         required.
15985
15986 2002-09-17  Martin Baulig  <martin@gnome.org>
15987
15988         * class.cs (PropertyBase.CheckBase): Don't check the base class if
15989         this is an explicit interface implementation.
15990
15991 2002-09-17  Martin Baulig  <martin@gnome.org>
15992
15993         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
15994         different `IndexerName' attributes.
15995
15996         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
15997         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
15998         virtual CommonResolve().
15999
16000 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16001
16002         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
16003         and convert that to the UnderlyingType.
16004
16005         * statement.cs (Foreach.Resolve): Indexers are just like variables
16006         or PropertyAccesses.
16007
16008         * cs-tokenizer.cs (consume_string): Track line numbers and columns
16009         inside quoted strings, we were not doing this before.
16010
16011 2002-09-16  Martin Baulig  <martin@gnome.org>
16012
16013         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
16014         resolve it.  This is needed for the definite assignment check of the
16015         instance expression, fixes bug #29846.
16016         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
16017
16018 2002-09-16  Nick Drochak  <ndrochak@gol.com>
16019
16020         * parameter.cs: Fix compile error.  Cannot reference static member
16021         from an instance object.  Is this an mcs bug?
16022
16023 2002-09-14  Martin Baulig  <martin@gnome.org>
16024
16025         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
16026         multiple times.  Fixes bug #30295, added test-166.cs.
16027
16028 2002-09-14  Martin Baulig  <martin@gnome.org>
16029
16030         * statement.cs (Block.Emit): Don't emit unreachable code.
16031         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
16032         `break' statements.
16033         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
16034
16035 2002-09-14  Martin Baulig  <martin@gnome.org>
16036
16037         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
16038         is set.
16039
16040 2002-09-14  Martin Baulig  <martin@gnome.org>
16041
16042         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
16043         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
16044         be false on the ms runtime.
16045
16046 2002-09-13  Martin Baulig  <martin@gnome.org>
16047
16048         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
16049         the CS0038 error message.
16050
16051 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
16052
16053         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
16054         constant inside, return it.
16055
16056 2002-09-12  Martin Baulig  <martin@gnome.org>
16057
16058         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
16059         implicit conversion can be done between enum types.
16060
16061         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
16062         check whether an implicit conversion to the current enum's UnderlyingType
16063         exists and report an error if not.
16064
16065         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
16066         without debugging support.
16067
16068         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
16069         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
16070
16071 2002-09-12  Martin Baulig  <martin@gnome.org>
16072
16073         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
16074
16075         * ecore.cs (IMemberExpr.DeclaringType): New property.
16076         (SimpleName.SimpleNameResolve): Check whether we're accessing a
16077         nonstatic member of an outer type (CS0038).
16078
16079 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
16080
16081         * driver.cs: Activate the using-error detector at warning level
16082         4 (at least for MS-compatible APIs).
16083
16084         * namespace.cs (VerifyUsing): Small buglett fix.
16085
16086         * pending.cs (PendingImplementation): pass the container pointer. 
16087
16088         * interface.cs (GetMethods): Allow for recursive definition.  Long
16089         term, I would like to move every type to support recursive
16090         definitions, not the current ordering mechanism that we have right
16091         now.
16092
16093         The situation is this: Attributes are handled before interfaces,
16094         so we can apply attributes to interfaces.  But some attributes
16095         implement interfaces, we will now handle the simple cases
16096         (recursive definitions will just get an error).  
16097
16098         * parameter.cs: Only invalidate types at the end if we fail to
16099         lookup all types.  
16100
16101 2002-09-09  Martin Baulig  <martin@gnome.org>
16102
16103         * ecore.cs (PropertyExpr.Emit): Also check for
16104         TypeManager.system_int_array_get_length so this'll also work when
16105         compiling corlib.  Fixes #30003.
16106
16107 2002-09-09  Martin Baulig  <martin@gnome.org>
16108
16109         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
16110         and throw an exception if we can't get the type's size.  Fixed #30040,
16111         added test-165.cs.
16112
16113 2002-09-09  Martin Baulig  <martin@gnome.org>
16114
16115         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
16116
16117         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
16118         context.  Fixes bug #30027.
16119
16120         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
16121         virtual functions.  Fixes bug #30043, added test-164.cs.
16122
16123 2002-09-08  Ravi Pratap  <ravi@ximian.com>
16124
16125         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
16126
16127 2002-09-08  Nick Drochak  <ndrochak@gol.com>
16128
16129         * driver.cs: Use an object to get the windows codepage since it's not a
16130         static property.
16131
16132 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
16133
16134         * statement.cs (For.Emit): for infinite loops (test == null)
16135         return whether there is a break inside, not always "true".
16136
16137         * namespace.cs (UsingEntry): New struct to hold the name of the
16138         using definition, the location where it is defined, and whether it
16139         has been used in a successful type lookup.
16140
16141         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
16142         strings.
16143
16144         * decl.cs: ditto.
16145
16146 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16147
16148         * attribute.cs : Fix incorrect code which relied on catching
16149         a NullReferenceException to detect a null being passed in
16150         where an object was expected.
16151
16152 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
16153
16154         * statement.cs (Try): flag the catch variable as assigned
16155
16156         * expression.cs (Cast): Simplified by using ResolveType instead of
16157         manually resolving.
16158
16159         * statement.cs (Catch): Fix bug by using ResolveType.
16160
16161 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16162
16163         * expression.cs (BetterConversion): Special case for when we have
16164         a NullLiteral as the argument and we have to choose between string
16165         and object types - we choose string the way csc does.
16166
16167         * attribute.cs (Attribute.Resolve): Catch the
16168         NullReferenceException and report error #182 since the Mono
16169         runtime no more has the bug and having this exception raised means
16170         we tried to select a constructor which takes an object and is
16171         passed a null.
16172
16173 2002-09-05  Ravi Pratap  <ravi@ximian.com>
16174
16175         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
16176         message (1502, 1503) when we can't locate a method after overload
16177         resolution. This is much more informative and closes the bug
16178         Miguel reported.
16179
16180         * interface.cs (PopulateMethod): Return if there are no argument
16181         types. Fixes a NullReferenceException bug.
16182
16183         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
16184         expressions too. Previously we were checking only in one place for
16185         positional arguments leaving out named arguments.
16186
16187         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
16188         type to the enum type is not allowed. Remove code corresponding to
16189         that.
16190
16191         (ConvertNumericExplicit): Allow explicit conversions from
16192         the underlying type to enum type. This precisely follows the spec
16193         and closes a bug filed by Gonzalo.
16194
16195 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16196
16197         * compiler.csproj:
16198         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
16199
16200 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
16201
16202         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
16203         it was important that we stored the right value after the
16204         reduction in `converted'.
16205
16206 2002-09-04  Martin Baulig  <martin@gnome.org>
16207
16208         * location.cs (Location.SymbolDocument): Use full pathnames for the
16209         source files.
16210
16211 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
16212
16213         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
16214         of the expression resolve mechanism, because that will catch the
16215         SimpleName error failures.
16216
16217         (Conditional): If we can not resolve the
16218         expression, return, do not crash.
16219
16220 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16221
16222         * cs-tokenizer.cs:
16223         (location): display token name instead of its number.
16224
16225 2002-08-28  Martin Baulig  <martin@gnome.org>
16226
16227         * expression.cs (Binary.ResolveOperator): Don't silently return
16228         but return an error if an operator cannot be applied between two
16229         enum types.
16230
16231 2002-08-28  Martin Baulig  <martin@gnome.org>
16232
16233         * class.cs (Constructor.Define): Set the permission attributes
16234         correctly instead of making all constructors public.
16235
16236 2002-08-28  Martin Baulig  <martin@gnome.org>
16237
16238         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
16239         for private members before reporting a CS0103; if we find anything,
16240         it's a CS0122.
16241
16242 2002-08-28  Martin Baulig  <martin@gnome.org>
16243
16244         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
16245         to check whether `closure_start_type == closure_invocation_type',
16246         we also need to check whether `m.DeclaringType == closure_invocation_type'
16247         before bypassing the permission checks.  We might be accessing
16248         protected/private members from the base class.
16249         (TypeManager.RealMemberLookup): Only set private_ok if private
16250         members were requested via BindingFlags.NonPublic.
16251
16252         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
16253
16254         * expression.cs (MemberAccess.ResolveMemberAccess): Set
16255         MethodGroupExpr.IsExplicitImpl if appropriate.
16256         (Invocation.DoResolve): Don't report the CS0120 for explicit
16257         interface implementations.
16258
16259 2002-08-27  Martin Baulig  <martin@gnome.org>
16260
16261         * expression.cs (Invocation.DoResolve): If this is a static
16262         method and we don't have an InstanceExpression, we must report
16263         a CS0120.
16264
16265 2002-08-25  Martin Baulig  <martin@gnome.org>
16266
16267         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
16268         `==' between a valuetype and an object.
16269
16270 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
16271
16272         * ecore.cs (TypeExpr): Provide a ToString method.
16273
16274 2002-08-24  Martin Baulig  <martin@gnome.org>
16275
16276         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
16277         now called proggie.dbg and it's a binary file.
16278
16279 2002-08-23  Martin Baulig  <martin@gnome.org>
16280
16281         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
16282
16283 2002-08-23  Martin Baulig  <martin@gnome.org>
16284
16285         * struct.cs (MyStructInfo.ctor): Make this work with empty
16286         structs; it's not allowed to use foreach() on null.
16287
16288 2002-08-23  Martin Baulig  <martin@gnome.org>
16289
16290         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
16291         writer the full pathname of the generated assembly.
16292
16293 2002-08-23  Martin Baulig  <martin@gnome.org>
16294
16295         * statements.cs (FlowBranching.UsageVector.MergeChildren):
16296         A `finally' block never returns or breaks; improved handling of
16297         unreachable code.
16298
16299 2002-08-23  Martin Baulig  <martin@gnome.org>
16300
16301         * statement.cs (Throw.Resolve): Allow `throw null'.
16302
16303 2002-08-23  Martin Baulig  <martin@gnome.org>
16304
16305         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
16306         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
16307         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
16308         MemberLookup would return a wrong event if this is an explicit
16309         interface implementation and the class has an event with the same
16310         name.
16311
16312 2002-08-23  Martin Baulig  <martin@gnome.org>
16313
16314         * statement.cs (Block.AddChildVariableNames): New public method.
16315         (Block.AddChildVariableName): Likewise.
16316         (Block.IsVariableNameUsedInChildBlock): Likewise.
16317         (Block.AddVariable): Check whether a variable name has already
16318         been used in a child block.
16319
16320         * cs-parser.jay (declare_local_variables): Mark all variable names
16321         from the current block as being used in a child block in the
16322         implicit block.
16323
16324 2002-08-23  Martin Baulig  <martin@gnome.org>
16325
16326         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
16327         find the symbol writer.
16328
16329         * driver.cs: csc also allows the arguments to /define being
16330         separated by commas, not only by semicolons.
16331
16332 2002-08-23  Martin Baulig  <martin@gnome.org>
16333
16334         * interface.cs (Interface.GetMembers): Added static check for events.
16335
16336 2002-08-15  Martin Baulig  <martin@gnome.org>
16337
16338         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
16339         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
16340
16341         * ecore.cs (Expression.MemberLookup): Added documentation and explained
16342         why the MethodData.EmitDestructor() change was necessary.
16343
16344 2002-08-20  Martin Baulig  <martin@gnome.org>
16345
16346         * class.cs (TypeContainer.FindMembers): Added static check for events.
16347
16348         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
16349
16350         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
16351         use Type.GetEvents(), not Type.FindMembers().
16352
16353 2002-08-20  Martin Baulig  <martin@gnome.org>
16354
16355         * decl.cs (MemberCache): Added a special method cache which will
16356         be used for method-only searched.  This ensures that a method
16357         search will return a MethodInfo with the correct ReflectedType for
16358         inherited methods.      
16359
16360 2002-08-20  Martin Baulig  <martin@gnome.org>
16361
16362         * decl.cs (DeclSpace.FindMembers): Made this public.
16363
16364 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16365
16366         * delegate.cs: fixed build on windows.
16367         [FIXME:  Filed as bug #29150: MCS must report these errors.]
16368
16369 2002-08-19  Ravi Pratap  <ravi@ximian.com>
16370
16371         * ecore.cs (StandardConversionExists): Return a false
16372         if we are trying to convert the void type to anything else
16373         since that is not allowed.
16374
16375         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16376         we flag error 70 in the event an event is trying to be accessed
16377         directly from outside the declaring type.
16378
16379 2002-08-20  Martin Baulig  <martin@gnome.org>
16380
16381         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16382         MemberCache from typemanager.cs to decl.cs.
16383
16384 2002-08-19  Martin Baulig  <martin@gnome.org>
16385
16386         * class.cs (TypeContainer): Implement IMemberContainer.
16387         (TypeContainer.DefineMembers): Create the MemberCache.
16388         (TypeContainer.FindMembers): Do better BindingFlags checking; only
16389         return public members if BindingFlags.Public was given, check
16390         whether members are static.
16391
16392 2002-08-16  Martin Baulig  <martin@gnome.org>
16393
16394         * decl.cs (DeclSpace.Define): Splitted this in Define and
16395         DefineMembers.  DefineMembers is called first and initializes the
16396         MemberCache.
16397
16398         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
16399         DefineMembers() on all our DeclSpaces.
16400
16401         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16402         but call DefineMembers() on all nested interfaces.  We call their
16403         Define() in our new Define() function.
16404
16405         * interface.cs (Interface): Implement IMemberContainer.
16406         (Interface.Define): Moved all code except the attribute stuf to
16407         DefineMembers().
16408         (Interface.DefineMembers): Initialize the member cache.
16409
16410         * typemanager.cs (IMemberFinder): Removed this interface, we don't
16411         need this anymore since we can use MemberCache.FindMembers directly.
16412
16413 2002-08-19  Martin Baulig  <martin@gnome.org>
16414
16415         * typemanager.cs (MemberCache): When creating the cache for an
16416         interface type, add all inherited members.
16417         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16418         to `out bool used_cache' and documented it.
16419         (TypeManager.MemberLookup): If we already used the cache in the first
16420         iteration, we don't need to do the interfaces check.
16421
16422 2002-08-19  Martin Baulig  <martin@gnome.org>
16423
16424         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
16425         here from IMemberFinder and don't implement this interface anymore.
16426         (DeclSpace.MemberCache): Moved here from IMemberFinder.
16427
16428         * typemanager.cs (IMemberFinder): This interface is now only used by
16429         classes which actually support the member cache.
16430         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16431         since we only put DeclSpaces into this Hashtable.
16432         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
16433         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
16434
16435 2002-08-16  Martin Baulig  <martin@gnome.org>
16436
16437         * typemanager.cs (ICachingMemberFinder): Removed.
16438         (IMemberFinder.MemberCache): New property.
16439         (TypeManager.FindMembers): Merged this with RealFindMembers().
16440         This function will never be called from TypeManager.MemberLookup()
16441         so we can't use the cache here, just the IMemberFinder.
16442         (TypeManager.MemberLookup_FindMembers): Check whether the
16443         IMemberFinder has a MemberCache and call the cache's FindMembers
16444         function.
16445         (MemberCache): Rewrote larger parts of this yet another time and
16446         cleaned it up a bit.
16447
16448 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
16449
16450         * driver.cs (LoadArgs): Support quoting.
16451
16452         (Usage): Show the CSC-like command line arguments.
16453
16454         Improved a few error messages.
16455
16456 2002-08-15  Martin Baulig  <martin@gnome.org>
16457
16458         * typemanager.cs (IMemberContainer.Type): New property.
16459         (IMemberContainer.IsInterface): New property.
16460
16461         The following changes are conditional to BROKEN_RUNTIME, which is
16462         defined at the top of the file.
16463
16464         * typemanager.cs (MemberCache.MemberCache): Don't add the base
16465         class'es members, but add all members from TypeHandle.ObjectType
16466         if we're an interface.
16467         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16468         is the current type.
16469         (MemberCache.CacheEntry.Container): Removed this field.
16470         (TypeHandle.GetMembers): Include inherited members.
16471
16472 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16473
16474         * typemanager.cs: fixed compilation and added a comment on a field that
16475         is never used.
16476
16477 2002-08-15  Martin Baulig  <martin@gnome.org>
16478
16479         * class.cs (ConstructorInitializer.Resolve): In the
16480         Expression.MemberLookup call, use the queried_type as
16481         invocation_type.
16482
16483         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16484         declared' attribute, it's always true.
16485         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16486         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16487         temporary wrapper for FindMembers which tells MemberLookup whether
16488         members from the base classes are included in the return value.
16489         This will go away soon.
16490         (TypeManager.MemberLookup): Use this temporary hack here; once the
16491         new MemberCache is completed, we don't need to do the DeclaredOnly
16492         looping here anymore since the MemberCache will take care of this.
16493         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16494         (MemberCache): When creating the MemberCache for a class, get
16495         members from the current class and all its base classes.
16496         (MemberCache.CacheEntry.Container): New field.  This is a
16497         temporary hack until the Mono runtime is fixed to distinguish
16498         between ReflectedType and DeclaringType.  It allows us to use MCS
16499         with both the MS runtime and the unfixed Mono runtime without
16500         problems and without accecting performance.
16501         (MemberCache.SearchMembers): The DeclaredOnly looping from
16502         TypeManager.MemberLookup is now done here.      
16503
16504 2002-08-14  Martin Baulig  <martin@gnome.org>
16505
16506         * statement.cs (MyStructInfo.MyStructInfo): Don't call
16507         Type.GetFields on dynamic types but get the fields from the
16508         corresponding TypeContainer.
16509         (MyStructInfo.GetStructInfo): Added check for enum types.
16510
16511         * typemanager.cs (MemberList.IsSynchronized): Implemented.
16512         (MemberList.SyncRoot): Implemented.
16513         (TypeManager.FilterWithClosure): No need to check permissions if
16514         closure_start_type == closure_invocation_type, don't crash if
16515         closure_invocation_type is null.
16516
16517 2002-08-13  Martin Baulig  <martin@gnome.org>
16518
16519         Rewrote TypeContainer.FindMembers to use a member cache.  This
16520         gives us a speed increase of about 35% for the self-hosting MCS
16521         build and of about 15-20% for the class libs (both on GNU/Linux).
16522
16523         * report.cs (Timer): New class to get enhanced profiling.  This
16524         whole class is "TIMER" conditional since it remarkably slows down
16525         compilation speed.
16526
16527         * class.cs (MemberList): New class.  This is an IList wrapper
16528         which we're now using instead of passing MemberInfo[]'s around to
16529         avoid copying this array unnecessarily.
16530         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16531         (ICachingMemberFinder, IMemberContainer): New interface.
16532         (TypeManager.FilterWithClosure): If `criteria' is null, the name
16533         has already been checked, otherwise use it for the name comparision.
16534         (TypeManager.FindMembers): Renamed to RealMemberFinder and
16535         provided wrapper which tries to use ICachingMemberFinder.FindMembers
16536         if possible.  Returns a MemberList, not a MemberInfo [].
16537         (TypeHandle): New class, implements IMemberContainer.  We create
16538         one instance of this class per type, it contains a MemberCache
16539         which is used to do the member lookups.
16540         (MemberCache): New class.  Each instance of this class contains
16541         all members of a type and a name-based hash table.
16542         (MemberCache.FindMembers): This is our new member lookup
16543         function.  First, it looks up all members of the requested name in
16544         the hash table.  Then, it walks this list and sorts out all
16545         applicable members and returns them.
16546
16547 2002-08-13  Martin Baulig  <martin@gnome.org>
16548
16549         In addition to a nice code cleanup, this gives us a performance
16550         increase of about 1.4% on GNU/Linux - not much, but it's already
16551         half a second for the self-hosting MCS compilation.
16552
16553         * typemanager.cs (IMemberFinder): New interface.  It is used by
16554         TypeManager.FindMembers to call FindMembers on a TypeContainer,
16555         Enum, Delegate or Interface.
16556         (TypeManager.finder_to_member_finder): New PtrHashtable.
16557         (TypeManager.finder_to_container): Removed.
16558         (TypeManager.finder_to_delegate): Removed.
16559         (TypeManager.finder_to_interface): Removed.
16560         (TypeManager.finder_to_enum): Removed.
16561
16562         * interface.cs (Interface): Implement IMemberFinder.
16563
16564         * delegate.cs (Delegate): Implement IMemberFinder.
16565
16566         * enum.cs (Enum): Implement IMemberFinder.
16567
16568         * class.cs (TypeContainer): Implement IMemberFinder.
16569
16570 2002-08-12  Martin Baulig  <martin@gnome.org>
16571
16572         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16573
16574 2002-08-12  Martin Baulig  <martin@gnome.org>
16575
16576         * ecore.cs (ITypeExpression): New interface for expressions which
16577         resolve to a type.
16578         (TypeExpression): Renamed to TypeLookupExpression.
16579         (Expression.DoResolve): If we're doing a types-only lookup, the
16580         expression must implement the ITypeExpression interface and we
16581         call DoResolveType() on it.
16582         (SimpleName): Implement the new ITypeExpression interface.
16583         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16584         hack, the situation that we're only looking up types can't happen
16585         anymore when this method is called.  Moved the type lookup code to
16586         DoResolveType() and call it.
16587         (SimpleName.DoResolveType): This ITypeExpression interface method
16588         is now doing the types-only lookup.
16589         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16590         (ResolveFlags): Added MaskExprClass.
16591
16592         * expression.cs (MemberAccess): Implement the ITypeExpression
16593         interface.
16594         (MemberAccess.DoResolve): Added support for a types-only lookup
16595         when we're called via ITypeExpression.DoResolveType().
16596         (ComposedCast): Implement the ITypeExpression interface.
16597
16598         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
16599         Expression.Resolve() with ResolveFlags.Type instead.
16600
16601 2002-08-12  Martin Baulig  <martin@gnome.org>
16602
16603         * interface.cs (Interface.Define): Apply attributes.
16604
16605         * attribute.cs (Attribute.ApplyAttributes): Added support for
16606         interface attributes.
16607
16608 2002-08-11  Martin Baulig  <martin@gnome.org>
16609
16610         * statement.cs (Block.Emit): Only check the "this" variable if we
16611         do not always throw an exception.
16612
16613         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16614         whether the property has a set accessor.
16615
16616 2002-08-11  Martin Baulig  <martin@gnome.org>
16617
16618         Added control flow analysis support for structs.
16619
16620         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16621         with control flow analysis turned off.
16622         (IVariable): New interface.
16623         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16624         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16625         (FieldExpr.DoResolve): Resolve the instance expression with flow
16626         analysis turned off and do the definite assignment check after the
16627         resolving when we know what the expression will resolve to.
16628
16629         * expression.cs (LocalVariableReference, ParameterReference):
16630         Implement the new IVariable interface, only call the flow analysis
16631         code if ec.DoFlowAnalysis is true.
16632         (This): Added constructor which takes a Block argument.  Implement
16633         the new IVariable interface.
16634         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16635         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16636         This does the definite assignment checks for struct members.
16637
16638         * class.cs (Constructor.Emit): If this is a non-static `struct'
16639         constructor which doesn't have any initializer, call
16640         Block.AddThisVariable() to tell the flow analysis code that all
16641         struct elements must be initialized before control returns from
16642         the constructor.
16643
16644         * statement.cs (MyStructInfo): New public class.
16645         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16646         argument to this indexer.  If non-zero, check an individual struct
16647         member, not the whole struct.
16648         (FlowBranching.CheckOutParameters): Check struct members.
16649         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16650         overloaded versions of these methods which take an additional
16651         `int field_idx' argument to check struct members.
16652         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16653         overloaded versions of these methods which take an additional
16654         `string field_name' argument to check struct member.s
16655         (VariableInfo): Implement the IVariable interface.
16656         (VariableInfo.StructInfo): New public property.  Returns the
16657         MyStructInfo instance of the variable if it's a struct or null.
16658         (Block.AddThisVariable): New public method.  This is called from
16659         Constructor.Emit() for non-static `struct' constructor which do
16660         not have any initializer.  It creates a special variable for the
16661         "this" instance variable which will be checked by the flow
16662         analysis code to ensure that all of the struct's fields are
16663         initialized before control returns from the constructor.
16664         (UsageVector): Added support for struct members.  If a
16665         variable/parameter is a struct with N members, we reserve a slot
16666         in the usage vector for each member.  A struct is considered fully
16667         initialized if either the struct itself (slot 0) or all its
16668         members are initialized.
16669
16670 2002-08-08  Martin Baulig  <martin@gnome.org>
16671
16672         * driver.cs (Driver.MainDriver): Only report an error CS5001
16673         if there were no compilation errors.
16674
16675         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
16676         `UnsafeContext' property to determine whether the parent is in
16677         unsafe context rather than checking the parent's ModFlags:
16678         classes nested in an unsafe class are unsafe as well.
16679
16680 2002-08-08  Martin Baulig  <martin@gnome.org>
16681
16682         * statement.cs (UsageVector.MergeChildren): Distinguish between
16683         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
16684         we return.  Added test17() and test18() to test-154.cs.
16685
16686 2002-08-08  Martin Baulig  <martin@gnome.org>
16687
16688         * typemanager.cs (TypeManager.FilterWithClosure): If we have
16689         Family access, make sure the invoking type isn't a subclass of the
16690         queried type (that'd be a CS1540).
16691
16692         * ecore.cs (Expression.MemberLookup): Added overloaded version of
16693         this method which takes an additional `Type invocation_type'.
16694
16695         * expression.cs (BaseAccess.DoResolve): Use the base type as
16696         invocation and query type.
16697         (MemberAccess.DoResolve): If the lookup failed and we're about to
16698         report a CS0122, try a lookup with the ec.ContainerType - if this
16699         succeeds, we must report a CS1540.
16700
16701 2002-08-08  Martin Baulig  <martin@gnome.org>
16702
16703         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
16704         (MethodGroupExpr): Implement the IMemberExpr interface.
16705
16706         * expression (MemberAccess.ResolveMemberAccess): No need to have
16707         any special code for MethodGroupExprs anymore, they're now
16708         IMemberExprs.   
16709
16710 2002-08-08  Martin Baulig  <martin@gnome.org>
16711
16712         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
16713         Family, FamANDAssem and FamORAssem permissions.
16714         (TypeManager.IsSubclassOrNestedChildOf): New public method.
16715
16716 2002-08-08  Martin Baulig  <martin@gnome.org>
16717
16718         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
16719         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
16720         or loop block.
16721
16722 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
16723
16724         * driver.cs: implemented /resource option to embed managed resources.
16725
16726 2002-08-07  Martin Baulig  <martin@gnome.org>
16727
16728         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
16729         (FieldBase.HasFieldInitializer): New public property.
16730         (FieldBase.GetInitializerExpression): New public method.  Resolves and
16731         returns the field initializer and makes sure it is only resolved once.
16732         (TypeContainer.EmitFieldInitializers): Call
16733         FieldBase.GetInitializerExpression to get the initializer, this ensures
16734         that it isn't resolved multiple times.
16735
16736         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
16737         the resolving process (SimpleName/MemberLookup) that we're currently
16738         emitting a field initializer (which must not access any instance members,
16739         this is an error CS0236).
16740
16741         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
16742         argument, if the `IsFieldInitializer' flag is set, we must report and
16743         error CS0236 and not an error CS0120.   
16744
16745 2002-08-07  Martin Baulig  <martin@gnome.org>
16746
16747         * ecore.cs (IMemberExpr): New public interface.
16748         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
16749         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
16750         if the expression is an IMemberExpr.
16751
16752         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
16753         to be null, implicitly default to `this' if we're non-static in
16754         this case.  Simplified the code a lot by using the new IMemberExpr
16755         interface.  Also fixed bug #28176 here.
16756
16757 2002-08-06  Martin Baulig  <martin@gnome.org>
16758
16759         * cs-parser.jay (SimpleLookup): Removed.  We need to create
16760         ParameterReferences during semantic analysis so that we can do a
16761         type-only search when resolving Cast, TypeOf and SizeOf.
16762         (block): Pass the `current_local_parameters' to the Block's
16763         constructor.
16764
16765         * class.cs (ConstructorInitializer): Added `Parameters parameters'
16766         argument to the constructor.
16767         (ConstructorInitializer.Resolve): Create a temporary implicit
16768         block with the parameters.
16769
16770         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
16771         references here if we aren't doing a type-only search.
16772
16773         * statement.cs (Block): Added constructor which takes a
16774         `Parameters parameters' argument.
16775         (Block.Parameters): New public property.
16776
16777         * support.cs (InternalParameters.Parameters): Renamed `parameters'
16778         to `Parameters' and made it public readonly.
16779
16780 2002-08-06  Martin Baulig  <martin@gnome.org>
16781
16782         * ecore.cs (Expression.Warning): Made this public as well.
16783
16784         * report.cs (Report.Debug): Print the contents of collections.
16785
16786 2002-08-06  Martin Baulig  <martin@gnome.org>
16787
16788         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
16789         used to tell Resolve() which kinds of expressions it may return.
16790         (Expression.Resolve): Added overloaded version of this method which
16791         takes a `ResolveFlags flags' argument.  This can be used to tell
16792         Resolve() which kinds of expressions it may return.  Reports a
16793         CS0118 on error.
16794         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
16795         ResolveFlags.SimpleName.
16796         (Expression.Error118): Added overloaded version of this method which
16797         takes a `ResolveFlags flags' argument.  It uses the flags to determine
16798         which kinds of expressions are allowed.
16799
16800         * expression.cs (Argument.ResolveMethodGroup): New public method.
16801         Resolves an argument, but allows a MethodGroup to be returned.
16802         This is used when invoking a delegate.
16803
16804         * TODO: Updated a bit.
16805
16806 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16807
16808         Fixed compilation with csc.
16809
16810         * ecore.cs: Expression.Error made public. Is this correct? Should
16811         Warning be made public too?
16812
16813         * expression.cs: use ea.Location instead of ea.loc.
16814         [FIXME:  Filed as bug #28607: MCS must report these errors.]
16815
16816 2002-08-06  Martin Baulig  <martin@gnome.org>
16817
16818         * ecore.cs (Expression.loc): Moved the location here instead of
16819         duplicating it in all derived classes.
16820         (Expression.Location): New public property.
16821         (Expression.Error, Expression.Warning): Made them non-static and
16822         removed the location argument.
16823         (Expression.Warning): Added overloaded version which takes an
16824         `int level' argument.
16825         (Expression.Error118): Make this non-static and removed the
16826         expression and location arguments.
16827         (TypeExpr): Added location argument to the constructor.
16828
16829         * expression.cs (StaticCallExpr): Added location argument to
16830         the constructor.
16831         (Indirection, PointerArithmetic): Likewise.
16832         (CheckedExpr, UnCheckedExpr): Likewise.
16833         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
16834         (StringPtr): Likewise.
16835
16836
16837 2002-08-05  Martin Baulig  <martin@gnome.org>
16838
16839         * expression.cs (BaseAccess.DoResolve): Actually report errors.
16840
16841         * assign.cs (Assign.DoResolve): Check whether the source
16842         expression is a value or variable.
16843
16844         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
16845         while resolving the corresponding blocks.
16846
16847         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
16848         an error, don't silently return null.
16849
16850         * statement.cs (Block.AddVariable): Do the error reporting here
16851         and distinguish between CS0128 and CS0136.
16852         (Block.DoResolve): Report all unused labels (warning CS0164).
16853         (LabeledStatement): Pass the location to the constructor.
16854         (LabeledStatement.HasBeenReferenced): New property.
16855         (LabeledStatement.Resolve): Set it to true here.
16856
16857         * statement.cs (Return.Emit): Return success even after reporting
16858         a type mismatch error (CS0126 or CS0127), this is what csc does and
16859         it avoids confusing the users with any consecutive errors.
16860
16861 2002-08-05  Martin Baulig  <martin@gnome.org>
16862
16863         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
16864
16865         * const.cs (Const.LookupConstantValue): Catch circular definitions.
16866
16867         * expression.cs (MemberAccess.DoResolve): Silently return if an
16868         error has already been reported.
16869
16870         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
16871         error has already been reported.
16872
16873 2002-08-05  Martin Baulig  <martin@gnome.org>
16874
16875         * statement.cs (UsageVector): Only initialize the `parameters'
16876         vector if we actually have any "out" parameters.
16877
16878 2002-08-05  Martin Baulig  <martin@gnome.org>
16879
16880         * expression.cs (Binary.ResolveOperator): When combining delegates,
16881         they must have the same type.
16882
16883 2002-08-05  Martin Baulig  <martin@gnome.org>
16884
16885         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
16886         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
16887         work with the ms runtime and we also don't need it: if we're a
16888         PropertyBuilder and not in the `indexer_arguments' hash, then we
16889         are a property and not an indexer.
16890
16891         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
16892         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
16893         since the latter one doesn't work with the ms runtime.
16894
16895 2002-08-03  Martin Baulig  <martin@gnome.org>
16896
16897         Fixed bugs #27998 and #22735.
16898
16899         * class.cs (Method.IsOperator): New public field.
16900         (Method.CheckBase): Report CS0111 if there's already a method
16901         with the same parameters in the current class.  Report CS0508 when
16902         attempting to change the return type of an inherited method.
16903         (MethodData.Emit): Report CS0179 if a method doesn't have a body
16904         and it's not marked abstract or extern.
16905         (PropertyBase): New abstract base class for Property and Indexer.
16906         (PropertyBase.CheckBase): Moved here from Property and made it work
16907         for indexers.
16908         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
16909         the same so we can reuse it there.
16910         (Property, Indexer): Derive from PropertyBase.
16911         (MethodSignature.inheritable_property_signature_filter): New delegate
16912         to find properties and indexers.
16913
16914         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
16915         argument and improved error reporting.
16916
16917         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
16918         EmptyReadOnlyParameters and made it a property.
16919
16920         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
16921         version of this method which takes a `PropertyInfo indexer'.
16922         (TypeManager.RegisterIndexer): New method.
16923
16924         * class.cs: Added myself as author of this file :-)
16925
16926 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16927
16928         * class.cs: fixed compilation on windoze.
16929
16930 2002-08-03  Martin Baulig  <martin@gnome.org>
16931
16932         * interface.cs (Interface.GetInterfaceBases): Check whether all
16933         base interfaces are at least as accessible than the current one.
16934
16935         * class.cs (TypeContainer.GetClassBases): Check whether base types
16936         are at least as accessible than the current type.
16937         (TypeContainer.AsAccessible): Implemented and made non-static.
16938         (MemberBase.CheckParameters): Report errors if the accessibility
16939         checks fail.
16940
16941         * delegate.cs (Delegate.Delegate): The default visibility is
16942         internal for top-level types and private for nested types.
16943         (Delegate.Define): Report errors if the accessibility checks fail.
16944
16945         * enum.cs (Enum.Enum): The default visibility is internal for
16946         top-level types and private for nested types.
16947         (Enum.DefineType): Compute the correct visibility.
16948
16949         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
16950         function which takes a `bool is_toplevel' instead of a TypeContainer.
16951
16952         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
16953         builtin type.
16954
16955 2002-08-02  Martin Baulig  <martin@gnome.org>
16956
16957         * expression.cs (LocalVariableReferenc): Added constructor which
16958         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
16959         (LocalVariableReference.IsReadOnly): New property.
16960         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
16961         variable is readonly, use our own readonly flag to do this; you can
16962         use the new constructor to get a writable reference to a read-only
16963         variable.
16964
16965         * cs-parser.jay (foreach_statement, using_statement): Get a writable
16966         reference to the local variable.
16967
16968 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
16969
16970         * rootcontext.cs (ResolveCore): Also include System.Exception
16971
16972         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
16973         we reach an EmptyStatement.
16974
16975         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
16976         is also fine.
16977
16978         * expression.cs (Binary.ResolveOperator): Check error result in
16979         two places.
16980
16981         use brtrue/brfalse directly and avoid compares to null.
16982
16983 2002-08-02  Martin Baulig  <martin@gnome.org>
16984
16985         * class.cs (TypeContainer.Define): Define all nested interfaces here.
16986         Fixes bug #28407, added test-155.cs.
16987
16988 2002-08-01  Martin Baulig  <martin@gnome.org>
16989
16990         * class.cs (Event.EmitDefaultMethod): Make this work with static
16991         events.  Fixes #28311, added verify-3.cs.
16992
16993 2002-08-01  Martin Baulig  <martin@gnome.org>
16994
16995         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
16996         `is_disposable' fields.
16997         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
16998         `hm.is_disposable' if we're using the collection pattern.
16999         (Foreach.EmitCollectionForeach): Use the correct type for the
17000         enumerator's local variable, only emit the try/finally block if
17001         necessary (fixes #27713).
17002
17003 2002-08-01  Martin Baulig  <martin@gnome.org>
17004
17005         * ecore.cs (Expression.report118): Renamed to Error118 and made
17006         it public static.
17007
17008         * statement.cs (Throw.Resolve): Check whether the expression is of
17009         the correct type (CS0118) and whether the type derives from
17010         System.Exception (CS0155).
17011         (Catch.Resolve): New method.  Do the type lookup here and check
17012         whether it derives from System.Exception (CS0155).
17013         (Catch.CatchType, Catch.IsGeneral): New public properties.
17014
17015         * typemanager.cs (TypeManager.exception_type): Added.
17016
17017 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
17018
17019         * driver.cs: Updated About function.
17020
17021 2002-07-31  Martin Baulig  <martin@gnome.org>
17022
17023         Implemented Control Flow Analysis.
17024
17025         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
17026         (EmitContext.CurrentBranching): Added.
17027         (EmitContext.StartFlowBranching): Added.
17028         (EmitContext.EndFlowBranching): Added.
17029         (EmitContext.KillFlowBranching): Added.
17030         (EmitContext.IsVariableAssigned): Added.
17031         (EmitContext.SetVariableAssigned): Added.
17032         (EmitContext.IsParameterAssigned): Added.
17033         (EmitContext.SetParameterAssigned): Added.
17034         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
17035         Added control flow analysis stuff here.
17036
17037         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
17038         resolve the expression as lvalue.
17039         (LocalVariableReference.DoResolve): Check whether the variable has
17040         already been assigned.
17041         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
17042         the parameter as assigned here.
17043         (ParameterReference.DoResolve): Check whether the parameter has already
17044         been assigned.
17045         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
17046         expression as lvalue.
17047
17048         * statement.cs (FlowBranching): New class for the flow analysis code.
17049         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
17050         (LabeledStatement.IsDefined): New public property.
17051         (LabeledStatement.AddUsageVector): New public method to tell flow
17052         analyis that the label may be reached via a forward jump.
17053         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
17054         flow analysis.
17055         (VariableInfo.Number): New public field.  This is used by flow analysis
17056         to number all locals of a block.
17057         (Block.CountVariables): New public property.  This is the number of
17058         local variables in this block (including the locals from all parent
17059         blocks).
17060         (Block.EmitMeta): Number all the variables.
17061
17062         * statement.cs: Added flow analysis support to all classes.
17063
17064 2002-07-31  Martin Baulig  <martin@gnome.org>
17065
17066         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
17067         To get debugging messages, compile mcs with /define:MCS_DEBUG and
17068         then use this argument.
17069
17070         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
17071
17072         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
17073         use this to specify /define options.
17074
17075 2002-07-29  Martin Baulig  <martin@gnome.org>
17076
17077         * statement.cs (Fixed): Moved all code that does variable lookups
17078         and resolvings from Emit to Resolve.
17079
17080         * statement.cs (For): Moved all code that does variable lookups
17081         and resolvings from Emit to Resolve.
17082
17083         * statement.cs (Using): Moved all code that does variable lookups
17084         and resolvings from Emit to Resolve.
17085
17086 2002-07-29  Martin Baulig  <martin@gnome.org>
17087
17088         * attribute.cs (Attribute.Resolve): Explicitly catch a
17089         System.NullReferenceException when creating the
17090         CustromAttributeBuilder and report a different warning message.
17091
17092 2002-07-29  Martin Baulig  <martin@gnome.org>
17093
17094         * support.cs (ParameterData.ParameterName): Added method to
17095         get the name of a parameter.
17096
17097         * typemanager.cs (TypeManager.IsValueType): New public method.
17098
17099 2002-07-29  Martin Baulig  <martin@gnome.org>
17100
17101         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
17102         is a flag which specifies that it's either ref or out.
17103         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
17104         the out parameter to `out Parameter.Modifier mod', also set the
17105         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
17106
17107         * support.cs (InternalParameters.ParameterModifier): Distinguish
17108         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17109         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17110
17111         * expression.cs (Argument.GetParameterModifier): Distinguish
17112         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17113         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17114
17115 2002-07-29  Martin Baulig  <martin@gnome.org>
17116
17117         * expression.cs (ParameterReference.ParameterReference): Added
17118         `Location loc' argument to the constructor.
17119
17120         * cs-parser.jay: Pass location to ParameterReference.
17121
17122 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
17123
17124         * statement.cs (Try): Initialize the location.
17125
17126         * cs-parser.jay: pass location to Try.
17127
17128         * expression.cs (Unary.Reduce): Change the prototype to return
17129         whether a constant fold could be performed or not.  The result is
17130         returned in an out parameters.  In the case of Indirection and
17131         AddressOf, we want to perform the full tests.
17132
17133 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
17134
17135         * statement.cs (Statement.Emit): Flag dead code.
17136
17137 2002-07-27  Andrew Birkett  <andy@nobugs.org>
17138
17139         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
17140
17141 2002-07-27  Martin Baulig  <martin@gnome.org>
17142
17143         * class.cs (MethodData.Define): Put back call to
17144         TypeManager.AddMethod(), accidentally commented this out.
17145
17146         * report.cs (Debug): New public method to print debugging information,
17147         this is `[Conditional ("DEBUG")]'.
17148
17149 2002-07-26  Martin Baulig  <martin@gnome.org>
17150
17151         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
17152         (switch_statement): Push the current_block to the switch_stack and
17153         pop it again when we're done with the switch.
17154         (switch_section): The new block is a child of the current_block.
17155         Fixes bug #24007, added test-152.cs.
17156
17157 2002-07-27  Martin Baulig  <martin@gnome.org>
17158
17159         * expression.cs (Invocation.EmitArguments): When calling a varargs
17160         function with only its fixed arguments, we need to pass an empty
17161         array.
17162
17163 2002-07-27  Martin Baulig  <martin@gnome.org>
17164
17165         Mono 0.13 has been released.
17166
17167 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
17168
17169         * driver.cs: Rename --resource to --linkres, because that is what
17170         we do currently, we dont support --resource yet.
17171
17172         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
17173
17174 2002-07-25  Martin Baulig  <martin@gnome.org>
17175
17176         * class.cs (MethodData): New public class.  This is a `method builder'
17177         class for a method or one accessor of a Property/Indexer/Event.
17178         (MethodData.GetMethodFlags): Moved here from MemberBase.
17179         (MethodData.ApplyAttributes): Likewise.
17180         (MethodData.ApplyObsoleteAttribute): Likewise.
17181         (MethodData.ApplyConditionalAttribute): Likewise.
17182         (MethodData.ApplyDllImportAttribute): Likewise.
17183         (MethodData.CheckAbstractAndExternal): Likewise.
17184         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
17185         (MethodData.Emit): Formerly known as Method.Emit().
17186         (MemberBase): Moved everything which was specific to a single
17187         accessor/method to MethodData.
17188         (Method): Create a new MethodData and call Define() and Emit() on it.
17189         (Property, Indexer, Event): Create a new MethodData objects for each
17190         accessor and call Define() and Emit() on them.
17191
17192 2002-07-25  Martin Baulig  <martin@gnome.org>
17193
17194         Made MethodCore derive from MemberBase to reuse the code from there.
17195         MemberBase now also checks for attributes.
17196
17197         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
17198         (MemberBase.GetMethodFlags): Moved here from class Method and marked
17199         as virtual.
17200         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
17201         `CallingConventions cc' and `Attributes opt_attrs' arguments.
17202         (MemberBase.ApplyAttributes): New virtual method; applies the
17203         attributes to a method or accessor.
17204         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
17205         (MemberBase.ApplyConditionalAttribute): Likewise.
17206         (MemberBase.ApplyDllImportAttribute): Likewise.
17207         (MemberBase.CheckAbstractAndExternal): Likewise.
17208         (MethodCore.ParameterTypes): This is now a property instead of a
17209         method, it's initialized from DoDefineParameters().
17210         (MethodCore.ParameterInfo): Removed the set accessor.
17211         (MethodCore.DoDefineParameters): New protected virtual method to
17212         initialize ParameterTypes and ParameterInfo.
17213         (Method.GetReturnType): We can now simply return the MemberType.
17214         (Method.GetMethodFlags): Override the MemberBase version and add
17215         the conditional flags.
17216         (Method.CheckBase): Moved some code from Define() here, call
17217         DoDefineParameters() here.
17218         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
17219         here to avoid some larger code duplication.
17220         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
17221         ensure that abstract and external accessors don't declare a body.
17222
17223         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
17224         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
17225         lookup in the attribute's parent classes, so we need to abort as soon
17226         as we found the first match.
17227         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
17228         the attribute has no arguments.
17229
17230         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
17231         of a Method.
17232
17233 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17234
17235         * cs-parser.jay: reverted previous patch.
17236
17237 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17238
17239         * cs-parser.jay: fixed bug #22119.
17240
17241 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17242
17243         * attribute.cs: fixed compilation. The error was:
17244         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
17245         be assigned to before control leaves the current method."
17246         [FIXME:  Filed as bug #28186: MCS must report this error.]
17247
17248 2002-07-25  Martin Baulig  <martin@gnome.org>
17249
17250         * attribute.cs (Attribute.Conditional_GetConditionName): New static
17251         method to pull the condition name ouf of a Conditional attribute.
17252         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
17253         the obsolete message and error flag out of an Obsolete attribute.
17254
17255         * class.cs (Method.GetMethodFlags): New public method to get the
17256         TypeManager.MethodFlags for this method.
17257         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
17258         private methods.
17259         (Method.Define): Get and apply the Obsolete and Conditional attributes;
17260         if we're overriding a virtual function, set the new private variable
17261         `parent_method'; call the new TypeManager.AddMethod().
17262
17263         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
17264         the MethodBuilder and the Method in a PtrHashtable.
17265         (TypeManager.builder_to_method): Added for this purpose.
17266         (TypeManager.MethodFlags): Added IsObsoleteError.
17267         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
17268         Obsolete and Conditional arguments in MethodBuilders.  If we discover
17269         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
17270         the message from the attribute.
17271
17272 2002-07-24  Martin Baulig  <martin@gnome.org>
17273
17274         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
17275         preprocessor directives, ensure that the argument to #define/#undef is
17276         exactly one identifier and that it's actually an identifier.
17277
17278         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
17279         did not work ....
17280
17281 2002-07-24  Martin Baulig  <martin@gnome.org>
17282
17283         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
17284         initialize it to TypeManager.object_type in the constructor.
17285         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
17286         of the `hm.get_current' method if we're using the collection pattern.
17287         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
17288         for the explicit conversion to make it work when we're using the collection
17289         pattern and the `Current' property has a different return type than `object'.
17290         Fixes #27713.
17291
17292 2002-07-24  Martin Baulig  <martin@gnome.org>
17293
17294         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
17295         does not match, but don't report any errors.  This method is called in
17296         order for all methods in a MethodGroupExpr until a matching method is
17297         found, so we don't want to bail out if the first method doesn't match.
17298         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
17299         matches, report the 123.  Fixes #28070.
17300
17301 2002-07-24  Martin Baulig  <martin@gnome.org>
17302
17303         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
17304         TypeManager.TypeToCoreType() to the top of the method so the
17305         following equality checks will work.  Fixes #28107.
17306
17307 2002-07-24  Martin Baulig  <martin@gnome.org>
17308
17309         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
17310         operand is of type uint, and the other operand is of type sbyte,
17311         short or int, the operands are converted to type long." -
17312         Actually do what this comment already told us.  Fixes bug #28106,
17313         added test-150.cs.
17314
17315 2002-07-24  Martin Baulig  <martin@gnome.org>
17316
17317         * class.cs (MethodBase): New abstract class.  This is now a base
17318         class for Property, Indexer and Event to avoid some code duplication
17319         in their Define() and DefineMethods() methods.
17320         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
17321         generic methods for Define() and DefineMethods().
17322         (FieldBase): Derive from MemberBase, not MemberCore.
17323         (Property): Derive from MemberBase, not MemberCore.
17324         (Property.DefineMethod): Moved all the code from this method to the
17325         new MethodBase.DefineAccessor(), just call it with appropriate
17326         argumetnts.
17327         (Property.Define): Call the new Property.DoDefine(), this does some
17328         sanity checks and we don't need to duplicate the code everywhere.
17329         (Event): Derive from MemberBase, not MemberCore.
17330         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
17331         accessors, this will also make them work with interface events.
17332         (Indexer): Derive from MemberBase, not MemberCore.
17333         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
17334         (Indexer.Define): Use the new MethodBase functions.
17335
17336         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
17337         argument to the constructor.
17338         (Interface.FindMembers): Added support for interface events.
17339         (Interface.PopluateEvent): Implemented.
17340
17341         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
17342
17343 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
17344
17345         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
17346         but this is required to check for a method name being the same as
17347         the containing class.  
17348
17349         Handle this now.
17350
17351 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17352
17353         * interface.cs: initialize variable.
17354
17355 2002-07-23  Martin Baulig  <martin@gnome.org>
17356
17357         Implemented the IndexerName attribute in interfaces.
17358
17359         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17360         name if this is an explicit interface implementation.
17361         (Indexer.InterfaceIndexerName): New public variable.  If we're
17362         implementing an interface indexer, this is the IndexerName in that
17363         interface.  Otherwise, it's the IndexerName.
17364         (Indexer.DefineMethod): If we're implementing interface indexer,
17365         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
17366         and Pending.ImplementIndexer methods.
17367         (Indexer.Define): Also define the PropertyBuilder if we're
17368         implementing an interface indexer and this is neither an explicit
17369         interface implementation nor do the IndexerName match the one in
17370         the interface.
17371
17372         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17373         If a method is defined here, then we always need to create a proxy
17374         for it.  This is used when implementing interface indexers.
17375         (Pending.IsInterfaceIndexer): New public method.
17376         (Pending.ImplementIndexer): New public method.
17377         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17378         This is used when implementing interface indexers to define a proxy
17379         if necessary.
17380         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17381         define a proxy if necessary.
17382
17383         * interface.cs (Interface.IndexerName): New public variable.
17384         (Interface.PopulateIndexer): Set the IndexerName.
17385         (Interface.DefineIndexers): New private method.  Populate all the
17386         indexers and make sure their IndexerNames match.
17387
17388         * typemanager.cs (IndexerPropertyName): Added support for interface
17389         indexers.
17390
17391 2002-07-22  Martin Baulig  <martin@gnome.org>
17392
17393         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17394         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17395         ret if HasReturnLabel.
17396         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17397         variables.
17398
17399         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17400         and set the ec.LoopBeginTryCatchLevel.
17401         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17402         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17403         the current ec.TryCatchLevel, the branch goes out of an exception
17404         block.  In this case, we need to use Leave and not Br.
17405
17406 2002-07-22  Martin Baulig  <martin@gnome.org>
17407
17408         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17409         block unless the block does not always return or it is contained in
17410         another try { ... } catch { ... } block.  Fixes bug #26506.
17411         Added verify-1.cs to the test suite.
17412
17413 2002-07-22  Martin Baulig  <martin@gnome.org>
17414
17415         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17416         then we do not always return.  Fixes bug #24985.
17417
17418 2002-07-22  Martin Baulig  <martin@gnome.org>
17419
17420         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17421         lookup on a per-class level; ie. walk up the class hierarchy until we
17422         found at least one applicable method, then choose the best among them.
17423         Fixes bug #24463 and test-29.cs.
17424
17425 2002-07-22  Martin Baulig  <martin@gnome.org>
17426
17427         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17428         return types of the methods.  The return type is not part of the
17429         signature and we must not check it to make the `new' modifier work.
17430         Fixes bug #27999, also added test-147.cs.
17431         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
17432
17433         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
17434         on the method's return type.
17435
17436 2002-07-21  Martin Baulig  <martin@gnome.org>
17437
17438         * assign.cs: Make this work if the rightmost source is a constant and
17439         we need to do an implicit type conversion.  Also adding a few more tests
17440         to test-38.cs which should have caught this.
17441
17442         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
17443         target in the makefile for this.  The makefile.gnu is primarily intended
17444         for end-users who don't want to debug the compiler.
17445
17446 2002-07-21  Martin Baulig  <martin@gnome.org>
17447
17448         * assign.cs: Improved the Assign class so it can now handle embedded
17449         assignments (X = Y = Z = something).  As a side-effect this'll now also
17450         consume less local variables.  test-38.cs now passes with MCS, added
17451         a few new test cases to that test.
17452
17453 2002-07-20  Martin Baulig  <martin@gnome.org>
17454
17455         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17456         instructions.  Fixes bug #27977, also added test-146.cs.
17457
17458 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17459
17460         * cs-tokenizer.cs: fixed getHex ().
17461
17462 2002-07-19  Martin Baulig  <martin@gnome.org>
17463
17464         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17465         not Type.GetType() to lookup the array type.  This is needed when
17466         we're constructing an array of a user-defined type.
17467         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17468         single-dimensional arrays, but also for single-dimensial arrays of
17469         type decimal.
17470
17471 2002-07-19  Martin Baulig  <martin@gnome.org>
17472
17473         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17474         this function is called, it's not allowed to share LocalBuilders
17475         among ILGenerators.
17476
17477 2002-07-19  Martin Baulig  <martin@gnome.org>
17478
17479         * expression.cs (Argument.Resolve): Report an error 118 when trying
17480         to pass a type as argument.
17481
17482 2002-07-18  Martin Baulig  <martin@gnome.org>
17483
17484         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17485         Conv_R_Un for the signed `long' type.
17486
17487 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
17488
17489         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17490         `expr' for the temporary result, as that will fail if we do
17491         multiple resolves on the same expression.
17492
17493 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
17494
17495         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17496         ec.TypeContainer for looking up aliases. 
17497
17498         * class.cs (TypeContainer): Remove LookupAlias from here.
17499
17500         * decl.cs (DeclSpace); Move here.
17501
17502 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
17503
17504         * class.cs (FindMembers): Only call filter if the constructor
17505         bulider is not null.
17506
17507         Also handle delegates in `NestedTypes' now.  Now we will perform
17508         type lookups using the standard resolution process.  This also
17509         fixes a bug.
17510
17511         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17512         This uses Expressions (the limited kind that can be parsed by the
17513         tree) instead of strings.
17514
17515         * expression.cs (ComposedCast.ToString): Implement, used to flag
17516         errors since now we have to render expressions.
17517
17518         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
17519         FormArrayType. 
17520
17521         * ecore.cs (SimpleName.ToString): ditto.
17522
17523         * cs-parser.jay: Instead of using strings to assemble types, use
17524         Expressions to assemble the type (using SimpleName, ComposedCast,
17525         MemberAccess).  This should fix the type lookups in declarations,
17526         because we were using a different code path for this.
17527
17528         * statement.cs (Block.Resolve): Continue processing statements
17529         even when there is an error.
17530
17531 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
17532
17533         * class.cs (Event.Define): Also remove the `remove' method from
17534         the list of pending items.
17535
17536         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17537         generate more compact code. 
17538
17539 2002-07-17  Martin Baulig  <martin@gnome.org>
17540
17541         * const.cs (Const.LookupConstantValue): Add support for constant
17542         `unchecked' and `checked' expressions.
17543         Also adding test case test-140.cs for this.
17544
17545 2002-07-17  Martin Baulig  <martin@gnome.org>
17546
17547         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17548         check whether mi.ReturnType implements the IEnumerator interface; the
17549         `==' and the IsAssignableFrom() will fail in this situation.
17550
17551 2002-07-16  Ravi Pratap  <ravi@ximian.com>
17552
17553         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
17554         here too.
17555
17556 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17557
17558         * expression.cs: fixed bug #27811.
17559
17560 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
17561
17562         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17563         Molaro: when we are a ref, the value already contains a pointer
17564         value, do not take the address of it.
17565
17566 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17567         * removed mb-parser.jay and mb-tokenizer.cs
17568
17569 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17570
17571         * expression.cs: check against the building corlib void type.
17572
17573 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17574
17575         * ecore.cs: fix for valuetype static readonly fields: when 
17576         initializing them, we need their address, not the address of a copy.
17577
17578 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17579
17580         * typemanager.cs: register also enum_type in corlib.
17581
17582 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17583
17584         * class.cs: allow calling this (but not base) initializers in structs.
17585
17586 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17587
17588         * ecore.cs: make sure we compare against the building base types
17589         in GetTypeSize ().
17590
17591 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
17592
17593         * typemanager.cs: fix TypeToCoreType() to handle void and object
17594         (corlib gets no more typerefs after this change).
17595
17596 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
17597
17598         * expression.cs (ArrayCreation.EmitArrayArguments): use
17599         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17600
17601         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17602         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
17603         array indexes, the runtime actually forbids them.
17604
17605         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17606         for array arguments here.
17607
17608         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17609         instead of the default for ValueTypes.
17610
17611         (New.DoEmit): Use IsValueType instead of
17612         IsSubclassOf (value_type)
17613         (New.DoResolve): ditto.
17614         (Invocation.EmitCall): ditto.
17615
17616         * assign.cs (Assign): ditto.
17617
17618         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17619         Statements *are* currently doing part of their resolution during
17620         Emit.  
17621
17622         Expressions do always resolve during resolve, but statements are
17623         only required to propagate resolution to their children.
17624
17625 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
17626
17627         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17628
17629         (LoadAssembly): Do not add the dll if it is already specified
17630
17631         (MainDriver): Add the System directory to the link path at the end,
17632         after all the other -L arguments. 
17633
17634         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17635         wrong opcode for loading bytes and bools (ldelem.i1 instead of
17636         ldelem.u1) and using the opposite for sbytes.
17637
17638         This fixes Digger, and we can finally run it.
17639
17640         * driver.cs (UnixParseOption): Move the option parsing here.  
17641         (CSCParseOption): Implement CSC-like parsing of options.
17642
17643         We now support both modes of operation, the old Unix way, and the
17644         new CSC-like way.  This should help those who wanted to make cross
17645         platform makefiles.
17646
17647         The only thing broken is that /r:, /reference: and /lib: are not
17648         implemented, because I want to make those have the same semantics
17649         as the CSC compiler has, and kill once and for all the confussion
17650         around this.   Will be doing this tomorrow.
17651
17652         * statement.cs (Unsafe.Resolve): The state is checked during
17653         resolve, not emit, so we have to set the flags for IsUnsfe here.
17654
17655 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17656
17657         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17658         not catch the Error_ObjectRefRequired in SimpleName (as it is
17659         possible to have a class/instance variable name that later gets
17660         deambiguated), we have to check this here.      
17661
17662 2002-07-10  Ravi Pratap  <ravi@ximian.com>
17663
17664         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17665         make static and put into Expression.
17666
17667         (Event.Define): Register the private field of the event with the 
17668         TypeManager so that GetFieldFromEvent can get at it.
17669
17670         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17671         keep track of the private field associated with an event which
17672         has no accessors.
17673
17674         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
17675         private field.
17676
17677         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
17678
17679 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17680
17681         * expression.cs (Binary.EmitBranchable): this routine emits the
17682         Binary expression in a branchable context.  This basically means:
17683         we need to branch somewhere, not just get the value on the stack.
17684
17685         This works together with Statement.EmitBoolExpression.
17686
17687         * statement.cs (Statement.EmitBoolExpression): Use
17688         EmitBranchable. 
17689
17690 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
17691
17692         * statement.cs (For): Reduce the number of jumps in loops.
17693
17694         (For): Implement loop inversion for the For statement.
17695
17696         (Break): We can be breaking out of a Try/Catch controlled section
17697         (foreach might have an implicit try/catch clause), so we need to
17698         use Leave instead of Br.
17699
17700         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
17701         now).  If the instace expression supports IMemoryLocation, we use
17702         the AddressOf method from the IMemoryLocation to extract the
17703         address instead of emitting the instance.
17704
17705         This showed up with `This', as we were emitting the instance
17706         always (Emit) instead of the Address of This.  Particularly
17707         interesting when This is a value type, as we dont want the Emit
17708         effect (which was to load the object).
17709
17710 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
17711
17712         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
17713
17714         * statement.cs (Checked): Set the CheckedState during the resolve
17715         process too, as the ConvCast operations track the checked state on
17716         the resolve process, and not emit.
17717
17718         * cs-parser.jay (namespace_member_declaration): Flag that we have
17719         found a declaration when we do.  This is used to flag error 1529
17720
17721         * driver.cs: Report ok when we display the help only.
17722
17723 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
17724
17725         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
17726
17727 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
17728
17729         * cs-tokenizer.cs (define): We also have to track locally the
17730         defines.  AllDefines is just used for the Conditional Attribute,
17731         but we also need the local defines for the current source code. 
17732
17733 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
17734
17735         * statement.cs (While, For, Do): These loops can exit through a
17736         Break statement, use this information to tell whether the
17737         statement is the last piece of code.
17738
17739         (Break): Flag that we break.
17740
17741         * codegen.cs (EmitContexts): New `Breaks' state variable.
17742
17743 2002-07-03  Martin Baulig  <martin@gnome.org>
17744
17745         * class.cs (TypeContainer.MethodModifiersValid): Allow override
17746         modifiers in method declarations in structs.  Otherwise, you won't
17747         be able to override things like Object.Equals().
17748
17749 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17750
17751         * class.cs (Method, Property, Indexer): Do not allow the public
17752         modifier to be used in explicit interface implementations.
17753
17754         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
17755         override modifiers in method declarations in structs
17756
17757 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
17758
17759         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
17760         integer or real overflow, report an error
17761
17762 2002-07-02  Martin Baulig  <martin@gnome.org>
17763
17764         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
17765         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
17766         to tell the runtime about our newly created System.Object and
17767         System.ValueType types.
17768
17769 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17770
17771         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
17772         struct instead of Ldarg/Starg.
17773
17774 2002-07-02  Martin Baulig  <martin@gnome.org>
17775
17776         * expression.cs (Indirection.Indirection): Call
17777         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
17778
17779 2002-07-02  Martin Baulig  <martin@gnome.org>
17780
17781         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
17782         ValueType, call TypeManager.TypeToCoreType() on it.
17783         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
17784         the OpCodes.Newarr argument.
17785
17786 2002-07-02  Martin Baulig  <martin@gnome.org>
17787
17788         * expression.cs (Invocation.EmitCall): When compiling corlib,
17789         replace all calls to the system's System.Array type to calls to
17790         the newly created one.
17791
17792         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
17793         System.Array methods.
17794         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
17795         from the system's System.Array type which must be replaced.
17796
17797 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
17798
17799         * typemanager.cs: load unverifiable_code_ctor so we can build
17800         corlib using the correct type. Avoid using GetTypeCode() with
17801         TypeBuilders.
17802         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
17803         TypeManager.object_type to allow building corlib.
17804
17805 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
17806
17807         * ecore.cs: handle System.Enum separately in LoadFromPtr().
17808
17809 2002-07-01  Martin Baulig  <martin@gnome.org>
17810
17811         * class.cs: Make the last change actually work, we need to check
17812         whether `ifaces != null' to avoid a crash.
17813
17814 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17815
17816         * class.cs: when we build structs without fields that implement
17817         interfaces, we need to add the interfaces separately, since there is
17818         no API to both set the size and add the interfaces at type creation
17819         time.
17820
17821 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17822
17823         * expression.cs: the dimension arguments to the array constructors
17824         need to be converted if they are a long.
17825
17826 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
17827
17828         * class.cs: don't emit ldarg.0 if there is no parent constructor
17829         (fixes showstopper for corlib).
17830
17831 2002-06-29  Martin Baulig  <martin@gnome.org>
17832
17833         MCS now compiles corlib on GNU/Linux :-)
17834
17835         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
17836         ie. check for MethodImplOptions.InternalCall.
17837
17838         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
17839         and TypeManager.attribute_type are null, so we must explicitly check
17840         whether parent is not null to find out whether it's an attribute type.
17841         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
17842         and SetBuilder, not only if the property is neither abstract nor external.
17843         This is necessary to set the MethodImplOptions on the accessor methods.
17844         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
17845         SetBuilder, see Property.Emit().
17846
17847         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
17848         populate "System.Object", "System.ValueType" and "System.Attribute" since
17849         they've already been populated from BootCorlib_PopulateCoreTypes().
17850
17851 2002-06-29  Martin Baulig  <martin@gnome.org>
17852
17853         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
17854         is the NullLiteral, we also need to make sure that target_type is not
17855         an enum type.   
17856
17857 2002-06-29  Martin Baulig  <martin@gnome.org>
17858
17859         * rootcontext.cs (RootContext.ResolveCore): We must initialize
17860         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
17861         before calling BootstrapCorlib_ResolveDelegate ().
17862
17863 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17864
17865         * statement.cs: fixed build-breaker. All tests passed ok.
17866
17867 2002-06-27  Martin Baulig  <martin@gnome.org>
17868
17869         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
17870         for System.Decimal when compiling corlib.
17871
17872 2002-06-27  Martin Baulig  <martin@gnome.org>
17873
17874         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
17875         switch blocks which contain nothing but a default clause.
17876
17877 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
17878
17879        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
17880
17881 2002-06-27  Martin Baulig  <martin@gnome.org>
17882
17883         * ecore.cs (PropertyExpr.PropertyExpr): Call
17884         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
17885
17886         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
17887         is already a TypeBuilder.
17888
17889 2002-06-27  Martin Baulig  <martin@gnome.org>
17890
17891         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
17892         `target_type == TypeManager.array_type', not IsAssignableFrom() in
17893         the "from an array-type to System.Array" case.  This makes it work
17894         when compiling corlib.
17895
17896 2002-06-27  Martin Baulig  <martin@gnome.org>
17897
17898         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
17899         non-static PropertyExpr, set its InstanceExpression.  This makes
17900         the `ICollection.Count' property work in System/Array.cs.
17901
17902 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
17903
17904         * driver.cs: Made error handling more consistent.  Errors now
17905         tracked by Report class, so many methods which used to return int
17906         now return void.  Main() now prints success/failure and 
17907         errors/warnings message.
17908
17909         Renamed '--probe' compiler argument to '--expect-error'.  Removed
17910         the magic number return values (123 and 124).  Now, if the
17911         expected error occurs, the compiler exits with success (exit value
17912         0).  If the compilation completes without seeing that particular
17913         error, the compiler exits with failure (exit value 1).  The
17914         makefile in mcs/errors has been changed to handle the new behaviour.
17915
17916         * report.cs: Made 'expected error' number a property and renamed
17917         it from 'Probe' to 'ExpectedError'.
17918
17919         * genericparser.cs: Removed error handling support, since it is
17920         now all done by Report class.
17921
17922         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
17923         class, so parse() no longer returns an int.
17924
17925         * namespace.cs: Use Report.Error instead of GenericParser.error
17926
17927 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
17928
17929         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
17930         TypeContainer.AddOperator): At the front of the list put the
17931         explicit implementations, so they get resolved/defined first. 
17932
17933 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
17934
17935         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
17936         interface type is implemented by this TypeContainer.  Used during
17937         explicit interface implementation.
17938
17939         (Property.Define, Indexer.Define, Method.Define): Validate that
17940         the given interface in the explicit implementation is one of the
17941         base classes for the containing type.
17942
17943         Also if we are explicitly implementing an interface, but there is
17944         no match in the pending implementation table, report an error.
17945
17946         (Property.Define): Only define the property if we are
17947         not explicitly implementing a property from an interface.  Use the
17948         correct name also for those properties (the same CSC uses,
17949         although that is really not needed).
17950
17951         (Property.Emit): Do not emit attributes for explicitly implemented
17952         properties, as there is no TypeBuilder.
17953
17954         (Indexer.Emit): ditto.
17955
17956         Hiding then means that we do not really *implement* a pending
17957         implementation, which makes code fail.
17958
17959 2002-06-22  Martin Baulig  <martin@gnome.org>
17960
17961         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
17962         the return value of Object.GetType().  [FIXME: we need to do this whenever
17963         we get a type back from the reflection library].
17964
17965 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
17966
17967         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
17968
17969 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
17970
17971         * attribute.cs: Return null if we can not look up the type.
17972
17973         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
17974         the interface types found.
17975
17976         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
17977         interface types found.
17978
17979         * typemanager.cs (GetInterfaces): Make this routine returns alll
17980         the interfaces and work around the lame differences between
17981         System.Type and System.Reflection.Emit.TypeBuilder in the results
17982         result for GetInterfaces.
17983
17984         (ExpandInterfaces): Given an array of interface types, expand and
17985         eliminate repeated ocurrences of an interface.  This expands in
17986         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
17987         be IA, IB, IC.
17988
17989 2002-06-21  Martin Baulig  <martin@gnome.org>
17990
17991         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
17992         on System.Enum.
17993
17994 2002-06-21  Martin Baulig  <martin@gnome.org>
17995
17996         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
17997         and called with one of the core types, return the corresponding typebuilder for
17998         that type.
17999
18000         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
18001         element type.
18002
18003 2002-06-21  Martin Baulig  <martin@gnome.org>
18004
18005         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
18006         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
18007         (Expression.ConvertReferenceExplicit): Likewise.
18008
18009         * expression.cs (ElementAccess.DoResolve): Likewise.
18010         (ElementAccess.DoResolveLValue): Likewise.
18011
18012 2002-06-10  Martin Baulig  <martin@gnome.org>
18013
18014         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
18015         add the "value" parameter to the parameter list.
18016
18017         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
18018         to our caller.
18019
18020 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
18021
18022         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
18023         the argument to an int, uint, long or ulong, per the spec.  Also
18024         catch negative constants in array creation.
18025
18026 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
18027
18028         * class.cs: do not allow the same interface to appear twice in
18029         the definition list.
18030
18031 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
18032
18033         * ecore.cs: don't use ldlen with System.Array.
18034
18035 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
18036
18037         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
18038
18039 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
18040
18041         * modifiers.cs: produce correct field attributes for protected
18042         internal. Easy fix so miguel can work on ther harder stuff:-)
18043
18044 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
18045
18046         * pending.cs: New file.  Move the code from class.cs here.
18047         Support clearning the pending flag for all methods (when not doing
18048         explicit interface implementation).
18049
18050 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
18051
18052         * rootcontext.cs: added a couple more types needed to bootstrap.
18053
18054 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
18055
18056         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
18057         constructor in the type, instead of any constructor in the type
18058         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
18059         a bug in the Mono runtime when applying the params attribute). 
18060
18061 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
18062         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
18063
18064 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
18065
18066         * expression.cs (Unary.ResolveOperator): Use TypeManager
18067         to resolve the type.
18068
18069 2002-06-13  Ravi Pratap  <ravi@ximian.com>
18070
18071         * cs-parser.jay (enum_member_declaration): Pass in the attributes
18072         attached.
18073
18074         * enum.cs (AddEnumMember): Add support to store the attributes associated 
18075         with each member too.
18076
18077         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
18078         field builders too - this takes care of the enum member case.
18079
18080 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
18081
18082         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
18083         address-of operator on both value types and pointers.
18084
18085 2002-06-10  Martin Baulig  <martin@gnome.org>
18086
18087         * interface.cs (Interface.PopulateIndexer): Add the indexer's
18088         PropertyBuilder to the `property_builders' list.
18089
18090         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
18091         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
18092         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
18093         find any indexers which are inherited from an interface.
18094
18095 2002-06-09  Martin Baulig  <martin@gnome.org>
18096
18097         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
18098         the same type as the constant if necessary.  There's also a test-130.cs
18099         for this.
18100
18101         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
18102
18103         * typemanager.cs (TypeManager.ChangeType): Previously known as
18104         Enum.ChangeEnumType().
18105
18106 2002-06-09  Martin Baulig  <martin@gnome.org>
18107
18108         * expression.cs (Cast.TryReduce): Added support for consts.
18109
18110 2002-06-08  Ravi Pratap  <ravi@ximian.com>
18111
18112         * class.cs (Accessor): Hold attributes information so we can pass
18113         it along.
18114
18115         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
18116         Modify to pass in attributes attached to the methods.
18117
18118         (add_accessor_declaration, remove_accessor_declaration): Ditto.
18119
18120         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
18121         to handle the Accessor kind :-)
18122
18123         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
18124
18125 2002-06-08  Martin Baulig  <martin@gnome.org>
18126
18127         * expression.cs (Unary.TryReduceNegative): Added support for
18128         ULongConstants.
18129
18130 2002-06-08  Martin Baulig  <martin@gnome.org>
18131
18132         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
18133         name can't be found in the `defined_names' - the caller will do a
18134         MemberLookup in this case and thus find methods in System.Enum
18135         such as Enum.IsDefined().
18136
18137 2002-06-08  Martin Baulig  <martin@gnome.org>
18138
18139         * enum.cs (Enum.ChangeEnumType): This is a custom version of
18140         Convert.ChangeType() which works with TypeBuilder created types.
18141         (Enum.LookupEnumValue, Enum.Define): Use it here.
18142
18143         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
18144         `TypeBuilder.BaseType != null' check.
18145         (TypeContainer.FindMembers): Only lookup parent members if we
18146         actually have a parent.
18147         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
18148         (ConstructorInitializer.Resolve): Likewise.
18149
18150         * interface.cs (Interface.FindMembers): Added
18151         `TypeBuilder.BaseType != null' check.
18152
18153         * rootcontext.cs (RootContext.ResolveCore): Added
18154         "System.Runtime.CompilerServices.IndexerNameAttribute" to
18155         classes_second_stage.
18156
18157         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
18158         debug_type and trace_type when compiling with --nostdlib.       
18159
18160 2002-06-07  Martin Baulig  <martin@gnome.org>
18161
18162         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
18163         (AddField): Set it to true when adding a non-static field.
18164         (DefineType): Use `have_nonstatic_fields' to find out whether we
18165         have non-static fields, not `Fields != null'.
18166
18167 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
18168
18169         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
18170         dereferencing a null on the static-field code path)
18171
18172 2002-05-30  Martin Baulig  <martin@gnome.org>
18173
18174         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
18175         to take command line arguments.  Use reflection to call the new
18176         custom `Initialize' function on the symbol writer and pass it the
18177         command line arguments.
18178
18179         * driver.cs (--debug-args): New command line argument to pass command
18180         line arguments to the symbol writer.
18181
18182 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
18183
18184         * assign.cs (DoResolve): Forgot to do the implicit conversion to
18185         the target type for indexers and properties.  Thanks to Joe for
18186         catching this.
18187
18188 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
18189
18190         * typemanager.cs (MethodFlags): returns the method flags
18191         (Obsolete/ShouldIgnore) that control warning emission and whether
18192         the invocation should be made, or ignored. 
18193
18194         * expression.cs (Invocation.Emit): Remove previous hack, we should
18195         not do this on matching a base type, we should do this based on an attribute
18196
18197         Only emit calls to System.Diagnostics.Debug and
18198         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
18199         on the command line.
18200
18201         * rootcontext.cs: Global settings for tracing and debugging.
18202
18203         * cs-tokenizer.cs (define): New utility function to track
18204         defines.   Set the global settings for TRACE and DEBUG if found.
18205
18206 2002-05-25  Ravi Pratap  <ravi@ximian.com>
18207
18208         * interface.cs (Populate*): Pass in the TypeContainer as well as
18209         the DeclSpace as parameters so that we can create EmitContexts and
18210         then use that to apply attributes etc.
18211
18212         (PopulateMethod, PopulateEvent, PopulateProperty)
18213         (PopulateIndexer): Apply attributes everywhere.
18214
18215         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
18216         etc.
18217
18218         (ApplyAttributes): Update accordingly.
18219
18220         We now apply interface attributes for all members too.
18221
18222 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
18223
18224         * class.cs (Indexer.Define); Correctly check if we are explicit
18225         implementation (instead of checking the Name for a ".", we
18226         directly look up if the InterfaceType was specified).
18227
18228         Delay the creation of the PropertyBuilder.
18229
18230         Only create the PropertyBuilder if we are not an explicit
18231         interface implementation.   This means that explicit interface
18232         implementation members do not participate in regular function
18233         lookups, and hence fixes another major ambiguity problem in
18234         overload resolution (that was the visible effect).
18235
18236         (DefineMethod): Return whether we are doing an interface
18237         implementation. 
18238
18239         * typemanager.cs: Temporary hack until we get attributes in
18240         interfaces (Ravi is working on that) and we get IndexerName
18241         support in interfaces.
18242
18243         * interface.cs: Register the indexers as properties.
18244
18245         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
18246         warning, I have verified that this is a bug in the .NET runtime
18247         (JavaScript suffers of the same problem).
18248
18249         * typemanager.cs (MemberLookup): When looking up members for
18250         interfaces, the parent of an interface is the implicit
18251         System.Object (so we succeed in searches of Object methods in an
18252         interface method invocation.  Example:  IEnumerable x;  x.ToString
18253         ()) 
18254
18255 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
18256
18257         * class.cs (Event): Events should also register if they do
18258         implement the methods that an interface requires.
18259
18260         * typemanager.cs (MemberLookup); use the new GetInterfaces
18261         method. 
18262
18263         (GetInterfaces): The code used to lookup interfaces for a type is
18264         used in more than one place, factor it here. 
18265
18266         * driver.cs: Track the errors at the bottom of the file, we kept
18267         on going.
18268
18269         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
18270         instance if the method we are calling is static!
18271
18272 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
18273
18274         * attribute.cs (ApplyAttributes): Make this function filter out
18275         the IndexerName attribute (as that attribute in reality is never
18276         applied) and return the string constant for the IndexerName
18277         attribute. 
18278
18279         * class.cs (TypeContainer.Emit): Validate that all the indexers
18280         have the same IndexerName attribute, and if so, set the
18281         DefaultName attribute on the class. 
18282
18283         * typemanager.cs: The return value might contain other stuff (not
18284         only methods).  For instance, consider a method with an "Item"
18285         property and an Item method.
18286
18287         * class.cs: If there is a problem with the parameter types,
18288         return. 
18289
18290 2002-05-24  Ravi Pratap  <ravi@ximian.com>
18291
18292         * ecore.cs (ImplicitConversionExists): Wrapper function which also
18293         looks at user defined conversion after making a call to 
18294         StandardConversionExists - we need this for overload resolution.
18295
18296         * expression.cs : Update accordingly the various method calls.
18297
18298         This fixes 2 bugs filed against implicit user defined conversions 
18299
18300 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
18301
18302         * statement.cs: Track the result of the assignment.
18303
18304 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
18305
18306         * expression.cs (MemberAccess): Improved error reporting for
18307         inaccessible members.
18308
18309 2002-05-22  Martin Baulig  <martin@gnome.org>
18310
18311         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
18312         itself with debugging support.
18313
18314 2002-05-22  Martin Baulig  <martin@gnome.org>
18315
18316         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
18317         Removed, this isn't needed anymore.
18318
18319 2002-05-20  Martin Baulig  <martin@gnome.org>
18320
18321         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
18322         be underlying type for an enum.
18323
18324 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
18325
18326         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
18327         that splits out the loading of just the core types.
18328
18329         * rootcontext.cs (ResolveCore): Split the struct resolution in
18330         two, so we can load the enumeration underlying types before any
18331         enums are used.
18332
18333         * expression.cs (Is): Bandaid until we fix properly Switch (see
18334         bug #24985 for details).
18335
18336         * typemanager.cs (ImplementsInterface): The hashtable will contain
18337         a null if there are no interfaces implemented.
18338
18339 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
18340
18341         * cs-parser.jay (indexer_declarator): It is fine to have array
18342         parameters
18343
18344 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18345
18346         * typemanager.cs: (RegisterBuilder): New function used to register
18347         TypeBuilders that implement interfaces.  Since
18348         TypeBuilder.GetInterfaces (as usual) does not work with lame
18349         Reflection.Emit. 
18350         (AddUserType): register interfaces.
18351
18352         (ImplementsInterface): Use the builder_to_ifaces hash if we are
18353         dealing with TypeBuilder.  Also, arrays are showing up as
18354         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
18355         methods can not be invoked on them!
18356
18357         * ecore.cs (ExplicitReferenceConversionExists): Made public.
18358         (ImplicitReferenceConversionExists): Split out from
18359         StandardConversionExists. 
18360
18361         * expression.cs (As): We were only implementing one of the three
18362         cases for the as operator.  We now implement them all.
18363         (Is): Implement the various other cases for Is as well.
18364
18365         * typemanager.cs (CACHE): New define used to control if we want or
18366         not the FindMembers cache.  Seems to have a negative impact on
18367         performance currently
18368
18369         (MemberLookup): Nested types have full acess to
18370         enclosing type members
18371
18372         Remove code that coped with instance/static returns for events, we
18373         now catch this in RealFindMembers.
18374
18375         (RealFindMembers): only perform static lookup if the instance
18376         lookup did not return a type or an event.  
18377
18378 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18379
18380         * assign.cs (CompoundAssign): We pass more semantic information
18381         now to Compound Assignments than we did before: now we have all
18382         the information at hand, and now we resolve the target *before* we
18383         do the expression expansion, which allows the "CacheValue" method
18384         to have the effect we intended (before, a [x] += 1 would generate
18385         two differen ArrayAccess expressions from the ElementAccess,
18386         during the resolution process).
18387
18388         (CompoundAssign.DoResolve): Resolve target and original_source here.
18389
18390 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
18391
18392         * expression.cs (ArrayAccess): dropped debugging information. 
18393
18394         * typemanager.cs: Small bug fix: I was always returning i_members,
18395         instead of one of i_members or s_members (depending on which had
18396         the content).
18397
18398         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
18399         method is invoked before any code generation takes place, and it
18400         is a mechanism to inform that the expression will be invoked more
18401         than once, and that the method should use temporary values to
18402         avoid having side effects
18403
18404         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18405
18406         * ecore.cs (Expression.CacheTemporaries): Provide empty default
18407         implementation.
18408
18409         * expression.cs (Indirection, ArrayAccess): Add support for
18410         CacheTemporaries in these two bad boys. 
18411
18412         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18413         ldobj or ldind_ref.  
18414         (StoreFromPtr): Handle stobj as well.
18415
18416         * expression.cs (UnaryMutator): Share more code.
18417
18418         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18419         down: I was not tracking the Filter function as well, which
18420         was affecting the results of the cache.
18421
18422 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
18423
18424         * attribute.cs: Remove the hack to handle the CharSet property on
18425         StructLayouts. 
18426
18427 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
18428
18429         * attribute.cs (DoResolve): More uglyness, we now only try to
18430         resolve the attribute partially, to extract the CharSet
18431         information (only if we are a StructLayout attribute).  Otherwise 
18432
18433         (GetExtraTypeInfo): Add some code to conditionally kill in the
18434         future this.   I am more and more convinced that the .NET
18435         framework has special code to handle the attribute setting on
18436         certain elements.
18437
18438         * expression.cs (IsParamsMethodApplicable): Revert my previous
18439         foreach change here, it was wrong.
18440
18441 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
18442
18443         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
18444         (pp_expr): do not abort on unknown input, just return.
18445         (eval): abort if there are pending chars.
18446
18447         * attribute.cs (Attribute.Resolve): Positional parameters are
18448         optional.  Deal with that case.
18449
18450         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
18451         the Ansi/Unicode/Auto information for the type.
18452
18453         (TypeContainer.DefineType): instantiate the EmitContext here, as
18454         we will be using it during the type definition (to resolve
18455         attributes) and during the emit phase.
18456
18457         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18458         to pull type information out of the attributes
18459
18460         (Attribute.Resolve): track the constructor builder, and allow for
18461         multiple invocations (structs and classes will use this).
18462
18463         * ecore.cs (MemberLookupFinal): new version with all the
18464         parameters customizable.
18465
18466         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18467         constructors.  Return if the result value is null (as the error
18468         would have been flagged already by MemberLookupFinal)
18469
18470         Do not allow instances of abstract classes or interfaces to be
18471         created.
18472
18473         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18474         We have to compare the assembly property here when dealing with
18475         FamANDAssem and Assembly access modifiers, because we might be
18476         creating an assembly from *modules* (that means that we are not
18477         getting TypeBuilders for types defined in other modules that are
18478         part of this assembly).
18479
18480         (Method.Emit): If the method is marked abstract and has a body,
18481         emit an error. 
18482
18483         (TypeContainer.DefineMembers): If both the defined member and the
18484         parent name match are methods, then do not emit any warnings: let
18485         the Method.Define routine take care of flagging warnings.  But if
18486         there is a mismatch (method overrides something else, or method is
18487         overriwritten by something, then emit warning).
18488
18489         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18490         set to null, this means `do not check for the return type on the
18491         signature'. 
18492
18493         (Method.Define): set the return type for the method signature to
18494         null, so that we get methods with the same name and parameters and
18495         different return types.  This is used to flag warning 114 (you are
18496         hiding a method, and you probably want to use the new/override
18497         keywords instead).
18498
18499         * typemanager.cs (MemberLookup): Implemented proper access
18500         control, closing a long standing set of bug reports.  The problem
18501         was that the Framework only has two bits: Public and NonPublic,
18502         and NonPublic includes private and protected methods, but we need
18503         to enforce the FamANDAssem, FamOrAssem and Family. 
18504
18505 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
18506
18507         * statement.cs (GotoCase): Return true: Ammounts to giving up
18508         knowledge on whether we return or not, and letting the other case
18509         be responsible for it.
18510
18511 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
18512
18513         * driver.cs: Do not load directories for each file processed, only
18514         do it if there is a pattern.
18515
18516         * ecore.cs: Report readonly assigns here as well, as we might have
18517         been resolved only by MemberAccess.
18518
18519         (SimpleName.SimpleNameResolve): Also be useful for LValue
18520         resolution.   We need this to propagate assign to local readonly variables
18521
18522         * typemanager.cs: Use a ptrhashtable for the criteria, because we
18523         do not want to reuse potential criteria memory.
18524
18525         * class.cs (MyEventBuilder): Set reflected_type;
18526
18527         * ecore.cs (Constantify): Added support for constifying bools.
18528
18529         (RootContext.LookupType): Added a cache for values looked up in
18530         the declaration space.
18531
18532         * typemanager.cs (FindMembers): Now is a front-end to
18533         RealFindMembers, and provides a two-level hashtable-based cache to
18534         the request.  
18535
18536         15% performance improvement: from 22.5 to 19.2 seconds.
18537
18538         * expression.cs (IsParamsMethodApplicable): use foreach.
18539         (Invocation.DoResolve): ditto.
18540         (New.DoResolve): ditto.
18541         (ArrayCreation.DoResolve): ditto.
18542
18543         * ecore.cs (FindMostEncompassingType): use foreach.
18544
18545         * delegate.cs (NewDelegate.DoResolve): Use foreach
18546
18547         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18548         (RemoveMethods): use foreach.
18549
18550         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18551         nested foreach statements instead of for, and also break out of
18552         the inner loop once a match is found.
18553
18554         (Invocation.OverloadResolve): Use foreach, simplify the code. 
18555
18556 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
18557
18558         * cfold.cs (BinaryFold): During an enumeration evaluation context,
18559         we actually unwrap the expression to allow for extra information
18560         to be extracted. 
18561
18562         * expression.cs: Use Shr_Un on unsigned operations. 
18563
18564 2002-05-08  Ravi Pratap  <ravi@ximian.com>
18565
18566         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
18567         applicable operators was not being considered correctly. This closes
18568         the bug Miguel reported.
18569
18570 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18571
18572         * attribute.cs: check that the type derives from System.Attribute
18573         and report the correct error in that case (moved the duplicate code to
18574         its own method, too).
18575
18576 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18577
18578         * attribute.cs: lookup attribute type name as the spec says: first the
18579         bare attribute name and then name + "Attribute" (nant compiles with
18580         mcs after this fix).
18581
18582 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
18583
18584         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
18585         Because of the way we parse things, we should try to see if a
18586         UIntConstant can fit in an integer.
18587
18588 2002-05-07  Ravi Pratap  <ravi@ximian.com>
18589
18590         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18591         when we are in an explicit context.
18592
18593         (ConvertReferenceExplicit): When converting from Iface type S to Class
18594         T make sure the rules are implemented as an OR.
18595
18596         * parameter.cs (ParameterType): Make it a property for now although the
18597         purpose really isn't anything immediate.
18598
18599         * expression.cs (Is*Applicable): Do better checking on the parameter type
18600         of a ref/out parameter. The ones from the system assemblies are already 
18601         marked with the correct type so we don't need to do any correction.
18602
18603         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
18604         the object type is standard too so include that.
18605
18606 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18607
18608         * ecore.cs (StandardConversionExists): Augment with missing code:
18609         deal with IntConstant, LongConstants and Enumerations.
18610
18611         * assign.cs: Report the error, instead of failing silently
18612
18613         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18614         typecontainer that they are declared, because the
18615         typecontainer/namespace will have the list of using clauses that
18616         need to be applied.
18617
18618         Assembly Attributes were escaping the normal registration
18619         mechanism. 
18620
18621         (EmitCode): Apply attributes within an EmitContext that represents
18622         the container they were declared on.
18623
18624         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
18625
18626 2002-05-06  Ravi Pratap  <ravi@ximian.com>
18627
18628         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18629         Revamp completely - make much cleaner as we now operate only
18630         on a set of Types.
18631
18632         (FindMostSpecificSource, FindMostSpecificTarget): New methods
18633         to implement the logic detailed in the spec more correctly.
18634
18635         (UserDefinedConversion): Update accordingly.
18636
18637 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18638
18639         * statement.cs: Return flow analysis information up.
18640
18641         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18642         and the default.
18643
18644         (token): Do not consume an extra character before calling
18645         decimal_digits.
18646
18647 2002-05-06  Piers Haken <piersh@friskit.com>
18648
18649         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18650
18651 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18652
18653         * class.cs (Constructor.Emit): Set the IsStatic flag in the
18654         EmitContext during the instance constructor initializer
18655         resolution, to stop access to instance variables.
18656
18657         This is mandated by the spec, last paragraph of the `constructor
18658         initializers' section. 
18659
18660 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
18661
18662         * cs-parser.jay, class.cs (Accessor): new class used to represent
18663         an accessor (get or set).  In the past we used `null' to represent
18664         a missing accessor.  But this is ambiguous because there was no
18665         way to tell in abstract indexers/properties if one of them was
18666         specified.
18667
18668         Now there is a way of addressing that.
18669
18670         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18671         instead of FindMembers.
18672
18673         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18674         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
18675
18676         * attribute.cs: Treat indexers and properties as the same in terms
18677         of applying attributes
18678
18679         * ecore.cs (FindMostEncompassedType): Use statically initialized
18680         EmptyExpressions()s like we do elsewhere to avoid creating useless
18681         objects (and we take this out of the tight loop).
18682
18683         (GetConversionOperators): Move the code to extract the actual
18684         operators to a separate routine to clean things up.
18685
18686 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
18687
18688         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
18689         events are always registered FieldBuilders.
18690
18691         * class.cs (FieldBase): New class shared by Fields 
18692
18693         * delegate.cs: If we are a toplevel delegate, use our full name.
18694         If we are a nested delegate, then only use our tail name.
18695
18696 2002-05-02  Ravi Pratap  <ravi@ximian.com>
18697
18698         * expression.cs (IsApplicable): Ensure that we add the "&" to
18699         ref/out types before comparing it with the type of the argument.
18700
18701         (IsParamsMethodApplicable): Ditto.
18702
18703         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
18704         silly me ;-)
18705
18706         * delegate.cs : Handle the case when we have more than one applicable
18707         method. Flag an error only when we finish checking all.
18708
18709 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
18710
18711         * expression.cs: Add support for boolean static initializers.
18712
18713 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
18714
18715         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
18716
18717         * parameter.cs (ComputeParameterTypes,
18718         ComputeAndDefineParameterTypes): Better error handling: now we
18719         clear the `types' cache if we fail during any of the type lookups.
18720         We also return the status code correctly to our caller
18721
18722         * delegate.cs: If we fail to define a delegate, abort the extra
18723         steps. 
18724
18725         * expression.cs (Binary.ResolveOperator): for
18726         operator==(object,object) and operator !=(object, object) we also
18727         have to verify that there is an implicit conversion from one to
18728         the other.
18729
18730         (ArrayAccess.DoResolve): Array Access can operate on
18731         non-variables. 
18732
18733 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
18734
18735         * assign.cs (CompoundAssign): A new class used as a "flag" that
18736         the assignment actually is happening as part of a compound
18737         assignment operator.
18738
18739         During compound assignment, a few new rules exist to enable things
18740         like:
18741
18742         byte b |= 1 + 2
18743
18744         From the spec:
18745
18746         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
18747         to the type of x) if y is implicitly convertible to the type of x,
18748         and the operator is a builtin operator and the return type of the
18749         operator is explicitly convertible to the type of x. 
18750
18751         * rootcontext.cs: Reset warning level to 2.  4 catches various
18752         "interesting" features in mcs, we must clean this up at some
18753         point, but currently am trying to kill other bugs ;-)
18754
18755         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
18756         in container classes as well.  
18757
18758         * expression.cs (Binary.ResolveOperator): Handle string case
18759         before anything else (as operator overloading does emit an error
18760         before doing anything else).
18761
18762         This code could go away when we move to a table driven model, but
18763         i could not come up with a good plan last night.
18764
18765 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
18766
18767         * typemanager.cs (CSharpName): reimplementation using regex.
18768         * class.cs: added null check for fields in Emit
18769         * rootcontext.cs: set warninglevel to 4
18770
18771 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
18772
18773         * typemanager.cs (CSharpName): reimplemented with Lupus
18774         suggestion.
18775
18776 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
18777
18778         * statement.cs (If): correclty implement Resolve, because we were
18779         not catching sem errors in there.  The same process is needed
18780         everywhere else. 
18781         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
18782
18783
18784         (Statement.Warning_DeadCodeFound): Factorize code.
18785         (While): Report dead code here too.
18786
18787         (Statement): Added Resolve virtual method to allow
18788         for resolution split from the emit code.
18789
18790 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
18791
18792         * statement.cs (EmitBoolExpression): No longer try to resolve the
18793         expression here.    
18794         (MakeBoolean): New utility function that resolve, implicitly
18795         converts to boolean and tags the expression. 
18796
18797
18798         (If, Do): Implement dead code elimination.
18799         (While): Implement loop inversion
18800
18801         (Do, While, For, If): Resolve the expression prior to calling our
18802         code generation.
18803
18804 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
18805
18806         * class.cs:
18807           - added method Report28 (warning: program has more than one entry point)
18808           - added method IsEntryPoint, implements paragraph 10.1 of the spec
18809           - modified method Method.Define, the part at the end of the method
18810
18811         * rootcontext.cs: added static public Location EntryPointLocation;
18812           
18813         * ../errors/cs0028.cs : Add test case for the above warning.              
18814
18815         * typemanager.cs:
18816           - modified method CSharpName to allow arrays of primitive type to
18817             be printed nicely (e.g. instead of System.Int32[][] it now prints
18818             int[][])
18819           - added method CSharpSignature: returns the signature of a method
18820             in string format to be used in reporting errors, warnings, etc.
18821
18822         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
18823         with String.Empty.
18824
18825 2002-04-26  Ravi Pratap  <ravi@ximian.com>
18826
18827         * delegate.cs (Define): Fix extremely silly bug where I was
18828         setting the type of the 'object' parameter of the BeginInvoke
18829         method to System.IAsyncResult instead of System.Object ;-)
18830
18831 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
18832
18833         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
18834         here. 
18835
18836         (Constructor.Emit): return if we fail to initialize the
18837         constructor.  Another door closed!  
18838
18839         * expression.cs (New.DoResolve): Improve error message (from -6 to
18840         1501).  Use DeclaredOnly lookup to find the exact constructor.
18841
18842         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
18843         loop.  This is useful.
18844
18845         * cs-parser.jay: Adjust the default parameters so that destructors
18846         have the proper signature.
18847
18848 2002-04-26  Martin Baulig  <martin@gnome.org>
18849
18850         * driver.cs (LoadAssembly): If `assembly' contains any characters
18851         which are only valid in path names and not in assembly names
18852         (currently slash, backslash and point), use Assembly.LoadFrom ()
18853         instead of Assembly.Load () on the `assembly' (before iteration
18854         over the link_paths).
18855
18856 2002-04-26  Martin Baulig  <martin@gnome.org>
18857
18858         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
18859
18860 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
18861
18862         * class.cs (Property): use the new typemanager.MemberLookup
18863
18864         (TypeContainer.MemberLookup): Implement using the
18865         TypeManager.MemberLookup now. 
18866
18867         * typemanager.cs: Make MemberLookup a function of the TypeManager,
18868         and return MemberInfos, so that these can be used without an
18869         EmitContext (what we had before).
18870
18871 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
18872
18873         * expression.cs: Fix the case where the argument to params if the
18874         type of the params.  I omitted handling this before.   Fixed
18875
18876 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
18877
18878         * driver.cs: Call BootCorlib_PopulateCoreType
18879
18880         * class.cs (Property.CheckBase): Check for properties only, not
18881         for all members. 
18882
18883         * interface.cs: Temporary hack: try/catch around the
18884         CustomAttributeBuilder, because I am getting an exception that I
18885         do not understand.
18886
18887         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
18888         types whose definitions are required to be there (attributes are
18889         defined before standard types).
18890
18891         Compute definitions as we boot the various types, as they are used
18892         immediately (value_type class will need object_type, but if we do
18893         not initialize object_type, we will pass a null, which will let
18894         the runtime pick the System.Object from the existing corlib, which
18895         is not what we want).
18896
18897 2002-04-22  Patrik Torstensson <totte@labs2.com>
18898
18899         * cs-tokenizer.cs: fixed a number of trim() issues.
18900
18901 2002-04-22  Ravi Pratap  <ravi@ximian.com>
18902
18903         * expression.cs (Argument.Type): Ensure that we return the correct
18904         type when we have out or ref parameters [in which case we 
18905         append a "&"].
18906
18907 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
18908
18909         * class.cs (Property, Indexer): Allow extern modifier in there. 
18910
18911         * typemanager.cs (InitBaseTypes): Initializes object_type and
18912         value_type, since those will be used early on during the bootstrap
18913         process to compile corlib.
18914
18915         (InitCoreTypes): Move code from here to InitBaseTypes.
18916
18917 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
18918
18919         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
18920         single-dimension arrays as using the ldlen opcode.  
18921
18922         Daniel Lewis discovered this optimization.  
18923
18924         * typemanager.cs: Add signature for System.Array::get_Length
18925
18926 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18927
18928         * statement.cs: report the error when the foreach does not apply to an
18929         array nor a collection.
18930
18931 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
18932
18933         * expression.cs: Add implicit conversions to the operator ~.
18934
18935         * constant.cs (DecimalConstant.Emit): Emit decimal value.
18936
18937         * typemanager.cs: Locate the decimal constructor.
18938
18939 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18940
18941         * attribute.cs: use the new property of TypeOf.
18942         * expression.cs: added 'get' property around typearg.
18943
18944         These changes fix a build breaker reported by NickD. Is this the
18945         correct way to fix?  If not, please, revert my changes and make it
18946         work :-).
18947
18948 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
18949
18950         * attribute.cs: Add support for typeof in attribute invocations.
18951         I am not sure that this is right though.
18952
18953 2002-04-14  Duncan Mak  <duncan@ximian.com>
18954
18955         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
18956         Binary.Operator.Division case.
18957
18958 2002-04-13  Ravi Pratap  <ravi@ximian.com>
18959
18960         * class.cs (DefineType): Ensure that we do a proper check on
18961         attribute types and also register it with the TypeManager.
18962
18963         (TypeContainer.Targets): The default for attribute types is
18964         AttributeTargets.All.
18965
18966         * attribute.cs (ApplyAttributes): Registering the attribute type
18967         is done elsewhere, not when we discover we have a Usage attribute.
18968
18969 2002-04-12  Ravi Pratap  <ravi@ximian.com>
18970
18971         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
18972         and get rid of is_delegate parameter.
18973
18974         * everywhere : update.
18975
18976 2002-04-12  Ravi Pratap  <ravi@ximian.com>
18977
18978         * cs-parser.jay (compilation_unit): Revamp completely to use
18979         some new ideas that I got from Rhys' grammar to solve the problems
18980         with assembly level attributes.
18981
18982         (outer_declaration): New grammar production.
18983
18984         (attribute_sections): Add.
18985
18986         (opt_attributes): Base on attribute_sections
18987
18988         (namespace_declaration): Allow opt_attributes to tackle the case
18989         when we have assembly level attributes - we are clever in this
18990         regard now ;-)
18991
18992         * attribute.cs (ApplyAttributes): Do not worry about assembly 
18993         attributes in the non-global context.
18994
18995         * rootcontext.cs (AddGlobalAttributes): Go back to using this
18996         instead of SetGlobalAttributes.
18997
18998         * class.cs, rootcontext.cs : Ensure we define and generate 
18999         attribute types before anything else.
19000
19001         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
19002         and flag the new error -20 for the case when the attribute type
19003         does not have valid targets specified. csc does not catch this.
19004
19005         * ../errors/errors.txt : update for error # -20
19006
19007 2002-04-11  Ravi Pratap  <ravi@ximian.com>
19008
19009         * support.cs (InternalParameters.ParameterModifier): Do some null
19010         checking and return sane values.
19011
19012         * class.cs (Method.Define): If we are a PInvoke method, ensure
19013         that we are static and extern. Report error # 601
19014
19015         * ../errors/cs0601.cs : Add test case for the above error.
19016
19017 2002-04-07  Ravi Pratap  <ravi@ximian.com>
19018
19019         * rootcontext.cs (attribute_types): We need to keep type of
19020         all attribute types separately and emit code for them first.
19021
19022         (RegisterAttribute) : Implement.
19023
19024         * class.cs (DefineType): Check if the current Type is a custom
19025         attribute type and register it accordingly.
19026
19027         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
19028         adding the first attribute twice and rename to
19029
19030         (SetGlobalAttributes): this.
19031
19032         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
19033         lookups.
19034
19035         * attribute.cs (ApplyAttributes): Take an additional argument telling us
19036         if we are processing global arguments. Hmm, I am unsure of this.
19037
19038 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19039
19040         * expression.cs: added static array of strings to avoid calling
19041         Enum.ToString () for Operator in Binary. Significant recover of
19042         performance.
19043
19044 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
19045
19046         * class.cs (FindMembers): Allow the Builders of the various
19047         members to be null.  If they are skip them.  This only happens
19048         during the PInvoke declaration.
19049
19050 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
19051
19052         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
19053         failure, so we do not keep going afterwards.
19054
19055         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
19056         wanted to pass `false' as the `is_delegate' argument.  If this is
19057         the case, why not use delegate_type == null to mean `is_delegate =
19058         false' and anything else as is_delegate = true.
19059
19060 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
19061
19062         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
19063         code for the section, not the beginning of the tests.
19064
19065 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
19066
19067         * cfold.cs: Handle operator + (Enum x, Underlying x) 
19068
19069         * expression.cs (Binary): same.  Warn about errors where we have
19070         Enum/Enum in operator + as well.
19071
19072 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
19073
19074         * statement.cs:
19075                 - added support for switch(bool)
19076                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
19077                 - add TableSwitchEmit() to handle table-based switch statements
19078
19079 2002-04-05  Ravi Pratap  <ravi@ximian.com>
19080
19081         * expression.cs (Invocation.OverloadResolve): Factor out code which
19082         does parameter compatibility checking with arguments so that we can 
19083         re-use the code even from Delegate.VerifyApplicability
19084
19085         (VerifyArgumentsCompat): Move above code here.
19086
19087         * delegate.cs (VerifyApplicability): Get rid of duplicate code
19088         and instead make a call to the above method.
19089
19090 2002-03-31  Ravi Pratap  <ravi@ximian.com>
19091
19092         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
19093         We use it to keep track of classes which are attribute types.
19094
19095 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
19096
19097         * delegate.cs (Delegate.Define): Correctly define the types in the
19098         presence of fixed and array parameters.
19099
19100         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
19101         doing FindMembers.
19102
19103         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
19104         include NonPublic after the first iteration.
19105
19106         * class.cs (Indexer.CheckBase): Only check if both parents are
19107         non-null. 
19108
19109         * cs-parser.jay (accessor_body): If empty, set to null.
19110
19111         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
19112         same code path here to resolve constants names that we did have in
19113         MemberAccess.DoResolve.  There is too much code duplicated here.
19114
19115 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
19116
19117         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
19118
19119         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
19120         to MakeUnionSet.
19121
19122         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
19123         tokens, numbers and strings.
19124
19125         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
19126         parenthesis.
19127
19128         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
19129         asyncronous parameters and the regular parameters.  
19130
19131         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
19132         specify the target directory.
19133
19134         * expression.cs: (This.DoResolve): Simplify
19135         (As.Emit): Optimize, do not generate IsInst if the expression is
19136         always of the given type.
19137
19138         (Is.DoResolve): Bug fix, we were reporting both always/never for
19139         the is expression.
19140
19141         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
19142         creating too many unnecessary arrays.
19143
19144 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
19145
19146         * class.cs (EmitFieldInitializer): Use Assign expression to assign
19147         fields instead of rolling our own initializer.   Takes care of all
19148         implicit conversions, and drops unnecessary static checks/argument.
19149
19150 2002-03-31  Dick Porter  <dick@ximian.com>
19151
19152         * driver.cs: use the GetDirectories() return values properly, and
19153         use "/" as path separator.
19154
19155 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
19156
19157         * expression.cs (Unary): Optimize - - expr into expr.
19158         (Binary): Optimize a + (-b) into a -b.
19159
19160         * codegen.cs (CodeGen): Made all methods static.
19161
19162 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
19163
19164         * rootcontext.cs: 
19165
19166         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
19167         TypeBuilder property.
19168
19169         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
19170         instead. 
19171
19172         * tree.cs: Removed the various RecordXXXX, and replaced with a
19173         single RecordDecl.  Removed all the accessor methods, and just
19174         left a single access point Type 
19175
19176         * enum.cs: Rename DefineEnum to DefineType.
19177
19178         * decl.cs: New abstract method `DefineType' used to unify the
19179         Defines for Enumerations, Interfaces, TypeContainers and
19180         Delegates.
19181
19182         (FindType): Moved LookupInterfaceOrClass here.  Moved the
19183         LookupBaseClasses method that used to live in class.cs and
19184         interface.cs here, and renamed to FindType.
19185
19186         * delegate.cs: Implement DefineType.  Take advantage of the
19187         refactored pattern for locating the parent builder without taking
19188         the parent_builder argument (which we know does not work if we are
19189         nested, and triggering a toplevel definition).
19190
19191 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19192
19193         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
19194         accessibility of a member has changed during override and report
19195         an error if so.
19196
19197         * class.cs (Method.Define, Property.Define): Only complain on
19198         overrides if the method is private, any other accessibility is
19199         fine (and since we just checked the permission is the same, we are
19200         good to go).
19201
19202         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
19203         and elif are processed always.  The other pre-processing
19204         directives are only processed if we are "taking" the path
19205
19206 2002-03-29  Martin Baulig  <martin@gnome.org>
19207
19208         * class.cs (Method.Emit): Only emit symbolic debugging info if the
19209         current location is not Null.
19210
19211         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
19212         a separate method so we can profile it.
19213
19214         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
19215         `span.Seconds' are just seconds, but no minutes or hours.
19216         (MainDriver): Profile the CodeGen.SaveSymbols calls.
19217
19218 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19219
19220         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
19221         Remove the gratuitous set of Final:
19222
19223                                 // If an interface implementation, then we can set Final.
19224                                 if (((flags & MethodAttributes.Abstract) == 0) &&
19225                                     implementing.DeclaringType.IsInterface)
19226                                         flags |= MethodAttributes.Final;
19227
19228         I do not know what I was smoking when I used that.
19229
19230
19231         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
19232         step into fixing the name resolution issues for delegates and
19233         unifying the toplevel name resolution.
19234
19235 2002-03-28  Martin Baulig  <martin@gnome.org>
19236
19237         * class.cs (Method.Emit): If we have a symbol writer, call its
19238         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
19239         tell it about the current method.
19240
19241         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
19242         writer that we're going to emit the first byte of IL code for a new
19243         statement (a new source line).
19244         (EmitContext.EmitTopBlock): If we have a symbol writer, call
19245         EmitContext.Mark() before emitting any code.
19246
19247         * location.cs (SymbolDocument): Return null when we're Null.
19248
19249         * statement.cs (Statement): Moved the `Location loc' variable here.
19250         (Statement.EmitBoolExpression): If we have a symbol writer, call
19251         ec.Mark() before emitting any code to tell it that we're at the
19252         beginning of a new statement.
19253         (StatementExpression): Added `Location' argument to the constructor.
19254         (Block): Added public readonly variable `StartLocation' and public
19255         variable `EndLocation'.  The latter is to be set using SetEndLocation().
19256         (Block): Added constructor which takes a start and end location.
19257         (Block.SetEndLocation): New method. This sets the end location.
19258         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
19259         local variables we create.
19260         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
19261         each statement and do also mark the begin and end of the block.
19262
19263         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
19264         tell it the current lexer.Location, use Location.Null for the end of the
19265         block.
19266         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
19267         current block, set its end location using SetEndLocation().
19268         (statement_expression): StatementExpression constructor now takes the
19269         lexer.Location as additional argument.
19270         (for_statement, declare_local_variables): Likewise.
19271         (declare_local_variables): When creating a new implicit block, use the
19272         new Block constructor and pass it the lexer.Location.
19273
19274 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19275
19276         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
19277         members also on the parent interfaces recursively.
19278
19279 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
19280
19281         * report.cs: Use new formats, since Gonzalo finished the missing
19282         bits. 
19283
19284         * expression.cs (Binary.ResolveOperator): added missing operator|
19285         operator& and operator^ for bool/bool.
19286
19287         * cs-parser.jay: CheckDef now takes a Location argument that is
19288         used to report errors more precisly (instead of reporting the end
19289         of a definition, we try to track something which is a lot closer
19290         to the source of the problem).
19291
19292         * cs-tokenizer.cs: Track global token use, so we can properly flag
19293         the use of #define/#undef after the first token has been seen.
19294
19295         Also, rename the reportXXXX to Error_DescriptiveName
19296
19297         * decl.cs (DeclSpace.IsTopLevel): Move property here from
19298         TypeContainer, so that Enum and Interface can use this too.
19299
19300         * class.cs (TypeContainer.LookupInterfaceOrClass,
19301         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
19302         `builder' argument.  Typically this was used to pass the parent
19303         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
19304         the definition).  
19305
19306         The problem is that a nested class could trigger the definition of
19307         a toplevel class, and the builder would be obviously wrong in that
19308         case. 
19309
19310         So we drop this argument, and we compute dynamically the
19311         TypeBuilder/ModuleBuilder (the correct information was available
19312         to us anyways from DeclSpace.Parent)
19313
19314         * interface.cs (Interface.DefineInterface): Drop builder
19315         parameter cleanup like class.cs
19316
19317         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
19318         like class.cs
19319
19320         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
19321         values. 
19322
19323         (Try.Emit): Propagate the returns value from the statement.
19324
19325         (Return.Emit): Even if we are leavning 
19326
19327         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
19328
19329         * modifiers.cs: Fix the computation of MethodAttributes flags.
19330
19331 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
19332
19333         * driver.cs: allow compilation of files that start with '/'.
19334         Add a default case when checking the argument of --target.
19335
19336 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
19337
19338         * interface.cs: Implement the same search algorithm for types in
19339         the interface code.
19340
19341         * delegate.cs: Do not allow multiple definition.
19342
19343         * Recovered ChangeLog that got accidentally amputated
19344
19345         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
19346
19347         * rootcontext.cs: Load manually enum to allow core classes to
19348         contain enumerations.
19349
19350         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
19351         Update to new static methods in TypeManager.
19352
19353         * typemanager.cs (GetMethod, GetConstructor): Use our
19354         implementation of FindMembers to find the members, since during
19355         corlib compilation, the types are TypeBuilders and GetMethod and
19356         GetConstructor do not work.
19357
19358         Make all methods in TypeManager static.
19359
19360         (InitCodeHelpers): Split the functionality from
19361         the InitCodeTypes function.
19362
19363         * driver.cs: Call InitCodeHelpers after we have populated the
19364         types. 
19365
19366         * cs-parser.jay (delegate_declaration): we did not used to compute
19367         the delegate name correctly for void delegates.
19368
19369 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
19370
19371         * rootcontext.cs (RootContext): Init the interface_resolve_order
19372         and type_container_resolve_order always.
19373
19374         (ResolveCore, BootstrapCorlib_ResolveClass,
19375         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19376         compiler when compiling with --nostdlib
19377
19378         * class.cs (TypeContainer.DefineType): Check that our parent is
19379         not null.  This test is most important when we are bootstraping
19380         the core types.
19381
19382         * codegen.cs: Split out the symbol writing code.
19383
19384 2002-03-25  Martin Baulig  <martin@gnome.org>
19385
19386         * driver.cs (-g): Made -g an alias for --debug.
19387
19388 2002-03-24  Martin Baulig  <martin@gnome.org>
19389
19390         * codegen.cs (SymbolWriter): New public variable. Returns the
19391         current symbol writer.
19392         (CodeGen): Added `bool want_debugging_support' argument to the
19393          constructor. If true, tell the ModuleBuild that we want debugging
19394         support and ask it for the ISymbolWriter.
19395         (Save): If we have a symbol writer, call it's Close() method after
19396         saving the assembly.
19397
19398         * driver.c (--debug): New command line argument to create a
19399         debugger information file.
19400
19401         * location.cs (SymbolDocument): New public property. Returns an
19402         ISymbolDocumentWriter object for the current source file or null
19403         if we don't have a symbol writer.
19404
19405 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
19406
19407         * driver.cs (LoadAssembly): Correctly return when all the paths
19408         have been tried and not before.
19409
19410         * statement.cs (Switch.Emit): return the actual coverage for this
19411         statement (returns/not-returns)
19412
19413         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19414         switch of the statement if we are the last switch section.  That
19415         kills two problems: try/catch problems (we used to emit an empty
19416         nop at the end) and switch statements where all branches would
19417         return. 
19418
19419 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
19420
19421         * driver.cs: Add default assemblies (the equivalent to the
19422         Microsoft CSC.RSP file)
19423
19424         * cs-tokenizer.cs: When updating `cols and setting it to zero,
19425         also update tokens_seen and set it to false.
19426
19427         * driver.cs: Implement --recurse for Mike.
19428
19429         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19430         correctly splitting out the paths.
19431
19432 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
19433
19434         * interface.cs (Interface.PopulateProperty): Instead of using
19435         `parent' as the declaration space for the set parameters, use
19436         `this' 
19437
19438         * support.cs (InternalParameters): InternalParameters constructor
19439         takes a DeclSpace instead of a TypeContainer.
19440
19441         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
19442         types are being initialized, load the address of it before calling
19443         the function.  
19444
19445         (New): Provide a mechanism to disable the generation of local
19446         value type temporaries when the caller will be providing us with
19447         an address to store it.
19448
19449         (ArrayCreation.EmitDynamicInitializers): Use it.
19450
19451 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
19452
19453         * expression.cs (Invocation.EmitArguments): Only probe for array
19454         property if there is more than one argument.  Sorry about that.
19455
19456         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19457         empty param arrays.
19458
19459         * class.cs (Method.LabelParameters): Fix incorrect code path that
19460         prevented the `ParamArrayAttribute' from being applied to the
19461         params attribute.
19462
19463 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
19464
19465         * support.cs (ReflectionParameters): Correctly compute whether the
19466         last argument is a params array.  Fixes the problem with
19467         string.Split ('a')
19468
19469         * typemanager.cs: Make the assemblies array always be non-null
19470         (empty, but non-null)
19471
19472         * tree.cs (RecordDecl): New function that abstracts the recording
19473         of names.  This reports error 101, and provides a pointer to the
19474         previous declaration.  Fixes a crash in the compiler.
19475
19476         * cs-parser.jay (constructor_declaration): Update to new grammar,
19477         and provide a constructor_body that can be empty.
19478
19479 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
19480
19481         * driver.cs: Add support for --resources.
19482
19483         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19484         Make all types for the various array helper methods be integer.
19485
19486         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19487         CheckState to ConvCast.
19488
19489         (ConvCast): Now it takes a `checked' state argument, to avoid
19490         depending on the emit context for the conversion, and just using
19491         the resolve time setting.
19492
19493         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19494         instead of Invocation.EmitArguments.  We do not emit the original
19495         arguments, instead we emit those which have been converted to
19496         unsigned int expressions.
19497
19498         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19499
19500         * codegen.cs: ditto.
19501
19502         * expression.cs (LocalVariableReference): Drop the use of the
19503         Store function that depended on the variable index.
19504
19505         * statement.cs (VariableInfo): Drop the `Idx' property from this
19506         class, as this is not taking into account the indexes for
19507         temporaries tat we generate during the execution, getting the
19508         indexes wrong.
19509
19510         * class.cs: First emit class initializers, then call the parent
19511         constructor. 
19512
19513         * expression.cs (Binary): Fix opcode emision.
19514         (UnaryMutator.EmitCode): Support checked code generation
19515
19516         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19517         matches for events for both the Static and Instance scans,
19518         pointing to the same element.   Fix that.
19519
19520 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
19521
19522         * rootcontext.cs (ResolveTree): Always set the
19523         interface_resolve_order, because nested interfaces will be calling
19524         into us.
19525
19526         * class.cs (GetInterfaceOrClass): Track the same resolution
19527         process used by TypeManager.LookupType.  This fixes the nested
19528         type lookups in class declarations (separate path from
19529         LookupType). 
19530
19531         (TypeContainer.DefineType): Also define nested interfaces.
19532         (TypeContainer.RegisterOrder): New public function used to
19533         register the order in which child interfaces need to be closed.
19534
19535         Nested interfaces need to be closed after their parents have been
19536         created. 
19537
19538         * interface.cs (InterfaceAttr): Put all the logic for computing
19539         the interface attribute here. 
19540
19541         (DefineInterface): Register our interface order with the
19542         RootContext or with the TypeContainer depending on the case.
19543
19544 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19545
19546         * cs-parser.jay: rework foreach statement to work with the new
19547         changes to the policy on SimpleNames.
19548
19549         * report.cs: support Stacktrace on warnings as well.
19550
19551         * makefile: drop --unsafe and /unsafe from the compile.
19552
19553 2002-03-13  Ravi Pratap  <ravi@ximian.com>
19554
19555         * ecore.cs (StandardConversionExists): Modify to take an Expression
19556         as the first parameter. Ensure we do null -> reference type conversion
19557         checking.
19558
19559         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19560         temporary Expression objects.
19561
19562 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19563
19564         * interface.cs: workaround bug in method overloading resolution
19565         (there is already a bugzilla bug for it).
19566
19567 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19568
19569         We could also solve this problem by having a separate path for
19570         performing type lookups, instead of DoResolve, we could have a
19571         ResolveType entry point, and only participating pieces of the
19572         production (simplename, deref, array) would implement this. 
19573
19574         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19575         signal SimpleName to only resolve type names and not attempt to
19576         resolve anything else.
19577
19578         * expression.cs (Cast): Set the flag.
19579
19580         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19581
19582         * class.cs: Only report 108 if there is no `new' modifier.
19583
19584         * cs-parser.jay: rework foreach statement to work with the new
19585         changes to the policy on SimpleNames.
19586         
19587         * report.cs: support Stacktrace on warnings as well.
19588
19589         * makefile: drop --unsafe and /unsafe from the compile.
19590
19591 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
19592
19593         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19594         lookups here, instead of doing that at parse time.  This means
19595         that our grammar will not introduce `LocalVariableReferences' as
19596         expressions at this point.  That solves the problem of code like
19597         this:
19598
19599         class X {
19600            static void Main ()
19601            { int X = 1;
19602             { X x = null }}}
19603
19604         This is only half the fix.  The full fix requires parameters to
19605         also be handled in this way.
19606
19607         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19608         makes the use more obvious of the DeclSpace.  The
19609         ec.TypeContainer.TypeBuilder is now only used to pull the
19610         TypeBuilder for it.
19611
19612         My theory is that I can get rid of the TypeBuilder completely from
19613         the EmitContext, and have typecasts where it is used (from
19614         DeclSpace to where it matters).  
19615
19616         The only pending problem is that the code that implements Aliases
19617         is on TypeContainer, and probably should go in DeclSpace.
19618
19619         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19620         lookups here, instead of doing that at parse time.  This means
19621         that our grammar will not introduce `LocalVariableReferences' as
19622         expressions at this point.  That solves the problem of code like
19623         this:
19624
19625         class X {
19626            static void Main ()
19627            { int X = 1;
19628             { X x = null }}}
19629
19630         This is only half the fix.  The full fix requires parameters to
19631         also be handled in this way.
19632
19633         * class.cs (Property.DefineMethod): When implementing an interface
19634         method, set newslot, when implementing an abstract method, do not
19635         set the flag (before we tried never setting it, or always setting
19636         it, which is the difference).
19637         (Indexer.DefineMethod): same.
19638         (Method.DefineMethod): same.
19639
19640         * ecore.cs: Only set the status used flag if we get back a Field.
19641
19642         * attribute.cs: Temporary hack, so Paolo can keep working.
19643
19644 2002-03-08  Ravi Pratap  <ravi@ximian.com>
19645
19646         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19647         the unmanaged type in the case we have a MarshalAs attribute.
19648
19649         (Resolve): Handle the case when we are parsing the special MarshalAs
19650         attribute [we need to store the unmanaged type to use later]
19651
19652         * typemanager.cs (marshal_as_attr_type): Built in type for the 
19653         MarshalAs Attribute.
19654
19655         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
19656         on parameters and accordingly set the marshalling info.
19657
19658 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
19659
19660         * class.cs: Optimizing slightly by removing redundant code after
19661         we switched to the `NoTypes' return value.
19662         (Property.DefineMethod): use NoTypes here too.
19663
19664         This fixes the bug I introduced in my last batch of changes.
19665
19666 2002-03-05  Ravi Pratap  <ravi@ximian.com>
19667
19668         * tree.cs (RecordEnum): Add. We now keep track of enums too.
19669
19670         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19671         Enums since those are types too. 
19672
19673         * cs-parser.jay (enum_declaration): Record enums as we parse them.
19674
19675         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
19676         thanks to a call during the lookup process.
19677
19678 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
19679
19680         * statement.cs (Foreach): Lots of work to accomodate a particular
19681         kind of foreach statement that I had not kept in mind.  It is
19682         possible to have foreachs on classes that provide a GetEnumerator
19683         method that return objects that implement the "pattern" for using
19684         a foreach, there is no need to support GetEnumerator
19685         specifically. 
19686
19687         This is needed to compile nant.
19688
19689         * decl.cs: Only report 114 if the member is not `Finalize' and if
19690         the warning level is at least 2.
19691
19692         * class.cs: Moved the compare function from Method to
19693         MethodSignature. 
19694
19695         (MethodSignature.InheritableMemberSignatureCompare): Add new
19696         filter function that is used to extract inheritable methods from a
19697         class. 
19698
19699         (Method.Define): Use the new `inheritable_method_signature_filter'
19700         delegate
19701
19702         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
19703         command. 
19704
19705 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
19706
19707         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
19708
19709         * cs-parser.jay: Add opt_semicolon to the interface declaration.
19710
19711         * expression.cs: Pass location information to
19712         ConvertImplicitStandard. 
19713
19714         * class.cs: Added debugging code to track return values from
19715         interfaces. 
19716
19717 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
19718
19719         * expression.cs (Is.DoResolve): If either side of the `is' is an
19720         interface, do not flag the warning.
19721
19722         * ecore.cs (ImplicitReferenceConversion): We need a separate test
19723         for interfaces
19724
19725         * report.cs: Allow for --fatal to be used with --probe.
19726
19727         * typemanager.cs (NoTypes): Move the definition for the empty Type
19728         array here. 
19729
19730         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
19731         properties. 
19732         (TypeContainer.DefineProxy): New function used to proxy to parent
19733         implementations when implementing interfaces.
19734         (TypeContainer.ParentImplements): used to lookup if our parent
19735         implements a public function that is required by an interface.
19736         (TypeContainer.VerifyPendingMethods): Hook this up.
19737
19738         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
19739         `modules' and `assemblies' arraylists into arrays.  We only grow
19740         these are the very early start up of the program, so this improves
19741         the speedof LookupType (nicely measured).
19742
19743         * expression.cs (MakeByteBlob): Replaced unsafe code with
19744         BitConverter, as suggested by Paolo.
19745
19746         * cfold.cs (ConstantFold.Binary): Special case: perform constant
19747         folding of string concatenation, but if either side is a string,
19748         and the other is not, then return null, and let the runtime use
19749         the concatenation on the string plus the object (using
19750         `Object.ToString'). 
19751
19752 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
19753
19754         Constant Folding has been implemented now.
19755
19756         * expression.cs (Unary.Reduce): Do not throw an exception, catch
19757         the error instead on types that are not supported in one's
19758         complement. 
19759
19760         * constant.cs (Constant and all children): New set of functions to
19761         perform implict and explicit conversions.
19762
19763         * ecore.cs (EnumConstant): Implement the new functions to perform
19764         conversion by proxying to the child expression.
19765
19766         * codegen.cs: (ConstantCheckState): Constant evaluation has its
19767         own separate setting that can not be turned off from the command
19768         line using --unchecked or --checked and is only controlled using
19769         the checked/unchecked statements and expressions.  This setting is
19770         used by the constant folder to flag errors.
19771
19772         * expression.cs (CheckedExpr, UncheckedExpr): Set the
19773         ConstantCheckState as well.   
19774
19775         During Resolve, they also have to flag the state, because the
19776         constant folder runs completely in the Resolve phase.
19777
19778         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
19779         well.
19780
19781 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
19782
19783         * cfold.cs: New file, this file contains the constant folder.
19784
19785         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
19786         argument to track whether we are using the resulting address to
19787         load or store a value and provide better error messages. 
19788
19789         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
19790         new AddressOf arguments.
19791
19792         * statement.cs (Foreach.EmitCollectionForeach): Update
19793
19794         * expression.cs (Argument.Emit): Call AddressOf with proper
19795         arguments to track usage.
19796
19797         (New.DoEmit): Call AddressOf with new arguments.
19798
19799         (Unary.Emit): Adjust AddressOf call.
19800
19801 2002-03-01  Ravi Pratap  <ravi@ximian.com>
19802
19803         * cs-parser.jay (member_access): Change the case for pre-defined types
19804         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
19805         this suggestion.
19806
19807         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
19808         a method body.
19809
19810         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
19811         essentially like methods and apply attributes like MethodImplOptions to them too.
19812
19813         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
19814         not being null.
19815
19816         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
19817         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
19818         is the DeclSpace.
19819
19820         * Update code everywhere accordingly.
19821
19822         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
19823
19824         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
19825
19826 2002-02-28  Ravi Pratap  <ravi@ximian.com>
19827
19828         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
19829         try performing lookups against those instead of jumping straight into using
19830         the 'using' clauses.
19831
19832         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
19833
19834         (LookupType): Perform lookups in implicit parents too.
19835
19836         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
19837         sequence as RootContext.LookupType. 
19838
19839         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
19840         the various cases of namespace lookups into this method.
19841
19842 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
19843
19844         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
19845         in positional arguments)
19846
19847         * class.cs (Operator): Update the AllowedModifiers to contain
19848         extern. 
19849
19850         * cs-parser.jay: Update operator declaration to allow for the
19851         operator body to be empty.
19852
19853         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
19854         values. 
19855
19856 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
19857
19858         * class.cs (Method.Emit): Label parameters.
19859
19860         * driver.cs: Return 1 or 0 as the program exit code.
19861
19862 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
19863
19864         * expression.cs: Special case the `null' object when trying to
19865         auto-compute the type, as anything can be explicitly converted to
19866         that. 
19867
19868         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
19869         spotting this Paolo.
19870
19871         (Expression.ImplicitNumericConversion): Perform comparissions of
19872         the type using the underlying type in the case of an enumeration
19873         rather than using the enumeration type for the compare.
19874
19875         Cope with the underlying == type case, which is not possible to
19876         catch before. 
19877
19878         (Expression.ConvertNumericExplicit): Perform comparissions of
19879         the type using the underlying type in the case of an enumeration
19880         rather than using the enumeration type for the compare.
19881
19882         * driver.cs: If the user does not supply an extension, assume .exe
19883
19884         * cs-parser.jay (if_statement): Rewrote so that we can track the
19885         location for the if statement.
19886
19887         * expression.cs (Binary.ConstantFold): Only concat strings when
19888         the operation is "+", not everything ;-)
19889
19890         * statement.cs (Statement.EmitBoolExpression): Take a location
19891         argument. 
19892         (If, While, Do): Track location.
19893
19894         * expression.cs (Binary.ResolveOperator): In the object + string
19895         case, I was missing a call to ConvertImplicit
19896
19897 2002-02-25  Ravi Pratap  <ravi@ximian.com>
19898
19899         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
19900         Location arguments. Ensure we use RootContext.LookupType to do our work
19901         and not try to do a direct Type.GetType and ModuleBuilder.GetType
19902
19903         * interface.cs (PopulateMethod): Handle the type of the parameter being
19904         null gracefully.
19905
19906         * expression.cs (Invocation.BetterFunction): Handle the case when we 
19907         have a params method with no fixed arguments and a call is made with no
19908         arguments.
19909
19910 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
19911
19912         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
19913         the verbatim-string-literal
19914
19915         * support.cs (InternalParameters.ParameterModifier): handle null
19916         fixed parameters.
19917         (InternalParameters.ParameterType): ditto.
19918
19919         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
19920         duplicating the name of the variable parameter.
19921         (GetParameterByName): Fix bug where we were not looking up array
19922         paramters if they were the only present (thanks Paolo!).
19923         (GetParameterInfo): We only have an empty set of types if both
19924         fixed and array are set to null.
19925         (GetParameterInfo-idx): Handle FixedParameter == null
19926
19927         * cs-parser.jay: Handle the case where there is no catch
19928         statements (missing null test).
19929
19930 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
19931
19932         * driver.cs (MainDriver): Be conservative on our command line
19933         handling.
19934
19935         Catch DirectoryNotFoundException when calling GetFiles.
19936
19937         (SplitPathAndPattern): Used to split the input specification into
19938         a path and a pattern that we can feed to Directory.GetFiles.
19939
19940 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
19941
19942         * statement.cs (Fixed): Implement the last case of the Fixed
19943         statement (string handling).
19944
19945         * expression.cs (StringPtr): New class used to return a char * to
19946         a string;  Used by the Fixed statement.
19947
19948         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
19949
19950         * expression.cs (Binary.ResolveOperator): Remove redundant
19951         MemberLookup pn parent type.
19952         Optimize union call, we do not need a union if the types are the same.
19953         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
19954         type.
19955
19956         Specialize the use of MemberLookup everywhere, instead of using
19957         the default settings. 
19958
19959         (StackAlloc): Implement stackalloc keyword.
19960
19961         * cs-parser.jay: Add rule to parse stackalloc.
19962
19963         * driver.cs: Handle /h, /help, /?
19964
19965         * expression.cs (MakeByteBlob): Removed the hacks we had in place
19966         before we supported unsafe code.
19967
19968         * makefile: add --unsafe to the self compilation of mcs.
19969
19970 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
19971
19972         * expression.cs (PointerArithmetic): New class that is used to
19973         perform pointer arithmetic.
19974         (Binary.Resolve): Handle pointer arithmetic
19975         Handle pointer comparission.
19976         (ArrayPtr): Utility expression class that is used to take the
19977         address of an array.
19978
19979         (ElementAccess): Implement array access for pointers
19980
19981         * statement.cs (Fixed): Implement fixed statement for arrays, we
19982         are missing one more case before we are done.
19983
19984         * expression.cs (Indirection): Implement EmitAssign and set the
19985         ExprClass to Variable.  This allows pointer dereferences to be
19986         treated as variables, and to have values assigned to them.
19987
19988         * ecore.cs (Expression.StoreFromPtr): New utility function to
19989         store values dereferencing.
19990
19991 2002-02-20  Ravi Pratap  <ravi@ximian.com>
19992
19993         * expression.cs (Binary.ResolveOperator): Ensure that we are
19994         not trying to operate on a void type - this fixes the reported
19995         bug.
19996
19997         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
19998         the parent implementation is sealed.
19999
20000         * ../errors/cs0239.cs : Add.
20001
20002         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
20003
20004         * typemanager.cs (unverifiable_code_type): Corresponds to 
20005         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
20006         which have unsafe code in them.
20007
20008         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
20009         unsafe context.
20010
20011 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
20012
20013         * cs-tokenizer.cs: Add support for @"litreal strings"
20014
20015         Make tokenizer accept pre-processor directives
20016         on any column (remove the old C-like limitation). 
20017
20018         * rootcontext.cs (EmitCode): Emit any global attributes.
20019         (AddGlobalAttributes): Used to keep track of assembly attributes. 
20020
20021         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
20022
20023         * cs-parser.jay: Add support for global attributes.  
20024
20025 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
20026
20027         * expression.cs (Indirection): New helper class.  Unary will
20028         create Indirection classes to be able to implement the
20029         IMemoryLocation interface on it.
20030
20031 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
20032
20033         * cs-parser.jay (fixed_statement): reference the right statement.
20034
20035         * statement.cs (Fixed.Emit): Finish implementing the fixed
20036         statement for the &x case.
20037
20038 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
20039
20040         * class.cs (Property.Define, Method.Define): Remove newslot when
20041         `implementing'.  
20042
20043         * modifiers.cs: My use of NewSlot when `Abstract' was set was
20044         wrong.  NewSlot should only be used if the `new' keyword is present.
20045
20046         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
20047         locating our system dir.  Sorry about this.
20048
20049 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20050
20051         * driver.cs (GetSystemDir): Compute correctly the location of our
20052         system assemblies.  I was using the compiler directory instead of
20053         the library directory.
20054
20055 2002-02-13  Ravi Pratap  <ravi@ximian.com>
20056
20057         * expression.cs (BetterFunction): Put back in what Miguel commented out
20058         since it is the correct fix. The problem is elsewhere ;-)
20059
20060         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
20061         parameters of the parms method are themselves compatible or not !
20062
20063         (StandardConversionExists): Fix very dangerous bug where we were forgetting
20064         to check that a class implements an interface before saying that an implicit
20065         conversion was allowed. Use ImplementsInterface to do the checking.
20066
20067 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20068
20069         * class.cs (Method.Define): Track whether we are an explicit
20070         implementation or not.  And only call DefineMethodOverride if we
20071         are an explicit implementation.
20072
20073         (Property.DefineMethod): Ditto.
20074
20075 2002-02-11  Ravi Pratap  <ravi@ximian.com>
20076
20077         * expression.cs (BetterFunction): Catch hideous bug which was
20078          preventing us from detecting ambiguous calls due to implicit casts i.e
20079         cs0121.
20080
20081 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
20082
20083         * support.cs (Pair): Remove un-needed method.  I figured why I was
20084         getting the error in cs-parser.jay, the variable in a foreach loop
20085         is readonly, and the compiler does not really treat this as a variable.
20086
20087         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
20088         instead of EQUALS in grammar.  
20089
20090         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
20091
20092         * expression.cs (Unary.DoResolve): Check whether the argument is
20093         managed or not.
20094
20095 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
20096
20097         * support.cs: Api for Pair to set a value.  Despite the fact that
20098         the variables are public the MS C# compiler refuses to compile
20099         code that accesses the field if the variable is part of a foreach
20100         statement. 
20101
20102         * statement.cs (Fixed): Begin implementation of the fixed
20103         statement.
20104
20105         (Block.AddVariable): Return the VariableInfo on success and null
20106         on failure instead of true/false. 
20107
20108         * cs-parser.jay (foreach): Catch errors on variables already
20109         defined (we were ignoring this value before) and properly unwind
20110         the block hierarchy
20111
20112         (fixed_statement): grammar for the fixed statement.
20113
20114 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
20115
20116         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
20117         pointer types to be incretemented.
20118
20119         (SizeOf): Implement.
20120
20121         * cs-parser.jay (pointer_member_access): Implement
20122         expr->IDENTIFIER production.
20123
20124         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
20125         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
20126         on safe contexts.
20127
20128         (Unary): Implement indirection.
20129
20130         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
20131         use in non-unsafe context).
20132
20133         (SimpleName.DoResolve): Check for pointers in field access on safe
20134         contexts. 
20135
20136         (Expression.LoadFromPtr): Factor the load-indirect code in this
20137         function.  This was duplicated in UnboxCast and ParameterReference
20138
20139 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
20140
20141         * expression.cs (ComposedCast): report an error if a pointer cast
20142         is used in a safe region.
20143
20144         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
20145         pointer type casts in unsafe context.
20146
20147         * codegen.cs (EmitContext): Set up IsUnsafe.
20148
20149         * cs-parser.jay (non_expression_type): Add productions for pointer
20150         casts. 
20151
20152         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
20153         code.  We should not use force into static mode if the method is
20154         not virtual.  Fixes bug in MIS
20155
20156         * statement.cs (Do.Emit, While.Emit, For.Emit,
20157         Statement.EmitBoolExpression): Add support to Do and While to
20158         propagate infinite loop as `I do return' semantics.
20159
20160         Improve the For case to also test for boolean constants.
20161
20162         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
20163         to the list of attributes we can add.
20164
20165         Remove `EmitContext' argument.
20166
20167         * class.cs (Method.Define): Apply parameter attributes.
20168         (Constructor.Define): Apply parameter attributes.
20169         (MethodCore.LabelParameters): Move here the core of labeling
20170         parameters. 
20171
20172         * support.cs (ReflectionParameters.ParameterModifier,
20173         InternalParameters.ParameterModifier): Use IsByRef on the type and
20174         only return the OUT bit for these parameters instead of in/out/ref
20175         flags.
20176
20177         This is because I miss-understood things.  The ParameterInfo.IsIn
20178         and IsOut represent whether the parameter has the [In] and [Out]
20179         attributes set.  
20180
20181 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
20182
20183         * ecore.cs (FieldExpr.Emit): Release temporaries.
20184
20185         * assign.cs (LocalTemporary.Release): new function.
20186
20187         * codegen.cs (EmitContext.GetTemporaryStorage,
20188         EmitContext.FreeTemporaryStorage): Rework the way we deal with
20189         temporary storage.  Now we can "put back" localbuilders when we
20190         are done with them
20191
20192 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
20193
20194         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
20195         need to make a copy of the variable to generate verifiable code.
20196
20197 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
20198
20199         * driver.cs: Compute dynamically the system directory.
20200
20201         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
20202         Slower, but more generally useful.  Used by the abstract
20203         registering implementation. 
20204
20205         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
20206         the rules for the special rule on Type/instances.  First check if
20207         we have the same name, and if so, try that special static path
20208         rather than the instance path.
20209
20210 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
20211
20212         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
20213         for, while and if.
20214
20215         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
20216         Enum, ValueType, Delegate or Array for non-corlib compiles.
20217
20218         * cs-tokenizer.cs: Catch long identifiers (645)
20219
20220         * typemanager.cs (IndexerPropetyName): Ravi never tested this
20221         piece of code.
20222
20223         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
20224         fix, we were returning too early, so we were not registering
20225         pending methods from abstract classes.
20226
20227         Do not register pending methods if the class is abstract.
20228
20229         * expression.cs (Conditional.DoResolve): Report circular implicit
20230         conversions when we neecd to compute it for conditional
20231         expressions. 
20232
20233         (Is.DoResolve): If the expression is always of the provided type,
20234         flag warning 183.  If the expression can not ever be of the
20235         provided type flag warning 184.
20236
20237         * class.cs: Catch 169 as well.
20238
20239         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
20240         read. 
20241
20242 2002-01-18  Nick Drochak  <ndrochak@gol.com>
20243
20244         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
20245
20246 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
20247
20248         * interface.cs: (PopulateMethod): Check for pointers being defined
20249         only if the unsafe context is active.
20250         (PopulateProperty): ditto.
20251         (PopulateIndexer): ditto.
20252
20253         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
20254         specified.  If pointers are present, make sure that they are
20255         present in an unsafe context.
20256         (Constructor, Constructor.Define): ditto.
20257         (Field, Field.Define): ditto.
20258         (Property, Property.Define): ditto.
20259         (Event, Event.Define): ditto.
20260
20261         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
20262         hashtable if there are classes or structs defined.
20263
20264         * expression.cs (LocalVariableReference.DoResolve): Simplify this
20265         code, as the constant resolution moved.
20266
20267         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
20268         the metadata, so we can flag error 133. 
20269
20270         * decl.cs (MemberCore.UnsafeOK): New function to test that a
20271         pointer is being declared in an unsafe context.
20272
20273 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
20274
20275         * modifiers.cs (Modifiers.Check): Require a Location argument.
20276         Report error 227 for Unsafe use.
20277
20278         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
20279
20280         * statement.cs (For.Emit): If the test is null, then report that
20281         we do `return', as we wont reach anything afterwards.
20282
20283         (Switch.SwitchGoverningType): Track the expression that matched
20284         the conversion.
20285
20286         * driver.cs: Allow negative numbers as an error code to flag.
20287
20288         * cs-parser.jay: Handle 1551.
20289
20290         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
20291
20292 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20293
20294         * cs-parser.jay: Report 1518 (type declaration can only contain
20295         class, struct, interface, enum or delegate)
20296
20297         (switch_label): Report 1523 (keywords `case' or `default' must
20298         preced code)
20299
20300         (opt_switch_sections): Report 1522 (empty switch)
20301
20302         * driver.cs: Report 1515 (response file specified multiple times)
20303         Report 1516 (Source file specified multiple times).
20304
20305         * expression.cs (Argument.Resolve): Signal 1510
20306
20307         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
20308         access not allowed in static code)
20309
20310 2002-01-11  Ravi Pratap  <ravi@ximian.com>
20311
20312         * typemanager.cs (IsPointerType): Utility method which we are going
20313         to need a lot.
20314
20315         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
20316         the object type, so we take care of that.
20317
20318         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
20319
20320         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
20321         added to non-params parameters :-)
20322
20323         * typemanager.cs (CSharpName): Include 'void' type too. 
20324
20325         (void_ptr_type): Include in the set of core types.
20326
20327         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
20328         duplicating code.
20329
20330         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
20331         an unsafe context.
20332
20333         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
20334         completely forgotten about it.
20335
20336 2002-01-10  Ravi Pratap  <ravi@ximian.com>
20337
20338         * cs-parser.jay (pointer_type): Add. This begins our implementation
20339         of parsing rules for unsafe code.
20340
20341         (unsafe_statement): Implement.
20342
20343         (embedded_statement): Modify to include the above.
20344
20345         * statement.cs (Unsafe): Implement new class for unsafe blocks.
20346
20347         * codegen.cs (EmitContext.InUnsafe): Add. This determines
20348         if the current context is an unsafe one.
20349
20350         * cs-parser.jay (local_variable_pointer_type): Since local variable types
20351         are handled differently, we need separate rules for them.
20352
20353         (local_variable_declaration): Update to use local_variable_pointer_type
20354         to allow variable declarations of unmanaged pointer types.
20355
20356         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
20357         in unsafe contexts.
20358
20359         * ../errors/cs0214.cs : Add.
20360
20361 2002-01-16  Nick Drochak  <ndrochak@gol.com>
20362
20363         * makefile: remove 'response' file when cleaning.
20364
20365 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20366
20367         * cs-parser.jay: Report 1524.
20368
20369 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
20370
20371         * typemanager.cs (RegisterMethod): drop checking if we have
20372         registered this from here
20373
20374 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
20375
20376         * class.cs (Method.EmitDestructor): Implement calling our base
20377         destructor. 
20378
20379         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20380         value of InFinally.
20381
20382         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20383         this routine and will wrap the call in a try/catch block.  Deal
20384         with the case.
20385
20386 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
20387
20388         * ecore.cs (Expression.MemberLookup): instead of taking a
20389         parameter `same_type' that was used to tell whether we could
20390         access private members we compute our containing type from the
20391         EmitContext.
20392
20393         (FieldExpr): Added partial support for volatile fields.  This does
20394         not work for volatile fields exposed from assemblies, as I can not
20395         figure out how to extract the modreq from it.
20396
20397         Updated all the source files to use this.
20398
20399         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20400         because it is referenced by MemberLookup very often. 
20401
20402 2002-01-09  Ravi Pratap  <ravi@ximian.com>
20403
20404         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20405         TypeBuilder.GetCustomAttributes to retrieve what we need.
20406
20407         Get rid of redundant default_member_attr_type as this is the same as
20408         default_member_type which already exists.
20409
20410         * interface.cs, attribute.cs : Update accordingly.
20411
20412 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
20413
20414         * typemanager.cs: Enable IndexerPropertyName again.  It does not
20415         work for TYpeBuilders though.  Ravi, can you please fix this?
20416
20417         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20418
20419         * expression.cs (Argument.Emit): Handle the case of ref objects
20420         being passed to ref functions;  
20421
20422         (ParameterReference.EmitLoad): Loads the content of the pointer
20423         without dereferencing.
20424
20425 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20426
20427         * cs-tokenizer.cs: Implemented the pre-processing expressions.
20428
20429 2002-01-08  Ravi Pratap  <ravi@ximian.com>
20430
20431         * class.cs (Indexer.DefineMethod): Incorporate the interface
20432         type in the name of the method if we are doing explicit interface
20433         implementation.
20434
20435         * expression.cs (ConversionExists): Remove as it is completely obsolete.
20436
20437         (BetterConversion): Fix extremely trivial bug where we were referring to
20438         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
20439         again !
20440
20441         * ../errors/bug16.cs : Add although we have fixed it.
20442
20443 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20444
20445         * expression.cs (BaseIndexer): Begin implementation.
20446
20447         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
20448
20449         * cs-parser.jay (indexer_declarator): Use qualified_identifier
20450         production directly to remove a shift/reduce, and implement
20451         explicit interface implementation.
20452
20453         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
20454         after a floating point suffix.
20455
20456         * expression.cs (DoNumericPromotions): Improved the conversion for
20457         uint/uint.  If we have a constant, we avoid doing a typecast to a
20458         larger type.
20459
20460         * class.cs (Indexer): Implement explicit interface implementation
20461         for indexers.
20462
20463 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20464
20465         * class.cs: make the default instance constructor public and hidebysig.
20466
20467 2001-01-03  Ravi Pratap  <ravi@ximian.com>
20468
20469         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20470         so we can call it from elsewhere.
20471
20472         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20473         we emit it internally if the class has a defined indexer; otherwise the user
20474         emits it by decorating the class definition with the DefaultMemberAttribute.
20475
20476         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20477         attribute is not used on a type which defines an indexer.
20478
20479         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20480         character when we skip whitespace.
20481
20482         * ../errors/cs0646.cs : Add.
20483
20484 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
20485
20486         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20487         again. 
20488
20489         * makefile: Add practical target `mcs3.exe' which builds the third
20490         generation compiler. 
20491
20492         * expression.cs (New): Fix structures constructor calling.
20493
20494         * class.cs (Property, Method, Indexer): Emit Final flag on the
20495         method if we are an interface implementation and we are not
20496         abstract. 
20497
20498         * ecore.cs (PropertyExpr): New public field `IsBase', tells
20499         whether this property is referencing a `base' method.
20500
20501         * expression.cs (Invocation.EmitCall): take an extra argument:
20502         is_base, this is used to determine whether the `call' or
20503         `callvirt' opcode should be used.
20504
20505
20506         * delegate.cs: update EmitCall.
20507
20508         * class.cs (Method.Define): Set NewSlot for the cases where we are
20509         not implementing an interface method.
20510
20511         (Property.Define): ditto.
20512
20513 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
20514
20515         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20516         'r'.  Allows mcs to parse itself fully.
20517
20518 2002-01-02  Ravi Pratap  <ravi@ximian.com>
20519
20520         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20521         of the number of initializers that require the InitializeArray method.
20522
20523         (CheckIndices): Store the Expression in all cases - not the plain value. Also
20524         update the above field where necessary.
20525
20526         (MakeByteBlob): Update accordingly.
20527
20528         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
20529         greater than 2.
20530
20531         (EmitDynamicInitializers): Update in accordance with the new optimization.
20532
20533         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20534         same OpCode applies.
20535
20536         * cs-parser.jay : Fix some glaring errors I introduced.
20537
20538 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
20539
20540         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20541         so that we can check for name clashes there too.
20542
20543         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20544         for interface indexers.
20545
20546         * interfaces.cs (Define): Emit the default member attribute.
20547
20548         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20549         variable was being referred to while setting the value ;-)
20550
20551 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
20552
20553         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20554         byte-by-byte information when we know the data is zero.
20555
20556         Make the block always a multiple of 4, because
20557         DefineInitializedData has a bug.
20558
20559         * assign.cs: Fix, we should assign from the temporary, not from
20560         the source. 
20561
20562         * expression.cs (MakeByteBlob): Fix my incorrect code.
20563
20564 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
20565
20566         * typemanager.cs (EnumToUnderlying): This function is used to get
20567         the underlying type from an enumeration, because it does not
20568         always work. 
20569
20570         * constant.cs: Use the I4_S form for values between -128 and 127.
20571
20572         * statement.cs (Block.LookupLabel): Looks up a label.
20573         (Block): Drop support for labeled blocks.
20574
20575         (LabeledStatement): New kind of statement that represents a label
20576         only.
20577
20578         (Goto): Finally implement this bad boy.
20579
20580         * cs-parser.jay: Update to reflect new mechanism to implement
20581         labels.
20582
20583 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
20584
20585         * codegen.cs (EmitContext.This): a codegen property that keeps the
20586         a single instance of this instead of creating many different this
20587         instances. 
20588
20589         * delegate.cs (Delegate.DoResolve): Update to use the property;
20590
20591         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
20592
20593         * expression.cs (BaseAccess.DoResolve): Ditto.
20594
20595 2001-12-29  Ravi Pratap  <ravi@ximian.com>
20596
20597         * typemanager.cs (methodimpl_attr_type): Add to hold the type
20598         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20599
20600         (InitCoreTypes): Update accordingly.
20601
20602         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20603         so we can quickly store the state.
20604
20605         (ApplyAttributes): Set the correct implementation flags
20606         for InternalCall methods.
20607
20608 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
20609
20610         * expression.cs (EmitCall): if a method is not virtual, then do
20611         not use callvirt on it.
20612
20613         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20614         user defined stuff) requires the use of stobj, which takes an
20615         address on the stack instead of an array and an index.  So emit
20616         the Ldelema operation for it.
20617
20618         (EmitStoreOpcode): Use stobj for valuetypes.
20619
20620         (UnaryMutator.EmitCode): Use the right 1 value depending on
20621         whether we are dealing with int64/uint64, float or doubles.
20622
20623         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20624         constructors that I implemented last night.
20625
20626         (Constructor.IsDefault): Fix to work properly for static
20627         constructors.
20628
20629         * cs-parser.jay (CheckDef): report method signature errors.
20630         Update error number 103 to be 132.
20631
20632         * decl.cs: New AdditionResult enumeration value: MethodExists.
20633         Although we do this check for methods later on in the semantic
20634         analysis, catching repeated default constructors is so easy that
20635         we catch these here. 
20636
20637         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20638         promotions code.
20639
20640         (ParameterReference.EmitAssign, Emit): handle
20641         bools as bytes.
20642
20643         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20644         (ArrayAccess.EmitStoreOpcode): ditto.
20645
20646         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20647
20648         * expression.cs (MakeByteBlob): Complete all the missing types
20649         (uint, short, ushort, byte, sbyte)
20650
20651         * class.cs: Only init instance field initializers on instance
20652         constructors. 
20653
20654         Rename `constructors' to instance_constructors. 
20655
20656         (TypeContainer.AddConstructor): Only add constructors to the list
20657         if it is not static.
20658
20659         Make sure that we handle default_static_constructor independently
20660         everywhere where we handle instance_constructors
20661
20662 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
20663
20664         * class.cs: Do not lookup or create a base initializer for a
20665         static constructor.
20666
20667         (ConstructorInitializer.Resolve): use the proper type to lookup
20668         for constructors.
20669
20670         * cs-parser.jay: Report error 1585 (modifiers between type and name).
20671
20672         * enum.cs, interface.cs: Remove CloseType, this is taken care by
20673         in DeclSpace. 
20674
20675         * decl.cs: CloseType is now an virtual method, the default
20676         implementation just closes this type.
20677
20678 2001-12-28  Ravi Pratap  <ravi@ximian.com>
20679
20680         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
20681         to PreserveSig by default. Also emit HideBySig on such methods.
20682
20683         Basically, set the defaults to standard values.
20684
20685         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
20686         argument, if candidate is better, it can't be worse than the best !
20687
20688         (Invocation): Re-write bits to differentiate between methods being
20689         applicable in their expanded form and their normal form - for params
20690         methods of course.
20691
20692         Get rid of use_standard everywhere as only standard conversions are allowed
20693         in overload resolution. 
20694
20695         More spec conformance.
20696
20697 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20698
20699         * driver.cs: Add --timestamp, to see where the compiler spends
20700         most of its time.
20701
20702         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
20703         `this' in static code.
20704
20705         (SimpleName.DoResolve): Implement in terms of a helper function
20706         that allows static-references to be passed upstream to
20707         MemberAccess.
20708
20709         (Expression.ResolveWithSimpleName): Resolve specially simple
20710         names when called by MemberAccess to implement the special
20711         semantics. 
20712
20713         (Expression.ImplicitReferenceConversion): Handle conversions from
20714         Null to reference types before others, as Null's type is
20715         System.Object. 
20716
20717         * expression.cs (Invocation.EmitCall): Handle the special case of
20718         calling methods declared on a reference type from a ValueType
20719         (Base classes System.Object and System.Enum)
20720
20721         (MemberAccess.Resolve): Only perform lookups on Enumerations if
20722         the left hand side is a TypeExpr, not on every enumeration. 
20723
20724         (Binary.Resolve): If types are reference types, then do a cast to
20725         object on operators != and == of both arguments.
20726
20727         * typemanager.cs (FindMembers): Extract instance and static
20728         members if requested.
20729
20730         * interface.cs (PopulateProperty): Use void_type instead of null
20731         as the return type for the setter method.
20732
20733         (PopulateIndexer): ditto.
20734
20735 2001-12-27  Ravi Pratap  <ravi@ximian.com>
20736
20737         * support.cs (ReflectionParameters): Fix minor bug where we
20738         were examining the wrong parameter for the ParamArray attribute.
20739
20740         Cope with requests for the type of the parameter at position
20741         greater than the params parameter's. We now return the element
20742         type of the params array as that makes more sense.
20743
20744         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
20745         accordingly as we no longer have to extract the element type
20746         ourselves.
20747
20748         (Invocation.OverloadResolve): Update.
20749
20750 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20751
20752         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
20753         against IEnumerator, test whether the return value is a descendant
20754         of the IEnumerator interface.
20755
20756         * class.cs (Indexer.Define): Use an auxiliary method to implement
20757         the other bits of the method definition.  Begin support for
20758         explicit interface implementation.
20759
20760         (Property.DefineMethod): Use TypeManager.void_type instead of null
20761         for an empty return value.
20762
20763 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
20764
20765         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
20766         dealing with a FieldExpr which is composed of a FieldBuilder, in
20767         the code path we did extract the constant, but we should have
20768         obtained the underlying value to be able to cast it (otherwise we
20769         end up in an infinite loop, this is what Ravi was running into).
20770
20771         (ArrayCreation.UpdateIndices): Arrays might be empty.
20772
20773         (MemberAccess.ResolveMemberAccess): Add support for section
20774         14.5.4.1 that deals with the special case of E.I when E is a type
20775         and something else, that I can be a reference to a static member.
20776
20777         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
20778         handle a particular array type to create byte blobs, it is just
20779         something we dont generate byteblobs for.
20780
20781         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
20782         arguments. 
20783
20784         * location.cs (Push): remove the key from the hashtable that we
20785         are about to add.   This happens for empty files.
20786
20787         * driver.cs: Dispose files after we have parsed them.
20788
20789         (tokenize): new function that only runs the tokenizer on its
20790         input, for speed testing.
20791
20792 2001-12-26  Ravi Pratap  <ravi@ximian.com>
20793
20794         * class.cs (Event.Define): Define the private field only if there
20795         are no accessors defined.
20796
20797         * expression.cs (ResolveMemberAccess): If there is no associated
20798         field with the event, that means we have an event defined with its
20799         own accessors and we should flag error cs0070 since transforming
20800         ourselves into a field is not valid in that case.
20801
20802         * ecore.cs (SimpleName.DoResolve): Same as above.
20803
20804         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
20805         and charset to sane values.
20806
20807 2001-12-25  Ravi Pratap  <ravi@ximian.com>
20808
20809         * assign.cs (DoResolve): Perform check on events only if they 
20810         are being accessed outside the declaring type.
20811
20812         * cs-parser.jay (event_declarations): Update rules to correctly
20813         set the type of the implicit parameter etc.
20814
20815         (add_accessor, remove_accessor): Set current local parameters.
20816
20817         * expression.cs (Binary): For delegate addition and subtraction,
20818         cast the return value from the method into the appropriate delegate
20819         type.
20820
20821 2001-12-24  Ravi Pratap  <ravi@ximian.com>
20822
20823         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
20824         of these as the workaround is unnecessary.
20825
20826         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
20827         delegate data - none of that is needed at all.
20828
20829         Re-write bits to extract the instance expression and the delegate method
20830         correctly.
20831
20832         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
20833         on delegates too.
20834
20835         * attribute.cs (ApplyAttributes): New method to take care of common tasks
20836         of attaching attributes instead of duplicating code everywhere.
20837
20838         * everywhere : Update code to do attribute emission using the above method.
20839
20840 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
20841
20842         * expression.cs (IsParamsMethodApplicable): if there are not
20843         parameters, return immediately.
20844
20845         * ecore.cs: The 0 literal can be implicity converted to an enum
20846         type. 
20847
20848         (SimpleName.DoResolve): First lookup the type, then lookup the
20849         members. 
20850
20851         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
20852         want to get its address.  If the InstanceExpression is not
20853         addressable, store the result in a temporary variable, then get
20854         the address of it.
20855
20856         * codegen.cs: Only display 219 errors on warning level or above. 
20857
20858         * expression.cs (ArrayAccess): Make it implement the
20859         IMemoryLocation interface.
20860
20861         (Binary.DoResolve): handle the operator == (object a, object b)
20862         and operator != (object a, object b) without incurring into a
20863         BoxedCast (because 5 != o should never be performed).
20864
20865         Handle binary enumerator operators.
20866
20867         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
20868         value type, otherwise use Ldelem_ref.
20869
20870         Use precomputed names;
20871
20872         (AddressOf): Implement address of
20873
20874         * cs-parser.jay (labeled_statement): Fix recursive block
20875         addition by reworking the production.
20876
20877         * expression.cs (New.DoEmit): New has a special case:
20878                 
20879                  If we are dealing with a ValueType, we have a few
20880                  situations to deal with:
20881                 
20882                     * The target of New is a ValueType variable, that is
20883                       easy, we just pass this as the variable reference
20884                 
20885                     * The target of New is being passed as an argument,
20886                       to a boxing operation or a function that takes a
20887                       ValueType.
20888                 
20889                       In this case, we need to create a temporary variable
20890                       that is the argument of New.
20891
20892
20893 2001-12-23  Ravi Pratap  <ravi@ximian.com>
20894
20895         * rootcontext.cs (LookupType): Check that current_type is not null before
20896         going about looking at nested types.
20897
20898         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
20899         not implement the IAssignMethod interface any more.
20900
20901         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
20902         where we tranform them into FieldExprs if they are being resolved from within
20903         the declaring type.
20904
20905         * ecore.cs (SimpleName.DoResolve): Do the same here.
20906
20907         * assign.cs (DoResolve, Emit): Clean up code considerably. 
20908
20909         * ../errors/bug10.cs : Add.
20910
20911         * ../errors/cs0070.cs : Add.
20912
20913         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
20914
20915         * assign.cs : Get rid of EventIsLocal everywhere.
20916
20917 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
20918
20919         * ecore.cs (ConvertIntLiteral): finished the implementation.
20920
20921         * statement.cs (SwitchLabel): Convert the value we are using as a
20922         key before looking up the table.
20923
20924 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
20925
20926         * codegen.cs (EmitTopBlock): Require a Location argument now.
20927
20928         * cs-parser.jay (constructor_declarator): We need to setup
20929         current_local_parameters before we parse the
20930         opt_constructor_initializer, to allow the variables to be bound
20931         to the constructor arguments.
20932
20933         * rootcontext.cs (LookupType): First lookup nested classes in our
20934         class and our parents before we go looking outside our class.
20935
20936         * expression.cs (ConstantFold): Extract/debox the values at the
20937         beginnning. 
20938
20939         * rootcontext.cs (EmitCode): Resolve the constants first before we
20940         resolve the types.  This is not really needed, but it helps debugging.
20941
20942         * statement.cs: report location.
20943
20944         * cs-parser.jay: pass location to throw statement.
20945
20946         * driver.cs: Small bug fix.
20947
20948         * report.cs: Updated format to be 4-zero filled digits.
20949
20950 2001-12-22  Ravi Pratap  <ravi@ximian.com>
20951
20952         * expression.cs (CheckIndices): Fix minor bug where the wrong
20953         variable was being referred to ;-)
20954
20955         (DoEmit): Do not call EmitStaticInitializers when the 
20956         underlying type is System.Object.
20957
20958 2001-12-21  Ravi Pratap  <ravi@ximian.com>
20959
20960         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
20961         and do the usual workaround for SRE.
20962
20963         * class.cs (MyEventBuilder.EventType): New member to get at the type
20964         of the event, quickly.
20965
20966         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
20967
20968         * assign.cs (Assign.DoResolve): Handle the case when the target
20969         is an EventExpr and perform the necessary checks.
20970
20971         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
20972         interface.
20973
20974         (SimpleName.MemberStaticCheck): Include check for EventExpr.
20975
20976         (EventExpr): Set the type in the constructor itself since we 
20977         are meant to be born fully resolved.
20978
20979         (EventExpr.Define): Revert code I wrote earlier.
20980                 
20981         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
20982         instance expression is null. The instance expression is a This in that case
20983         or a null, depending on whether it is a static method or not.
20984
20985         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
20986         refers to more than one method.
20987
20988         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
20989         and accordingly flag errors.
20990
20991 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
20992
20993         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
20994
20995 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
20996
20997         * location.cs (ToString): Provide useful rutine.
20998
20999 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21000
21001         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
21002         objects, return the actual integral boxed.
21003
21004         * statement.cs (SwitchLabel): define an ILLabel for each
21005         SwitchLabel. 
21006
21007         (Switch.CheckSwitch): If the value is a Literal, extract
21008         the underlying literal.
21009
21010         Also in the unused hashtable we had, add the SwitchLabel so we can
21011         quickly look this value up.
21012
21013         * constant.cs: Implement a bunch of new constants.  Rewrite
21014         Literal based on this.  Made changes everywhere to adapt to this.
21015
21016         * expression.cs (Expression.MakeByteBlob): Optimize routine by
21017         dereferencing array only once, and also copes with enumrations.
21018
21019         bytes are two bytes wide, not one.
21020
21021         (Cast): Perform constant conversions.
21022
21023         * ecore.cs (TryImplicitIntConversion): Return literals instead of
21024         wrappers to the literals here.
21025
21026         * expression.cs (DoNumericPromotions): long literals can converted
21027         to ulong implicity (this is taken care of elsewhere, but I was
21028         missing this spot).
21029
21030         * ecore.cs (Expression.Literalize): Make the return type Literal,
21031         to improve type checking.
21032
21033         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
21034
21035 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21036
21037         * literal.cs: Revert code from ravi that checked the bounds.  The
21038         bounds are sane by the definition of the type itself. 
21039
21040         * typemanager.cs: Fix implementation of ImplementsInterface.  We
21041         need to actually look up in our parent hierarchy for interfaces
21042         implemented. 
21043
21044         * const.cs: Use the underlying type for enumerations
21045
21046         * delegate.cs: Compute the basename for the delegate creation,
21047         that should fix the delegate test case, and restore the correct
21048         Type Lookup semantics in rootcontext
21049
21050         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
21051         referencing a nested type with the Reflection API is using the "+"
21052         sign. 
21053
21054         * cs-parser.jay: Do not require EOF token at the end.
21055
21056 2001-12-20  Ravi Pratap  <ravi@ximian.com>
21057
21058         * rootcontext.cs (LookupType): Concatenate type names with
21059         a '.' instead of a '+' The test suite passes again.
21060
21061         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
21062         field of the enumeration.
21063
21064         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
21065         the case when the member is an EventExpr.
21066
21067         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
21068         static has an associated instance expression.
21069
21070         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
21071
21072         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
21073
21074         * class.cs (Event.Define): Register event and perform appropriate checks
21075         for error #111.
21076
21077         We define the Add and Remove methods even if the use provides none because
21078         in that case, we provide default implementations ourselves.
21079
21080         Define a private field of the type of the event. This is done by the CSC compiler
21081         and we should be doing it too ;-)
21082
21083         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
21084         More methods we use in code we generate.
21085
21086         (multicast_delegate_type, delegate_type): Two separate types since the distinction
21087         is important.
21088
21089         (InitCoreTypes): Update accordingly for the above.
21090
21091         * class.cs (Event.Emit): Generate code for default accessors that we provide
21092
21093         (EmitDefaultMethod): Do the job in the above.
21094
21095         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
21096         appropriate place.
21097
21098 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21099
21100         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
21101         builders even if we were missing one.
21102
21103         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
21104         pass the Basename as our class name instead of the Name.  The
21105         basename will be correctly composed for us.
21106
21107         * parameter.cs (Paramters): Now takes a Location argument.
21108
21109         * decl.cs (DeclSpace.LookupType): Removed convenience function and
21110         make all the code call directly LookupType in RootContext and take
21111         this chance to pass the Location information everywhere.
21112
21113         * Everywhere: pass Location information.
21114
21115 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
21116
21117         * class.cs (Constructor.Define): Updated way of detecting the
21118         length of the parameters.
21119
21120         (TypeContainer.DefineType): Use basename as the type name for
21121         nested types.
21122
21123         (TypeContainer.Define): Do not recursively define types here, as
21124         definition is taken care in order by the RootContext.
21125
21126         * tree.cs: Keep track of namespaces in a per-file basis.
21127
21128         * parameter.cs (Parameter.ComputeSignature): Update to use
21129         DeclSpace. 
21130
21131         (Parameters.GetSignature): ditto.
21132
21133         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
21134         instead of a TypeContainer.
21135
21136         (Interface.SemanticAnalysis): Use `this' instead of our parent to
21137         resolve names.  Because we need to be resolve in our context, not
21138         our parents.
21139
21140         * driver.cs: Implement response files.
21141
21142         * class.cs (TypeContainer.DefineType): If we are defined, do not
21143         redefine ourselves.
21144
21145         (Event.Emit): Emit the code for add/remove handlers.
21146         (Event.Define): Save the MethodBuilders for add/remove.
21147
21148         * typemanager.cs: Use pair here too.
21149
21150         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
21151         DictionaryEntry requires the first argument to be non-null.  
21152
21153         (enum_declaration): Compute full name for registering the
21154         enumeration.
21155
21156         (delegate_declaration): Instead of using
21157         formal_parameter_list, use opt_formal_parameter_list as the list
21158         can be empty.
21159
21160         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
21161         (EventParsing): New property that controls whether `add' and
21162         `remove' are returned as tokens or identifiers (for events);
21163
21164 2001-12-19  Ravi Pratap  <ravi@ximian.com>
21165
21166         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
21167         use MyEventBuilder only and let it wrap the real builder for us.
21168
21169         (MyEventBuilder): Revamp constructor etc.
21170
21171         Implement all operations that we perform on EventBuilder in precisely the same
21172         way here too.
21173
21174         (FindMembers): Update to use the EventBuilder member.
21175
21176         (Event.Emit): Update accordingly.
21177
21178 2001-12-18  Ravi Pratap  <ravi@ximian.com>
21179
21180         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
21181         by calling the appropriate methods.
21182
21183         (GetCustomAttributes): Make stubs as they cannot possibly do anything
21184         useful.
21185
21186         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
21187
21188 2001-12-17  Ravi Pratap  <ravi@ximian.com>
21189
21190         * delegate.cs (Delegate.Populate): Check that the return type
21191         and various parameters types are indeed accessible.
21192
21193         * class.cs (Constructor.Define): Same here.
21194
21195         (Field.Define): Ditto.
21196
21197         (Event.Define): Ditto.
21198
21199         (Operator.Define): Check that the underlying Method defined itself
21200         correctly - so it's MethodBuilder should not be null.
21201
21202         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
21203         expression happens to be null.
21204
21205         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
21206         members but as of now we don't seem to be able to do anything really useful with it.
21207
21208         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
21209         not the EventBuilder.
21210
21211 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
21212
21213         * cs-tokenizer.cs: Add support for defines.
21214         Add support for #if, #elif, #else, #endif
21215
21216         (eval_var): evaluates a variable.
21217         (eval): stubbed for evaluating functions.
21218
21219         * cs-parser.jay: Pass the defines information
21220
21221         * driver.cs: Add --define command line option.
21222
21223         * decl.cs: Move MemberCore here.
21224
21225         Make it the base class for DeclSpace.  This allows us to catch and
21226         report 108 and 109 for everything now.
21227
21228         * class.cs (TypeContainer.Define): Extract all the members
21229         before populating and emit the warning 108 (new keyword required
21230         to override) instead of having each member implement this.
21231
21232         (MemberCore.Define): New abstract method, we will be using this in
21233         the warning reporting engine in Populate.
21234
21235         (Operator.Define): Adjust to new MemberCore protocol. 
21236
21237         * const.cs (Const): This does not derive from Expression, it is a
21238         temporary object we use to create fields, it is a MemberCore. 
21239
21240         * class.cs (Method.Define): Allow the entry point to be in a
21241         specific class.
21242
21243         * driver.cs: Rewrite the argument handler to clean it up a bit.
21244
21245         * rootcontext.cs: Made it just an auxiliary namespace feature by
21246         making everything static.
21247
21248         * driver.cs: Adapt code to use RootContext type name instead of
21249         instance variable.
21250
21251         * delegate.cs: Remove RootContext argument.
21252
21253         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
21254         argument. 
21255
21256         * class.cs (Event.Define): The lookup can fail.
21257
21258         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
21259
21260         * expression.cs: Resolve the this instance before invoking the code.
21261
21262 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
21263
21264         * cs-parser.jay: Add a production in element_access that allows
21265         the thing to become a "type" reference.  This way we can parse
21266         things like "(string [])" as a type.
21267
21268         Note that this still does not handle the more complex rules of
21269         casts. 
21270
21271
21272         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
21273
21274         * ecore.cs: (CopyNewMethods): new utility function used to
21275         assemble the list of methods from running FindMembers.
21276
21277         (MemberLookup): Rework FindMembers so that 
21278
21279 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
21280
21281         * class.cs (TypeContainer): Remove Delegates who fail to be
21282         defined.
21283
21284         * delegate.cs (Populate): Verify that we dont get null return
21285         values.   TODO: Check for AsAccessible.
21286
21287         * cs-parser.jay: Use basename to emit error 574 (destructor should
21288         have the same name as container class), not the full name.
21289
21290         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
21291         possible representation.  
21292
21293         Also implements integer type suffixes U and L.
21294
21295 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
21296
21297         * expression.cs (ArrayCreation.DoResolve): We need to do the
21298         argument resolution *always*.
21299
21300         * decl.cs: Make this hold the namespace.  Hold the root context as
21301         well.
21302         (LookupType): Move here.
21303
21304         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
21305
21306         * location.cs (Row, Name): Fixed the code, it was always returning
21307         references to the first file.
21308
21309         * interface.cs: Register properties defined through interfaces.
21310
21311         * driver.cs: Add support for globbing on the command line
21312
21313         * class.cs (Field): Make it derive from MemberCore as well.
21314         (Event): ditto.
21315
21316 2001-12-15  Ravi Pratap  <ravi@ximian.com>
21317
21318         * class.cs (Event::Define): Check that the type of the event is a delegate
21319         type else flag error #66.
21320
21321         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
21322         same.
21323
21324         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
21325         values of EntryPoint, CharSet etc etc.
21326
21327         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
21328
21329         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
21330         be null and we should ignore this. I am not sure if this is really clean. Apparently,
21331         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
21332         which needs this to do its work.
21333
21334         * ../errors/cs0066.cs : Add.
21335
21336 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
21337
21338         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
21339         helper functions.
21340
21341         * class.cs: (MethodSignature.MethodSignature): Removed hack that
21342         clears out the parameters field.
21343         (MemberSignatureCompare): Cleanup
21344
21345         (MemberCore): New base class used to share code between MethodCore
21346         and Property.
21347
21348         (RegisterRequiredImplementations) BindingFlags.Public requires
21349         either BindingFlags.Instace or Static.  Use instance here.
21350
21351         (Property): Refactored code to cope better with the full spec.
21352
21353         * parameter.cs (GetParameterInfo): Return an empty array instead
21354         of null on error.
21355
21356         * class.cs (Property): Abstract or extern properties have no bodies.
21357
21358         * parameter.cs (GetParameterInfo): return a zero-sized array.
21359
21360         * class.cs (TypeContainer.MethodModifiersValid): Move all the
21361         method modifier validation to the typecontainer so we can reuse
21362         this on properties.
21363
21364         (MethodCore.ParameterTypes): return an empty sized array of types.
21365
21366         (Property.Define): Test property modifier validity.
21367
21368         Add tests for sealed/override too.
21369
21370         (Method.Emit): abstract or extern methods have no bodies.
21371
21372 2001-12-14  Ravi Pratap  <ravi@ximian.com>
21373
21374         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21375         thing.
21376
21377         (Method::Define, ::Emit): Modify accordingly.
21378
21379         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21380
21381         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21382
21383         * makefile: Pass in /unsafe.
21384
21385 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
21386
21387         * class.cs (MakeKey): Kill routine.
21388
21389         * class.cs (TypeContainer.Define): Correctly define explicit
21390         method implementations (they require the full interface name plus
21391         the method name).
21392
21393         * typemanager.cs: Deply the PtrHashtable here and stop using the
21394         lame keys.  Things work so much better.
21395
21396         This of course broke everyone who depended on `RegisterMethod' to
21397         do the `test for existance' test.  This has to be done elsewhere.
21398
21399         * support.cs (PtrHashtable): A hashtable that avoid comparing with
21400         the object stupid Equals method (because, that like fails all over
21401         the place).  We still do not use it.
21402
21403         * class.cs (TypeContainer.SetRequiredInterface,
21404         TypeContainer.RequireMethods): Killed these two routines and moved
21405         all the functionality to RegisterRequiredImplementations.
21406
21407         (TypeContainer.RegisterRequiredImplementations): This routine now
21408         registers all the implementations required in an array for the
21409         interfaces and abstract methods.  We use an array of structures
21410         which can be computed ahead of time to reduce memory usage and we
21411         also assume that lookups are cheap as most classes will not
21412         implement too many interfaces.
21413
21414         We also avoid creating too many MethodSignatures.
21415
21416         (TypeContainer.IsInterfaceMethod): Update and optionally does not
21417         clear the "pending" bit if we find that there are problems with
21418         the declaration.
21419
21420         (TypeContainer.VerifyPendingMethods): Update to report errors of
21421         methods that look like implementations but are not.
21422
21423         (TypeContainer.Define): Add support for explicit interface method
21424         implementation. 
21425
21426 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
21427
21428         * typemanager.cs: Keep track of the parameters here instead of
21429         being a feature of the TypeContainer.
21430
21431         * class.cs: Drop the registration of parameters here, as
21432         InterfaceMethods are also interface declarations.
21433
21434         * delegate.cs: Register methods with the TypeManager not only with
21435         the TypeContainer.  This code was buggy.
21436
21437         * interface.cs: Full registation here.
21438
21439 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
21440
21441         * expression.cs: Remove reducer for binary expressions, it can not
21442         be done this way.
21443
21444         * const.cs: Put here the code that used to go into constant.cs
21445
21446         * constant.cs: Put here the code for constants, this is a new base
21447         class for Literals.
21448
21449         * literal.cs: Make Literal derive from Constant.
21450
21451 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
21452
21453         * statement.cs (Return.Emit): Report error 157 if the user
21454         attempts to return from a finally block.
21455
21456         (Return.Emit): Instead of emitting a return, jump to the end of
21457         the function.
21458
21459         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21460         LocalBuilder to store the result of the function.  ReturnLabel is
21461         the target where we jump.
21462
21463
21464 2001-12-09  Radek Doulik  <rodo@ximian.com>
21465
21466         * cs-parser.jay: remember alias in current namespace
21467
21468         * ecore.cs (SimpleName::DoResolve): use aliases for types or
21469         namespaces
21470
21471         * class.cs (LookupAlias): lookup alias in my_namespace
21472
21473         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21474         aliases hashtable
21475         (LookupAlias): lookup alias in this and if needed in parent
21476         namespaces
21477
21478 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
21479
21480         * support.cs: 
21481
21482         * rootcontext.cs: (ModuleBuilder) Made static, first step into
21483         making things static.  I need this to avoid passing the
21484         TypeContainer when calling ParameterType.
21485
21486         * support.cs (InternalParameters.ParameterType): Remove ugly hack
21487         that did string manipulation to compute the type and then call
21488         GetType.  Use Parameter.ParameterType instead.
21489
21490         * cs-tokenizer.cs: Consume the suffix for floating values.
21491
21492         * expression.cs (ParameterReference): figure out whether this is a
21493         reference parameter or not.  Kill an extra variable by computing
21494         the arg_idx during emission.
21495
21496         * parameter.cs (Parameters.GetParameterInfo): New overloaded
21497         function that returns whether a parameter is an out/ref value or not.
21498
21499         (Parameter.ParameterType): The type of the parameter (base,
21500         without ref/out applied).
21501
21502         (Parameter.Resolve): Perform resolution here.
21503         (Parameter.ExternalType): The full type (with ref/out applied).
21504
21505         * statement.cs (Using.Emit, Using.EmitExpression): Implement
21506         support for expressions on the using statement.
21507
21508 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
21509
21510         * statement.cs (Using.EmitLocalVariableDecls): Split the
21511         localvariable handling of the using statement.
21512
21513         (Block.EmitMeta): Keep track of variable count across blocks.  We
21514         were reusing slots on separate branches of blocks.
21515
21516         (Try.Emit): Emit the general code block, we were not emitting it. 
21517
21518         Check the type of the declaration to be an IDisposable or
21519         something that can be implicity converted to it. 
21520
21521         Emit conversions if required.
21522
21523         * ecore.cs (EmptyExpression): New utility class.
21524         (Expression.ImplicitConversionExists): New utility function.
21525
21526 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
21527
21528         * statement.cs (Using): Implement.
21529
21530         * expression.cs (LocalVariableReference): Support read only variables.
21531
21532         * statement.cs: Remove the explicit emit for the Leave opcode.
21533         (VariableInfo): Add a readonly field.
21534
21535 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
21536
21537         * ecore.cs (ConvCast): new class used to encapsulate the various
21538         explicit integer conversions that works in both checked and
21539         unchecked contexts.
21540
21541         (Expression.ConvertNumericExplicit): Use new ConvCast class to
21542         properly generate the overflow opcodes.
21543
21544 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21545
21546         * statement.cs: The correct type for the EmptyExpression is the
21547         element_type, not the variable type.  Ravi pointed this out.
21548
21549 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21550
21551         * class.cs (Method::Define): Handle PInvoke methods specially
21552         by using DefinePInvokeMethod instead of the usual one.
21553
21554         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21555         above to do the task of extracting information and defining the method.
21556
21557 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21558
21559         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21560         of the condition for string type.
21561
21562         (Emit): Move that here. 
21563
21564         (ArrayCreation::CheckIndices): Keep string literals in their expression
21565         form.
21566
21567         (EmitDynamicInitializers): Handle strings appropriately.
21568
21569 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21570
21571         * codegen.cs (EmitContext): Replace multiple variables with a
21572         single pointer to the current Switch statement.
21573
21574         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21575         EmitContext.
21576
21577 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21578
21579         * statement.cs 
21580
21581         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21582         default'.
21583
21584         (Foreach.Emit): Foreach on arrays was not setting
21585         up the loop variables (for break/continue).
21586
21587         (GotoCase): Semi-implented.
21588
21589 2001-12-03  Ravi Pratap  <ravi@ximian.com>
21590
21591         * attribute.cs (CheckAttribute): Handle system attributes by using
21592         Attribute.GetAttributes to examine information we need.
21593
21594         (GetValidPlaces): Same here.
21595
21596         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21597
21598         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21599
21600         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21601
21602         (Method::Define): Set appropriate flags if we have a DllImport attribute.
21603
21604         (Method::Emit): Handle the case when we are a PInvoke method.
21605
21606 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21607
21608         * expression.cs: Use ResolveWithSimpleName on compound names.
21609
21610 2001-12-02  Ravi Pratap  <ravi@ximian.com>
21611
21612         * constant.cs (EmitConstant): Make sure we resolve the associated expression
21613         before trying to reduce it.
21614
21615         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21616
21617         * constant.cs (LookupConstantValue): Implement.
21618
21619         (EmitConstant): Use the above in emitting the constant.
21620
21621         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21622         that are user-defined by doing a LookupConstantValue on them.
21623
21624         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21625         too, like above.
21626
21627 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
21628
21629         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21630
21631         (BaseAccess.DoResolve): Implement.
21632
21633         (MemberAccess.DoResolve): Split this routine into a
21634         ResolveMemberAccess routine that can be used independently
21635
21636 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
21637
21638         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21639         As that share bits of the implementation.  Is returns a boolean,
21640         while As returns the Type that is being probed.
21641
21642 2001-12-01  Ravi Pratap  <ravi@ximian.com>
21643
21644         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21645         instead of a Literal - much easier.
21646
21647         (EnumInTransit): Remove - utterly useless :-)
21648
21649         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21650
21651         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21652
21653         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21654         chain when we have no associated expression.
21655
21656 2001-11-30  Ravi Pratap  <ravi@ximian.com>
21657
21658         * constant.cs (Define): Use Location while reporting the errror.
21659
21660         Also emit a warning when 'new' is used and there is no inherited
21661         member to hide.
21662
21663         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
21664         populated.
21665
21666         (LookupEnumValue): Implement to lookup an enum member's value and define it
21667         if necessary.
21668
21669         (Populate): Re-write accordingly to use the above routine.
21670
21671 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
21672
21673         * expression.cs (This): Fix prototype for DoResolveLValue to
21674         override the base class DoResolveLValue.
21675
21676         * cs-parser.cs: Report errors cs574 and cs575 (destructor
21677         declarations) 
21678
21679         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
21680         (we need to load the address of the field here).  This fixes
21681         test-22. 
21682
21683         (FieldExpr.DoResolveLValue): Call the DoResolve
21684         function to initialize the Instance expression.
21685
21686         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
21687         correctly the GetEnumerator operation on a value type.
21688
21689         * cs-parser.jay: Add more simple parsing error catches.
21690
21691         * statement.cs (Switch): Add support for string switches.
21692         Handle null specially.
21693
21694         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
21695
21696 2001-11-28  Ravi Pratap  <ravi@ximian.com>
21697
21698         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
21699
21700         (declare_local_constant): New helper function.
21701
21702         * statement.cs (AddConstant): Keep a separate record of constants
21703
21704         (IsConstant): Implement to determine if a variable is a constant.
21705
21706         (GetConstantExpression): Implement.
21707
21708         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
21709
21710         * statement.cs (IsVariableDefined): Re-write.
21711
21712 2001-11-27  Ravi Pratap  <ravi@ximian.com>
21713
21714         * class.cs (TypeContainer::FindMembers): Look for constants
21715         in the case when we are looking for MemberTypes.Field
21716
21717         * expression.cs (MemberAccess::DoResolve): Check that in the
21718         case we are a FieldExpr and a Literal, we are not being accessed
21719         by an instance reference.
21720
21721         * cs-parser.jay (local_constant_declaration): Implement.
21722
21723         (declaration_statement): Implement for constant declarations.
21724
21725 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
21726
21727         * statement.cs (Switch): Catch double defaults.
21728
21729         (Switch): More work on the switch() statement
21730         implementation.  It works for integral values now, need to finish
21731         string support.
21732
21733
21734 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21735
21736         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
21737         integer literals into other integer literals.  To be used by
21738         switch. 
21739
21740 2001-11-24  Ravi Pratap  <ravi@ximian.com>
21741
21742         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
21743         some memory.
21744
21745         (EmitDynamicInitializers): Cope with the above since we extract data
21746         directly from ArrayData now.
21747
21748         (ExpectInitializers): Keep track of whether initializers are mandatory
21749         or not.
21750
21751         (Bounds): Make it a hashtable to prevent the same dimension being 
21752         recorded for every element in that dimension.
21753
21754         (EmitDynamicInitializers): Fix bug which prevented the Set array method
21755         from being found.
21756
21757         Also fix bug which was causing the indices to be emitted in the reverse
21758         order.
21759
21760 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21761
21762         * expression.cs (ArrayCreation): Implement the bits that Ravi left
21763         unfinished.  They do not work, because the underlying code is
21764         sloppy.
21765
21766 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21767
21768         * cs-parser.jay: Remove bogus fixme.
21769
21770         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
21771         on Switch statement.
21772
21773 2001-11-23  Ravi Pratap  <ravi@ximian.com>
21774
21775         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
21776         the same. 
21777
21778         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
21779         parameter. Apparently, any expression is allowed. 
21780
21781         (ValidateInitializers): Update accordingly.
21782
21783         (CheckIndices): Fix some tricky bugs thanks to recursion.
21784
21785         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
21786         I was being completely brain-dead.
21787
21788         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
21789         and re-write acordingly.
21790
21791         (DelegateInvocation): Re-write accordingly.
21792
21793         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
21794
21795         (MakeByteBlob): Handle types more correctly.
21796
21797         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
21798         initialization from expressions but it is incomplete because I am a complete
21799         Dodo :-|
21800
21801 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21802
21803         * statement.cs (If.Emit): Fix a bug that generated incorrect code
21804         on If.  Basically, we have to return `true' (ie, we do return to
21805         our caller) only if both branches of the if return.
21806
21807         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
21808         short-circuit operators, handle them as short circuit operators. 
21809
21810         (Cast.DoResolve): Resolve type.
21811         (Cast.Cast): Take an expression as the target type.
21812
21813         * cs-parser.jay (cast_expression): Remove old hack that only
21814         allowed a limited set of types to be handled.  Now we take a
21815         unary_expression and we resolve to a type during semantic
21816         analysis.
21817
21818         Use the grammar productions from Rhys to handle casts (this is
21819         not complete like Rhys syntax yet, we fail to handle that corner
21820         case that C# has regarding (-x), but we will get there.
21821
21822 2001-11-22  Ravi Pratap  <ravi@ximian.com>
21823
21824         * class.cs (EmitFieldInitializer): Take care of the case when we have a
21825         field which is an array type.
21826
21827         * cs-parser.jay (declare_local_variables): Support array initialization too.
21828
21829         * typemanager.cs (MakeKey): Implement.
21830
21831         (everywhere): Use the above appropriately.
21832
21833         * cs-parser.jay (for_statement): Update for array initialization while
21834         declaring variables.
21835
21836         * ecore.cs : The error message was correct, it's the variable's names that
21837         were misleading ;-) Make the code more readable.
21838
21839         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
21840         the correct type etc.
21841
21842         (ConvertExplicit): Handle Enum types by examining the underlying type.
21843
21844 2001-11-21  Ravi Pratap  <ravi@ximian.com>
21845
21846         * parameter.cs (GetCallingConvention): Always return
21847         CallingConventions.Standard for now.
21848
21849 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21850
21851         * expression.cs (Binary.ResolveOperator): Update the values of `l'
21852         and `r' after calling DoNumericPromotions.
21853
21854         * ecore.cs: Fix error message (the types were in the wrong order).
21855
21856         * statement.cs (Foreach.ProbeCollectionType): Need to pass
21857         BindingFlags.Instance as well 
21858
21859         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
21860         implicit int literal conversion in an empty cast so that we
21861         propagate the right type upstream.
21862
21863         (UnboxCast): new class used to unbox value types.
21864         (Expression.ConvertExplicit): Add explicit type conversions done
21865         by unboxing.
21866
21867         (Expression.ImplicitNumericConversion): Oops, forgot to test for
21868         the target type before applying the implicit LongLiterals to ULong
21869         literal cast.
21870
21871 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
21872
21873         * cs-parser.jay (for_statement): Reworked the way For works: now
21874         we declare manually any variables that are introduced in
21875         for_initializer to solve the problem of having out-of-band code
21876         emition (that is what got for broken).
21877
21878         (declaration_statement): Perform the actual variable declaration
21879         that used to be done in local_variable_declaration here.
21880
21881         (local_variable_declaration): Do not declare anything, just pass
21882         the information on a DictionaryEntry
21883
21884 2001-11-20  Ravi Pratap  <ravi@ximian.com>
21885
21886         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
21887         re-write of the logic to now make it recursive.
21888
21889         (UpdateIndices): Re-write accordingly.
21890
21891         Store element data in a separate ArrayData list in the above methods.
21892
21893         (MakeByteBlob): Implement to dump the array data into a byte array.
21894
21895 2001-11-19  Ravi Pratap  <ravi@ximian.com>
21896
21897         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
21898         into CheckIndices.
21899
21900         * constant.cs (Define): Implement.
21901
21902         (EmitConstant): Re-write fully.
21903
21904         Pass in location info.
21905
21906         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
21907         respectively.
21908
21909         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
21910         DictionaryEntry since we need location info too.
21911
21912         (constant_declaration): Update accordingly.
21913
21914         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
21915         code into another method : UpdateIndices.
21916
21917 2001-11-18  Ravi Pratap  <ravi@ximian.com>
21918
21919         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
21920         some type checking etc.
21921
21922 2001-11-17  Ravi Pratap  <ravi@ximian.com>
21923
21924         * expression.cs (ArrayCreation::ValidateInitializers): Implement
21925         bits to provide dimension info if the user skips doing that.
21926
21927         Update second constructor to store the rank correctly.
21928
21929 2001-11-16  Ravi Pratap  <ravi@ximian.com>
21930
21931         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
21932         and try to implement.
21933
21934         * ../errors/cs0150.cs : Add.
21935
21936         * ../errors/cs0178.cs : Add.
21937
21938 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
21939
21940         * statement.cs: Implement foreach on multi-dimensional arrays. 
21941
21942         * parameter.cs (Parameters.GetParameterByName): Also lookup the
21943         name of the params argument.
21944
21945         * expression.cs: Use EmitStoreOpcode to get the right opcode while
21946         initializing the array.
21947
21948         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
21949         we can use this elsewhere.
21950
21951         * statement.cs: Finish implementation of foreach for single
21952         dimension arrays.
21953
21954         * cs-parser.jay: Use an out-of-band stack to pass information
21955         around, I wonder why I need this.
21956
21957         foreach_block: Make the new foreach_block the current_block.
21958
21959         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
21960         function used to return a static Parameters structure.  Used for
21961         empty parameters, as those are created very frequently.
21962
21963         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
21964
21965 2001-11-15  Ravi Pratap  <ravi@ximian.com>
21966
21967         * interface.cs : Default modifier is private, not public. The
21968         make verify test passes again.
21969
21970 2001-11-15  Ravi Pratap  <ravi@ximian.com>
21971
21972         * support.cs (ReflectionParameters): Fix logic to determine
21973         whether the last parameter is a params one. Test 9 passes again.
21974
21975         * delegate.cs (Populate): Register the builders we define with
21976         RegisterParameterForBuilder. Test 19 passes again.
21977
21978         * cs-parser.jay (property_declaration): Reference $6 instead
21979         of $$ to get at the location.
21980
21981         (indexer_declaration): Similar stuff.
21982
21983         (attribute): Ditto.
21984
21985         * class.cs (Property): Register parameters for the Get and Set methods
21986         if they exist. Test 23 passes again.
21987
21988         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
21989         call to EmitArguments as we are sure there aren't any params arguments. 
21990         Test 32 passes again.
21991
21992         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
21993         IndexOutOfRangeException. 
21994
21995         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
21996         Test 33 now passes again.
21997
21998 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
21999
22000         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
22001         broke a bunch of things.  Will have to come up with a better way
22002         of tracking locations.
22003
22004         * statement.cs: Implemented foreach for single dimension arrays.
22005
22006 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22007
22008         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
22009         an error.  This removes the lookup from the critical path.
22010
22011         * cs-parser.jay: Removed use of temporary_loc, which is completely
22012         broken. 
22013
22014 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
22015
22016         * support.cs (ReflectionParameters.ParameterModifier): Report
22017         whether the argument is a PARAMS argument or not.
22018
22019         * class.cs: Set the attribute `ParamArrayAttribute' on the
22020         parameter argument.
22021
22022         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
22023         and cons_param_array_attribute (ConstructorInfo for
22024         ParamArrayAttribute)., 
22025
22026         * codegen.cs: Emit the return using the `Return' statement, that
22027         way we can report the error correctly for missing return values. 
22028
22029         * class.cs (Method.Emit): Clean up.
22030
22031         * expression.cs (Argument.Resolve): Take another argument: the
22032         location where this argument is used.  Notice that this is not
22033         part of the "Argument" class as to reduce the size of the
22034         structure (we know the approximate location anyways).
22035
22036         Test if the argument is a variable-reference, if not, then
22037         complain with a 206.
22038
22039         (Argument.Emit): Emit addresses of variables.
22040
22041         (Argument.FullDesc): Simplify.
22042
22043         (Invocation.DoResolve): Update for Argument.Resolve.
22044
22045         (ElementAccess.DoResolve): ditto.
22046
22047         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
22048         method should be virtual, as this method is always virtual.
22049
22050         (NewDelegate.DoResolve): Update for Argument.Resolve.
22051
22052         * class.cs (ConstructorInitializer.DoResolve): ditto.
22053
22054         * attribute.cs (Attribute.Resolve): ditto.
22055
22056 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
22057
22058         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
22059
22060         * expression.cs (ParameterReference): Drop IStackStorage and implement
22061         IAssignMethod instead. 
22062
22063         (LocalVariableReference): ditto.
22064
22065         * ecore.cs (FieldExpr): Drop IStackStorage and implement
22066         IAssignMethod instead. 
22067
22068 2001-11-13  Miguel de Icaza <miguel@ximian.com>
22069
22070         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
22071         enumerations that are used in heavily used structures derive from
22072         byte in a laughable and pathetic attempt to reduce memory usage.
22073         This is the kind of pre-optimzations that you should not do at
22074         home without adult supervision.
22075
22076         * expression.cs (UnaryMutator): New class, used to handle ++ and
22077         -- separatedly from the other unary operators.  Cleans up the
22078         code, and kills the ExpressionStatement dependency in Unary.
22079
22080         (Unary): Removed `method' and `Arguments' from this class, making
22081         it smaller, and moving it all to SimpleCall, so I can reuse this
22082         code in other locations and avoid creating a lot of transient data
22083         strucutres when not required.
22084
22085         * cs-parser.jay: Adjust for new changes.
22086
22087 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
22088
22089         * enum.cs (Enum.Populate): If there is a failure during
22090         definition, return
22091
22092         * cs-parser.jay (opt_enum_base): we used to catch type errors
22093         here, but this is really incorrect.  The type error should be
22094         catched during semantic analysis.
22095
22096 2001-12-11  Ravi Pratap  <ravi@ximian.com>
22097
22098         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
22099         current_local_parameters as expected since I, in my stupidity, had forgotten
22100         to do this :-)
22101
22102         * attribute.cs (GetValidPlaces): Fix stupid bug.
22103
22104         * class.cs (Method::Emit): Perform check on applicability of attributes.
22105
22106         (Constructor::Emit): Ditto.
22107
22108         (Field::Emit): Ditto.
22109
22110         (Field.Location): Store location information.
22111
22112         (Property, Event, Indexer, Operator): Ditto.
22113
22114         * cs-parser.jay (field_declaration): Pass in location for each field.
22115
22116         * ../errors/cs0592.cs : Add.
22117
22118 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22119
22120         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
22121
22122         (InitCoreTypes): Update accordingly.
22123
22124         (RegisterAttrType, LookupAttr): Implement.
22125
22126         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
22127         info about the same.
22128
22129         (Resolve): Update to populate the above as necessary.
22130
22131         (Error592): Helper.
22132
22133         (GetValidPlaces): Helper to the above.
22134
22135         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
22136
22137         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
22138
22139 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22140
22141         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
22142
22143         * ../errors/cs0617.cs : Add.
22144
22145 2001-11-11  Ravi Pratap  <ravi@ximian.com>
22146
22147         * enum.cs (Emit): Rename to Populate to be more consistent with what
22148         we expect it to do and when exactly it is called.
22149
22150         * class.cs, rootcontext.cs : Update accordingly.
22151
22152         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
22153         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
22154
22155         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
22156
22157         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
22158         of a fieldinfo using the above, when dealing with a FieldBuilder.
22159
22160 2001-11-10  Ravi Pratap  <ravi@ximian.com>
22161
22162         * ../errors/cs0031.cs : Add.
22163
22164         * ../errors/cs1008.cs : Add.
22165
22166         * ../errrors/cs0543.cs : Add.
22167
22168         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
22169         enum type.
22170
22171         (FindMembers): Implement.
22172
22173         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
22174         enums and delegates too.
22175
22176         (enum_types): Rename to builder_to_enum.
22177
22178         (delegate_types): Rename to builder_to_delegate.
22179
22180         * delegate.cs (FindMembers): Implement.
22181
22182 2001-11-09  Ravi Pratap  <ravi@ximian.com>
22183
22184         * typemanager.cs (IsEnumType): Implement.
22185
22186         * enum.cs (Emit): Re-write parts to account for the underlying type
22187         better and perform checking etc.
22188
22189         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
22190         of the underlying type.
22191
22192         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
22193         value
22194
22195         * enum.cs (error31): Helper to report error #31.
22196
22197         * cs-parser.jay (enum_declaration): Store location of each member too.
22198
22199         * enum.cs (member_to_location): New hashtable. 
22200
22201         (AddEnumMember): Update location hashtable.
22202
22203         (Emit): Use the location of each member while reporting errors.
22204
22205 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22206
22207         * cs-parser.jay: A for_initializer if is a
22208         local_variable_declaration really ammount to have an implicit
22209         block with the variable declaration and no initializer for for.
22210
22211         * statement.cs (For.Emit): Cope with null initializers.
22212
22213         This fixes the infinite loop on for initializers.
22214
22215 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
22216
22217         * enum.cs: More cleanup.
22218
22219         * ecore.cs: Remove dead code.
22220
22221         * class.cs (Property.Emit): More simplification.
22222         (Event.Emit): ditto.
22223
22224         Reworked to have less levels of indentation.
22225
22226 2001-11-08  Ravi Pratap  <ravi@ximian.com>
22227
22228         * class.cs (Property): Emit attributes.
22229
22230         (Field): Ditto.
22231
22232         (Event): Ditto.
22233
22234         (Indexer): Ditto.
22235
22236         (Operator): Ditto.
22237
22238         * enum.cs (Emit): Ditto.
22239
22240         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
22241         Enums too.
22242
22243         * class.cs (Field, Event, etc.): Move attribute generation into the
22244         Emit method everywhere.
22245
22246         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
22247         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
22248         as we had no way of defining nested enums !
22249
22250         * rootcontext.cs : Adjust code accordingly.
22251
22252         * typemanager.cs (AddEnumType): To keep track of enum types separately.
22253
22254 2001-11-07  Ravi Pratap  <ravi@ximian.com>
22255
22256         * expression.cs (EvalConstantExpression): Move into ecore.cs
22257
22258         * enum.cs (Enum): Rename some members and make them public and readonly
22259         according to our convention.
22260
22261         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
22262         nothing else.
22263
22264         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
22265
22266         (Enum::Emit): Write a simple version for now which doesn't try to compute
22267         expressions. I shall modify this to be more robust in just a while.
22268
22269         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
22270
22271         (TypeContainer::CloseType): Create the Enum types too.
22272
22273         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
22274
22275         * expression.cs (EvalConstantExpression): Get rid of completely.
22276
22277         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
22278         user-defined values and other cases.
22279
22280         (IsValidEnumLiteral): Helper function.
22281
22282         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
22283         out there in the case we had a literal FieldExpr.
22284
22285         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
22286
22287         (Literalize): Revamp a bit to take two arguments.
22288
22289         (EnumLiteral): New class which derives from Literal to wrap enum literals.
22290
22291 2001-11-06  Ravi Pratap  <ravi@ximian.com>
22292
22293         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
22294
22295         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
22296
22297         (Resolve): Use the above to ensure we have proper initializers.
22298
22299 2001-11-05  Ravi Pratap  <ravi@ximian.com>
22300
22301         * expression.cs (Expression::EvalConstantExpression): New method to 
22302         evaluate constant expressions.
22303
22304         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
22305
22306 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
22307
22308         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
22309         in an array.
22310
22311         (Binary.ResolveOperator): Handle operator != (object a, object b)
22312         and operator == (object a, object b);
22313
22314         (Binary.DoNumericPromotions): Indicate whether the numeric
22315         promotion was possible.
22316
22317         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
22318         Implement.  
22319
22320         Made the ArrayAccess implement interface IAssignMethod instead of
22321         IStackStore as the order in which arguments are passed reflects
22322         this.
22323
22324         * assign.cs: Instead of using expr.ExprClass to select the way of
22325         assinging, probe for the IStackStore/IAssignMethod interfaces.
22326
22327         * typemanager.cs: Load InitializeArray definition.
22328
22329         * rootcontext.cs (RootContext.MakeStaticData): Used to define
22330         static data that can be used to initialize arrays. 
22331
22332 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
22333
22334         * expression.cs: Handle operator== and operator!= for booleans.
22335
22336         (Conditioal.Reduce): Implement reducer for the ?: operator.
22337
22338         (Conditional.Resolve): Implement dead code elimination.
22339
22340         (Binary.Resolve): Catch string literals and return a new
22341         concatenated string.
22342
22343         (Unary.Reduce): Implement reduction of unary expressions.
22344
22345         * ecore.cs: Split out the expression core handling here.
22346
22347         (Expression.Reduce): New method used to perform constant folding
22348         and CSE.  This is needed to support constant-expressions. 
22349
22350         * statement.cs (Statement.EmitBoolExpression): Pass true and false
22351         targets, and optimize for !x.
22352
22353 2001-11-04  Ravi Pratap  <ravi@ximian.com>
22354
22355         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
22356         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
22357         set custom atttributes.
22358
22359         * literal.cs (Literal::GetValue): New abstract method to return the actual
22360         value of the literal, cast as an object.
22361
22362         (*Literal): Implement GetValue method.
22363
22364         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22365         expressions to the arraylist but objects of type Argument.
22366
22367         * class.cs (TypeContainer::Emit): Emit our attributes too.
22368
22369         (Method::Emit, Constructor::Emit): Ditto.
22370
22371         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
22372         to be ignoring earlier.
22373
22374 2001-11-03  Ravi Pratap  <ravi@ximian.com>
22375
22376         * attribute.cs (AttributeSection::Define): Implement to do the business
22377         of constructing a CustomAttributeBuilder.
22378
22379         (Attribute): New trivial class. Increases readability of code.  
22380
22381         * cs-parser.jay : Update accordingly.
22382
22383         (positional_argument_list, named_argument_list, named_argument): New rules
22384
22385         (attribute_arguments): Use the above so that we are more correct.
22386
22387 2001-11-02  Ravi Pratap  <ravi@ximian.com>
22388
22389         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22390         to perform all checks for a method with a params parameter.
22391
22392         (Invocation::OverloadResolve): Update to use the above method and therefore
22393         cope correctly with params method invocations.
22394
22395         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
22396         params too.
22397
22398         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22399         constructors in our parent too because we can't afford to miss out on 
22400         protected ones ;-)
22401
22402         * attribute.cs (AttributeSection): New name for the class Attribute
22403
22404         Other trivial changes to improve readability.
22405
22406         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22407         use the new class names.
22408
22409 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22410
22411         * class.cs (Method::Define): Complete definition for params types too
22412
22413         (Indexer::Define): Ditto.
22414
22415         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22416         Cope everywhere with a request for info about the array parameter.
22417
22418 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22419
22420         * tree.cs (RecordNamespace): Fix up to check for the correct key.
22421
22422         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
22423         local_variable_type to extract the string corresponding to the type.
22424
22425         (local_variable_type): Fixup the action to use the new helper method.
22426
22427         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
22428         go.
22429
22430         * expression.cs : Clean out code which uses the above.
22431
22432 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22433
22434         * typemanager.cs (RegisterMethod): Check if we already have an existing key
22435         and bale out if necessary by returning a false.
22436
22437         (RegisterProperty): Ditto.
22438
22439         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
22440         and print out appropriate error messages.
22441
22442         * interface.cs (everywhere): Ditto.
22443
22444         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
22445         location to constructor.
22446
22447         * class.cs (Property, Event, Indexer): Update accordingly.
22448
22449         * ../errors/cs111.cs : Added.
22450
22451         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
22452         of a method, as laid down by the spec.
22453
22454         (Invocation::OverloadResolve): Use the above method.
22455
22456 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22457
22458         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22459         now take a TypeContainer and a Parameters object.
22460
22461         (ParameterData): Modify return type of ParameterModifier method to be 
22462         Parameter.Modifier and not a string.
22463
22464         (ReflectionParameters, InternalParameters): Update accordingly.
22465
22466         * expression.cs (Argument::GetParameterModifier): Same here.
22467
22468         * support.cs (InternalParameters::ParameterType): Find a better way of determining
22469         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22470         symbol in it at all so maybe this is only for now.
22471
22472 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22473
22474         * support.cs (InternalParameters): Constructor now takes an extra argument 
22475         which is the actual Parameters class.
22476
22477         (ParameterDesc): Update to provide info on ref/out modifiers.
22478
22479         * class.cs (everywhere): Update call to InternalParameters to pass in
22480         the second argument too.
22481
22482         * support.cs (ParameterData): Add ParameterModifier, which is a method 
22483         to return the modifier info [ref/out etc]
22484
22485         (InternalParameters, ReflectionParameters): Implement the above.
22486
22487         * expression.cs (Argument::ParameterModifier): Similar function to return
22488         info about the argument's modifiers.
22489
22490         (Invocation::OverloadResolve): Update to take into account matching modifiers 
22491         too.
22492
22493         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22494         a new SetFormalParameters object which we pass to InternalParameters.
22495
22496 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22497
22498         * expression.cs (NewArray): Merge into the ArrayCreation class.
22499
22500 2001-10-29  Ravi Pratap  <ravi@ximian.com>
22501
22502         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
22503         NewUserdefinedArray into one as there wasn't much of a use in having
22504         two separate ones.
22505
22506         * expression.cs (Argument): Change field's name to ArgType from Type.
22507
22508         (Type): New readonly property which returns the proper type, taking into 
22509         account ref/out modifiers.
22510
22511         (everywhere): Adjust code accordingly for the above.
22512
22513         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22514         whether we are emitting for a ref or out parameter.
22515
22516         * expression.cs (Argument::Emit): Use the above field to set the state.
22517
22518         (LocalVariableReference::Emit): Update to honour the flag and emit the
22519         right stuff.
22520
22521         * parameter.cs (Attributes): Set the correct flags for ref parameters.
22522
22523         * expression.cs (Argument::FullDesc): New function to provide a full desc.
22524
22525         * support.cs (ParameterData): Add method ParameterDesc to the interface.
22526
22527         (ReflectionParameters, InternalParameters): Implement the above method.
22528
22529         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22530         reporting errors.
22531
22532         (Invocation::FullMethodDesc): Ditto. 
22533
22534 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
22535
22536         * cs-parser.jay: Add extra production for the second form of array
22537         creation. 
22538
22539         * expression.cs (ArrayCreation): Update to reflect the above
22540         change. 
22541
22542         * Small changes to prepare for Array initialization.
22543
22544 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
22545
22546         * typemanager.cs (ImplementsInterface): interface might be null;
22547         Deal with this problem;
22548
22549         Also, we do store negative hits on the cache (null values), so use
22550         this instead of calling t.GetInterfaces on the type everytime.
22551
22552 2001-10-28  Ravi Pratap  <ravi@ximian.com>
22553
22554         * typemanager.cs (IsBuiltinType): New method to help determine the same.
22555
22556         * expression.cs (New::DoResolve): Get rid of array creation code and instead
22557         split functionality out into different classes.
22558
22559         (New::FormArrayType): Move into NewBuiltinArray.
22560
22561         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22562         quite useless.
22563
22564         (NewBuiltinArray): New class to handle creation of built-in arrays.
22565
22566         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22567         account creation of one-dimensional arrays.
22568
22569         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22570
22571         (NewUserdefinedArray::DoResolve): Implement.
22572
22573         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22574
22575         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22576         we maintain inside the TypeManager. This is necessary to perform lookups on the
22577         module builder.
22578
22579         (LookupType): Update to perform GetType on the module builders too.     
22580
22581         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22582
22583         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22584
22585 2001-10-23  Ravi Pratap  <ravi@ximian.com>
22586
22587         * expression.cs (New::DoResolve): Implement guts of array creation.
22588
22589         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22590
22591 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
22592
22593         * expression.cs: Fix bug I introduced lsat night that broke
22594         Delegates. 
22595
22596         (Expression.Resolve): Report a 246 error (can not resolve name)
22597         if we find a SimpleName in the stream.
22598
22599         (Expression.ResolveLValue): Ditto.
22600
22601         (Expression.ResolveWithSimpleName): This function is a variant of
22602         ResolveName, this one allows SimpleNames to be returned without a
22603         warning.  The only consumer of SimpleNames is MemberAccess
22604
22605 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
22606
22607         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22608         might arrive here.  I have my doubts that this is correct.
22609
22610         * statement.cs (Lock): Implement lock statement.
22611
22612         * cs-parser.jay: Small fixes to support `lock' and `using'
22613
22614         * cs-tokenizer.cs: Remove extra space
22615
22616         * driver.cs: New flag --checked, allows to turn on integer math
22617         checking. 
22618
22619         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22620         Threading.Monitor.Exit 
22621
22622 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
22623
22624         * expression.cs (IndexerAccess::DoResolveLValue): Set the
22625         Expression Class to be IndexerAccess.
22626
22627         Notice that Indexer::DoResolve sets the eclass to Value.
22628
22629 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
22630
22631         * class.cs (TypeContainer::Emit): Emit code for indexers.
22632
22633         * assign.cs (IAssignMethod): New interface implemented by Indexers
22634         and Properties for handling assignment.
22635
22636         (Assign::Emit): Simplify and reuse code. 
22637
22638         * expression.cs (IndexerAccess, PropertyExpr): Implement
22639         IAssignMethod, clean up old code. 
22640
22641 2001-10-22  Ravi Pratap  <ravi@ximian.com>
22642
22643         * typemanager.cs (ImplementsInterface): New method to determine if a type
22644         implements a given interface. Provides a nice cache too.
22645
22646         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22647         method.
22648
22649         (ConvertReferenceExplicit): Ditto.
22650
22651         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
22652         various methods, with correct names etc.
22653
22654         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
22655         Operator.UnaryNegation.
22656
22657         * cs-parser.jay (operator_declarator): Be a little clever in the case where
22658         we have a unary plus or minus operator.
22659
22660         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
22661         UnaryMinus.
22662
22663         * everywhere : update accordingly.
22664
22665         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22666         respectively.
22667
22668         * class.cs (Method::Define): For the case where we are implementing a method
22669         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
22670         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22671
22672 2001-10-21  Ravi Pratap  <ravi@ximian.com>
22673
22674         * interface.cs (FindMembers): Implement to work around S.R.E
22675         lameness.
22676
22677         * typemanager.cs (IsInterfaceType): Implement.
22678
22679         (FindMembers): Update to handle interface types too.
22680
22681         * expression.cs (ImplicitReferenceConversion): Re-write bits which
22682         use IsAssignableFrom as that is not correct - it doesn't work.
22683
22684         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
22685         and accordingly override EmitStatement.
22686
22687         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
22688         using the correct logic :-)
22689
22690 2001-10-19  Ravi Pratap  <ravi@ximian.com>
22691
22692         * ../errors/cs-11.cs : Add to demonstrate error -11 
22693
22694 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
22695
22696         * assign.cs (Assign::Resolve): Resolve right hand side first, and
22697         then pass this as a hint to ResolveLValue.
22698
22699         * expression.cs (FieldExpr): Add Location information
22700
22701         (FieldExpr::LValueResolve): Report assignment to readonly
22702         variable. 
22703
22704         (Expression::ExprClassFromMemberInfo): Pass location information.
22705
22706         (Expression::ResolveLValue): Add new method that resolves an
22707         LValue. 
22708
22709         (Expression::DoResolveLValue): Default invocation calls
22710         DoResolve. 
22711
22712         (Indexers): New class used to keep track of indexers in a given
22713         Type. 
22714
22715         (IStackStore): Renamed from LValue, as it did not really describe
22716         what this did.  Also ResolveLValue is gone from this interface and
22717         now is part of Expression.
22718
22719         (ElementAccess): Depending on the element access type
22720
22721         * typemanager.cs: Add `indexer_name_type' as a Core type
22722         (System.Runtime.CompilerServices.IndexerNameAttribute)
22723
22724         * statement.cs (Goto): Take a location.
22725
22726 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22727
22728         * delegate.cs (Delegate::VerifyDelegate): New method to verify
22729         if two delegates are compatible.
22730
22731         (NewDelegate::DoResolve): Update to take care of the case when
22732         we instantiate a delegate from another delegate.
22733
22734         * typemanager.cs (FindMembers): Don't even try to look up members
22735         of Delegate types for now.
22736
22737 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22738
22739         * delegate.cs (NewDelegate): New class to take care of delegate
22740         instantiation.
22741
22742         * expression.cs (New): Split the delegate related code out into 
22743         the NewDelegate class.
22744
22745         * delegate.cs (DelegateInvocation): New class to handle delegate 
22746         invocation.
22747
22748         * expression.cs (Invocation): Split out delegate related code into
22749         the DelegateInvocation class.
22750
22751 2001-10-17  Ravi Pratap  <ravi@ximian.com>
22752
22753         * expression.cs (New::DoResolve): Implement delegate creation fully
22754         and according to the spec.
22755
22756         (New::DoEmit): Update to handle delegates differently.
22757
22758         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
22759         because of which we were printing out arguments in reverse order !
22760
22761         * delegate.cs (VerifyMethod): Implement to check if the given method
22762         matches the delegate.
22763
22764         (FullDelegateDesc): Implement.
22765
22766         (VerifyApplicability): Implement.
22767
22768         * expression.cs (Invocation::DoResolve): Update to accordingly handle
22769         delegate invocations too.
22770
22771         (Invocation::Emit): Ditto.
22772
22773         * ../errors/cs1593.cs : Added.
22774
22775         * ../errors/cs1594.cs : Added.
22776
22777         * delegate.cs (InstanceExpression, TargetMethod): New properties.
22778
22779 2001-10-16  Ravi Pratap  <ravi@ximian.com>
22780
22781         * typemanager.cs (intptr_type): Core type for System.IntPtr
22782
22783         (InitCoreTypes): Update for the same.
22784
22785         (iasyncresult_type, asynccallback_type): Ditto.
22786
22787         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
22788         correct.
22789
22790         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
22791         too.
22792
22793         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
22794         the builders for the 4 members of a delegate type :-)
22795
22796         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
22797         type.
22798
22799         * expression.cs (New::DoResolve): Implement guts for delegate creation.
22800
22801         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
22802
22803 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
22804
22805         * statement.cs (Break::Emit): Implement.   
22806         (Continue::Emit): Implement.
22807
22808         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22809         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22810         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22811         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
22812         end loop
22813
22814         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
22815         properties that track the label for the current loop (begin of the
22816         loop and end of the loop).
22817
22818 2001-10-15  Ravi Pratap  <ravi@ximian.com>
22819
22820         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
22821         use of emitting anything at all.
22822
22823         * class.cs, rootcontext.cs : Get rid of calls to the same.
22824
22825         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
22826
22827         (Populate): Define the constructor correctly and set the implementation
22828         attributes.
22829
22830         * typemanager.cs (delegate_types): New hashtable to hold delegates that
22831         have been defined.
22832
22833         (AddDelegateType): Implement.
22834
22835         (IsDelegateType): Implement helper method.
22836
22837         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
22838
22839         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
22840         and accordingly handle it.
22841
22842         * delegate.cs (Populate): Take TypeContainer argument.
22843         Implement bits to define the Invoke method. However, I still haven't figured out
22844         how to take care of the native int bit :-(
22845
22846         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
22847         Qualify the name of the delegate, not its return type !
22848
22849         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
22850         conversion.
22851
22852         (StandardConversionExists): Checking for array types turns out to be recursive.
22853
22854         (ConvertReferenceExplicit): Implement array conversion.
22855
22856         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
22857
22858 2001-10-12  Ravi Pratap  <ravi@ximian.com>
22859
22860         * cs-parser.jay (delegate_declaration): Store the fully qualified
22861         name as it is a type declaration.
22862
22863         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
22864         readonly.
22865
22866         (DefineDelegate): Renamed from Define. Does the same thing essentially,
22867         as TypeContainer::DefineType.
22868
22869         (Populate): Method in which all the definition of the various methods (Invoke)
22870         etc is done.
22871
22872         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
22873         see.
22874
22875         (CloseDelegate): Finally creates the delegate.
22876
22877         * class.cs (TypeContainer::DefineType): Update to define delegates.
22878         (Populate, Emit and CloseType): Do the same thing here too.
22879
22880         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
22881         delegates in all these operations.
22882
22883 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
22884
22885         * expression.cs: LocalTemporary: a new expression used to
22886         reference a temporary that has been created.
22887
22888         * assign.cs: Handle PropertyAccess back here, so that we can
22889         provide the proper semantic access to properties.
22890
22891         * expression.cs (Expression::ConvertReferenceExplicit): Implement
22892         a few more explicit conversions. 
22893
22894         * modifiers.cs: `NEW' modifier maps to HideBySig.
22895
22896         * expression.cs (PropertyExpr): Make this into an
22897         ExpressionStatement, and support the EmitStatement code path. 
22898
22899         Perform get/set error checking, clean up the interface.
22900
22901         * assign.cs: recognize PropertyExprs as targets, and if so, turn
22902         them into toplevel access objects.
22903
22904 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
22905
22906         * expression.cs: PropertyExpr::PropertyExpr: use work around the
22907         SRE.
22908
22909         * typemanager.cs: Keep track here of our PropertyBuilders again to
22910         work around lameness in SRE.
22911
22912 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
22913
22914         * expression.cs (LValue::LValueResolve): New method in the
22915         interface, used to perform a second resolution pass for LValues. 
22916
22917         (This::DoResolve): Catch the use of this in static methods.
22918
22919         (This::LValueResolve): Implement.
22920
22921         (This::Store): Remove warning, assigning to `this' in structures
22922         is 
22923
22924         (Invocation::Emit): Deal with invocation of
22925         methods on value types.  We need to pass the address to structure
22926         methods rather than the object itself.  (The equivalent code to
22927         emit "this" for structures leaves the entire structure on the
22928         stack instead of a pointer to it). 
22929
22930         (ParameterReference::DoResolve): Compute the real index for the
22931         argument based on whether the method takes or not a `this' pointer
22932         (ie, the method is static).
22933
22934         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
22935         value types returned from functions when we need to invoke a
22936         method on the sturcture.
22937
22938
22939 2001-10-11  Ravi Pratap  <ravi@ximian.com>
22940
22941         * class.cs (TypeContainer::DefineType): Method to actually do the business of
22942         defining the type in the Modulebuilder or Typebuilder. This is to take
22943         care of nested types which need to be defined on the TypeBuilder using
22944         DefineNestedMethod.
22945
22946         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
22947         methods in RootContext, only ported to be part of TypeContainer.
22948
22949         (TypeContainer::GetInterfaceOrClass): Ditto.
22950
22951         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
22952
22953         * interface.cs (Interface::DefineInterface): New method. Does exactly
22954         what RootContext.CreateInterface did earlier, only it takes care of nested types 
22955         too.
22956
22957         (Interface::GetInterfaces): Move from RootContext here and port.
22958
22959         (Interface::GetInterfaceByName): Same here.
22960
22961         * rootcontext.cs (ResolveTree): Re-write.
22962
22963         (PopulateTypes): Re-write.
22964
22965         * class.cs (TypeContainer::Populate): Populate nested types too.
22966         (TypeContainer::Emit): Emit nested members too.
22967
22968         * typemanager.cs (AddUserType): Do not make use of the FullName property,
22969         instead just use the name argument passed in as it is already fully
22970         qualified.
22971
22972         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
22973         to TypeContainer mapping to see if a type is user-defined.
22974
22975         * class.cs (TypeContainer::CloseType): Implement. 
22976
22977         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
22978         the default constructor.
22979
22980         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
22981         twice.
22982
22983         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
22984
22985         * interface.cs (CloseType): Create the type here.
22986
22987         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
22988         the hierarchy.
22989
22990         Remove all the methods which are now in TypeContainer.
22991
22992 2001-10-10  Ravi Pratap  <ravi@ximian.com>
22993
22994         * delegate.cs (Define): Re-write bits to define the delegate
22995         correctly.
22996
22997 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
22998
22999         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
23000
23001         * expression.cs (ImplicitReferenceConversion): handle null as well
23002         as a source to convert to any reference type.
23003
23004         * statement.cs (Return): Perform any implicit conversions to
23005         expected return type.  
23006
23007         Validate use of return statement.  
23008
23009         * codegen.cs (EmitContext): Pass the expected return type here.
23010
23011         * class.cs (Method, Constructor, Property): Pass expected return
23012         type to EmitContext.
23013
23014 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
23015
23016         * expression.cs: Make DoResolve take an EmitContext instead of a
23017         TypeContainer.
23018
23019         Replaced `l' and `location' for `loc', for consistency.
23020
23021         (Error, Warning): Remove unneeded Tc argument.
23022
23023         * assign.cs, literal.cs, constant.cs: Update to new calling
23024         convention. 
23025
23026         * codegen.cs: EmitContext now contains a flag indicating whether
23027         code is being generated in a static method or not.
23028
23029         * cs-parser.jay: DecomposeQI, new function that replaces the old
23030         QualifiedIdentifier.  Now we always decompose the assembled
23031         strings from qualified_identifier productions into a group of
23032         memberaccesses.
23033
23034 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
23035
23036         * rootcontext.cs: Deal with field-less struct types correctly now
23037         by passing the size option to Define Type.
23038
23039         * class.cs: Removed hack that created one static field. 
23040
23041 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23042
23043         * statement.cs: Moved most of the code generation here. 
23044
23045 2001-10-09  Ravi Pratap  <ravi@ximian.com>
23046
23047         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
23048         seem very right.
23049
23050         (ElementAccess): Remove useless bits for now - keep checks as the spec
23051         says.
23052
23053 2001-10-08  Ravi Pratap  <ravi@ximian.com>
23054
23055         * expression.cs (ElementAccess::DoResolve): Remove my crap code
23056         and start performing checks according to the spec.
23057
23058 2001-10-07  Ravi Pratap  <ravi@ximian.com>
23059
23060         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
23061         rank_specifiers instead.
23062
23063         (rank_specifiers): Change the order in which the rank specifiers are stored
23064
23065         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
23066
23067         * expression.cs (ElementAccess): Implement the LValue interface too.
23068
23069 2001-10-06  Ravi Pratap  <ravi@ximian.com>
23070
23071         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
23072         except that user defined conversions are not included.
23073
23074         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
23075         perform the conversion of the return type, if necessary.
23076
23077         (New::DoResolve): Check whether we are creating an array or an object
23078         and accordingly do the needful.
23079
23080         (New::Emit): Same here.
23081
23082         (New::DoResolve): Implement guts of array creation.
23083
23084         (New::FormLookupType): Helper function.
23085
23086 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23087
23088         * codegen.cs: Removed most of the code generation here, and move the
23089         corresponding code generation bits to the statement classes. 
23090
23091         Added support for try/catch/finalize and throw.
23092
23093         * cs-parser.jay: Added support for try/catch/finalize.
23094
23095         * class.cs: Catch static methods having the flags override,
23096         virtual or abstract.
23097
23098         * expression.cs (UserCast): This user cast was not really doing
23099         what it was supposed to do.  Which is to be born in fully resolved
23100         state.  Parts of the resolution were being performed at Emit time! 
23101
23102         Fixed this code.
23103
23104 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23105
23106         * expression.cs: Implicity convert the result from UserCast.
23107
23108 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23109
23110         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
23111         prevented it from working correctly. 
23112
23113         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
23114         merely ConvertImplicit.
23115
23116 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23117
23118         * typemanager.cs: Make the LookupTypeContainer function static,
23119         and not per-instance.  
23120
23121         * class.cs: Make static FindMembers (the one that takes a Type
23122         argument). 
23123
23124         * codegen.cs: Add EmitForeach here.
23125
23126         * cs-parser.jay: Make foreach a toplevel object instead of the
23127         inline expansion, as we need to perform semantic analysis on it. 
23128
23129 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23130
23131         * expression.cs (Expression::ImplicitUserConversion): Rename to
23132         UserDefinedConversion.
23133
23134         (Expression::UserDefinedConversion): Take an extra argument specifying 
23135         whether we look for explicit user conversions too.
23136
23137         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
23138
23139         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
23140
23141         (ExplicitUserConversion): Make it a call to UserDefinedConversion
23142         with the appropriate arguments.
23143
23144         * cs-parser.jay (cast_expression): Record location too.
23145
23146         * expression.cs (Cast): Record location info.
23147
23148         (Expression::ConvertExplicit): Take location argument.
23149
23150         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
23151         to determine if we are doing explicit conversions.
23152
23153         (UserCast::Emit): Update accordingly.
23154
23155         (Expression::ConvertExplicit): Report an error if everything fails.
23156
23157         * ../errors/cs0030.cs : Add.
23158
23159 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
23160
23161         * modifiers.cs: If the ABSTRACT keyword is present, also set the
23162         virtual and newslot bits. 
23163
23164         * class.cs (TypeContainer::RegisterRequiredImplementations):
23165         Record methods we need.
23166
23167         (TypeContainer::MakeKey): Helper function to make keys for
23168         MethodBases, since the Methodbase key is useless.
23169
23170         (TypeContainer::Populate): Call RegisterRequiredImplementations
23171         before defining the methods.   
23172
23173         Create a mapping for method_builders_to_methods ahead of time
23174         instead of inside a tight loop.
23175
23176         (::RequireMethods):  Accept an object as the data to set into the
23177         hashtable so we can report interface vs abstract method mismatch.
23178
23179 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23180
23181         * report.cs: Make all of it static.
23182
23183         * rootcontext.cs: Drop object_type and value_type computations, as
23184         we have those in the TypeManager anyways.
23185
23186         Drop report instance variable too, now it is a global.
23187
23188         * driver.cs: Use try/catch on command line handling.
23189
23190         Add --probe option to debug the error reporting system with a test
23191         suite. 
23192
23193         * report.cs: Add support for exiting program when a probe
23194         condition is reached.
23195
23196 2001-10-03  Ravi Pratap  <ravi@ximian.com>
23197
23198         * expression.cs (Binary::DoNumericPromotions): Fix the case when
23199         we do a forcible conversion regardless of type, to check if 
23200         ForceConversion returns a null.
23201
23202         (Binary::error19): Use location to report error.
23203
23204         (Unary::error23): Use location here too.
23205
23206         * ../errors/cs0019.cs : Check in.
23207
23208         * ../errors/cs0023.cs : Check in.
23209
23210         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
23211         case of a non-null MethodInfo object with a length of 0 !
23212
23213         (Binary::ResolveOperator): Flag error if overload resolution fails to find
23214         an applicable member - according to the spec :-)
23215         Also fix logic to find members in base types.
23216
23217         (Unary::ResolveOperator): Same here.
23218
23219         (Unary::report23): Change name to error23 and make first argument a TypeContainer
23220         as I was getting thoroughly confused between this and error19 :-)
23221
23222         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
23223         (::FindMostEncompassedType): Implement.
23224         (::FindMostEncompassingType): Implement.
23225         (::StandardConversionExists): Implement.
23226
23227         (UserImplicitCast): Re-vamp. We now need info about most specific
23228         source and target types so that we can do the necessary conversions.
23229
23230         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
23231         mathematical union with no duplicates.
23232
23233 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23234
23235         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
23236         in order from base classes to child classes, so that we can in
23237         child classes look up in our parent for method names and
23238         attributes (required for handling abstract, virtual, new, override
23239         constructs: we need to instrospect our base class, and if we dont
23240         populate the classes in order, the introspection might be
23241         incorrect.  For example, a method could query its parent before
23242         the parent has any methods and would determine that the parent has
23243         no abstract methods (while it could have had them)).
23244
23245         (RootContext::CreateType): Record the order in which we define the
23246         classes.
23247
23248 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
23249
23250         * class.cs (TypeContainer::Populate): Also method definitions can
23251         fail now, keep track of this.
23252
23253         (TypeContainer::FindMembers): Implement support for
23254         DeclaredOnly/noDeclaredOnly flag.
23255
23256         (Constructor::Emit) Return the ConstructorBuilder.
23257
23258         (Method::Emit) Return the MethodBuilder. 
23259         Check for abstract or virtual methods to be public.
23260
23261         * rootcontext.cs (RootContext::CreateType): Register all the
23262         abstract methods required for the class to be complete and the
23263         interface methods that must be implemented. 
23264
23265         * cs-parser.jay: Report error 501 (method requires body if it is
23266         not marked abstract or extern).
23267
23268         * expression.cs (TypeOf::Emit): Implement.
23269
23270         * typemanager.cs: runtime_handle_type, new global type.
23271
23272         * class.cs (Property::Emit): Generate code for properties.
23273
23274 2001-10-02  Ravi Pratap  <ravi@ximian.com>
23275
23276         * expression.cs (Unary::ResolveOperator): Find operators on base type
23277         too - we now conform exactly to the spec.
23278
23279         (Binary::ResolveOperator): Same here.
23280
23281         * class.cs (Operator::Define): Fix minor quirk in the tests.
23282
23283         * ../errors/cs0215.cs : Added.
23284
23285         * ../errors/cs0556.cs : Added.
23286
23287         * ../errors/cs0555.cs : Added.
23288
23289 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23290
23291         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
23292         single integer which is really efficient
23293
23294 2001-10-01  Ravi Pratap  <ravi@ximian.com>
23295
23296         *  expression.cs (Expression::ImplicitUserConversion): Use location
23297         even in the case when we are examining True operators.
23298  
23299         * class.cs (Operator::Define): Perform extensive checks to conform
23300         with the rules for operator overloading in the spec.
23301
23302         * expression.cs (Expression::ImplicitReferenceConversion): Implement
23303         some of the other conversions mentioned in the spec.
23304
23305         * typemanager.cs (array_type): New static member for the System.Array built-in
23306         type.
23307
23308         (cloneable_interface): For System.ICloneable interface.
23309
23310         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
23311         we start resolving the tree and populating types.
23312
23313         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
23314  
23315 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23316
23317         * expression.cs (Expression::ExprClassFromMemberInfo,
23318         Expression::Literalize): Create literal expressions from
23319         FieldInfos which are literals.
23320
23321         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
23322         type casts, because they were wrong.  The test suite in tests
23323         caught these ones.
23324
23325         (ImplicitNumericConversion): ushort to ulong requires a widening
23326         cast. 
23327
23328         Int32 constant to long requires widening cast as well.
23329
23330         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
23331         for integers because the type on the stack is not i4.
23332
23333 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
23334
23335         * expression.cs (report118): require location argument. 
23336
23337         * parameter.cs: Do not dereference potential null value.
23338
23339         * class.cs: Catch methods that lack the `new' keyword when
23340         overriding a name.  Report warnings when `new' is used without
23341         anything being there to override.
23342
23343         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
23344
23345         * class.cs: Only add constructor to hashtable if it is non-null
23346         (as now constructors can fail on define).
23347
23348         (TypeManager, Class, Struct): Take location arguments.
23349
23350         Catch field instance initialization in structs as errors.
23351
23352         accepting_filter: a new filter for FindMembers that is static so
23353         that we dont create an instance per invocation.
23354
23355         (Constructor::Define): Catch errors where a struct constructor is
23356         parameterless 
23357
23358         * cs-parser.jay: Pass location information for various new
23359         constructs. 
23360
23361         * delegate.cs (Delegate): take a location argument.
23362
23363         * driver.cs: Do not call EmitCode if there were problesm in the
23364         Definition of the types, as many Builders wont be there. 
23365
23366         * decl.cs (Decl::Decl): Require a location argument.
23367
23368         * cs-tokenizer.cs: Handle properly hex constants that can not fit
23369         into integers, and find the most appropiate integer for it.
23370
23371         * literal.cs: Implement ULongLiteral.
23372
23373         * rootcontext.cs: Provide better information about the location of
23374         failure when CreateType fails.
23375
23376 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
23377
23378         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23379         as well.
23380
23381         * expression.cs (Binary::CheckShiftArguments): Add missing type
23382         computation.
23383         (Binary::ResolveOperator): Add type to the logical and and logical
23384         or, Bitwise And/Or and Exclusive Or code paths, it was missing
23385         before.
23386
23387         (Binary::DoNumericPromotions): In the case where either argument
23388         is ulong (and most signed types combined with ulong cause an
23389         error) perform implicit integer constant conversions as well.
23390
23391 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23392
23393         * expression.cs (UserImplicitCast): Method should always be
23394         non-null. 
23395         (Invocation::BetterConversion): Simplified test for IntLiteral.
23396
23397         (Expression::ImplicitNumericConversion): Split this routine out.
23398         Put the code that performs implicit constant integer conversions
23399         here. 
23400
23401         (Expression::Resolve): Become a wrapper around DoResolve so we can
23402         check eclass and type being set after resolve.
23403
23404         (Invocation::Badness): Remove this dead function
23405
23406         (Binary::ResolveOperator): Do not compute the expensive argumnets
23407         unless we have a union for it.
23408
23409         (Probe::Emit): Is needs to do an isinst and then
23410         compare against null.
23411
23412         (::CanConvert): Added Location argument.  If the Location argument
23413         is null (Location.Null), then we do not report errors.  This is
23414         used by the `probe' mechanism of the Explicit conversion.  We do
23415         not want to generate an error for something that the user
23416         explicitly requested to be casted.  But the pipeline for an
23417         explicit cast first tests for potential implicit casts.
23418
23419         So for now, if the Location is null, it means `Probe only' to
23420         avoid adding another argument.   Might have to revise this
23421         strategy later.
23422
23423         (ClassCast): New class used to type cast objects into arbitrary
23424         classes (used in Explicit Reference Conversions).
23425
23426         Implement `as' as well.
23427
23428         Reverted all the patches from Ravi below: they were broken:
23429
23430                 * The use of `level' as a mechanism to stop recursive
23431                   invocations is wrong.  That was there just to catch the
23432                   bug with a strack trace but not as a way of addressing
23433                   the problem.
23434
23435                   To fix the problem we have to *understand* what is going
23436                   on and the interactions and come up with a plan, not
23437                   just get things going.
23438
23439                 * The use of the type conversion cache that I proposed
23440                   last night had an open topic: How does this work across
23441                   protection domains.  A user defined conversion might not
23442                   be public in the location where we are applying the
23443                   conversion, a different conversion might be selected
23444                   (ie, private A->B (better) but public B->A (worse),
23445                   inside A, A->B applies, but outside it, B->A will
23446                   apply).
23447
23448                 * On top of that (ie, even if the above is solved),
23449                   conversions in a cache need to be abstract.  Ie, `To
23450                   convert from an Int to a Short use an OpcodeCast', not
23451                   `To convert from an Int to a Short use the OpcodeCast on
23452                   the variable 5' (which is what this patch was doing).
23453
23454 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23455
23456         * expression.cs (Invocation::ConversionExists): Re-write to use
23457         the conversion cache
23458
23459         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23460         cache all conversions done, not just user-defined ones.
23461
23462         (Invocation::BetterConversion): The real culprit. Use ConversionExists
23463         to determine if a conversion exists instead of acutually trying to 
23464         perform the conversion. It's faster too.
23465
23466         (Expression::ConvertExplicit): Modify to use ConversionExists to check
23467         and only then attempt the implicit conversion.
23468
23469 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23470
23471         * expression.cs (ConvertImplicit): Use a cache for conversions
23472         already found. Check level of recursion and bail out if necessary.
23473
23474 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23475
23476         * typemanager.cs (string_concat_string_string, string_concat_object_object):
23477         Export standard methods that we expect for string operations.
23478
23479         * statement.cs (Block::UsageWarning): Track usage of variables and
23480         report the errors for not used variables.
23481
23482         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23483         operator. 
23484
23485 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23486
23487         * codegen.cs: remove unnneded code 
23488
23489         * expression.cs: Removed BuiltinTypeAccess class
23490
23491         Fix the order in which implicit conversions are
23492         done.  
23493
23494         The previous fixed dropped support for boxed conversions (adding a
23495         test to the test suite now)
23496
23497         (UserImplicitCast::CanConvert): Remove test for source being null,
23498         that code is broken.  We should not feed a null to begin with, if
23499         we do, then we should track the bug where the problem originates
23500         and not try to cover it up here.
23501
23502         Return a resolved expression of type UserImplicitCast on success
23503         rather than true/false.  Ravi: this is what I was talking about,
23504         the pattern is to use a static method as a "constructor" for
23505         objects. 
23506
23507         Also, do not create arguments until the very last minute,
23508         otherwise we always create the arguments even for lookups that
23509         will never be performed. 
23510
23511         (UserImplicitCast::Resolve): Eliminate, objects of type
23512         UserImplicitCast are born in a fully resolved state. 
23513
23514         * typemanager.cs (InitCoreTypes): Init also value_type
23515         (System.ValueType). 
23516
23517         * expression.cs (Cast::Resolve): First resolve the child expression.
23518
23519         (LValue): Add new method AddressOf to be used by
23520         the `&' operator.  
23521
23522         Change the argument of Store to take an EmitContext instead of an
23523         ILGenerator, because things like FieldExpr need to be able to call
23524         their children expression to generate the instance code. 
23525
23526         (Expression::Error, Expression::Warning): Sugar functions for
23527         reporting errors.
23528
23529         (Expression::MemberLookup): Accept a TypeContainer instead of a
23530         Report as the first argument.
23531
23532         (Expression::ResolvePrimary): Killed.  I still want to improve
23533         this as currently the code is just not right.
23534
23535         (Expression::ResolveMemberAccess): Simplify, but it is still
23536         wrong. 
23537
23538         (Unary::Resolve): Catch errors in AddressOf operators.
23539
23540         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23541         index to a byte for the short-version, or the compiler will choose
23542         the wrong Emit call, which generates the wrong data.
23543
23544         (ParameterReference::Emit, ::Store): same.
23545
23546         (FieldExpr::AddressOf): Implement.
23547
23548         * typemanager.cs: TypeManager: made public variable instead of
23549         property.
23550
23551         * driver.cs: document --fatal.
23552
23553         * report.cs (ErrorMessage, WarningMessage): new names for the old
23554         Error and Warning classes.
23555
23556         * cs-parser.jay (member_access): Turn built-in access to types
23557         into a normal simplename
23558
23559 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23560
23561         * expression.cs (Invocation::BetterConversion): Fix to cope
23562         with q being null, since this was introducing a bug.
23563
23564         * expression.cs (ConvertImplicit): Do built-in conversions first.
23565
23566 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23567
23568         * expression.cs (UserImplicitCast::Resolve): Fix bug.
23569
23570 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23571
23572         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23573         I had introduced long ago (what's new ?).
23574
23575         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
23576         the work of all the checking. 
23577         (ConvertImplicit): Call CanConvert and only then create object if necessary.
23578         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23579
23580         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23581         that is the right way. 
23582
23583         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
23584         overloading resolution. Use everywhere instead of cutting and pasting code.
23585
23586         (Binary::ResolveOperator): Use MakeUnionSet.
23587
23588         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
23589         we have to convert to bool types. Not complete yet.
23590
23591 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23592
23593         * typemanager.cs (TypeManager::CSharpName): support ushort.
23594
23595         * expression.cs (Expression::TryImplicitIntConversion): Attempts
23596         to provide an expression that performsn an implicit constant int
23597         conversion (section 6.1.6).
23598         (Expression::ConvertImplicitRequired): Reworked to include
23599         implicit constant expression conversions.
23600
23601         (Expression::ConvertNumericExplicit): Finished.
23602
23603         (Invocation::Emit): If InstanceExpression is null, then it means
23604         that we perform a call on this.
23605
23606 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23607
23608         * expression.cs (Unary::Emit): Remove some dead code.
23609         (Probe): Implement Resolve and Emit for `is'.
23610         (Expression::ConvertImplicitRequired): Attempt to do constant
23611         expression conversions here.  Maybe should be moved to
23612         ConvertImplicit, but I am not sure.
23613         (Expression::ImplicitLongConstantConversionPossible,
23614         Expression::ImplicitIntConstantConversionPossible): New functions
23615         that tell whether is it possible to apply an implicit constant
23616         expression conversion.
23617
23618         (ConvertNumericExplicit): Started work on explicit numeric
23619         conversions.
23620
23621         * cs-parser.jay: Update operator constants.
23622
23623         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23624         (Parameters::GetSignature): Hook up VerifyArgs here.
23625         (Parameters::VerifyArgs): Verifies that no two arguments have the
23626         same name. 
23627
23628         * class.cs (Operator): Update the operator names to reflect the
23629         ones that the spec expects (as we are just stringizing the
23630         operator names).
23631
23632         * expression.cs (Unary::ResolveOperator): Fix bug: Use
23633         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23634         previous usage did only work for our methods.
23635         (Expression::ConvertImplicit): Handle decimal implicit numeric
23636         conversions as well.
23637         (Expression::InternalTypeConstructor): Used to invoke constructors
23638         on internal types for default promotions.
23639
23640         (Unary::Emit): Implement special handling for the pre/post
23641         increment/decrement for overloaded operators, as they need to have
23642         the same semantics as the other operators.
23643
23644         (Binary::ResolveOperator): ditto.
23645         (Invocation::ConversionExists): ditto.
23646         (UserImplicitCast::Resolve): ditto.
23647
23648 2001-09-26  Ravi Pratap  <ravi@ximian.com>
23649
23650         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23651         operator, return after emitting body. Regression tests pass again !
23652
23653         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23654         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23655         (Invocation::OverloadResolve): Ditto.
23656         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23657
23658         * everywhere : update calls to the above methods accordingly.
23659
23660 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23661
23662         * assign.cs (Assign): Make it inherit from ExpressionStatement.
23663
23664         * expression.cs (ExpressionStatement): New base class used for
23665         expressions that can appear in statements, so that we can provide
23666         an alternate path to generate expression that do not leave a value
23667         on the stack.
23668
23669         (Expression::Emit, and all the derivatives): We no longer return
23670         whether a value is left on the stack or not.  Every expression
23671         after being emitted leaves a single value on the stack.
23672
23673         * codegen.cs (EmitContext::EmitStatementExpression): Use the
23674         facilties of ExpressionStatement if possible.
23675
23676         * cs-parser.jay: Update statement_expression.
23677
23678 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
23679
23680         * driver.cs: Change the wording of message
23681
23682 2001-09-25  Ravi Pratap  <ravi@ximian.com>
23683
23684         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
23685         the type of the expression to the return type of the method if
23686         we have an overloaded operator match ! The regression tests pass again !
23687         (Unary::ResolveOperator): Ditto.
23688
23689         * expression.cs (Invocation::ConversionExists): Correct the member lookup
23690         to find "op_Implicit", not "implicit" ;-)
23691         (UserImplicitCast): New class to take care of user-defined implicit conversions.
23692         (ConvertImplicit, ForceConversion): Take TypeContainer argument
23693
23694         * everywhere : Correct calls to the above accordingly.
23695
23696         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
23697         (ConvertImplicit): Do user-defined conversion if it exists.
23698
23699 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
23700
23701         * assign.cs: track location.
23702         (Resolve): Use implicit conversions on assignment.
23703
23704         * literal.cs: Oops.  Not good, Emit of short access values should
23705         pass (Bytes) or the wrong argument will be selected.
23706
23707         * expression.cs (Unary::Emit): Emit code for -expr.
23708
23709         (Unary::ResolveOperator): Handle `Substract' for non-constants
23710         (substract from zero from the non-constants).
23711         Deal with Doubles as well. 
23712
23713         (Expression::ConvertImplicitRequired): New routine that reports an
23714         error if no implicit conversion exists. 
23715
23716         (Invocation::OverloadResolve): Store the converted implicit
23717         expressions if we make them
23718
23719 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23720
23721         * class.cs (ConstructorInitializer): Take a Location argument.
23722         (ConstructorBaseInitializer): Same here.
23723         (ConstructorThisInitializer): Same here.
23724
23725         * cs-parser.jay : Update all calls accordingly.
23726
23727         * expression.cs (Unary, Binary, New): Take location argument.
23728         Update accordingly everywhere.
23729
23730         * cs-parser.jay : Update all calls to the above to take a location
23731         argument.
23732
23733         * class.cs : Ditto.
23734
23735 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23736
23737         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
23738         (Invocation::BetterConversion): Same here
23739         (Invocation::ConversionExists): Ditto.
23740
23741         (Invocation::ConversionExists): Implement.
23742
23743 2001-09-22  Ravi Pratap  <ravi@ximian.com>
23744
23745         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
23746         Also take an additional TypeContainer argument.
23747
23748         * All over : Pass in TypeContainer as argument to OverloadResolve.
23749
23750         * typemanager.cs (CSharpName): Update to check for the string type and return
23751         that too.
23752
23753         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
23754         a given method.
23755
23756 2001-09-21  Ravi Pratap  <ravi@ximian.com>
23757
23758         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
23759         (Invocation::BetterFunction): Implement.
23760         (Invocation::BetterConversion): Implement.
23761         (Invocation::ConversionExists): Skeleton, no implementation yet.
23762
23763         Okay, things work fine !
23764
23765 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
23766
23767         * typemanager.cs: declare and load enum_type, delegate_type and
23768         void_type. 
23769
23770         * expression.cs (Expression::Emit): Now emit returns a value that
23771         tells whether a value is left on the stack or not.  This strategy
23772         might be reveted tomorrow with a mechanism that would address
23773         multiple assignments.
23774         (Expression::report118): Utility routine to report mismatches on
23775         the ExprClass.
23776
23777         (Unary::Report23): Report impossible type/operator combination
23778         utility function.
23779
23780         (Unary::IsIncrementableNumber): Whether the type can be
23781         incremented or decremented with add.
23782         (Unary::ResolveOperator): Also allow enumerations to be bitwise
23783         complemented. 
23784         (Unary::ResolveOperator): Implement ++, !, ~,
23785
23786         (Invocation::Emit): Deal with new Emit convetion.
23787
23788         * All Expression derivatives: Updated their Emit method to return
23789         whether they leave values on the stack or not.
23790
23791         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
23792         stack for expressions that are statements. 
23793
23794 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
23795
23796         * expression.cs (LValue): New interface.  Must be implemented by
23797         LValue objects.
23798         (LocalVariableReference, ParameterReference, FieldExpr): Implement
23799         LValue interface.
23800
23801         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
23802         interface for generating code, simplifies the code.
23803
23804 2001-09-20  Ravi Pratap  <ravi@ximian.com>
23805
23806         * expression.cs (everywhere): Comment out return statements in ::Resolve
23807         methods to avoid the warnings.
23808
23809 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
23810
23811         * driver.cs (parse): Report error 2001 if we can not open the
23812         source file.
23813
23814         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
23815         not resolve it.
23816
23817         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
23818         object. 
23819
23820         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
23821         otherwise nested blocks end up with the same index.
23822
23823         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
23824
23825         * expression.cs:  Instead of having FIXMEs in the Resolve
23826         functions, throw exceptions so it is obvious that we are facing a
23827         bug. 
23828
23829         * cs-parser.jay (invocation_expression): Pass Location information.
23830
23831         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
23832         Use a basename for those routines because .NET does not like paths
23833         on them. 
23834
23835         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
23836         already defined.
23837
23838 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
23839
23840         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
23841         are loading the correct data types (throws an exception if not).
23842         (TypeManager::InitCoreTypes): Use CoreLookupType
23843
23844         * expression.cs (Unary::ResolveOperator): return the child
23845         expression for expressions which are just +expr.
23846         (Unary::ResolveOperator): Return negative literals for -LITERAL
23847         expressions (otherwise they are Unary {Literal}).
23848         (Invocation::Badness): Take into account `Implicit constant
23849         expression conversions'.
23850
23851         * literal.cs (LongLiteral): Implement long literal class.
23852         (IntLiteral): export the `Value' of the intliteral. 
23853
23854 2001-09-19  Ravi Pratap  <ravi@ximian.com>
23855
23856         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
23857
23858         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
23859         instead of 'Operator'
23860
23861         * expression.cs (Binary::ResolveOperator): Update accordingly.
23862         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
23863         and 'Minus'
23864
23865         * cs-parser.jay (unary_expression): Update to use the new names.
23866
23867         * gen-treedump.cs (GetUnary): Same here.
23868
23869         * expression.cs (Unary::Resolve): Implement.
23870         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
23871         operators are found instead of making noise ;-)
23872         (Unary::ResolveOperator): New method to do precisely the same thing which
23873         Binary::ResolveOperator does for Binary expressions.
23874         (Unary.method, .Arguments): Add.
23875         (Unary::OperName): Implement.   
23876         (Unary::ForceConversion): Copy and Paste !
23877
23878         * class.cs (Operator::Define): Fix a small bug for the case when we have 
23879         a unary operator.
23880
23881         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
23882         for the inbuilt operators. Only overloading works for now ;-)
23883
23884 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
23885
23886         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
23887         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
23888
23889         * expression.cs (This::Emit): Implement. 
23890         (This::Resolve): Implement.
23891         (TypeOf:Resolve): Implement.
23892         (Expression::ResolveSimpleName): Add an implicit this to instance
23893         field references. 
23894         (MemberAccess::Resolve): Deal with Parameters and Fields. 
23895         Bind instance variable to Field expressions.
23896         (FieldExpr::Instance): New field used to track the expression that
23897         represents the object instance.
23898         (FieldExpr::Resolve): Track potential errors from MemberLookup not
23899         binding 
23900         (FieldExpr::Emit): Implement.
23901
23902         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
23903         the last instruction contains a return opcode to avoid generating
23904         the last `ret' instruction (this generates correct code, and it is
23905         nice to pass the peverify output).
23906
23907         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
23908         initializer for static and instance variables.
23909         (Constructor::Emit): Allow initializer to be null in the case of
23910         static constructors.  Only emit initializer for instance
23911         constructors. 
23912
23913         (TypeContainer::FindMembers): Return a null array if there are no
23914         matches.
23915
23916         Also fix the code for the MemberTypes.Method branch, as it was not
23917         scanning that for operators (or tried to access null variables before).
23918
23919         * assign.cs (Assign::Emit): Handle instance and static fields. 
23920
23921         * TODO: Updated.
23922
23923         * driver.cs: Stop compilation if there are parse errors.
23924
23925         * cs-parser.jay (constructor_declaration): Provide default base
23926         initializer for non-static constructors.
23927         (constructor_declarator): Do not provide a default base
23928         initializers if none was specified.
23929         Catch the fact that constructors should not have parameters.
23930
23931         * class.cs: Do not emit parent class initializers for static
23932         constructors, that should be flagged as an error.
23933
23934 2001-09-18  Ravi Pratap  <ravi@ximian.com>
23935
23936         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
23937         Move back code into TypeContainer::Populate.
23938
23939 2001-09-18  Ravi Pratap  <ravi@ximian.com>
23940
23941         * class.cs (TypeContainer::AddConstructor): Fix the check to
23942         compare against Name, not Basename. 
23943         (Operator::OpType): Change Plus and Minus to Add and Subtract.
23944
23945         * cs-parser.jay : Update accordingly.
23946
23947         * class.cs (TypeContainer::FindMembers): For the case where we are searching
23948         for methods, don't forget to look into the operators too.
23949         (RegisterMethodBuilder): Helper method to take care of this for
23950         methods, constructors and operators.
23951         (Operator::Define): Completely revamp.
23952         (Operator.OperatorMethod, MethodName): New fields.
23953         (TypeContainer::Populate): Move the registering of builders into
23954         RegisterMethodBuilder.
23955         (Operator::Emit): Re-write.
23956
23957         * expression.cs (Binary::Emit): Comment out code path to emit method
23958         invocation stuff for the case when we have a user defined operator. I am
23959         just not able to get it right !
23960
23961 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
23962
23963         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
23964         argument. 
23965
23966         (Expression::MemberLookup): Provide a version that allows to
23967         specify the MemberTypes and BindingFlags. 
23968
23969         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
23970         so it was not fetching variable information from outer blocks.
23971
23972         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
23973         Beforefieldinit as it was buggy.
23974
23975         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
23976         that Ravi put here.  
23977
23978         * class.cs (Constructor::Emit): Only emit if block is not null.
23979         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
23980         deal with this by semantically definining it as if the user had
23981         done it.
23982
23983         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
23984         constructors as we now "emit" them at a higher level.
23985
23986         (TypeContainer::DefineDefaultConstructor): Used to define the
23987         default constructors if none was provided.
23988
23989         (ConstructorInitializer): Add methods Resolve and Emit. 
23990
23991         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
23992
23993 2001-09-17  Ravi Pratap  <ravi@ximian.com>
23994
23995         * class.cs (TypeContainer::EmitDefaultConstructor): Register
23996         the default constructor builder with our hashtable for methodbuilders
23997         to methodcores.
23998
23999         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
24000         and argument_count is 0 in which case we have a match.
24001         (Binary::ResolveOperator): More null checking and miscellaneous coding
24002         style cleanup.
24003
24004 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24005
24006         * rootcontext.cs (IsNameSpace): Compare against null.
24007
24008         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
24009
24010         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
24011         and Unary::Operator.
24012
24013         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
24014         accordingly.
24015
24016         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
24017         we have overloaded operators.
24018         (Binary::ResolveOperator): Implement the part which does the operator overload
24019         resolution.
24020
24021         * class.cs (Operator::Emit): Implement.
24022         (TypeContainer::Emit): Emit the operators we have too.
24023
24024         * expression.cs (Binary::Emit): Update to emit the appropriate code for
24025         the case when we have a user-defined operator.
24026
24027 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24028
24029         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
24030
24031 2001-09-16  Ravi Pratap  <ravi@ximian.com>
24032
24033         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
24034         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
24035         (Constructor::Emit): Implement.
24036         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
24037         if we have no work to do. 
24038         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
24039         Emit method.
24040
24041         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
24042         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
24043
24044         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
24045         of parent.parent.
24046
24047 2001-09-15  Ravi Pratap  <ravi@ximian.com>
24048
24049         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
24050         in the source.
24051         (Tree::RecordNamespace): Method to do what the name says ;-)
24052         (Tree::Namespaces): Property to get at the namespaces hashtable.
24053
24054         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
24055         keep track.
24056
24057         * rootcontext.cs (IsNamespace): Fixed it :-)
24058
24059 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24060
24061         * class.cs (TypeContainer::FindMembers): Add support for
24062         constructors. 
24063         (MethodCore): New class that encapsulates both the shared aspects
24064         of a Constructor and a Method.  
24065         (Method, Constructor): Factored pieces into MethodCore.
24066
24067         * driver.cs: Added --fatal which makes errors throw exceptions.
24068         Load System assembly as well as part of the standard library.
24069
24070         * report.cs: Allow throwing exceptions on errors for debugging.
24071
24072         * modifiers.cs: Do not use `parent', instead use the real type
24073         container to evaluate permission settings.
24074
24075         * class.cs: Put Ravi's patch back in.  He is right, and we will
24076         have to cope with the
24077
24078 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24079
24080         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
24081         FamORAssem, not FamANDAssem.
24082
24083 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24084
24085         * driver.cs: Added --parse option that only parses its input files
24086         and terminates.
24087
24088         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
24089         incorrect.  IsTopLevel is not used to tell whether an object is
24090         root_types or not (that can be achieved by testing this ==
24091         root_types).  But to see if this is a top-level *class* (not
24092         necessarly our "toplevel" container). 
24093
24094 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24095
24096         * enum.cs (Enum::Define): Modify to call the Lookup method on the
24097         parent instead of a direct call to GetType.
24098
24099 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24100
24101         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
24102         Modifiers.TypeAttr. This should just be a call to that method.
24103
24104         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
24105         object so that we can determine if we are top-level or not.
24106
24107         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
24108         TypeContainer too.
24109
24110         * enum.cs (Enum::Define): Ditto.
24111
24112         * modifiers.cs (FieldAttr): Re-write.
24113
24114         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
24115         (TypeContainer::HaveStaticConstructor): New property to provide access
24116         to precisely that info.
24117
24118         * modifiers.cs (MethodAttr): Re-write.
24119         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
24120
24121         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
24122         of top-level types as claimed.
24123
24124 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24125
24126         * expression.cs (MemberLookup): Fruitless attempt to lookup
24127         constructors.  Maybe I need to emit default constructors?  That
24128         might be it (currently .NET emits this for me automatically).
24129         (Invocation::OverloadResolve): Cope with Arguments == null.
24130         (Invocation::EmitArguments): new function, shared by the new
24131         constructor and us.
24132         (Invocation::Emit): Handle static and instance methods.  Emit
24133         proper call instruction for virtual or non-virtual invocations.
24134         (New::Emit): Implement.
24135         (New::Resolve): Implement.
24136         (MemberAccess:Resolve): Implement.
24137         (MethodGroupExpr::InstanceExpression): used conforming to the spec
24138         to track instances.
24139         (FieldExpr::Resolve): Set type.
24140
24141         * support.cs: Handle empty arguments.
24142                 
24143         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
24144         SimpleLookup): Auxiliary routines to help parse a qualifier
24145         identifier.  
24146
24147         Update qualifier_identifier rule.
24148
24149         * codegen.cs: Removed debugging messages.
24150
24151         * class.cs: Make this a global thing, this acts just as a "key" to
24152         objects that we might have around.
24153
24154         (Populate): Only initialize method_builders_to_methods once.
24155
24156         * expression.cs (PropertyExpr): Initialize type from the
24157         PropertyType. 
24158
24159         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
24160         Resolve pattern.  Attempt to implicitly convert value to boolean.
24161         Emit code.
24162
24163         * expression.cs: Set the type for the int32/int32 argument case.
24164         (Binary::ResolveOperator): Set the return type to boolean for
24165         comparission operators
24166
24167         * typemanager.cs: Remove debugging print code.
24168
24169         (Invocation::Resolve): resolve type.
24170
24171         * class.cs: Allocate a MemberInfo of the correct size, as the code
24172         elsewhere depends on the test to reflect the correct contents.
24173
24174         (Method::) Keep track of parameters, due to System.Reflection holes
24175
24176         (TypeContainer::Populate): Keep track of MethodBuilders to Method
24177         mapping here.
24178
24179         (TypeContainer::FindMembers): Use ArrayList and then copy an array
24180         of the exact size and return that.
24181
24182         (Class::LookupMethodByBuilder): New function that maps
24183         MethodBuilders to its methods.  Required to locate the information
24184         on methods because System.Reflection bit us again.
24185
24186         * support.cs: New file, contains an interface ParameterData and
24187         two implementations: ReflectionParameters and InternalParameters
24188         used to access Parameter information.  We will need to grow this
24189         as required.
24190
24191         * expression.cs (Invocation::GetParameterData): implement a cache
24192         and a wrapper around the ParameterData creation for methods. 
24193         (Invocation::OverloadResolve): Use new code.
24194
24195 2001-09-13  Ravi Pratap  <ravi@ximian.com>
24196
24197         * class.cs (TypeContainer::EmitField): Remove and move into 
24198         (Field::Define): here and modify accordingly.
24199         (Field.FieldBuilder): New member.
24200         (TypeContainer::Populate): Update accordingly.
24201         (TypeContainer::FindMembers): Implement.
24202
24203 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24204
24205         * statement.cs: (VariableInfo::VariableType): New field to be
24206         initialized with the full type once it is resolved. 
24207
24208 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
24209
24210         * parameter.cs (GetParameterInfo): Use a type cache to compute
24211         things only once, and to reuse this information
24212
24213         * expression.cs (LocalVariableReference::Emit): Implement.
24214         (OpcodeCast::Emit): fix.
24215
24216         (ParameterReference::Resolve): Implement.
24217         (ParameterReference::Emit): Implement.
24218
24219         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
24220         that are expressions need to stay as Expressions.
24221
24222         * typemanager.cs (CSharpName): Returns the C# name of a type if
24223         possible. 
24224
24225         * expression.cs (Expression::ConvertImplicit): New function that
24226         implements implicit type conversions.
24227
24228         (Expression::ImplicitReferenceConversion): Implements implicit
24229         reference conversions.
24230
24231         (EmptyCast): New type for transparent casts.
24232
24233         (OpcodeCast): New type for casts of types that are performed with
24234         a sequence of bytecodes.
24235
24236         (BoxedCast): New type used for casting value types into reference
24237         types.  Emits a box opcode.
24238
24239         (Binary::DoNumericPromotions): Implements numeric promotions of
24240         and computation of the Binary::Type.
24241
24242         (Binary::EmitBranchable): Optimization.
24243
24244         (Binary::Emit): Implement code emission for expressions.
24245
24246         * typemanager.cs (TypeManager): Added two new core types: sbyte
24247         and byte.
24248
24249 2001-09-12  Ravi Pratap  <ravi@ximian.com>
24250
24251         * class.cs (TypeContainer::FindMembers): Method which does exactly
24252         what Type.FindMembers does, only we don't have to use reflection. No
24253         implementation yet.
24254
24255         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
24256         typecontainer objects as we need to get at them.
24257         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
24258
24259         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
24260         typecontainer object.
24261
24262         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
24263         of just a Report object.
24264
24265 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24266
24267         * class.cs (Event::Define): Go back to using the prefixes "add_" and
24268         "remove_"
24269         (TypeContainer::Populate): Now define the delegates of the type too.
24270         (TypeContainer.Delegates): Property to access the list of delegates defined
24271         in the type.
24272
24273         * delegates.cs (Delegate::Define): Implement partially.
24274
24275         * modifiers.cs (TypeAttr): Handle more flags.
24276
24277 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24278
24279         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
24280         and not <=
24281         (Operator::Define): Re-write logic to get types by using the LookupType method
24282         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
24283         (Indexer::Define): Ditto.
24284         (Event::Define): Ditto.
24285         (Property::Define): Ditto.
24286
24287 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24288
24289         * class.cs (TypeContainer::Populate): Now define operators too. 
24290         (TypeContainer.Operators): New property to access the list of operators
24291         in a type.
24292         (Operator.OperatorMethodBuilder): New member to hold the method builder
24293         for the operator we are defining.
24294         (Operator::Define): Implement.
24295
24296 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24297
24298         * class.cs (Event::Define): Make the prefixes of the accessor methods
24299         addOn_ and removeOn_ 
24300
24301         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
24302         of the location being passed in too. Ideally, this should go later since all
24303         error reporting should be done through the Report object.
24304
24305         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
24306         (Populate): Iterate thru the indexers we have and define them too.
24307         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
24308         for the get and set accessors.
24309         (Indexer::Define): Implement.
24310
24311 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
24312
24313         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
24314         my previous implementation, did not work.
24315
24316         * typemanager.cs: Add a couple of missing types (the longs).
24317
24318         * literal.cs: Use TypeManager.bool_type instead of getting it.
24319
24320         * expression.cs (EventExpr): New kind of expressions.
24321         (Expressio::ExprClassFromMemberInfo): finish
24322
24323 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
24324
24325         * assign.cs: Emit stores to static fields differently.
24326
24327 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24328
24329         * Merge in changes and adjust code to tackle conflicts. Backed out my
24330         code in Assign::Resolve ;-) 
24331
24332 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24333
24334         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
24335         instead Report.Error and also pass in the location.
24336         (CSharpParser::Lexer): New readonly property to return the reference
24337         to the Tokenizer object.
24338         (declare_local_variables): Use Report.Error with location instead of plain 
24339         old error.
24340         (CheckDef): Ditto.
24341
24342         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
24343         (Operator.CheckBinaryOperator): Ditto.
24344
24345         * cs-parser.jay (operator_declarator): Update accordingly.
24346
24347         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
24348         (CheckBinaryOperator): Same here.
24349
24350         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
24351         on the name without any prefixes of namespace names etc. This is because we
24352         already might have something already fully qualified like 
24353         'System.Console.WriteLine'
24354
24355         * assign.cs (Resolve): Begin implementation. Stuck ;-)
24356
24357 2001-09-07  Ravi Pratap  <ravi@ximian.com>
24358
24359         * cs-tokenizer.cs (location): Return a string which also contains
24360         the file name.
24361
24362         * expression.cs (ElementAccess): New class for expressions of the
24363         type 'element access.'
24364         (BaseAccess): New class for expressions of the type 'base access.'
24365         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
24366         respectively.
24367
24368         * cs-parser.jay (element_access): Implement action.
24369         (base_access): Implement actions.
24370         (checked_expression, unchecked_expression): Implement.
24371
24372         * cs-parser.jay (local_variable_type): Correct and implement.
24373         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24374
24375         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24376
24377         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24378         name and the specifiers.
24379
24380         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24381
24382         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
24383         making them all public ;-)
24384
24385         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24386         class anyways.
24387
24388 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
24389
24390         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24391         PropertyExprs.
24392         (FieldExpr, PropertyExprs): New resolved expressions.
24393         (SimpleName::MemberStaticCheck): Perform static checks for access
24394         to non-static fields on static methods. Maybe this should be
24395         generalized for MemberAccesses. 
24396         (SimpleName::ResolveSimpleName): More work on simple name
24397         resolution. 
24398
24399         * cs-parser.jay (primary_expression/qualified_identifier): track
24400         the parameter index.
24401
24402         * codegen.cs (CodeGen::Save): Catch save exception, report error.
24403         (EmitContext::EmitBoolExpression): Chain to expression generation
24404         instead of temporary hack.
24405         (::EmitStatementExpression): Put generic expression code generation.
24406
24407         * assign.cs (Assign::Emit): Implement variable assignments to
24408         local variables, parameters and fields.
24409
24410 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
24411
24412         * statement.cs (Block::GetVariableInfo): New method, returns the
24413         VariableInfo for a variable name in a block.
24414         (Block::GetVariableType): Implement in terms of GetVariableInfo
24415
24416         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24417         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24418
24419 2001-09-06  Ravi Pratap  <ravi@ximian.com>
24420
24421         * cs-parser.jay (operator_declaration): Continue on my quest : update
24422         to take attributes argument.
24423         (event_declaration): Ditto.
24424         (enum_declaration): Ditto.
24425         (indexer_declaration): Ditto.
24426
24427         * class.cs (Operator::Operator): Update constructor accordingly.
24428         (Event::Event): Ditto.
24429
24430         * delegate.cs (Delegate::Delegate): Same here.
24431
24432         * enum.cs (Enum::Enum): Same here.
24433
24434 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24435
24436         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
24437
24438         * ../tests/cs0658.cs : New file to demonstrate error 0658.
24439
24440         * attribute.cs (Attributes): New class to encapsulate all attributes which were
24441         being passed around as an arraylist.
24442         (Attributes::AddAttribute): Method to add attribute sections.
24443
24444         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
24445         (struct_declaration): Update accordingly.
24446         (constant_declaration): Update.
24447         (field_declaration): Update.
24448         (method_header): Update.
24449         (fixed_parameter): Update.
24450         (parameter_array): Ditto.
24451         (property_declaration): Ditto.
24452         (destructor_declaration): Ditto.
24453
24454         * class.cs (Struct::Struct): Update constructors accordingly.
24455         (Class::Class): Ditto.
24456         (Field::Field): Ditto.
24457         (Method::Method): Ditto.
24458         (Property::Property): Ditto.
24459         (TypeContainer::OptAttribute): update property's return type.
24460
24461         * interface.cs (Interface.opt_attributes): New member.
24462         (Interface::Interface): Update to take the extra Attributes argument.
24463
24464         * parameter.cs (Parameter::Parameter): Ditto.
24465
24466         * constant.cs (Constant::Constant): Ditto.
24467
24468         * interface.cs (InterfaceMemberBase): New OptAttributes field.
24469         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
24470         the attributes as a parameter.
24471         (InterfaceProperty): Update constructor call.
24472         (InterfaceEvent): Ditto.
24473         (InterfaceMethod): Ditto.
24474         (InterfaceIndexer): Ditto.
24475
24476         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
24477         pass the attributes too.
24478         (interface_event_declaration): Ditto.
24479         (interface_property_declaration): Ditto.
24480         (interface_method_declaration): Ditto.
24481         (interface_declaration): Ditto.
24482
24483 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
24484
24485         * class.cs (Method::Define): Track the "static Main" definition to
24486         create an entry point. 
24487
24488         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24489         EntryPoint if we find it. 
24490
24491         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24492         (EmitContext::ig): Make this variable public.
24493
24494         * driver.cs: Make the default output file be the first file name
24495         with the .exe extension.  
24496
24497         Detect empty compilations
24498
24499         Handle various kinds of output targets.  Handle --target and
24500         rename -t to --dumper.
24501
24502         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24503         methods inherited from Expression return now an Expression.  This
24504         will is used during the tree rewriting as we resolve them during
24505         semantic analysis.
24506
24507         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24508         the spec.  Missing entirely is the information about
24509         accessability of elements of it.
24510
24511         (Expression::ExprClassFromMemberInfo): New constructor for
24512         Expressions that creates a fully initialized Expression based on
24513         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24514         a Type.
24515
24516         (Invocation::Resolve): Begin implementing resolution of invocations.
24517
24518         * literal.cs (StringLiteral):  Implement Emit.
24519
24520 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24521
24522         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24523         member.
24524
24525 2001-09-04  Ravi Pratap  <ravi@ximian.com>
24526
24527         * cs-parser.jay (attribute_arguments): Implement actions.
24528         (attribute): Fix bug in production. Implement action.
24529         (attribute_list): Implement.
24530         (attribute_target): Implement.
24531         (attribute_target_specifier, opt_target_specifier): Implement
24532         (CheckAttributeTarget): New method to check if the attribute target
24533         is valid.
24534         (attribute_section): Implement.
24535         (opt_attributes): Implement.
24536
24537         * attribute.cs : New file to handle attributes.
24538         (Attribute): Class to hold attribute info.
24539
24540         * cs-parser.jay (opt_attribute_target_specifier): Remove production
24541         (attribute_section): Modify production to use 2 different rules to 
24542         achieve the same thing. 1 s/r conflict down !
24543         Clean out commented, useless, non-reducing dimension_separator rules.
24544
24545         * class.cs (TypeContainer.attributes): New member to hold list
24546         of attributes for a type.
24547         (Struct::Struct): Modify to take one more argument, the attribute list.
24548         (Class::Class): Ditto.
24549         (Field::Field): Ditto.
24550         (Method::Method): Ditto.
24551         (Property::Property): Ditto.
24552
24553         * cs-parser.jay (struct_declaration): Update constructor call to
24554         pass in the attributes too.
24555         (class_declaration): Ditto.
24556         (constant_declaration): Ditto.
24557         (field_declaration): Ditto.
24558         (method_header): Ditto.
24559         (fixed_parameter): Ditto.
24560         (parameter_array): Ditto.
24561         (property_declaration): Ditto.
24562
24563         * constant.cs (Constant::Constant): Update constructor similarly.
24564         Use System.Collections.
24565
24566         * parameter.cs (Parameter::Parameter): Update as above.
24567
24568 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24569
24570         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24571         (TypeContainer.delegates): New member to hold list of delegates.
24572
24573         * cs-parser.jay (delegate_declaration): Implement the action correctly 
24574         this time as I seem to be on crack ;-)
24575
24576 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
24577
24578         * rootcontext.cs (RootContext::IsNamespace): new function, used to
24579         tell whether an identifier represents a namespace.
24580
24581         * expression.cs (NamespaceExpr): A namespace expression, used only
24582         temporarly during expression resolution.
24583         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24584         utility functions to resolve names on expressions.
24585
24586 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
24587
24588         * codegen.cs: Add hook for StatementExpressions. 
24589
24590         * class.cs: Fix inverted test for static flag in methods.
24591
24592 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24593
24594         * class.cs (Operator::CheckUnaryOperator): Correct error number used
24595         to make it coincide with MS' number.
24596         (Operator::CheckBinaryOperator): Ditto.
24597
24598         * ../errors/errors.txt : Remove error numbers added earlier.
24599
24600         * ../errors/cs1019.cs : Test case for error # 1019
24601
24602         * ../errros/cs1020.cs : Test case for error # 1020
24603
24604         * cs-parser.jay : Clean out commented cruft.
24605         (dimension_separators, dimension_separator): Comment out. Ostensibly not
24606         used anywhere - non-reducing rule.
24607         (namespace_declarations): Non-reducing rule - comment out.
24608
24609         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24610         with TypeContainer::AddEnum.
24611
24612         * delegate.cs : New file for delegate handling classes.
24613         (Delegate): Class for declaring delegates.
24614
24615         * makefile : Update.
24616
24617         * cs-parser.jay (delegate_declaration): Implement.
24618
24619 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
24620
24621         * class.cs (Event::Define): Implement.
24622         (Event.EventBuilder): New member.
24623
24624         * class.cs (TypeContainer::Populate): Update to define all enums and events
24625         we have.
24626         (Events): New property for the events arraylist we hold. Shouldn't we move to using
24627         readonly fields for all these cases ?
24628
24629 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24630
24631         * class.cs (Property): Revamp to use the convention of making fields readonly.
24632         Accordingly modify code elsewhere.
24633
24634         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24635         the Define method of the Property class.
24636
24637         * class.cs : Clean up applied patch and update references to variables etc. Fix 
24638         trivial bug.
24639         (TypeContainer::Populate): Update to define all the properties we have. Also
24640         define all enumerations.
24641
24642         * enum.cs (Define): Implement.
24643
24644 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24645
24646         * cs-parser.jay (overloadable_operator): The semantic value is an
24647         enum of the Operator class.
24648         (operator_declarator): Implement actions.
24649         (operator_declaration): Implement.
24650
24651         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24652         validity of definitions.
24653         (Operator::CheckBinaryOperator): Static method to check for binary operators
24654         (TypeContainer::AddOperator): New method to add an operator to a type.
24655
24656         * cs-parser.jay (indexer_declaration): Added line to actually call the
24657         AddIndexer method so it gets added ;-)
24658
24659         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
24660         already taken care of by the MS compiler ?  
24661
24662 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24663
24664         * class.cs (Operator): New class for operator declarations.
24665         (Operator::OpType): Enum for the various operators.
24666
24667 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24668
24669         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24670         ostensibly handle this in semantic analysis.
24671
24672         * cs-parser.jay (general_catch_clause): Comment out
24673         (specific_catch_clauses, specific_catch_clause): Ditto.
24674         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24675         (catch_args, opt_catch_args): New productions.
24676         (catch_clause): Rewrite to use the new productions above
24677         (catch_clauses): Modify accordingly.
24678         (opt_catch_clauses): New production to use in try_statement
24679         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
24680         and re-write the code in the actions to extract the specific and
24681         general catch clauses by being a little smart ;-)
24682
24683         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
24684         Hooray, try and catch statements parse fine !
24685
24686 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24687
24688         * statement.cs (Block::GetVariableType): Fix logic to extract the type
24689         string from the hashtable of variables.
24690
24691         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
24692         I end up making that mistake ;-)
24693         (catch_clauses): Fixed gross error which made Key and Value of the 
24694         DictionaryEntry the same : $1 !!
24695
24696 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24697
24698         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
24699
24700         * cs-parser.jay (event_declaration): Correct to remove the semicolon
24701         when the add and remove accessors are specified. 
24702
24703 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24704
24705         * cs-parser.jay (IndexerDeclaration): New helper class to hold
24706         information about indexer_declarator.
24707         (indexer_declarator): Implement actions.
24708         (parsing_indexer): New local boolean used to keep track of whether
24709         we are parsing indexers or properties. This is necessary because 
24710         implicit_parameters come into picture even for the get accessor in the 
24711         case of an indexer.
24712         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
24713
24714         * class.cs (Indexer): New class for indexer declarations.
24715         (TypeContainer::AddIndexer): New method to add an indexer to a type.
24716         (TypeContainer::indexers): New member to hold list of indexers for the
24717         type.
24718
24719 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24720
24721         * cs-parser.jay (add_accessor_declaration): Implement action.
24722         (remove_accessor_declaration): Implement action.
24723         (event_accessors_declaration): Implement
24724         (variable_declarators): swap statements for first rule - trivial.
24725
24726         * class.cs (Event): New class to hold information about event
24727         declarations.
24728         (TypeContainer::AddEvent): New method to add an event to a type
24729         (TypeContainer::events): New member to hold list of events.
24730
24731         * cs-parser.jay (event_declaration): Implement actions.
24732
24733 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24734
24735         * cs-parser.jay (dim_separators): Implement. Make it a string
24736         concatenating all the commas together, just as they appear.
24737         (opt_dim_separators): Modify accordingly
24738         (rank_specifiers): Update accordingly. Basically do the same
24739         thing - instead, collect the brackets here.
24740         (opt_rank_sepcifiers): Modify accordingly.
24741         (array_type): Modify to actually return the complete type string
24742         instead of ignoring the rank_specifiers.
24743         (expression_list): Implement to collect the expressions
24744         (variable_initializer): Implement. We make it a list of expressions
24745         essentially so that we can handle the array_initializer case neatly too.
24746         (variable_initializer_list): Implement.
24747         (array_initializer): Make it a list of variable_initializers
24748         (opt_array_initializer): Modify accordingly.
24749
24750         * expression.cs (New::NType): Add enumeration to help us
24751         keep track of whether we have an object/delegate creation
24752         or an array creation.
24753         (New:NewType, New::Rank, New::Indices, New::Initializers): New
24754         members to hold data about array creation.
24755         (New:New): Modify to update NewType
24756         (New:New): New Overloaded contructor for the array creation
24757         case.
24758
24759         * cs-parser.jay (array_creation_expression): Implement to call
24760         the overloaded New constructor.
24761
24762 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
24763
24764         * class.cs (TypeContainer::Constructors): Return member
24765         constructors instead of returning null.
24766
24767 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
24768
24769         * typemanager.cs (InitCoreTypes): Initialize the various core
24770         types after we have populated the type manager with the user
24771         defined types (this distinction will be important later while
24772         compiling corlib.dll)
24773
24774         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
24775         on Expression Classification.  Now all expressions have a method
24776         `Resolve' and a method `Emit'.
24777
24778         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
24779         generation from working.     Also add some temporary debugging
24780         code. 
24781
24782 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
24783
24784         * codegen.cs: Lots of code generation pieces.  This is only the
24785         beginning, will continue tomorrow with more touches of polish.  We
24786         handle the fundamentals of if, while, do, for, return.  Others are
24787         trickier and I need to start working on invocations soon.
24788
24789         * gen-treedump.cs: Bug fix, use s.Increment here instead of
24790         s.InitStatement. 
24791
24792         * codegen.cs (EmitContext): New struct, used during code
24793         emission to keep a context.   Most of the code generation will be
24794         here. 
24795
24796         * cs-parser.jay: Add embedded blocks to the list of statements of
24797         this block.  So code generation proceeds in a top down fashion.
24798
24799 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
24800
24801         * statement.cs: Add support for multiple child blocks.
24802
24803 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
24804
24805         * codegen.cs (EmitCode): New function, will emit the code for a
24806         Block of code given a TypeContainer and its ILGenerator. 
24807
24808         * statement.cs (Block): Standard public readonly optimization.
24809         (Block::Block constructors): Link children. 
24810         (Block::Child): Child Linker.
24811         (Block::EmitVariables): Emits IL variable declarations.
24812
24813         * class.cs: Drop support for MethodGroups here, delay until
24814         Semantic Analysis.
24815         (Method::): Applied the same simplification that I did before, and
24816         move from Properties to public readonly fields.
24817         (Method::ParameterTypes): Returns the parameter types for the
24818         function, and implements a cache that will be useful later when I
24819         do error checking and the semantic analysis on the methods is
24820         performed.
24821         (Constructor::GetCallingConvention): Renamed from CallingConvetion
24822         and made a method, optional argument tells whether this is a class
24823         or a structure to apply the `has-this' bit.
24824         (Method::GetCallingConvention): Implement, returns the calling
24825         convention. 
24826         (Method::Define): Defines the type, a second pass is performed
24827         later to populate the methods.
24828
24829         (Constructor::ParameterTypes): implement a cache similar to the
24830         one on Method::ParameterTypes, useful later when we do semantic
24831         analysis. 
24832
24833         (TypeContainer::EmitMethod):  New method.  Emits methods.
24834
24835         * expression.cs: Removed MethodGroup class from here.
24836
24837         * parameter.cs (Parameters::GetCallingConvention): new method.
24838
24839 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
24840
24841         * class.cs (TypeContainer::Populate): Drop RootContext from the
24842         argument. 
24843
24844         (Constructor::CallingConvention): Returns the calling convention.
24845         (Constructor::ParameterTypes): Returns the constructor parameter
24846         types. 
24847
24848         (TypeContainer::AddConstructor): Keep track of default constructor
24849         and the default static constructor.
24850
24851         (Constructor::) Another class that starts using `public readonly'
24852         instead of properties. 
24853
24854         (Constructor::IsDefault): Whether this is a default constructor. 
24855
24856         (Field::) use readonly public fields instead of properties also.
24857
24858         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
24859         track of static constructors;  If none is used, turn on
24860         BeforeFieldInit in the TypeAttributes. 
24861
24862         * cs-parser.jay (opt_argument_list): now the return can be null
24863         for the cases where there are no arguments. 
24864
24865         (constructor_declarator): If there is no implicit `base' or
24866         `this', then invoke the default parent constructor. 
24867
24868         * modifiers.cs (MethodAttr): New static function maps a set of
24869         modifiers flags into a MethodAttributes enum
24870         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
24871         MethodAttr, TypeAttr to represent the various mappings where the
24872         modifiers are used.
24873         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
24874
24875 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
24876
24877         * parameter.cs (GetParameterInfo): Fix bug where there would be no
24878         method arguments.
24879
24880         * interface.cs (PopulateIndexer): Implemented the code generator
24881         for interface indexers.
24882
24883 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
24884
24885         * interface.cs (InterfaceMemberBase): Now we track the new status
24886         here.  
24887
24888         (PopulateProperty): Implement property population.  Woohoo!  Got
24889         Methods and Properties going today. 
24890
24891         Removed all the properties for interfaces, and replaced them with
24892         `public readonly' fields. 
24893
24894 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
24895
24896         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
24897         initialize their hashtables/arraylists only when they are needed
24898         instead of doing this always.
24899
24900         * parameter.cs: Handle refs and out parameters.
24901
24902         * cs-parser.jay: Use an ArrayList to construct the arguments
24903         instead of the ParameterCollection, and then cast that to a
24904         Parameter[] array.
24905
24906         * parameter.cs: Drop the use of ParameterCollection and use
24907         instead arrays of Parameters.
24908
24909         (GetParameterInfo): Use the Type, not the Name when resolving
24910         types. 
24911
24912 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
24913
24914         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
24915         and instead use public readonly fields.
24916
24917         * class.cs: Put back walking code for type containers.
24918
24919 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
24920
24921         * class.cs (MakeConstant): Code to define constants.
24922
24923         * rootcontext.cs (LookupType): New function.  Used to locate types 
24924
24925
24926 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
24927
24928         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
24929         this System.Reflection code is.  Kudos to Microsoft
24930
24931         * typemanager.cs: Implement a type cache and avoid loading all
24932         types at boot time.  Wrap in LookupType the internals.  This made
24933         the compiler so much faster.  Wow.  I rule!
24934
24935         * driver.cs: Make sure we always load mscorlib first (for
24936         debugging purposes, nothing really important).
24937
24938         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
24939         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
24940
24941         * rootcontext.cs: Lookup types on their namespace;  Lookup types
24942         on namespaces that have been imported using the `using' keyword.
24943
24944         * class.cs (TypeContainer::TypeAttr): Virtualize.
24945         (Class::TypeAttr): Return attributes suitable for this bad boy.
24946         (Struct::TypeAttr): ditto.
24947         Handle nested classes.
24948         (TypeContainer::) Remove all the type visiting code, it is now
24949         replaced with the rootcontext.cs code
24950
24951         * rootcontext.cs (GetClassBases): Added support for structs. 
24952
24953 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
24954
24955         * interface.cs, statement.cs, class.cs, parameter.cs,
24956         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
24957         Drop use of TypeRefs, and use strings instead.
24958
24959 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
24960
24961         * rootcontext.cs: 
24962
24963         * class.cs (Struct::Struct): set the SEALED flags after
24964         checking the modifiers.
24965         (TypeContainer::TypeAttr): new property, returns the
24966         TypeAttributes for a class.  
24967
24968         * cs-parser.jay (type_list): Oops, list production was creating a
24969         new list of base types.
24970
24971         * rootcontext.cs (StdLib): New property.
24972         (GetInterfaceTypeByName): returns an interface by type name, and
24973         encapsulates error handling here.
24974         (GetInterfaces): simplified.
24975         (ResolveTree): Encapsulated all the tree resolution here.
24976         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
24977         types. 
24978
24979         * driver.cs: Add support for --nostdlib, to avoid loading the
24980         default assemblies.
24981         (Main): Do not put tree resolution here. 
24982
24983         * rootcontext.cs: Beginning of the class resolution.
24984
24985 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
24986
24987         * rootcontext.cs: Provide better error reporting. 
24988
24989         * cs-parser.jay (interface_base): set our $$ to be interfaces.
24990
24991         * rootcontext.cs (CreateInterface): Handle the case where there
24992         are no parent interfaces.
24993
24994         (CloseTypes): Routine to flush types at the end.
24995         (CreateInterface): Track types.
24996         (GetInterfaces): Returns an array of Types from the list of
24997         defined interfaces.
24998
24999         * typemanager.c (AddUserType): Mechanism to track user types (puts
25000         the type on the global type hash, and allows us to close it at the
25001         end). 
25002
25003 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
25004
25005         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
25006         RecordInterface instead.
25007
25008         * cs-parser.jay: Updated to reflect changes above.
25009
25010         * decl.cs (Definition): Keep track of the TypeBuilder type that
25011         represents this type here.  Not sure we will use it in the long
25012         run, but wont hurt for now.
25013
25014         * driver.cs: Smaller changes to accomodate the new code.
25015
25016         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
25017         when done. 
25018
25019         * rootcontext.cs (CreateInterface):  New method, used to create
25020         the System.TypeBuilder type for interfaces.
25021         (ResolveInterfaces): new entry point to resolve the interface
25022         hierarchy. 
25023         (CodeGen): Property, used to keep track of the code generator.
25024
25025 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
25026
25027         * cs-parser.jay: Add a second production for delegate_declaration
25028         with `VOID'.
25029
25030         (enum_body): Put an opt_comma here instead of putting it on
25031         enum_body or enum_member_declarations so we can handle trailing
25032         commas on enumeration members.  Gets rid of a shift/reduce.
25033
25034         (type_list): Need a COMMA in the middle.
25035
25036         (indexer_declaration): Tell tokenizer to recognize get/set
25037
25038         * Remove old targets.
25039
25040         * Re-add the parser target.
25041
25042 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25043
25044         * cs-parser.jay: Add precendence rules for a number of operators
25045         ot reduce the number of shift/reduce conflicts in the grammar.
25046
25047 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
25048
25049         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
25050         and put it here.
25051
25052         Get rid of old crufty code.
25053
25054         * rootcontext.cs: Use this to keep track of the parsed
25055         representation and the defined types available to the program. 
25056
25057         * gen-treedump.cs: adjust for new convention.
25058
25059         * type.cs: Split out the type manager, and the assembly builder
25060         from here. 
25061
25062         * typemanager.cs: the type manager will live here now.
25063
25064         * cil-codegen.cs: And the code generator here. 
25065
25066 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
25067
25068         * makefile: Fixed up for easy making.
25069
25070 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25071
25072         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
25073         the 
25074
25075         (unary_expression): Expand pre_increment_expression and
25076         post_decrement_expression to reduce a shift/reduce.
25077
25078 2001-07-11  Simon Cozens
25079
25080         * cs-tokenizer.cs: Hex numbers should begin with a 0.
25081
25082         Improve allow_keyword_as_indent name.
25083
25084 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
25085
25086         * Adjustments for Beta2. 
25087
25088 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
25089
25090         * decl.cs: Added `Define' abstract method.
25091         (InTransit): new property, used to catch recursive definitions. 
25092
25093         * interface.cs: Implement `Define'. 
25094
25095         * modifiers.cs: Map Modifiers.constants to
25096         System.Reflection.TypeAttribute flags.
25097
25098         * class.cs: Keep track of types and user-defined types.
25099         (BuilderInit): New method for creating an assembly
25100         (ResolveType): New function to launch the resolution process, only
25101         used by interfaces for now.
25102
25103         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
25104         that are inserted into the name space. 
25105
25106 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
25107
25108         * ARGH.  I have screwed up my tree so many times due to the use of
25109         rsync rather than using CVS.  Going to fix this at once. 
25110
25111         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
25112         load types.
25113
25114 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
25115
25116         * Experiment successful: Use System.Type rather that our own
25117         version of Type.  
25118
25119 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
25120
25121         * cs-parser.jay: Removed nsAliases from here.
25122
25123         Use new namespaces, handle `using XXX;' 
25124
25125         * namespace.cs: Reimplemented namespace handling, use a recursive
25126         definition of the class.  Now we can keep track of using clauses
25127         and catch invalid using clauses.
25128
25129 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
25130
25131         * gen-treedump.cs: Adapted for all the renaming.
25132
25133         * expression.cs (Expression): this class now has a Type property
25134         which returns an expression Type.
25135
25136         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
25137         `Type', as this has a different meaning now in the base
25138
25139 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
25140
25141         * interface.cs, class.cs: Removed from all the sources the
25142         references to signature computation, as we can not do method
25143         signature computation during the parsing time, as we are not
25144         trying to solve at that point distinguishing:
25145
25146         class X {
25147                 void a (Blah x) {}
25148                 void a (NS.Blah x) {}
25149         }
25150
25151         Which depending on the context might be valid or not, as we do not
25152         know if Blah is the same thing as NS.Blah at that point.
25153
25154         * Redid everything so the code uses TypeRefs now instead of
25155         Types.  TypeRefs are just temporary type placeholders, that need
25156         to be resolved.  They initially have a pointer to a string and the
25157         current scope in which they are used.  This is used later by the
25158         compiler to resolve the reference to an actual Type. 
25159
25160         * DeclSpace is no longer a CIR.Type, and neither are
25161         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
25162         are all DeclSpaces, but no Types. 
25163
25164         * type.cs (TypeRefManager): This implements the TypeRef manager,
25165         which keeps track of all the types that need to be resolved after
25166         the parsing has finished. 
25167
25168 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
25169
25170         * ARGH.  We are going to have to store `foreach' as a class rather
25171         than resolving it, as we need to verify error 1579 after name
25172         resolution.   *OR* we could keep a flag that says `This request to
25173         IEnumerator comes from a foreach statement' which we can then use
25174         to generate the error.
25175
25176 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
25177
25178         * class.cs (TypeContainer.AddMethod): we now add methods to the
25179         MethodGroup instead of the method hashtable.  
25180
25181         * expression.cs: Add MethodGroup abstraction, which gets us one
25182         step closer to the specification in the way we handle method
25183         declarations.  
25184
25185         * cs-parser.jay (primary_expression): qualified_identifier now
25186         tried to match up an identifier to a local variable reference or
25187         to a parameter reference.
25188
25189         current_local_parameters is now a parser global variable that
25190         points to the current parameters for the block, used during name
25191         lookup.
25192
25193         (property_declaration): Now creates an implicit `value' argument to
25194         the set accessor.
25195
25196 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
25197
25198         * parameter.cs: Do not use `param' arguments as part of the
25199         signature, per the spec.
25200
25201 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
25202
25203         * decl.cs: Base class for classes, structs and interfaces.  This
25204         is the "Declaration Space" 
25205
25206         * cs-parser.jay: Use CheckDef for checking declaration errors
25207         instead of having one on each function.
25208
25209         * class.cs: Factor out some code for handling error handling in
25210         accordance to the "Declarations" section in the "Basic Concepts"
25211         chapter in the ECMA C# spec.
25212
25213         * interface.cs: Make all interface member classes derive from
25214         InterfaceMemberBase.
25215
25216 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
25217
25218         * Many things: all interfaces are parsed and generated in
25219         gen-treedump.  Support for member variables, constructors,
25220         destructors, properties, constants is there.
25221
25222         Beginning of the IL backend, but very little done, just there for
25223         testing purposes. 
25224
25225 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
25226
25227         * cs-parser.jay: Fix labeled statement.
25228
25229         * cs-tokenizer.cs (escape): Escape " and ' always.
25230         ref_line, ref_name: keep track of the line/filename as instructed
25231         by #line by the compiler.
25232         Parse #line.
25233
25234 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
25235
25236         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
25237         to match the values in System.CodeDOM.
25238
25239         Divid renamed to Divide.
25240
25241         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
25242         statements. 
25243         (Statements.set): remove.
25244
25245         * System.CodeDOM/CodeCatchClause.cs: always have a valid
25246         statements. 
25247
25248         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
25249         falseStatements always have valid values. 
25250
25251         * cs-parser.jay: Use System.CodeDOM now.
25252