*** merged revision 57580 from mcs
[mono.git] / mcs / gmcs / ChangeLog
1 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
2
3         A fix for #77353.
4
5         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
6         (Event.Define): ditto
7         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
8
9         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
10         Removed redundant code and set NewSlot for Invoke method too.
11
12         * parameter.cs (Parameters.ctor): Add custom, type ctor.
13         (Parameters.MergeGenerated): New method. Use this method when you merge
14         compiler generated argument with user arguments.
15
16 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
17
18         * attribute.cs (ResolveAsTypeTerminal): Removed.
19
20         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
21         specialization for predefined types; 30% speed up.
22         Finally placed obsolete check to right place.
23         (Expression.ResolveType): Removed.
24
25         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
26         Updated after ResolveType was removed.
27
28         * expression.cs (Cast.ctor): Check void cast.
29         (Binary.ResolveAsTypeTerminal): Is never type.
30         (Conditional.ResolveAsTypeTerminal): Is never type.
31
32         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
33
34 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
35
36         * rootcontext.cs (ResolveCore): Removed System.INullableValue.
37
38 2006-03-23  Martin Baulig  <martin@ximian.com>
39
40         * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
41         type check if either of the types is an open generic type.
42
43 2006-03-23  Martin Baulig  <martin@ximian.com>
44
45         * convert.cs
46         (Convert.ExplicitTypeParameterConversion): New method; implement
47         explicit type parameter conversions.
48
49 2006-03-23  Martin Baulig  <martin@ximian.com>
50
51         * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
52         blindly allow all conversions if we do not have any constraints.
53
54 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
55
56         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
57         these two separated members to simplify the code.
58         (Attribute.Resolve): Refactored to use new fields and methods.
59         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
60         implemented obsolete attribute checking.
61         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
62         implemented obsolete checking again. It look line never ending quest ;-)
63         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
64
65         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
66
67         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
68
69         *class.cs (Property.Define): Add RegisterProperty call.
70
71         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
72         argument groups (only 2).
73
74         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
75         encoding expression to arguments.
76         (Expression.ExprClassToResolveFlags): Just turned to property.
77
78         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
79         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
80         optimized as well as implemented support for zero-length attributes.
81
82         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
83         Add caching of PropertyInfo's.
84
85 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
86
87         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
88         error multiple times.
89
90 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
91
92         New partial class implementation.
93         A fix for #77027, #77029, #77403
94
95         * attribute.cs (Attributable): Made attributes protected.
96
97         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
98         the replacements of ClassPart and PartialContainer.
99         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
100         (TypeContainer.AddInterface): Ditto.
101         (TypeContainer.AddPartial): The main method for partial classes. It checks
102         for errors and merges ModFlags and attributes. At the end class is added to
103         partial_parts list.
104         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
105         required here.
106         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
107         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
108         from the rest of partial classes.
109         (TypeContainer.GetClassBases): Simplified.
110         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
111         DefineType.
112         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
113         (TypeContainer.HasExplicitLayout): Uses Flags now.
114         (PartialContainer): Removed.
115         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
116         (StaticClass): Was merged with Class.
117         (Class.GetClassBases): class and static class bases are verified here.
118         (Class.TypeAttr): Added static attributes when class is static.
119         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
120         (MemberBase): In some cases we need to call parent container for partial
121         class. It should be eliminated but it's not easy now.
122
123         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
124
125         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
126         partial classed to accumulate class comments.
127         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
128
129         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
130
131         * driver.cs (MainDriver): Tree.GetDecl was removed.
132
133         * modifiers.cs (Modifiers): Add partial modifier.
134
135         * tree.cs (Tree.decl): Removed.
136         (RootTypes): Started to use this class more often for root types
137         specializations.
138
139 2006-03-23  Raja R Harinath  <rharinath@novell.com>
140
141         * generic.cs (TypeParameter.UpdateConstraints): Update
142         'constraints' if null.
143
144 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
145
146         A fix for #77615
147
148         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
149         external interface does not have an attribute.
150
151 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
152
153         Another prerequisites for new partial classs implementation.
154         
155         * attribute.cs (Attribute.Equal): Implemented.
156         (Attribute.Emit): Changed as attributes can be applied more than twice.
157         (Attributes.Emit): Check for duplicate attributes here.
158
159         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
160         as a parameter, clean-up.
161
162 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
163
164         A fix for #77485
165
166         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
167         contains obsolete attribute check which can in some cases look for base
168         type of current class which is not initialized yet.
169         (TypeContainer.BaseType): Replacement of ptype.
170
171         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
172
173 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
174
175         First of prerequisites for new partial classs implemention.
176         
177         * attribute.cs (Attributable): Extended by ResolveContext;
178         Attributes finally have correct context for resolving in all cases.
179         (AttachTo): Attribute owner is assigned here.
180
181         * codegen.cs (IResolveContext): Introduce new interface to hold
182         all information needed in resolving phase.
183         (EmitContext): Implements IResolveContext; more clean-up needed here.
184         
185         * decl.cs (MemberCore): Implemented IResolveContext.
186
187         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
188         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
189         parameter.cs, statement.cs, tree.cs, typemanager.cs:
190         Refactored to use new IResolveContext instead of EmitContext; cleanup
191
192 2006-03-22  Raja R Harinath  <rharinath@novell.com>
193
194         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
195         mcs to keep code differences small.
196         * attribute.cs (Attribute.GetParameterDefaultValue): New.
197         * typemanager.cs (parameter_default_value_attribute_type): New.
198         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
199         CS1908 check.
200
201 2006-03-22  Martin Baulig  <martin@ximian.com>
202
203         * generic.cs
204         (Nullable.NullableLiteral): Derive from `NullLiteral'.
205
206         * convert.cs
207         (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
208         instead of the normal `NullLiteral'.
209
210 2006-03-21  Martin Baulig  <martin@ximian.com>
211
212         Fix #77583.
213         * generic.cs (TypeManager.InferType): If `pt' is a generic
214         parameter, don't check whether `pt == at'.
215
216 2006-03-20  Raja R Harinath  <rharinath@novell.com>
217
218         Fix #77852
219         * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
220         (TypeParameter.Resolve): Update to change.
221         (ConstraintChecker.CheckConstraints): Resolve type-argument
222         constraints before use.
223
224 2006-03-16  Martin Baulig  <martin@ximian.com>
225
226         * generic.cs
227         (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
228         and don't have any instance constructors, also lookup in the base class.
229         (TypeManager.IsNullableValueType): New public method.
230
231         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
232         `BindingFlags.DeclaredOnly' flag and set `used_cache'.
233         (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
234
235         * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
236         instead of just TypeManager.IsNullableType() to determine whether
237         a lifted operator exists.
238         (UnaryMutator.DoResolve): Likewise.
239         (Conditional.DoResolve): Likewise.
240         (Binary.DoResolve): A lifted operator only exists if both operands
241         are valuetypes and at least one of them is a nullable type.
242
243 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
244
245         * iterator.cs : yield break is allowed in try statement which has
246           catch clauses. Fixed bug #77767.
247
248 2006-03-12  Martin Baulig  <martin@ximian.com>
249
250         * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
251         private IsSignatureEqual() to compare types; see the comment in
252         that method; fixes #77674.
253
254 2006-03-10  Raja R Harinath  <rharinath@novell.com>
255
256         * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
257         (Expression.ResolveAsTypeTerminal): Likewise.
258         * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
259         * expression.cs, generic.cs, iterators.cs: Likewise.
260         * parameter.cs, statement.cs, typemanager.cs: Likewise.
261
262 2006-03-09  Martin Baulig  <martin@ximian.com>
263
264         * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
265         TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
266
267 2006-03-09  Martin Baulig  <martin@ximian.com>
268
269         * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
270         `prepared' flag is set.
271
272         * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
273         (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
274         issues; see gtest-254.cs.
275
276 2006-03-07  Martin Baulig  <martin@ximian.com>
277
278         * generic.cs (TypeManager.InferType): Allow infering
279         `IEnumerable<T>' with an array of T; see gtest-251.cs.
280
281 2006-03-06  Martin Baulig  <martin@ximian.com>
282
283         * generic.cs
284         (TypeManager.InferType): Fix gtest-250.cs.
285
286         * typemanager.cs
287         (TypeManager.IsSubclassOf): Also check the base class.
288
289         * expression.cs
290         (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
291         fixes gtest-249.cs.
292
293 2006-03-01  Raja R Harinath  <rharinath@novell.com>
294
295         Fix #77679.
296         * expression.cs (ParameterReference.DoResolveBase): Change return
297         type to bool.
298         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
299         Update.
300
301         Fix #77628.
302         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
303
304         Fix #77642.
305         * typemanager.cs (GetFullNameSignature): Don't nullref on
306         protected accessors.
307
308 2006-02-16  Martin Baulig  <martin@ximian.com>
309
310         * generic.cs
311         (TypeManager.GetGenericFieldDefinition): New public method; use it
312         instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
313
314 2006-02-14  Martin Baulig  <martin@ximian.com>
315
316         * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
317
318 2006-02-14  Martin Baulig  <martin@ximian.com>
319
320         * generic.cs
321         (TypeManager.DropGenericMethodArguments): New public method; don't
322         use GetGenericMethodDefinition() on something which is not a
323         generic method.
324
325 2006-02-14  Martin Baulig  <martin@ximian.com>
326
327         * generic.cs
328         (ConstraintChecker.CheckConstraints): If a type parameter has the
329         `struct' constraint, the type must be a non-nullable valuetype.
330
331 2006-02-10  Martin Baulig  <martin@ximian.com>
332
333         * typemanager.cs
334         (TypeManager.IsOverride): Make this work for instantiated methods
335         in a generic class; fixes #77509.
336         (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
337         rather than calling it directly; fixes #77488.  
338
339 2006-02-08  Martin Baulig  <martin@ximian.com>
340
341         * generic.cs (ConstraintChecker.CheckConstraints): Move the error
342         reporting into CheckConstraint() so we can use the correctly
343         instantiated type.
344
345 2006-02-08  Martin Baulig  <martin@ximian.com>
346
347         * expression.cs (BaseAccess): Add support for generic methods.
348
349         * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
350         the new MethodGroupExpr.
351
352 2006-02-07  Martin Baulig  <martin@ximian.com>
353
354         * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
355         also reference types; fixes #77483.
356
357 2006-02-07  Martin Baulig  <martin@ximian.com>
358
359         * generic.cs
360         (TypeManager.IsGenericMethod): We now return whether something is
361         an instantiated generic method (and not a generic method def).
362         (TypeManager.IsGenericMethodDefinition): New public method.
363
364         * typemanager.cs
365         (TypeManager.CSharpSignature): Only include type arguments for
366         "real" generic methods, not for any instantiated method.
367         (TypeManager.GetMethodName): Likewise, but also allow generic
368         method definitions here.
369
370 2006-02-06  Miguel de Icaza  <miguel@novell.com>
371
372         * codegen.cs (EmitScopeInitFromBlock): check here the
373         capture_context, there is no need to make two calls to the
374         EmitContext. 
375
376         * anonymous.cs: Add some debugging messages that might help me
377         track other instances of this problem in the future (the
378         regression of test 467).
379
380         * cs-parser.jay: track the variable block, as we need to initalize
381         any captured variables declared in this block for the "catch"
382         portion of the "Try" statement.
383
384         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
385         scope initialization for captured variables. 
386
387         Also, move the emit for the variables after the block location has
388         been marked.
389
390 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
391
392        * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
393         
394 2006-02-06  Martin Baulig  <martin@ximian.com>
395
396         * class.cs (TypeContainer.DefineType): If we're a struct, pass
397         `TypeManager.value_type' as parent type to
398         ModuleBuilder.DefineType().  Fixes #77358.      
399
400 2006-02-02  Miguel de Icaza  <miguel@novell.com>
401
402         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
403         commit yesterday, the initialization for the roots is necessary.
404         What is not necessary is the scope activation.
405
406 2006-02-02  Raja R Harinath  <rharinath@novell.com>
407
408         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
409         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
410         CS0206 checks.
411         (Argument.Resolve): Remove CS0206 checks.
412
413 2006-02-01  Miguel de Icaza  <miguel@novell.com>
414
415         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
416         scopes for all the roots, the scopes will now be emitted when the
417         Blocks are entered. [This change was wrong, fixed on 2006-02-02]
418
419         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
420         code.  This reduces a lot of existing cruft.
421         
422         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
423         that the ScopeInfo is generated as we enter the scope, not at the
424         time of use, which is what we used to do before.
425
426         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
427         every time a Block is about to be emitted if we have a
428         CaptureContext. 
429
430 2006-02-01  Raja R Harinath  <rharinath@novell.com>
431
432         * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
433         attribute for mscorlib too.
434
435         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
436         (Reset): Update.
437         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
438
439         * typemanager.cs (cons_param_array_attribute): Make private.
440         (Reset): Set it to null.
441         (InitCoreHelpers): Don't initialize it.
442         (ConsParamArrayAttribute): New.  Initialize it as needed.
443         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
444
445 2006-01-31  Miguel de Icaza  <miguel@novell.com>
446
447         * expression.cs: There might be errors reported during the
448         selection of applicable methods.  If there are errors, do not
449         continue execution as it will lead the compiler to crash.
450
451 2006-01-30  Miguel de Icaza  <miguel@novell.com>
452
453         * expression.cs: Member access is not allowed on anonymous
454         methods.  Fixes #77402.
455
456 2006-01-30  Raja R Harinath  <rharinath@novell.com>
457
458         Fix #77401
459         * cs-parser.jay (VariableDeclaration): Don't set
460         current_array_type to null.
461         (field_declaration, event_declaration, declaration_statement):
462         Set it to null here.
463
464 2006-01-29  Raja R Harinath  <harinath@gmail.com>
465
466         Fix part of #77397
467         * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
468
469 2006-01-28  Raja R Harinath  <harinath@gmail.com>
470
471         * typemanager.cs (GenericParameterPosition): New.
472         * doc.cs: Use it.
473
474 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
475
476         * doc.cs : To process "include" elements, first we should create
477           another list than XmlNodeList, because it could result in node
478           removal, which could result in that the XmlNodeList gives up
479           yielding next node.
480
481 2006-01-25  Miguel de Icaza  <miguel@novell.com>
482
483         * expression.cs: Introduce an error report that we were not
484         catching before.   Gonzalo ran into it.
485
486 2006-01-23  Miguel de Icaza  <miguel@novell.com>
487
488         A fix for bug: #76957
489         
490         * iterators.cs (MoveNextMethod.CreateMethodHost): call
491         ComputeMethodHost before creating the method, this is a new
492         requirement. 
493
494         * anonymous.cs (AnonymousContainer): Now we track all the scopes
495         that this method references (RegisterScope).  The actual scope
496         where the method is hosted is computed with the ComputeMethodHost
497         before we create the method.
498
499         Moved the Deepest routine here.
500
501         (AnonymousContainer.ComputeMethodHost): New routine used to
502         compute the proper ScopeInfo that will host the anonymous method.
503
504         (ScopeInfo): Deal with multiple roots.  The problem was that we
505         did not have a unique root where all ScopeInfos could be hanged
506         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
507         of roots.  
508
509         Remove AdjustMethodScope which is now computed at the end.  Remove
510         LinkScope which did a partial link, instead link all ScopeInfos
511         before code generation from the new "LinkScopes" routine. 
512
513         Simplify all the Add* routines as they no longer need to maintain
514         the tree, they just need to record that they are using variables
515         from a ScopeInfo.
516
517         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
518         routines to produce the forest of ScopeInfo trees.
519
520         * class.cs (TypeContainer.AppendMethod): This is just like
521         AddMethod, but ensures that an interface implementation method
522         (IEnumerable.XXX) is not inserted at the beginning of the queue of
523         methods, but at the end.
524
525         We use this functionality to ensure that the generated MoveNext
526         method in the iterator class is resolved/emitted before the
527         enumerator methods created.   
528
529         This is required because the MoveNext method computes the right
530         ScopeInfo for the method.  And the other methods will eventually
531         need to resolve and fetch information computed from the anonymous
532         method. 
533
534         
535 2006-01-23  Raja R Harinath  <rharinath@novell.com>
536
537         Improve implementation of section 14.4.2.2 (Better function member).
538         * expression.cs (Invocation.MoreSpecific): Compare all type
539         arguments before deciding if one type is more specific than
540         another.  Handle array types too.  Return the more specific type.
541         (Invocation.BetterFunction): Add more tie-breaking rules from
542         section 14.4.2.2.  Perform "more specific" check after
543         other tie-breaking rules.  Compare all parameter types before
544         choosing the "more specific" method.
545
546 2006-01-21  Raja R Harinath  <harinath@gmail.com>
547             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
548
549         Fix rest of #76995.
550         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
551         the 'aliases' hash.
552         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
553         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
554
555 2006-01-18  Martin Baulig  <martin@ximian.com>
556
557         * class.cs (TypeContainer.AddToMemberContainer): Use
558         `symbol.MemberName.MethodName' instead of just `symbol.Name';
559         fixes #77124.
560
561 2006-01-18  Martin Baulig  <martin@ximian.com>
562
563         Fix #76417: a generic class may now have methods which may unify
564         for some type parameter substitutions.
565
566         * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
567         for methods which may unify anymore.
568
569         * expression.cs (Invocation.MoreSpecific): New private static
570         method; checks whether one method is more specific than another
571         according to 14.4.2.2 of the spec.
572         (Invocation.BetterFunction): Implement the tie-breaking rules from
573         14.4.2.2 of the spec: if two methods unify for some type parameter
574         substitution, we need to pick the more specific one.
575
576 2006-01-18  Raja R Harinath  <rharinath@novell.com>
577
578         Fix #76656, cs0231-2.cs.
579         * cs-parser.jay (formal_parameter_list): Make error case catch
580         more issues.
581         (parenthesized_expression_0): Add CS1026 check.
582         (invocation_expression): Remove unused { $$ = lexer.Location }.
583
584 2006-01-17  Raja R Harinath  <rharinath@novell.com>
585
586         Fix #76824.
587         * cs-parser.jay (statement_expression): Don't list out the
588         individual statement-expressions.  Convert syntax error into
589         CS0201 check.
590
591 2006-01-16  Raja R Harinath  <rharinath@novell.com>
592
593         Fix #76874.
594         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
595         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
596         CheckIntermediateModification.
597         (FieldExpr.DoResolve): Add new two-argument version that
598         allows us to resolve the InstanceExpression as an lvalue.
599         The one-argument variant is now just a wrapper.
600         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
601         Resolve the lhs as an lvalue if the it has a value type.
602         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
603         from Assign.DoResolve.
604         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
605         resolved as an lvalue.
606         (PropertyExpr.DoResolve): Update.
607         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
608         has a value type.  Move CS1612 check here from
609         CheckIntermediateModification.
610         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
611         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
612         'right_side' of a ResolveLValue on an 'out' argument.
613         (EmptyExpression.LValueMemberAccess): New.  Used as the
614         'right_side' of a propagated ResolveLValue on a value type.
615         (LocalVariableReference.DoResolveBase): Recognize
616         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
617         Add CS1654 check.
618         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
619         EmptyExpression.Null.
620
621 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
622
623         * typemanager.cs : added IsGenericParameter(). In gmcs it returns
624           Type.IsGenericParameter(). Fixed bug #77183.
625         * doc.cs : it is now identical to doc.cs in mcs.
626
627 2006-01-16  Martin Baulig  <martin@ximian.com>
628
629         * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
630
631 2006-01-16  Martin Baulig  <martin@ximian.com>
632
633         * typemanager.cs (TypeManager.CSharpSignature): Make this work for
634         ctors; fixes #77250.
635
636 2006-01-12  Miguel de Icaza  <miguel@novell.com>
637
638         This fixes the problem where we used ldfld instead of ldflda to
639         load the "THIS" pointer on captured parameters, when THIS is a
640         value type.  See bug #77205.
641         
642         * iterators.cs (CapturedThisReference.Emit): Pass false to
643         EmitThis (we do not need the address).
644
645         * codegen.cs (EmitThis): it needs to know whether we need the
646         address of `this' or not.  This is used by value types.  
647
648         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
649         every other call passes false.
650
651 2006-01-12  Raja R Harinath  <rharinath@novell.com>
652
653         Fix #77221.
654         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
655         GetOverride.
656         * expression.cs (Invocation.OverloadResolve): Update.
657         (Invocation.DoResolve): Avoid double resolution of invocation.
658
659 2006-01-11  Raja R Harinath  <rharinath@novell.com>
660
661         Fix #77180.
662         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
663         unary negation of floating point types as 0-expr; negation cannot
664         overflow in floating point types.
665
666         Fix #77204.
667         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
668         on operands of 'void' type.
669
670         Fix #77200.
671         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
672         and ExclusiveOr for boolean constants too.
673
674 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
675
676         * expression.cs: Fix Console.WriteLine ((this = x).foo);
677
678 2006-01-12  Miguel de Icaza  <miguel@novell.com>
679
680         * cs-tokenizer.cs (Position): New class used to save and restore
681         the position state in the tokenizer.  Before this patch the save
682         and restore was not complete enough so the line and columns would
683         start to drift and the debugger and stack traces will get the
684         wrong data.
685
686 2006-01-10  Martin Baulig  <martin@ximian.com>
687
688         * generic.cs
689         (TypeParameter.InflateConstraints): New public method.
690
691         * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
692         constraints; fixes #77042.
693
694 2006-01-10  Martin Baulig  <martin@ximian.com>
695
696         * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
697         instead of the `TypeBuilder' for this "<>THIS" variable; fixes
698         #77061. 
699
700 2006-01-09  Raja R Harinath  <rharinath@novell.com>
701
702         Fix #75636.
703         * expression.cs (Invocation.OverloadResolve): Replace reflected
704         override methods with their base virtual methods, rather than
705         skipping over them.
706         * typemanager.cs (TypeManager.GetOverride): New.
707
708 2005-12-21  Miguel de Icaza  <miguel@novell.com>
709
710         * driver.cs: Report the case of no source files and no -out:
711         argument provided.
712
713 2005-12-20  Raja R Harinath  <rharinath@novell.com>
714
715         Fix #77035.
716         * expression.cs (ComposedCast.GetSignatureForError): Define.
717
718 2006-01-05  Jb Evain  <jbevain@gmail.com>
719
720         * class.cs (Property.Define, Indexer.Define): do not tag the
721         properties as SpecialName | RTSpecialName.
722
723 2006-01-04  Miguel de Icaza  <miguel@novell.com>
724
725         * class.cs (MethodCore.IsDuplicateImplementation): This method was
726         doing a low-level comparission of parameter types.  It was lacking
727         a check for __argslist. 
728
729 2005-12-30  Miguel de Icaza  <miguel@novell.com>
730
731         * expression.cs (ParameterReference.DoResolveBase): Allow
732         reference parameters if they are local to this block. 
733
734         This allows the ref and out parameters of a delegate to be used in
735         an anonymous method, for example:
736
737         delegate void set (out int x);
738
739         set s = delegate (out int x){
740                 x = 0;
741         };
742
743         This is used by functionality introduced late in the C# language.
744         
745         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
746         method that take ref and out parameters. 
747
748         Fixes #77119 which was a late change in the spec.
749
750 2005-12-23  Miguel de Icaza  <miguel@novell.com>
751
752         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
753         parent if its the same scope.  Fixes #77060.
754
755 2005-12-22  Marek Safar  <marek.safar@seznam.cz>
756
757         * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
758
759 2005-12-21  Carlos Alberto Cortez <calberto.cortez@gmail.com>
760
761         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
762         errors 1726 for strong named assemblies with InternalsVisibleToAttribute 
763         that doesn't contain the full public key. This is a update of the
764         friend assemblies in .Net 2.0 release.
765         
766 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
767
768         Fix #76995
769
770         * namespace.cs (NamespaceEntry): Add extern_aliases as a
771         ListDictionary, to contain the ExternAliasEntry entries (in
772         addition to the NamespaceEntry.aliases hashtable). This field is
773         shared between the original entry and its doppelganger (bodyless 
774         copy of it).
775         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
776         extern_aliases field.
777         (NamespaceEntry.Lookup): Move the IsImplicit check after the
778         lookup in extern_aliases.
779
780 2005-12-16  Raja R Harinath  <rharinath@novell.com>
781
782         Fix #77006.
783         * class.cs (TypeContainer.Mark_HasEquals): New.
784         (TypeContainer.Mark_HasGetHashCode): New.
785         (ClassPart): Override them.
786         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
787
788         * generic.cs (GenericMethod.DefineMembers): Update to changes.
789         (TypeParameter.TypeParameter): Change type of 'parent' argument to
790         DeclSpace.
791
792         Fix #77008.
793         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
794         'parent' argument to the base constructor.
795
796         Remove all mention of TypeContainer from decl.cs.
797         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
798         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
799         (DeclSpace.DeclSpace): Likewise.
800         (DeclSpace.DefineMembers): Remove unused argument.
801         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
802         debugging check -- we don't care if the debug code throws an
803         InvalidCastException instead of an InternalErrorException.
804         * class.cs (TypeContainer.DefineMembers): Update to changes.
805         (TypeContainer.DoDefineMembers): Likewise.
806         (TypeContainer.GetMethods): Likewise.
807         (PropertyMember.Define): Likewise.
808         (MemberBase.Parent): New property that forwards to
809         MemberCore.Parent, but ensures that we get a TypeContainer.
810         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
811         (RootContext.PopulateTypes): Likewise.  Remove special case code
812         for !RootContext.StdLib: DefineMembers is idempotent.
813
814 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
815
816         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
817
818 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
819
820         * doc.cs : The search for referenced namespace was insufficient to
821           get global one as it used to do. Fixed bug #76965.
822
823 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
824
825         * doc.cs : check name in cref in the last phase that whether it is
826           namespace or not.
827
828 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
829
830         * cs-tokenizer.cs : reverted the latest change: it somehow broke
831           Mono.C5.
832
833 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
834
835         * doc.cs : so it turned out that we cannot skip override check for 
836           interface members. Fixed bug #76954.
837
838 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
839
840         * cs-tokenizer.cs : fixed bug #75984:
841           - #warning and #error should not be handled when the source line
842             is disabled.
843           - #line is not checked strictly when the source line is disabled.
844           - #define and #undef is on the other hand checked strictly at any
845             state.
846
847 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
848
849         * cs-tokenizer.cs : missing Location (actually, filename) in one of
850           CS1027 report.
851
852 2005-12-15  Raja R Harinath  <rharinath@novell.com>
853
854         * generic.cs (TypeManager.IsGeneric): Remove unused method.
855
856         * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
857         nested types.
858
859 2005-12-14  Martin Baulig  <martin@ximian.com>
860
861         * typemanager.cs (TypeManager.GetFullName): Make this public;
862         `Type.Fullname' now never returns null.
863
864         * class.cs (Method.Define): Use TypeManager.GetFullName() for
865         explicit interface implementations; we're now using the same
866         naming convention than csc does.
867
868 2005-12-14  Miguel de Icaza  <miguel@novell.com>
869
870         * convert.cs (ExplicitConversionCore): Check the return value from
871         ExplicitConversionCore which can return null on failure.  Fixes #76914
872
873 2005-12-09  Raja R Harinath  <rharinath@novell.com>
874
875         * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
876         instead of IsGenericInstance.
877         * generic.cs (TypeManager.IsEqual): Likewise.  Delete redundant
878         code that's now covered by the more general test.
879         * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
880
881         * generic.cs (DropGenericTypeArguments): New.  Captures the common
882         pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
883         * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
884         * generic.cs, report.cs, typemanager.cs: Likewise.
885
886 2005-12-08  Martin Baulig  <martin@ximian.com>
887
888         * generic.cs (TypeArguments.Resolve): Added CS1547 check.
889
890         * typemanager.cs (TypeManager.CSharpSignature): Include type
891         arguments in the signature of a generic method.
892
893 2005-12-07  Martin Baulig  <martin@ximian.com>
894
895         Add support for custom attributes on type parameters.
896
897         * cs-parser.jay (type_arguments): Added `opt_attributes'.
898
899         * generic.cs (TypeParameterName): New public class; we use this
900         instead of a `string' to store the name of a type parameter, so we
901         can also have `Attributes'.
902         (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
903         array instead of a `string[]' array.
904         (TypeParameter.ctor): We now also take an `Attributes' argument.
905         (TypeParameter.EmitAttributes): New public method; emit our
906         `OptAttributes' here.
907         (GenericMethod.EmitAttributes): New public method; emit the custom
908         attributes on all our type parameters.
909
910         * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
911         our type parameters.
912         (MethodData.Define): If we're a generic method, call
913         EmitAttributes() on it.
914
915 2005-12-07  Martin Baulig  <martin@ximian.com>
916
917         * generic.cs
918         (ConstraintChecker): New public abstract class; move the
919         constraint checking here from `ConstructedType' and also do
920         constraint checking for generic methods here.
921
922         * expression.cs (Invocation.OverloadResolve): Use
923         ConstraintChecker.CheckConstraints() if we resolved to a generic
924         method.  Fix #76806.
925
926 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
927
928         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
929
930         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
931         event initializers.
932         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
933         (FieldBase.Initializer): Initializer is now optional.
934         (EventField.Define): Only event field can have initializer.
935
936         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
937
938         * const.cs (Const): Reuse initializer.
939
940         * cs-parser.jay: Updated after FieldBase changes.
941         Added current_array_type to simplify array initializers.
942
943         * ecore.cs (NullCast.IsDefaultValue): Implemented.
944
945         * expression.cs, iterators.cs: Updated.
946
947         * namespace.cs (NamespaceEntry): Made UsingFound private.
948
949 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
950
951         * parameterCollection.cs: Obsolete, removed.
952         * parser.cs: Obsolete, removed.
953
954 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
955
956         Fix #76849.
957         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
958
959         * enum.cs (Enum.Define): Set obsolete context here.
960
961 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
962
963         * doc.cs :
964           - FindDocumentedMember() now expects 1) paramList as null
965             when "we don't have to check the number of parameters" and
966             2) Type.EmptyTypes when "there is no arguments".
967           - Introduced FoundMember struct to hold the exact type which was
968             used to find the documented member (the above change broke
969             test-xml-044; it might be better just to use DeclaringType than
970             what MS does, like this change does, but it depends on usage.)
971
972 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
973
974         * doc.cs : documented member might be from DeclaringType for nested
975           types. Fixed bug #76782.
976
977 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
978
979         * anonymous.cs: Have the param code handle leaving copies on the
980         stack etc. Allows anonymous params to take part in the assignment
981         code (++, +=, etc). Fixes bug #76550
982
983         * expression.cs: Handle the prepare_for_load/leave_copy by passing
984         it down to the anon code.
985
986         * iterators.cs: Use dummy var here
987
988         * codegen.cs: Handle new vars
989
990 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
991
992         Fix #76849.
993         * class.cs (MethodData.Define): Set proper Obsolete context.
994
995         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
996         obsolete context.
997         (FieldExpr.DoResolve): Ditto.
998
999 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1000
1001         Fix #76849.
1002         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1003         parent is not obsolete.
1004
1005 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
1006
1007         * doc.cs : (FindDocumentedMember) find parameterless members first
1008           and get CS0419 in the early stage. Fixed first case of bug #76727.
1009
1010 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
1011
1012         Fix #76859.
1013         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1014         no error was reported.
1015
1016         *expression.cs (Binary.DoResolve): left can be null.
1017
1018 2005-12-06  Raja R Harinath  <rharinath@novell.com>
1019
1020         * class.cs (MethodCore.CheckGenericOverride): Delete unused
1021         abstract method and all overrides.
1022         * support.cs (ParameterData.GenericConstraints): Delete.
1023         (ReflectionParameters.type_params): Delete.
1024         (ReflectionParameters.ReflectionParameters): Make private.
1025         (ReflectionParameters.GetConstaints): New factory method.
1026         * generic.cs (TypeParameterDefineType): Use it.
1027         (TypeManager.GetTypeParameterConstraints): Likewise.
1028
1029 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
1030
1031         Fix #76783.
1032         * class.cs (MethodData.Emit): Parameters should be labeled first.
1033
1034 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
1035
1036         Fix #76761.
1037         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1038
1039 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
1040
1041         * attribute.cs (AreParametersCompliant): Moved to Parameter.
1042
1043         * class.cs (MethodCore): Parameter clean up.
1044         (IMethodData): Added ParameterInfo.
1045         (MethodData): Parameter clean up.
1046         (Indexer.Define): Parameter clean up.
1047
1048         * anonymous.cs,
1049         * codegen.cs,
1050         * cs-parser.jay,
1051         * decl.cs,
1052         * doc.cs,
1053         * ecore.cs,
1054         * flowanalysis.cs,
1055         * iterators.cs,
1056         * pending.cs,
1057         * statement.cs,
1058         * typemanager.cs: Parameter clean up.
1059
1060         * delegate.cs (Define): Get rid of duplicated code.
1061
1062         * expression.cs (ParameterReference): Removed useless parameters
1063         and simplified.
1064         (Invocation): Ditto.
1065
1066         * parameter.cs (ParamsParameter): New class, params specialization.
1067         (ArglistParameter): Attemp to separate arglist.
1068         (Parameter): Refactored to be reusable and faster.
1069         (Parameter.Modifier): Made understandable.
1070         (Parameters): Changed to be used as a class for `this' assembly
1071         parameters. Refactored to use new specialized classes.
1072
1073         * support.cs (ParameterData): Added Types property.
1074         (InternalParameters): Deleted.
1075
1076 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1077
1078         * doc.cs : the previous patch does not actually fix the bug.
1079           PropertyInfo override check is now implemented and really fixed it.
1080         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
1081
1082 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1083
1084         * doc.cs : apply "override filter" also to properties.
1085           Fixed bug #76730.
1086
1087 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1088
1089         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
1090           no need to check overrides. For classes, omit those results from 
1091           interfaces since they must exist in the class. Fixed bug #76726.
1092
1093 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1094
1095         * typemanager.cs : (GetFullNameSignature) differentiate indexers
1096           with different parameters. Fixed the second problem in #76685.
1097
1098 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1099
1100         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
1101           get expected 'protected' access in CheckValidFamilyAccess()).
1102           Fixed bug #76692.
1103
1104 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1105
1106         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
1107           Fixed bug #76705.  CS1569 was incorrectly commented out.
1108
1109 2005-11-23  Martin Baulig  <martin@ximian.com>
1110
1111         * generic.cs (Constraints.Define): Removed.
1112         (TypeParameter.DefineConstraints): Removed.
1113         (TypeParameter.DefineType): Call SetGenericParameterAttributes()
1114         on the GenericTypeParameterBuilder here.
1115
1116 2005-11-23  Martin Baulig  <martin@ximian.com>
1117
1118         * typemanager.cs (TypeManager.GetProperty): Make this public.
1119
1120         * generic.cs (Nullable.NullableInfo.ctor): Use
1121         TypeManager.GetProperty() rather than using reflection directly.
1122
1123 2005-11-17  Martin Baulig  <martin@ximian.com>
1124
1125         * expression.cs (Indexers.GetIndexersForType): Added support for
1126         generic parameters; fixes #76587.
1127
1128 2005-11-17  Martin Baulig  <martin@ximian.com>
1129
1130         * anonymous.cs
1131         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
1132         inherit the scope from our parent.  Fixes #76653.
1133
1134 2005-11-15  Martin Baulig  <martin@ximian.com>
1135
1136         * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
1137         instead of `ScopeTypeBuilder' to refer to the "current" type.
1138         (AnonymousMethod.CreateScopeType): Correctly create the helper
1139         class if we're inside a generic type definition.
1140
1141 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1142
1143         * doc.cs : use Invocation.IsOverride() to do real override check.
1144         * expression.cs : made Invocation.IsOverride() internal.
1145
1146 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1147
1148         * doc.cs : use TypeManager.FindMembers() instead of (possible)
1149           TypeBuilder.FindMembers() and filter overriden base members out.
1150           Fixed bug #76990.
1151
1152 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1153
1154         * doc.cs : ref/out parameters are represented as '@' (instead of
1155           '&' in type FullName). Fixed bug #76630 (additionally crefs).
1156
1157 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1158
1159         * doc.cs : when there was no '.' in cref to methods in doc comment,
1160           then parameters were missing in the output. Fixed bug #76691.
1161
1162 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1163
1164         * driver.cs : don't output docs when there is an error.
1165           Fixed bug #76693.
1166
1167 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1168
1169         * doc.cs :
1170           Now it should detect indexers. Fixed primary concern in bug #76685.
1171           Fixed CS0419 message to not show the identical member signature in
1172           the message.
1173
1174 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1175
1176         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
1177           instead of Type.FindMembers() since it does not handle events.
1178           Fixed bug #71604.
1179
1180 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
1181
1182         * codegen.cs: Fixed typo (speficied -> specified).
1183
1184 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1185
1186         Fix #76369.
1187         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
1188
1189 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1190
1191         * attribute.cs: Changed error message.
1192
1193         * cs-tokenizer.cs: One more check.
1194
1195 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1196
1197         * statement.cs (Block.Resolve): Ignore empty statement.
1198
1199 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1200
1201         * report.cs: Made error/warning methods more strict to avoid
1202         their misuse.
1203
1204         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
1205         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
1206         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
1207         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
1208
1209 2005-11-11  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1210
1211         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): 
1212         Use the more explicit AssemblyName.FullName instead of 
1213         AssemblyName.Name to report errors.
1214         
1215 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1216
1217         * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
1218         with mcs.
1219
1220 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1221
1222         * class.cs,
1223         * convert.cs,
1224         * cs-parser.jay,
1225         * decl.cs,
1226         * enum.cs,
1227         * expression.cs,
1228         * generic.cs,
1229         * pending.cs,
1230         * report.cs: Fixed error reporting and typos.
1231
1232         * generic.cs (TypeParameter.GetSignatureForError): New method.
1233         (ConstructedType.GetSignatureForError): Instead of DeclarationName.
1234
1235         * typemanager.cs (GetFullName): Refactored.
1236
1237 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
1238
1239         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
1240         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
1241
1242         * class.cs (TypeContainer.IsComImport): New property.
1243         (Constructor.Define): Create proper ctor for ComImport types.
1244
1245         * expression.cs (New.CheckComImport): Fixed.
1246
1247 2005-11-07  Miguel de Icaza  <miguel@novell.com>
1248
1249         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
1250         that a parameter has been captured does not mean that we do not
1251         have to do the rest of the processing.  This fixes the second part
1252         of #76592.  If there was another anonymous method capturing
1253         values in the past, the Scope would never be set for the second
1254         method that captured the same parameter.
1255
1256         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
1257         properly manipulate the stack.   Second part of fix for #76592.
1258
1259         * expression.cs (New): Add support for invoking "new" on
1260         interfaces that have been flagged with the ComImport attribute and
1261         the CoClass.  Fixes #76637 
1262
1263         * statement.cs (Try.DoEmit): When a variable is captured, do not
1264         try to emit the vi.LocalBuilder variable as it has been captured.
1265         Create a temporary variable and store the results on the
1266         FieldBuilder.  Fixes #76642
1267
1268 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1269
1270         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
1271
1272         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
1273
1274         * expression.cs (Binary.DoResolve): Added && optimalization.
1275     
1276         * typemanager.cs (AddUserType): Removed useless argument.
1277
1278 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
1279
1280         * statement.cs (Block.variables): Uses ListDictionary.
1281
1282 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1283
1284         Fix #75969.
1285         * class.cs (PartialContainer.EmitType): Customized to emit
1286         security attributes.
1287         (ClassPart.ApplyAttributeBuilder): Transform security attribute
1288         for partial classes.
1289
1290 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1291
1292         Fix #76599.
1293         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
1294         access has to be fixed.
1295         
1296         * typemanager.cs (IsUnmanagedType): Wrong common field type.
1297
1298 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
1299
1300         Fix #76590.
1301         * ecore.cs (NullCast.Reduce): Implemented.
1302
1303         * expression.cs (ArrayCreation.CheckIndices): Correcly check
1304         constant type.
1305         
1306         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
1307         properly.
1308         (Foreach.Resolve): Catch null properly.
1309
1310 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1311  
1312         * cs-tokenizer.cs: Warning text fix.
1313
1314         * driver.cs: AllWarningNumbers exposed on public interface.
1315
1316         * report.cs (): Reviewed warning numbers.
1317         (IsValidWarning): Use binary search.
1318
1319 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1320  
1321         * driver.cs: Implemeted resource visibility.
1322         (Resources): New class for code sharing between /res: and
1323         /linkres:
1324  
1325 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1326
1327         decl.cs (CurrentTypeParameters): Fixed to be public.
1328
1329 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1330
1331         generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
1332
1333 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1334
1335         gmcs.exe.sources: Use CryptoConvert.cs from corlib.
1336
1337 2005-11-05  Kornél Pál  <kornelpal@hotmail.com>
1338
1339         * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
1340
1341 2005-11-04  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1342
1343         Add friend assembly access support.
1344         * typemanager.cs: assembly_internals_vis_attrs
1345         cache for friend assembly access. 
1346         (TypeManager.IsFriendAssembly): New method for
1347         checking friend assembly access.
1348         (TypeManager.Error_FriendAccessNameNotMatching): New
1349         helper method.
1350         (TypeManager.CompareKeyTokens): Likewise.
1351         (TypeManager.Filter): Handle friend accessible
1352         members.
1353
1354         * namespace.cs (RootNamespace.GetTypeInAssembly): Return
1355         friend accessible types.
1356
1357         * ecore.cs (Expression.IsAccessorAccessible): Handle
1358         friend accessible properties.
1359
1360         * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
1361         accessible types.
1362         
1363 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
1364
1365         Fix #76568.
1366         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
1367         folding.
1368         
1369         * convert (Convert.ImplicitReferenceConversion): NullCast holds
1370         contants only.
1371         
1372         * ecore.cs (NullCast): Child is contant only.
1373         
1374         * literal.cs (NullLiteral.Reduce): null can be converted to any
1375         reference type.
1376
1377 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
1378
1379         * driver.cs: Use Encoding.Default as default code page instead
1380           of ISO-28591.
1381
1382 2005-10-27  Raja R Harinath  <rharinath@novell.com>
1383
1384         Fix #76085.
1385         * expression.cs (Invocation.Error_InvalidArguments): Handle
1386         __arglist parameters.
1387         (Invocation.VerifyArgumentsCompat): Likewise.
1388         * support.cs (ReflectionParameters.GetSignatureForError): Print
1389         __arglist parameters.
1390         (InternalParamters.GetSignatureForError): Likewise.
1391         * parameter.cs (Parameters.GetSignatureForError): Likewise.
1392
1393 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
1394
1395         * attribute.cs (GetPropertyValue): Made public.
1396
1397         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
1398         Resolve.
1399         Add new property WrapNonExceptionThrows to handle 2.0 assembly
1400         attribute.
1401         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
1402         is not defined.
1403         
1404         * driver.cs: Reflect method name change.
1405         
1406         * statement.cs (Try.Resolve): Warn when try has both general
1407         exception handlers.
1408         
1409         * typemanager.cs: runtime_compatibility_attr_type new predefined
1410         type.
1411
1412 2005-10-26  Raja R Harinath  <harinath@gmail.com>
1413
1414         Fix #76419.
1415         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
1416         treat it as an empty parameter list.
1417
1418 2005-10-26  Raja R Harinath  <rharinath@novell.com>
1419
1420         Fix #76271.     
1421         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
1422         ResolveAsTypeStep silent.
1423         * statement.cs (Block.AddConstant): Mark block as used.
1424         (Block.ResolveMeta): Avoid piling on error messages
1425         if a constant initializer resolution fails.
1426
1427 2005-10-25  Raja R Harinath  <rharinath@novell.com>
1428
1429         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
1430         Remove.
1431         (NamespaceEntry.VerifyAllUsing): New.
1432         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
1433         behaviour.  Delegates actual resolution of alias to ...
1434         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
1435         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
1436         Update.
1437         * driver.cs (Driver.MainDriver): Update.
1438         
1439         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
1440         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
1441         property.
1442         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
1443         Remove.
1444         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
1445         RootNamespace.DefineNamespacesForAll.
1446
1447 2005-10-24  Raja R Harinath  <harinath@gmail.com>
1448
1449         * typemanager.cs (assemblies, external_aliases, modules)
1450         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
1451         (ComputeNamespaces, GetRootNamespace): Remove extra staging
1452         overhead.  Move resposibility ...
1453         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
1454         * driver.cs, attribute.cs, codegen.cs: Update to changes.
1455
1456 2005-10-23  Raja R Harinath  <harinath@gmail.com>
1457
1458         * namespace.cs (RootNamespace.all_namespaces): Renamed from
1459         cached_namespaces.  Improve usage.
1460         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
1461         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
1462         Move from GlobalRootNamespace and simplify.
1463         (RootNamespace.Global): Make instance variable.
1464         (RootNamespace.RootNamespace): Add "alias name" parameter.
1465         (GlobalRootNamespace): Simplify drastically.
1466         (Namespace.Lookup): Don't use GetNamespace.
1467         * typemanager.cs (GetRootNamespace): Rename from
1468         ComputeNamespaceForAlias.
1469         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
1470
1471 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1472
1473         * anonymous.cs (AnonymousContainer): Don't crash when container
1474         doesn't exist.
1475
1476 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1477
1478         * expression.cs (Binary.DoResolve): Warn when comparing same
1479         values.
1480
1481 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1482
1483         Fix #76486.
1484         * expression.cs (Binary.DoResolve): It looks like there are no
1485         convetsion rules in enum context.
1486
1487 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1488
1489         Add support for extern alias qualifiers.
1490         * typemanager.cs: Move some LookupTypeReflection code
1491         to namespace.cs, to have cleaner code. Added some methods
1492         to help us keep track of the extern aliased references.
1493         * driver.cs: Add suport for extern alias assemblies on command
1494         line and check for their warnings/errors. Also keep track of the
1495         extern aliased assemblies.
1496         * namespace.cs: Move the global functionality of Namespace
1497         to GlobalRootNamespace/RootNamespace. Now the global namespace
1498         is GlobalRootNamespace.Globa. Also the code moved from 
1499         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
1500         Finally added LocalAliasEntry (AliasEntry before) and
1501         ExternAliasEntry, to handle alias statements.
1502         * cs-parser.jay: Add support in the grammar for extern alias
1503         statement.
1504         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
1505         Update callings to Namespace (now in GlobalRootNamespace).
1506
1507 2005-10-25  Martin Baulig  <martin@ximian.com>
1508
1509         * convert.cs (ImplicitTypeParameterConversion): Make base
1510         interfaces actually work; fixes #76557.
1511
1512 2005-10-25  Martin Baulig  <martin@ximian.com>
1513
1514         * generic.cs
1515         (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
1516         all the type parameters; fixes #76551.
1517
1518 2005-10-25  Martin Baulig  <martin@ximian.com>
1519
1520         Fix #76472.
1521
1522         * generic.cs
1523         (GenericMethod.ctor): Added `Expression return_type' and
1524         `Parameters parameters' arguments.
1525         (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
1526         parameter and return types to check their constraints if they're
1527         generic types.
1528
1529         * codegen.cs (EmitContext.ResolvingGenericMethod): New public
1530         boolean field.
1531
1532         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
1533         constraints of a generic type if `ec.ResolvingGenericMethod'.
1534
1535         * class.cs (MethodCore.DoDefineParameters): Set
1536         `ec.ResolvingGenericMethod' if we're a generic method.
1537         (MemberBase.MemberType): Likewise.
1538
1539 2005-10-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1540
1541         * typemanager.cs (TypeManager): Added 
1542         TypeManager.internals_visible_attr_type to cache
1543         S.R.CompilerServices.InternalsVisibleToAttribute.
1544
1545         * codegen.cs (AssemblyClass): Added checks for 
1546         InternalsVisibleToAttribute in new method 
1547         CheckInternalsVisibleAttribute () and also cache the
1548         AssemblyName in AssemblyClass.Name.
1549         
1550 2005-10-24  Martin Baulig  <martin@ximian.com>
1551
1552         * typemanager.cs
1553         (TypeManager.ExpandInterfaces): Added overloaded version which
1554         just takes a `Type[]' array.
1555
1556         * generic.cs
1557         (Constraints.Resolve): Don't expand the interfaces here; ie. we
1558         just use the interfaces which were explicitly specified and not
1559         the interfaces they inherit.  Fixes #76482.
1560         (TypeParameter.FindMembers): Expand the interfaces here.
1561
1562 2005-10-21  Martin Baulig  <martin@ximian.com>
1563
1564         * generic.cs
1565         (Constraints.Resolve): Also resolve the actual types here.
1566         (Constraints.ResolveTypes): Just check the constraints here.
1567         Fixes #76363; see gtest-218.cs.
1568
1569 2005-10-21  Martin Baulig  <martin@ximian.com>
1570
1571         * convert.cs
1572         (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
1573         instead of a `BoxedCast'; fixes gtest-217.cs.
1574
1575 2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
1576
1577         * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
1578           1) "new()" is specified as generic parameter constraint and 2) the
1579           type is TypeBuilder and 3) the type is abstract even if it has a
1580           default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
1581
1582 2005-10-20  Martin Baulig  <martin@ximian.com>
1583
1584         * generic.cs
1585         (GenericConstraints.TypeParameter): New public property.
1586         (TypeParameter.ctor): Also take a `DeclSpace' argument.
1587         (TypeParameter.DeclSpace): New public property.
1588         (TypeParameter.DefineType): Inflate the constraints if our
1589         `DeclSpace' is an `Iterator'.   
1590
1591 2005-10-19  Atsushi Enomoto  <atsushi@ximian.com>
1592
1593         * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added 
1594           GenericMethod argument to compare methods' generic type arguments.
1595           Fixed bug #76382.
1596
1597 2005-10-19  Martin Baulig  <martin@ximian.com>
1598
1599         * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
1600         not ResolveType() when resolving the base type, so we're not
1601         checking the constraints here.
1602         (TypeContainer.ResolveType): Call ResolveType() on our base_type
1603         if we have any.
1604
1605 2005-10-19  Martin Baulig  <martin@ximian.com>
1606
1607         * generic.cs (ConstructedType.CheckConstraints): Committing
1608         untested fix for #76441.
1609
1610 2005-10-18  Raja R Harinath  <rharinath@novell.com>
1611
1612         Fix #76371.
1613         * class.cs (TypeContainer.DefineType): Move updating of
1614         topological sort earlier in the code.
1615         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
1616
1617 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
1618
1619         Fix #76273.
1620         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
1621         
1622         * constant.cs (Constant.TryReduce): Moved from Cast class.
1623         (Reduce): Made little bit more OO and fixed missing conversions.
1624         
1625         * ecore.cs (Reduce): Implemented.
1626         (Binary.EnumLiftUp): New method to upgrade values to enum values.
1627         
1628         * literal.cs (Reduce): Implemented.
1629         
1630         * class.cs: Reverted Miguel's wrong commit.
1631
1632 2005-10-14  Miguel de Icaza  <miguel@novell.com>
1633
1634         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
1635
1636 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
1637
1638         * cs-parser.jay, expression.cs : CS0214 was missing error location
1639           for constants. Fixed bug #76404.
1640
1641 2005-10-10  Raja R Harinath  <rharinath@novell.com>
1642
1643         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
1644         InstanceExpression.
1645         (PropertyExpr.EmitCall): Likewise.
1646         * expression.cs (Invocation.EmitArguments): Handle case where
1647         arguments == null.
1648         (Invocation.EmitCall): Avoid allocating temporary variable if
1649         there are no arguments.
1650
1651 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
1652
1653         Fix #76370.
1654         * convert.cs (ExplicitConversionCore): Fixed object->enum
1655         conversion.
1656
1657 2005-10-07  Raja R Harinath  <rharinath@novell.com>
1658
1659         Fix #76323.
1660         * convert.cs (ImplicitConversionStandard): Move conversion of
1661         void* to arbitrary pointer types ...
1662         (ExplicitConversionStandard): .. here.
1663         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
1664         error to always print typenames.
1665
1666 2005-10-07  Raja R Harinath  <rharinath@novell.com>
1667
1668         * convert.cs (GetConversionOperator): Rename from
1669         GetConversionOperators.  Move operator selection code from ...
1670         (UserDefinedConversion): ... here.
1671
1672 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
1673
1674         * convert.cs (ExplicitConversionCore): Removed duplicate enum
1675         conversion.
1676
1677 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
1678
1679         * assign.cs (Assign.DoResolve): Error method changed.
1680
1681         * cfold.cs (DoConstantNumericPromotions): Error method changed.
1682         
1683         * const.cs (ResolveValue): Reset in_transit immediately.
1684         
1685         * constant.cs: Error method changed.
1686         
1687         * convert.cs: Removed useless location parameter.
1688         (ExplicitNumericConversion): Don't do double enum check.
1689         (ExplicitConversionCore): Renamed from ExplicitConversion.
1690         (ExplicitUnsafe): Extracted from ExplicitConversion.
1691         (ExplicitConversion): Uses for error reporting.
1692         
1693         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
1694         error messages.
1695         (ResolveBoolean): Uses common error method.
1696         (CastToDecimal): Get rid of ec.
1697         (CastFromDecimal): Optimized.
1698         (ConvCast): Get rid of ec.
1699         
1700         * enum.cs (ResolveValue): Reset in_transit immediately.
1701         (Emit): Return after first error.
1702         
1703         * expression.cs: Convert changes.
1704         
1705         * literal.cs: Error method changed.
1706         
1707         * statement.cs: Error method changed.
1708
1709 2005-10-06  Raja R Harinath  <rharinath@novell.com>
1710
1711         Fix gtest-131.cs and gtest-211.cs.
1712         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
1713         Only emit code for a label if it is used.  Unreachable code can
1714         violate ECMA evaluation stack invariants.
1715
1716 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
1717
1718         * anonymous.cs: Implemented ExprClassName.
1719         
1720         * assign.cs (Assign.DoResolve): Don't chrash when type is not
1721         delegate.
1722         
1723         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
1724         check.
1725         
1726         * class.cs (StaticClass.DefineContainerMembers): Report protected
1727         members as error.
1728         
1729         * codegen.cs: if(ed) PRODUCTION.
1730         
1731         * convert.cs (Error_CannotImplicitConversion): Better error
1732         distinction.
1733         
1734         * cs-parser.jay: More error checks.
1735         
1736         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
1737         
1738         * driver.cs (CSCParseOption): Enabled wrong option check.
1739         
1740         * ecore.cs (Expression.ExprClassName): Turned to property.
1741         (MemberExpr.CheckIntermediateModification): For checking boxed
1742         value types     modification.
1743         
1744         * statement.cs (Fixed.Resolve): Expression type must be
1745         convertible to fixed type.
1746         (CollectionForeach.GetEnumeratorFilter,TryType):
1747         Small refactoring for easier error checking.
1748
1749 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
1750
1751         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
1752         attributes.
1753         
1754         * class.cs (GeneratedBaseInitializer): New class for customization
1755         compiler generated initializers.
1756         (MemberBase.DoDefine): Check Obsolete attribute here.
1757         (FieldMember.DoDefine): Ditto.
1758         
1759         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
1760         constants.
1761         
1762         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
1763         (MemberCore.GetObsoleteAttribute): Removed argument.
1764         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
1765         (MemberCore.CheckObsoleteType): New helper.
1766         
1767         * delegate.cs,
1768         * enum.cs,
1769         * statement.cs: Updates after MemberCore changes.
1770         
1771         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
1772         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
1773         
1774         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
1775         obsolete attribute for compiler construct.
1776         (As.DoResolve): Cache result.
1777         
1778         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
1779
1780 2005-10-01  Miguel de Icaza  <miguel@novell.com>
1781
1782         * expression.cs (Probe): instead of having a "Type probe_type"
1783         keep the extra information as a TypeExpr probe_type_expr since the
1784         "As" operator needs to perform some type checks.
1785
1786         * (As.DoResolve): If the type is a type parameter, ensure that it
1787         is constrained by a class.
1788
1789 2005-09-22  Miguel de Icaza  <miguel@novell.com>
1790
1791         * statement.cs (Lock): Use the TemporaryVariable class instead of
1792         manually using local variables as those do not work when variables
1793         are captured.
1794
1795         * ecore.cs: Moved the TemporaryVariable class from being a nested
1796         class inside Foreach to be a public class that can be employed in
1797         other places. 
1798
1799 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
1800
1801         * cs-parser.jay: interface_accessors replaced by
1802         accessor_declarations.
1803
1804         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
1805         location.
1806         
1807         * statement.cs (GotoCase.Resolve): Convert null constant to
1808         null case.
1809         (SwitchLabel.ResolveAndReduce): Ditto.
1810         (SwitchLabel.NullStringCase): Custom null stamp.
1811         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
1812         
1813         typemanager.cs (CSharpSignature): Don't skip first argument
1814         for full names.
1815
1816 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
1817
1818         * cfold.cs, constant.cs, convert.cs, ecore.cs,
1819         expression.cs, iterators.cs, literal.cs: Store constants and
1820         literals location.
1821         
1822         * class.cs (MemberBase.ShortName): Pass location.
1823         
1824         * cs-parser.jay: Some location fixes.
1825         
1826         * ecore.cs (Expression.Location): Made virtual.
1827
1828 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
1829
1830         Fix #72930.
1831         * const.cs (Const.ResolveValue): Check for assigning non-null
1832         value to reference type.
1833
1834 2005-09-26  Raja R Harinath  <rharinath@novell.com>
1835
1836         Fix #76133.
1837         * expression.cs (This.VerifyFixed): In a value type T, the type of
1838         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
1839         value type R, 'this' is treated as a value parameter.
1840
1841 2005-09-05  Miguel de Icaza  <miguel@novell.com>
1842
1843         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
1844         if the underlying types are the same, otherwise we need to produce
1845         code that will do the proper cast.
1846
1847         This was exposed by Marek's constant rewrite which produced
1848         invalid code for the call site:
1849
1850         enum X : long { a }
1851         void Method (X v) {}
1852
1853         Method ((X) 5)
1854
1855         This fixes test-49.cs
1856
1857 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
1858
1859         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
1860           Type/Object should be allowed as well. Fixed bug #75968.
1861
1862 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
1863
1864         * expression.cs : (Binary.DoResolve): when one is enum constant and
1865           another is constant 0, then return enum one *as enum type*.
1866           Fixed bug 74846.
1867
1868 2005-10-04  Martin Baulig  <martin@ximian.com>
1869
1870         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
1871         `SetMemberIsUsed()' work for generics, too.
1872
1873 2005-10-04  Martin Baulig  <martin@ximian.com>
1874
1875         * expression.cs (DelegateInvocation.EmitStatement): Make this work
1876         for corlib.  Fixes #75691.
1877
1878 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
1879
1880         Fix #76255.
1881         * driver.cs: Fix compilation files with full root path.
1882
1883 2005-09-25  Miguel de Icaza  <miguel@novell.com>
1884
1885         * report.cs (SymbolRelatedToPreviousError): Format the output so
1886         it does not use an open parenthesis that is never closed. 
1887
1888         * driver.cs: Follow coding guidelines
1889
1890 2005-09-18  Miguel de Icaza  <miguel@novell.com>
1891
1892         * driver.cs: Set InEmacs based on the environment variable EMACS. 
1893
1894         * location.cs (InEmacs): in this mode, do not report column
1895         location as it confuses Emacs.
1896
1897 2005-10-03  Raja R Harinath  <rharinath@novell.com>
1898
1899         * support.cs (SeekableStreamReader.Position): Don't error out when
1900         the requested position is just beyond the end of the current
1901         buffered data.
1902
1903 2005-09-28  Raja R Harinath  <rharinath@novell.com>
1904
1905         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
1906         try to keep in sync with the byte count of the underlying Stream.
1907         However, this limits us to a window size of 2048 characters: i.e.,
1908         the maximum lookahead of our lexer/parser can be 2048 characters.
1909
1910 2005-09-22  Martin Baulig  <martin@ximian.com>
1911
1912         * driver.cs: Removed a debugging FIXME.
1913
1914 2005-09-21  Raja R Harinath  <rharinath@novell.com>
1915
1916         * cs-parser.jay (type_arguments): Add CS1644 check.
1917         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
1918
1919 2005-09-15  Raja R Harinath  <rharinath@novell.com>
1920
1921         * Makefile (PROGRAM): Make profile specific.
1922         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
1923         the current directory.
1924
1925         Fix test-455.cs.
1926         * expression.cs (Invocation.EmitCall): Remove optimization on
1927         this_call since it doesn't handle 'this' being a value type.
1928
1929 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
1930
1931         * driver.cs: Ensure file handles are closed after parsing
1932
1933 2005-09-05  Miguel de Icaza  <miguel@novell.com>
1934
1935         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
1936         if the underlying types are the same, otherwise we need to produce
1937         code that will do the proper cast.
1938
1939         This was exposed by Marek's constant rewrite which produced
1940         invalid code for the call site:
1941
1942         enum X : long { a }
1943         void Method (X v) {}
1944
1945         Method ((X) 5)
1946
1947         This fixes test-49.cs
1948
1949 2005-09-05  Martin Baulig  <martin@ximian.com>
1950
1951         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
1952         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
1953
1954         * cs-parser.jay (delegate_declaration): Small fix for #75852.
1955
1956 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
1957
1958         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
1959           to be a pointer type due to the spec 25.2, so check if declaring
1960           type is generic type definition. Fixed bug #75772.
1961
1962 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
1963
1964         Fixed bug #75957.
1965         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
1966           both types are not defined by methods.
1967         * expression.cs : (Invocation.IsApplicable): it should work when
1968           the argument type is equal to the parameter type, not only when
1969           ImplicitConversionExists() returns true.
1970
1971 2005-09-02  Raja R Harinath  <rharinath@novell.com>
1972
1973         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
1974         internal.
1975
1976         Fix #75941.
1977         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
1978         flow-branching for LocalVariableReferences in case we were invoked
1979         from a MemberAccess.
1980         * expression.cs (LocalVariableReference.VerifyAssigned): New.
1981         Carved out of ...
1982         (LocalVariableReference.DoResolveBase): ... this.
1983         (MemberAccess.Resolve): Do the check that was disabled during
1984         SimpleNameResolve.
1985
1986 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
1987
1988         * class.cs :
1989           (PartialContainer.Create): check abstract/sealed/static strictly
1990           but abstract/sealed can exist only at one side. Fixed bug #75883.
1991
1992 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
1993
1994         Fix #75945.
1995         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
1996         specified, don't default to UnmanagedType.I4.
1997
1998 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
1999
2000         * expression.cs : conditional operator should check possibly
2001           incorrect assign expression. Fixed bug #75946.
2002
2003 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2004
2005         Fix #75934.
2006         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2007         (ScopeInfo.EmitScopeType): Use it to construct field names from
2008         names of captured locals.
2009
2010         Fix #75929.
2011         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2012         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2013         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
2014         (ExplicitConversion): Remove enum cases already handled by
2015         implicit conversion.  Move implicit conversion check to the beginning.
2016         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2017         * expression.cs (ArrayCreation.EmitDynamicInitializers):
2018         Don't treat System.Enum as a struct.
2019
2020 2005-08-30  Jb Evain  <jbevain@gmail.com>
2021
2022         * attribute.cs: handles as expression in parameters.
2023
2024 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2025
2026         Fix #75802.
2027         * class.cs (TypeContainer.VerifyClsName): Don't use a
2028         PartialContainer when verifying CLS compliance.
2029         (AbstractPropertyEventMethod): Set Parent here, ...
2030         (PropertyMethod): ... not here.
2031
2032 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
2033
2034         * attribute.cs : escaped attribute name should not be allowed to be
2035           resolved (e.g. @class as classAttribute). Fixed bug #75930.
2036
2037 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2038
2039         Fix #75927.
2040         * convert.cs (ImplicitStandardConversionExists): Allow zero also
2041         when converting a long constant to unsigned long.
2042         * expression.cs (Invocation.OverloadResolve): Add sanity check to
2043         detect where IsApplicable and VerifyArgumentsCompat disagree.
2044
2045 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2046         and Carlos Alberto Cortez  <carlos@unixmexico.org>
2047
2048         Fix #75848.
2049         * class.cs (TypeContainer.CanElideInitializer): New helper.
2050         (TypeContainer.EmitFieldInitializers): Use it to determine if we
2051         can safely emitting the initializer of a field.
2052
2053 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2054
2055         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2056           allowed inside a switch (without loop). Fixed bug #75433.
2057
2058 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
2059
2060         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2061         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2062
2063 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2064
2065         * driver.cs : kinda reverting the default encoding changes (not exact 
2066           revert since I noticed that "codepage:reset" might not work fine).
2067
2068 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2069
2070         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2071           Location. Now getter and setter store location correctly.
2072           (errors/cs0111-12.cs now reports the expected location.)
2073
2074 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2075
2076         * driver.cs : Use default encoding on the environment.
2077           Removed (now that) extra parameter for SeekableStreamReader.
2078         * support.cs : (SeekableStreamReader) third .ctor() argument for
2079           StreamReader is not required (always true). preamble size could
2080           be acquired in simpler and safe way.
2081
2082 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
2083
2084         * cs-parser.jay: report CS0642 at warning level 3
2085           and report CS0642 for an if else statement also
2086           fixes bug #74745. Patch by John Luke (and a bit
2087           modified by me).
2088           Removed extra CS0642 warning check for "while",
2089           "for" and "fixed".
2090         * statement.cs: In Block.Resolve(), CS0642 check
2091           is reimplemented to check a sequence of an empty
2092           statement and a block.
2093
2094           Both fix bug #66777.
2095
2096 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
2097
2098         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2099         detection until I fix it.
2100         
2101         * cs-tokenizer.cs: Changed error message.
2102         
2103         * cs-parser.jay: Fixed 2 error locations.
2104         
2105         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2106         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2107         properties.
2108         
2109         * enum.cs (GetSignatureForError): Fixed.
2110         
2111         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2112         method detection.
2113         
2114         * class.cs,
2115         * typemanager.cs (RegisterProperty): Removed.
2116         
2117         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2118
2119 2005-08-24  Raja R Harinath  <rharinath@novell.com>
2120
2121         Fix #75874.
2122         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2123         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2124
2125 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2126
2127         * expression.cs : tiny fix is required for not warning positive ulong.
2128           See test-441.cs.
2129
2130 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2131
2132         * expression.cs : add CS0652 check for constant and integral
2133           expression. Fixed bug #53974.
2134
2135 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2136
2137         * expression.cs : in DoNumericPromotions(), check if there is implicit
2138           conversion overload for string (to check CS0034). Fixed bug #52492.
2139
2140 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2141
2142         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2143
2144 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2145
2146         * ecore.cs : report location when it is *not* Null.
2147
2148 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2149
2150         * codegen.cs,
2151           ecore.cs,
2152           flowanalysis.cs,
2153           expression.cs:
2154           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2155           correctly. Fixed bug #75721.
2156
2157 2005-08-23  Raja R Harinath  <rharinath@novell.com>
2158
2159         * support.cs (SeekableStreamReader.Position): Avoid an expensive
2160         loop that performs 'min (pos, char_count)'.
2161
2162         Fix #75862.
2163         * expression.cs (Unary.ResolveOperator): Don't discard implicit
2164         converted value in Operator.OnesComplement.
2165
2166 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
2167
2168         * anonymous.cs: If the anon method is pulled into a helper class,
2169         it needs to be `internal' not `private'. Fixes runtime behavior on
2170         msft. bug #75704
2171
2172 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
2173
2174         Fix #75803
2175         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2176         is a partial class.
2177
2178 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
2179
2180         The big constants rewrite
2181         Fix #75746, #75685 and more
2182         As a side effect saved 1MB for MWF ;-)
2183         
2184         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
2185         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
2186         enum based for corlib compilation.
2187         
2188         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
2189         subtractions.
2190         
2191         * class.cs (FixedField.Define): Use ResolveAsConstant.
2192         
2193         * const.cs (IConstant): Interface constants and enums.
2194         (Const.ResolveValue): New method for constant resolvning.
2195         (ExternalConstant): Constants from imported assemblies.
2196         
2197         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
2198         conversion; like enums.
2199         (Constant.ToType): Converts this constant to different type.
2200         (Constant.Increment): Adds 1.
2201         
2202         * convert.cs (ImplicitConversionRequired): Simplified.
2203         
2204         * cs-parser.jay: Create EnumMember directly.
2205         
2206         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
2207         
2208         * doc.cs (GenerateEnumDocComment): Removed.
2209         
2210         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
2211         (ConvertIntLiteral): Removed.
2212         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
2213         
2214         * enum.cs (EnumMember): Implement IConstant.
2215         (Enum.IsValidEnumConstant): Removed.
2216         (Enum.GetNextDefaultValue): Removed.
2217         (Enum.FindMembers): Updated.
2218         (Enum.GenerateDocComment): Iterate enum members.
2219         
2220         * expression.cs (Cast.TryReduce): Handle enums correctly.
2221         (New.Constantify): Made public.
2222         (MemberAccess.DoResolve): Removed contant specific if(s).
2223         
2224         * literal.cs (NullLiteral): Implement new abstract methods.
2225         
2226         * statement.cs (GotoCase.Resolve): Use new constant methods.
2227         (SwitchLabel.ResolveAndReduce): Use new constant methods.
2228         
2229         * typemanager.cs (LookupEnum): Removed.
2230         (IsEnumType): Fixed to work with corlib.
2231         (RegisterConstant): Removed.
2232         (LookupConstant): Removed.
2233         (GetConstant): Changed to work with IConstant.
2234
2235 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
2236
2237         * location.cs : Fixed overflown (>255) column number.
2238
2239 2005-08-03  Raja R Harinath  <rharinath@novell.com>
2240
2241         First cut of the qualified-alias-member feature.
2242         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
2243         token.
2244         * cs-parser.jay (DOUBLE_COLON): New token.
2245         (namespace_or_type_name): Add rule for recognizing
2246         qualified-alias-members.
2247         (primary_expression): Likewise.
2248         (element_access): Allow QualifiedAliasMember as a possible
2249         type-bearing expression.
2250         (local_variable_type, local_variable_pointer_type): Likewise.
2251         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
2252         aliases in the current and enclosing namespace declarations.
2253         (NamespaceEntry.UsingAlias): Add CS0440 warning.
2254         * decl.cs (MemberName.is_double_colon): New.
2255         (MemberName.MemberName): Add new constructor for alias-member.
2256         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
2257         * expression.cs (QualifiedAliasMember): New expression type.
2258
2259 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2260
2261         * location.cs : it borked when no argument was specified.
2262
2263 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2264
2265         * location.cs : tiny ToString() format fix.
2266
2267 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2268
2269         * statement.cs : oops, it was missing.
2270
2271 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2272
2273         A set of fixes for precise line/column location.
2274
2275         * location.cs :
2276           "token" field now holds a file/line "delta", a line number offset 
2277           from the segment, and a column number. See also:
2278           http://lists.ximian.com/pipermail/mono-devel-list/2004-
2279           December/009508.html
2280           Removed static IsNull. Use instance IsNull property instead.
2281         * cs-tokenizer.cs :
2282           For some tokens it stores Location. For Identifier it stores
2283           LocatedToken which is a pair of string name and location.
2284           Column numbers are adjusted only at getChar().
2285         * report.cs :
2286           Use Location.ToString() for reporting (it now contains column).
2287         * cs-parser.jay :
2288           Largely modified to use LocatedToken instead of
2289           string (IDENTIFIER), and to acquire Location from some tokens.
2290         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2291           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2292           codegen.cs :
2293           Now MemberName holds Location. DeclSpace.ctor() receives Location
2294           as a parameter. Removed extra parameters to all derived classes.
2295           Replaced Location.IsNull() with instance property.
2296         * assign.cs, expression.cs :
2297           Added .ctor() overload that omits Location.
2298         * attribute.cs :
2299           Added "nameEscaped" flag that indicates the identifier was escaped
2300           in the source file. This fixes bug #57047.
2301
2302 2005-09-02  Martin Baulig  <martin@ximian.com>
2303
2304         * class.cs: Make CS3005 a warning, not an error.
2305
2306 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
2307
2308         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2309         New method, looking for lo-case imported cls type.
2310
2311         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2312         here.
2313
2314         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2315
2316         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2317
2318         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2319         all_imported_types.
2320         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2321
2322         Optimized to save 3.5 MB for SWF compilation.
2323
2324 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2325
2326         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
2327         (PartialContainer.Create): Moved logic AddToContainer.
2328         (PartialContainer.MarkForDuplicationCheck): Shares name.
2329         
2330         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
2331         place.
2332         
2333         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
2334         initialization.
2335         (Namespace.GetSignatureForError): New method.
2336         
2337         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
2338         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
2339
2340 2005-08-01  Raja R Harinath  <rharinath@novell.com>
2341
2342         Fix #75669.
2343         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
2344         member lookup rather than qualifier_type, since qualifier_type can
2345         be null.
2346
2347 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2348
2349         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
2350         enum member.
2351
2352 2005-07-31  Miguel de Icaza  <miguel@novell.com>
2353
2354         * statement.cs: Copy the local exception into the exception
2355         captured local.  Fixes 75674
2356
2357 2005-07-31  Raja R Harinath  <harinath@gmail.com>
2358
2359         Fix #75658.
2360         * expression.cs (Invocation.OverloadResolve): Don't report error
2361         CS1501 if error CS1502 has been reported.
2362         (New.DoResolve): Delegate CS1501 reporting to
2363         Invocation.OverloadResolve.
2364
2365         Fix #75656.
2366         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
2367         invariant-meaning-in-block property in an enclosing block if
2368         necessary.
2369
2370 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
2371
2372         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
2373         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
2374         (Switch.CheckSwitch): Just save 50kb for SWF.
2375
2376 2005-07-27  Martin Baulig  <martin@ximian.com>
2377
2378         * anonymous.cs (CaptureContext.AddField): Added
2379         `AnonymousContainer am' argument; compute its toplevel scope if
2380         it's not already computed.  Fixes #75649.
2381
2382 2005-07-26  Raja R Harinath  <rharinath@novell.com>
2383
2384         Fix #75628.
2385         * class.cs (Constructor.Emit): Reset block to null if the block
2386         resolve fails.
2387
2388 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
2389
2390         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
2391
2392 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
2393
2394         * class.cs (MethodData.Define): Check whether accessor implementing
2395         interface is public.
2396
2397         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
2398
2399 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
2400
2401         Fix #57245
2402         * namespace.cs (LookupType): Moved same type check to...
2403         
2404         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
2405         with the same name.
2406
2407 2005-07-21  Raja R Harinath  <rharinath@novell.com>
2408
2409         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
2410         already found a typebuilder.
2411         * class.cs (MethodCore.IsDuplicateImplementation): Compare
2412         MemberNames, not strings.
2413
2414         * const.cs (Error_ExpressionMustBeConst): 
2415         Rename from Error_EpressionMustBeConst.
2416         * const.cs, class.cs, statement.cd: Update.
2417
2418 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
2419
2420         Fix #65573
2421
2422         * const.cs (Const.LookupConstantValue): Report missing contant expression
2423         everytime.
2424         (Error_EpressionMustBeConstant): Only one error method.
2425
2426         * class.cs, statement.c: Updated.
2427
2428 2005-07-20  Raja R Harinath  <rharinath@novell.com>
2429
2430         * statement.cs (Block.Flags): Add back HasVarargs.
2431         (Block.flags): Make protected.
2432         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
2433
2434         * typemanager.cs (types, typecontainers, user_types): Remove.
2435         (UserTypes, TypeContainers): Likewise.
2436         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
2437         (CleanUp, Reset): Update.
2438         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
2439         (GetNestedType): Use Type.GetNestedType.
2440         (CoreLookupType): Take two arguments, the namespace and the
2441         basename of the type.  Update to use the Namespace.Lookup
2442         mechanism.
2443         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
2444         (RealMemberLookup): Use IsNestedChildOf instead of playing with
2445         string concatenation and substring matches.
2446         * class.cs, enum.cs, delegate.cs: Update to changes.
2447
2448 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
2449
2450         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
2451         Expression and made virtual.
2452
2453         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
2454         (ImplicitStandardConversionExists): Fixed `byte' typo ?
2455
2456         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
2457
2458         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
2459         error message.
2460
2461         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
2462         change.
2463
2464 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
2465
2466         Fix #57707
2467         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
2468         AssemblyCultureAttribute is not used on executable.
2469
2470         * rootcontext.cs,
2471         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
2472
2473 2005-07-16  Raja R Harinath  <rharinath@novell.com>
2474
2475         Fix #60638.
2476         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
2477         New.  Reports CS0252/CS0253.
2478         Mostly taken from preliminary patch by Duncak Mak.
2479         (Binary.DoResolveOperator): Store results of operator lookup.
2480         Use them to detect if we need to warn about unintended reference
2481         comparisons.
2482
2483 2005-07-15  Raja R Harinath  <rharinath@novell.com>
2484
2485         Fix #72969.
2486         * namespace.cs (Namespace.Lookup): Add back location parameter.
2487         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
2488         * delegate.cs, ecore.cs, expression.cs: Update to changes.
2489
2490         * codegen.cs (EmitContext.DeclSpace): Make readonly.
2491         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
2492         (Namespace.LookupType): ... this.
2493         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
2494         of namespaces.
2495         * typemanager.cs (LookupTypeReflection): Remove buggy code that
2496         purported to handle pointers.
2497         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
2498         CoreLookupType.
2499
2500 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
2501
2502         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2503         type as namespace.
2504
2505 2005-07-15  Raja R Harinath  <rharinath@novell.com>
2506
2507         * namespace.cs (Namespace.Lookup): Drop location parameter.
2508         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
2509         (NamespaceEntry.Lookup): ... this.
2510         (NamespaceEntry.Error_AmbiguousTypeReference):
2511         Move here from DeclSpace.
2512         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
2513         names ...
2514         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
2515         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
2516         Move to NamespaceEntry.
2517         * delegate.cs, expression.cs: Update to changes.
2518
2519 2005-08-31  Martin Baulig  <martin@ximian.com>
2520
2521         Committing a patch from Atsushi Enomoto for #75850.
2522
2523         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
2524         Prefer a generic enumerator over a non-generic one.
2525
2526 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
2527
2528         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2529         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2530
2531 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2532
2533         * driver.cs : reverting default encoding change as well as mcs.
2534
2535 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2536
2537         * driver.cs, support.cs : merged r48826.
2538           Marek Safer wrote:
2539           > could you integrate your mcs changes to gmcs otherwise
2540           > gmcs cannot compile some files.
2541
2542 2005-08-20  Martin Baulig  <martin@ximian.com>
2543
2544         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2545         scope if we don't already have it.
2546
2547         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2548         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2549         fixes #75867.
2550
2551 2005-07-31  Miguel de Icaza  <miguel@novell.com>
2552
2553         * statement.cs: Copy the local exception into the exception
2554         captured local.  Fixes 75674
2555
2556 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
2557
2558         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2559         type as namespace.
2560
2561 2005-08-12  Martin Baulig  <martin@ximian.com>
2562
2563         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
2564         for nested types here to avoid hitting the cache too early.
2565
2566 2005-08-09  Miguel de Icaza  <miguel@novell.com>
2567
2568         * enum.cs: On the new compiler CLS error 3005 is now a warning not
2569         an error. 
2570
2571 2005-08-03  Martin Baulig  <martin@ximian.com>
2572
2573         Make iterators in generic methods work; see gtest-191.cs.
2574
2575         * generic.cs
2576         (Constraints.Resolve): Protect against being called twice.
2577
2578         * class.cs
2579         (TypeContainer.GetClassBases): Make this `protected virtual'.
2580
2581         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
2582         (Iterator.GetClassBases): Override this and compute the base
2583         classes here.
2584         (Iterator.DefineNestedTypes): If we're a generic method, all our
2585         method type parameters become class type parameters on the proxy
2586         class.
2587
2588         * statement.cs
2589         (ToplevelBlock.Parameters): Make this a property, not a field.
2590         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
2591
2592 2005-08-03  Martin Baulig  <martin@ximian.com>
2593
2594         * typemanager.cs (TypeManager.IsSubclassOf): Use
2595         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
2596         (TypeManager.GetFullName_recursed): Improved.
2597
2598 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2599
2600         Fix #75417
2601         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
2602         Private accessor case, using TypeManager.IsPrivateAccessible instead of
2603         invocation_type == mi.DeclaringType, since the first one also checks
2604         other condition used by generic instances.
2605         
2606 2005-07-27  Martin Baulig  <martin@ximian.com>
2607
2608         * anonymous.cs (CaptureContext.AddField): Added
2609         `AnonymousContainer am' argument; compute its toplevel scope if
2610         it's not already computed.  Fixes #75649.
2611
2612 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
2613
2614         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
2615         CheckAttributeType and refactored.
2616         (Attribute.ResolvePossibleAttributeType): Changed to reuse
2617         ResolveAsTypeTerminal error handling.
2618         (ResolveAsTypeTerminal): Introduced because of global attributes extra
2619         handling.
2620         (GetSignatureForError): Print errors in same way.
2621
2622         * class.cs,
2623         * codegen.cs: Reflect attribute GetSignatureForError change.
2624
2625         * ecore.cs,
2626         * expression.cs: Add silent parameter to ResolveAsTypeStep.
2627
2628         * namespace.cs (UsingEntry): Refactored to make fields private.
2629
2630         * assign.cs,
2631         statement.cs: Error_UnexpectedKind has extra parameter.
2632
2633 2005-07-14  Raja R Harinath  <rharinath@novell.com>
2634
2635         * ecore.cs (IAlias): Remove.
2636         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
2637         that implement the interface.
2638         * namespace.cs (Namespace): Likewise.
2639         (Namespace.declspaces): Renamed from 'defined_names'.
2640         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
2641         DeclSpace instead of an IAlias.
2642         * tree.cs (Tree.AddDecl): Update.
2643
2644 2005-07-12  Raja R Harinath  <rharinath@novell.com>
2645
2646         * statement.cs (Block.Flags); Remove HasVarargs.
2647         (Block.HasVarargs): Move to ToplevelBlock.
2648         (Block.ThisVariable, Block.AddThisVariable): Likewise.
2649         (Block.Variables): Make protected.  Initialize variable hashtable
2650         if necessary.
2651         (Block.AddVariable): Update.
2652         (Block.Resolve): Update to changes.
2653         (ToplevelBlock.HasVarargs): New boolean.
2654         (ToplevelBlock.ThisVariable): Move here from Block.
2655         (ToplevelBlock.AddThisVariable): Likewise.
2656         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
2657         * expression.cs (This.ResolveBase): Update to changes.
2658         (ArglistAccess.DoResolve): Likewise.
2659
2660 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
2661
2662         Fix #75321
2663         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
2664
2665         * class.cs (TypeContainer.VerifyMembers): Distinguish between
2666         not used and not used & assigned.
2667         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
2668
2669 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
2670
2671         Fix #75053
2672         * expression.cs (Is.DoResolve): null is never provided type.
2673
2674 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
2675
2676         Fix #52496
2677         * cs-parser.jay: Less strict event error rule to catch more errors.
2678
2679 2005-07-11  Martin Baulig  <martin@ximian.com>
2680
2681         * generic.cs (ConstructedType.CheckConstraints): Improve the check
2682         for the constructor constraint: we do not only have to check
2683         whether the class has a public constructor, but also ensure that
2684         it's parameterless.  Fixes #75492.
2685
2686 2005-07-11  Martin Baulig  <martin@ximian.com>
2687
2688         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
2689         between type parameters if they either have the reference type
2690         constraint or the class constraint.
2691
2692 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
2693
2694         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
2695
2696 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
2697
2698         Fix #74975
2699         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
2700         (ExtractSecurityPermissionSet): Cope with self referencing security
2701         attributes properly.
2702
2703         * driver.cs (SetOutputFile): Made public property OutputFile.
2704
2705 2005-07-07  Raja R Harinath  <rharinath@novell.com>
2706
2707         Fix #75486.
2708         * class.cs (TypeContainer.first_nonstatic_field): Rename from
2709         has_nonstatic_fields.  Make into a FieldBase pointer.
2710         (TypeContainer.AddField): Add CS0282 check.
2711         (TypeContainer.EmitType): Update.
2712
2713 2005-07-06  Miguel de Icaza  <miguel@novell.com>
2714
2715         * cs-tokenizer.cs (consume_identifier): Do not create strings to
2716         compare if they start with __.
2717
2718 2005-07-06  Raja R Harinath  <rharinath@novell.com>
2719
2720         * statement.cs (Switch.SwitchGoverningType): Only look at
2721         UserCasts that don't need implicit standard conversions to one of
2722         the allowed switch types (Fixes test-322.cs).
2723         (LocalInfo.Resolve): Re-enable sanity-test.
2724
2725 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
2726
2727         * cs-tokenizer.cs (consume_identifier): Detect double undescores
2728         
2729         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
2730         
2731         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
2732
2733 2005-07-06  Raja R Harinath  <rharinath@novell.com>
2734
2735         Fix #75472.
2736         * ecore.cs (SimpleName.GetSignatureForError): Add.
2737         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
2738         (MemberAccess.GetSignatureForError): Add.
2739
2740 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
2741  
2742         The big error and warning messages review.
2743         
2744         * anonymous.cs,
2745         * assign.cs,
2746         * attribute.cs,
2747         * class.cs,
2748         * codegen.cs,
2749         * convert.cs,
2750         * cs-parser.jay,
2751         * cs-tokenizer.cs,
2752         * decl.cs,
2753         * delegate.cs,
2754         * doc.cs,
2755         * driver.cs,
2756         * ecore.cs,
2757         * enum.cs,
2758         * expression.cs,
2759         * flowanalysis.cs,
2760         * iterators.cs,
2761         * literal.cs,
2762         * location.cs,
2763         * modifiers.cs,
2764         * namespace.cs,
2765         * parameter.cs,
2766         * pending.cs,
2767         * report.cs,
2768         * rootcontext.cs,
2769         * statement.cs,
2770         * support.cs,
2771         * tree.cs,
2772         * typemanager.cs: Updated.
2773         
2774         * class.cs: (MethodCore.SetYields): Moved here to share.
2775         (PropertyMethod.Define): Moved iterator setup here.
2776         
2777         * iterators.cs: Add orig_method to have full access to parent
2778         container.
2779
2780 2005-07-05  Raja R Harinath  <rharinath@novell.com>
2781
2782         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
2783         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
2784         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
2785         variable of struct type.
2786         * expression.cs (Unary.ResolveOperator): Update to change.
2787         (Indirection.VerifyFixed): Likewise.
2788         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
2789         (ParameterReference.VerifyFixed): Value parameters are fixed.
2790         (This.VerifyFixed): Treat 'this' as a value parameter.
2791         * statement.cs (LocalInfo.IsFixed): Remove.
2792
2793 2005-07-01  Martin Baulig  <martin@ximian.com>
2794
2795         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
2796         `ec.EmitThis ()' to get the correct scope.
2797
2798 2005-07-01  Martin Baulig  <martin@ximian.com>
2799
2800         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
2801         instance is a ParameterReference; fixes #75299.
2802
2803 2005-06-30  Raja R Harinath  <rharinath@novell.com>
2804
2805         Fix #75412.
2806         * expression.cs (Indexers.map): Remove.
2807         (Indexers.Append): Filter out inaccessible setters and getters.
2808         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
2809
2810         Fix #75283.
2811         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
2812         Refactored from ...
2813         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
2814         (FieldExpr.Emit, PropertyExpr.Emit): Update.
2815         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
2816         * expression.cs (Invocation.EmitCall): Add CS0120 check.
2817
2818 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
2819
2820         Fix #75322
2821         * class.cs (FieldBase.GetInitializerExpression): One more field
2822         for backup.
2823
2824 2005-06-28  Miguel de Icaza  <miguel@novell.com>
2825
2826         * pending.cs: Do not define a proxy if the base method is virtual,
2827         it will be picked up by the runtime (bug 75270).
2828
2829 2005-07-08  Martin Baulig  <martin@ximian.com>
2830
2831         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
2832         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
2833
2834 2005-07-07  Martin Baulig  <martin@ximian.com>
2835
2836         * generic.cs (ConstructedType.CheckConstraint): Use
2837         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
2838         called recursively; fixes #75329.
2839
2840 2005-07-06  Martin Baulig  <martin@ximian.com>
2841
2842         * generic.cs (TypeManager.InferTypeArguments): Added support for
2843         anonymous methods; fixes #75461.
2844
2845 2005-07-01  Martin Baulig  <martin@ximian.com>
2846
2847         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
2848         `ec.EmitThis ()' to get the correct scope.
2849
2850 2005-07-01  Martin Baulig  <martin@ximian.com>
2851
2852         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
2853         instance is `This'; fixes #75299.
2854
2855 2005-06-30  Martin Baulig  <martin@ximian.com>
2856
2857         * class.cs (Indexer): Implement IIteratorContainer; added support
2858         for iterators in indexers.
2859
2860         * codegen.cs
2861         (EmitContext.CurrentIterator): Make this a property, not a field.
2862
2863         * anonymous.cs (AnonymousContainer.Iterator): New public property.
2864
2865 2005-06-28  Miguel de Icaza  <miguel@novell.com>
2866
2867         * pending.cs: Do not define a proxy if the base method is virtual,
2868         it will be picked up by the runtime (bug 75270).
2869
2870 2005-06-28  Martin Baulig  <martin@ximian.com>
2871
2872         * cs-parser.jay (interface_method_declaration): Avoid a
2873         reduce/reduce conflict by moving some of the code into a separate
2874         `interface_method_declaration_body' rule; fixes #75368.
2875
2876 2005-06-28  Martin Baulig  <martin@ximian.com>
2877
2878         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
2879         array check after the check for TypeBuilder's.
2880
2881 2005-06-21  Raja R Harinath  <rharinath@novell.com>
2882
2883         * convert.cs (FindMostEncompassedType): Add two trivial special
2884         cases (number_of_types == 0 || number_of_types == 1).
2885         (FindMostEncompasingType): Likewise.
2886
2887 2005-06-17  Raja R Harinath  <rharinath@novell.com>
2888
2889         Some cleanups preparing for the fix of #75283.
2890         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
2891         error testing.
2892         (EventExpr.InstanceResolve): Likewise.
2893         (EventExpr.DoResolve): Remove redundant checks.
2894
2895 2005-06-08  Miguel de Icaza  <miguel@novell.com>
2896
2897         * class.cs: Small fix.
2898
2899 2005-06-08  Raja R Harinath  <rharinath@novell.com>
2900
2901         Fix #75160.
2902         * class.cs (GetPartialBases): Fix return value check of
2903         part.GetClassBases.
2904
2905 2005-06-07  Raja R Harinath  <rharinath@novell.com>
2906
2907         Ensure that partial classes are registered in their enclosing
2908         namespace.  Initial part of fix of #75160.
2909         * tree.cs (Tree.RecordDecl): Add new namespace argument.
2910         Register declspace with namespace here, not in
2911         DeclSpace.RecordDecl.
2912         * cs-parser.jay: Pass namespace to RecordDecl.
2913         * class.cs (PartialContainer.Create): Likewise.
2914         (ClassPart.DefineType): New sanity-check.  Throws an exception if
2915         called.
2916         * decl.cs (Declspace.RecordDecl): Remove.
2917         * namespace.cs (NamespaceEntry.DefineName): Remove.
2918
2919 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
2920
2921         * rootcontext.cs: Reset TargetExt as well.
2922
2923 2005-06-03  Raja R Harinath  <rharinath@novell.com>
2924
2925         * ecore.cs (Expression.Resolve): Emit CS0654 error when
2926         -langversion:ISO-1.
2927
2928 2005-06-02  Raja R Harinath  <rharinath@novell.com>
2929
2930         Fix #75080, cs0119.cs.
2931         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
2932         of ...
2933         (Expression.Resolve): ... this.  Use it.  Remove bogus code
2934         allowing ExprClass.Type and ExprClass.Namespace for
2935         ResolveFlags.VariableOrValue.
2936         (Expression.Resolve) [1-argument variant]: Change default resolve
2937         flags based on language version.
2938         (Expression.Error_UnexpectedKind): Use a simple string array
2939         rather than an ArrayList.
2940         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
2941         not ExprClass.Type.
2942         (TypeOfVoid.DoResolve): Likewise.
2943         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
2944         flags argument -- it always has the same value.
2945
2946 2005-05-31  Raja R Harinath  <rharinath@novell.com>
2947
2948         Fix #75081.
2949         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
2950         Use it in the error message.
2951         * assign.cs, expression.cs, statement.cs: Update.
2952
2953 2005-05-30  Raja R Harinath  <rharinath@novell.com>
2954
2955         Fix #75088.
2956         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
2957         the "almostMatchedMember" case too.
2958         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
2959         that failed the accessibility checks to 'almost_match'.
2960
2961 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
2962
2963         * attribute.cs: Use internal MethodBuilder methods to set
2964         ExactSpelling and SetLastError on PInvoke methods, instead
2965         of passing them via charset.  Fixes #75060.
2966
2967 2005-05-27  Raja R Harinath  <rharinath@novell.com>
2968
2969         * parameter.cs (Parameter): Remove TODO comment.
2970         (Parameter.DefineParameter): Remove Location parameter.
2971         (Parameters.LabelParameters): Likewise.
2972         * class.cs (Constructor.Emit): Update to change.
2973         (MethodData.Emit): Likewise.
2974         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
2975         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
2976
2977 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
2978
2979         * parameter.cs,
2980           Removed Parameters.Location and added Parameter.Location instead.
2981           Removed Location parameter from Emit() and GetSignature().
2982         * anonymous.cs,
2983           class.cs,
2984           cs-parser.jay,
2985           delegate.cs,
2986           iterators.cs,
2987           statement.cs :
2988           Modified all related calls.
2989
2990 2005-06-21  Martin Baulig  <martin@ximian.com>
2991
2992         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
2993         left-hand side is not a nullable type; fixes #75328.
2994
2995 2005-06-21  Martin Baulig  <martin@ximian.com>
2996
2997         * typemanager.cs
2998         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
2999         (TypeManager.GetFullNameSignature): Likewise.
3000
3001         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
3002         `source.FullName' and `target.FullName' to check whether there are
3003         two conflicting definitions.
3004
3005 2005-06-21  Martin Baulig  <martin@ximian.com>
3006
3007         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
3008         a BoxedCast - also for reference types - to be compatible with csc.
3009
3010 2005-06-21  Martin Baulig  <martin@ximian.com>
3011
3012         * expression.cs (MemberAccess.DoResolve): Add support for nested
3013         types in a generic instance; fixes #75320.
3014
3015 2005-06-20  Martin Baulig  <martin@ximian.com>
3016
3017         * generic.cs (TypeManager.InferType): Also walk the class
3018         hierarchy for generic instances; fixes #75261.
3019
3020 2005-06-17  Martin Baulig  <martin@ximian.com>
3021
3022         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
3023         to make things work for corlib.
3024
3025 2005-06-15  Martin Baulig  <martin@ximian.com>
3026
3027         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
3028         obsolete `SecurityAction' values.
3029
3030 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3031
3032         * rootcontext.cs: Reset TargetExt as well.
3033         
3034 2005-06-09  Martin Baulig  <martin@ximian.com>
3035
3036         * delegate.cs (Delegate.VerifyMethod): Added
3037         `MethodGroupExpr old_mg' argument; inherit its
3038         `HasTypeParameters'; fix #75085.
3039
3040 2005-06-09  Martin Baulig  <martin@ximian.com>
3041
3042         * expression.cs (Invocation.OverloadResolve): Correctly handle
3043         generic methods for the SetMemberIsUsed(); fix #75064.
3044
3045 2005-06-09  Martin Baulig  <martin@ximian.com>
3046
3047         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
3048         fixes #75062.
3049
3050 2005-06-08  Martin Baulig  <martin@ximian.com>
3051
3052         * cs-parser.jay (nullable_type_or_conditional): If we put the
3053         nullable back and our `type' is a `ComposedCast', remove the
3054         nullable from it.  Fixes #75156.
3055
3056         * expression.cs (ComposedCast.RemoveNullable): New public method.
3057
3058 2005-06-08  Martin Baulig  <martin@ximian.com>
3059
3060         The big Iterators rewrite :-)
3061
3062         * iterators.cs: Rewrite this to use the anonymous methods framework.
3063
3064         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3065         before the TypeContainers; see 2test-21.cs.
3066
3067         * class.cs
3068         (TypeContainer.DefineType): Don't create a new EmitContext if we
3069         already have one (this only happens if we're an Iterator).
3070         (TypeContainer.Define): Also call Define() on all our iterators.
3071         (Method.CreateEmitContext): Added support for iterators.
3072
3073         * anonymous.cs
3074         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3075         (AnonymousContainer.CreateMethodHost): Moved here from
3076         AnonymousMethod and made abstract.
3077         (AnonymousContainer.CreateScopeType): New abstract method.
3078         (AnonymousContainer.IsIterator): New public property.
3079         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3080         get the ScopeTypeBuilder rather than manually defining it here. 
3081         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3082         iterators here.
3083
3084         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3085         before RootContext.DefineTypes().
3086
3087         * codegen.cs (EmitContext.RemapToProxy): Removed.
3088         (EmitContext.CurrentAnonymousMethod): Changed type from
3089         AnonymousMethod -> AnonymousContainer.
3090         (EmitContext.ResolveTopBlock): Protect from being called twice.
3091         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3092         (EmitContext.EmitThis): Removed the iterators hacks; use the
3093         anonymous methods framework for that.
3094
3095         * statement.cs
3096         (ToplevelBlock.Container): Make this a property, not a field.
3097         (ToplevelBlock.ReParent): New public method; move the
3098         ToplevelBlock into a new container.
3099         (Foreach.TemporaryVariable): Simplify.
3100
3101 2005-06-05  Martin Baulig  <martin@ximian.com>
3102
3103         * statement.cs (LocalInfo.CompilerGenerated): New flag.
3104         (Block.AddTemporaryVariable): New public method; creates a new
3105         `LocalInfo' for a temporary variable.
3106         (Block.EmitMeta): Create the LocalBuilders for all the temporary
3107         variables here.
3108         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3109         non-iterator variables.
3110
3111 2005-06-05  Martin Baulig  <martin@ximian.com>
3112
3113         * statement.cs (Foreach.TemporaryVariable): Create the
3114         LocalBuilder in the Emit phase and not in Resolve since in some
3115         situations, we don't have an ILGenerator during Resolve; see
3116         2test-19.cs for an example.
3117
3118 2005-06-04  Martin Baulig  <martin@ximian.com>
3119
3120         The big Foreach rewrite - Part II.
3121
3122         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3123         with `PropertyInfo ienumerator_getcurrent'.
3124
3125         * codegen.cs (VariableStorage): Removed.
3126
3127         * statement.cs
3128         (Foreach): Derive from Statement, not ExceptionStatement.
3129         (Foreach.CollectionForeach): New nested class.  Moved all the code
3130         dealing with collection foreach here.
3131         (Foreach.ForeachHelperMethods): Removed.
3132         (Foreach.TemporaryVariable): Implement IMemoryLocation.
3133
3134 2005-05-23  Martin Baulig  <martin@ximian.com>
3135
3136         * statement.cs (Try.DoResolve): Don't create a `finally' if we
3137         don't need to.  Fix #75014.
3138
3139 2005-05-26  Raja R Harinath  <rharinath@novell.com>
3140
3141         Improve user-defined conversion handling.
3142         * convert.cs (GetConversionOperators): Rewrite.  Return only the
3143         applicable operators.
3144         (AddConversionOperators): New.  Helper for GetConversionOperators.
3145         (FindMostEncompassedType, FindMostEncompassingType): Verify that
3146         there is only one most encompassed/encompassing type.
3147         (FindMostSpecificSource, FindMostSpecificTarget): Remove
3148         "applicable operator" handling.
3149         (UserConversion): Move cache here from GetConversionOperators.
3150         Directly cache the chosen operator, rather than the whole
3151         MethodGroup.
3152         (ExplicitNumericConversion): Fix buggy implementation of Decimal
3153         case.  Allow conversion of decimal to sbyte and byte too.
3154         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3155         New static methods.  Used to avoid allocating EmptyExpressions in
3156         convert.cs.
3157
3158 2005-05-24  Duncan Mak  <duncan@novell.com>
3159
3160         * ecore.cs (CastFromDecimal): New class for casting a decimal to
3161         another class, used in Convert.ExplicitNumericConversion.
3162         (CastToDecimal): New class, similar to above, but casts to
3163         System.Decimal, used in Convert.ImplicitNumericConversion and also
3164         in explicit convesion from double/float to decimal.
3165
3166         * convert.cs (ImplicitNumericConversion): Handle implicit
3167         conversions to System.Decimal.
3168         (ExplicitNumericConversion): handle explicit conversions to
3169         System.Decimal.
3170
3171         This fixes #68711.
3172         
3173 2005-05-20  Miguel de Icaza  <miguel@novell.com>
3174
3175         * typemanager.cs: Do not throw an exception in the TypeBuilder
3176         case, we take care of it on the TypeCode.
3177
3178 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
3179         
3180         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
3181         is back.
3182         
3183         * cs-parser.jay: Catch more lexical errors.
3184         
3185         * report.cs: Add one more Error method.
3186         
3187         * rootcontext.cs,
3188         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
3189
3190 2005-05-20  Martin Baulig  <martin@ximian.com>
3191
3192         * class.cs (TypeContainer.CircularDepException): Removed.
3193         (TypeContainer.DefineType): Removed the `InTransit' stuff.
3194         (TypeContainer.CheckRecursiveDefinition): Check for circular class
3195         (CS0146) and interface (CS0529) dependencies here.
3196
3197 2005-05-20  Martin Baulig  <martin@ximian.com>
3198
3199         * expression.cs (New.DoResolve): Move the CS0712 check above the
3200         CS0144 check; otherwise it can never be reached.
3201
3202 2005-05-20  Martin Baulig  <martin@ximian.com>
3203
3204         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
3205
3206 2005-05-20  Martin Baulig  <martin@ximian.com>
3207
3208         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
3209
3210         * typemanager.cs (TypeManager.IsAttributeType): New public method.
3211
3212 2005-05-19  Martin Baulig  <martin@ximian.com>
3213
3214         * delegate.cs
3215         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
3216         to disable error reporting.
3217
3218         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
3219         here since we don't want to report an error; see the new test-336.cs.
3220
3221 2005-05-19  Raja R Harinath  <rharinath@novell.com>
3222
3223         * statement.cs (ToplevelBlock.GetParameterReference)
3224         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
3225         Move here from class Block.
3226         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
3227         * expression.cs (ParameterReference.DoResolveBase): Likewise.
3228
3229 2005-05-18  Martin Baulig  <martin@ximian.com>
3230
3231         Fix #74978.
3232
3233         * flowanalysis.cs
3234         (FlowBranching.Reachability): Add non-static public And() and Or()
3235         methods.
3236         (FlowBranchingSwitch): New class; do the `break_origins' thing
3237         like in FlowBranchingLoop.
3238         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
3239         reachability, not just locals and parameters.
3240         (FlowBranching.MergeChild): Remove some of the hacks for loop and
3241         switch; MergeBreakOrigins() now takes care of that.
3242
3243 2005-05-18  Martin Baulig  <martin@ximian.com>
3244
3245         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3246         a loop and may leave it, reset the barrier; fixes #74974.
3247
3248 2005-05-16  Raja R Harinath  <rharinath@novell.com>
3249
3250         Fix test-382.cs.  Emit values of decimal constants.
3251         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3252         Carved out of ...
3253         (TypeContainer.AddField): ... this.
3254         (TypeContainer.EmitFieldInitializers): Allow the list of fields
3255         with initializers to include 'Const's.
3256         (ClassPart.RegisterFieldForInitialization): Forward to
3257         PartialContainer.
3258         * const.cs (Const.Const): Pass initializer to base class.
3259         (Const.Define): In case of decimal constants, register them for
3260         initialization in a static constructor.
3261
3262 2005-05-14  Martin Baulig  <martin@ximian.com>
3263
3264         * statement.cs (Block.Resolve): Correctly handle unreachable code;
3265         do not call ResolveUnreachable() on unreachable statements in
3266         here, see the comment in the source code.
3267
3268 2005-05-13  Raja R Harinath  <rharinath@novell.com>
3269
3270         Fix #74934.
3271         * expression.cs (BinaryResolveOperator): If one of the operands of
3272         an equality comparison is 'null' and the other is a pointer type,
3273         convert the null to a NullPointer.
3274         * convert.cs (ImplicitReferenceConversion): If the expression is a
3275         NullLiteral and the target type is a pointer type, return a
3276         NullPointer instead.
3277         (ImplicitConversionStandard): Likewise.
3278
3279 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
3280         
3281         * cs-parser.jay: Set readonly context based on special constructs.
3282         
3283         * expression.cs (LocalVariableReference.DoResolveBase): Improved
3284         readonly variable error handling.
3285         
3286         * rootcontext.cs (EmitCode): Don't verify members when error
3287         occurred.
3288         
3289         * statement.cs (LocalInfo): Add reaodnly context information.
3290         (SetReadOnlyContext, GetReadOnlyContext): New methods.
3291
3292 2005-05-17  Martin Baulig  <martin@ximian.com>
3293
3294         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3295         #70970. 
3296
3297 2005-05-13  Martin Baulig  <martin@ximian.com>
3298
3299         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
3300         handle unreachable blocks.
3301
3302 2005-05-13  Martin Baulig  <martin@ximian.com>
3303
3304         * class.cs
3305         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
3306         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
3307         #74905. 
3308
3309 2005-05-13  Martin Baulig  <martin@ximian.com>
3310
3311         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3312         instance variable, not a local.  Fix #74873.
3313         (Block.ResolveUnreachable): Set it to true here.
3314
3315 2005-05-12  Martin Baulig  <martin@ximian.com>
3316
3317         * cs-parser.jay (property_declaration): Pass the `current_class',
3318         not the `current_container' to Property's .ctor.  Fixes #74912.
3319
3320 2005-05-11  Martin Baulig  <martin@ximian.com>
3321
3322         * typemanager.cs (Closure): Copy this from MCS and merge all the
3323         GMCS-specific changes into it.
3324
3325 2005-05-12  Raja R Harinath  <harinath@gmail.com>
3326
3327         Fix #74920.
3328         * typemanager.cs (unmanaged_enclosing_types): New.
3329         (IsUnmanagedType): Avoid infloops by using
3330         'unmanaged_enclosing_types' to talk with recursive invocations.
3331
3332 2005-05-11  Duncan Mak  <duncan@novell.com>
3333
3334         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3335         continuing to process for 'arg'.
3336         (handle_preprocessing_directive): Check the argument of the #endif
3337         directive and report error CS1025 if there are any trailing
3338         characters.
3339
3340         According to the C# spec, having even whitespace after the #endif
3341         directive is illegal; however, because we call arg.TrimEnd ()
3342         beforehand, we have the same behavior as csc, allowing whitespace
3343         after the directive.
3344
3345         Fixes #74892.
3346
3347 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
3348
3349         Fix #74863.
3350         
3351         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3352         (Constructor.GetObsoleteAttribute): Implemented correctly.
3353
3354 2005-05-10  Martin Baulig  <martin@ximian.com>
3355
3356         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
3357         resolve the type; fixes #74864.
3358         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
3359         in DoResolve(); fixes #74862.
3360
3361 2005-05-10  Martin Baulig  <martin@ximian.com>
3362
3363         * support.cs (ReflectionParameters.ParameterModifier): Use
3364         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3365         and `ParameterAttributes.In'.  Fixes #74884.
3366
3367 2005-05-10  Martin Baulig  <martin@ximian.com>
3368
3369         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
3370         the cache if we're just looking for `MemberTypes.NestedType' in a
3371         generic instance.
3372
3373         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3374         constraints if we're still resolving the type tree.
3375         (Expression.MemberLookup): If we're resolving the type tree, only
3376         look for `MemberTypes.NestedType' since we're only interested in
3377         getting types.
3378
3379         * class.cs (TypeContainer.DefineType): Don't resolve the type
3380         parameters here; do this later in ResolveType() after the type
3381         tree has been resolved.
3382         (TypeContainer.ResolveType): New public method; this is called
3383         after the type tree is resolved and before the types are being
3384         populated.  We resolve the generic constraints here.
3385         (TypeContainer.DoDefineMember): Check the constraints on our base
3386         class and interfaces.
3387
3388         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
3389         set the `ResolvingTypeTree' flag on the EmitContext.
3390
3391         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
3392
3393 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
3394
3395         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3396         
3397         * expression.cs (Argument.GetParameterModifier): Turned to property.
3398         (Invocation.Error_InvalidArguments): Add more descriptive errors.
3399         
3400         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3401         its C# equivalent.
3402         
3403 2005-05-09  Raja R Harinath  <rharinath@novell.com>
3404
3405         Fix #74852.
3406         * decl.cs (MemberCache.AddMethods): Register override methods,
3407         rather than non-override methods.
3408         * typemanager.cs (RegisterOverride): New.
3409         (IsOverride): Update.
3410
3411 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3412
3413         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
3414
3415 2005-05-06  Martin Baulig  <martin@ximian.com>
3416
3417         * attribute.cs
3418         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
3419         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
3420
3421 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3422
3423         Fix #73105.
3424         
3425         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3426         recursive declaration.
3427         
3428         * statement.cs (Block.ResolveMeta): Report any error in resolving.
3429         
3430 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
3431
3432         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
3433         
3434         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
3435
3436 2005-05-05  Raja R Harinath  <rharinath@novell.com>
3437
3438         Fix #74797.
3439         * decl.cs (DeclSpace.FamilyAccessible): 
3440         Use TypeManager.IsNestedFamilyAccessible.
3441
3442         Fix reopened #64812.
3443         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
3444         internal'.
3445
3446 2005-05-04  Raja R Harinath  <rharinath@novell.com>
3447             Abin Thomas  <projectmonokochi@rediffmail.com>
3448             Anoob V E  <projectmonokochi@rediffmail.com>
3449             Harilal P R  <projectmonokochi@rediffmail.com>
3450
3451         Fix #64812.
3452         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
3453         allow access to all static members.
3454
3455 2005-05-04  Martin Baulig  <martin@ximian.com>
3456
3457         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
3458
3459 2005-05-04  Martin Baulig  <martin@ximian.com>
3460
3461         Fix #74655.
3462
3463         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
3464         section at the end; make things work if `default' is not the last
3465         section.        
3466
3467 2005-05-04  Martin Baulig  <martin@ximian.com>
3468
3469         Fix #70400.
3470
3471         * statement.cs (Switch): Replaced the `got_default' field with a
3472         `default_section' one.
3473         (Switch.CheckSwitch): Set `default_section' here.
3474         (Switch.Resolve): If we're a constant switch and the constant is
3475         not found, use the default section.
3476
3477 2005-05-03  Martin Baulig  <martin@ximian.com>
3478
3479         * expression.cs (ArrayAccess.EmitGetLength): New public method.
3480
3481         * statement.cs (Foreach.ArrayForeach): New nested class.
3482         (Foreach.TemporaryVariable): New nested class.
3483         (Foreach.EmitArrayForeach): Removed; this is now in the new
3484         ArrayForeach class.
3485
3486 2005-05-03  Raja R Harinath  <rharinath@novell.com>
3487
3488         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
3489         more conservative.
3490         (VerifyPendingMethods): Revert change below.
3491
3492         * typemanager.cs (IsOverride, RegisterNonOverride): New.
3493         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
3494         that used to trigger warning -28.  Remove warning -28.
3495         * expression.cs (Invocation.OverloadResolve): Use
3496         TypeManager.IsOverride to distinguish override methods.
3497
3498         Fix #74773.
3499         * pending.cs (VerifyPendingMethods): If a base type implements the
3500         requested interface, don't bother checking individual methods of
3501         the base type.  As a side-effect, this prevents the creation of
3502         unnecessary proxies.
3503
3504 2005-05-02  Martin Baulig  <martin@ximian.com>
3505
3506         Fix #70182.
3507
3508         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3509         Also `And' the locals if the old vector is null.
3510         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
3511         null; in this case we basically reset all the variables.        
3512
3513 2005-05-02  Martin Baulig  <martin@ximian.com>
3514
3515         Fix #74529.
3516
3517         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
3518         Added `FlowBranching branching' argument; always `and' the
3519         variables instead of `or'ing them unless we're an infinite loop.
3520
3521         * statement.cs (While.Resolve): Create a new sibling unless we're
3522         infinite.       
3523
3524 2005-05-02  Martin Baulig  <martin@ximian.com>
3525
3526         Fix #70140.
3527
3528         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
3529         arguments; use it instead of creating a new TopLevelBlock.
3530         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
3531         our ConstructorInitializer.
3532
3533         * statement.cs
3534         (TopLevelBlock.TopLevelBranching): New public property.
3535         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
3536         and create our `TopLevelBranching'.
3537
3538         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
3539         anonymous method host, use `block.TopLevelBranching' rather than
3540         creating a new branching.
3541
3542 2005-04-20  Miguel de Icaza  <miguel@novell.com>
3543
3544         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
3545         a ScopeInfo, if any of the current children is a child of the new
3546         entry, move those children there.
3547
3548 2005-04-30  Martin Baulig  <martin@ximian.com>
3549
3550         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
3551         at the beginning of a SwitchSection.  Fix #73335.
3552
3553 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
3554
3555         Fix #74378
3556         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
3557         
3558         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
3559         (FieldExpr.DoResolve): Obsolete members are ignored for field
3560         initializers.
3561         
3562 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
3563
3564         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
3565         of arrays detection.
3566
3567         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
3568         verification.
3569         (Field.VerifyClsCompliance): Volatile fields are not compliant.
3570
3571         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
3572         arrays report.
3573
3574 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
3575
3576         * cs-parser.jay: Use the prefered version of -unsafe in error
3577         message.
3578
3579 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
3580
3581         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
3582         circumstances.
3583
3584 2005-04-20  John Luke  <john.luke@gmail.com>
3585
3586         * driver.cs: fix typo in error message, --outout to --output
3587
3588 2005-04-30  Martin Baulig  <martin@ximian.com>
3589
3590         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
3591         handle the .NET 2.x security attributes.
3592
3593 2005-04-30  Martin Baulig  <martin@ximian.com>
3594
3595         * typemanager.cs
3596         (TypeManager.ExpandInterfaces): Don't add things twice.
3597
3598         * class.cs
3599         (TypeContainer.VerifyClsCompliance): Allow generic instances.
3600
3601 2005-04-29  Martin Baulig  <martin@ximian.com>
3602
3603         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
3604
3605         * anonymous.cs: Added support for anonymous generic methods.
3606
3607 2005-04-29  Martin Baulig  <martin@ximian.com>
3608
3609         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
3610         generic instances.
3611
3612 2005-04-29  Martin Baulig  <martin@ximian.com>
3613
3614         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
3615
3616         * expression.cs (New.DoResolve): Fix the CS0304 check.
3617
3618 2005-04-29  Martin Baulig  <martin@ximian.com>
3619
3620         * typemanager.cs (TypeManager.GetFullName): Updated to the new
3621         naming schema.
3622
3623         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
3624         explicit interface implementation, compare the interface types.
3625         (MethodData.Define): Use the new naming scheme from the latest
3626         .NET 2.x beta2.
3627         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
3628
3629         * decl.cs (MemberName.GetMemberName): Removed.
3630         (MemberName.MethodName, FullName): New properties.
3631
3632 2005-04-25  Raja R Harinath  <rharinath@novell.com>
3633
3634         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
3635
3636 2005-04-22  Martin Baulig  <martin@ximian.com>
3637
3638         * generic.cs (GenericMethod): Create the EmitContext in the
3639         `Define()'; in `Define(MethodBuilder)', create the type parameters
3640         before calling `Define()'.  Fixes #73933.
3641
3642 2005-04-22  Martin Baulig  <martin@ximian.com>
3643
3644         * generic.cs
3645         (Constraints.Resolve): Make things work wrt. the new type lookup system.
3646         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
3647
3648         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
3649         ConstructedType, check its constraints.
3650
3651 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
3652
3653         * codegen.cs (InRefOutArgumentResolving): New field.
3654         
3655         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
3656         fields outside contructor.
3657         
3658         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
3659         
3660 2005-04-19  Miguel de Icaza  <miguel@novell.com>
3661
3662         * anonymous.cs (CaptureContext.EmitParameterInstance): The
3663         parameter code was not completed ever, so it was not as up-to-date
3664         as local variables.  Must finish it.
3665
3666         The bug fix was to compare the Toplevel of the block, not the
3667         current block.  Thanks for Ben for pointing this out. 
3668
3669 2005-04-19  Raja R Harinath  <rharinath@novell.com>
3670
3671         * decl.cs (AddMethods): Use the declaring type of the problem
3672         method to determine if we want to squash a warning.
3673
3674 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
3675
3676         * attribute.cs: Removed debug output.
3677
3678         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
3679         
3680         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
3681         Report.Stderr.
3682         
3683 2005-04-18  Raja R Harinath  <rharinath@novell.com>
3684
3685         Fix #74481.
3686         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
3687         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
3688         all null comparisons against reference types.
3689
3690 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
3691
3692         Fix# 74565
3693         * class.cs (TypeContainer.CircularDepException) New nested
3694         exception class.
3695         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
3696         (TypeContainer.DefineType): Removed error, reset InTransit before
3697         exit.
3698         (Class.DefineType): Throw exception when is in Transit.
3699         Catch exception and report error.
3700         (Struct.DefineType): Throw exception when is in Transit.
3701         Catch exception and report error.
3702         (Interface.DefineType): Throw exception when is in Transit.
3703         Catch exception and report error.
3704
3705         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
3706         handle nested exception handlers.
3707
3708         * flowanalysis.cs (InTryWithCatch): New method, search for try with
3709         a catch.
3710
3711         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
3712         InFinally and InCatch storage.
3713
3714         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
3715         (Catch.Resolve): Set and Restore ec.InCatch.
3716         (Try.Resolve): Set and Restore ec.InFinally.
3717         (Try.HasCatch): True when try has catch.
3718
3719 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
3720
3721         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
3722           for the same event member, so exclude such cases from warning 419.
3723           Fixed bug #74633.
3724
3725 2005-04-16  Miguel de Icaza  <miguel@novell.com>
3726
3727         * expression.cs (Binary.ResolveOperator): Apply patch from John
3728         Luke to fix bug 59864: operators &, | and ^ on enumerations
3729         require that the same enum type on both sides.
3730
3731         * driver.cs: Add warnings to old flag usage, this is to assist
3732         people who produce Makefiles and hope that the Makefiles will be
3733         used on Windows.
3734
3735         * class.cs (TypeContainer.EmitType): Moved the definition of the
3736         special $PRIVATE$ field from the resolve phase to the Emit phase.
3737         During resolve we do not know if we are a struct with
3738         HasExplicitLayout, we know this only after the attributes for the
3739         type are emitted.
3740
3741         Set the FieldOffset to zero on the dummy field that we create for
3742         the class.   Fixes 74590.
3743
3744 2005-04-16  Raja R Harinath  <rharinath@novell.com>
3745
3746         Fix #73834.
3747         * ecore.cs (PropertyExpr.resolved): New.
3748         (DoResolve): Use it to handle a case of double resolution here.
3749         Handle a case of identical-name-and-type-name.
3750         * expression.cs (ArrayCreation.CheckIndices): Avoid double
3751         resolution by storing the results of expression resolution back
3752         into the "probes" array.
3753
3754 2005-04-15  Raja R Harinath  <rharinath@novell.com>
3755
3756         Fix cs0208-7.cs and cs0208-8.cs.
3757         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
3758         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
3759         error reporting to point out the reason a struct is not unmanaged.
3760
3761 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
3762
3763         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
3764           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
3765
3766 2005-04-13  Raja R Harinath  <rharinath@novell.com>
3767
3768         Fix #74528.
3769         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
3770         IdenticalNameAndTypeName here.
3771         (EventExpr.InstanceResolve): Likewise.
3772
3773 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
3774
3775         C# 2.0 DefaultCharSetAttribute implementation
3776         
3777         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
3778         which allows us to set GlobalNamespace for every resolve.
3779         (Attribute.ResolveArguments): Cut from Resolve.
3780         (Attribute.GetCharSetValue): Returns CharSet named argument.
3781         (Attribute.DefinePInvokeMethod): Gets default charset from
3782         module settings.
3783         (GlobalAttribute.ResolveAsTypeStep): Override.
3784         (GlobalAttribute.ResolveArguments): Override.
3785         
3786         * class.cs (TypeAttr): Is protected.
3787         
3788         * codegen.cs (ModuleClass.DefaultCharSet): New member.
3789         (ModuleClass.DefaultCharSetType): New memeber.
3790         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
3791         
3792         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
3793         charset from module.
3794         
3795         * delegate.cs (TypeAttr): Override.
3796         (Delegate.DefineType): Use this TypeAttr.
3797         
3798         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
3799         at very early stage (before types are defined) to resolve model
3800         module attributes. It will probably not work with corlib but it
3801         should be ok.
3802         
3803         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
3804         charset from module.
3805         
3806         * typemanager.cs (default_charset_type): New type.
3807
3808 2005-04-13  Raja R Harinath  <rharinath@novell.com>
3809
3810         * decl.cs (MemberCache.AddMethods): Don't warn if
3811         System.Object.Finalize has buggy MethodAttributes.
3812
3813         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
3814         removed below.
3815
3816 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
3817
3818         * doc.cs : detect ambiguous reference to overloaded members.
3819           Fixed bug #71603. MS 1.1 csc does not detect it.
3820
3821 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
3822
3823         * doc.cs : delegates must not be referenced with parameters.
3824           Fixed bug #71605.
3825
3826 2005-04-12  Miguel de Icaza  <miguel@novell.com>
3827
3828         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
3829
3830 2005-04-10  Miguel de Icaza  <miguel@novell.com>
3831
3832         * driver.cs (MainDriver): Stop processing if the CLS stage found
3833         errors. 
3834
3835         (CompilerCallableEntryPoint.InvokeCompiler): Always
3836         reset after execution;   Take a TextWriter argument for the
3837         output.
3838
3839         * report.cs: Use the error stream instead of hardcoding stderr. 
3840
3841 2005-04-09  Miguel de Icaza  <miguel@novell.com>
3842
3843         * class.cs: Reduce code paths to test, too small of an
3844         optimization to make it worth the extra testing.  Always perform
3845         it. 
3846
3847 2005-04-08  Raja R Harinath  <rharinath@novell.com>
3848
3849         Fix #74510.
3850         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
3851         operators that had errors reported on them.
3852
3853 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
3854
3855         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
3856         argument types.
3857         (Attribute.Resolve): Add named argument type checking.
3858         
3859         * class.cs (FixedField.Define): Use IsPrimitiveType
3860         
3861         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
3862         
3863         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
3864         unsafe parameter types.
3865         
3866         * statement.cs (Using.ResolveExpression): Add better error description.
3867         
3868         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
3869         
3870 2005-04-08  Raja R Harinath  <rharinath@novell.com>
3871
3872         Fix #74484.
3873         * attribute.cs (Attribute.GetAttributeUsage): Resolve
3874         AttributeUsageAttribute in the emitcontext of the attribute class,
3875         not in the emitcontext of the attributable entity it was attached to.
3876         * cs-parser.jay: Use 'current_class', not 'current_container',
3877         when creating a GlobalAttribute.
3878
3879 2005-04-08  Alp Toker  <alp@atoker.com>
3880
3881         * pending.cs: The fix to #58413 failed to compile methods implementing
3882         interfaces with/without params modifiers and vice versa, even though
3883         params modifiers aren't part of the signature. Make the modifier check
3884         less strict as in csc.
3885
3886 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
3887             Anoob V E  <projectmonokochi@rediffmail.com>
3888             Harilal P R  <projectmonokochi@rediffmail.com>
3889
3890         Fix #58413.
3891         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
3892         modifiers of pending methods.
3893         (PendingImplementation.PendingImplementation): Initialize it.
3894         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
3895         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
3896         with ParameterData.  Add check for modifiers.
3897         * class.cs (MethodData.Define): Update to changes.
3898
3899 2005-04-07  Raja R Harinath  <rharinath@novell.com>
3900
3901         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
3902
3903 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
3904
3905         * class.cs (PropertyMethod.Define): Check private accessor in abstract
3906         property.
3907         
3908         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
3909         
3910         * rootcontext.cs,
3911         * typemanager.cs: Registered RequiredAttributeAttribute.
3912         
3913 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
3914
3915         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
3916         Warning CS0169 is back at level 3.
3917         (IMethodData.SetMemberIsUsed): New method.
3918         
3919         * decl.cs (IsUsed): New value; moved from FieldBase.Status
3920         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
3921         
3922         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
3923
3924         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
3925         contants.
3926         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
3927         is used.
3928         
3929         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
3930         is used.
3931         
3932         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
3933         to avoid the problems with nested types.
3934
3935 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
3936             Anoob V.E  <projectmonokochi@rediffmail.com>
3937             Harilal P.R  <projectmonokochi@rediffmail.com>
3938             Raja R Harinath  <rharinath@novell.com>
3939
3940         Fix #73820.
3941         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
3942         attribute.
3943         * typemanager (GetConstructor): Make public.
3944
3945 2005-04-05  John Luke  <john.luke@gmail.com>
3946             Raja R Harinath  <rharinath@novell.com>
3947
3948         Fix #62232.
3949         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
3950         struct too.  Return false quicker in a few cases.
3951         (VerifyUnManaged): Use it.
3952
3953 2005-04-05  Raja R Harinath  <rharinath@novell.com>
3954
3955         Fix #74041.
3956         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
3957         not 'unreachable_seen'.
3958
3959 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
3960
3961         * attribute.cs (Attribute.GetValue): Removed unused.
3962         
3963         * codegen.cs (CodeGen.TrimExt): Removed unused.
3964         
3965         * cs-parser.jay (output): Removed unused.
3966         
3967         * cs-tokenizer.cs (hex_digits): Removed unused.
3968         
3969         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
3970         
3971         * expression.cs (Indirection.LoadExprValue): Removed unused.
3972         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
3973         
3974         * iterators.cs (Iterator.param_types): Removed unused.
3975         
3976         * statement.cs (Goto.block): Removed unused.
3977         (ToplevelBlock.did): Removed unused.
3978         (Switch.ResolveConstantSwitch): Removed unused.
3979
3980 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
3981
3982         * rootcontext.cs: Allow mcs to bootstrap with the compilation
3983         resetting thingy.
3984
3985 2005-04-19  Martin Baulig  <martin@ximian.com>
3986
3987         Merged r42462 from MCS and made it work for GMCS.
3988
3989         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
3990
3991         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
3992
3993 2005-04-01  Raja R Harinath  <rharinath@novell.com>
3994
3995         Fix #74232 and cs0208-3.cs.
3996         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
3997         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
3998         unmanaged type.  Don't use FieldBuilders when 't' is a
3999         TypeBuilder.  Use ModFlags and MemberType fields.
4000         * class.cs (MemberBase.member_type): Rename from MemberType.
4001         (MemberBase.MemberType): New property.  Determines member_type on
4002         demand.
4003         (MemberBase.DoDefine): Don't initialize MemberType here.
4004         (FieldMember.Define): Likewise.
4005
4006 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
4007
4008         Fix #74241
4009         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4010         Attributes are emitted there.
4011         
4012 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4013
4014         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4015         keyword in 'partial enum' too.
4016         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4017         is not allowed).
4018         Report from Kamil Skalski <nazgul@omega.pl>.
4019
4020         Fix #74309.
4021         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4022         have partial containers too.
4023
4024         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4025         in block' checks to Block.CheckInvariantMeaningInBlock.
4026         * statement.cs (Block.GetKnownVariableInfo): Make private.
4027         (Block.IsVariableUsedInChildBlock): Remove.
4028         (Block.IsVariableUsedInBlock): Likewise.
4029         (Block.CheckInvariantMeaningInBlock): New.  Show location of
4030         conflicting declaration.
4031         (Block.AddVariable): Make error messages less long-winded and more
4032         specific.  Show location of conflicting declaration.
4033         * parameter.cs (Parameters.Location): New readonly property.
4034
4035 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4036
4037         Clean up semantics of invoking ResolveMemberAccess.
4038         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4039         can have an instance, ensure that we pass in a non-TypeExpression
4040         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
4041         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4042         argument.  Update to changes and simplify.
4043         (FieldExpr.Emitinstance): Remove CS0120 check.
4044         (PropertyExpr.EmitInstance): Likewise.
4045         * expression.cs (Argument.Resolve): Likewise.
4046         (Invocation.DoResolve): Update to changes in semantics of
4047         InstanceExpression.
4048
4049 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
4050
4051         Fix #74241
4052         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4053         customization.
4054         
4055         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4056
4057 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4058
4059         Fix difference in behaviour with commandline invocation.
4060         * driver.cs (Driver.Reset): New.
4061         (CompilerCallableEntryPoint): Call it.
4062
4063         * statement.cs (If.Resolve): Avoid spurious "uninitialized
4064         variable" warnings if the boolean expression failed to resolve.
4065
4066 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
4067
4068         * attribute.cs: Fix the union of several permissions when some of them
4069         are unrestricted (so the result isn't an unrestricted permission set).
4070         Fix #74036.
4071
4072 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4073
4074         * ecore.cs (MemberExpr): New class.  Convert from interface
4075         IMemberExpr.
4076         (MemberExpr.ResolveMemberAccess): Refactor and move here from
4077         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
4078         error checks.
4079         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4080         (MethodGroupExpr.IsExplicitImpl): Remove.
4081         (Expression.GetFieldFromEvent): Remove.
4082         (SimpleName.MemberStaticCheck): Remove.
4083         (SimpleName.DoSimpleNameResolve): Update to changes.
4084         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4085         (MemberAccess.IdenticalNameAndTypeName): Remove.
4086         (MemberAccess.error176): Move to MemberExpr.
4087         (MemberAccess.DoResolve): Update to changes.
4088         (BaseAccess.DoResolve): Likewise.
4089
4090 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
4091
4092         C# 2.0 Conditional attribute class implementation
4093         
4094         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4095         Analyzes class whether it has attribute which has ConditionalAttribute
4096         and its condition is not defined.
4097         
4098         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4099         (Class.IsExcluded): New method. Search for at least one defined
4100         condition in ConditionalAttribute of attribute class.
4101
4102 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4103
4104         * ecore.cs (PropertyExpr): Derive from Expression, not
4105         ExpressionStatement.
4106         (PropertyExpr.EmitStatement): Remove.
4107
4108 2005-03-29  Raja R Harinath  <rharinath@novell.com>
4109
4110         Fix #74060.
4111         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4112         internal field "value__" of an enum be private.  The examples for
4113         "value__" that I found on MSDN all used FieldAttributes.Private.
4114
4115         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4116         Don't mention IL method attribute names.
4117
4118         Fix #47991.  Remove a TODO.
4119         * statement.cs (Block.Toplevel): Make into a field.
4120         (Block.Parameters): Move into ToplevelBlock.
4121         (Block.known_variables): Rename from child_variable_names.
4122         (Block.Block): Remove variants that take Parameters.  Initialize
4123         'Toplevel' with the immediately surrounding toplevel block.
4124         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
4125         LocalInfo parameter.
4126         (Block.GetKnownVariableInfo): New.
4127         (Block.IsVariableNameUsedInChildBlock): Update.
4128         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
4129         the block, even though it may not be in scope.
4130         (Block.AddVariable): Remove Parameters parameter.  Use
4131         Toplevel.Parameters instead.
4132         (Block.AddConstant): Remove Parameters parameter.
4133         (Block.GetParameterReference): Update to use Toplevel.Parameters.
4134         (Block.IsParamaterReference): Likewise.
4135         (Block.IsLocalParameter): Likewise.  Simplify a lot.
4136         (ToplevelBlock.Parameters): New.  Moved from Block.
4137         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
4138         initialize Parameters to a non-null value.
4139         * cs-parser.jay: Update to changes.
4140         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4141         simple names that mean different things in the same block.  Use
4142         Block.IsVariableNameUsedInBlock.
4143
4144 2005-03-28  Raja R Harinath  <rharinath@novell.com>
4145
4146         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4147
4148 2005-03-26  Raja R Harinath  <harinath@acm.org>
4149
4150         Fix #73038.
4151         * assign.cs (Assign.DoResolve): When the RHS of an assignment
4152         fails to resolve, ensure that the LHS is still resolved as an
4153         lvalue.
4154
4155 2005-03-25  Raja R Harinath  <harinath@acm.org>
4156
4157         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4158         ec.ContainerType.
4159         (Enum.current_ec): Remove.
4160         (Enum.LookupEnumValue): Remove EmitContext argument.
4161         Just uses the one created during DefineType.
4162         (Enum.FindMembers): Update.
4163         * expression.cs (MemberAccess.DoResolve): Update.
4164
4165 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
4166
4167         * assign.cs (Assign.DoResolve): Check for CS1717 when
4168         source and target are same (uses Equals).
4169
4170         * expression.cs (LocalVariableReference, ParameterReference,
4171         This): Implemented Equals, GetHashCode.
4172
4173         * statement.cs (Block.GetParameterReference): Removed useless
4174         local variable.
4175
4176 2005-03-22  Raja R Harinath  <rharinath@novell.com>
4177
4178         Fix cs0128.cs
4179         * statement.cs (Block.AddVariable): Ensure that we skip implicit
4180         blocks before deciding whether the error is cs0136 or cs0128.
4181
4182         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4183         (using_alias_directive, using_namespace_directive): Pass
4184         MemberName, not an expression to Namespace.UsingAlias and
4185         Namespace.Using.
4186         (MakeName): Use the MemberName of the namespace.
4187         * namespace.cs (Namespace.MemberName): New.
4188         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4189         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4190         Likewise.
4191         * decl.cs (MemberName.Name): Make readonly.
4192         (MemberName.FromDotted): New "constructor".
4193         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4194         (MemberCore.Name): Compute from MemberName on demand.
4195         (MemberCore.SetMemberName): Provide a way to change the
4196         MemberName.
4197         (MemberCore.AddToContainer): Don't take a fullname parameter.
4198         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4199         fully qualified name of the container to the member name.
4200         (TypeContainer.AddToTypeContainer): Use a fully qualified name
4201         only if the type is a member of the root container.
4202         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4203         MemberName.Left rather than searching for an embedded ".".
4204         (PartialContainer.CreatePart): Update to changes in RootContext.
4205         (MemberBase.ShortName): Turn into a property.  Use
4206         MemberCore.SetMemberName.
4207         (MemberBase.ExplicitInterfaceName): Remove.
4208         (MemberBase.UpdateMemberName): Remove.
4209         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4210         (PropertyBase.SetMemberName): New override.
4211         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4212         (Tree.GetDecl): New.
4213         (Tree.AllDecls): Rename from Decls.
4214         * attribute.cs, enum.cs, report.cs: Update to changes.
4215         * driver.cs (MainDriver): Use MemberName.FromDotted on
4216         RootContext.MainClass.
4217
4218 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
4219
4220         * class.cs (FixedField.Define): Check for CS1664 and more sanity
4221         checks.
4222
4223         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4224
4225 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
4226
4227         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4228         property accessor modifiers.
4229
4230         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4231         fixed buffer attribute (CS1716).
4232         (PropertyMethod.HasCustomAccessModifier): When property accessor
4233         has custom modifier.
4234
4235         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4236         modifiers.
4237         (PropertyExpr.DoResolveLValue): Add CS0272.
4238
4239 2005-03-17  Miguel de Icaza  <miguel@novell.com>
4240
4241         * convert.cs: When converting to a pointer, use the proper Conv.U
4242         or Conv.I depending on the source data type.
4243
4244         * cs-tokenizer.cs: Make the size for large decimal constants,
4245         fixes #72957.
4246
4247 2005-03-17  Martin Baulig  <martin@ximian.com>
4248
4249         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4250         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
4251
4252 2005-03-17  Martin Baulig  <martin@ximian.com>
4253
4254         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4255         to bool so we can return an error condition.
4256         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4257         returned an error.
4258
4259 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
4260
4261         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4262         attributes.
4263
4264 2005-03-16  Raja R Harinath  <rharinath@novell.com>
4265
4266         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4267         Refactor to avoid traversing the list of assemblies, and to avoid
4268         string concatenation.
4269         * typemanager.cs (guid_attr_type): Remove.
4270         (negative_hits, pointers, references): Remove hashes.
4271         (type_hash): New.
4272         (GetConstructedType): New.  Uses type_hash to handle constructed
4273         types (arrays, references, pointers).
4274         (GetReferenceType, GetPointerType): Use it.
4275         (GetNestedType): New.  Uses type_hash to handle nested types of
4276         reflected types.
4277         (LookupType, LookupTypeDirect): Remove.
4278         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
4279         'types' hash and LookupTypeReflection directly.
4280         (params_string, params_object): Use GetConstructedType.
4281         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
4282         top-level types.
4283         (Namespace.Lookup): Use cached_types.
4284         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4285         provided by old TypeManager.LookupType.
4286         * rootcontext.cs (MakeFQN): Remove.
4287         * decl.cs (DeclSpace.MakeFQN): Likewise.
4288         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4289         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4290         TypeManager.GetConstructedType.
4291         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4292
4293 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
4294
4295         * cs-parser.jay: Fix build.
4296
4297 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
4298
4299         * class.cs (TypeContainer.CircularDepException) New nested
4300         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
4301
4302         * cs-parser.jay: Reports CS1527 for any namespace element.
4303
4304         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4305         Added CS0407.
4306
4307         * expression.cs (ParameterReference.IsAssigned): Changed error to
4308         CS0269.
4309         (Error_WrongNumArguments): Moved CS0245 detection here.
4310
4311         * statement.cs (Return.Resolve): Add CS1622 report.
4312
4313 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
4314
4315         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4316
4317 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
4318
4319         * attribute.cs expression.cs: Get rid of some allocations.
4320
4321 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
4322
4323         * doc.cs : just eliminate the latest change.
4324
4325 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4326
4327         * doc.cs : commented out the latest change. It breaks xml-030.cs
4328
4329 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4330
4331         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4332           fail. So invoke CreateType() in FindDocumentedType().
4333
4334 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4335
4336         * cs-tokenizer.cs : added IsKeyword().
4337         * doc.cs : Detect keyword incorrectly used as identifier.
4338           Allow identifiers prefixed by @.
4339
4340 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
4341
4342         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4343         It caused exception in namespace resolving (again!).
4344         
4345         * class.cs (Class.ctor): Removed exit.
4346         (PropertyMethod.ctor): ditto.
4347         
4348         * codegen.cs (Codegen.Reset): Reset static data.
4349         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4350         
4351         * cs-tokenizer.cs (Cleanup): Removed.
4352         
4353         * driver.cs (GetSystemDir): Rewrote to one line command.
4354         It caused problem with unloaded dynamic modules.
4355         (UnixParseOption): Removed Exit.
4356         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4357         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4358         Now can be mcs used as library.
4359         
4360         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4361         empty location.
4362         
4363         * location.cs (Reset): Reset static data.
4364         
4365         * namespace.cs (Reset): Reset static data.
4366         
4367         * report.cs (Report.Reset): Reset static data.
4368         
4369         * rootcontext.cs (RootContext.Reset): Reset static data.
4370         
4371         * tree.cs (RootTypes.ctor): Use Location.Null
4372         
4373         * typemanager.cs (TypeManager.Reset): Reset static data.
4374         (CoreLookupType): Removed Exit.
4375         (TypeHandle.Reset): Reset static data.
4376         
4377 2005-03-10  Raja R Harinath  <rharinath@novell.com>
4378
4379         Fix #73516.
4380         * typemanager.cs (ComputeNamespaces): Import namespaces from
4381         referenced modules too.
4382
4383 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4384
4385         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4386         than '.'.
4387
4388 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4389
4390         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4391         enclosing DeclSpace.  This ensures that a name-lookup populates
4392         more caches and there are fewer 'TypeExpression's.  Carve out
4393         nested type lookup into ...
4394         (LookupNestedTypeInHierarchy): ... this.
4395
4396 2005-04-15  Martin Baulig  <martin@ximian.com>
4397
4398         Merged r41590 from MCS and make it work in the generics land.
4399
4400         * generic.cs (TypeParameter.UpdateConstraints): Removed the
4401         `check' argument.
4402
4403         * class.cs (PartialContainer.UpdateConstraints): Removed.
4404         (PartialContainer.CheckConstraints): Removed.
4405         (PartialContainer.SetParameterInfo): Store the constraints here.
4406         (PartialContainer.DefineTypeParameters): New public method;
4407         resolve the type parameter's constraints here.  Note that the
4408         PartialContainer doesn't have an EmitContext anymore, so we must
4409         do this in the ClassPart.
4410
4411 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4412
4413         Clean up a few partial-class semantics.  
4414         Fixes test-357.cs and cs1618-2.cs.
4415         * cs-parser.jay (struct_declaration): Use 'current_class' as
4416         parent of newly-created struct.  Remove call to Register ().
4417         Use 'pop_current_class' to complete handing the current struct.
4418         (interface_declaration): Likewise.
4419         (class_declaration): Likewise.
4420         (enum_declaration): Use 'current_class' as parent of newly created
4421         enum.
4422         (delegate_declaration): Likewise.
4423         (pop_current_class): New function.  This is used to handle closing
4424         up the 'current_class' and 'current_container', and pointing them
4425         to the enclosing class/container.
4426         (CSharpParser): Initialize 'current_class' too.
4427         * decl.cs (MemberCore): Add check for invariant: a partial
4428         container is not a parsed entity, and thus does not enclose any
4429         parsed members.
4430         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4431         (DeclSpace.BaseTypeExpr): Use it.
4432         (DeclSpace.LookupType): Add check for invariant.
4433         * class.cs (TypeContainer): Add check for invariant: a nested
4434         class should have the same NamespaceEntry as its enclosing class.
4435         (TypeContainer.EmitFieldInitializers): Make virtual.
4436         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4437         MemberCore.
4438         (TypeContainer.Register): Remove.
4439         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4440         null.  Use TypeResolveEmitContext for resolving base types and
4441         interfaces.  Move initialization of Parts.TypeBuilder here from
4442         ...
4443         (TypeContainer.DefineNestedTypes): ... here.
4444         (PartialContainer): Take a Namespace not a NamespaceEntry.
4445         (PartialContainer.Create): Don't use Register.  Call the
4446         appropriate Add... function directly.
4447         (ClassPart): Take both the PartialContainer and the enclosing
4448         class as constructor arguments.
4449         (ClassPart.EmitFieldInitializers): Override.
4450         (ClassPart.PartFindNestedTypes): Remove.
4451         (FieldBase.GetInitializerExpression): Resolve the initializer
4452         expression in the emit context of the enclosing class.
4453         * tree.cs (RootTypes): Remove Register ().
4454         
4455 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
4456
4457         * cs-parser.jay: Removed CS0134.
4458         
4459         * driver.cs: Removed CS1901.
4460         
4461         * expression.cs (SizeOf.DoResolve): Don't report CS0233
4462         for predefined types.
4463
4464 2005-03-07  Duncan Mak  <duncan@novell.com>
4465
4466         * codegen.cs (Save):  Catch UnauthorizedAccessException as
4467         well. Fixes bug #73454.
4468
4469 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
4470
4471         * cs-tokenizer.cs (xtoken): Add CS1035.
4472         
4473         * class.cs (MethodData.Define): Add CS0683.
4474         (FieldMember.ctor): Add CS0681.
4475
4476 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4477
4478         * ecore.cs (SimpleName.DoResolve): Rename from
4479         SimpleName.DoResolveAllowStatic.
4480         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4481         Pass 'intermediate' flag to MemberStaticCheck.
4482         (SimpleName.MemberStaticCheck): Skip "static check" only in case
4483         of "intermediate" lookups via MemberAccess.
4484         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
4485         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4486
4487 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4488
4489         Fix #73394.
4490         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4491         slipped in because of variable names that are identical to a
4492         builtin type's BCL equivalent ('string String;', 'int Int32;').
4493         (PropertyExpr.EmitInstance): Likewise.
4494
4495 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
4496
4497         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4498         
4499         * report.cs (warning_ignore_table): Made public.
4500
4501 2005-03-04  Raja R Harinath  <rharinath@novell.com>
4502
4503         Fix #73282.
4504         * class.cs (MethodData.Emit): Pass 'container' to
4505         container.GetObsoleteAttribute instead of 'container.Parent'.
4506
4507 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
4508
4509         * cs-parser.jay: Add 1534 error test.
4510
4511         * iterators.cs (Yield.CheckContext): Add error 1629.
4512         (Iterator.ctor): Save unsafe modifier.
4513         (MoveNextMethod.DoEmit): Restore unsafe context.
4514
4515         * namespace.cs (UsingAlias): Better error message.
4516
4517 2005-03-03  Dan Winship  <danw@novell.com>
4518
4519         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
4520         the warning message [#73219]
4521
4522 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4523
4524         Fix compile with MCS 1.0.0.0.
4525         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
4526         w_restore to not depend on string constant folding.
4527
4528 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4529
4530         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
4531         CS0246 check to users who passed 'silent = false'.
4532         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
4533         check.
4534         (SimpleName.SimpleNameResolve): Update.
4535         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
4536         (MemberAccess.IdenticalNameAndTypeName): Update.
4537         * doc.cs (FindDocumentedTypeNonArray): Update.
4538
4539 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
4540
4541         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
4542         * parameters.cs (ComputeAndDefineParameters): Remove.
4543         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
4544         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
4545         Use GetParameterInfo.
4546
4547 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
4548
4549         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
4550
4551 2005-03-02  Raja R Harinath  <rharinath@novell.com>
4552
4553         Unify DeclSpace.LookupType and DeclSpace.FindType.
4554         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
4555         is in charge of defining nested types on demand.
4556         (DeclSpace.LookupType): Use it when the current_type is a
4557         TypeBuilder.  Use LookupTypeDirect for reflected types.
4558         (DeclSpace.FindType): Remove.
4559         (DeclSpace.LookupInterfaceOrClass): Likewise.
4560         (DeclSpace.DefineTypeAndParents): Likewise.
4561         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
4562         DeclSpace.LookupType.
4563         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
4564         * typemanager.cs (LookupType): Simplify.
4565         (AddUserType): Remove type from negative_hits.
4566         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
4567         * class.cs (TypeContainer.FindMembers): Move handling of nested
4568         types ...
4569         (TypeContainer.FindMembers_NestedTypes): ... here.
4570         (TypeContainer.FindNestedType): Implement override.
4571         (ClassPart.FindNestedType): Delegate to PartialContainer.
4572         (ClassPart.PartFindNestedType): Looks up the nested types of the
4573         part alone.
4574
4575 2005-04-14  Martin Baulig  <martin@ximian.com>
4576
4577         * generic.cs (ConstructedType): Moved all the type lookup and
4578         nested class logic into SimpleName.
4579         (ConstructedType.ResolveConstructedType): Our underlying type is
4580         already fully resolved; all the type lookup stuff is in
4581         SimpleName.
4582
4583         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
4584         constructed types here instead of in ConstructedType.
4585
4586         * decl.cs (MemberName.GetTypeExpression): Always create a
4587         SimpleName, not a ConstructedType.
4588         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
4589
4590 2005-03-02  Martin Baulig  <martin@ximian.com>
4591
4592         * class.cs (TypeContainer.DoDefineMembers): We also need a default
4593         static constructor in static classes.
4594
4595 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
4596
4597         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
4598         sizeParamIndex is not specified.
4599
4600 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
4601
4602         Fix #73117
4603         * report.cs (WarningMessage.IsEnabled): Missing null check.
4604
4605 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4606
4607         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
4608         in the fields and not in the properties.
4609
4610 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
4611
4612         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
4613         fields as well.
4614
4615 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4616
4617         * attribute.cs: Small refactoring (improved robustness).
4618         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
4619         (ValidateGuid): Removed.
4620         (Resolve): Removed referenced to above mentioned.
4621         (GetAttributeUsage): Made private and changed to work without
4622         class assistance.
4623         (GetIndexerAttributeValue): Don't crash.
4624         (GetConditionalAttributeValue): Ditto.
4625         (GetClsCompliantAttributeValue): Ditto.
4626         (ExtractSecurityPermissionSet): All attributes exceptions are
4627         error 648.
4628         (GetPropertyValue): New helper.
4629         (GetMethodImplOptions): New method.
4630         (DefinePInvokeMethod): Reuse common code. Implemented handling of
4631         some missing properties.
4632         
4633         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
4634         (Method.ApplyAttributeBuilder): Updated.
4635         
4636         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
4637         exception.
4638
4639 2005-02-28  Raja R Harinath  <rharinath@novell.com>
4640
4641         Fix #73052.
4642         * report.cs (Report.SymbolRelatedToPreviousError): Handle
4643         non-simple types (array, pointer, reference).
4644
4645 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4646
4647         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
4648
4649         * class.cs (MethodCore.IsDuplicateImplementation): Special error
4650         for operators.
4651         (Method.CheckBase): Catch wrong destructor here.
4652         (MethodData.Define): Add errors 550, 668.
4653
4654         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
4655
4656         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
4657
4658         * pending.cs (VerifyPendingMethods): Add error 551.
4659
4660         * typemanager.cs (CSharpName): Next error report helper.
4661
4662 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
4663
4664         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
4665         attributes. Removed useless attribute double check.
4666         It saves almost 2MBs for corlib.
4667
4668 2005-02-25  Raja R Harinath  <rharinath@novell.com>
4669
4670         Fix #72924.
4671         * statement.cs (ExpressionStatement.Resolve): Make robust to being
4672         called twice in case of error.
4673
4674 2005-02-23  Chris Toshok  <toshok@ximian.com>
4675
4676         Fix compiler portions of #72827.
4677         * statement.cs (Block.Emit): call Begin/EndScope on the
4678         EmitContext instead of the ILGenerator.
4679
4680         * codegen.cs (EmitContext.BeginScope): new method, call
4681         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
4682         we have one.)
4683         (EmitContext.BeginScope): same, but EndScope and CloseScope
4684
4685         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
4686         offset and call the superclass's OpenScope(int) with it.
4687         (SymbolWriter.CloseScope): get the current il
4688         offset and call superclass's CloseScope(int) with it.
4689
4690 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
4691
4692         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
4693         CS1677 for out and ref as well.
4694
4695         * class.cs (Method.Define): Add error CS1599 detection.
4696         
4697         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
4698         
4699         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
4700         
4701         * delegate.cs (Delegate.Define): Add error CS1599 detection.
4702         
4703         * support.cs.cs (ModifierDesc): New helper method.
4704
4705 2005-02-23  Raja R Harinath  <rharinath@novell.com>
4706             Abin Thomas  <projectmonokochi@rediffmail.com>
4707             Anoob V E  <projectmonokochi@rediffmail.com>
4708             Harilal P R  <projectmonokochi@rediffmail.com>
4709
4710         Fix #57851, #72718.
4711         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
4712         MemberLookup (used for error reporting) actually returns a result.
4713         Fix error report number (122, not 112).
4714
4715 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
4716             Anoob V E  <projectmonokochi@rediffmail.com>
4717             Harilal P R  <projectmonokochi@rediffmail.com>
4718
4719         Fix #71134.
4720         * pending.cs (PendingImplementation.GetAbstractMethods):
4721         Find NonPublic members too.
4722
4723 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
4724
4725         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
4726         Fixed error 217.
4727         
4728         * class.cs (MethodCore.CheckMethodAgainstBase):
4729         Add error 239 report.
4730
4731 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
4732
4733         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
4734         
4735         * class.cs (Operator.Define): Add error 217 report.
4736         
4737 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4738
4739         Fix #68955.
4740         * expression.cs (Invocation.IsApplicable): Make public.
4741         (Invocation.IsParamsMethodApplicable): Likewise.
4742         * delegate.cs (Delegate.VerifyApplicability): Don't use
4743         Invocation.VerifyArgumentCompat for parameter applicability
4744         testing.  Use Invocation.IsApplicable and
4745         Invocation.IsParamsMethodApplicable.
4746
4747 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
4748
4749         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
4750         
4751         * class.cs (Operator.Define): Add error 217 report.
4752         
4753 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4754
4755         * namespace.cs (UsingEntry.Resolve): Undo change below.
4756
4757 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4758
4759         Fix #72756.
4760         * ecore.cs (Expression.MemberLookupFailed): Add argument to
4761         disable the error message when the extended MemberLookup also
4762         fails.
4763         (Expression.MemberLookupFinal): Update.
4764         (SimpleName.DoSimpleNameResolve): Update.
4765         * expression.cs (MemberAccess.ResolveNamespaceOrType):
4766         Don't use MemberLookupFinal.
4767         (New.DoResolve): Update.
4768         (BaseAccess.CommonResolve): Update.
4769
4770 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4771
4772         Fix #72732.
4773         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
4774         occured previously, don't resolve again.
4775
4776 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
4777
4778         Fix #69949
4779         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
4780         argument. Call ResolveAttributeUsage for unresolved.
4781         when types doesn't match ctor arguments.
4782         
4783         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
4784         for nested attribute classes.
4785         (Class.attribute_usage): Removed.
4786         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
4787         for attribute class.
4788         
4789         * ecore.cs (IsAttribute): Removed.
4790         
4791         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
4792         
4793         * rootcontext.cs (RegisterAttribute): Removed, attributes are
4794         now normal types.
4795         (attribute_types): Removed.
4796         (EmitCode): Global attributes are emited as the latest.
4797
4798 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
4799
4800         * class.cs (EmitFieldInitializers): Don't emit field initializer
4801         for default values when optimilization is on.
4802         
4803         * constant.cs (Constant.IsDefaultValue): New property.
4804         
4805         * driver.cs: Add /optimize handling.
4806         
4807         * constant.cs,
4808         * ecore.cs,
4809         * literal.cs: Implement new IsDefaultValue property.
4810         
4811         * rootcontext.cs (Optimize): New field, holds /optimize option.
4812
4813 2005-02-18  Raja R Harinath  <rharinath@novell.com>
4814
4815         Fix crasher in re-opened #72347.
4816         * namespace.cs (Namespace.Lookup): Return null if
4817         DeclSpace.DefineType returns null.
4818
4819         Fix #72678.
4820         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
4821
4822 2005-02-18  Raja R Harinath  <rharinath@novell.com>
4823
4824         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
4825         now returns null if it cannot resolve to an lvalue.
4826         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
4827         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
4828         returned null.  Remove check for SimpleName.
4829         (EventExpr.DoResolveLValue): New.
4830         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
4831         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
4832         error from ...
4833         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
4834         avoid CS0131 error.
4835         (Unary.ResolveOperator): Move CS0211 check ...
4836         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
4837         CS0131 error.
4838         (Unary.DoResolveLValue): Simplify.
4839         (AddressOf.DoResolveLValue): New.
4840         (ArrayAccess.DoResolveLValue): New.
4841
4842 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
4843
4844         * attribute.cs (Attribute.Resolve): Add arguments casting for
4845         when types doesn't match ctor arguments.
4846
4847 2005-02-16  Raja R Harinath  <rharinath@novell.com>
4848
4849         Fix parts of #63202.
4850         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
4851         lookup of operator in base type.  Ensure that all checks happen
4852         when the operator resolves to an "op_..." method.
4853
4854 2005-02-15  Raja R Harinath  <rharinath@novell.com>
4855
4856         Fix #71992.
4857         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
4858         'ignore_cs0104' parameter.  Pass it to ...
4859         (NamespaceEntry.Lookup): ... this.
4860         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
4861         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
4862         (TypeLookupExpression.DoResolveAsTypeStep): Update.
4863         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
4864         Update.  Request that cs0104 errors be ignored.
4865         (ComposedCast.ResolveAsTypeStep): Update.
4866
4867 2005-02-14  Raja R Harinath  <rharinath@novell.com>
4868
4869         Fix #59209.
4870         * expression.cs (Invocation.BetterFunction): Remove support for
4871         comparing virtual functions and their overrides.
4872         (Invocation.IsOverride): New.
4873         (Invocation.OverloadResolve): Don't consider 'override' functions
4874         during candidate selection.  Store them in a lookaside list.
4875         If the selected method is a 'virtual' function, use the list to
4876         find any overrides that are closer to the LHS type.
4877
4878 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
4879
4880         * expression.cs (New.DoResolve): Add complex core type reduction.
4881         (New.Constantify): Converts complex core type syntax like 'new int ()'
4882         to simple constant.
4883         
4884 2005-02-14  Raja R Harinath  <rharinath@novell.com>
4885
4886         * decl.cs (EntryType.EntryType): New constructor to create an
4887         updated copy of a cache entry.
4888         (MemberCache.AddMethods): Use it.
4889         (MemberCache.ClearDeclaredOnly): Remove.
4890         (MemberCache.MemberCache): Update.
4891
4892 2005-02-11  Miguel de Icaza  <miguel@novell.com>
4893
4894         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
4895         variable.  This one is represents the actual low-level declaration
4896         of the method, as opposed to the semantic level `IsStatic'.   
4897
4898         An anonymous method which is hosted into a static method might be
4899         actually an instance method.  IsStatic would reflect the
4900         container, while MethodIsStatic represents the actual code
4901         generated.
4902
4903         * expression.cs (ParameterReference): Use the new MethodIsStatic
4904         instead of IsStatic.
4905
4906         * anonymous.cs (AnonymousMethod.Compatible): Pass the
4907         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
4908         set on the current EmitContext. 
4909
4910         * expression.cs (Cast): Overload DoResolveLValue so we can pass
4911         resolve our casted expression as an LValue.  This triggers the
4912         proper LValue processing that is later required by Assign.
4913
4914         This fixes 72347.
4915
4916         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
4917
4918 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
4919
4920         C# 2.0 Fixed buffer implementation
4921
4922         * anonymous.cs: Update after RegisterHelperClass renaming.
4923
4924         * attribute.cs (AttributeTester.fixed_buffer_cache):
4925         Cache of external fixed buffers.
4926         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
4927         implementation if field is fixed buffer else null.
4928
4929         * class.cs
4930         (TypeContainer.AddField): Accept FieldMember instead of Field.
4931         (FieldBase.IsFieldClsCompliant): Extracted code from
4932         VerifyClsCompliance descendant customization.
4933         (FixedField): New class handles fixed buffer fields.
4934         (FixedFieldExternal): Keeps information about imported fixed
4935         buffer.
4936         (IFixedField): Make access to internal or external fixed buffer
4937         same.
4938
4939         * cs-parser.jay: Add fixed buffer parsing.
4940
4941         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
4942         buffer.
4943
4944         * expression.cs (Indirection): Extended implementation to accept
4945         fixed buffer field.
4946         (PointerArithmetic.Emit): Get element from fixed buffer as well.
4947         (ElementAccess.MakePointerAccess): Get type as parameter.
4948         (DoResolve): Add fixed buffer field expression conversion.
4949         (DoResolveLValue): Ditto.
4950         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
4951         (ArrayPtr): Derives from FixedBufferPtr.
4952         (ArrayPtr.Emit): Add extra emit for array elements.
4953
4954         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
4955
4956         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
4957         for compiler generated types.
4958         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
4959
4960         * statement.cs (Fixed): Refactored to be easier add fixed buffer
4961         and consume less memory.
4962         (Fixed.Resolve): Add fixed buffer case.
4963
4964         * typemanager.cs (compiler_generated_attr_ctor,
4965         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
4966         (HasElementType): Add our own implementation to work on every
4967         runtime.
4968
4969 2005-02-11  Miguel de Icaza  <miguel@novell.com>
4970
4971         * anonymous.cs (CaptureContext): Track whether `this' has been
4972         referenced.   
4973
4974         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
4975         only captured `this' if it was implicitly done (instance
4976         methods/variables were used). 
4977
4978         * codegen.cs (EmitContext.CaptureThis): New method to flag that
4979         `this' must be captured.
4980
4981 2005-01-30  Miguel de Icaza  <miguel@novell.com>
4982  
4983         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
4984         is null it means that there has been no need to capture anything,
4985         so we just create a sibling.
4986
4987         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
4988
4989         Just a partial fix.  The other half is fairly elusive.
4990         
4991 2005-02-10  Raja R Harinath  <rharinath@novell.com>
4992
4993         Fix #52586, cs0121-4.cs.
4994         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
4995         and return a hashtable.
4996         (MemberCache.ClearDeclaredOnly): New.
4997         (MemberCache.MemberCache): Update to change.  Make a deep copy of
4998         the method_hash of a base type too.
4999         (MemberCache.AddMethods): Adapt to having a deep copy of the base
5000         type methods.  Overwrite entries with the same MethodHandle so
5001         that the ReflectedType is correct.  The process leaves in base
5002         virtual functions and their overrides as distinct entries.
5003         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
5004         matters since it was boxed in a ArrayList before.
5005         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5006         modifier.
5007         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
5008         case of a virtual function and its override (choose the overload
5009         as better).
5010         (Invocation.OverloadResolve): Avoid 'override' members during
5011         'applicable_type' calculation.
5012
5013 2005-03-28  Raja R Harinath  <rharinath@novell.com>
5014
5015         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5016         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5017         GetTypeHandle.  It is possible for a reflected type to derive from
5018         a TypeBuilder (e.g., int[] derives from the TypeBuilder
5019         System.Array during mscorlib compilation).
5020         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5021         contain a method_hash, don't create one either.  Don't create a
5022         deep copy of the base cache's method_hash.
5023         (MemberCache.SetupCache): Rename back from DeepCopy.
5024         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5025         already initialized.  If we see an override function, add its
5026         underlying base virtual function to the member_hash too.
5027
5028 2005-02-09  Raja R Harinath  <rharinath@novell.com>
5029
5030         Combine two near-redundant caches.
5031         * typemanager.cs (method_params): Rename from method_internal_params.
5032         (TypeManager.GetParameterData): New.  Replace
5033         Invocation.GetParameterData.
5034         (TypeManager.LookupParametersByBuilder): Remove.
5035         * expression.cs (Invocation.method_parameter_cache): Remove.
5036         (Invocation.GetParameterData): Remove.
5037         Update to changes.
5038         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5039         Update to changes.
5040
5041 2005-02-08  Raja R Harinath  <rharinath@novell.com>
5042
5043         Fix #72015.
5044         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5045         TypeManager.multicast_delegate_type is null, resolve it by looking
5046         up "System.MulticastDelegate".
5047         * rootcontext.cs (RootContext.ResolveCore): Simplify.
5048
5049 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
5050             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
5051             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
5052
5053         Fix cs0164.cs.
5054         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5055         (LabeledStatement.AddReference): New.  Set 'referenced'.
5056         (Goto.Resolve): Use it.
5057
5058 2005-02-05  John Luke  <john.luke@gmail.com>
5059
5060         * driver.cs: remove duplicate -doc line in Usage ()
5061
5062 2005-02-04  Raja R Harinath  <rharinath@novell.com>
5063
5064         * location.cs (Location.AddFile): Fix CS2002 error report.
5065
5066 2005-02-02  Martin Baulig  <martin@ximian.com>
5067
5068         * delegate.cs (Delegate.DefineType): Report an internal error if
5069         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5070         details.        
5071
5072 2005-02-02  Raja R Harinath  <rharinath@novell.com>
5073
5074         Fix a crasher in a variant of #31984.
5075         * const.cs (Constant.CheckBase): New override that defers the
5076         new-or-override check in case the base type hasn't been populated
5077         yet.
5078         (Constant.Define): Ensure the new-or-override check is performed.
5079
5080 2005-02-01  Duncan Mak  <duncan@ximian.com>
5081
5082         * const.cs (LookupConstantValue): Check that `ce' is not null
5083         before calling GetValue ().
5084
5085 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5086
5087         Fix test-334.cs (#69519).
5088         * cs-parser.jay (using_alias_directive): Pass in an expression to
5089         NamespaceEntry.UsingAlias.
5090         (using_namespace_directive): Pass in an expression to
5091         NamespaceEntry.Using.
5092         (namespace_name): Don't flatten to a string.
5093         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5094         (NamespaceEntry.AliasEntry.Resolve): Lookup using
5095         ResolveAsTypeStep.
5096         (NamespaceEntry.UsingEntry): Likewise.
5097         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5098         changes.
5099         (NamespaceEntry.LookupForUsing): Remove.
5100         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5101         names.
5102         (NamespaceEntry.Lookup): Remove support for dotted names.
5103
5104 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5105
5106         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5107         split into two.
5108         (NamespaceEntry.ImplicitParent): Compute on demand.
5109         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5110         parallels the current.
5111         (NamespaceEntry.LookupForUsing): Use it.
5112         (NamespaceEntry.Lookup): If the current namespace-entry is
5113         implicit, don't search aliases and using tables.
5114
5115 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5116
5117         Fix #31984.
5118         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5119         BaseCache here.
5120         (TypeContainer.BaseCache): Compute on demand.
5121         (TypeContainer.FindMembers): Define constants and types if they're
5122         not already created.
5123         (FieldMember.Define): Move resetting of ec.InUnsafe before error
5124         check.
5125         * const.cs (Constant.Define): Make idempotent.
5126
5127 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5128
5129         * pending.cs: Produce better code (no nops produced by using Ldarg
5130         + value).
5131         
5132         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5133         i - 1' it should be arg + 1.
5134
5135         Fixes bug #71819.
5136
5137 2005-01-28  Raja R Harinath  <rharinath@novell.com>
5138
5139         * attribute.cs (Attribute.CheckAttributeType): Make private
5140         non-virtual.
5141         (Attribute.ResolveType): Make virtual.
5142         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5143         handling of RootContext.Tree.Types.
5144
5145 2005-01-27  Raja R Harinath  <rharinath@novell.com>
5146
5147         Update attribute-handling to use the SimpleName/MemberAccess
5148         mechanisms.
5149         * cs-parser.jay (attribute): Pass in an expression to the
5150         constructors of Attribute and GlobalAttribute.
5151         * attribute.cs (Attribute): Take an expression for the name.
5152         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
5153         passed in attribute name expression.
5154         (Attribute.CheckAttributeType): Use it.
5155         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5156         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5157         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
5158         argument to prevent error messages if the lookup fails.
5159
5160 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
5161
5162         * expression.cs (Indirection): Implemented IVariable interface
5163         to support indirection in AddressOf operator.
5164         (PointerArithmetic.Emit): Add optimalization for case where
5165         result can be precomputed.
5166
5167 2005-01-26  Martin Baulig  <martin@ximian.com>
5168
5169         * class.cs (TypeContainer.AttributeTargets): Return the correct
5170         AttributeTargets depending on our `Kind' instead of throwing an
5171         exception; fixes #71632.
5172
5173 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
5174
5175         Fix #71257
5176         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5177         constant members.
5178
5179 2005-03-17  Martin Baulig  <martin@ximian.com>
5180
5181         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5182         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
5183
5184 2005-03-17  Martin Baulig  <martin@ximian.com>
5185
5186         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5187         to bool so we can return an error condition.
5188         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5189         returned an error.
5190
5191 2005-03-17  Martin Baulig  <martin@ximian.com>
5192
5193         * generic.cs (TypeMananager.IsIEnumerable): New public method.
5194
5195         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
5196         converting from an array-type of T to `IEnumerable<T>'.
5197
5198 2005-03-16  Martin Baulig  <martin@ximian.com>
5199
5200         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
5201         (Nullable.LiftedUnaryMutator): New public class.
5202
5203         * expression.cs (UnaryMutator.DoResolve): Added support for
5204         Nullable Types.
5205
5206 2005-03-14  Martin Baulig  <martin@ximian.com>
5207
5208         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
5209
5210 2005-03-14  Martin Baulig  <martin@ximian.com>
5211
5212         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
5213         the comparision operators `<', `>', `<=' and `>='.
5214
5215 2005-03-13  Martin Baulig  <martin@ximian.com>
5216
5217         * generic.cs
5218         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
5219         avoid confusion with the `NullLiteral'.
5220         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
5221
5222 2005-03-13  Martin Baulig  <martin@ximian.com>
5223
5224         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
5225         comparing arbitrary types with the null literal.
5226
5227 2005-03-13  Martin Baulig  <martin@ximian.com>
5228
5229         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
5230         boolean operators '&&', '||', '&' and '|'.
5231         (Nullable.OperatorTrueOrFalse): New public class.
5232
5233         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
5234         instead of a `StaticCallExpr'; added support for nullables.
5235
5236 2005-03-10  Martin Baulig  <martin@ximian.com>
5237
5238         * expression.cs
5239         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
5240         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
5241
5242 2005-03-07  Martin Baulig  <martin@ximian.com>
5243
5244         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
5245         it work if `expr' is not an IMemoryLocation.
5246         (Nullable.Lifted): Implement IMemoryLocation.
5247         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
5248         target type.
5249
5250 2005-03-05  Martin Baulig  <martin@ximian.com>
5251
5252         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
5253         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
5254         (Nullable): Added support for lifted unary and binary operators.
5255
5256         * expression.cs (Unary.DoResolve): Added support for nullable types.
5257         (Binary.DoResolve): Likewise.
5258         (Conditional.DoResolve): Likewise.
5259
5260 2005-03-02  Martin Baulig  <martin@ximian.com>
5261
5262         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
5263
5264         * class.cs (ClassPart.SetParameterInfo): Override this.
5265         (PartialContainer.SetParameterInfo): Override this.
5266         (TypeContainer.CheckConstraints): New protected method.
5267         (PartialContainer.CheckConstraints): Override this and check
5268         whether the same contraints were specified in all parts of a
5269         partial generic type definition.
5270         (PartialContainer.UpdateConstraints): New public method.
5271
5272         * generic.cs (TypeParameter.UpdateConstraints): New public method.
5273
5274 2005-03-02  Martin Baulig  <martin@ximian.com>
5275
5276         Committing a patch from Carlos Alberto Cortez to fix #72887.
5277
5278         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
5279         casts from `T []' to `int []'.
5280
5281 2005-03-02  Martin Baulig  <martin@ximian.com>
5282
5283         * generic.cs (TypeManager.IsEqual): Make this symmetric.
5284
5285         * expression.cs (Binary.ResolveOperator): When resolving a
5286         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
5287         `=='.  Fixes #71866.  See gen-127.cs.
5288
5289 2005-03-02  Martin Baulig  <martin@ximian.com>
5290
5291         * class.cs (TypeContainer.DoDefineMembers): We also need a default
5292         static constructor in static classes.
5293
5294 2005-03-02  Martin Baulig  <martin@ximian.com>
5295
5296         * generic.cs
5297         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
5298         (Nullable.LiftedConversion): Added support for user-defined
5299         conversions.
5300
5301         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
5302
5303         * cs-parser.jay: Use ComposedCast everywhere instead of
5304         NullableType, so we don't need to check for NullableType
5305         everywhere.
5306         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
5307         case where we'll be resolved into a `parenthesized_expression_0'
5308         afterwards.
5309
5310         * convert.cs
5311         (Convert.UserDefinedConversion): Added nullable conversions.
5312
5313 2005-02-28  Martin Baulig  <martin@ximian.com>
5314
5315         * generic.cs (TypeManager.IsNullableType): New static method.
5316         (Nullable): New abstract class.
5317         (Nullable.NullLiteral): New public class.
5318         (Nullable.LiftedConversion): New public class.
5319
5320         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
5321         `builtin_types opt_nullable'.
5322
5323         * convert.cs
5324         (Convert.ImplicitConversionStandard): Added nullable conversions.
5325         (Convert.ExplicitConversionStandard): Likewise.
5326         (Convert.ExplicitConversion): Likewise.
5327
5328 2005-02-26  Martin Baulig  <martin@ximian.com>
5329
5330         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
5331         begin with a "?", for instance "?[]".  Don't do a type lookup if
5332         `dim' is empty.
5333
5334 2005-02-25  Martin Baulig  <martin@ximian.com>
5335
5336         The first part of Nullable Types :-)
5337
5338         * generic.cs (NullableType): New public class.
5339         (NullCoalescingOperator): New public class.
5340         (TypeArguments.Resolve): Add a CS0306 check.
5341
5342         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
5343         (opt_nullable): New rule.
5344         (type): Added `opt_nullable' to `namespace_or_type_name',
5345         `builtin_types' and `pointer_type'.
5346         (array_type): Added `opt_nullable'.
5347         (opt_rank_specifier_or_nullable): New rule; this is the
5348         combination of `opt_rank_specifier' and `opt_nullable'.
5349         (opt_error): New rule; catch errors here.
5350         (nullable_type_or_conditional): New rule; we use this to check for
5351         nullable and still detect the conditional operator.
5352         (local_variable_type): Use `opt_rank_specifier_or_nullable'
5353         instead `opt_rank_specifier'.
5354
5355         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
5356         for nullables.
5357
5358 2005-02-24  Martin Baulig  <martin@ximian.com>
5359
5360         * README, README.Changes: Removed; they're old and obsolete.
5361
5362 2005-02-22  Martin Baulig  <martin@ximian.com>
5363
5364         * generic.cs (TypeParameter.Resolve): If resolving the constraints
5365         returned an error, set `constraints' to null to avoid a crash
5366         later on.
5367         (TypeParameter.ResolveType): Likewise.
5368
5369 2005-02-22  Martin Baulig  <martin@ximian.com>
5370
5371         * generic.cs
5372         (Constraints.ResolveTypes): Protect against being called twice.
5373         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
5374         (TypeParameter.ResolveType): New public method; calls
5375         constraints.ResolveTypes().
5376         (TypeParameter.DefineType): Moved constraints.ResolveType() out
5377         into the new ResolveType().
5378         (GenericMethod.Define): Call ResolveType() on all our
5379         TypeParameter's.        
5380
5381 2005-02-21  Martin Baulig  <martin@ximian.com>
5382
5383         * generic.cs
5384         (TypeManager.generic_nullable_type): New static public field.
5385         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
5386
5387         * rootcontext.cs
5388         (RootContext.ResolveCore): Resolve "System.Nullable`1".
5389
5390 2005-02-15  Martin Baulig  <martin@ximian.com>
5391
5392         * generic.cs (ConstructedType.Constraints): Correctly check
5393         constraints if the argument type is a type parameter; fixes
5394         #72326. 
5395
5396 2005-02-02  Martin Baulig  <martin@ximian.com>
5397
5398         * delegate.cs (Delegate.DefineType): Report an internal error if
5399         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5400         details.        
5401
5402 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5403
5404         * pending.cs: Produce better code (no nops produced by using Ldarg
5405         + value).
5406         
5407         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5408         i - 1' it should be arg + 1.
5409
5410         Fixes bug #71819.
5411         
5412 2005-01-26  Martin Baulig  <martin@ximian.com>
5413
5414         * cs-parser.jay (indexer_declarator): Don't report an error if we
5415         have type parameters since we can be an explicit interface
5416         implementation; fixes #71449.
5417
5418 2005-01-26  Martin Baulig  <martin@ximian.com>
5419
5420         * class.cs (TypeContainer.AttributeTargets): Return the correct
5421         AttributeTargets depending on our `Kind' instead of throwing an
5422         exception; fixes #71632.
5423
5424 2005-01-26  Martin Baulig  <martin@ximian.com>
5425
5426         * delegate.cs (Delegate.DefineType): Correctly define our type
5427         parameters.  Fixes #71483.
5428
5429 2005-01-25  Raja R Harinath  <rharinath@novell.com>
5430
5431         Fix #71602.
5432         * expression.cs (MemberAccess.DoResolve): Don't complain with
5433         cs0572 when the LHS of a member access has identical name and type
5434         name.
5435
5436 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
5437
5438         Fix #71651, #71675
5439         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5440         CreatePermission.
5441         Create custom PermissionSet only for PermissionSetAttribute.
5442
5443 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
5444
5445         Fix #71649
5446         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5447         delegates in static class.
5448
5449 2005-01-24  Martin Baulig  <martin@ximian.com>
5450
5451         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5452         merging an implicit block, just use its reachability.
5453
5454         * statement.cs (Block.Resolve): Make the unreachable code check
5455         work wrt. implicit blocks; see test-337 from #63842.
5456
5457 2005-01-21  Alp Toker  <alp@atoker.com>
5458  
5459         * cs-parser.jay: destructor_declaration's container is PartialContainer
5460         not Class when partial types are used, so use Kind prop instead of
5461         'is'.
5462         
5463 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
5464
5465         * cs-parser.jay: Improve error reporting when an interface
5466         declares new types.
5467
5468 2005-01-20  Dick Porter  <dick@ximian.com>
5469
5470         * support.cs: SeekableStreamReader fix from Sandor Dobos
5471         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5472         chars are read.  Fixes bug 70369.
5473
5474 2005-01-20  Raja R Harinath  <rharinath@novell.com>
5475
5476         * cs-parser.jay (catch_clause): Simplify current_block handling
5477         somewhat.
5478
5479 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
5480
5481         * convert.cs (ImplicitStandardConversionExists): Synchronize the
5482         code with ImplicitStandardConversion to handle the implicit
5483         conversion of method groups into valid delegate invocations. 
5484
5485         The problem is that in parameter handling we were using this code
5486         path.  Fixes bug #64698
5487
5488 2005-01-19  Raja R Harinath  <rharinath@novell.com>
5489
5490         * cs-parser.jay: Fix several infelicities.
5491         - Avoid assigning to the parser value stack.  Code like 
5492           '$3 = null' is unclean.  Synthesize a value for the code block
5493           instead. 
5494         - Avoid using oob_stack for storing location information.  Use ...
5495         (_mark_): ... this.  New (empty) rule.  Saves the current location
5496         in $$.
5497         (foreach_statement): Avoid using oob_stack for current_block
5498         handling.  Use technique used in for_statement and
5499         using_statement.  Synthesize a value for the code block to store
5500         additional intermediate information.
5501
5502 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
5503
5504         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5505         of a different type is only allowed to private fields of a
5506         containing type, not on fields of a base class.
5507
5508         See test-174.cs and error cs0122-9.cs
5509
5510 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5511
5512         Fix test-335.cs (bug #58126).
5513         * cs-parser.jay (argument): Split out non-expression parts of the
5514         rule into 'non_simple_argument'.
5515         (invocation_expression): Support parenthesized invocations with
5516         multiple arguments, and with single non-simple arguments.
5517
5518 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5519
5520         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5521         places.
5522
5523 2005-01-12  Raja R Harinath  <rharinath@novell.com>
5524
5525         Fix cs0038-1.cs, cs1640-6.cs.
5526         * ecore.cs (Expression.Resolve): Remove special-case for
5527         SimpleName in error-handling.
5528         (Expression.almostMatchedMembers): Relax access permission to
5529         protected.
5530         (Expression.MemberLookupFailed): Handle duplicates in
5531         almostMatchedMembers list.
5532         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5533         * expression.cs (New.DoResolve): Report CS1540 for more cases.
5534         * typemanager.cs (GetFullNameSignature): Use the MethodBase
5535         overload if the passed in MemberInfo is a MethodBase.
5536
5537 2005-01-25  Martin Baulig  <martin@ximian.com>
5538
5539         * doc.cs
5540         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
5541
5542 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
5543
5544         Fix #70749
5545         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5546         for non-CAS & merge permission sets properly.
5547
5548 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5549
5550         Improve standard-compliance of simple name and member access 
5551         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
5552         * ecore.cs (FullNamedExpression): New abstract base class 
5553         for Namespaces and TypeExpressions.
5554         (ResolveFlags.SimpleName): Remove.
5555         (SimpleName): Remove support for dotted names.
5556         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
5557         DeclSpace.FindType and DeclSpace.LookupType.
5558         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5559         (Expression.ExprClassName): Make member function.
5560         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5561         a namespace.  Remove creation of dotted "SimpleName"s.
5562         (MemberAccess.DoResolve): Likewise.
5563         * decl.cs (DeclSpace.Cache): Make private.
5564         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5565         (DeclSpace.FindType): Update.
5566         (DeclSpace.LookupType): Move here from RootContext.  Return a 
5567         FullNamedExpression.
5568         * namespace.cs (Namespace): Derive from FullNamedExpression
5569         so that it can be part of expression resolution.
5570         (Namespace.Lookup): Return an FullNamedExpression.
5571         (NamespaceEntry.LookupAlias): Lookup aliases only in current
5572         namespace.
5573         * rootcontext.cs (NamespaceLookup): Remove.
5574         (LookupType): Move to DeclSpace.
5575         * attribute.cs (CheckAttributeType): Update.
5576         * doc.cs (FindDocumentedType): Remove allowAlias argument.
5577         (FindDocumentedTypeNonArray): Likewise.
5578
5579 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5580
5581         Fix cs0509.cs, cs1632.cs.
5582         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5583         is the same as IsInterface.
5584         (TypeContainer.GetClassBases): Likewise.
5585         * statement.cs (LabeledStatement.ig): New field.
5586         (LabeledStatement.LabelTarget): Save ILGenerator which created the
5587         label.
5588         (LabeledStatement.DoEmit): Check that the label was created with
5589         the same ILGenerator.
5590
5591 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5592
5593         Fix #71058
5594         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
5595         accessors to its properties.
5596
5597         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
5598         from accessors to property.
5599         
5600 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5601
5602         Fix #70722
5603         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
5604         only for overrides.
5605         
5606 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
5607
5608         * attribute.cs: Check for null and empty strings.  
5609
5610         I have lost another battle to Paolo.
5611
5612 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
5613
5614         Fix #70942
5615         * class.cs (PropertyMethod): Set Parent field in ctors.
5616         (SetMethod.InternalParameters): Add unsafe switch hack.
5617         Override MarkForDuplicationCheck where it is appropriate.
5618
5619         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
5620         It says whether container allows members with the same name.
5621         Base default is no.
5622         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
5623         Removed is_method parameter.
5624
5625 2005-01-06  Duncan Mak  <duncan@ximian.com>
5626
5627         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
5628         because the previous change led to incorrect reporting of CS1032
5629         ("Cannot define/undefine preprocessor symbols after first token in
5630         file"). Instead of using `tokens_seen' as the only flag that
5631         triggers CS1040, introduce `comments_seen'. This new flag is used
5632         to signify having seen comments on the current line, so it is
5633         unset after a newline.
5634
5635 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5636
5637         * doc.cs : When searching for a type, find nested type too.
5638           This fixes bug #71040.
5639
5640 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5641
5642         * doc.cs :
5643           - Warn missing member comment on those classes which also does not
5644             have doc comments. Fixed bug #71041.
5645           - Don't warn missing doc comment on default constructor.
5646             Fixed bug #71042.
5647
5648 2005-01-06  Duncan Mak  <duncan@ximian.com>
5649
5650         * cs-tokenizer.cs (xtoken): After handling traditional C-style
5651         comments, set `tokens_seen' to true. This allows us to detect
5652         misplaced preprocessor directives (i.e. not at the beginning of
5653         the a line, nor after whitespaces). In that case, report error
5654         CS1040. This fixes bug #56460.
5655
5656         * cs-parser.jay (interface_member_declaration): Add checks for
5657         IsExplicitImpl, and report CS0541 error if an interface member is
5658         defined as an explicit interface declaration.
5659
5660 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
5661
5662         Fix #70817
5663         * class.cs (PropertyMethod): Set Parent field in ctors.
5664         (SetMethod.InternalParameters): Add unsafe switch hack.
5665         
5666         * decl.cs (MemberCore.Parent): Cannot be readonly.
5667
5668 2005-01-06  Raja R Harinath  <rharinath@novell.com>
5669
5670         * decl.cs (DeclSpace.ResolveType): Remove.
5671         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
5672         Merge in code from ...
5673         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
5674         * class.cs, enum.cs: Update to changes.
5675
5676 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
5677
5678         * anonymous.cs: Ensure that we init the scope of our parent if it
5679         has not been initialized yet.
5680
5681 2004-12-30  Duncan Mak  <duncan@ximian.com>
5682
5683         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
5684         if field.FieldBuilder is null. Fixes #70758.
5685
5686         * convert.cs: Fixed some typos and updated some of the comments.
5687         (ImplicitStandardConversionExists):
5688         (TryImplicitIntConversion): If `target_type' is an interface and
5689         the type of `ic' implements this interface, return true or a new
5690         BoxedCast instead of null. This fixes #70468.
5691
5692 2004-12-29  Duncan Mak  <duncan@ximian.com>
5693
5694         * expression.cs (Argument.Emit): Check that Expr is
5695         IMemoryLocation before casting to it, and report CS1510 otherwise.
5696
5697         This fixes #70402.
5698
5699 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
5700
5701         * statement.cs (Block.ThisVariable): remove the recursion here, to
5702         make the --profile more sane.
5703
5704 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
5705
5706         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
5707         assembly, by JB Evain.
5708
5709 2004-12-17  Raja R Harinath  <rharinath@novell.com>
5710
5711         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
5712           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
5713         "parent" refers to enclosing type/class.  "base" refers to superclass.
5714
5715 2004-12-17  Raja R Harinath  <rharinath@novell.com>
5716
5717         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5718         Ensure that we only have GlobalAttributes.
5719         * attribute.cs (Attribute.Emit): Make non-virtual.
5720         (GlobalAttribute.Emit): Remove.
5721         (Attribute.Resolve): Make virtual.
5722         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
5723         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
5724         the argument. Don't create one.
5725         (Attribute.GetObsoleteAttribute): Likewise.
5726         (Attribute.GetClsCompliantAttributeValue): Likewise.
5727         * class.cs, decl.cs: Update to changes.
5728
5729 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
5730
5731         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
5732         
5733         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
5734         
5735         * statement.cs (Foreach.Resolve): Add error 186 report.
5736
5737 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
5738
5739         * expression.cs (Conditional.DoResolve): Add warning 429.
5740         
5741         * statement.cs (If.Resolve): Add warning 665.
5742
5743 2004-12-16  Raja R Harinath  <rharinath@novell.com>
5744
5745         New invariant: RootContext.Tree.Types.NamespaceEntry == null
5746         except when in the parser, and in GlobalAttribute.
5747         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
5748         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
5749         RootContext.Tree.Types.NamespaceEntry once work is done.
5750         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
5751         and resets RootContext.Tree.Types.NamespaceEntry.
5752
5753 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
5754
5755         * cs-parser.jay: Don't create a block for every variable.
5756
5757 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
5758
5759         * location.cs: Provide extra information.
5760
5761         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
5762         variables from the captured environment, it is the ldarg_0.
5763
5764 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
5765
5766         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
5767         find a conclusion.
5768         
5769         * class.cs: Changed warning level for 169 to avoid developer
5770         displeasure from warning flooding. It will be changed back when they
5771         fix most of current BCL warnings.
5772         
5773         * RootContext.cs: Pushed default WarningLevel to 3.
5774         
5775         * statement.cs: Removed unused variable.
5776
5777 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
5778
5779         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
5780         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
5781         Add error 502 report.
5782         (StaticClass.DefineType): Add error 441 report.
5783         (Class.AllowedModifiersProp): New virtual property as temporary
5784         extension to AllowedModifiers.
5785         (Class.DefineType): Add error 418 report. Moved ModFlags check here
5786         to share implementation with StaticClass and don't call virtual
5787         methods from ctor.
5788         
5789         * driver.cs (MainDriver): Add error 1558 test.
5790
5791         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
5792         report. Moved error 36 test here.
5793
5794         * statement.cs (Throw.Resolve): Add error 724 report.
5795
5796         * typemanager.cs: Add out_attribute_type core type.
5797         
5798 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
5799
5800         * class.cs (TypeContainer.VerifyClsCompliance): Add error
5801         3018 report.
5802         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
5803
5804         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
5805         3017 report.
5806         
5807         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
5808
5809         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
5810         Add error 3023 report.
5811         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
5812
5813         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
5814         implementation.
5815
5816 2004-12-12  John Luke  <john.luke@gmail.com>
5817
5818         * driver.cs (AddArgs): take -- into account when
5819         adding arguments, fixes bug 65710 
5820
5821 2004-12-12  Martin Baulig  <martin@ximian.com>
5822
5823         * expression.cs (Unary.TryReduceNegative): Added support for
5824         SByteConstant and ByteConstant.
5825         (Unary.Reduce): Check error values from TryReduceNegative().
5826
5827 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
5828
5829         * attributes.cs (Attribute.Resolve): Avoid multiple error report
5830         and report exception as error 182.
5831
5832 2004-12-10  Raja R Harinath  <rharinath@novell.com>
5833
5834         * driver.cs (Main): Fix message when there are warnings.
5835
5836 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
5837
5838         * delegate.cs: Fixed my fix from yesterday, sorry about that.
5839
5840 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
5841
5842         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
5843         Reduced number of warnings.
5844         
5845         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
5846
5847 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
5848
5849         * driver.cs: Removed message.
5850
5851         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
5852
5853 2004-12-08    <vargaz@freemail.hu>
5854
5855         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
5856
5857 2004-12-08  Martin Baulig  <martin@ximian.com>
5858
5859         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5860         instead of a CS3002 for properties and indexer.
5861
5862 2004-12-08  Martin Baulig  <martin@ximian.com>
5863
5864         * decl.cs (MemberName.ToString): Make this work again.
5865
5866 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
5867
5868         * attribute.cs (Resolve): Add error 591 detection.
5869
5870         * class.cs (FieldMember.Define): Add error 1547 detection.
5871         (Indexer.Define): Add error 620 detection.
5872         (Operator.Define): Add error 590 detection.
5873
5874         * ecore.cs: Missing argument for error 79.
5875
5876         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
5877         detection.
5878
5879 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
5880
5881         Fix #70106
5882         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
5883         only.
5884
5885 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
5886
5887         * cs-parser.jay : handle doc comments on implicit/explicit operators.
5888           Some operator comments were suppressed.
5889         * doc.cs : Implicit/explicit operator name in doc comments are like
5890           "op_Explicit(type)~returnType", so added suffix handling.
5891
5892 2005-01-21  Alp Toker  <alp@atoker.com>
5893
5894         * cs-parser.jay: destructor_declaration's container is PartialContainer
5895         not Class when partial types are used, so use Kind prop instead of 'is'.
5896
5897 2004-12-12  Martin Baulig  <martin@ximian.com>
5898
5899         * expression.cs (Unary.TryReduceNegative): Added support for
5900         SByteConstant and ByteConstant.
5901         (Unary.Reduce): Check error values from TryReduceNegative().
5902
5903 2004-12-11  Martin Baulig  <martin@ximian.com>
5904
5905         * support.cs (ReflectionParameters.ParameterName): If we have a
5906         `gpd', call `ParameterName' on it.
5907
5908         * parameter.cs (Parameter.GetParameterAttributes): New static method.
5909
5910         * pending.cs (PendingImplementation.DefineProxy): Call
5911         DefineParameter() for all of the MethodBuilder's arguments.
5912
5913 2004-12-09  Martin Baulig  <martin@ximian.com>
5914
5915         * doc.cs (DocUtil): Make this a static class.
5916
5917 2004-12-09  Martin Baulig  <martin@ximian.com>
5918
5919         * expression.cs (Invocation.InferType): Moved the type inference
5920         implementation into TypeManager.
5921
5922         * generics.cs (TypeManager): Moved the type inference
5923         implementation here.
5924
5925 2004-12-09  Martin Baulig  <martin@ximian.com>
5926
5927         * typemanager.cs (TypeManager): Make this a partial class.
5928
5929         * generics.cs
5930         (TypeManager): Move the generics part of `TypeManager' here.
5931
5932 2004-12-08  Martin Baulig  <martin@ximian.com>
5933
5934         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5935         instead of a CS3002 for properties and indexer.  Added CS3024
5936         check for generic interfaces.
5937
5938         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
5939         instances are not CLS-compliant.
5940
5941 2004-12-08  Martin Baulig  <martin@ximian.com>
5942
5943         * cs-parser.jay
5944         (void_pointer_expression): New rule for `void*', `void**' etc.
5945         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
5946
5947 2004-12-08  Martin Baulig  <martin@ximian.com>
5948
5949         * expression.cs (Invocation.InferType): Removed the hack for
5950         MethodCore.MayUnify().  
5951
5952         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
5953         this actually work.
5954
5955         * class.cs (MethodCore.MayUnify): Use
5956         TypeManager.MayBecomeEqualGenericTypes().       
5957
5958 2004-12-08  Martin Baulig  <martin@ximian.com>
5959
5960         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
5961         parameter, box it.  Fixes #69233.
5962
5963 2004-12-08  Martin Baulig  <martin@ximian.com>
5964
5965         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
5966         have the ctor constraint.  Fixes #68326.
5967
5968 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
5969
5970         * cs-parser.jay : interface comment was not consumed because of
5971           extra opt_semicolon before doc handling.
5972
5973 2004-12-03  Raja R Harinath  <rharinath@novell.com>
5974
5975         Fix test-327.cs, test-328.cs, and put in early infrastructure
5976         for eventually fixing #52697.
5977         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
5978         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
5979         from other methods.
5980         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
5981         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
5982         (VerifyUsing, error246): Update.
5983         * rootcontext.cs (RootContext.NamespaceLookup): Just use
5984         'NamespaceEntry.LookupNamespaceOrType'.
5985
5986 2004-12-07  Martin Baulig  <martin@ximian.com>
5987
5988         * driver.cs: Call it "BETA SOFTWARE" :-)
5989
5990 2004-12-06  Raja R Harinath  <rharinath@novell.com>
5991
5992         Fix crash on cs0657-17.cs.
5993         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5994         Use RootContext.Tree.Types, not 'new RootTypes ()'.
5995         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
5996         the case where the NamespaceEntry gets overwritten.
5997
5998 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
5999
6000         Fixed #69195, #56821
6001         * ecore.cs (ResolveBoolean): Tiny refactoring.
6002
6003         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6004         of right expression resolving when left is false constant and
6005         operator is LogicalAnd OR true constant and operator is LogicalOr.
6006
6007         * statement.cs (ResolveUnreachable): Always reports warning.
6008
6009 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
6010
6011         * class.cs: Distinguish between 1721 and 1722 (just a little help
6012         for the programmer).
6013
6014 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
6015
6016         * delegate.cs: Only allow this on new versions of the language. 
6017
6018 2004-12-02  Duncan Mak  <duncan@ximian.com>
6019
6020         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6021         Expression class.
6022         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6023         here as a static method. Take an additional bool out parameter
6024         `must_do_cs1540_check' for signaling to InstanceResolve.
6025         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6026         member field from PropertyExpr class and made it an argument of
6027         the method instead.
6028         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6029         check for MarshalByRefObject, and report CS0122 instead of CS1540.
6030         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6031         and `remove_accessor' as well as InstanceResolve: report CS0122
6032         where applicable.
6033
6034         Fixes #70129.
6035
6036 2004-12-07  Martin Baulig  <martin@ximian.com>
6037
6038         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
6039         and CS0692 where appropriate.
6040
6041 2004-12-06  Martin Baulig  <martin@ximian.com>
6042
6043         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
6044         IsDuplicateImplementation() and improved it.
6045
6046         * expression.cs (Invocation.InferTypeArguments): Added
6047         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
6048         and removed the "ref" modifier from `infered_types'.
6049
6050         * decl.cs (MemberName.ToString): Removed the exception.
6051
6052 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
6053
6054         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6055           comments are allowed.
6056
6057 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6058
6059         * delegate.cs: Add checks for subtypes in paramaters and return values
6060         in VerifyMethod () to add support for Covariance/Contravariance
6061         in delegates.
6062         
6063 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6064
6065         * report.cs: Remove extra closing parenthesis.
6066
6067         * convert.cs (Error_CannotImplicitConversion): If the name of the
6068         types are the same, provide some extra information.
6069
6070 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
6071
6072         Fix bug #70102
6073         * attribute.cs (Resolve): Improved implementation of params
6074         attribute arguments.
6075
6076         * support.cs (ParameterData): Add HasParams to be faster.
6077
6078 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
6079
6080         all things are for /doc support:
6081
6082         * doc.cs: new file that supports XML documentation generation.
6083         * mcs.exe.sources: added doc.cs.
6084         * driver.cs:
6085           Handle /doc command line option.
6086           Report error 2006 instead of 5 for missing file name for /doc.
6087           Generate XML documentation when required, after type resolution.
6088         * cs-tokenizer.cs:
6089           Added support for picking up documentation (/// and /** ... */),
6090           including a new XmlCommentState enumeration.
6091         * cs-parser.jay:
6092           Added lines to fill Documentation element for field, constant,
6093           property, indexer, method, constructor, destructor, operator, event
6094           and class, struct, interface, delegate, enum.
6095           Added lines to warn incorrect comment.
6096         * rootcontext.cs :
6097           Added Documentation field (passed only when /doc was specified).
6098         * decl.cs:
6099           Added DocComment, DocCommentHeader, GenerateDocComment() and
6100           OnGenerateDocComment() and some supporting private members for
6101           /doc feature to MemberCore.
6102         * class.cs:
6103           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6104         * delegate.cs:
6105           Added overriden DocCommentHeader.
6106         * enum.cs:
6107           Added overriden DocCommentHeader and GenerateDocComment().
6108
6109 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
6110
6111         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6112         unwrapping the enumeration values, chain to
6113         DoConstantNumericPromotions again, so we can promote things to the
6114         fundamental types (takes care of enums that are bytes, sbytes).
6115
6116         Fixes bug #62054.
6117
6118 2004-12-01  Raja R Harinath  <rharinath@novell.com>
6119
6120         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6121         Fix long-standing bug in type-lookup.  Use FindType instead of
6122         LookupType when ec.ResolvingTypeTree.
6123         (Attribute.ResolveType, Attribute.Resolve)
6124         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6125         Update to changes.
6126         (Attributes.Search): Remove internal version.  Update.
6127         (Attributes.SearchMulti): Update.
6128         (Attributes.GetClsCompliantAttribute): Remove.
6129         (Attributes.GetIndexerNameAttribute): Remove.
6130         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6131         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6132         * class.cs (Indexer.Define): Likewise.
6133
6134 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
6135
6136         Fix bug #68790
6137         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6138         MarshallByReference members access.
6139
6140         * expression.cs: Use CheckMarshallByRefAccess;
6141         Better error CS0197 message.
6142
6143         * report.cs: Print whole related error message.
6144
6145 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6146
6147         * class (GetClassBases): Better error 60 report.
6148         (EventProperty): Disabled warning 67 detection.
6149
6150 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6151
6152         Fix bug #60324
6153         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6154
6155         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6156         precise values.
6157
6158 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6159
6160         Fix bug #49488
6161         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6162
6163         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6164
6165 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
6166
6167         * attribute.cs (Attribute.Resolve): Refine error reporting and
6168         report a cs0117 if the identifier does not exist, to distinguish
6169         from 0617 which is a miss-use of the actual identifier.
6170
6171         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6172         between cs0070 and cs0079.
6173
6174         * class.cs (MemberBase.DoDefine): When reporting a wrong
6175         accessibility level, we use MethodCore to compare instead of
6176         Method (this was a regression in some refactoring effort).
6177
6178         So now we correctly report cs0056 again.
6179
6180         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6181         testing the target_type (which was known to be object_type) and
6182         not the source type (which is anonymous_method).
6183
6184         Fixed reporting of error cs1660.
6185
6186         * expression.cs (UserCast.Source): Expose the underlying cast.
6187
6188         * statement.cs (Switch.SwitchGoverningType): Sort the list of
6189         allowed types to find a match to int32 first (most common).
6190
6191         In addition, it ignores any ImplicitUserConversions that did an
6192         internal implicit conversion (as the switch statement allows only
6193         one integral conversion to exist).
6194
6195         * class.cs (PartialContainer.Create): rename `name' to
6196         `member_name' for clarity.  Then replace the string calls with a
6197         call to MemberName.GetPartialName, as now using
6198         MemberName.ToString is an error (this is due to the side effects
6199         it had, that were fixed in the past).
6200
6201         This will restore the error reporting on a number of partial class
6202         errors that were missusing this (and getting an exception as a
6203         results, which is now just a plain textual warning, because
6204         yyparse debug output would crash otherwise).
6205
6206 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6207
6208         * Makefile (PROGRAM_INSTALL_DIR): Remove.
6209
6210 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6211
6212         * rootcontext.cs (LookupType): Make sure to cache lookups that
6213         don't give us a negative result. This saves about 5% of corlib
6214         compilation time.
6215
6216 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6217
6218         * report.cs (AbstractMessage.Print): messages are sent to stderr
6219
6220         * class.cs (TypeContainer.GetClassBases): It is an error to have a
6221         non-interface in the list of interfaces (at this point, either
6222         parent was properly set, or a base class is being listed in the
6223         interfaces section).
6224
6225         This flags error 1722, and resolves the crash from bug 69259.
6226
6227 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6228
6229         * statement.cs (Using.EmitExpressionFinally): make this work right
6230         for valuetypes. Fixes 69926.
6231
6232 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6233
6234         * const.cs (Const.ChangeType): Cope with the "0 literal can be
6235         converted to an enum" here, before we try to change the underlying
6236         type.  This code exists, but it is a different code path than the
6237         one used while encoding constants.
6238
6239         (ImplicitReferenceConversionExists): In addition, resynchronized
6240         the code here, so it matches the same code in
6241         ImplicitReferenceConversionExists for the `from any class-type S
6242         to any interface-type T'.       
6243
6244 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
6245
6246         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6247
6248 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
6249
6250         * cs-parser.jay: Use verbosity accordingly. 
6251
6252 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6253
6254         * expression.cs (Unary.ResolveOperator): Do not report warning;
6255         AddressOf reads from variable.
6256         
6257         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6258
6259 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6260
6261         Fix bug #69462
6262
6263         * attribute.cs (Attributable): Removed CheckTargets.
6264         (Attributes.Emit): Explicit attribute targets are tested here.
6265
6266         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6267         not enabled for interfaces.
6268
6269         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6270         (GetAssemblyName): Ouch next bug there.
6271
6272 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6273
6274         * expression.cs: Error 275 added.
6275         
6276 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
6277
6278         Fix bug #69177 (Implemented decimal constant support)
6279
6280         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6281         (BinaryFold): Add DecimalConstant.
6282
6283         * const.cs (Define): Decimal constant 
6284         (is not constant.
6285         (ChangeType): Add decimal type handling.
6286         (LookupConstantValue): Don't set value for decimal type but
6287         emit DecimalConstantAttribute. Needed for constant optimization.
6288
6289         * constant.cs (ToDecimal): New method.
6290         (ConvertToDecimal): New method.
6291         (IntConstant): Implemented ConvertToDecimal.
6292         (DecimalConstant.Emit): Emit optimized version for decimals in
6293         int range.
6294
6295         * expression.cs (ResolveOperator): Changed order of constant
6296         reduction to work correctly with native types which have
6297         overloaded operators.
6298         (ResolveMemberAccess): Extract constant value from attribute
6299         for decimal type.
6300
6301         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6302
6303         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6304         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6305         (ChangeType): Decimal is special.
6306         (TypeToCoreType): Add decimal type.
6307
6308 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6309
6310         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6311         decimal types.
6312
6313 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6314
6315         * class.cs (EventField.ApplyAttributeBuilder): Fix error
6316         test cs1667-5.cs.
6317
6318 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6319
6320         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6321
6322         * pending.cs (PendingImplementation): Grab only interfaces.
6323
6324 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6325
6326         * statement.cs (ForeachHelperMethods): Add location member and
6327         error 202 detection.
6328
6329 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
6330
6331         * expression.cs (DoResolveBase): Fixed wrong warning for out
6332         variables.
6333
6334 2004-12-04  Martin Baulig  <martin@ximian.com>
6335
6336         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
6337         to check whether the conversion is ok.
6338
6339         * typemanager.cs (TypeManager.GetTypeArguments): Just return
6340         `Type.EmptyTypes' if we're not a generic TypeContainer.
6341
6342 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6343
6344         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6345         old bug: when converting from the null literal to a pointer,
6346         return an EmptyCast, not the NullLiteral.
6347
6348         This fixes #69921, the recent null_type changes probably made this
6349         bug more prominent.
6350
6351 2004-12-03  Martin Baulig  <martin@ximian.com>
6352
6353         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6354         method as our child, call AnonymousMethod.Compatible() on it.
6355
6356 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6357
6358         * class.cs (FieldBase): Use an unused bit field from the field to
6359         encode the `has_offset' property from the FieldMember.  This saves
6360         a couple of Ks on bootstrap compilation.
6361
6362         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6363         method as our child, return the AnonymousMethod resolved
6364         expression.
6365
6366         * expression.cs (New.DoResolve): Allow return values from
6367         NewDelegate to also include AnonymousMethods.
6368
6369         Fixes #70150.
6370
6371 2004-11-29  Raja R Harinath  <rharinath@novell.com>
6372
6373         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
6374         cs1648 report.
6375         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
6376         System.Runtime.InteropServices._Exception, since it's a base
6377         interface of the core type System.Exception in the net_2_0 profile.
6378
6379 2004-11-27  Martin Baulig  <martin@ximian.com>
6380
6381         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
6382
6383 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6384
6385         * Makefile: Convert to use executable.make.
6386         * gmcs.exe.sources: New.
6387
6388 2004-11-25  Martin Baulig  <martin@ximian.com>
6389
6390         * expression.cs (Invocation.InferType): Added support for byref types.
6391
6392 2004-11-25  Martin Baulig  <martin@ximian.com>
6393
6394         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
6395         in TypeManager.TypeToCoreType().
6396
6397 2004-11-25  Martin Baulig  <martin@ximian.com>
6398
6399         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
6400         "Dispose" method from the `current_type'.
6401         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
6402         DoDefineMembers() instead of using the MethodBuilder; this is
6403         required for generic iterators.
6404
6405         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
6406
6407 2004-11-24  Martin Baulig  <martin@ximian.com>
6408
6409         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
6410
6411 2004-11-20  Martin Baulig  <martin@ximian.com>
6412
6413         * expression.cs (Invocation.InferType): Correctly infer generic
6414         instances; see gen-103.cs.
6415         (Invocation.InferTypeArguments): If a generic method doesn't have
6416         any unbound type parameters, we don't need to infer anything.
6417
6418 2004-11-19  Raja R Harinath  <rharinath@novell.com>
6419
6420         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
6421
6422 2004-11-17  Raja R Harinath  <rharinath@novell.com>
6423
6424         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6425         (TypeHandle.GetMemberCache): New.
6426         (TypeHandle.TypeHandle): Update.
6427         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6428         (TypeManager.LookupParentInterfacesCache):
6429         Rename from LookupInterfaceCache.  Optimize slightly.
6430         (TypeManager.MemberLookup_FindMembers): Update.
6431         * decl.cs (MemberCache.MemberCache): Set Container to null in the
6432         multi-type variant.
6433         (AddCacheContents): Rename from AddHashtable.
6434         * class.cs (TypeContainer.parent_container): Remove.
6435         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6436         (TypeContainer.DoDefineMembers): Don't initialize it.
6437         Update to name changes.
6438         
6439 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
6440
6441         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6442         that factors the code to check access modifiers on override.  
6443
6444         (PropertyBase): Use the code here.
6445
6446         Patch from Lluis S'anchez, fixes bug #69361.
6447
6448 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
6449
6450         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6451         routine that is used to report the use of a captured variable
6452         whose address has been taken.
6453
6454         There are two checks: one when variables are being captured and
6455         the other check is when the address of a variable is taken. 
6456         
6457         (because an anonymous methods might be resolved before *or* after
6458         the address has been taken) and 
6459
6460         * expression.cs (Conditional.DoResolve): Remove the special
6461         casing that Martin added to trueExpr and falseExpr being both
6462         NullLiteral.  We get the right behavior now just by introducing
6463         the null_type into the compiler. 
6464
6465         * convert.cs (ExplicitConversion): Change the code to use
6466         null_type instead of testing `expr is NullLiteral'.
6467         (ImplicitConversionStandard): use null_type too.
6468         (ImplicitReferenceConversionExists): use null_type too.
6469         (ImplicitReferenceConversion): use null_type too.
6470
6471         * literal.cs: The type of `NullLiteral' is now null_type instead
6472         of object_type. 
6473         (Resolve): Set the type here.
6474
6475         * typemanager.cs: Introduce null_type.
6476
6477 2004-11-18  Martin Baulig  <martin@ximian.com>
6478
6479         * rootcontext.cs
6480         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
6481
6482 2004-11-18  Martin Baulig  <martin@ximian.com>
6483
6484         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
6485
6486 2004-11-18  Martin Baulig  <martin@ximian.com>
6487
6488         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
6489         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
6490         call ResolveConstructedType() on it to resolve it without checking
6491         constraints.
6492         (Constraints.ResolveTypes): Check them here.
6493         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
6494         but don't check constraints.
6495         (ConstructedType.ResolveAsTypeTerminal): Override this and also
6496         check constraints here.
6497         (ConstructedType.ResolveConstructedType): New public method.  This
6498         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
6499         resolve ourselves without checking constraints.
6500
6501         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
6502
6503 2004-11-18  Martin Baulig  <martin@ximian.com>
6504
6505         * decl.cs
6506         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
6507
6508         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
6509
6510 2004-11-18  Martin Baulig  <martin@ximian.com>
6511
6512         * ecore.cs (TypeExpr.ResolveType): Removed.
6513         (Expression.ResolveAsTypeTerminal): We always return a fully
6514         resolved `TypeExpr', so we can just access its `Type'.
6515
6516         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
6517
6518 2004-11-17  Martin Baulig  <martin@ximian.com>
6519
6520         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
6521         sure we don't return any unresolved TypeExpr's.
6522         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
6523         a `TypeExpr'.
6524         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
6525
6526         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
6527         unresolved `ConstructedType's.
6528
6529 2004-11-17  Martin Baulig  <martin@ximian.com>
6530
6531         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
6532
6533 2004-11-17  Martin Baulig  <martin@ximian.com>
6534
6535         * ecore.cs
6536         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
6537
6538         * decl.cs (DeclSpace.ResolveType): Removed.
6539         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
6540
6541 2004-11-17  Martin Baulig  <martin@ximian.com>
6542
6543         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6544         direction, like FindMembers() does.  Fixes #69546, testcase is in
6545         test-315.cs.    
6546
6547 2004-11-16  Martin Baulig  <martin@ximian.com>
6548
6549         This is based on a patch from Marek Safar, see bug #69082.
6550         Fixes bugs #63705 and #67130.
6551
6552         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6553         method; create a MemberCache for an interface type and cache the
6554         result.
6555
6556         * decl.cs (IMemberContainer.ParentContainer): Removed.
6557         (IMemberContainer.ParentCache): New property.
6558         (MemberCache.SetupCacheForInterface): Removed.
6559         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6560         to create a cache for an interface's "parent".
6561
6562         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6563         interfaces too.
6564
6565 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
6566
6567         * statement.cs: Avoid adding bools to a hashtable.
6568
6569 2004-11-15  Martin Baulig  <martin@ximian.com>
6570
6571         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
6572
6573 2004-11-11  Martin Baulig  <martin@ximian.com>
6574
6575         * typemanager.cs (TypeManager.GetMethodName): New method.
6576
6577         * class.cs (MethodData.Define): Include the generic arity in the
6578         name of an explicit interface; also add it to the method name.
6579
6580         * pending.cs (PendingImplementation.InterfaceMethod): The method
6581         name now includes the generic arity.
6582
6583 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
6584
6585         * expression.cs (Invocation.OverloadResolve): Flag error if we are
6586         calling an unsafe method from a safe location.
6587
6588 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
6589
6590         Fix #69167
6591         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6592
6593 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
6594
6595         * namespace.cs (VerifyUsing): use GetPartialName instead of
6596         ToString. 
6597
6598 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
6599
6600         * statement.cs (Return.Resolve): Fix regression in typo: if
6601         `in_exc', we have to request a NeedReturnLabel, this was a typo
6602         introduced in the anonymous method check-in.  Fixes #69131.
6603
6604         * Indexers were using the ShortName when defining themselves,
6605         causing a regression in the compiler bootstrap when applying the
6606         patch from 2004-11-02 (first part), now they use their full name
6607         and the bug is gone.
6608
6609 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
6610
6611         * driver.cs: Strip the path from the names of embedded resources. Fixes
6612         #68519.
6613
6614 2004-11-04  Raja R Harinath  <rharinath@novell.com>
6615
6616         Fix error message regression: cs0104-2.cs.
6617         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6618         (AliasEntry.Resolve): Update.
6619         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
6620         'silent' flag.
6621         (RootContext.LookupType): Update.
6622
6623 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
6624
6625         * cs-parser.jay: Add support for handling accessor modifiers
6626         * class: Add support port accessor modifiers and error checking,
6627         define PropertyMethod.Define as virtual (not abstract anymore)
6628         * ecore.cs: Add checking for proeprties access with access modifiers
6629         * iterators.cs: Modify Accessor constructor call based in the modified
6630         constructor
6631 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
6632
6633         * expression.cs (StringConcat): Handle being called twice,
6634         as when we have a concat in a field init with more than two
6635         ctors in the class
6636
6637 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
6638
6639         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6640         special case explicit implementations, we should always produce
6641         the .property or .event declaration.
6642         
6643         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6644         since it will not return correct data if people use this
6645         unresolved in the presence of using statements (see test-313).
6646
6647         * class.cs (MethodData.Define): If we are an explicit interface
6648         implementation, set the method name to the full name of the
6649         interface plus the name of the method.  
6650
6651         Notice that using the method.MethodName.GetFullName() does not
6652         work, as it will only contain the name as declared on the source
6653         file (it can be a shorthand in the presence of using statements)
6654         and not the fully qualifed type name, for example:
6655
6656         using System;
6657
6658         class D : ICloneable {
6659                 object ICloneable.Clone ()  {
6660                 }
6661         }
6662
6663         Would produce a method called `ICloneable.Clone' instead of
6664         `System.ICloneable.Clone'.
6665
6666         * namespace.cs (Alias.Resolve): Use GetPartialName.
6667         
6668 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6669
6670         * cs-parser.jay: Add error 1055 report.
6671
6672 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
6673
6674         * assign.cs (Assign.DoResolve): Only do the transform of
6675         assignment into a New if the types are compatible, if not, fall
6676         through and let the implicit code deal with the errors and with
6677         the necessary conversions. 
6678
6679 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6680
6681         * cs-parser.jay: Add error 1031 report.
6682
6683         * cs-tokenizer.cs: Add location for error 1038.
6684
6685 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6686
6687         * cs-parser.jay: Add error 1016 report.
6688
6689 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6690
6691         * cs-parser.jay: Add errors 1575,1611 report.
6692
6693 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6694
6695         * cs-parser.jay: Add error 1001 report.
6696
6697 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6698
6699         Fix #68850
6700         * attribute.cs (GetMarshal): Add method argument for
6701         caller identification.
6702
6703         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
6704         agument for GetMarshal and RuntimeMissingSupport.
6705
6706 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6707
6708         * attribute.cs (ExtractSecurityPermissionSet): Removed
6709         TypeManager.code_access_permission_type.
6710
6711         * typemanager.cs: Removed TypeManager.code_access_permission_type.
6712
6713 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
6714
6715         * expression.cs (LocalVariableReference.DoResolveLValue): Check
6716         for obsolete use of a variable here.   Fixes regression on errors
6717         cs0619-25 and cs0619-26.
6718
6719 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
6720
6721         Fix #62358, implemented security attribute encoding.
6722
6723         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
6724         Tests permitted SecurityAction for assembly or other types.
6725         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
6726         data from SecurityPermissionAttribute to PermisionSet class.
6727
6728         * class.cs (ApplyAttributeBuilder): Added special handling
6729         for System.Security.Permissions.SecurityAttribute based types.
6730
6731         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
6732         special handling for System.Security.Permissions.SecurityAttribute
6733         based types.
6734
6735         * enum.cs (ApplyAttributeBuilder): Added special handling
6736         for System.Security.Permissions.SecurityAttribute based types.
6737
6738         * parameter.cs (ApplyAttributeBuilder): Added special handling
6739         for System.Security.Permissions.SecurityAttribute based types.
6740
6741         * rootcontext.cs: Next 2 core types.
6742
6743         * typemanager.cs (TypeManager.security_permission_attr_type):
6744         Built in type for the SecurityPermission Attribute.
6745         (code_access_permission_type): Build in type.
6746
6747 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
6748
6749         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
6750         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
6751         all of this information into
6752         EmitContext.EmitCapturedVariableInstance.
6753         
6754         * codegen.cs (EmitCapturedVariableInstance): move here the
6755         funcionality of emitting an ldarg.0 in the presence of a
6756         remapping.   This centralizes the instance emit code.
6757
6758         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
6759         then emit a load of this: it means that we have reached the
6760         topmost ScopeInfo: the one that contains the pointer to the
6761         instance of the class hosting the anonymous method.
6762
6763         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
6764         captures to the topmost CaptureContext.
6765
6766 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
6767
6768         * expression.cs (LocalVariableReference): Move the knowledge about
6769         the iterators into codegen's EmitCapturedVariableInstance.
6770
6771 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
6772
6773         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
6774         all code paths return a value from an anonymous method (it is the
6775         same as the 161 error, but for anonymous methods).
6776
6777 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
6778
6779         The introduction of anonymous methods in the compiler changed
6780         various ways of doing things in the compiler.  The most
6781         significant one is the hard split between the resolution phase
6782         and the emission phases of the compiler.
6783
6784         For instance, routines that referenced local variables no
6785         longer can safely create temporary variables during the
6786         resolution phase: they must do so from the emission phase,
6787         since the variable might have been "captured", hence access to
6788         it can not be done with the local-variable operations from the runtime.
6789         
6790         * statement.cs 
6791
6792         (Block.Flags): New flag `IsTopLevel' to indicate that this block
6793         is a toplevel block.
6794
6795         (ToplevelBlock): A new kind of Block, these are the blocks that
6796         are created by the parser for all toplevel method bodies.  These
6797         include methods, accessors and anonymous methods.
6798
6799         These contain some extra information not found in regular blocks:
6800         A pointer to an optional CaptureContext (for tracking captured
6801         local variables and parameters).  A pointer to the parent
6802         ToplevelBlock.
6803         
6804         (Return.Resolve): Catch missmatches when returning a value from an
6805         anonymous method (error 1662).
6806         Invoke NeedReturnLabel from the Resolve phase instead of the emit
6807         phase.
6808
6809         (Break.Resolve): ditto.
6810
6811         (SwitchLabel): instead of defining the labels during the
6812         resolution phase, we now turned the public ILLabel and ILLabelCode
6813         labels into methods called GetILLabelCode() and GetILLabel() that
6814         only define the label during the Emit phase.
6815
6816         (GotoCase): Track the SwitchLabel instead of the computed label
6817         (its contained therein).  Emit the code by using
6818         SwitchLabel.GetILLabelCode ().
6819
6820         (LocalInfo.Flags.Captured): A new flag has been introduce to track
6821         whether the Local has been captured or not.
6822
6823         (LocalInfo.IsCaptured): New property, used to tell whether the
6824         local has been captured.
6825         
6826         * anonymous.cs: Vastly updated to contain the anonymous method
6827         support.
6828
6829         The main classes here are: CaptureContext which tracks any
6830         captured information for a toplevel block and ScopeInfo used to
6831         track the activation frames for various local variables.   
6832
6833         Each toplevel block has an optional capture context associated
6834         with it.  When a method contains an anonymous method both the
6835         toplevel method and the anonymous method will create a capture
6836         context.   When variables or parameters are captured, they are
6837         recorded on the CaptureContext that owns them, for example:
6838
6839         void Demo () {
6840              int a;
6841              MyDelegate d = delegate {
6842                  a = 1;
6843              }
6844         }
6845
6846         Here `a' will be recorded as captured on the toplevel
6847         CapturedContext, the inner captured context will not have anything
6848         (it will only have data if local variables or parameters from it
6849         are captured in a nested anonymous method.
6850
6851         The ScopeInfo is used to track the activation frames for local
6852         variables, for example:
6853
6854         for (int i = 0; i < 10; i++)
6855                 for (int j = 0; j < 10; j++){
6856                    MyDelegate d = delegate {
6857                         call (i, j);
6858                    }
6859                 }
6860
6861         At runtime this captures a single captured variable `i', but it
6862         captures 10 different versions of the variable `j'.  The variable
6863         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
6864         recorded on a child.  
6865
6866         The toplevel ScopeInfo will also track information like the `this'
6867         pointer if instance variables were referenced (this is necessary
6868         as the anonymous method lives inside a nested class in the host
6869         type of the method). 
6870
6871         (AnonymousMethod): Expanded to track the Toplevel, implement
6872         `AnonymousMethod.Compatible' to tell whether an anonymous method
6873         can be converted to a target delegate type. 
6874
6875         The routine now also produces the anonymous method content
6876
6877         (AnonymousDelegate): A helper class that derives from
6878         DelegateCreation, this is used to generate the code necessary to
6879         produce the delegate for the anonymous method that was created. 
6880
6881         * assign.cs: API adjustments for new changes in
6882         Convert.ImplicitStandardConversionExists.
6883
6884         * class.cs: Adjustments to cope with the fact that now toplevel
6885         blocks are of type `ToplevelBlock'. 
6886
6887         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
6888         insteda of standard blocks.
6889
6890         Flag errors if params arguments are passed to anonymous methods.
6891
6892         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
6893         `CurrentAnonymousMethod' which points to the current Anonymous
6894         Method.  The variable points to the AnonymousMethod class that
6895         holds the code being compiled.  It is set in the new EmitContext
6896         created for the anonymous method.
6897
6898         (EmitContext.Phase): Introduce a variable and an enumeration to
6899         assist in enforcing some rules about when and where we are allowed
6900         to invoke certain methods (EmitContext.NeedsReturnLabel is the
6901         only one that enfonces this right now).
6902
6903         (EmitContext.HaveCaptureInfo): new helper method that returns
6904         whether we have a CapturedContext initialized.
6905
6906         (EmitContext.CaptureVariable): New method used to register that a
6907         LocalInfo must be flagged for capturing. 
6908
6909         (EmitContext.CapturedParameter): New method used to register that a
6910         parameters must be flagged for capturing. 
6911         
6912         (EmitContext.CapturedField): New method used to register that a
6913         field must be flagged for capturing. 
6914
6915         (EmitContext.HaveCapturedVariables,
6916         EmitContext.HaveCapturedFields): Return whether there are captured
6917         variables or fields. 
6918
6919         (EmitContext.EmitMethodHostInstance): This is used to emit the
6920         instance for the anonymous method.  The instance might be null
6921         (static methods), this (for anonymous methods that capture nothing
6922         and happen to live side-by-side with the current method body) or a
6923         more complicated expression if the method has a CaptureContext.
6924
6925         (EmitContext.EmitTopBlock): Routine that drives the emission of
6926         code: it will first resolve the top block, then emit any metadata
6927         and then emit the code.  The split is done so that we can extract
6928         any anonymous methods and flag any captured variables/parameters.
6929         
6930         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
6931         during this phase, the ILGenerator should not be used as labels
6932         and local variables declared here might not be accessible to any
6933         code that is part of an anonymous method.  
6934
6935         Exceptions to this include the temporary variables that are
6936         created by some statements internally for holding temporary
6937         variables. 
6938         
6939         (EmitContext.EmitMeta): New routine, in charge of emitting all the
6940         metadata for a cb
6941
6942         (EmitContext.TemporaryReturn): This method is typically called
6943         from the Emit phase, and its the only place where we allow the
6944         ReturnLabel to be defined other than the EmitMeta.  The reason is
6945         that otherwise we would have to duplicate a lot of logic in the
6946         Resolve phases of various methods that today is on the Emit
6947         phase. 
6948
6949         (EmitContext.NeedReturnLabel): This no longer creates the label,
6950         as the ILGenerator is not valid during the resolve phase.
6951
6952         (EmitContext.EmitThis): Extended the knowledge in this class to
6953         work in anonymous methods in addition to iterators. 
6954
6955         (EmitContext.EmitCapturedVariableInstance): This emits whatever
6956         code is necessary on the stack to access the instance to a local
6957         variable (the variable will be accessed as a field).
6958
6959         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
6960         EmitContext.EmitAddressOfParameter): Routines to support
6961         parameters (not completed at this point). 
6962         
6963         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
6964         will also remove the parameters.
6965
6966         * convert.cs (Convert): Define a `ConstantEC' which points to a
6967         null.  This is just to prefity some code that uses
6968         ImplicitStandardConversion code and do not have an EmitContext
6969         handy.
6970
6971         The idea is to flag explicitly that at that point in time, it is
6972         known that the conversion will not trigger the delegate checking
6973         code in implicit conversions (which requires a valid
6974         EmitContext). 
6975
6976         Everywhere: pass new EmitContext parameter since
6977         ImplicitStandardConversionExists now requires it to check for
6978         anonymous method conversions. 
6979
6980         (Convert.ImplicitStandardConversionExists): If the type of an
6981         expression is the anonymous_method_type, and the type is a
6982         delegate, we invoke the AnonymousMethod.Compatible method to check
6983         whether an implicit conversion is possible. 
6984
6985         (Convert.ImplicitConversionStandard): Only do implicit method
6986         group conversions if the language level is not ISO_1.
6987
6988         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
6989         MethodInfo for the Invoke method.  used by Delegate and
6990         AnonymousDelegate.
6991
6992         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
6993         method conversions if the target type is a delegate.
6994
6995         Removed extra debugging nops.
6996
6997         (LocalVariableReference): Turn the `local_info' into a public
6998         field. 
6999
7000         Add `prepared' field, the same hack used for FieldExprs to cope
7001         with composed assignments, as Local variables do not necessarily
7002         operate purely on the stack as they used to: they can be captured
7003         fields. 
7004
7005         Add `temp' for a temporary result, like fields.
7006
7007         Refactor DoResolve and DoResolveLValue into DoResolveBase.
7008
7009         It now copes with Local variables that are captured and emits the
7010         proper instance variable to load it from a field in the captured
7011         case. 
7012
7013         (ParameterReference.DoResolveBase): During the resolve phase,
7014         capture parameters if we are in an anonymous method.
7015
7016         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7017         anonymous method, use the EmitContext helper routines to emit the
7018         parameter reference.
7019
7020         * iterators.cs: Set RemapToProxy to true/false during the
7021         EmitDispose class.
7022
7023         * parameters.cs (GetParameterByName): New helper method. 
7024
7025         * typemanager.cs (anonymous_method_type) a new type that
7026         represents an anonyous method.  This is always an internal type,
7027         used as a fencepost to test against the anonymous-methodness of an
7028         expression. 
7029         
7030 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
7031
7032         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7033         561 report.
7034         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7035
7036 2004-11-10  Martin Baulig  <martin@ximian.com>
7037
7038         * expression.cs (Invocation.BetterFunction): If two methods have
7039         equal parameter types, but only one of them is generic, the
7040         non-generic one wins.
7041         (New.DoResolve): Don't set `is_struct' to false if we're a generic
7042         instance; just use `Type.IsValueType' to determine whether
7043         something is a struct or not.
7044         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
7045         so we can be called multiple times.
7046
7047 2004-11-10  Martin Baulig  <martin@ximian.com>
7048
7049         * generic.cs (TypeParameter.DefineConstraints): New public method.
7050         (TypeParameter.CheckAccessLevel): Override this and return true.
7051         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
7052         override ResolveType() anymore.
7053         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
7054
7055 2004-11-10  Martin Baulig  <martin@ximian.com>
7056
7057         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
7058         call DeclSpace.ResolveNestedType() on it.
7059
7060 2004-11-10  Martin Baulig  <martin@ximian.com>
7061
7062         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
7063         non-null, call ParameterModifier() on it.
7064
7065 2004-11-10  Martin Baulig  <martin@ximian.com>
7066
7067         * iterators.cs
7068         (Iterators): Added `current_type' and `this_type' fields.
7069         (Iterators.DefineIterator): Create a new EmitContext and store it
7070         in `ec'; compute `this_type'.
7071
7072 2004-11-10  Martin Baulig  <martin@ximian.com>
7073
7074         * typemanager.cs
7075         (TypeManager.IsPrivateAccessible): New public method.
7076         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
7077
7078 2004-11-10  Martin Baulig  <martin@ximian.com>
7079
7080         * class.cs (TypeContainer.DefineType): Call
7081         TypeBuilder.DefineGenericParameters() before resolving the type
7082         parameters.
7083         (MethodData.parent_method): New protected field.
7084         (MethodData..ctor): Added `MethodInfo parent_method' argument.
7085         (MethodData.Define): Compute `parent_method'.
7086
7087         * decl.cs
7088         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7089         (MemberCore.GetClsCompliantAttributeValue): Likewise.
7090         (DeclSpace.ec): New protected field; store the EmitContext here.
7091         (DeclSpace.EmitContext): New public property.
7092         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
7093         (DeclSpace.ResolveNestedType): New public method.
7094         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
7095         (DeclSpace.NestedAccessible): Added `Type tb' argument.
7096         (DeclSpace.FamilyAccessible): Likewise.
7097         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
7098         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7099         EmitContext.
7100
7101         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
7102         field.
7103
7104         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7105         (Enum.Emit): Don't create a new EmitContext.
7106
7107 2004-10-18  Martin Baulig  <martin@ximian.com>
7108
7109         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7110         `Type' directly, but call ResolveType() on it.
7111         (Catch.Resolve): Likewise.
7112         (Foreach.Resolve): Likewise.
7113
7114 2004-10-18  Martin Baulig  <martin@ximian.com>
7115
7116         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7117         `Type' directly, but call ResolveType() on it.
7118         (Probe.DoResolve): Likewise.
7119         (ArrayCreation.LookupType): Likewise.
7120         (TypeOf.DoResolve): Likewise.
7121         (SizeOf.DoResolve): Likewise.
7122
7123 2004-10-18  Raja R Harinath  <rharinath@novell.com>
7124
7125         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7126         the ResolveType.
7127
7128 2004-10-17  John Luke  <john.luke@gmail.com>
7129
7130         * class.cs (Operator.GetSignatureForError): use CSharpName
7131
7132         * parameter.cs (Parameter.GetSignatureForError): Returns
7133         correct name even if was not defined.
7134
7135 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7136
7137         Fix #65816.
7138         * class.cs (TypeContainer.EmitContext): New property.
7139         (DefineNestedTypes): Create an emitcontext for each part.
7140         (MethodCore.DoDefineParameters): Use container's emitcontext.
7141         Pass type array to InternalParameters.
7142         (MemberBase.DoDefine): Use container's emitcontext.
7143         (FieldMember.Define): Likewise.
7144         (Event.Define): Likewise.
7145         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7146         Pass type array to InternalParameters.
7147         (SetIndexerMethod.GetParameterInfo): Likewise.
7148         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7149         * delegate.cs (Define): Pass emitcontext to
7150         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7151         array to InternalParameters.
7152         * expression.cs (ParameterReference.DoResolveBase): Pass
7153         emitcontext to GetParameterInfo.
7154         (ComposedCast.DoResolveAsTypeStep): Remove check on
7155         ec.ResolvingTypeTree.
7156         * parameter.cs (Parameter.Resolve): Change argument to
7157         EmitContext.  Use ResolveAsTypeTerminal.
7158         (Parameter.GetSignature): Change argument to EmitContext.
7159         (Parameters.ComputeSignature): Likewise.
7160         (Parameters.ComputeParameterTypes): Likewise.
7161         (Parameters.GetParameterInfo): Likewise.
7162         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7163         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7164         * support.cs (InternalParameters..ctor): Remove variant that takes
7165         a DeclSpace.
7166         * typemanager.cs (system_intptr_expr): New.
7167         (InitExpressionTypes): Initialize it.
7168
7169 2004-10-12  Chris Toshok  <toshok@ximian.com>
7170
7171         * cs-parser.jay: fix location for try_statement and catch_clause.
7172
7173 2004-10-18  Martin Baulig  <martin@ximian.com>
7174
7175         * class.cs (FieldMember.Define): Don't access the TypeExpr's
7176         `Type' directly, but call ResolveType() on it.
7177         (MemberBase.DoDefine): Likewise.
7178
7179         * expression.cs (New.DoResolve): Don't access the TypeExpr's
7180         `Type' directly, but call ResolveType() on it.
7181         (ComposedCast.DoResolveAsTypeStep): Likewise.
7182
7183         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7184         `Type' directly, but call ResolveType() on it.
7185
7186 2004-10-17  John Luke  <john.luke@gmail.com>
7187
7188         * class.cs (Operator.GetSignatureForError): use CSharpName
7189
7190         * parameter.cs (Parameter.GetSignatureForError): Returns
7191         correct name even if was not defined.
7192
7193 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7194
7195         Fix #65816.
7196         * class.cs (TypeContainer.EmitContext): New property.
7197         (DefineNestedTypes): Create an emitcontext for each part.
7198         (MethodCore.DoDefineParameters): Use container's emitcontext.
7199         Pass type array to InternalParameters.
7200         (MemberBase.DoDefine): Use container's emitcontext.
7201         (FieldMember.Define): Likewise.
7202         (Event.Define): Likewise.
7203         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7204         Pass type array to InternalParameters.
7205         (SetIndexerMethod.GetParameterInfo): Likewise.
7206         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7207         * delegate.cs (Define): Pass emitcontext to
7208         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7209         array to InternalParameters.
7210         * expression.cs (ParameterReference.DoResolveBase): Pass
7211         emitcontext to GetParameterInfo.
7212         (ComposedCast.DoResolveAsTypeStep): Remove check on
7213         ec.ResolvingTypeTree.
7214         * parameter.cs (Parameter.Resolve): Change argument to
7215         EmitContext.  Use ResolveAsTypeTerminal.
7216         (Parameter.GetSignature): Change argument to EmitContext.
7217         (Parameters.ComputeSignature): Likewise.
7218         (Parameters.ComputeParameterTypes): Likewise.
7219         (Parameters.GetParameterInfo): Likewise.
7220         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7221         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7222         * support.cs (InternalParameters..ctor): Remove variant that takes
7223         a DeclSpace.
7224         * typemanager.cs (system_intptr_expr): New.
7225         (InitExpressionTypes): Initialize it.
7226
7227 2004-10-12  Chris Toshok  <toshok@ximian.com>
7228
7229         * cs-parser.jay: fix location for try_statement and catch_clause.
7230
7231 2004-10-07  Raja R Harinath  <rharinath@novell.com>
7232
7233         More DeclSpace.ResolveType avoidance.
7234         * decl.cs (MemberCore.InUnsafe): New property.
7235         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
7236         with newly created EmitContext.
7237         (FieldMember.Define): Likewise.
7238         * delegate.cs (Delegate.Define): Likewise.
7239         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7240         only if normal name-lookup fails.
7241         (TypeExpr.DoResolve): Enable error-checking.
7242         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7243         (SizeOf.DoResolve): Likewise.
7244         (ComposedCast.DoResolveAsTypeStep): Likewise.
7245         (StackAlloc.DoResolve): Likewise.
7246         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7247         (Block.Unsafe): New property.
7248         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7249         (Unsafe): Set 'unsafe' flag of contained block.
7250         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7251         (Fixed.Resolve): Likewise.
7252         (Catch.Resolve): Likewise.
7253         (Using.ResolveLocalVariableDecls): Likewise.
7254         (Foreach.Resolve): Likewise.
7255
7256 2004-10-05  John Luke <john.luke@gmail.com>
7257
7258         * cs-parser.jay: add location to error CS0175
7259
7260 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
7261
7262         * ecore.cs (Expression.Constantity): Add support for turning null
7263         into a constant.
7264
7265         * const.cs (Const.Define): Allow constants to be reference types
7266         as long as the value is Null.
7267
7268 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
7269
7270         * namespace.cs (NamespaceEntry.Using): No matter which warning
7271         level is set, check if this namespace name has already been added.
7272
7273 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
7274
7275         * expression.cs: reftype [!=]= null should always use br[true,false].
7276         # 67410
7277
7278 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
7279
7280         Fix #67108
7281         * attribute.cs: Enum conversion moved to 
7282         GetAttributeArgumentExpression to be applied to the all
7283         expressions.
7284
7285 2004-10-01  Raja R Harinath  <rharinath@novell.com>
7286
7287         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7288         * class.c (TypeContainer.DefineType): Flag error if
7289         base types aren't accessible due to access permissions.
7290         * decl.cs (DeclSpace.ResolveType): Move logic to
7291         Expression.ResolveAsTypeTerminal.
7292         (DeclSpace.ResolveTypeExpr): Thin layer over
7293         Expression.ResolveAsTypeTerminal.
7294         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7295         Refactor code into NestedAccess.  Use it.
7296         (DeclSpace.NestedAccess): New.
7297         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7298         argument to silence errors.  Check access permissions.
7299         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7300         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7301         (Cast.DoResolve): Likewise.
7302         (New.DoResolve): Likewise.
7303         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7304         (TypeOf.DoResolve): Likewise.
7305
7306         * expression.cs (Invocation.BetterConversion): Return the Type of
7307         the better conversion.  Implement section 14.4.2.3 more faithfully.
7308         (Invocation.BetterFunction): Make boolean.  Make correspondence to
7309         section 14.4.2.2 explicit.
7310         (Invocation.OverloadResolve): Update.
7311         (Invocation): Remove is_base field.
7312         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
7313         (Invocation.Emit): Likewise.
7314
7315 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
7316
7317         * cs-parser.jay: Reverted 642 warning fix.
7318
7319 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7320
7321         Fix bug #66615
7322         * decl.cs (FindMemberWithSameName): Indexer can have more than
7323         1 argument.
7324
7325 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7326
7327         * expression.cs (LocalVariableReference.DoResolveLValue):
7328         Do not report warning 219 for out values.
7329         (EmptyExpression.Null): New member to avoid extra allocations.
7330
7331 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7332
7333         * cs-parser.jay: Fix wrong warning 642 report.
7334
7335         * cs-tokenizer.cs (CheckNextToken): New helper;
7336         Inspect next character if is same as expected.
7337
7338 2004-09-23  Martin Baulig  <martin@ximian.com>
7339
7340         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7341         (Convert.ImplicitReferenceConversionExists): Likewise.
7342
7343 2004-11-09  Raja R Harinath  <rharinath@novell.com>
7344
7345         * Makefile (DISTFILES): Comment out a few missing files.
7346
7347 2004-10-29  Raja R Harinath  <rharinath@novell.com>
7348
7349         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
7350         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
7351         (gmcs.exe): Invoke bootstrap-libs.
7352         (clean-local): Clean the net_2_0_bootstrap profile too.
7353         (PROGRAM_INSTALL_DIR): New.
7354         (install-local): Use it.
7355
7356 2004-10-13  Martin Baulig  <martin@ximian.com>
7357
7358         * generic.cs (TypeManager.InflatedConstraints): New nested class.
7359         (TypeParameter.DefineType): If we're a method type parameter and
7360         that method is overriding something, "inflate" its constraints.
7361
7362 2004-10-12  Martin Baulig  <martin@ximian.com>
7363
7364         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
7365         and have type arguments, create and resolve a ConstructedType.
7366
7367 2004-10-12  Martin Baulig  <martin@ximian.com>
7368
7369         * decl.cs (MemberCache.FindMemberToOverride): Use
7370         TypeManager.IsEqual() to compare the parameters and Type.Equals()
7371         to compare the invocationType.
7372
7373         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
7374         When comparing two type parameters, only do the signature-only
7375         comparision for method type parameters.
7376
7377 2004-10-11  Martin Baulig  <martin@ximian.com>
7378
7379         * report.cs: Don't make --fatal abort on warnings, we have
7380         -warnaserror for that.
7381
7382 2004-10-11  Martin Baulig  <martin@ximian.com>
7383
7384         * typemanager.cs
7385         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
7386         (TypeManager.IsEqual): Call ourself recursively instead of using
7387         Type.IsEqual(). 
7388
7389 2004-10-11  Martin Baulig  <martin@ximian.com>
7390
7391         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
7392         on our own type parameters, not on the ones we inherit from a containing
7393         class.
7394
7395         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
7396         the comparision.
7397
7398         * generic.cs (TypeParameter.Define): We may only be called once.
7399
7400         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
7401         instead of TypeManager.IsEqual().
7402
7403 2004-09-28  Martin Baulig  <martin@ximian.com>
7404
7405         * generic.cs
7406         (GenericConstraints.EffectiveBaseClass): New public property.
7407         (TypeParameter.GenericConstraints): New public property.
7408         (ConstructedType.CheckConstraints): Improved.
7409
7410         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
7411         (Convert.TypeParameterConversion): New private method; use this in
7412         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
7413         for all conversions related to type parameters.
7414
7415 2004-09-24  Martin Baulig  <martin@ximian.com>
7416
7417         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
7418         type parameter conversions for type parameters which are known to
7419         be reference types.
7420
7421 2004-09-24  Martin Baulig  <martin@ximian.com>
7422
7423         * generic.cs (GenericConstraints): Added `IsReferenceType' and
7424         `IsValueType' properties.
7425
7426         * support.cs (ReflectionConstraints): Use
7427         Type.GetGenericParameterConstraints() instead of the old hack.
7428
7429 2004-09-24  Martin Baulig  <martin@ximian.com>
7430
7431         * generic.cs (GenericConstraints): Moved here and made it an
7432         abstract class.
7433
7434         * support.cs (GenericConstraints): Moved to generic.cs.
7435
7436 2004-09-24  Martin Baulig  <martin@ximian.com>
7437
7438         * support.cs
7439         (ReflectionConstraints): Un-nested this class and made it public.
7440
7441         * typemanager.cs
7442         (TypeManager.GetTypeParameterConstraints): New public method.
7443         (TypeManager.HasConstructorConstraint): Use the attributes.
7444
7445 2004-09-24  Martin Baulig  <martin@ximian.com>
7446
7447         * support.cs (GenericConstraints): Replaced `HasConstructor',
7448         `IsReferenceType' and `IsValueType' with `Attributes'.
7449         (ReflectionParameters.ReflectionConstraints): Removed the Create()
7450         method and made the .ctor public.
7451
7452         * generic.cs (Constraints.Attributes): New public property.
7453         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
7454         `IsReferenceType' -> `HasReferenceTypeConstraint' and
7455         `IsValueType' -> `HasValueTypeConstraint'.
7456
7457 2004-09-23  Martin Baulig  <martin@ximian.com>
7458
7459         * generic.cs (Constraints): Reflect latest runtime changes.
7460
7461 2004-09-23  Martin Baulig  <martin@ximian.com>
7462
7463         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7464         (Convert.ImplicitReferenceConversionExists): Likewise.
7465
7466 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7467
7468         * class.cs (Operator.Define): Add error 448 and 559 report.
7469         
7470 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7471
7472         * class.cs (MemberBase.IsTypePermitted): New protected
7473         method for checking error CS0610.
7474
7475 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7476
7477         * class.cs (TypeContainer.HasExplicitLayout): New property
7478         Returns whether container has StructLayout attribute set Explicit.
7479         (FieldMember): New abstract class for consts and fields.
7480         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7481         (Field): Reuse FieldMember.
7482
7483         * const.cs (Const): Reuse FieldMember.
7484
7485         * rootcontext.cs: EmitConstants call moved to class.
7486
7487 2004-09-22  Martin Baulig  <martin@ximian.com>
7488
7489         Marek and me just fixed one of our oldest bugs: #28562 :-)
7490
7491         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7492
7493         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7494         we're an EnumConstant, just return that.
7495         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7496         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
7497         to get the value which'll actually be written into the attribute.
7498         However, we have to use GetValue() to access the attribute's value
7499         in the compiler.        
7500
7501 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7502
7503         * constant.cs (Constant.IsNegative): New abstract property
7504         IsNegative.
7505
7506         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7507         (StackAlloc.DoResolve): Reused IsNegative.
7508
7509 2004-09-22  Martin Baulig  <martin@ximian.com>
7510
7511         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
7512         public method; like LookupTypeContainer, but also works for
7513         generic instances.
7514
7515         * report.cs (Report.SymbolRelatedToPreviousError): Use
7516         TypeManager.LookupGenericTypeContainer().       
7517
7518 2004-09-22  Martin Baulig  <martin@ximian.com>
7519
7520         Thanks to Peter Sestoft for this bug report.
7521
7522         * expression.cs (Conditional): If both the `trueExpr' and the
7523         `falseExpr' is a NullLiteral, return a NullLiteral.
7524
7525 2004-09-22  Martin Baulig  <martin@ximian.com>
7526
7527         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7528         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7529         for the "get_Current" call.
7530
7531 2004-09-21  Martin Baulig  <martin@ximian.com>
7532
7533         * convert.cs (Convert.ImplicitReferenceConversion): When
7534         converting to an interface type, first check whether we're
7535         converting from a reference type.
7536
7537 2004-09-14  Martin Baulig  <martin@ximian.com>
7538
7539         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7540
7541 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7542
7543         Fixed bug #61902
7544         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7545         called and is obsolete then this member suppress message
7546         when call is inside next [Obsolete] method or type.
7547
7548         * expression.cs: Use TestObsoleteMethodUsage member.
7549
7550 2004-09-14  Martin Baulig  <martin@ximian.com>
7551
7552         * genericparser.cs: Removed.
7553
7554 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
7555
7556         * class.cs (MethodCore.CheckBase): Fix bug #65757.
7557
7558 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
7559
7560         * attribute.cs (Attribute.Resolve): Add error 653 report.
7561
7562         * class.cs (Class.ApplyAttributeBuilder): Add error 641
7563         report.
7564         (Method.ApplyAttributeBuilder): Add error 685 report.
7565         (Operator.Define): Add error 564 report.
7566
7567         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7568
7569         * expression.cs (Invocation.DoResolve): Add error
7570         245 and 250 report.
7571
7572         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7573         error 674 report.
7574
7575 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7576
7577         * class.cs (ConstructorInitializer.Resolve):
7578         Wrong error number (515->516).
7579
7580 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7581
7582         * class.cs (Indexer.Define): Add error 631 report.
7583
7584 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7585
7586         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7587
7588 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7589
7590         * expression.cs (Probe.DoResolve): Add error CS0241 report.
7591
7592 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
7593
7594         * cs-parser.jay: Added error CS0241 report.
7595
7596 2004-09-10  Raja R Harinath  <rharinath@novell.com>
7597
7598         * cs-parser.jay (fixed_statement): Introduce a scope for the
7599         declaration in the 'fixed' statement.
7600
7601 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7602
7603         * cs-parser.jay: Added CS0230 error report.
7604
7605 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7606
7607         * cs-parser.jay: Added errors CS0231 and CS0257 report.
7608
7609 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7610
7611         * expression.cs (Argument.Resolve): Added error CS0192 and
7612         CS0199 report.
7613
7614 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7615
7616         C# 2.0 #pragma warning feature
7617
7618         * cs-tokenizer.cs (PreProcessPragma): New method; 
7619         Handles #pragma directive.
7620
7621         * report.cs (WarningRegions): New class; Support
7622         class for #pragma warning directive. It tests whether
7623         warning is enabled for a given line.
7624
7625 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
7626
7627         * const.cs: Add more descriptive error report, tahnks to
7628         Sebastien. 
7629
7630 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
7631
7632         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7633
7634 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
7635
7636         * expression.cs: Apply patch from Ben: Remove dead code from
7637         ArrayCreation, and remove the TurnintoConstant call in const.cs,
7638         as that code just threw an exception anwyays.
7639
7640         * const.cs: Remove the call to the turnintoconstant, for details
7641         see bug: #63144
7642         
7643         * literal.cs: The type of the null-literal is the null type;  So
7644         we use a placeholder type (literal.cs:System.Null, defined here)
7645         for it.
7646
7647         * expression.cs (Conditional.DoResolve): Remove some old code that
7648         is no longer needed, conversions have been fixed.
7649
7650         (ArrayCreationExpression.DoResolve): Return false if we fail to
7651         resolve the inner expression.
7652
7653 2004-09-07  Raja R Harinath  <rharinath@novell.com>
7654
7655         Fix test-290.cs.
7656         * cs-parser.jay (delegate_declaration): Record a delegate
7657         declaration as a type declaration.
7658         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7659
7660 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
7661
7662         * parameter.cs: Do not crash if the type can not be resolved. 
7663
7664         * expression.cs: Report errors with unsafe pointers, fixes #64896
7665
7666 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7667
7668         * expression.cs: Pointer arith always needs to do a conv.i
7669         if the operand is a long. fix 65320
7670
7671 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7672
7673         Fixed cs0619-37.cs, cs0619-38.cs
7674
7675         * enum.cs (GetObsoleteAttribute): Removed.
7676
7677         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7678         on Enum member is double staged. The first is tested member
7679         and then enum.
7680
7681 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7682
7683         Fixed #56986, #63631, #65231
7684
7685         * class.cs: (TypeContainer.AddToMemberContainer): New method,
7686         adds member to name container.
7687         (TypeContainer.AddToTypeContainer): New method, adds type to
7688         name container.
7689         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
7690         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
7691         AddOperator): Simplified by reusing AddToMemberContainer.
7692         (TypeContainer.UserDefinedStaticConstructor): Changed to property
7693         instead of field.
7694         (Method.CheckForDuplications): Fixed implementation to test all
7695         possibilities.
7696         (MemberBase): Detection whether member is explicit interface
7697         implementation is now in constructor.
7698         (MemberBase.UpdateMemberName): Handles IndexerName.
7699         (Accessor): Changed to keep also location information.
7700         (AbstractPropertyEventMethod): Is derived from MemberCore.
7701         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
7702         will be emited or not.
7703         (PropertyBase.AreAccessorsDuplicateImplementation):
7704         Tests whether accessors are not in collision with some method.
7705         (Operator): Is derived from MethodCore to simplify common
7706         operations.
7707
7708         * decl.cs (Flags.TestMethodDuplication): Test for duplication
7709         must be performed.
7710         (DeclSpace.AddToContainer): Adds the member to defined_names
7711         table. It tests for duplications and enclosing name conflicts.
7712
7713         * enum.cs (EnumMember): Clean up to reuse the base structures
7714
7715 2004-09-03  Martin Baulig  <martin@ximian.com>
7716
7717         Merged latest changes into gmcs.  Please keep this comment in
7718         here, it makes it easier for me to see what changed in MCS since
7719         the last time I merged.
7720
7721 2004-09-03  Martin Baulig  <martin@ximian.com>
7722
7723         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7724         into TypeContainer, to make partial classes work again.
7725
7726 2004-09-03  Martin Baulig  <martin@ximian.com>
7727
7728         * rootcontext.cs (RootContext.V2): Removed.
7729
7730 2004-03-23  Martin Baulig  <martin@ximian.com>
7731
7732         * expression.cs (Invocation.OverloadResolve): Added `bool
7733         may_fail' argument and use it instead of the Location.IsNull() hack.
7734
7735 2004-09-09  Martin Baulig  <martin@ximian.com>
7736
7737         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
7738
7739 2004-09-09  Martin Baulig  <martin@ximian.com>
7740
7741         * generic.cs (TypeParameter.DefineType): Added support for
7742         explicit interface methods.
7743
7744 2004-09-09  Martin Baulig  <martin@ximian.com>
7745
7746         * README.Changes: New document.  Started to list important changes
7747         between MCS and GMCS here.
7748
7749 2004-09-08  Martin Baulig  <martin@ximian.com>
7750
7751         * class.cs
7752         (TypeContainer.CheckRecursiveDefinition): New protected method.
7753         (TypeContainer.DefineType): Move the CS0146 check into
7754         CheckRecursiveDefinition().     
7755
7756 2004-09-06  Martin Baulig  <martin@ximian.com>
7757
7758         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
7759         types for the constructor constraint.
7760
7761 2004-09-03  Martin Baulig  <martin@ximian.com>
7762
7763         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7764         into TypeContainer, to make partial classes work again.
7765
7766 2004-09-03  Martin Baulig  <martin@ximian.com>
7767
7768         * rootcontext.cs (RootContext.V2): Removed.
7769
7770 2004-03-23  Martin Baulig  <martin@ximian.com>
7771
7772         * expression.cs (Invocation.OverloadResolve): Added `bool
7773         may_fail' argument and use it instead of the Location.IsNull() hack.
7774
7775 2004-09-03  Martin Baulig  <martin@ximian.com>
7776
7777         Merged latest changes into gmcs.  Please keep this comment in
7778         here, it makes it easier for me to see what changed in MCS since
7779         the last time I merged.
7780
7781 2004-09-03  Raja R Harinath  <rharinath@novell.com>
7782
7783         Fix #61128.
7784         * expression.cs (BetterConversion): Don't allow either conversion 
7785         to be null.  Remove redundant implicit conversion test when 'q ==
7786         null' -- when this function is invoked, we already know that the
7787         implicit conversion exists.
7788         (BetterFunction): Assume that 'best' is non-null.  Remove
7789         redundant reimplementation of IsApplicable when 'best' is null.
7790         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
7791         number of arguments.
7792         (IsAncestralType): Extract from OverloadResolve.
7793         (OverloadResolve): Make robust to the MethodGroupExpr being
7794         unsorted.  Implement all the logic of Section 14.5.5.1, and
7795         support overloading of methods from multiple applicable types.
7796         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
7797
7798         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
7799         (RealError, Warning): Append type of report to related symbol.
7800
7801 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
7802
7803         * enum.cs: Fixed CLS-Compliance checks for enum members.
7804         Error tests cs3008-8.cs, cs3014-8.cs
7805
7806 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
7807
7808         Fixed bug #62342, #63102
7809         * class.cs: ImplementIndexer uses member.IsExplicitImpl
7810         like ImplementMethod.
7811
7812 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
7813
7814         * attribute.cs (Attribute.GetAttributeArgumentExpression):
7815         Fixed bug #65170.
7816
7817 2004-09-02  Martin Baulig  <martin@ximian.com>
7818
7819         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7820         TypeManager.GetArgumentTypes() rather than calling GetParameters()
7821         on the MethodBase.
7822
7823 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
7824
7825         C# 2.0 Static classes implemented
7826
7827         * class.cs (TypeContainer): instance_constructors,
7828         initialized_fields, initialized_static_fields,
7829         default_constructor, base_inteface_types are protected to be
7830         accessible from StaticClass.
7831         (TypeContainer.DefineDefaultConstructor): New virtual method
7832         for custom default constructor generating
7833         (StaticClass): New class to handle "Static classes" feature.
7834
7835         * cs-parser.jay: Handle static keyword on class like instance
7836         of StaticClass.
7837
7838         * driver.cs: Added "/langversion" command line switch with two
7839         options (iso-1, default).
7840
7841 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
7842
7843         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
7844
7845 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
7846
7847         * delegate.cs: Style.
7848
7849 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7850
7851         * delegate.cs: Add seperate instance expr field for miguel.
7852
7853 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7854
7855         * PointerArithmetic (Resolve): make sure we are not doing
7856         pointer arith on void*. Also, make sure we are resolved
7857         by not setting eclass until resolve.
7858
7859         All callers: Make sure that PointerArithmetic gets resolved.
7860
7861 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7862
7863         * ArrayCreation (LookupType): If the type does not resolve 
7864         to an array, give an error.
7865
7866 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
7867
7868         * statement.cs (Try.Resolve): Fixed bug #64222
7869
7870 2004-08-27  Martin Baulig  <martin@ximian.com>
7871
7872         * class.cs
7873         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7874         crash here.     
7875
7876 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
7877
7878         * ecore.cs (Constantify): Get underlying type via
7879         System.Enum.GetUnderlyingType to avoid StackOverflow on the
7880         Windows in special cases.
7881
7882 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
7883
7884         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
7885         for obtaining also private methods.
7886         (GetRemoveMethod): Used GetRemoveMethod (true)
7887         for obtaining also private methods.
7888
7889 2004-09-02  Martin Baulig  <martin@ximian.com>
7890
7891         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7892         TypeManager.GetArgumentTypes() rather than calling GetParameters()
7893         on the MethodBase.
7894
7895 2004-08-27  Martin Baulig  <martin@ximian.com>
7896
7897         * class.cs
7898         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7899         crash here.     
7900
7901 2004-08-25  Martin Baulig  <martin@ximian.com>
7902
7903         * support.cs (ReflectionParameters..ctor): If this is a generic
7904         method, retrieve and store its type parameters.
7905         (InternalParameters..ctor): Added `TypeParameter[]' argument.
7906         (ReflectionParameters.GenericConstraints): The argument specifies
7907         the type parameter, not the method parameter.
7908         (InternalParameters.GenericConstraints): Likewise.
7909
7910         * generic.cs (TypeParameter.DefineType): Correctly handle
7911         constraints wrt. generic methods in interfaces and their
7912         implementations.        
7913
7914 2004-08-24  Martin Baulig  <martin@ximian.com>
7915
7916         * generic.cs (TypeParameter.IsSubclassOf): New public method.
7917         (Constraints.IsSubclassOf): New internal method.
7918
7919         * typemanager.cs (TypeManager.FindMembers): Added special support
7920         for GenericTypeParameterBuilder's.      
7921         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
7922         type parameters.
7923
7924 2004-08-24  Martin Baulig  <martin@ximian.com>
7925
7926         * typemanager.cs
7927         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
7928         this for accessibility checks.
7929         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
7930         IsNestedFamilyAccessible.
7931         (TypeManager.IsSubclassOf): New method, do what the name actually
7932         says.   
7933
7934 2004-08-24  Martin Baulig  <martin@ximian.com>
7935
7936         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
7937         as a SimpleName, include the generic arity.
7938
7939 2004-08-24  Martin Baulig  <martin@ximian.com>
7940
7941         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
7942         MethodAttributes.HideBySig for operators.
7943
7944 2004-08-23  Martin Baulig  <martin@ximian.com>
7945
7946         Back to the old error reporting system :-)
7947
7948         * report.cs (Message): Removed.
7949         (Report.MessageData, ErrorData, WarningData): Removed.
7950         (Report.Error, Warning): Back to the old system.
7951
7952 2004-08-23  Martin Baulig  <martin@ximian.com>
7953
7954         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
7955
7956         * class.cs (TypeContainer.ParentContainer): New public virtual
7957         method; replaces the explicit interface implementation.
7958         (ClassPart.ParentContainer): Override.
7959
7960 2004-08-23  Martin Baulig  <martin@ximian.com>
7961
7962         * statement.cs (Switch): Added support for constant switches; see
7963         #59428 or test-285.cs.
7964
7965 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
7966
7967         Fixed bug #62740.
7968         * statement.cs (GetEnumeratorFilter): Removed useless
7969         logic because C# specs is strict. GetEnumerator must be
7970         public.
7971
7972 2004-08-22  Martin Baulig  <martin@ximian.com>
7973
7974         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7975         a switch and may break, reset the barrier.  Fixes #59867.
7976
7977 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
7978
7979         CLS-Compliance speed up (~5% for corlib)
7980
7981         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
7982         New method. Tests container for CLS-Compliant names
7983
7984         * class.cs (TypeContainer.VerifyClsName): New method.
7985         Checks whether container name is CLS Compliant.
7986         (Constructor): Implements IMethodData.
7987
7988         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
7989         low-case table for CLS Compliance test.
7990         (MemberCache.VerifyClsParameterConflict): New method.
7991         Checks method parameters for CS3006 error.
7992
7993         * enum.cs (EnumMember): Is derived from MemberCore.
7994         (Enum.VerifyClsName): Optimized for better performance.
7995
7996 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
7997
7998         * report.cs: Renamed Error_T to Error and changed all
7999         references.
8000
8001 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8002
8003         * class.cs (TypeContainer.IndexerArrayList): New inner class
8004         container for indexers.
8005         (TypeContainer.DefaultIndexerName): New constant for default
8006         indexer name. Replaced all "Item" with this constant.
8007         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8008
8009         * typemanager.cs (TypeManager.default_member_ctor): Cache here
8010         DefaultMemberAttribute constructor.
8011
8012 2004-08-05  Martin Baulig  <martin@ximian.com>
8013
8014         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8015         Fix bug #59429.
8016
8017 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
8018
8019         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8020         multi platforms problem.
8021
8022         * compiler.csproj: Included shared files.
8023
8024 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8025
8026         Fix bug 60333, 55971 in the more general way
8027         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8028         Added arg_type argument for constant conversion.
8029         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8030
8031 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8032
8033         Fix bug #59760
8034         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
8035         OperatorArrayList, MethodCoreArrayList for typecontainer
8036         containers. Changed class member types to these new types.
8037         (MethodArrayList.DefineMembers): Added test for CS0659.
8038
8039 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
8040
8041         * cfold.cs: Synchronize the folding with the code in expression.cs
8042         Binary.DoNumericPromotions for uint operands.
8043
8044         * attribute.cs: Revert patch from Raja, it introduced a regression
8045         while building Blam-1.2.1 (hard to isolate a test case).
8046
8047 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8048
8049         Fix for #55382
8050         * class.cs:
8051         (TypeContainer.Define): Renamed to DefineContainerMembers because of
8052         name collision.
8053         (MethodCore.parent_method): New member. The method we're overriding
8054         if this is an override method.
8055         (MethodCore.CheckBase): Moved from Method class and made common.
8056         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8057         private.
8058         (MethodCore.CheckForDuplications): New abstract method. For custom
8059         member duplication search in a container
8060         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8061         method and its return type.
8062         (Event.conflict_symbol): New member. Symbol with same name in the
8063         parent class.
8064
8065         * decl.cs:
8066         (MemberCache.FindMemberWithSameName): New method. The method
8067         is looking for conflict with inherited symbols.
8068
8069 2004-08-04  Martin Baulig  <martin@ximian.com>
8070
8071         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8072
8073         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8074
8075 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8076
8077         * report.cs (Message): New enum for better error, warning reference in
8078         the code.
8079         (MessageData): New inner abstract class. It generally handles printing of
8080         error and warning messages.
8081         Removed unused Error, Warning, Message methods.
8082
8083 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8084
8085         Fix for cs0592-8.cs test
8086         * attribute.cs
8087         (Attributable.ValidAttributeTargets): Made public.
8088         (Attribute.ExplicitTarget): New member for explicit target value.
8089         (Attribute.CheckTargets): Now we translate explicit attribute
8090         target to Target here.
8091
8092 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
8093
8094         * ecore.cs (MethodGroupExpr): new IsBase property.
8095
8096         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8097
8098         * delegate.cs (DelegateCreation): store a MethodGroupExpr
8099         rather than an instance expr.
8100
8101         (DelegateCreation.Emit): Use the method group rather than
8102         the instance expression. Also, if you have base.Foo as the
8103         method for a delegate, make sure to emit ldftn, not ldftnvirt.
8104
8105         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
8106
8107         (NewDelegate.DoResolve): Only check for the existance of Invoke
8108         if the method is going to be needed. Use MethodGroupExpr.
8109
8110         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
8111
8112         * expression.cs: For pointer arith., make sure to use
8113         the size of the type, not the size of the pointer to
8114         the type.
8115
8116 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8117
8118         Fix for #60722
8119         * class.cs (Class): Added error CS0502 test.
8120
8121 2004-08-03  John Luke  <jluke@cfl.rr.com>
8122             Raja R Harinath  <rharinath@novell.com>
8123
8124         Fix for #60997.
8125         * attribute.cs (Attribute.complained_before): New flag.
8126         (Attribute.ResolveType, Attribute.Resolve),
8127         (Attribute.DefinePInvokeMethod): Set it.
8128         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8129         
8130 2004-08-03  Martin Baulig  <martin@ximian.com>
8131
8132         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8133         use a user-defined operator; we still need to do numeric
8134         promotions in case one argument is a builtin type and the other
8135         one has an implicit conversion to that type.  Fixes #62322.
8136
8137 2004-08-18  Martin Baulig  <martin@ximian.com>
8138
8139         * class.cs (Method.Define): Use the correct method name when
8140         creating the MethodBuilder for a generic method.
8141
8142 2004-08-17  Martin Baulig  <martin@ximian.com>
8143
8144         * generic.cs (Constraints): Support type parameter constraints.
8145
8146 2004-08-16  Martin Baulig  <martin@ximian.com>
8147
8148         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
8149         (Token.GENERIC_DIMENSION): New token; this is returned if we
8150         encounter an unbound generic type in a typeof() expression.
8151
8152         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
8153         this token is only generated while parsing a typeof() expression.
8154         (typeof_expression): Removed the old unbound_type hack.
8155
8156         * generic.cs (TypeArguments.IsUnbound): New public property.
8157
8158         * decl.cs (MemberName): Added support for unbound types.
8159
8160 2004-08-14  Martin Baulig  <martin@ximian.com>
8161
8162         * typemanager.cs
8163         (TypeManager.IsEqualGenericInstance): New static method.
8164         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
8165         just used to check accessibility, so follow the rules of 26.1.6.        
8166
8167         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
8168         ConstructedType instead of a TypeExpression if we have type arguments.
8169
8170         * cs-parser.jay (typeof_expression): Support unbound generic types.
8171
8172         * ecore.cs (UnboundTypeExpression): New public class.
8173
8174 2004-08-12  Martin Baulig  <martin@ximian.com>
8175
8176         * typemanager.cs (TypeManager.IsNestedChildOf): Use
8177         TypeManager.IsEqual() rather than `=='.
8178
8179         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
8180         generic instances as well.
8181
8182 2004-08-12  Martin Baulig  <martin@ximian.com>
8183
8184         * expression.cs (Invocation.InferType): We can only infer method
8185         type parameters.  Fixes #62647.
8186
8187 2004-08-11  Martin Baulig  <martin@ximian.com>
8188
8189         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
8190         before resolving the base classes.
8191
8192 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8193
8194         * Makefile: install .mdb file too.
8195
8196 2004-08-05  Martin Baulig  <martin@ximian.com>
8197
8198         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
8199         initializer, the current type is just the TypeBuilder, not the
8200         instantiated generic type.
8201         (FieldExpr.IsFieldInitializer): New public property.
8202
8203 2004-08-04  Martin Baulig  <martin@ximian.com>
8204
8205         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8206
8207         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8208
8209 2004-08-03  Martin Baulig  <martin@ximian.com>
8210
8211         * class.cs (MethodData.Define): If we're an explicit
8212         implementation, remove the generic arity from the type name.
8213
8214 2004-08-03  Martin Baulig  <martin@ximian.com>
8215
8216         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8217         use a user-defined operator; we still need to do numeric
8218         promotions in case one argument is a builtin type and the other
8219         one has an implicit conversion to that type.  Fixes #62322.
8220
8221 2004-08-02  Martin Baulig  <martin@ximian.com>
8222
8223         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
8224         `TypeExpr[]' array.
8225         (TypeContainer.GetClassBases): Return the unexpanded list of
8226         interfaces; we expand them later.
8227         (TypeContainer.DefineType): After creating the TypeBuilder, call
8228         TypeManager.ExpandInterfaces() to get an expanded and resolved
8229         list of interfaces.
8230
8231         * ecore.cs (TypeExpr.GetInterfaces): Removed
8232
8233         * generics.cs (Constraints.InterfaceConstraints): Remove.
8234         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
8235         register the interface constraints.
8236
8237         * typemanager.cs
8238         (TypeManager.AddUserType): Removed the `ifaces' argument.
8239         (TypeManager.AddTypeParameter): Likewise.
8240         (TypeManager.AddUserInterface): Removed, was unused.
8241         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
8242         `TypeExpr[]' array for the interfaces.
8243         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
8244         has been defined, returns a list of the resolved interfaces types.
8245         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
8246         (TypeManager.GetExplicitInterfaces): Likewise.  
8247
8248 2004-08-02  Martin Baulig  <martin@ximian.com>
8249
8250         * expression.cs (Invocation.EmitCall): If we're invoking a method
8251         on a type parameter, use the new `Constrained' prefix opcode.
8252
8253 2004-08-02  Martin Baulig  <martin@ximian.com>
8254
8255         * statement.cs (LocalInfo.Flags): Added `IsThis'.
8256         (LocalInfo.IsThis): New public property.
8257         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8258
8259 2004-08-01  Martin Baulig  <martin@ximian.com>
8260
8261         * class.cs (TypeContainer.GetClassBases): Don't set the default
8262         here since we may get called from GetPartialBases().
8263         (TypeContainer.DefineType): If GetClassBases() didn't return a
8264         parent, use the default one.
8265
8266 2004-07-30  Martin Baulig  <martin@ximian.com>
8267
8268         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8269
8270         * class.cs (SourceMethod): New public class, derive from the
8271         symbol writer's ISourceMethod.
8272         (Method): Use the new symbol writer API.
8273
8274         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8275         as argument and use the new symbol writer.
8276
8277         * location.cs
8278         (SourceFile): Implement the symbol writer's ISourceFile.
8279         (Location.SymbolDocument): Removed.
8280         (Location.SourceFile): New public property.
8281
8282         * symbolwriter.cs: Use the new symbol writer API.
8283
8284 2004-07-30  Raja R Harinath  <rharinath@novell.com>
8285
8286         * Makefile (install-local): Remove.  Functionality moved to
8287         executable.make.
8288
8289 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
8290
8291         * Makefile: Install mcs.exe.config file together with mcs.exe.
8292         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8293         correct runtime version.
8294         
8295 2004-07-25  Martin Baulig  <martin@ximian.com>
8296
8297         * class.cs
8298         (TypeContainer.RegisterOrder): Removed, this was unused.
8299         (TypeContainer, interface_order): Removed.
8300         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8301         TypeContainer as argument since we can also be called with a
8302         `PartialContainer' for a partial class/struct/interface.
8303         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8304         of checking whether we're an `Interface' - we could be a
8305         `PartialContainer'.
8306         (PartialContainer.Register): Override; call
8307         AddClass()/AddStruct()/AddInterface() on our parent.
8308
8309         * cs-parser.jay (interface_member_declaration): Add things to the
8310         `current_container', not the `current_class'.
8311
8312         * rootcontext.cs (RegisterOrder): The overloaded version which
8313         takes an `Interface' was unused, removed.
8314
8315         * typemanager.cs (TypeManager.LookupInterface): Return a
8316         `TypeContainer', not an `Interface'.
8317         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8318         contain a `PartialContainer' for an interface, so check it's
8319         `Kind' to figure out what it is.
8320
8321 2004-07-25  Martin Baulig  <martin@ximian.com>
8322
8323         * class.cs (Class.DefaultTypeAttributes): New public constant.
8324         (Struct.DefaultTypeAttributes): Likewise.
8325         (Interface.DefaultTypeAttributes): Likewise.
8326         (PartialContainer.TypeAttr): Override this and add the
8327         DefaultTypeAttributes.
8328
8329 2004-07-25  Martin Baulig  <martin@ximian.com>
8330
8331         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8332         we can just use the `Parent' field instead.
8333
8334 2004-07-25  Martin Baulig  <martin@ximian.com>
8335
8336         * class.cs (TypeContainer.Emit): Renamed to EmitType().
8337
8338 2004-07-25  Martin Baulig  <martin@ximian.com>
8339
8340         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8341         our parts before defining any methods.
8342         (TypeContainer.VerifyImplements): Make this virtual.
8343         (ClassPart.VerifyImplements): Override and call VerifyImplements()
8344         on our PartialContainer.
8345
8346 2004-07-25  Martin Baulig  <martin@ximian.com>
8347
8348         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8349
8350         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8351         argument, we can just use the `Parent' field instead.
8352
8353         * class.cs
8354         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
8355         (MemberBase.DoDefine): Likewise.
8356
8357 2004-07-24  Martin Baulig  <martin@ximian.com>
8358
8359         * decl.cs (MemberCore.Parent): New public field.
8360         (DeclSpace.Parent): Moved to MemberCore.
8361
8362         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8363         (MemberBase.ctor): Added TypeContainer argument, pass it to our
8364         parent's .ctor.
8365         (FieldBase, Field, Operator): Likewise.
8366         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8367         (EventField, Event): Likewise.
8368
8369 2004-07-23  Martin Baulig  <martin@ximian.com>
8370
8371         * class.cs (PartialContainer): New public class.
8372         (ClassPart): New public class.
8373         (TypeContainer): Added support for partial classes.
8374         (TypeContainer.GetClassBases): Splitted some of the functionality
8375         out into GetNormalBases() and GetPartialBases().
8376
8377         * cs-tokenizer.cs (Token.PARTIAL): New token.
8378         (Tokenizer.consume_identifier): Added some hacks to recognize
8379         `partial', but only if it's immediately followed by `class',
8380         `struct' or `interface'.
8381
8382         * cs-parser.jay: Added support for partial clases.
8383
8384 2004-07-23  Martin Baulig  <martin@ximian.com>
8385
8386         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8387         a `DeclSpace' and also made it readonly.
8388         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8389         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8390         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8391
8392         * cs-parser.jay: Pass the `current_class', not the
8393         `current_container' (at the moment, this is still the same thing)
8394         to a new Method, Property, Event, Indexer or Constructor.
8395
8396 2004-07-23  Martin Baulig  <martin@ximian.com>
8397
8398         * cs-parser.jay (CSharpParser): Added a new `current_class' field
8399         and removed the `current_interface' one.
8400         (struct_declaration, class_declaration, interface_declaration):
8401         Set `current_class' to the newly created class/struct/interface;
8402         set their `Bases' and call Register() before parsing their body.
8403
8404 2004-07-23  Martin Baulig  <martin@ximian.com>
8405
8406         * class.cs (Kind): New public enum.
8407         (TypeContainer): Made this class abstract.
8408         (TypeContainer.Kind): New public readonly field.
8409         (TypeContainer.CheckDef): New public method; moved here from
8410         cs-parser.jay.
8411         (TypeContainer.Register): New public abstract method.
8412         (TypeContainer.GetPendingImplementations): New public abstract
8413         method.
8414         (TypeContainer.GetClassBases): Removed the `is_class' and
8415         `is_iface' parameters.
8416         (TypeContainer.DefineNestedTypes): Formerly known as
8417         DoDefineType().
8418         (ClassOrStruct): Made this class abstract.
8419
8420         * tree.cs (RootTypes): New public type. 
8421
8422 2004-07-20  Martin Baulig  <martin@ximian.com>
8423
8424         * tree.cs (Tree.RecordNamespace): Removed.
8425         (Tree.Namespaces): Removed.
8426
8427         * rootcontext.cs (RootContext.IsNamespace): Removed.
8428
8429         * cs-parser.jay (namespace_declaration): Just create a new
8430         NamespaceEntry here.
8431
8432 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
8433
8434         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
8435         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
8436         entry to make sure it runs in the correct runtime version.
8437         
8438 2004-07-18  Martin Baulig  <martin@ximian.com>
8439
8440         * generic.cs (ConstructedType.CheckConstraints): Improved
8441         constraints checking.
8442
8443 2004-07-18  Martin Baulig  <martin@ximian.com>
8444
8445         * expression.cs (Invocation.BetterMethod): Call
8446         TypeManager.TypeToCoreType() on all types and removed my previous
8447         hack; we're already doig the right thing here.
8448
8449 2004-07-17  Martin Baulig  <martin@ximian.com>
8450
8451         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
8452
8453 2004-07-16  Martin Baulig  <martin@ximian.com>
8454
8455         * iterators.cs: Added generics support.
8456
8457 2004-07-16  Martin Baulig  <martin@ximian.com>
8458
8459         * iterators.cs: Rewrote this.  We're now using one single Proxy
8460         class for both the IEnumerable and the IEnumerator interface and
8461         `Iterator' derives from Class so we can use the high-level API.
8462
8463         * class.cs (TypeContainer.AddIterator): New method.
8464         (TypeContainer.DoDefineType): New protected virtual method, which
8465         is called from DefineType().
8466         (TypeContainer.DoDefineMembers): Call DefineType() and
8467         DefineMembers() on all our iterators.
8468         (TypeContainer.Emit): Call Emit() on all our iterators.
8469         (TypeContainer.CloseType): Call CloseType() on all our iterators.
8470
8471         * codegen.cs (EmitContext.CurrentIterator): New public field.
8472
8473 2004-07-15  Martin Baulig  <martin@ximian.com>
8474
8475         * typemanager.cs
8476         (TypeManager.not_supported_exception_type): New type.   
8477
8478 2004-07-14  Martin Baulig  <martin@ximian.com>
8479
8480         * typemanager.cs
8481         (TypeManager.generic_ienumerable_type): New type.
8482         (TypeManager.generic_ienumerator_type): New type.
8483
8484         * rootcontext.cs
8485         (RootContext.interfaces_first_stage): Added
8486         "System.Collections.Generic.IEnumerator`1" and
8487         "System.Collections.Generic.IEnumerable`1".     
8488
8489 2004-07-14  Martin Baulig  <martin@ximian.com>
8490
8491         * iterators.cs: Use real error numbers.
8492
8493 2004-07-14  Martin Baulig  <martin@ximian.com>
8494
8495         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8496         requires this to be a System.Collection.IEnumerable and not a
8497         class implementing that interface.
8498         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
8499
8500 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
8501
8502         * class.cs: Fixed previous fix, it broke some error tests.
8503
8504 2004-07-12  Martin Baulig  <martin@ximian.com>
8505
8506         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8507         Fixes #61293.
8508
8509 2004-07-14  Martin Baulig  <martin@ximian.com>
8510
8511         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
8512         an exclamation mark (!) for the generic arity to reflect the
8513         latest spec changes; ie. use "System.Collections.Generic.IList`1".
8514
8515 2004-07-13  Martin Baulig  <martin@ximian.com>
8516
8517         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
8518         specifiers being part of a type argument.
8519
8520 2004-07-13  Martin Baulig  <martin@ximian.com>
8521
8522         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
8523         name for generic types.
8524
8525 2004-07-13  Martin Baulig  <martin@ximian.com>
8526
8527         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
8528         bit to fix #60119.
8529
8530 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
8531
8532         * assign.cs (LocalTemporary): Add new argument: is_address,If
8533         `is_address' is true, then the value that we store is the address
8534         to the real value, and not the value itself.
8535         
8536         * ecore.cs (PropertyExpr): use the new local temporary
8537         stuff to allow us to handle X.Y += z (where X is a struct)
8538
8539 2004-07-08  Martin Baulig  <martin@ximian.com>
8540
8541         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8542         not always return, just like we're doing in Using.Resolve().
8543
8544 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
8545
8546         * cs-parser.jay (fixed_statement): flag this as Pinned.
8547
8548 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
8549
8550         * typemanager.cs (TypeManager): Removed MakePinned method, this
8551         mechanism is replaced with the .NET 2.x compatible mechanism of
8552         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8553
8554         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
8555         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8556         `IsFixed' property which has a different meaning.
8557
8558 2004-07-02  Raja R Harinath  <rharinath@novell.com>
8559
8560         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8561         visible from inside a nested class, not just the names of the
8562         immediately enclosing class.
8563         Fix for bug #60730.
8564
8565 2004-06-24  Raja R Harinath  <rharinath@novell.com>
8566
8567         * expression.cs (BetterConversion): Remove buggy special-case
8568         handling of "implicit constant expression conversions".  At this
8569         point, we already know that the conversion is possible -- we're
8570         only checking to see which is better.
8571
8572 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8573
8574         * cs-parser.jay: Added error CS0210 test.
8575
8576 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8577
8578         * cs-parser.jay: Added error CS0134 test.
8579
8580 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8581
8582         Fix bug #52507
8583         * cs-parser.jay: Added error CS0145 test.
8584
8585 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8586
8587         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8588
8589 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
8590         
8591         * expression.cs (StackAlloc.Resolve): The argument may not
8592         be a constant; deal with this case.
8593         
8594 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
8595
8596         * attribute.cs (IndexerName_GetIndexerName): Renamed to
8597         GetIndexerAttributeValue.
8598         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8599
8600         * class.cs (Indexer.Define): Added error tests for CS0415,
8601         CS0609.
8602
8603 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
8604
8605         * attribute.cs (Attribute.Resolve): Keep field code in sync with
8606         property code.
8607
8608 2004-06-23  Martin Baulig  <martin@ximian.com>
8609
8610         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8611         neither return nor throw, reset the barrier as well.  Fixes #60457.
8612
8613 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
8614
8615         * class.cs : EventAttributes is now set to None by default.
8616           This fixes bug #60459.
8617
8618 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8619
8620         Fix bug #60219
8621         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8622         Don't throw exception but return null (it's sufficient now).
8623
8624 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8625
8626         * typemanager.cs (GetArgumentTypes): Faster implementation.
8627
8628 2004-06-18  Martin Baulig  <martin@ximian.com>
8629
8630         * attribute.cs (Attribute.Resolve): Check whether we're an
8631         EmptyCast which a Constant child.  Fixes #60333.
8632
8633 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
8634
8635         * statement.cs (EmitCollectionForeach): Account for the fact that
8636         not all valuetypes are in areas which we can take the address of.
8637         For these variables, we store to a temporary variable. Also, make
8638         sure that we dont emit a `callvirt' on a valuetype method.
8639
8640 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8641
8642         * expression.cs (StackAlloc.DoReSolve): Added test for
8643         negative parameter (CS0247).
8644
8645 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8646
8647         Fix bug #59792
8648         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8649
8650 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8651
8652         Fix bug #59781
8653         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8654         ulong.
8655
8656 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8657
8658         Fix bug #58254 & cs1555.cs, cs1556.cs
8659         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8660
8661 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8662
8663         * cs-parser.jay: Added error CS1669 test for indexers.
8664
8665 2004-06-18  Martin Baulig  <martin@ximian.com>
8666
8667         * generics.cs (GenericMethod.ctor): Don't take an Attributes
8668         argument.  Fixes #60441.
8669
8670 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
8671         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
8672         The name needs to have the actual name of the method in order
8673         for other tests (such as the one in OverloadResolve for Invoke
8674         on a delegate) to work. As well, it does not really help
8675         error reporting because the method group had multiple methods.
8676         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
8677         Make profiling work.
8678         
8679 2004-06-13  Martin Baulig  <martin@ximian.com>
8680
8681         * cs-parser.jay: Don't allow generic attributes.
8682
8683 2004-06-13  Martin Baulig  <martin@ximian.com>
8684
8685         * class.cs (MemberBase.DoDefineBase): New protected method.
8686         (MemberBase.DoDefine): Compute the `flags' in the new
8687         DoDefineBase() which must be called first.
8688         (Method.Define): Call DoDefineBase() first so we have the flags
8689         when defining the generic method.
8690
8691         * cs-parser.jay (interface_method_declaration): Support generic methods.
8692
8693 2004-06-13  Martin Baulig  <martin@ximian.com>
8694
8695         * decl.cs (TypeName): Removed.
8696         (MemberName): Removed TypeName and MemberNow; now we just have
8697         MemberName.
8698
8699         * cs-parser.jay: Don't distinguish between type arguments and type
8700         parameters in the grammar and simplified the rules a bit.  The
8701         reduce/reduce conflicts are now gone (except the one we inherited
8702         from mcs).
8703
8704 2004-06-11  Martin Baulig  <martin@ximian.com>
8705
8706         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
8707         call this twice: for params and varargs methods.
8708
8709 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8710
8711         * class.cs:
8712         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
8713
8714 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8715
8716         * attribute.cs (Attribute.GetValidTargets): Made public.
8717
8718         * class.cs: 
8719         (AbstractPropertyEventMethod): New class for better code sharing.
8720         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
8721         CS1667 report.
8722         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
8723
8724 2004-06-09  Martin Baulig  <martin@ximian.com>
8725
8726         * cs-parser.jay: Removed a reduce/reduce conflict.
8727
8728 2004-06-03  Martin Baulig  <martin@ximian.com>
8729
8730         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
8731         GetSimpleName() and return a SimpleName.
8732
8733         * ecore.cs (SimpleName.Arguments): New public field.
8734         (SimpleName): Added overloaded ctor which takes an additional
8735         TypeArguments argument.
8736         (SimpleName.SimpleNameResolve): Added support for generic methods.
8737         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
8738         formerly in MemberAccess.DoResolve(), but we also need it in
8739         SimpleNameResolve().
8740
8741         * expression.cs (MemberAccess.DoResolve): Use the new
8742         MethodGroupExpr.ResolveGeneric().       
8743
8744 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8745
8746         * decl.cs: If possible, use lookuptypedirect here. We can only do
8747         this if there is no `.' after the namespace. Avoids using
8748         LookupType, which does lots of slow processing.
8749         (FindNestedType) New method, does what it says :-).
8750         * namespace.cs: use LookupTypeDirect.
8751         * rootcontext.cs: use membercache, if possible.
8752         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8753
8754 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8755
8756         * expression.cs:
8757         According to the spec, 
8758
8759         In a member access of the form E.I, if E is a single identifier,
8760         and if the meaning of E as a simple-name (§7.5.2) is a constant,
8761         field, property, localvariable, or parameter with the same type as
8762         the meaning of E as a type-name (§3.8), then both possible
8763         meanings of E are permitted.
8764
8765         We did not check that E as a simple-name had the same type as E as
8766         a type name.
8767
8768         This trivial check gives us 5-7% on bootstrap time.
8769
8770 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8771
8772         * expression.cs (Invocation.OverloadResolve): Avoid the
8773         use of hashtables and boxing here by allocating on demand.
8774
8775 2004-05-30  Martin Baulig  <martin@ximian.com>
8776
8777         * rootcontext.cs (RootContext.LookupType): Don't cache things if
8778         we're doing a silent lookup.  Don't try to lookup nested types in
8779         TypeManager.object_type (thanks to Ben Maurer).
8780
8781 2004-05-30  Martin Baulig  <martin@ximian.com>
8782
8783         Committing a patch from Ben Maurer.
8784
8785         * rootcontext.cs (RootContext.LookupType): Cache negative results.
8786
8787 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8788
8789         * convert.cs: add a trivial cache for overload operator resolution.
8790
8791 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
8792
8793         * attribute.cs
8794         (AttributeTester.GetObsoleteAttribute): Returns instance of
8795         ObsoleteAttribute when type is obsolete.
8796
8797         * class.cs
8798         (TypeContainer.VerifyObsoleteAttribute): Override.
8799         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
8800         (MethodCode.VerifyObsoleteAttribute): Override.
8801         (MemberBase.VerifyObsoleteAttribute): Override.
8802
8803         * decl.cs
8804         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
8805         and report proper error.
8806
8807         *delegate.cs
8808         (Delegate.VerifyObsoleteAttribute): Override.
8809
8810         * ecore.cs
8811         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
8812         and report proper error.
8813         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
8814
8815         * enum.cs
8816         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
8817         and enum member.
8818
8819         * expression.cs
8820         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
8821         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
8822         Added test for ObsoleteAttribute.
8823
8824         * statement.cs
8825         (Catch): Derived from Statement.
8826
8827 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8828
8829         * decl.cs: If possible, use lookuptypedirect here. We can only do
8830         this if there is no `.' after the namespace. Avoids using
8831         LookupType, which does lots of slow processing.
8832         (FindNestedType) New method, does what it says :-).
8833         * namespace.cs: use LookupTypeDirect.
8834         * rootcontext.cs: use membercache, if possible.
8835         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8836
8837 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8838
8839         * expression.cs:
8840         According to the spec, 
8841
8842         In a member access of the form E.I, if E is a single identifier,
8843         and if the meaning of E as a simple-name (§7.5.2) is a constant,
8844         field, property, localvariable, or parameter with the same type as
8845         the meaning of E as a type-name (§3.8), then both possible
8846         meanings of E are permitted.
8847
8848         We did not check that E as a simple-name had the same type as E as
8849         a type name.
8850
8851         This trivial check gives us 5-7% on bootstrap time.
8852
8853 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
8854
8855         Fixed bug #59071 & cs0160.cs
8856         * statement.cs (Try.Resolve): Check here whether order of catch
8857         clauses matches their dependencies.
8858
8859 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
8860
8861         Fixed bug #58624
8862         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
8863         unsafe type.
8864
8865 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8866
8867         * expression.cs (Invocation.OverloadResolve): Avoid the
8868         use of hashtables and boxing here by allocating on demand.
8869
8870 2004-05-30  Martin Baulig  <martin@ximian.com>
8871
8872         * rootcontext.cs (RootContext.LookupType): Don't cache things if
8873         we're doing a silent lookup.  Don't try to lookup nested types in
8874         TypeManager.object_type (thanks to Ben Maurer).
8875
8876 2004-05-30  Martin Baulig  <martin@ximian.com>
8877
8878         Committing a patch from Ben Maurer.
8879
8880         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
8881
8882 2004-05-29  Martin Baulig  <martin@ximian.com>
8883
8884         * class.cs (IMethodData.ShouldIgnore): New method.
8885
8886         * typemanager.cs (TypeManager.MethodFlags): Don't take a
8887         `Location' argument, we don't need it anywhere.  Use
8888         `IMethodData.ShouldIgnore ()' instead of
8889         `MethodData.GetMethodFlags ()'.
8890         (TypeManager.AddMethod): Removed.
8891         (TypeManager.AddMethod2): Renamed to AddMethod.
8892
8893 2004-05-29  Martin Baulig  <martin@ximian.com>
8894
8895         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
8896
8897         * convert.cs (Convert.ImplicitReferenceConversion): If we're
8898         converting from a class type S to an interface type and we already
8899         have an object on the stack, don't box it again.  Fixes #52578.
8900
8901 2004-05-29  Martin Baulig  <martin@ximian.com>
8902
8903         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8904         Added support for `params' parameters.  Fixes #59267.
8905
8906 2004-05-29  Martin Baulig  <martin@ximian.com>
8907
8908         * literal.cs (NullPointer): Provide a private .ctor which sets
8909         `type' to TypeManager.object_type.  Fixes #59048.
8910
8911 2004-05-29  Martin Baulig  <martin@ximian.com>
8912
8913         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
8914         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
8915
8916         * ecore.cs (EventExpr.instance_expr): Make the field private.
8917
8918 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
8919
8920         Fixed bug #50080 & cs0214-2.cs
8921         * expression.cs (Cast.DoResolve): Check unsafe context here.
8922         
8923         * statement.cs (Resolve.DoResolve): Likewise.
8924
8925 2004-05-26  Martin Baulig  <martin@ximian.com>
8926
8927         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
8928
8929         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
8930         (RootContext.LookupType): Pass down the `silent' flag.
8931
8932 2004-05-25  Martin Baulig  <martin@ximian.com>
8933
8934         * expression.cs
8935         (MethodGroupExpr.IdenticalTypeName): New public property.
8936         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
8937         expression actually refers to a type.
8938
8939 2004-05-25  Martin Baulig  <martin@ximian.com>
8940
8941         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
8942         for #56176 and made it actually work.
8943
8944 2004-05-25  Martin Baulig  <martin@ximian.com>
8945
8946         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
8947         (FieldExpr, PropertyExpr): Override and implement
8948         CacheTemporaries.  Fixes #52279.
8949
8950 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
8951
8952         * location.cs: In the new compiler listing a file twice is a
8953         warning, not an error.
8954
8955 2004-05-24  Martin Baulig  <martin@ximian.com>
8956
8957         * enum.cs (Enum.DefineType): For the `BaseType' to be a
8958         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
8959
8960 2004-05-24  Martin Baulig  <martin@ximian.com>
8961
8962         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
8963         walking the `using' list.  Fixes #53921.
8964
8965 2004-05-24  Martin Baulig  <martin@ximian.com>
8966
8967         * const.cs (Const.LookupConstantValue): Added support for
8968         EmptyCast's; fixes #55251.
8969
8970 2004-05-24  Martin Baulig  <martin@ximian.com>
8971
8972         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
8973         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
8974         which does the CS0135 check.  The reason is that we first need to
8975         check whether the variable actually exists.
8976
8977 2004-05-24  Martin Baulig  <martin@ximian.com>
8978
8979         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
8980         than RootContext.LookupType() to find the explicit interface
8981         type.  Fixes #58584.
8982
8983 2004-05-24  Raja R Harinath  <rharinath@novell.com>
8984
8985         * Makefile: Simplify.  Use executable.make.
8986         * mcs.exe.sources: New file.  List of sources of mcs.exe.
8987
8988 2004-05-24  Anders Carlsson  <andersca@gnome.org>
8989
8990         * decl.cs:
8991         * enum.cs:
8992         Use the invariant culture when doing String.Compare for CLS case
8993         sensitivity.
8994         
8995 2004-05-23  Martin Baulig  <martin@ximian.com>
8996
8997         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
8998         don't have any dots.  Fixes #52622, added cs0246-8.cs.
8999
9000         * namespace.cs (NamespaceEntry.Lookup): Likewise.
9001
9002 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9003
9004         * class.cs (MemberBase.Define): Reuse MemberType member for 
9005         resolved type. Other methods can use it too.
9006
9007 2004-05-23  Martin Baulig  <martin@ximian.com>
9008
9009         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9010         the variable also exists in the current block (otherwise, we need
9011         to report a CS0103).  Fixes #58670.
9012
9013 2004-05-23  Martin Baulig  <martin@ximian.com>
9014
9015         * flowanalysis.cs (Reachability.Reachable): Compute this
9016         on-the-fly rather than storing it as a field.
9017
9018 2004-05-23  Martin Baulig  <martin@ximian.com>
9019
9020         * flowanalysis.cs (Reachability.And): Manually compute the
9021         resulting `barrier' from the reachability.      
9022        
9023 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9024
9025         Fix bug #57835
9026         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9027         instance of ObsoleteAttribute when symbol is obsolete.
9028
9029         * class.cs
9030         (IMethodData): Extended interface for ObsoleteAttribute support.
9031
9032 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9033
9034         * attribute.cs: Fix bug #55970
9035
9036 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9037
9038         Fix bug #52705
9039         * attribute.cs
9040         (GetObsoleteAttribute): New method. Creates the instance of
9041         ObsoleteAttribute.
9042         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9043         ObsoleteAttribute when member is obsolete.
9044         (AttributeTester.Report_ObsoleteMessage): Common method for
9045         Obsolete error/warning reporting.
9046
9047         * class.cs
9048         (TypeContainer.base_classs_type): New member for storing parent type.
9049
9050         * decl.cs
9051         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9052         for this MemberCore.
9053
9054 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9055
9056         * attribute.cs, const.cs: Fix bug #58590
9057
9058 2004-05-21  Martin Baulig  <martin@ximian.com>
9059
9060         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9061         out parameters if the end of the method is unreachable.  Fixes
9062         #58098. 
9063
9064 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9065
9066         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9067         Hari was right, why extra method.
9068
9069 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9070
9071         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9072
9073 2004-05-20  Martin Baulig  <martin@ximian.com>
9074
9075         * delegate.cs: Convert this file to Unix mode - like the original
9076         version in mcs is.
9077
9078 2004-05-20  Martin Baulig  <martin@ximian.com>
9079
9080         * attribute.cs: Convert this file to Unix mode - like the original
9081         version in mcs is.
9082
9083 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
9084
9085        Fix bug #58688 (MCS does not report error when the same attribute
9086        is assigned twice)
9087
9088        * attribute.cs (Attribute.Emit): Distinction between null and default.
9089
9090 2004-05-19  Raja R Harinath  <rharinath@novell.com>
9091
9092        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9093        of a top-level attribute without an attribute target.
9094        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
9095        Make non-static.
9096        (Attribute.Conditional_GetConditionName), 
9097        (Attribute.Obsolete_GetObsoleteMessage): Update.
9098        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
9099        part of ScanForIndexerName.
9100        (Attribute.CanIgnoreInvalidAttribute): New function.
9101        (Attribute.ScanForIndexerName): Move to ...
9102        (Attributes.ScanForIndexerName): ... here.
9103        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9104        (Attributes.Search): New internal variant that can choose not to
9105        complain if types aren't resolved.  The original signature now
9106        complains.
9107        (Attributes.GetClsCompliantAttribute): Use internal variant, with
9108        complaints suppressed.
9109        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9110        only if it not useful.
9111        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9112        top-level for attributes that are shared between the assembly
9113        and a top-level class.
9114        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9115        * class.cs: Update to reflect changes.
9116        (DefineIndexers): Fuse loops.
9117        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
9118        a couple more variants of attribute names.
9119
9120 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
9121
9122         Fix bug #52585 (Implemented explicit attribute declaration)
9123
9124         * attribute.cs:
9125         (Attributable.ValidAttributeTargets): New abstract method. It gets
9126         list of valid attribute targets for explicit target declaration.
9127         (Attribute.Target): It holds target itself.
9128         (AttributeSection): Removed.
9129         (Attribute.CheckTargets): New method. It checks whether attribute
9130         target is valid for the current element.
9131
9132         * class.cs:
9133         (EventProperty): New class. For events that are declared like
9134         property (with add and remove accessors).
9135         (EventField): New class. For events that are declared like field.
9136         class.cs
9137
9138         * cs-parser.jay: Implemented explicit attribute target declaration.
9139
9140         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
9141         Override ValidAttributeTargets.
9142
9143         * parameter.cs:
9144         (ReturnParameter): Class for applying custom attributes on 
9145         the return type.
9146         (ParameterAtribute): New class. Class for applying custom
9147         attributes on the parameter type.
9148
9149 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
9150
9151         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9152         definitions. 
9153
9154         (Method): Allow UNSAFE here.
9155
9156         * modifiers.cs: Support unsafe reporting.
9157
9158 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
9159
9160         * decl.cs: Fix bug #58478.
9161
9162 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9163
9164         * statement.cs: When checking for unreachable code on an EmptyStatement,
9165         set the location. Fixes bug #58488.
9166
9167 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
9168
9169         * driver.cs: Add -pkg handling.
9170
9171         From Gonzalo: UseShelLExecute=false
9172
9173 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
9174
9175         * attribute.cs:
9176         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9177         for attribute.
9178         (Attribute.IsClsCompliaceRequired): Moved to base for better
9179         accesibility.
9180         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9181         when attribute is AttributeUsageAttribute.
9182         (Attribute.GetValidTargets): Simplified.
9183         (Attribute.GetAttributeUsage): New method returns AttributeUsage
9184         attribute for this type.
9185         (Attribute.ApplyAttributes): Method renamed to Emit and make
9186         non-static.
9187         (GlobalAttributeSection): New class for special handling of global
9188         attributes (assembly, module).
9189         (AttributeSection.Emit): New method.
9190
9191         * class.cs: Implemented Attributable abstract methods.
9192         (MethodCore.LabelParameters): Moved to Parameter class.
9193         (Accessor): Is back simple class.
9194         (PropertyMethod): Implemented Attributable abstract class.
9195         (DelegateMethod): Implemented Attributable abstract class.
9196         (Event): New constructor for disctintion between normal Event
9197         and Event with accessors.
9198
9199         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9200
9201         * codegen.cs, const.cs, decl.cs, delegate.cs:
9202         (CommonAssemblyModulClass): Implemented Attributable abstract class
9203         and simplified.
9204
9205         * enum.cs: Implement IAttributeSupport interface.
9206         (EnumMember): New class for emum members. Implemented Attributable
9207         abstract class
9208
9209         * parameter.cs:
9210         (ParameterBase): Is abstract.
9211         (ReturnParameter): New class for easier [return:] attribute handling.
9212
9213         * typemanager.cs: Removed builder_to_attr.
9214
9215 2004-05-11  Raja R Harinath  <rharinath@novell.com>
9216
9217         Fix bug #57151.
9218         * attribute.cs (Attribute.GetPositionalValue): New function.
9219         * class.cs (TypeContainer.VerifyMembers): New function.
9220         (TypeContainer.Emit): Use it.
9221         (ClassOrStruct): New base class for Class and Struct.
9222         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
9223         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9224         class.
9225         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9226         then each non-static field should have a FieldOffset attribute.
9227         Otherwise, none of the fields should have a FieldOffset attribute.
9228         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
9229         and FieldOffset attributes.
9230         * typemanager.cs (TypeManager.struct_layout_attribute_type)
9231         (TypeManager.field_offset_attribute_type): New core types.
9232         (TypeManager.InitCoreTypes): Initialize them.
9233
9234 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
9235
9236         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9237         Return correct type.
9238         From bug #58270.
9239
9240 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
9241
9242         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9243         be implicitly converted to ulong.
9244         
9245         * expression.cs: The logic for allowing operator &, | and ^ worked
9246         was wrong, it worked before because we did not report an error in
9247         an else branch.  Fixes 57895.
9248
9249         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9250         allow volatile fields to be reference types.
9251
9252 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
9253
9254         * driver.cs: Add support for /debug-
9255
9256 2004-05-07  Raja R Harinath  <rharinath@novell.com>
9257
9258         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
9259         Add a 'complain' parameter to silence errors.
9260         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
9261         silently overlooked type-resolutions.
9262         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9263         to reflect changes.
9264         (Attributes.Search): New function.
9265         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9266         (Attributes.GetAttributeFullName): Remove hack.
9267         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
9268         Update to reflect changes.
9269         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9270         Use Attributes.Search instead of nested loops.
9271
9272 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
9273
9274         * decl.cs:
9275         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9276         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9277         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9278
9279         * report.cs: (Report.Warning): Renamed to Warning_T because of
9280         parameter collision.
9281
9282 2004-05-05  Raja R Harinath  <rharinath@novell.com>
9283
9284         * expression.cs (MemberAccess.ResolveMemberAccess):
9285         Exit with non-zero status after Report.Error.
9286         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9287         Likewise.
9288         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9289
9290 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9291
9292         * support.cs: Don't hang when the file is empty.
9293
9294 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9295
9296         * support.cs: In SeekableStreamReader, compute the preamble size of the
9297           underlying stream. Position changes should take into account that initial
9298           count of bytes.
9299
9300 2004-05-03  Todd Berman  <tberman@sevenl.net>
9301
9302         * driver.cs: remove unused GetSysVersion function.
9303
9304 2004-05-03  Todd Berman  <tberman@sevenl.net>
9305
9306         * driver.cs: Remove the hack from saturday, as well as the hack
9307         from jackson (LoadAssemblyFromGac), also adds the CWD to the
9308         link_paths to get that bit proper.
9309
9310 2004-05-01  Todd Berman  <tberman@sevenl.net>
9311
9312         * driver.cs: Try a LoadFrom before a Load, this checks the current
9313         path. This is currently a bug in mono that is be fixed, however, this
9314         provides a workaround for now. This will be removed when the bug
9315         is fixed.
9316
9317 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
9318
9319         * CryptoConvert.cs: Updated to latest version. Fix issue with 
9320         incomplete key pairs (#57941).
9321
9322 2004-05-01  Todd Berman  <tberman@sevenl.net>
9323
9324         * driver.cs: Remove '.' from path_chars, now System.* loads properly
9325         from the GAC
9326
9327 2004-04-30  Jackson Harper  <jackson@ximian.com>
9328
9329         * codegen.cs: Open keys readonly.
9330         
9331 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9332
9333         * typemanager.cs: don't report cyclic struct layout when a struct
9334         contains 2 or more fields of the same type. Failed for Pango.AttrShape
9335         which has 2 Pango.Rectangle fields.
9336
9337 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9338
9339         * expression.cs: Handle IntPtr comparisons with IL code
9340         rather than a method call.
9341
9342 2004-04-29  Martin Baulig  <martin@ximian.com>
9343
9344         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
9345         the list of PropertyInfo's in class hierarchy and find the
9346         accessor.  Fixes #56013.
9347
9348 2004-04-29  Martin Baulig  <martin@ximian.com>
9349
9350         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9351
9352 2004-04-29  Martin Baulig  <martin@ximian.com>
9353
9354         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9355
9356         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9357
9358 2004-04-29  Martin Baulig  <martin@ximian.com>
9359
9360         * class.cs (ConstructorInitializer.Resolve): Check whether the
9361         parent .ctor is accessible.  Fixes #52146.
9362
9363 2004-04-29  Martin Baulig  <martin@ximian.com>
9364
9365         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9366
9367         * statement.cs (Using.EmitLocalVariableDecls): Use
9368         TypeManager.idisposable_type, not typeof (IDisposable).
9369         (Foreach.EmitCollectionForeach): Added support for valuetypes.
9370
9371 2004-04-29  Martin Baulig  <martin@ximian.com>
9372
9373         * class.cs (Event.Define): Don't emit the field and don't set
9374         RTSpecialName and SpecialName for events on interfaces.  Fixes
9375         #57703. 
9376
9377 2004-04-29  Raja R Harinath  <rharinath@novell.com>
9378
9379         Refactor Attribute.ApplyAttributes.
9380         * attribute.cs (Attributable): New base class for objects that can
9381         have Attributes applied on them.
9382         (Attribute): Make AttributeUsage fields public.
9383         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9384         (Attribute.IsInternalCall): New property.
9385         (Attribute.UsageAttr): Convert to a public read-only property.
9386         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9387         (Attribute.ResolveType, Attribute.Resolve)
9388         (Attribute.ScanForIndexerName): Update to reflect changes.
9389         (Attribute.CheckAttributeTarget): Re-format.
9390         (Attribute.ApplyAttributes): Refactor, to various
9391         Attributable.ApplyAttributeBuilder methods.
9392         * decl.cs (MemberCore): Make Attributable.
9393         * class.cs (Accessor): Make Attributable.
9394         (MethodData.ApplyAttributes): Use proper attribute types, not
9395         attribute names.
9396         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9397         (TypeContainer.ApplyAttributeBuilder)
9398         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9399         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
9400         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9401         (Operator.ApplyAttributeBuilder): New factored-out methods.
9402         * const.cs (Const.ApplyAttributeBuilder): Likewise.
9403         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9404         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9405         * parameter.cs (ParameterBase): New Attributable base class
9406         that can also represent Return types.
9407         (Parameter): Update to the changes.
9408
9409 2004-04-29  Jackson Harper  <jackson@ximian.com>
9410
9411         * driver.cs: Prefer the corlib system version when looking for
9412         assemblies in the GAC. This is still a hack, but its a better hack
9413         now.
9414         
9415 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
9416
9417         * decl.cs, enum.cs: Improved error 3005 reporting.
9418   
9419         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9420         (related_symbols): New private member for list of symbols
9421         related to reported error/warning.
9422         
9423         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9424
9425 2004-04-29  Martin Baulig  <martin@ximian.com>
9426
9427         * ecore.cs (Expression.Constantify): If we're an enum and
9428         TypeManager.TypeToCoreType() doesn't give us another type, use
9429         t.UnderlyingSystemType.  Fixes #56178.  
9430
9431 2004-04-29  Martin Baulig  <martin@ximian.com>
9432
9433         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9434         interfaces and for each interface, only add members directly
9435         declared in that interface.  Fixes #53255.
9436
9437 2004-04-28  Martin Baulig  <martin@ximian.com>
9438
9439         * expression.cs (ConditionalLogicalOperator): Use a temporary
9440         variable for `left' to avoid that we evaluate it more than once;
9441         bug #52588.
9442
9443 2004-04-28  Martin Baulig  <martin@ximian.com>
9444
9445         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9446         `void[]' (CS1547).
9447
9448 2004-04-28  Martin Baulig  <martin@ximian.com>
9449
9450         * statement.cs (LocalInfo.Resolve): Check whether the type is not
9451         void (CS1547).
9452
9453         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9454         whether the type is not void (CS1547).
9455
9456 2004-04-28  Martin Baulig  <martin@ximian.com>
9457
9458         * expression.cs (Unary.DoResolveLValue): Override this and report
9459         CS0131 for anything but Operator.Indirection.
9460
9461 2004-04-28  Martin Baulig  <martin@ximian.com>
9462
9463         Committing a patch from Ben Maurer; see bug #50820.
9464
9465         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9466         check for classes.
9467
9468         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9469         classes.        
9470
9471 2004-04-28  Martin Baulig  <martin@ximian.com>
9472
9473         Committing a patch from Ben Maurer; see bug #50820.
9474
9475         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9476         check for classes.
9477
9478         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9479         classes.        
9480
9481 2004-04-28  Martin Baulig  <martin@ximian.com>
9482
9483         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9484         (Block.AddLabel): Call DoLookupLabel() to only search in the
9485         current block.
9486
9487 2004-04-28  Martin Baulig  <martin@ximian.com>
9488
9489         * cfold.cs (ConstantFold.BinaryFold): Added special support for
9490         comparing StringConstants and NullLiterals in Equality and Inequality.
9491
9492 2004-04-28  Jackson Harper  <jackson@ximian.com>
9493
9494         * driver.cs: Attempt to load referenced assemblies from the
9495         GAC. This is the quick and dirty version of this method that
9496         doesnt take into account versions and just takes the first
9497         canidate found. Will be good enough for now as we will not have more
9498         then one version installed into the GAC until I update this method.
9499
9500 2004-04-28  Martin Baulig  <martin@ximian.com>
9501
9502         * typemanager.cs (TypeManager.CheckStructCycles): New public
9503         static method to check for cycles in the struct layout.
9504
9505         * rootcontext.cs (RootContext.PopulateTypes): Call
9506         TypeManager.CheckStructCycles() for each TypeContainer.
9507         [Note: We only need to visit each type once.]
9508
9509 2004-04-28  Martin Baulig  <martin@ximian.com>
9510
9511         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9512
9513         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9514         success and added `out object value'.  Use a `bool resolved' field
9515         to check whether we've already been called rather than
9516         `ConstantValue != null' since this breaks for NullLiterals.
9517
9518 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9519
9520         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9521         setting of this flag, since the 'set' method may be non-public.
9522
9523 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9524
9525         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9526         check on current_vector.Block.
9527
9528 2004-04-27  Martin Baulig  <martin@ximian.com>
9529
9530         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9531         a field initializer.  Fixes #56459.
9532
9533 2004-04-27  Martin Baulig  <martin@ximian.com>
9534
9535         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9536         we're not attempting to use an indexer.  Fixes #52154.
9537
9538 2004-04-27  Martin Baulig  <martin@ximian.com>
9539
9540         * statement.cs (Return): Don't create a return label if we don't
9541         need it; reverts my change from January 20th.  Thanks to Ben
9542         Maurer for this.
9543
9544 2004-04-27  Martin Baulig  <martin@ximian.com>
9545
9546         According to the spec, `goto' can only leave a nested scope, but
9547         never enter it.
9548
9549         * statement.cs (Block.LookupLabel): Only lookup in the current
9550         block, don't recurse into parent or child blocks.
9551         (Block.AddLabel): Check in parent and child blocks, report
9552         CS0140/CS0158 if we find a duplicate.
9553         (Block): Removed this indexer for label lookups.
9554         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9555         this already does the error reporting for us.
9556
9557         * flowanalysis.cs
9558         (FlowBranching.UsageVector.Block): New public variable; may be null.
9559         (FlowBranching.CreateSibling): Added `Block' argument.
9560         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
9561         label for the target of a `goto' and check whether we're not
9562         leaving a `finally'.
9563
9564 2004-04-27  Martin Baulig  <martin@ximian.com>
9565
9566         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9567         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9568         just for returns).
9569
9570 2004-04-27  Martin Baulig  <martin@ximian.com>
9571
9572         * statement.cs (Block.AddLabel): Also check for implicit blocks
9573         and added a CS0158 check.
9574
9575 2004-04-27  Martin Baulig  <martin@ximian.com>
9576
9577         * flowanalysis.cs (FlowBranchingLoop): New class.
9578         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9579         UsageVector's instead of an ArrayList.
9580         (FlowBranching.Label): Likewise.
9581         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9582         (FlowBranching.AddBreakVector): New method.
9583
9584 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
9585
9586         * attribute.cs: Small regression fix: only convert the type if we
9587         the type is different, fixes System.Drawing build.
9588
9589 2004-04-27  Martin Baulig  <martin@ximian.com>
9590
9591         * attribute.cs (Attribute.Resolve): If we have a constant value
9592         for a named field or property, implicity convert it to the correct
9593         type.
9594
9595 2004-04-27  Raja R Harinath  <rharinath@novell.com>
9596
9597         * statement.cs (Block.Block): Implicit blocks share
9598         'child_variable_names' fields with parent blocks.
9599         (Block.AddChildVariableNames): Remove.
9600         (Block.AddVariable): Mark variable as "used by a child block" in
9601         every surrounding block.
9602         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9603         been used in a child block, complain about violation of "Invariant
9604         meaning in blocks" rule.
9605         * cs-parser.jay (declare_local_variables): Don't use
9606         AddChildVariableNames.
9607         (foreach_statement): Don't create an implicit block: 'foreach'
9608         introduces a scope.
9609
9610 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
9611
9612         * convert.cs (ImplicitNumericConversion): 0 is also positive when
9613         converting from 0L to ulong.  Fixes 57522.
9614
9615 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9616
9617         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9618         derived class hides via 'new' keyword field from base class (test-242.cs).
9619         TODO: Handle this in the more general way.
9620         
9621         * class.cs (CheckBase): Ditto.
9622
9623 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9624
9625         * decl.cs (caching_flags): New member for storing cached values
9626         as bit flags.
9627         (MemberCore.Flags): New enum where bit flags for caching_flags
9628         are defined.
9629         (MemberCore.cls_compliance): Moved to caching_flags.
9630         (DeclSpace.Created): Moved to caching_flags.
9631
9632         * class.cs: Use caching_flags instead of DeclSpace.Created
9633         
9634 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
9635
9636         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9637         if we are only a derived class, not a nested class.
9638
9639         * typemanager.cs: Same as above, but do this at the MemberLookup
9640         level (used by field and methods, properties are handled in
9641         PropertyExpr).   Allow for the qualified access if we are a nested
9642         method. 
9643
9644 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
9645
9646         * class.cs: Refactoring.
9647         (IMethodData): New inteface; Holds links to parent members
9648         to avoid member duplication (reduced memory allocation).
9649         (Method): Implemented IMethodData interface.
9650         (PropertyBase): New inner classes for get/set methods.
9651         (PropertyBase.PropertyMethod): Implemented IMethodData interface
9652         (Event): New inner classes for add/remove methods.
9653         (Event.DelegateMethod): Implemented IMethodData interface.
9654
9655         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9656         EmitContext (related to class.cs refactoring).
9657
9658 2004-04-21  Raja R Harinath  <rharinath@novell.com>
9659
9660         * delegate.cs (Delegate.VerifyApplicability): If the number of
9661         arguments are the same as the number of parameters, first try to
9662         verify applicability ignoring  any 'params' modifier on the last
9663         parameter.
9664         Fixes #56442.
9665
9666 2004-04-08  Martin Baulig  <martin@ximian.com>
9667
9668         Merged latest changes into gmcs.  Please keep this comment in
9669         here, it makes it easier for me to see what changed in MCS since
9670         the last time I merged.
9671
9672 2004-04-16  Raja R Harinath  <rharinath@novell.com>
9673
9674         * class.cs (TypeContainer.AddIndexer): Use
9675         'ExplicitInterfaceName' to determine if interface name was
9676         explicitly specified.  'InterfaceType' is not initialized at this time.
9677         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
9678         Indexers array is already in the required order.  Initialize
9679         'IndexerName' only if there are normal indexers.
9680         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
9681         (TypeContainer.Emit): Emit DefaultMember attribute only if
9682         IndexerName is initialized.
9683         Fixes #56300.
9684
9685 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
9686
9687         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
9688         Fixes #57007
9689
9690 2004-04-15  Raja R Harinath  <rharinath@novell.com>
9691
9692         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
9693         attributes.
9694         Fix for #56456.
9695
9696         * attribute.cs (Attribute.Resolve): Check for duplicate named
9697         attributes.
9698         Fix for #56463.
9699
9700 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
9701
9702         * iterators.cs (MarkYield): track whether we are in an exception,
9703         and generate code accordingly.  Use a temporary value to store the
9704         result for our state.
9705
9706         I had ignored a bit the interaction of try/catch with iterators
9707         since their behavior was not entirely obvious, but now it is
9708         possible to verify that our behavior is the same as MS .NET 2.0
9709
9710         Fixes 54814
9711
9712 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
9713
9714         * iterators.cs: Avoid creating temporaries if there is no work to
9715         do. 
9716
9717         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
9718         Enumerations, use TypeManager.EnumToUnderlying and call
9719         recursively. 
9720
9721         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
9722         bug #57013
9723
9724         (This.Emit): Use EmitContext.EmitThis to emit our
9725         instance variable.
9726
9727         (This.EmitAssign): Ditto.
9728
9729         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
9730         codepaths, we will move all the functionality into
9731         Mono.CSharp.This 
9732
9733         (FieldExpr.EmitAssign): Ditto.
9734
9735         This fixes several hidden bugs that I uncovered while doing a code
9736         review of this today.
9737
9738         * codegen.cs (EmitThis): reworked so the semantics are more clear
9739         and also support value types "this" instances.
9740
9741         * iterators.cs: Changed so that for iterators in value types, we
9742         do not pass the value type as a parameter.  
9743
9744         Initialization of the enumerator helpers is now done in the caller
9745         instead of passing the parameters to the constructors and having
9746         the constructor set the fields.
9747
9748         The fields have now `assembly' visibility instead of private.
9749
9750 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
9751
9752         * expression.cs (Argument.Resolve): Check if fields passed as ref
9753         or out are contained in a MarshalByRefObject.
9754
9755         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
9756         another compiler type.
9757
9758 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
9759
9760         * class.cs (Indexer.Define): use the new name checking method.
9761         Also, return false on an error.
9762         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
9763         (is_identifier_[start/part]_character): make static.
9764
9765 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
9766
9767         * expression.cs (Binary.ResolveOperator): Do no append strings
9768         twice: since we can be invoked more than once (array evaluation)
9769         on the same concatenation, take care of this here.  Based on a fix
9770         from Ben (bug #56454)
9771
9772 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
9773
9774         * codegen.cs: Fix another case where CS1548 must be reported (when 
9775         delay-sign isn't specified and no private is available #56564). Fix
9776         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
9777         error when MCS is used on the MS runtime and we need to delay-sign 
9778         (which seems unsupported by AssemblyBuilder - see #56621).
9779
9780 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
9781
9782         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
9783         (TypeManager.ComputeNamespaces): Faster implementation for
9784         Microsoft runtime.
9785
9786         * compiler.csproj: Updated AssemblyName to mcs.
9787
9788 2004-05-11  Jackson Harper  <jackson@ximian.com>
9789
9790         * Makefile: Preserve MONO_PATH
9791         
9792 2004-05-11  Jackson Harper  <jackson@ximian.com>
9793
9794         * Makefile: Use mono and mcs to build gmcs
9795         
9796 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
9797
9798         * codegen.cs: Add patch from Robert Shade
9799         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
9800         sync with mcs.
9801
9802 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
9803
9804         * CryptoConvert.cs: Updated to latest version. Fix issue with 
9805         incomplete key pairs (#57941).
9806
9807 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
9808
9809         * codegen.cs: Fix another case where CS1548 must be reported (when 
9810         delay-sign isn't specified and no private is available #56564). Fix
9811         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
9812         error when MCS is used on the MS runtime and we need to delay-sign 
9813         (which seems unsupported by AssemblyBuilder - see #56621).
9814
9815 2004-04-29  Jackson Harper  <jackson@ximian.com>
9816
9817         * Makefile: Set MONO_PATH to use the bootstrap corlib
9818         * driver.cs: Check the GAC for referenced assemblies.
9819                 
9820 2004-04-29  Martin Baulig  <martin@ximian.com>
9821
9822         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
9823
9824 2004-04-07  Martin Baulig  <martin@ximian.com>
9825
9826         * expression.cs (Binary.ResolveOperator): Added special case for
9827         Equality/Inequality between a type parameter and a null literal.
9828
9829 2004-04-07  Martin Baulig  <martin@ximian.com>
9830
9831         * convert.cs: Check null literal -> type parameter conversions.
9832
9833 2004-04-07  Martin Baulig  <martin@ximian.com>
9834
9835         * generic.cs (ConstructedType.CheckConstraints): Enforce the
9836         `class' and `struct' constraints.
9837
9838 2004-04-07  Martin Baulig  <martin@ximian.com>
9839
9840         * generic.cs (SpecialConstraint): New public enum.
9841         (Constraints.Resolve): Added support for the `class' and `struct'
9842         constraints.
9843
9844         * cs-parser.jay (type_parameter_constraint): Added support for the
9845         `class' and `struct' constraints.
9846
9847 2004-04-07  Martin Baulig  <martin@ximian.com>
9848
9849         * support.cs (GenericConstraints): Replaced `Types' by
9850         `ClassConstraint' and `InterfaceConstraints'; added
9851         `HasClassConstraint'.   
9852
9853 2004-04-07  Martin Baulig  <martin@ximian.com>
9854
9855         * generic.cs
9856         (Constraints.InterfaceConstraints): New public property.
9857         (Constraints.Types): Make this property public
9858         (TypeParameter): Implement IMemberContainer.
9859         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
9860         instead of a TypeBuilder/MethodBuilder; pass the interface
9861         constraints to TypeManager.AddTypeParameter().
9862         (TypeParameter.DefineType): Just take an EmitContext and no
9863         TypeBuilder/MethodBuilder.  Use the new public API.
9864
9865         * typemanager.cs (TypeManager.AddTypeParameter): Added
9866         `TypeExpr[]' argument; add the interfaces to the
9867         `builder_to_ifaces' hash.
9868         (TypeManager.LookupMemberContainer): For
9869         GenericTypeParameterBuilders, get the TypeParameter from the
9870         `builder_to_type_param'.
9871         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
9872         the TypeParameter and call FindMembers on it.
9873
9874 2004-04-07  Martin Baulig  <martin@ximian.com>
9875
9876         * class.cs
9877         (MethodCore.GenericMethod): Moved this field here from Method.
9878         (MethodCore.IsDuplicateImplementation): Take the number of type
9879         parameters into account if we're a generic method.
9880
9881         * expression.cs (Invocation.InferTypeArguments): Don't return true
9882         if `arguments' is null; we still need to check whether we actually
9883         don't need to infer anything in this case.
9884         (MemberAccess): Merged the functionality from GenericMemberAccess
9885         into this class.
9886
9887         * generic.cs (GenericMemberAccess): Removed.
9888
9889 2004-04-05  Martin Baulig  <martin@ximian.com>
9890
9891         * decl.cs (MemberCore): For generic classes, interfaces and
9892         structs, `Name' now includes the number of type parameters
9893         ("Stack!1.Node!1").
9894         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
9895         encode the number of type arguments in the type name.
9896
9897         * expression.cs (Expression.MemberLookup): Removed the
9898         `num_type_args' argument; we now encode the number of type
9899         arguments in the type name.
9900
9901         * ecore.cs (SimpleName): Encode the number of type arguments in
9902         the type name itself.
9903
9904         * generic.cs (ConstructedType): Likewise.
9905
9906         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
9907         `MemberName'; we now include the number of type parameters in the
9908         type name.
9909
9910         * typemanager.cs (TypeManager.CheckGeneric): Removed.
9911         (TypeManager.MemberLookup): Removed the
9912         `num_type_args' argument; we now encode the number of type
9913         arguments in the type name.     
9914
9915 2004-04-03  Martin Baulig  <martin@ximian.com>
9916
9917         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
9918         (MemberCore.MemberName): Moved here from MemberBase.
9919         (DeclSpace.SetParameterInfo): Just take the constraints as an
9920         ArrayList; we already have the type parameters in our
9921         `MemberName'; also do the CS0080 reporting here.
9922
9923         * cs-parser.jay (struct_declaration): Use `member_name' instead of
9924         `IDENTIFIER opt_type_parameter_list'; when constructing our
9925         `MemberName', it'll already include our type parameters.
9926         (class_declaration, interface_declaration): Likewise.
9927         (delegate_declaration): Likewise.
9928         (MakeName): Take a MemberName and return a MemberName.
9929         The following two changes are required to avoid shift/reduce conflicts:
9930         (member_name): Don't include a TypeName anymore; ie. this is now
9931         just 'IDENTIFIER opt_type_parameter_list'.
9932         (property_declaration, event_declaration): Use a
9933         `namespace_or_type_name' instead of a `member_name'.            
9934
9935 2004-04-03  Martin Baulig  <martin@ximian.com>
9936
9937         * decl.cs (MemberName): Renamed to `TypeName' and created a new
9938         `MemberName' class.
9939         (TypeName): Formerly known as MemberName.
9940
9941         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
9942         instead of a `MemberName'.
9943
9944         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
9945         (member_name): New rule; create a MemberName.
9946
9947 2004-04-02  Martin Baulig  <martin@ximian.com>
9948
9949         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
9950         (CS0305 and CS0308).
9951
9952 2004-04-02  Martin Baulig  <martin@ximian.com>
9953
9954         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
9955         support for nested types.
9956
9957 2004-04-02  Martin Baulig  <martin@ximian.com>
9958
9959         * ecore.cs (IAlias): New public interface.
9960         (TypeExpr, TypeExpression): Implement IAlias.
9961         (TypeAliasExpression): New public class.
9962
9963         * namespace.cs (Namespace): Implement IAlias.
9964         (Namespace.Lookup): Return an IAlias instead on an object.
9965         (Namespace.DefineName): Take an IAlias instead of an object.
9966         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
9967         an object.
9968         (NamespaceEntry.UsingAlias): Take a Membername instead of an
9969         Expression.
9970         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
9971         object.
9972         (NamespaceEntry.Lookup): Likewise.
9973
9974         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
9975         instead of a Type.      
9976
9977         * decl.cs (DeclSpace): Implement IAlias.
9978         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
9979
9980         * generic.cs (ConstructedType): Improved error checking.
9981
9982 2004-04-02  Martin Baulig  <martin@ximian.com>
9983
9984         * convert.cs: Added type parameter conversions.
9985
9986         * ecore.cs
9987         (UnboxCast.Emit): Emit an `unbox.any' for type params.
9988         (ClassCast.Emit): If the source type is a type parameter, box it.
9989         If the target type is a type parameter, emit an `unbox.any'
9990         instead of a `classcast'.1      
9991
9992 2004-04-01  Martin Baulig  <martin@ximian.com>
9993
9994         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
9995
9996 2004-04-01  Martin Baulig  <martin@ximian.com>
9997
9998         * generic.cs (ConstructedType.CheckConstraints): Use
9999         Convert.ImplicitStandardConversionExists(); user-defined implicit
10000         conversions are not allowed according to the spec.
10001
10002 2004-03-30  Martin Baulig  <martin@ximian.com>
10003
10004         * expression.cs (New): Added support for type parameters.
10005
10006         * typemanager.cs
10007         (TypeManager.activator_type): New public static field.
10008         (TypeManager.activator_create_instance): Likewise.
10009
10010 2004-03-30  Martin Baulig  <martin@ximian.com>
10011
10012         * typemanager.cs (TypeManager.HasConstructorConstraint): New
10013         public method.
10014
10015 2004-03-30  Martin Baulig  <martin@ximian.com>
10016
10017         * generic.cs (ConstructedType.CheckConstraints): Actually follow
10018         the spec here: the argument type must be convertible to the
10019         constraints.
10020
10021 2004-03-30  Martin Baulig  <martin@ximian.com>
10022
10023         * generic.cs
10024         (TypeParameter.Define, TypeParameter.DefineMethod): Call
10025         TypeManager.AddTypeParameter().
10026         (ConstructedType.CheckConstraints): Re-enable this and actually
10027         check whether we have a constructor constraint.
10028
10029         * typemanager.cs
10030         (TypeManager.builder_to_type_param): New static field.
10031         (TypeManager.AddTypeParameter): New static method.
10032         (TypeManager.LookupTypeParameter): New public method.
10033
10034 2004-03-30  Martin Baulig  <martin@ximian.com>
10035
10036         * generic.cs (TypeParameter.DefineType): Return a boolean and use
10037         the new API to actually define the constructor constraint.
10038
10039         * typemanager.cs
10040         (TypeManager.new_constraint_attr_type): New static field.
10041         (TypeManager.InitCoreTypes): Initialize it.
10042
10043 2004-03-30  Martin Baulig  <martin@ximian.com>
10044
10045         * generic.cs (Constraints): Completed error checking, use correct
10046         error numbers.
10047
10048 2004-03-29  Martin Baulig  <martin@ximian.com>
10049
10050         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
10051
10052         * expression.cs (Invocation.InferTypeArguments): Added overloaded
10053         public version which takes a `ParameterData pd' instead of an
10054         `ArrayList args'.
10055
10056 2004-03-29  Martin Baulig  <martin@ximian.com>
10057
10058         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
10059         not a MethodInfo.       
10060
10061 2004-03-29  Martin Baulig  <martin@ximian.com>
10062
10063         * expression.cs (Argument.ResolveMethodGroup): If we're a
10064         ConstructedType, call GetMemberAccess() on it.  
10065
10066 2004-03-29  Martin Baulig  <martin@ximian.com>
10067
10068         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
10069         (MethodCore.CheckGenericOverride): When overriding a generic
10070         method, check whether the constraints match.
10071
10072         * support.cs (GenericConstraints): New public interface.
10073         (ParameterData.GenericConstraints): New public method.
10074
10075         * parameter.cs (Parameter.Resolve): Check whether we're a generic
10076         method parameter and compute our constraints if appropriate.
10077         (Parameter.GenericConstraints): New public property.
10078
10079         * generic.cs (Constraints): Implement GenericConstraints.
10080
10081 2004-03-29  Martin Baulig  <martin@ximian.com>
10082
10083         * decl.cs (MemberCache.FindMemberToOverride): Use
10084         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
10085
10086 2004-03-29  Martin Baulig  <martin@ximian.com>
10087
10088         * generic.cs (GenericMethod.Define): Resolve our type parameters.
10089
10090 2004-03-29  Martin Baulig  <martin@ximian.com>
10091
10092         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
10093         not allowed on non-generic declarations").
10094
10095 2004-03-29  Martin Baulig  <martin@ximian.com>
10096
10097         * expression.cs (Invocation.InferTypeArguments): Added overloaded
10098         public version of this method.
10099
10100         * class.cs (MethodCore.IsDuplicateImplementation): Use
10101         Invocation.InferTypeArguments() to check this.
10102
10103 2004-03-29  Martin Baulig  <martin@ximian.com>
10104
10105         * convert.cs: Use TypeManager.IsDelegateType() instead of
10106         comparing types correctly.
10107
10108 2004-03-29  Martin Baulig  <martin@ximian.com>
10109
10110         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
10111         types directly to make it work for generic instances.
10112
10113         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
10114
10115 2004-03-29  Martin Baulig  <martin@ximian.com>
10116
10117         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
10118         support for arrays.     
10119
10120 2004-03-24  Martin Baulig  <martin@ximian.com>
10121
10122         * decl.cs (DeclSpace.FindType): Also use
10123         TypeManager.CheckGeneric() for types from the using clauses.
10124
10125 2004-03-23  Martin Baulig  <martin@ximian.com>
10126
10127         * expression.cs (Invocation.OverloadResolve): Added `bool
10128         may_fail' argument and use it instead of the Location.IsNull() hack.
10129
10130 2004-03-23  Martin Baulig  <martin@ximian.com>
10131
10132         * expression.cs (Invocation.InferType): Use correct type inference
10133         rules here.     
10134
10135 2004-03-23  Martin Baulig  <martin@ximian.com>
10136
10137         * ecore.cs (MethodGroupExpr.Name): Use
10138         TypeManager.CSharpSignature() instead of just the name.
10139
10140         * expression.cs (Invocation.OverloadResolve): Provide better error
10141         reporting.
10142         (Invocation.DoResolve): OverloadResolve() never returns null
10143         without reporting an error, so removed the error -6 reporting here.
10144
10145 2004-03-23  Martin Baulig  <martin@ximian.com>
10146
10147         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
10148         generic methods.
10149
10150         * cs-parser.jay (delegate_declaration): Support generic delegates.
10151
10152         * delegate.cs: Support generic delegates.
10153
10154 2004-03-22  Martin Baulig  <martin@ximian.com>
10155
10156         * expression.cs (Invocation.InferParamsTypeArguments): New static
10157         method; does type inference for params arguments.
10158
10159 2004-03-21  Martin Baulig  <martin@ximian.com>
10160
10161         * typemanager.cs (TypeManager.IsGenericMethod): New public static
10162         method; checks whether a method is a generic method.    
10163
10164         * expression.cs (Invocation.InferTypeArguments): New static method;
10165         infer type arguments for generic method invocation.
10166
10167         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
10168         property; we set this to true if we're resolving a generic method
10169         invocation and the user specified type arguments, ie. we're not
10170         doing type inference.
10171
10172 2004-03-20  Martin Baulig  <martin@ximian.com>
10173
10174         * class.cs (MethodData.DeclaringType): New public property.
10175         (MethodData.Define): Set DeclaringType here.
10176         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
10177         instead of OperatorMethodBuilder.DeclaringType.
10178
10179 2004-03-20  Martin Baulig  <martin@ximian.com>
10180
10181         * cs-tokenizer.cs (xtoken): Return a special
10182         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
10183
10184         * cs-parser.jay (default_value_expression): Switch to the new
10185         syntax (14.5.13).
10186
10187 2004-03-19  Martin Baulig  <martin@ximian.com>
10188
10189         * decl.cs (MemberName): New class.  We use this to "construct"
10190         namespace_or_type_name's.
10191
10192         * generics.cs (TypeArguments.GetDeclarations): New public method;
10193         returns the type arguments as a string[] and reports a CS0081 if
10194         one of them is not an identifier.
10195
10196         * class.cs (MemberBase): The .ctor now takes the name as a
10197         MemberName instead of a string.
10198         (MemberBase.ExplicitInterfaceName): Changed type from string to
10199         Expression.
10200         (MemberBase.DoDefine): If we're an explicit implementation, the
10201         InterfaceType may be a generic instance.
10202
10203         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
10204         (namespace_name): Call MemberName.GetName () to transform the
10205         MemberName into a string and ensure we don't have any type
10206         arguments.
10207         (type_name): Call MemberName.GetTypeExpression() to transfrom the
10208         MemberName into an expression.
10209         (method_header): Use namespace_or_type_name instead of member_name.     
10210
10211 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
10212
10213         * rootcontext.cs: Add new types to the boot resolution.
10214
10215         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
10216         MulticastDelegate is not allowed.
10217
10218         * typemanager.cs: Add new types to lookup: System.TypedReference
10219         and ArgIterator.
10220
10221         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
10222         check for TypedReference or ArgIterator, they are not allowed. 
10223
10224         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
10225         makes us properly catch 1510 in some conditions (see bug 56016 for
10226         details). 
10227
10228 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
10229
10230         * CryptoConvert.cs: update from corlib version
10231         with endian fixes.
10232
10233 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
10234
10235         * class.cs (Indexer.Define): Check indexername declaration
10236
10237 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
10238
10239         * attribute.cs (IsClsCompliant): Fixed problem with handling
10240         all three states (compliant, not-compliant, undetected).
10241
10242 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
10243
10244         * attribute.cs (Attribute): Location is now public.
10245         (Resolve): Store resolved arguments (pos_values) in attribute class.
10246         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
10247         (GetClsCompliantAttributeValue): New method that gets
10248         CLSCompliantAttribute value.
10249         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
10250         if exists else null.
10251         (AttributeTester): New class for CLS-Compliant verification routines.
10252
10253         * class.cs (Emit): Add CLS-Compliant verification.
10254         (Method.GetSignatureForError): Implemented.
10255         (Constructor.GetSignatureForError): Implemented
10256         (Constructor.HasCompliantArgs): Returns if constructor has
10257         CLS-Compliant arguments.
10258         (Constructor.Emit): Override.
10259         (Construcor.IsIdentifierClsCompliant): New method; For constructors
10260         is needed to test only parameters.
10261         (FieldBase.GetSignatureForError): Implemented.
10262         (TypeContainer): New member for storing base interfaces.
10263         (TypeContainer.FindMembers): Search in base interfaces too.
10264
10265         * codegen.cs (GetClsComplianceAttribute): New method that gets
10266         assembly or module CLSCompliantAttribute value.
10267         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10268         for assembly.
10269         (ModuleClass.Emit): Add error 3012 test.
10270
10271         * const.cs (Emit): Override and call base for CLS-Compliant tests.
10272
10273         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10274         state for all decl types.
10275         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10276         if CLS-Compliant tests are required.
10277         (IsClsCompliaceRequired): New method. Analyze whether code
10278         must be CLS-Compliant.
10279         (IsExposedFromAssembly): New method. Returns true when MemberCore
10280         is exposed from assembly.
10281         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10282         value or gets cached value.
10283         (HasClsCompliantAttribute): New method. Returns true if MemberCore
10284         is explicitly marked with CLSCompliantAttribute.
10285         (IsIdentifierClsCompliant): New abstract method. This method is
10286         used to testing error 3005.
10287         (IsIdentifierAndParamClsCompliant): New method. Common helper method
10288         for identifier and parameters CLS-Compliant testing.
10289         (VerifyClsCompliance): New method. The main virtual method for
10290         CLS-Compliant verifications.
10291         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10292         null. I don't know why is null (too many public members !).
10293         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10294         and get value of first CLSCompliantAttribute that found.
10295
10296         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10297         (VerifyClsCompliance): Override and add extra tests.
10298
10299         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10300         clscheck- disable CLS-Compliant verification event if assembly is has
10301         CLSCompliantAttribute(true).
10302
10303         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10304         ApllyAttribute is now called in emit section as in the other cases.
10305         Possible future Emit integration.
10306         (IsIdentifierClsCompliant): New override.
10307         (VerifyClsCompliance): New override.
10308         (GetEnumeratorName): Returns full enum name.
10309
10310         * parameter.cs (GetSignatureForError): Implemented.
10311
10312         * report.cs (WarningData): New struct for Warning message information.
10313         (LocationOfPreviousError): New method.
10314         (Warning): New method. Reports warning based on the warning table.
10315         (Error_T): New method. Reports error based on the error table.
10316
10317         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10318         verifications are done here.
10319
10320         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10321
10322         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10323         CLSCompliantAttribute.
10324         (all_imported_types): New member holds all imported types from other
10325         assemblies.
10326         (LoadAllImportedTypes): New method fills static table with exported types
10327         from all referenced assemblies.
10328         (Modules): New property returns all assembly modules.
10329
10330 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
10331
10332         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10333         throwing a parser error.
10334
10335         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10336         which removes the hardcoded get_/set_ prefixes for properties, as
10337         IL allows for the properties to be named something else.  
10338
10339         Bug #56013
10340
10341         * expression.cs: Do not override operand before we know if it is
10342         non-null.  Fix 56207
10343
10344 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10345
10346         * typemanager.cs: support for pinned variables.
10347
10348 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10349
10350         * decl.cs, typemanager.cs: Avoid using an arraylist
10351         as a buffer if there is only one result set.
10352
10353 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10354
10355         * expression.cs: Make sure you cant call a static method
10356         with an instance expression, bug #56174.
10357
10358 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
10359
10360         * class.cs (IsDuplicateImplementation): Improve error reporting to
10361         flag 663 (method only differs in parameter modifier).
10362
10363         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10364         in preprocessor directives.
10365
10366         * location.cs (LookupFile): Allow for the empty path.
10367
10368         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
10369         better approach for some of that patch, but its failing with the
10370         CharSet enumeration.  For now try/catch will do.
10371
10372         * typemanager.cs: Do not crash if a struct does not have fields.
10373         Fixes 56150.
10374
10375 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10376
10377         * expression.cs: cs0213, cant fix a fixed expression.
10378         fixes 50231.
10379
10380 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10381
10382         * cs-parser.jay: detect invalid embeded statements gracefully.
10383         bug #51113.
10384
10385 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10386
10387         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10388         As a regex:
10389         s/
10390         the invocation type may not be a subclass of the tye of the item/
10391         The type of the item must be a subclass of the invocation item.
10392         /g
10393
10394         Fixes bug #50820.
10395
10396 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
10397
10398         * attribute.cs: Added methods to get a string and a bool from an
10399         attribute. Required to information from AssemblyKeyFileAttribute,
10400         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10401         * codegen.cs: Modified AssemblyName creation to include support for
10402         strongnames. Catch additional exceptions to report them as CS1548.
10403         * compiler.csproj: Updated include CryptoConvert.cs.
10404         * compiler.csproj.user: Removed file - user specific configuration.
10405         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
10406         Mono.Security assembly. The original class is maintained and tested in
10407         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10408         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10409         like CSC 8.0 (C# v2) supports.
10410         * Makefile: Added CryptoConvert.cs to mcs sources.
10411         * rootcontext.cs: Added new options for strongnames.
10412
10413 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
10414
10415         * driver.cs: For --expect-error, report error code `2'
10416         if the program compiled with no errors, error code `1' if
10417         it compiled with an error other than the one expected.
10418
10419 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
10420
10421         * compiler.csproj: Updated for Visual Studio .NET 2003.
10422         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10423         * compiler.sln: Updated for Visual Studio .NET 2003.
10424
10425 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
10426
10427         * expression.cs: Fix bug #47234. We basically need to apply the
10428         rule that we prefer the conversion of null to a reference type
10429         when faced with a conversion to 'object' (csc behaviour).
10430
10431 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10432
10433         * statement.cs: Shorter form for foreach, eliminates
10434         a local variable. r=Martin.
10435
10436 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10437
10438         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10439         checks if we can use brtrue/brfalse to test for 0.
10440         * expression.cs: use the above in the test for using brtrue/brfalse.
10441         cleanup code a bit.
10442
10443 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10444
10445         * expression.cs: Rewrite string concat stuff. Benefits:
10446
10447         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10448         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10449         rather than a concat chain.
10450
10451         * typemanager.cs: Add lookups for more concat overloads.
10452
10453 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10454
10455         * expression.cs: Emit shorter il code for array init.
10456
10457         newarr
10458         dup
10459         // set 1
10460
10461         // set 2
10462
10463         newarr
10464         stloc.x
10465
10466         ldloc.x
10467         // set 1
10468
10469         ldloc.x
10470         // set 2
10471
10472 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
10473
10474         * statement.cs: Before, two switch blocks would be merged if the
10475         total size of the blocks (end_item - begin_item + 1) was less than
10476         two times the combined sizes of the blocks.
10477
10478         Now, it will only merge if after the merge at least half of the
10479         slots are filled.
10480
10481         fixes 55885.
10482
10483 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
10484
10485         * class.cs : csc build fix for GetMethods(). See bug #52503.
10486
10487 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
10488
10489         * expression.cs: Make sure fp comparisons work with NaN.
10490         This fixes bug #54303. Mig approved this patch a long
10491         time ago, but we were not able to test b/c the runtime
10492         had a related bug.
10493
10494 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
10495
10496         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
10497
10498 2004-03-19  Martin Baulig  <martin@ximian.com>
10499
10500         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
10501         two overloads may unify for some type parameter substitutions and
10502         report a CS0408 if appropriate.
10503
10504 2004-03-19  Martin Baulig  <martin@ximian.com>
10505
10506         * class.cs (MemberCore.IsDuplicateImplementation): Report the
10507         error here and not in our caller.
10508
10509 2004-03-19  Martin Baulig  <martin@ximian.com>
10510
10511         * interface.cs: Completely killed this file.
10512         (Interface): We're now a TypeContainer and live in class.cs.
10513
10514         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
10515         argument; we're now also called for interfaces.
10516         (TypeContainer.DefineMembers): Allow this method being called
10517         multiple times.
10518         (TypeContainer.GetMethods): New public method; formerly known as
10519         Interface.GetMethod().  This is used by PendingImplementation.
10520         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
10521         it's now private and non-static.
10522         (Interface): Moved this here; it's now implemented similar to
10523         Class and Struct.
10524         (Method, Property, Event, Indexer): Added `bool is_interface'
10525         argument to their .ctor's.
10526         (MemberBase.IsInterface): New public field.
10527
10528         * cs-parser.jay: Create normal Method, Property, Event, Indexer
10529         instances instead of InterfaceMethod, InterfaceProperty, etc.
10530         (opt_interface_base): Removed; we now use `opt_class_base' instead.
10531         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
10532
10533 2004-03-19  Martin Baulig  <martin@ximian.com>
10534
10535         * class.cs (MethodCore.IsDuplicateImplementation): New private
10536         method which does the CS0111 checking.
10537         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
10538         Use IsDuplicateImplementation().
10539
10540 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
10541
10542         * decl.cs (FindMemberToOverride): New method to find the correct
10543         method or property to override in the base class.
10544         * class.cs
10545             - Make Method/Property use the above method to find the
10546               version in the base class.
10547             - Remove the InheritableMemberSignatureCompare as it is now
10548               dead code.
10549
10550         This patch makes large code bases much faster to compile, as it is
10551         O(n) rather than O(n^2) to do this validation.
10552
10553         Also, it fixes bug 52458 which is that nested classes are not
10554         taken into account when finding the base class member.
10555
10556         Reviewed/Approved by Martin.
10557
10558 2004-03-17  Martin Baulig  <martin@ximian.com>
10559
10560         * expression.cs (MemberAccess.DoResolve): Take the parent's number
10561         of type arguments into account; use the `real_num_type_args'
10562         approach like in DoResolveAsTypeStep().
10563
10564         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
10565         nested types.
10566
10567 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
10568
10569         * interface.cs: In all interface classes removed redundant
10570         member initialization.
10571
10572 2004-03-16  Martin Baulig  <martin@ximian.com>
10573
10574         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10575
10576 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
10577
10578         * decl.cs (DefineTypeAndParents): New helper method to define a
10579         type's containers before the type itself is defined;  This is a
10580         bug exposed by the recent changes to Windows.Forms when an
10581         implemented interface was defined inside a class that had not been
10582         built yet.   
10583
10584         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10585
10586         (Check): Loop correctly to report errors modifiers
10587         (UNSAFE was not in the loop, since it was the same as TOP).
10588
10589         * interface.cs: Every interface member now takes a ModFlags,
10590         instead of a "is_new" bool, which we set on the base MemberCore. 
10591
10592         Every place where we called "UnsafeOk" in the interface, now we
10593         call the proper member (InterfaceMethod.UnsafeOK) instead to get
10594         the unsafe settings from the member declaration instead of the
10595         container interface. 
10596
10597         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
10598
10599         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10600         `set_indexer_name' to the pending bits (one per type).
10601
10602         We fixed a bug today that was picking the wrong method to
10603         override, since for properties the existing InterfaceMethod code
10604         basically ignored the method name.  Now we make sure that the
10605         method name is one of the valid indexer names.
10606
10607 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
10608  
10609         * support.cs (SeekableStreamReader): Keep track of stream byte
10610         positions and don't mix them with character offsets to the buffer.
10611
10612         Patch from Gustavo Giráldez
10613
10614 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
10615
10616         * interface.cs (InterfaceSetGetBase): Removed double member
10617         initialization, base class does it as well.
10618
10619 2004-03-13  Martin Baulig  <martin@ximian.com>
10620
10621         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10622         when compiling corlib.
10623
10624 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
10625
10626         * convert.cs (ExplicitConversion): We were reporting an error on
10627         certain conversions (object_type source to a value type, when the
10628         expression was `null') before we had a chance to pass it through
10629         the user defined conversions.
10630
10631         * driver.cs: Replace / and \ in resource specifications to dots.
10632         Fixes 50752
10633
10634         * class.cs: Add check for duplicate operators.  Fixes 52477
10635
10636 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
10637
10638         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10639         that are in the middle of the statements, not only at the end.
10640         Fixes #54987
10641
10642         * class.cs (TypeContainer.AddField): No longer set the
10643         `HaveStaticConstructor' flag, now we call it
10644         `UserDefineStaticConstructor' to diferentiate the slightly
10645         semantic difference.
10646
10647         The situation is that we were not adding BeforeFieldInit (from
10648         Modifiers.TypeAttr) to classes that could have it.
10649         BeforeFieldInit should be set to classes that have no static
10650         constructor. 
10651
10652         See:
10653
10654         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10655
10656         And most importantly Zoltan's comment:
10657
10658         http://bugzilla.ximian.com/show_bug.cgi?id=44229
10659
10660         "I think beforefieldinit means 'it's ok to initialize the type sometime 
10661          before its static fields are used', i.e. initialization does not need
10662          to be triggered by the first access to the type. Setting this flag
10663          helps the JIT to compile better code, since it can run the static
10664          constructor at JIT time, and does not need to generate code to call it
10665          (possibly lots of times) at runtime. Unfortunately, mcs does not set
10666          this flag for lots of classes like String. 
10667          
10668          csc sets this flag if the type does not have an explicit static 
10669          constructor. The reasoning seems to be that if there are only static
10670          initalizers for a type, and no static constructor, then the programmer
10671          does not care when this initialization happens, so beforefieldinit
10672          can be used.
10673          
10674          This bug prevents the AOT compiler from being usable, since it 
10675          generates so many calls to mono_runtime_class_init that the AOT code
10676          is much slower than the JITted code. The JITted code is faster, 
10677          because it does not generate these calls if the vtable is type is
10678          already initialized, which is true in the majority of cases. But the
10679          AOT compiler can't do this."
10680
10681 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
10682
10683         * class.cs (MethodData.Emit): Refactor the code so symbolic
10684         information is generated for destructors;  For some reasons we
10685         were taking a code path that did not generate symbolic information
10686         before. 
10687
10688 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
10689
10690         * class.cs: Create a Constructor.CheckBase method that
10691         takes care of all validation type code. The method
10692         contains some code that was moved from Define.
10693
10694         It also includes new code that checks for duplicate ctors.
10695         This fixes bug #55148.
10696
10697 2004-03-09  Joshua Tauberer <tauberer@for.net>
10698
10699         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
10700         a { ... }-style array creation invokes EmitStaticInitializers
10701         which is not good for reference-type arrays.  String, decimal
10702         and now null constants (NullCast) are not counted toward
10703         static initializers.
10704
10705 2004-03-05  Martin Baulig  <martin@ximian.com>
10706
10707         * location.cs (SourceFile.HasLineDirective): New public field;
10708         specifies whether the file contains or is referenced by a "#line"
10709         directive.
10710         (Location.DefineSymbolDocuments): Ignore source files which
10711         either contain or are referenced by a "#line" directive.        
10712
10713 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
10714
10715         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10716         direct access to our parent, so check the method inline there.
10717
10718 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
10719
10720         * expression.cs (Invocation.EmitCall): Miguel's last commit
10721         caused a regression. If you had:
10722
10723             T t = null;
10724             t.Foo ();
10725
10726         In Foo the implict this would be null.
10727
10728 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
10729
10730         * expression.cs (Invocation.EmitCall): If the method is not
10731         virtual, do not emit a CallVirt to it, use Call.
10732
10733         * typemanager.cs (GetFullNameSignature): Improve the method to
10734         cope with ".ctor" and replace it with the type name.
10735
10736         * class.cs (ConstructorInitializer.Resolve): Now the method takes
10737         as an argument the ConstructorBuilder where it is being defined,
10738         to catch the recursive constructor invocations.
10739
10740 2004-03-16  Martin Baulig  <martin@ximian.com>
10741
10742         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
10743         ConstructedType, call ResolveType() on it to get the type rather
10744         than just using `expr.Type'.
10745
10746 2004-03-16  Martin Baulig  <martin@ximian.com>
10747
10748         * generics.cs (ConstructedType.GetMemberAccess): Take the
10749         EmitContext instead on the TypeExpr and use
10750         ec.TypeContainer.CurrentType/ec.ContainerType.
10751
10752 2004-03-16  Martin Baulig  <martin@ximian.com>
10753
10754         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
10755         parameters before aliases.
10756
10757 2004-03-16  Martin Baulig  <martin@ximian.com>
10758
10759         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
10760         New oublic function; checks whether two generic instances may become
10761         equal under some instantiations (26.3.1).
10762
10763         * class.cs (TypeContainer.Define): Call
10764         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
10765         error.
10766
10767 2004-03-16  Martin Baulig  <martin@ximian.com>
10768
10769         * class.cs (TypeContainer.GetClassBases): Moved
10770         Error_TypeParameterAsBase() here and also check whether the base
10771         class is not an attribute.
10772
10773 2004-03-16  Martin Baulig  <martin@ximian.com>
10774
10775         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10776
10777 2004-03-16  Martin Baulig  <martin@ximian.com>
10778
10779         * class.cs (Error_TypeParameterAsBase): Use correct error number
10780         here (CS0689).  
10781
10782 2004-03-16  Martin Baulig  <martin@ximian.com>
10783
10784         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
10785         for generics.
10786
10787         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
10788         error reporting.
10789
10790 2004-03-15  Martin Baulig  <martin@ximian.com>
10791
10792         * typemanager.cs (TypeManager.GetFullName): New public method.
10793         (TypeManager.MemberLookup): Added `int_num_type_arguments'
10794         argument; only return members with the correct number of type
10795         arguments.
10796         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
10797         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
10798         whether the number of type arguments matches.
10799
10800         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
10801         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
10802
10803         * expression.cs (MemberAccess): Added public `NumTypeArguments'
10804         field; it's set by the protected .ctor when we're actually a
10805         GenericMemberAccess.
10806         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
10807         arguments and pass it to MemberLookupFinal ().
10808
10809         * ecore.cs (Expression.MemberLookup): Added `int
10810         num_type_arguments' argument; only return members with the correct
10811         number of type arguments.
10812         (Expression.MemberLookupFailed): Check whether the MemberLookup
10813         failed because we did not have the correct number of type
10814         arguments; report CS0305 in this case.
10815
10816         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
10817         `e.ResolveAsTypeTerminal()' already did so.
10818
10819 2004-03-15  Martin Baulig  <martin@ximian.com>
10820
10821         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
10822         we're a ConstructedType; in this case, the caller must report an
10823         error (for instance CS0131).
10824
10825         * generic.cs (TypeArguments): Added Location argument to the .ctor.
10826         (TypeArguments.Resolve): Actually report errors here.
10827
10828 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
10829
10830         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10831         `set_indexer_name' to the pending bits (one per type).
10832
10833         We fixed a bug today that was picking the wrong method to
10834         override, since for properties the existing InterfaceMethod code
10835         basically ignored the method name.  Now we make sure that the
10836         method name is one of the valid indexer names.
10837
10838 2004-03-15  Martin Baulig  <martin@ximian.com>
10839
10840         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
10841         for generic instances.
10842
10843 2004-03-13  Martin Baulig  <martin@ximian.com>
10844
10845         * class.cs (TypeContainer.DefineType): Call
10846         TypeManager.AddUserType() immediately after creating the
10847         TypeBuilder; pass all type parameters when creating the
10848         CurrentType.
10849
10850         * decl.cs (DeclSpace.FindNestedType): New public method.
10851         (DeclSpace.FindType): Added `int num_type_args' argument; only
10852         return types with the correct number of type parameters.
10853         (DeclSpace.CountTypeParams): New public property.
10854
10855         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
10856         the number of type parameters; defaults to zero.
10857
10858         * generic.cs (TypeArguments.Count): New public property.
10859         (ConstructedType.DoResolveAsTypeStep): First call
10860         ds.FindNestedType() to find out whether we're nested in the
10861         current generic type; in this case, we inherit all type parameters
10862         from the current class.
10863
10864         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
10865         num_type_args' argument.
10866         (RootContext.LookupType): Added overloaded version which takes the
10867         number of type arguments; only return types with the correct
10868         number of type arguments.
10869
10870         * typemanager.cs (TypeManager.CheckGeneric): New public function;
10871         checks whether `Type t' has `int num_type_args'.
10872
10873 2004-03-13  Martin Baulig  <martin@ximian.com>
10874
10875         * generic.cs (GenericMethod.DefineType): New method; calls
10876         DefineType() on all the type parameters.
10877
10878         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
10879         (MethodData.Define): If we're a generic method, call
10880         GenericMethod.DefineType() to define the type parameters.       
10881
10882 2004-03-10  Martin Baulig  <martin@ximian.com>
10883
10884         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
10885         instead of IsAssignableFrom.    
10886
10887 2004-03-10  Martin Baulig  <martin@ximian.com>
10888
10889         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
10890
10891         * support.cs (ParameterData.HasArrayParameter): New property.
10892         (ReflectionParameters.ctor): Take a MethodBase instead of a
10893         ParameterInfo[].  If we have any type parameters, get the generic
10894         method definition and ask it whether we have variable arguments.
10895
10896 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
10897
10898         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
10899         routines to check if a type is an enumerable/enumerator allow
10900         classes that implement the IEnumerable or IEnumerator interfaces.
10901
10902         * class.cs (Property, Operator): Implement IIteratorContainer, and
10903         implement SetYields.
10904
10905         (Property.Define): Do the block swapping for get_methods in the
10906         context of iterators.   We need to check if Properties also
10907         include indexers or not.
10908
10909         (Operator): Assign the Block before invoking the
10910         OperatorMethod.Define, so we can trigger the Iterator code
10911         replacement. 
10912
10913         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
10914         Property and Operator classes are not created when we parse the
10915         declarator but until we have the block completed, so we use a
10916         singleton SimpleIteratorContainer.Simple to flag whether the
10917         SetYields has been invoked.
10918
10919         We propagate this setting then to the Property or the Operator to
10920         allow the `yield' to function.
10921
10922 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
10923
10924         * codegen.cs: Implemented attribute support for modules.
10925         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
10926         Assembly/Module functionality.
10927
10928         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
10929         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
10930         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
10931
10932 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
10933
10934         * interface.cs (FindMembers): The operation is performed on all base
10935         interfaces and not only on the first. It is required for future CLS Compliance patch.
10936
10937 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
10938
10939         * statement.cs, codegen.cs:
10940         This patch deals with patterns such as:
10941
10942         public class List : IEnumerable {
10943
10944                 public MyEnumerator GetEnumerator () {
10945                         return new MyEnumerator(this);
10946                 }
10947
10948                 IEnumerator IEnumerable.GetEnumerator () {
10949                         ...
10950                 }
10951                 
10952                 public struct MyEnumerator : IEnumerator {
10953                         ...
10954                 }
10955         }
10956
10957         Before, there were a few things we did wrong:
10958         1) we would emit callvirt on a struct, which is illegal
10959         2) we emited ldarg when we needed to emit ldarga
10960         3) we would mistakenly call the interface methods on an enumerator
10961         type that derived from IEnumerator and was in another assembly. For example:
10962
10963         public class MyEnumerator : IEnumerator
10964
10965         Would have the interface methods called, even if there were public impls of the
10966         method. In a struct, this lead to invalid IL code.
10967
10968 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
10969
10970         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
10971           renamed to Emit.
10972
10973         * delegate.cs (Define): Fixed crash when delegate type is undefined.
10974
10975 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
10976
10977         * cs-parser.jay: Fix small regression: we were not testing V2
10978         compiler features correctly.
10979
10980         * interface.cs: If the emit context is null, then create one
10981
10982 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
10983
10984         * decl.cs (GetSignatureForError): New virtual method to get full name
10985           for error messages.
10986
10987         * attribute.cs (IAttributeSupport): New interface for attribute setting.
10988           Now it is possible to rewrite ApplyAttributes method to be less if/else.
10989
10990         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
10991           Duplicated members and code in these classes has been removed.
10992           Better encapsulation in these classes.
10993
10994 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
10995
10996         * assign.cs (Assign.DoResolve): When dealing with compound
10997         assignments, there is a new rule in ECMA C# 2.4 (might have been
10998         there before, but it is documented here) that states that in:
10999
11000         a op= b;
11001
11002         If b is of type int, and the `op' is a shift-operator, then the
11003         above is evaluated as:
11004
11005         a = (int) a op b 
11006
11007         * expression.cs (Binary.ResolveOperator): Instead of testing for
11008         int/uint/long/ulong, try to implicitly convert to any of those
11009         types and use that in pointer arithmetic.
11010
11011         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11012         method to print information for from the type, not from the
11013         null-method we were given.
11014
11015 2004-02-01  Duncan Mak  <duncan@ximian.com>
11016
11017         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11018         parsing for cmd, fixes bug #53694.
11019
11020 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
11021
11022         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11023         in the member name duplication tests. Property and operator name duplication
11024         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11025
11026 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
11027
11028         * interface.cs (PopulateMethod): Fixed crash when interface method
11029         returns not existing type (error test cs0246-3.cs).
11030
11031 2004-02-02  Ravi Pratap M <ravi@ximian.com>
11032
11033         * cs-parser.jay (interface_accessors): Re-write actions to also
11034         store attributes attached to get and set methods. Fix spelling
11035         while at it.
11036
11037         (inteface_property_declaration): Modify accordingly.
11038
11039         (InterfaceAccessorInfo): New helper class to store information to pass
11040         around between rules that use interface_accessors.
11041
11042         * interface.cs (Emit): Apply attributes on the get and set
11043         accessors of properties and indexers too.
11044
11045         * attribute.cs (ApplyAttributes): Modify accordingly to use the
11046         right MethodBuilder when applying attributes to the get and set accessors.
11047
11048 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
11049
11050         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11051
11052 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
11053
11054         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11055
11056 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
11057
11058         * cs-parser.jay: Remove YIELD token, instead use the new grammar
11059         changes that treat `yield' specially when present before `break'
11060         or `return' tokens.
11061
11062         * cs-tokenizer.cs: yield is no longer a keyword.
11063
11064 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
11065
11066         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11067         setting for default constructors.
11068         For default constructors are almost every time set wrong Modifier. The
11069         generated IL code has been alright. But inside mcs this values was
11070         wrong and this was reason why several of my CLS Compliance tests
11071         failed.
11072
11073 2004-02-27  Martin Baulig  <martin@ximian.com>
11074
11075         * generics.cs (ConstructedType.ResolveType): Make the nested type
11076         stuff actually work.
11077
11078 2004-02-25  Martin Baulig  <martin@ximian.com>
11079
11080         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
11081         property; returns the type parameters just from the current type,
11082         ie. with the ones from outer classes.
11083         (DeclSpace.LookupGeneric): First search in the current class, then
11084         in outer classes.
11085         (DeclSpace.initialize_type_params): When hiding a type parameter
11086         from an outer class, put it into the `type_param_list' anyways.
11087
11088         * expression.cs (MemberAccess.expr): Made this field protected.
11089
11090         * class.cs (TypeContainer.Define): The `CurrentType' just contains
11091         the type parameters from the current class.
11092
11093         * generic.cs (ConstructedType.ResolveType): Support nested generic
11094         types by taking the type parameters which we inherit from outer
11095         classes into account.
11096         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
11097         support for nested generic types.
11098
11099 2004-02-23  Martin Baulig  <martin@ximian.com>
11100
11101         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
11102         field and check whether we're nested inside a generic type.
11103         (DeclSpace.ResolveType): If we're resolving to a generic type
11104         definition, create a ConstructedType and return its resolved type.
11105         (DeclSpace.initialize_type_params): New private method;
11106         initializes the `type_param_list' field from the type parameters
11107         from this and all enclosing classes.
11108         (DeclSpace.TypeParameters): Call initialize_type_params() unless
11109         we're already initialized.
11110
11111 2004-02-23  Martin Baulig  <martin@ximian.com>
11112
11113         * class.cs (Method.Define): Create the generic method before
11114         calling DoDefine().
11115         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
11116         the TypeContainer one); we use this for generic methods.
11117
11118         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
11119         parent's TypeBuilder.
11120
11121 2004-02-18  Martin Baulig  <martin@ximian.com>
11122
11123         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
11124         to check for equality.
11125
11126 2004-02-05  Martin Baulig  <martin@ximian.com>
11127
11128         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
11129         `ec.TypeContainer.CurrentType', use it instead of
11130         `ec.ContainerType' to check whether we're in the type's ctor.
11131
11132 2004-01-29  Martin Baulig  <martin@ximian.com>
11133
11134         * expression.cs (Invocation.DoResolve): If we're a
11135         `ConstructedType', then we're actually a generic method, so
11136         rewrite the expr as a GenericMemberAccess.
11137
11138         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
11139         here; manually parse it into a string.
11140
11141 2004-01-28  Martin Baulig  <martin@ximian.com>
11142
11143         * typemanager.cs (TypeManager.IsEqual): New static method.
11144         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
11145         check for equality instead of using `=='.
11146
11147 2004-01-26  Martin Baulig  <martin@ximian.com>
11148
11149         * decl.cs (DeclSpace.CurrentType): New public field.
11150
11151         * expression.cs (This.ResolveBase): If we have an
11152         `ec.TypeContainer.CurrentType', use it instead of
11153         `ec.ContainerType'.
11154
11155         * class.cs (TypeContainer.DefineType): If we're a generic type,
11156         create the `CurrentType' (unresolved).
11157         (TypeContainer.GenericType): New private field.
11158         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
11159         it and store it in `GenericType' before creating the MemberCache.
11160         (TypeContainer.GetMembers): If we have a `GenericType', call
11161         TypeManager.FindMembers() on it.
11162
11163         * interface.cs (Interface.GenericType): New private field.
11164         (Interface.DefineType): If we're a generic type, create the
11165         `CurrentType' (unresolved).
11166         (Interface.DefineMembers): If we have a `CurrentType', resolve it
11167         and store it in `GenericType' before creating the MemberCache.
11168         (Interface.GetMembers): If we have a `GenericType', call
11169         TypeManager.FindMembers() on it.
11170
11171 2004-01-22  Martin Baulig  <martin@ximian.com>
11172
11173         * cs-parser.jay (namespace_or_type_name): Return an Expression,
11174         not a QualifiedIdentifier.  This is what `type_name_expression'
11175         was previously doing.
11176         (type_name_expression): Removed; the code is now in
11177         `namespace_or_type_name'.
11178         (qualified_identifier): Removed, use `namespace_or_type_name'
11179         instead.
11180         (QualifiedIdentifier): Removed this class.      
11181
11182 2004-01-22  Martin Baulig  <martin@ximian.com>
11183
11184         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11185         not a string as alias name.
11186
11187 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
11188
11189         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11190         #52730 bug, and instead compute correctly the need to use a
11191         temporary variable when requesting an address based on the
11192         static/instace modified of the field and the constructor.
11193  
11194 2004-01-21  Martin Baulig  <martin@ximian.com>
11195
11196         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11197         class and namespace before looking up aliases.  Fixes #52517.
11198
11199 2004-01-21  Martin Baulig  <martin@ximian.com>
11200
11201         * flowanalysis.cs (UsageVector.Merge): Allow variables being
11202         assinged in a 'try'; fixes exception4.cs.
11203
11204 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11205         * class.cs : Implemented parameter-less constructor for TypeContainer
11206
11207         * decl.cs: Attributes are now stored here. New property OptAttributes
11208
11209         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
11210
11211         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
11212
11213 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11214
11215         * typemanager.cs (CSharpSignature): Now reports also inner class name.
11216           (CSharpSignature): New method for indexer and property signature.
11217
11218 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11219
11220         * pending.cs (IsVirtualFilter): Faster implementation.
11221
11222 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11223
11224         * typemanager.cs: Avoid inclusion of same assembly more than once.
11225
11226 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11227
11228         * cs-parser.jay: Fixed problem where the last assembly attribute
11229           has been applied also to following declaration (class, struct, etc.)
11230           
11231 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11232
11233         * class.cs: Added error CS0538, CS0539 reporting.
11234         Fixed crash on Microsoft runtime when field type is void.
11235
11236         * cs-parser.jay: Added error CS0537 reporting.
11237
11238         * pending.cs: Added error CS0535 reporting.
11239         Improved error report for errors CS0536, CS0534.
11240
11241 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
11242
11243         Merge a few bits from the Anonymous Method MCS tree.
11244
11245         * statement.cs (ToplevelBlock): New class for toplevel methods,
11246         will hold anonymous methods, lifted variables.
11247
11248         * cs-parser.jay: Create toplevel blocks for delegates and for
11249         regular blocks of code. 
11250
11251 2004-01-20  Martin Baulig  <martin@ximian.com>
11252
11253         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11254         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11255         and `NeedExplicitReturn'; added `IsLastStatement'.
11256         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11257         have a `ReturnLabel' or we're not unreachable.
11258
11259         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
11260         child's reachability; don't just override ours with it.  Fixes
11261         #58058 (lluis's example).
11262         (FlowBranching): Added public InTryOrCatch(), InCatch(),
11263         InFinally(), InLoop(), InSwitch() and
11264         BreakCrossesTryCatchBoundary() methods.
11265
11266         * statement.cs (Return): Do all error checking in Resolve().
11267         Unless we are the last statement in a top-level block, always
11268         create a return label and jump to it.
11269         (Break, Continue): Do all error checking in Resolve(); also make
11270         sure we aren't leaving a `finally'.
11271         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
11272         statement in a top-level block.
11273         (Block.Flags): Added `IsDestructor'.
11274         (Block.IsDestructor): New public property.
11275
11276 2004-01-20  Martin Baulig  <martin@ximian.com>
11277
11278         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11279
11280 2004-01-20  Martin Baulig  <martin@ximian.com>
11281
11282         * statement.cs (Statement.ResolveUnreachable): New public method.
11283         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11284         (Block.Resolve): Resolve unreachable statements.
11285
11286 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11287
11288         * expression.cs: We need to fix the case where we do
11289         not have a temp variable here.
11290
11291         * assign.cs: Only expression compound assignments need
11292         temporary variables.
11293
11294 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11295
11296         * flowanalysis.cs: Reduce memory allocation in a few ways:
11297           - A block with no variables should not allocate a bit
11298             vector for itself.
11299           - A method with no out parameters does not need any tracking
11300             for assignment of the parameters, so we need not allocate
11301             any data for it.
11302           - The arrays:
11303                 public readonly Type[] VariableTypes;
11304                 public readonly string[] VariableNames;
11305             Are redundant. The data is already stored in the variable
11306             map, so we need not allocate another array for it.
11307           - We need to add alot of checks for if (params | locals) == null
11308             due to the first two changes.
11309
11310 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
11311
11312         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11313         implement IMemoryLocation, we store a copy on a local variable and
11314         take the address of it.  Patch from Benjamin Jemlich
11315
11316         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11317         to use a special "type_name_expression" rule which reduces the
11318         number of "QualifiedIdentifier" classes created, and instead
11319         directly creates MemberAccess expressions.
11320
11321 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
11322
11323         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11324         that fixes #52853.  Null literal assignment to ValueType
11325
11326         * class.cs (MethodData.Emit): Instead of checking the name of the
11327         method to determine if its a destructor, create a new derived
11328         class from Method called Destructor, and test for that.  
11329
11330         * cs-parser.jay: Create a Destructor object instead of a Method.  
11331
11332         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11333
11334         Fixes: 52933
11335
11336 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
11337
11338         * expression.cs (Binary.ResolveOperator): Perform an implicit
11339         conversion from MethodGroups to their delegate types on the
11340         Addition operation.
11341
11342         * delegate.cs: Introduce a new class DelegateCreation that is the
11343         base class for `NewDelegate' and `ImplicitDelegateCreation',
11344         factor some code in here.
11345
11346         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11347         conversion from MethodGroups to compatible delegate types. 
11348
11349         * ecore.cs (Expression.Resolve): Do not flag error 654
11350         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11351         we allow conversions from MethodGroups to delegate types now.
11352
11353         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11354         assignments in v2 either.
11355
11356 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
11357
11358         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11359         static read-only fields in ctors.
11360
11361         Applied patch from Benjamin Jemlich 
11362
11363         * expression.cs (UnaryMutator): Avoid leaking local variables. 
11364
11365 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
11366
11367         * cs-tokenizer.cs (IsCastToken): Allow the various native types
11368         here to return true, as they can be used like this:
11369
11370                 (XXX) int.MEMBER ()
11371
11372         Fixed 49836 and all the other dups
11373
11374 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
11375
11376         * driver.cs: Implement /win32res and /win32icon.
11377
11378 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
11379
11380         * cs-parser.jay: Add a rule to improve error handling for the
11381         common mistake of placing modifiers after the type.
11382
11383 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
11384
11385         * cs-parser.jay (interface_event_declaration): Catch
11386         initialization of events on interfaces, and report cs0068
11387
11388         * cs-parser.jay (interface_event_declaration): Catch
11389         initialization of events. 
11390
11391         * ecore.cs: Better report missing constructors.
11392
11393         * expression.cs (Binary.ResolveOperator): My previous bug fix had
11394         the error reporting done in the wrong place.  Fix.
11395
11396         * expression.cs (Binary.ResolveOperator): Catch the 
11397         operator + (E x, E y) error earlier, and later allow for implicit
11398         conversions in operator +/- (E e, U x) from U to the underlying
11399         type of E.
11400
11401         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11402         52596, if the container class is abstract, the default constructor
11403         is protected otherwise its public (before, we were always public).
11404
11405         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11406         fixed statement.
11407
11408         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11409         Jemlich that fixes bug #52597, MCS was generating invalid code for
11410         idisposable structs.   Thanks to Ben for following up with this
11411         bug as well.
11412
11413 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
11414
11415         * driver.cs: Allow assemblies without code to be generated, fixes
11416         52230.
11417
11418 2004-01-07  Nick Drochak <ndrochak@gol.com>
11419
11420         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11421
11422 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
11423
11424         * cs-parser.jay: Add rules to improve error reporting if fields or
11425         methods are declared at the namespace level (error 116)
11426
11427         * Add rules to catch event add/remove
11428
11429 2004-01-04  David Sheldon <dave-mono@earth.li>
11430
11431   * expression.cs: Added matching ")" to error message for 
11432   CS0077
11433
11434 2004-01-03 Todd Berman <tberman@gentoo.org>
11435
11436         * ecore.cs, attribute.cs:
11437         Applying fix from #52429.
11438
11439 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11440
11441         * ecore.cs, expression.cs, statement.cs:
11442         Total rewrite of how we handle branching. We
11443         now handle complex boolean expressions with fewer
11444         jumps. As well if (x == 0) no longer emits a ceq.
11445
11446         if (x is Foo) is much faster now, because we generate
11447         better code.
11448
11449         Overall, we get a pretty big improvement on our benchmark
11450         tests. The code we generate is smaller and more readable.
11451
11452         I did a full two-stage bootstrap. The patch was reviewed
11453         by Martin and Miguel.
11454
11455 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11456
11457         * cs-parser.jay: Make primary_expression not take a QI.
11458         we dont need this because the member_access rule covers
11459         us here. So we replace the rule with just IDENTIFIER.
11460
11461         This has two good effects. First, we remove a s/r conflict.
11462         Second, we allocate many fewer QualifiedIdentifier objects.
11463
11464 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11465
11466         * attribute.cs: Handle MarshalAs attributes as pseudo, and
11467         set the correct information via SRE. This prevents
11468         hanging on the MS runtime. Fixes #29374.
11469
11470 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11471
11472         * convert.cs: correctly handle conversions to value types
11473         from Enum and ValueType as unboxing conversions.
11474
11475         Fixes bug #52569. Patch by Benjamin Jemlich.
11476
11477 2004-01-02  Ravi Pratap  <ravi@ximian.com>
11478
11479         * expression.cs (BetterConversion): Prefer int -> uint
11480         over int -> ulong (csc's behaviour). This fixed bug #52046.
11481
11482 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11483
11484         * decl.cs (MemberCache.FindMembers): now returns a
11485         MemberInfo [].
11486
11487         * typemanager.cs: In general, go with with ^^.
11488         (CopyNewMethods): take an IList.
11489         (RealMemberLookup): Only allocate an arraylist
11490         if we copy from two sets of methods.
11491
11492         This change basically does two things:
11493         1) Fewer array lists allocated due to CopyNewMethods.
11494         2) the explicit cast in MemberList costed ALOT.
11495
11496 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
11497
11498         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
11499         a hashtable to avoid needless string allocations when an identifier is
11500         used more than once (the common case).
11501
11502 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11503
11504         * pending.cs: MS's TypeBuilder.GetInterfaces ()
11505         is broken, it will not return anything. So, we
11506         have to use the information we have in mcs to
11507         do the task.
11508
11509         * typemanager.cs: Add a cache for GetInterfaces,
11510         since this will now be used more often (due to ^^)
11511
11512         (GetExplicitInterfaces) New method that gets the
11513         declared, not effective, interfaces on a type
11514         builder (eg, if you have interface IFoo, interface
11515         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
11516         { IBar }.
11517
11518         This patch makes MCS able to bootstrap itself on
11519         Windows again.
11520
11521 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11522
11523         * expression.cs: Remove the Nop's that Miguel put
11524         in by mistake.
11525
11526 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11527
11528         * report.cs, codegen.cs: Give the real stack trace to
11529         the error when an exception is thrown.
11530
11531 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11532
11533         * decl.cs: only allocate hashtables for ifaces if 
11534         it is an iface!
11535
11536 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11537
11538         * expression.cs: fix the error from cs0121-2.cs
11539         (a parent interface has two child interfaces that
11540         have a function with the same name and 0 params
11541         and the function is called through the parent).
11542
11543 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11544
11545         * class.cs, rootcontext.cs, typmanager.cs: do not
11546         leak pointers.
11547
11548 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11549
11550         * codegen.cs: remove stack for the ec flow branching.
11551         It is already a linked list, so no need.
11552
11553 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11554
11555         * Makefile: Allow custom profiler here.
11556
11557 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11558
11559         * typemanager.cs (LookupType):
11560           - Use a static char [], because split takes
11561             a param array for args, so it was allocating
11562             every time.
11563           - Do not store true in a hashtable, it boxes.
11564
11565 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11566
11567         * flowanalysis.cs: bytify common enums.
11568
11569 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11570
11571         * modifiers.cs: Add a new set of flags for the
11572         flags allowed on explicit interface impls.
11573         * cs-parser.jay: catch the use of modifiers in
11574         interfaces correctly.
11575         * class.cs: catch private void IFoo.Blah ().
11576
11577         All related to bug #50572.
11578
11579 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11580
11581         * decl.cs: Rewrite the consistant accessability checking.
11582         Accessability is not linear, it must be implemented in
11583         a tableish way. Fixes #49704.
11584
11585 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11586
11587         * expression.cs: Handle negation in a checked context.
11588         We must use subtraction from zero. Fixes #38674.
11589
11590 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11591
11592         * class.cs: Ignore static void main in DLLs.
11593         * rootcontext.cs: Handle the target type here,
11594         since we are have to access it from class.cs
11595         * driver.cs: account for the above.
11596
11597 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11598
11599         * report.cs: Give line numbers and files if available.
11600
11601 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
11602
11603         * driver.cs: Implement /addmodule.
11604
11605         * typemanager.cs:  Change 'modules' field so it now contains Modules not
11606         ModuleBuilders.
11607
11608 2003-12-20  Martin Baulig  <martin@ximian.com>
11609
11610         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11611         (FieldBase.IsAssigned): Removed this field.
11612         (FieldBase.SetAssigned): New public method.
11613         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11614
11615 2003-12-20  Martin Baulig  <martin@ximian.com>
11616
11617         * expression.cs (LocalVariableReference.DoResolve): Don't set
11618         `vi.Used' if we're called from DoResolveLValue().
11619
11620         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11621         returns the usage vector it just merged into the current one -
11622         pass this one to UsageWarning().
11623         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11624         of the `EmitContext', don't call this recursively on our children.
11625
11626 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
11627
11628         * driver.cs: Implement /target:module.
11629
11630 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
11631
11632         * support.cs (CharArrayHashtable): New helper class.
11633
11634         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
11635         char arrays, not strings, so we can avoid creating a string in
11636         consume_identifier if the identifier is a keyword.
11637
11638 2003-12-16  Martin Baulig  <martin@ximian.com>
11639
11640         * statement.cs (LocalInfo.Assigned): Removed this property.
11641         (LocalInfo.Flags): Removed `Assigned'.
11642         (LocalInfo.IsAssigned): New public method; takes the EmitContext
11643         and uses flow analysis.
11644         (Block.UsageWarning): Made this method private.
11645         (Block.Resolve): Call UsageWarning() if appropriate.
11646
11647         * expression.cs (LocalVariableReference.DoResolve): Always set
11648         LocalInfo.Used here.
11649
11650 2003-12-13  Martin Baulig  <martin@ximian.com>
11651
11652         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11653         any value here; we're now using flow analysis to figure out
11654         whether a statement/block returns a value.
11655
11656 2003-12-13  Martin Baulig  <martin@ximian.com>
11657
11658         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
11659         working again.
11660         (FlowBranching.MergeFinally): Don't call
11661         `branching.CheckOutParameters()' here, this is called in
11662         MergeTopBlock().
11663         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
11664         when adding the `finally' vector.       
11665
11666 2003-12-13  Martin Baulig  <martin@ximian.com>
11667
11668         * flowanalysis.cs
11669         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
11670         actually work and also fix #48962.
11671
11672 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11673
11674         * decl.cs: Do not check System.Object for nested types,
11675         since we know it does not have any. Big bang for buck:
11676
11677         BEFORE:
11678            Run 1:   8.35 seconds
11679            Run 2:   8.32 seconds
11680            corlib:  17.99 seconds
11681         AFTER:
11682            Run 1:   8.17 seconds
11683            Run 2:   8.17 seconds
11684            corlib:  17.39 seconds
11685
11686 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
11687
11688         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
11689         time we are returning 0 members, so we save alot here.
11690
11691 2003-12-11  Martin Baulig  <martin@ximian.com>
11692
11693         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
11694         `MergeChild()', also just take the `FlowBranching' as argument;
11695         call Merge() on it and return the result.
11696         (FlowBranching.Merge): We don't need to do anything if we just
11697         have one sibling.
11698
11699 2003-12-11  Martin Baulig  <martin@ximian.com>
11700
11701         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
11702         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
11703         Maurer for this idea.
11704
11705 2003-12-11  Martin Baulig  <martin@ximian.com>
11706
11707         * flowanalysis.cs (MergeResult): This class is now gone; we now
11708         use the `UsageVector' for this.  The reason for this is that if a
11709         branching just has one sibling, we don't need to "merge" them at
11710         all - that's the next step to do.
11711         (FlowBranching.Merge): We now return a `UsageVector' instead of a
11712         `MergeResult'.
11713
11714 2003-12-11  Martin Baulig  <martin@ximian.com>
11715
11716         Reworked flow analyis and made it more precise and bug-free.  The
11717         most important change is that we're now using a special `Reachability'
11718         class instead of having "magic" meanings of `FlowReturns'.  I'll
11719         do some more cleanups and optimizations and also add some more
11720         documentation this week.
11721
11722         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
11723         largely reworked this class.
11724         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
11725         the new `Reachability' class instead of having "magic" values here.
11726         (FlowBranching): We're now using an instance of `Reachability'
11727         instead of having separate `Returns', `Breaks' etc. fields.
11728
11729         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
11730         based on flow analysis; ignore the return value of block.Emit ().
11731
11732 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
11733
11734         * driver.cs typemanager.cs: Find the mono extensions to corlib even
11735         if they are private.
11736
11737 2003-12-09  Martin Baulig  <martin@ximian.com>
11738
11739         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
11740         call them directly on the UsageVector.
11741
11742 2003-12-09  Martin Baulig  <martin@ximian.com>
11743
11744         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
11745         Changed return type from `FlowReturns' to `Reachability'.
11746
11747 2003-12-09  Martin Baulig  <martin@ximian.com>
11748
11749         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
11750         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
11751         `Reachable' fields with a single `Reachability' one.
11752
11753 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11754
11755         * class.cs (FindMembers): Remove foreach's.
11756
11757         Bootstrap times:
11758
11759         BEFORE
11760                 Run 1:   8.74 seconds
11761                 Run 2:   8.71 seconds
11762
11763         AFTER
11764                 Run 1:   8.64 seconds
11765                 Run 2:   8.58 seconds
11766
11767
11768 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11769
11770         * cs-parser.jay:
11771         * gen-treedump.cs:
11772         * statement.cs:
11773         This patch does a few things:
11774                 1. EmptyStatement is now a singleton, so it is never reallocated.
11775                 2. All blah is EmptyStatement constructs have been changed to
11776                    blah == EmptyStatement.Value, which is much faster and valid
11777                    now that EmptyStatement is a singleton.
11778                 3. When resolving a block, rather than allocating a new array for
11779                    the non-empty statements, empty statements are replaced with
11780                    EmptyStatement.Value
11781                 4. Some recursive functions have been made non-recursive.
11782         Mainly the performance impact is from (3), however (1) and (2) are needed for
11783         this to work. (4) does not make a big difference in normal situations, however
11784         it makes the profile look saner.
11785
11786         Bootstrap times:
11787
11788         BEFORE
11789         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11790         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11791         Total memory allocated: 56397 KB
11792
11793         AFTER
11794         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
11795         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
11796         Total memory allocated: 55666 KB
11797
11798 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11799
11800         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
11801         than the hashtable in a hashtable version
11802
11803         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
11804         we always end up concating a string. This results in a huge perf
11805         loss, because many strings have to be tracked by the GC. In this
11806         patch, we first use a hashtable that works with two keys, so that
11807         the strings do not need to be concat'ed.
11808
11809         Bootstrap times:
11810         BEFORE
11811                 Run 1:   8.74 seconds
11812                 Run 2:   8.71 seconds
11813
11814         AFTER
11815                 Run 1:   8.65 seconds
11816                 Run 2:   8.56 seconds
11817
11818 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11819
11820         * Makefile: Add a new target `do-time' that does a quick and simple
11821         profile, leaving easy to parse output.
11822
11823 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
11824
11825         * codegen.cs (Init): Create the dynamic assembly with 
11826         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
11827
11828 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11829
11830         * support.cs: Make the PtrHashtable use only one
11831         instance of its comparer.
11832
11833 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
11834
11835         * typemanager.cs: Fix lookup of GetNamespaces.
11836
11837 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
11838
11839         * expression.cs: Removed redundant line.
11840
11841         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
11842         ArrayLists, use for loops with bounds.  
11843
11844         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
11845         arraylist.
11846
11847         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
11848         arraylists, use for loop with bounds.
11849
11850         The above three changes give us a 0.071 second performance
11851         improvement out of 3.294 seconds down to 3.223.  On my machine
11852         the above changes reduced the memory usage by 1,387 KB during
11853         compiler bootstrap.
11854
11855         * cs-parser.jay (QualifiedIdentifier): New class used to represent
11856         QualifiedIdentifiers.  Before we created a new string through
11857         concatenation, and mostly later on, the result would be
11858         manipulated by DecomposeQI through string manipulation.
11859
11860         This reduced the compiler memory usage for bootstrapping from
11861         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
11862         compile times in 0.05 seconds.
11863
11864 2003-11-28  Dick Porter  <dick@ximian.com>
11865
11866         * support.cs: Do string compares with the Invariant culture.
11867
11868         * rootcontext.cs: 
11869         * gen-treedump.cs: 
11870         * expression.cs: 
11871         * driver.cs: 
11872         * decl.cs: 
11873         * codegen.cs: 
11874         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
11875         the comparison is done with the Invariant culture.
11876
11877 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
11878
11879         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
11880         GetEnumerator method.
11881
11882         (ProbeCollectionType): Iterate starting at the most specific type
11883         upwards looking for a GetEnumerator
11884
11885         * expression.cs: Shift count can be up to 31 for int/uint and 63
11886         for long/ulong.
11887
11888 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
11889
11890         * statement.cs (Block.LookupLabel): Also look for the label on the
11891         children blocks.  Use a hash table to keep track of visited
11892         nodes. 
11893
11894         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
11895         we actually did transform the other operand, otherwise fall back
11896         to the common codepath that casts to long.
11897
11898         * cs-tokenizer.cs: Use the same code pattern as the int case.
11899         Maybe I should do the parsing myself, and avoid depending on the
11900         Parse routines to get this done.
11901
11902 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
11903
11904         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
11905         which fixes bug 51347.  This time test it.
11906
11907         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
11908         attributes for example can not tell the difference between these.
11909         The difference was only a syntax feature of the language. 
11910
11911         * attribute.cs: Apply attributes to delegates.
11912
11913         * delegate.cs: Call the apply attributes method.
11914
11915 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
11916
11917         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
11918         comparing 0 vs Byte.MinValue, not the value
11919
11920         (ImplicitConversionRequired): When reporting a conversion error,
11921         use error 31 to print out the constant error instead of the
11922         simpler 29.
11923
11924         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
11925         which fixes bug 51347.
11926
11927 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
11928
11929         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
11930         which fixes the -warnaserror command line option.
11931
11932 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
11933
11934         * cfold.cs (DoNumericPromotions): During constant folding of
11935         additions on UIntConstant, special case intconstants with
11936         IntConstants like we do on the expression binary operator. 
11937
11938 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
11939
11940         * convert.cs (ImplicitReferenceConversion): We were missing a case
11941         (System.Enum are not value types or class types, so we need to
11942         classify them separatedly).
11943
11944         * driver.cs: We do not support error 2007.
11945
11946 2003-11-12 Jackson Harper <jackson@ximian.com>
11947
11948         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
11949         system directory. Also use the full file name so users can
11950         libraries names mscorlib-o-tron.dll in a non system dir.
11951         
11952 2004-01-04  David Sheldon <dave-mono@earth.li>
11953
11954         * expression.cs: Added matching ")" to error message for CS0077.
11955
11956 2003-12-19  Martin Baulig  <martin@ximian.com>
11957
11958         * typemanager.cs (TypeManager.IsEqualGenericType): New public
11959         static method; see documentation in the method.
11960         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
11961
11962         * convert.cs (Convert.ImplicitReferenceConversion,
11963         Convert.ImplicitReferenceConversionExists): Add support for
11964         generic type declarations; see gen-36.cs.
11965
11966 2003-12-19  Martin Baulig  <martin@ximian.com>
11967
11968         * pending.cs (Pending.InterfaceMethod): Use
11969         `Type.IsAssignableFrom()' instead of `=='.
11970
11971 2003-12-18  Martin Baulig  <martin@ximian.com>
11972
11973         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
11974         byref types first.
11975
11976         * convert.cs (Convert.ImplicitStandardConversionExists): Use
11977         `expr_type.Equals (target_type)' instead of `=='.
11978
11979 2003-12-08  Martin Baulig  <martin@ximian.com>
11980
11981         * generics.cs (Constraints.Types): Removed.
11982         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
11983         to Type's.
11984         (Constraints.ResolveTypes): New public method; resolves the
11985         TypeExpr's to Type's.
11986         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
11987         longer takes the constraints.
11988         (TypeParameter.DefineMethod): Likewise.
11989         (TypeParameter.DefineType): New public method.  Calls
11990         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
11991         the constraints.
11992
11993 2003-12-08  Martin Baulig  <martin@ximian.com>
11994
11995         * convert.cs (Convert.ImplicitConversionStandard): Use
11996         `expr_type.Equals (target_type)' instead of `=='.
11997
11998 2003-12-08  Martin Baulig  <martin@ximian.com>
11999
12000         * typemanager.cs (TypeManager.GetReferenceType): Call
12001         `Type.MakeByRefType ()'.
12002
12003 2003-12-08  Martin Baulig  <martin@ximian.com>
12004
12005         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
12006         just has some special meaning in some situations.  For instance,
12007         it is allowed to use `where' as the name of a variable etc.
12008
12009 2003-12-04  Martin Baulig  <martin@ximian.com>
12010
12011         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12012         `Type.MakeArrayType()' for array types.
12013
12014 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
12015
12016         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
12017         debugging message.
12018
12019         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
12020         corlib to compile.
12021
12022 2003-11-16  Martin Baulig  <martin@ximian.com>
12023
12024         * codegen.cs (EmitContext.IsGeneric): Removed.
12025
12026         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
12027         ResolveGeneric() on the DeclSpace.
12028
12029 2003-11-16  Martin Baulig  <martin@ximian.com>
12030
12031         * generic.cs (TypeArguments.Resolve):
12032         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
12033         `ResolveType()' on it to get the Type.
12034
12035 2003-11-15  Martin Baulig  <martin@ximian.com>
12036
12037         * generic.cs (ConstructedType.GetInterfaces): Override this.
12038
12039 2003-11-14  Martin Baulig  <martin@ximian.com>
12040
12041         * interface.cs (Interface.DefineType): Define all type parameters
12042         before adding the interfaces we inherit.
12043
12044 2003-11-11  Martin Baulig  <martin@ximian.com>
12045
12046         * generic.cs (ConstructedType.ResolveType): Always call
12047         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
12048
12049 2003-11-10  Martin Baulig  <martin@ximian.com>
12050
12051         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
12052         (TypeManager.InitCoreTypes): Initialize them here, but instead of
12053         calling `ResolveType()' on them, directly assign their `Type'.
12054
12055 2003-11-08  Martin Baulig  <martin@ximian.com>
12056
12057         * generic.cs (ConstructedType): Override `IsClass' etc.
12058
12059 2003-11-08  Martin Baulig  <martin@ximian.com>
12060
12061         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
12062         return value and the `out parent' parameter.
12063         (TypeContainer.DefineType): Moved the CS0644 check into
12064         GetClassBases().  Don't pass the interface types to the
12065         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
12066         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
12067
12068         * ecore.cs (TypeExpr.IsAttribute): New property.
12069         (TypeExpr.GetInterfaces): New method.
12070
12071         * interface.cs (Interface.GetInterfaceTypeByName): Return a
12072         TypeExpr instead of a Type.
12073         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
12074         (Interface.DefineType): Don't pass the interface types to the
12075         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
12076         them later and then call `TypeBulider.AddInterfaceImplementation()'.
12077
12078         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
12079         instead of a `Type[]'.
12080         (TypeManager.RegisterBuilder): Likewise.
12081         (TypeManager.AddUserInterface): Likewise.
12082         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
12083         `Type[]' and also return a `TypeExpr[]'.
12084         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
12085
12086 2003-11-08  Martin Baulig  <martin@ximian.com>
12087
12088         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12089         Expression.     
12090
12091 2003-11-08  Martin Baulig  <martin@ximian.com>
12092
12093         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12094         TypeManager.ResolveExpressionTypes().
12095
12096         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12097         instead of an Expression.
12098         (TypeExpr): This is now an abstract base class for `TypeExpression'.
12099         (TypeExpression): New public class; formerly known as `TypeExpr'.
12100
12101         * expression.cs (ComposedCast): Derive from TypeExpr.
12102
12103         * typemanager.cs (TypeManager.system_*_expr): These are now
12104         TypExpr's instead of Expression's.
12105         (TypeManager.ResolveExpressionTypes): New public static function;
12106         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12107         of them.        
12108
12109 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
12110
12111         * expression.cs (New.DoResolve): Do not dereference value that
12112         might be a null return.
12113
12114         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12115         sure that the constant value has the right type.  Fixes an
12116         unreported bug, similar to 50425.
12117
12118         * const.cs (Const.LookupConstantValue): Call
12119         ImplicitStandardConversionExists before doing a conversion to
12120         avoid havng the TypeManager.ChangeType do conversions.
12121
12122         Reduced the number of casts used
12123
12124         (Const.ChangeType): New routine to enable reuse of the constant
12125         type changing code from statement.
12126
12127         * typemanager.cs (ChangeType): Move common initialization to
12128         static global variables.
12129
12130         Fixes #50425.
12131
12132         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12133         every value type to go through, even if it was void.  Fix that. 
12134
12135         * cs-tokenizer.cs: Use is_identifier_start_character on the start
12136         character of the define, and the is_identifier_part_character for
12137         the rest of the string.
12138
12139 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
12140
12141         * expression.cs (UnaryMutator.EmitCode): When I updated
12142         LocalVariableReference.DoResolve, I overdid it, and dropped an
12143         optimization done on local variable references.
12144
12145 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
12146
12147         * ecore.cs: Convert the return from Ldlen into an int.
12148
12149 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
12150
12151         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12152         the accessibility, this is a special case for toplevel non-public
12153         classes (internal for instance).
12154
12155 2003-10-20  Nick Drochak <ndrochak@gol.com>
12156
12157         * ecore.cs: Fix typo and build.  Needed another right paren.
12158
12159 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
12160
12161         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
12162         `internal' case regular and protected, but not allowing protected
12163         to be evaluated later.  Bug 49840
12164
12165 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
12166
12167         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12168         to kb.Nlast, and not the kb.nFirst to isolate the switch
12169         statement.
12170
12171         Extract the underlying type, so enumerations of long/ulong are
12172         treated like long/ulong.
12173
12174 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
12175
12176         * expression.cs (New): Overload the meaning of RequestedType to
12177         track the possible creation of the NewDelegate type, since
12178         DoResolve is invoked more than once for new constructors on field
12179         initialization.
12180
12181         See bugs: #48800 and #37014
12182
12183         * cs-parser.jay (declare_local_constants): Take an arraylist
12184         instead of a single constant.
12185
12186         (local_constant_declaration): It should take a
12187         constant_declarators, not a constant_declarator.  Fixes 49487
12188
12189         * convert.cs: Fix error report.
12190
12191 2003-10-13 Jackson Harper <jackson@ximian.com>
12192
12193         * typemanager.cs (TypeToCoreType): Add float and double this fixes
12194         bug #49611
12195         
12196 2003-11-03  Martin Baulig  <martin@ximian.com>
12197
12198         * expression.cs (ArrayAccess.GetStoreOpcode): Added
12199         `out bool has_type_arg'; if set, we need to pass the type to
12200         ig.Emit().
12201         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
12202         Stelem_Any/Ldelem_Any for generic parameters.   
12203
12204 2003-11-02  Martin Baulig  <martin@ximian.com>
12205
12206         * expression.cs (Invocation.EmitCall): Use
12207         `TypeManager.IsValueType()' to check whether it's a value type.
12208         Don't set `struct_call' when calling a method on a type parameter.
12209
12210 2003-11-02  Martin Baulig  <martin@ximian.com>
12211
12212         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
12213         and removed the TypeBuilder argument.
12214
12215         * typemanager.cs (TypeManager.IsValueType): Return
12216         `t.IsGenericParameter || t.IsValueType'.
12217
12218 2003-10-25  Martin Baulig  <martin@ximian.com>
12219
12220         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
12221         call ConstructedType.Resolve() on it.
12222
12223         * generic.cs (ConstructedType.Resolve): Set `type' on success.
12224
12225 2003-10-25  Martin Baulig  <martin@ximian.com>
12226
12227         * class.cs (TypeContainer.GetClassBases): Changed
12228         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
12229         CS8214 reporting here.
12230         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
12231         instead of a `Type' for our parent.  In case of a recursive
12232         declaration (see tests/gen-23.cs for an example), our parent is a
12233         ConstructedType and it doesn't have its type set.  So, first
12234         create our own TypeBuilder, then call constructed.Resolve() to get
12235         the parent's type and finally TypeBuilder.SetParent() it.
12236
12237         * ecore.cs (TypeExpr.Name): New public virtual property.
12238
12239         * generic.cs
12240         (ConstructedType): We're now a TypeExpr and not just an Expression.
12241         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
12242         arguments here; this is done later.
12243         (ConstructedType.Resolve): New public method to resolve the type
12244         arguments and bind them.
12245
12246 2003-10-21  Martin Baulig  <martin@ximian.com>
12247
12248         * convert.cs: Use `TypeManager.IsValueType' instead of
12249         'type.IsValueType' everywhere.
12250
12251         * typemanager.cs (TypeManager.IsValueType): Return true for type
12252         parameters.  The reason for this is that we need to box a type
12253         parameter when converting it to a reference type.
12254
12255         * cs-parser.jay: Added support for default value expressions.
12256
12257         * generics.cs (DefaultValueExpression): New public class.       
12258
12259 2003-10-17  Martin Baulig  <martin@ximian.com>
12260
12261         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
12262         TypeContainer so we can also use this for Interfaces.
12263         (TypeParameter.Resolve): Likewise.
12264
12265         * interface.cs (Interface.DefineType): Added support for generic
12266         interfaces.
12267
12268         * cs-parser.jay: Added support for generic structs and interfaces.
12269
12270 2003-10-17  Martin Baulig  <martin@ximian.com>
12271
12272         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
12273         call generic methods :-)
12274
12275 2003-10-16  Martin Baulig  <martin@ximian.com>
12276
12277         * cs-parser.jay (namespace_or_type_name): Only create a
12278         GenericMemberAccess if we actually have type arguments.
12279
12280 2003-10-13  Martin Baulig  <martin@ximian.com>
12281
12282         * class.cs (Method.Define): If we're a generic method, call
12283         TypeBuilder.DefineGenericMethod () before resolving
12284         the parameters.
12285         (MethodData): Added .ctor which takes an additional MethodBuilder
12286         argument; this is used for generic methods.
12287         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
12288         we already have a MethodBuilder.
12289
12290 2003-10-10  Martin Baulig  <martin@ximian.com>
12291
12292         * class.cs (Method): Added .ctor which takes a `GenericMethod'
12293         instead of a `DeclSpace'.  This is used for generic methods.
12294
12295         * cs-parser.jay (method_header): Added support for generic
12296         methods; create a `GenericMethod' instance and pass it to the
12297         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
12298         parameters and locals.
12299
12300         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
12301         since we already have the location.  Check whether we're a generic
12302         type declaration or a generic method and create the correct type
12303         parameter.
12304
12305         * generic.cs (TypeParameter.DefineMethod): New public method.
12306         (GenericMethod): New public class; derives from DeclSpace and is
12307         used for generic methods.       
12308
12309 2003-10-09  Martin Baulig  <martin@ximian.com>
12310
12311         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12312         to the .ctor.
12313         (MethodCore.DoDefineParameters): Removed the TypeContainer
12314         argument; use the DeclSpace which was passed to the .ctor instead.
12315         (MethodCore.CheckParameter): Take a DeclSpace instead of a
12316         TypeContainer; we only need a DeclSpace here.
12317
12318 2003-10-09  Martin Baulig  <martin@ximian.com>
12319
12320         * class.cs (MethodData): Added additional `DeclSpace ds' argument
12321         to the .ctor.
12322         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12323         EmitContext's .ctor.    
12324
12325 2003-10-09  Martin Baulig  <martin@ximian.com>
12326
12327         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12328         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12329         AsAccessible(), moved them as well.
12330
12331         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12332
12333 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
12334
12335         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12336         generation for >=, as spotted by Paolo, bug 48679.  
12337         Patch from David Waite.
12338
12339         * cs-tokenizer.cs: Add handling for #pragma.
12340
12341         * cs-parser.jay: Allow for both yield and yield return in the
12342         syntax.  The anti-cobolization of C# fight will go on!
12343
12344         * class.cs (TypeBuilder.DefineType): Catch error condition here
12345         (Parent.DefineType erroring out and returning null).
12346
12347         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12348         coping with enumerations variables, we were mistakenly processing
12349         them as a regular value type instead of built-in types.  Fixes the
12350         bug #48063
12351
12352         * typemanager.cs (IsBuiltinOrEnum): New method.
12353
12354 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
12355
12356         * cs-parser.jay: Upgrade: yield now needs the return clause.
12357
12358 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12359
12360         * cs-parser.jay : Renamed yyName to yyNames related to jay.
12361
12362 2003-09-29  Martin Baulig  <martin@ximian.com>
12363
12364         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
12365         inflated generic methods.
12366
12367         * generics.cs (ConstructedType): Distinguish between open and
12368         closed constructed types; correctly resolve the arguments.
12369
12370 2003-09-22  Martin Baulig  <martin@ximian.com>
12371
12372         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
12373         all type arguments meet their constraints.
12374
12375 2003-09-19  Martin Baulig  <martin@ximian.com>
12376
12377         * decl.cs (MemberCache.SetupCacheForInterface): Take a
12378         `MemberCache parent' argument.  Normally, an interface doesn't
12379         have a parent type except System.Object, but we use this in gmcs
12380         for generic type parameters.
12381
12382 2003-09-18  Martin Baulig  <martin@ximian.com>
12383
12384         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12385         on `type.IsInterface'; don't check whether the type has a parent
12386         to determine whether it's an interface.
12387
12388 2003-09-17  Martin Baulig  <martin@ximian.com>
12389
12390         * generic.cs (ConstructedType.ToString): Always use `name' as the
12391         type name.
12392
12393 2003-09-15  Martin Baulig  <martin@ximian.com>
12394
12395         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
12396
12397         * generic.cs (Constraints.Resolve): New public method; this is
12398         called to resolve the constraint types and to check whether all
12399         the constraints are correct.
12400         (Constraints.Types): New public property.
12401         (TypeParameter.Resolve): New public method; resolves all the
12402         type's constraints.
12403
12404         * class.cs (TypeContainer.DefineType): Call
12405         TypeParameter.Resolve() before actually defining the type.
12406
12407 2003-09-15  Martin Baulig  <martin@ximian.com>
12408
12409         * class.cs (TypeContainer.DefineType): Added an error flag to
12410         avoid reporting duplicate CS0146's ("class definition is
12411         circular.").
12412
12413         * driver.cs (Driver.MainDriver): Abort if
12414         RootContext.ResolveTree() reported any errors.
12415
12416 2003-09-07  Martin Baulig  <martin@ximian.com>
12417
12418         * report.cs (Error, Warning): Added overloaded versions which take
12419         a `params object[] args' and call String.Format().
12420
12421 2003-09-07  Martin Baulig  <martin@ximian.com>
12422
12423         * decl.cs (DeclSpace..ctor): Don't call
12424         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12425         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
12426         (DeclSpace.RecordDecl): New method.
12427
12428         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12429
12430 2003-09-02  Ravi Pratap  <ravi@ximian.com>
12431
12432         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12433         value attributes to be applied to ParameterBuilders.
12434
12435         * class.cs (MethodCore.LabelParameters): Make static and more
12436         generic so that it can be used from other places - like interface
12437         methods, for instance.
12438
12439         * interface.cs (Interface.Emit): Call LabelParameters before
12440         emitting attributes on the InterfaceMethod.
12441
12442 2003-09-07  Martin Baulig  <martin@ximian.com>
12443
12444         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
12445         if the number of type parameters doesn't match.
12446
12447 2003-09-04  Martin Baulig  <martin@ximian.com>
12448
12449         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
12450         for arrays of generic type params (ie. `!0[]').
12451
12452 2003-09-04  Martin Baulig  <martin@ximian.com>
12453
12454         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
12455         for the moment.
12456
12457 2003-09-04  Martin Baulig  <martin@ximian.com>
12458
12459         * decl.cs (DeclSpace.LookupGeneric): New method.
12460         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
12461         moment.
12462
12463         * generic.cs (TypeParameterExpr): Take a TypeParameter as
12464         argument, not just a string.
12465         (TypeParameter.Define): New public method; this is called to
12466         actually define the generic parameter; after this, you can use the
12467         new `Type' property to get the type.
12468
12469 2003-09-04  Martin Baulig  <martin@ximian.com>
12470
12471         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
12472         is now an ArrayList; initialize the result of the `TypeParameters'
12473         property here.
12474         (DeclSpace.GetGenericData): Removed.
12475         (DeclSpace.LookupGeneric): Temporarily removed; we need to
12476         implement this in a different way.
12477         (DeclSpace.GetTypeParameters): Removed; there's now a
12478         `TypeParameters' property.
12479         (DeclSpace.TypeParameters): New public property.
12480
12481         * generic.cs (Constraints): Make this class public.
12482         (TypeParameter): New public class.
12483
12484 2003-09-04  Martin Baulig  <martin@ximian.com>
12485
12486         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
12487         generic parameters.
12488
12489         * class.cs (TypeContainer.DefineType): Call
12490         TypeBuilder.DefineGenericParameter () on all generic parameters if
12491         this is a generic type.
12492
12493 2003-08-28  Martin Baulig  <martin@ximian.com>
12494
12495         * sample-stack.il: Compile this with ilasm: "ilasm /dll
12496         sample-stack.il".
12497
12498         * sample-hello.cs: Compile this with gmcs: "gmcs
12499         /r:sample-stack.dll sample-hello.cs".
12500
12501 2003-08-28  Martin Baulig  <martin@ximian.com>
12502
12503         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
12504         the parameters to the generic type.
12505
12506 2003-08-28  Martin Baulig  <martin@ximian.com>
12507
12508         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
12509
12510 2003-08-28  Martin Baulig  <martin@ximian.com>
12511
12512         * cs-parser.jay (opt_type_argument_list): Use
12513         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
12514         (primary_expression): Replace `qualified_identifier' with `type_name'.
12515         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
12516
12517         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
12518         parser to check whether it is syntactically a type parameter list;
12519         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
12520         this case.
12521
12522 2003-08-26  Martin Baulig  <martin@ximian.com>
12523
12524         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12525         resolving aliases; fixes #47927.
12526
12527 2003-08-26  Martin Baulig  <martin@ximian.com>
12528
12529         * statement.cs (Using.DoResolve): This is internally emitting a
12530         try/finally clause, so we need to set ec.NeedExplicitReturn if we
12531         do not always return.  Fixes #47681.
12532
12533 2003-08-26  Martin Baulig  <martin@ximian.com>
12534
12535         * decl.cs (MemberCore): Moved WarningNotHiding(),
12536         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
12537         into MemberBase.
12538         (AdditionResult): Make this nested in DeclSpace.
12539         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
12540         argument; call NamespaceEntry.Define() unless we're nested in a
12541         class or struct.
12542
12543         * namespace.cs (Namespace.DefineName): New public function.  This
12544         is called from DeclSpace's .ctor to add 
12545         (Namespace.Lookup): Include DeclSpaces in the lookup.
12546
12547         * class.cs (Operator): Derive from MemberBase, not MemberCore.
12548
12549         * const.cs (Const): Derive from MemberBase, not MemberCore.     
12550
12551 2003-08-25  Martin Baulig  <martin@ximian.com>
12552
12553         * convert.cs (Convert.ExplicitReferenceConversion): When
12554         converting from an interface type to a class, unbox if the target
12555         type is a struct type.  Fixes #47822.
12556
12557 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12558
12559         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
12560         #47854.
12561
12562 2003-08-22  Martin Baulig  <martin@ximian.com>
12563
12564         * class.cs (TypeManager.DefineType): When defining a nested type,
12565         call DefineType() on our parent; fixes #47801.
12566
12567 2003-08-22  Martin Baulig  <martin@ximian.com>
12568
12569         * class.cs (MethodData.Define): While checking if a method is an
12570         interface implementation, improve the test a bit more to fix #47654.
12571
12572 2003-08-22  Martin Baulig  <martin@ximian.com>
12573
12574         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
12575         correctly; fixes #47722.
12576
12577 2003-08-22  Martin Baulig  <martin@ximian.com>
12578
12579         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
12580         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
12581
12582         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
12583
12584 2003-08-22  Martin Baulig  <martin@ximian.com>
12585
12586         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
12587         can only be assigned in static constructors.  Fixes #47161.
12588
12589 2003-08-22  Martin Baulig  <martin@ximian.com>
12590
12591         Rewrote and improved the flow analysis code.
12592
12593         * flowbranching.cs (FlowBranching): Make this class abstract.
12594         (FlowBranching.CreateBranching): New static function to create a
12595         new flow branching.
12596         (FlowBranchingBlock, FlowBranchingException): New classes.
12597         (FlowBranching.UsageVector.Type): New public readonly field.
12598         (FlowBranching.UsageVector.Breaks): Removed the setter.
12599         (FlowBranching.UsageVector.Returns): Removed the setter.
12600         (FlowBranching.UsageVector): Added Break(), Return(),
12601         NeverReachable() and Throw() methods to modify the reachability.
12602         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
12603         done by FlowBranching.Merge().
12604         (FlowBranching.UsageVector.MergeChild): New method; merges the
12605         merge result into the current vector.
12606         (FlowBranching.Merge): New abstract method to merge a branching.
12607
12608 2003-08-12  Martin Baulig  <martin@ximian.com>
12609
12610         * expression.cs (Indirection.CacheTemporaries): Create the
12611         LocalTemporary with the pointer type, not its element type.
12612
12613 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
12614
12615         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
12616         token was a keyword or not.
12617
12618         Add `error' options where an IDENTIFIER was expected;  Provide
12619         CheckToken and CheckIdentifierToken convenience error reporting
12620         functions. 
12621
12622         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
12623
12624         * decl.cs: Rename `NamespaceEntry Namespace' public field into
12625         NameSpaceEntry NameSpaceEntry.
12626
12627         (LookupInterfaceOrClass): Avoid creating a full qualified name
12628         from namespace and name: avoid doing lookups when we know the
12629         namespace is non-existant.   Use new Tree.LookupByNamespace which
12630         looks up DeclSpaces based on their namespace, name pair.
12631
12632         * driver.cs: Provide a new `parser verbose' to display the
12633         exception thrown during parsing.  This is turned off by default
12634         now, so the output of a failure from mcs is more graceful.
12635
12636         * namespace.cs: Track all the namespaces defined in a hashtable
12637         for quick lookup.
12638
12639         (IsNamespace): New method
12640
12641 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
12642
12643         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
12644         we know that we need to concatenate (full typename can never be
12645         null). 
12646
12647         * class.cs: ditto.
12648
12649         * statement.cs: Use a bitfield;  Do not initialize to null things
12650         which are done by the constructor by default.
12651
12652         * cs-parser.jay: bug fix, parameter was 4, not 3.
12653
12654         * expression.cs: Just use the property;
12655
12656         * statement.cs: No need for GetVariableInfo method.
12657
12658 2003-08-08  Martin Baulig  <martin@ximian.com>
12659
12660         * flowanalysis.cs (FlowReturns): This is now nested in the
12661         `FlowBranching' class.
12662         (MyBitVector): Moved this here from statement.cs.
12663         (FlowBranching.SiblingType): New enum type.
12664         (FlowBranching.CreateSibling): Added `SiblingType' argument.
12665
12666 2003-08-07  Martin Baulig  <martin@ximian.com>
12667
12668         * flowanalysis.cs (FlowBranchingType): This is now nested in the
12669         `FlowBranching' class and called `BranchingType'.
12670
12671 2003-08-07  Martin Baulig  <martin@ximian.com>
12672
12673         * flowanalysis.cs: Moved all the control flow analysis code into
12674         its own file.
12675
12676 2003-08-07  Martin Baulig  <martin@ximian.com>
12677
12678         * assign.cs (Assign.DoResolve): `target' must either be an
12679         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
12680         #37319.
12681
12682 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
12683
12684         * expression.cs (BinaryMethod): This kind of expression is created by the
12685         Binary class if it determines that the operator has to be handled
12686         by a method.
12687
12688         (BinaryDelegate): This kind of expression is created if we are
12689         dealing with a + or - operator on delegates.
12690
12691         (Binary): remove method, argumetns, and DelegateOperator: when
12692         dealing with methods, 
12693
12694         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
12695
12696         * statement.cs (Block): use bitfields for the three extra booleans
12697         we had in use.   Remove unused topblock parameter.
12698
12699         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
12700
12701         * assign.cs: Drop extra unneeded tests.
12702
12703 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
12704
12705         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
12706
12707         * statement.cs (Foreach): Use VariableStorage instead of
12708         LocalBuilders.   
12709
12710         * codegen.cs (VariableStorage): New class used by clients that
12711         require a variable stored: locals or fields for variables that
12712         need to live across yield.
12713
12714         Maybe provide a convenience api for EmitThis+EmitLoad?
12715
12716         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
12717         these bad boys.
12718
12719 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
12720
12721         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
12722         RemapParameterLValue): New methods that are used to turn a
12723         precomputed FieldInfo into an expression like this:
12724
12725                 instance.FieldInfo
12726
12727         The idea is to use this instead of making LocalVariableReference
12728         have more than one meaning.
12729
12730         * cs-parser.jay: Add error production to BASE.
12731
12732         * ecore.cs: Deal with TypeManager.GetField returning null, which
12733         is now a valid return value.
12734
12735         (FieldExprNoAddress): New expression for Fields whose address can
12736         not be taken.
12737
12738         * expression.cs (LocalVariableReference): During the resolve
12739         phases, create new expressions if we are in a remapping context.
12740         Remove code that dealt with remapping here.
12741
12742         (ParameterReference): same.
12743
12744         (ProxyInstance): New expression, like the `This' expression, but
12745         it is born fully resolved.  We know what we are doing, so remove
12746         the errors that are targeted to user-provided uses of `this'.
12747
12748         * statement.cs (Foreach): our variable is now stored as an
12749         Expression;  During resolution, follow the protocol, dont just
12750         assume it will return this.
12751
12752 2003-08-06  Martin Baulig  <martin@ximian.com>
12753
12754         * support.cs (SeekableStreamReader.cs): New public class.
12755
12756         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
12757         SeekableStreamReader instead of the normal StreamReader.
12758
12759 2003-08-04  Martin Baulig  <martin@ximian.com>
12760
12761         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
12762         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
12763         deambiguate casts and delegate invocations.
12764         (parenthesized_expression): Use the new tokens to ensure this is
12765         not a cast of method invocation.
12766
12767         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
12768         when reading a `)' and Deambiguate_CloseParens () was previously
12769         called.
12770
12771         * expression.cs (ParenthesizedExpression): New class.  This is
12772         just used for the CS0075 test.
12773         (Binary.DoResolve): Check for CS0075.   
12774
12775 2003-07-29  Ravi Pratap  <ravi@ximian.com>
12776
12777         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
12778         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
12779         reference comparison.
12780
12781         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
12782         examine the ReturnType for equality - this is necessary in the
12783         cases of implicit and explicit operators whose signature also
12784         includes the return type.
12785
12786 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
12787
12788         * namespace.cs: Cache the result of the namespace computation,
12789         instead of computing it every time.
12790
12791 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
12792
12793         * decl.cs: Use a global arraylist that we reuse over invocations
12794         to avoid excesive memory consumption.  Reduces memory usage on an
12795         mcs compile by one meg (45 average).
12796
12797         * typemanager.cs (LookupTypeReflection): In .NET pointers are
12798         private, work around that.
12799
12800 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
12801
12802         * literal.cs (IntLiteral): Define Zero and One static literals. 
12803
12804         * cs-parser.jay (integer_literal): use static literals to reduce
12805         memory usage for the most used literals (0, 1 and -1).  211kb
12806         reduced in memory usage.
12807
12808         Replace all calls to `new ArrayList' with `new
12809         ArrayList(4)' which is a good average number for most allocations,
12810         and also requires only 16 bytes of memory for its buffer by
12811         default. 
12812
12813         This reduced MCS memory usage in seven megabytes for the RSS after
12814         bootstrapping.
12815
12816 2003-07-28  Ravi Pratap  <ravi@ximian.com>
12817
12818         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
12819         handle params methods the correct way by forming only one
12820         applicable set with params and normal methods in them. Earlier we
12821         were looking at params methods only if we found no normal methods
12822         which was not the correct thing to do.
12823
12824         (Invocation.BetterFunction): Take separate arguments indicating
12825         when candidate and the best method are params methods in their
12826         expanded form.
12827
12828         This fixes bugs #43367 and #46199.
12829
12830         * attribute.cs: Documentation updates.
12831
12832         (CheckAttribute): Rename to CheckAttributeTarget.
12833         (GetValidPlaces): Rename to GetValidTargets.
12834
12835         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
12836         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
12837
12838         Fixes bug #44468.
12839
12840 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
12841
12842         * codegen.cs: Compute IsGeneric correctly.
12843
12844         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
12845         resolution. 
12846
12847         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
12848         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
12849         regressions, and I was chasing more bugs than I required.
12850
12851         * interface.cs: Use expressions for base type names (like classes
12852         and structs have been doing for a while now), and resolve that.
12853         This patch should probably go into head as well.
12854
12855         This makes it one less user of FindType.
12856
12857 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
12858
12859         This compiler can not self host currently.  Need to fix that.
12860         
12861         * Makefile: compile to `gmcs.exe'
12862
12863         * driver.cs: Turn on v2 by default on gmcs.
12864
12865         * generic.cs (ConstructedType): Does no longer take a container
12866         type argument;  That will be taken care of later.
12867
12868         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
12869         Use SimpleName to resolve for now, so we can continue the work on
12870         the parser, until we get Type.GetType that understands generics.
12871
12872         (ConstructedType.ToString): Implement
12873
12874         (TypeArguments.Resolve): Resolve the child expressions as types. 
12875         
12876         * cs-parser.jay: Rename interface_constraints to
12877         type_parameter_constraints
12878
12879         (namespace_or_type_name): Only use constructed types for the basic
12880         construction, we will deal with identifier<...> later.
12881
12882         (type/type_name): No longer call DecomposeQI, as
12883         namespace_or_type_name is always decoded now.
12884         
12885 2003-07-22  Ravi Pratap  <ravi@ximian.com>
12886
12887         * expression.cs (Invocation.OverloadResolve): Follow the spec more
12888         closely: we eliminate methods in base types when we have an
12889         applicable method in a top-level type.
12890
12891         Please see section 14.5.5.1 for an exact description of what goes
12892         on. 
12893
12894         This fixes bug #45127 and a host of other related to corlib compilation.
12895
12896         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
12897         array is the method corresponding to the top-level type (this is
12898         because of the changes made to icall.c) so we change this
12899         accordingly.
12900
12901         (MethodGroupExpr.Name): This too.
12902
12903         * typemanager.cs (GetElementType): New method which does the right
12904         thing when compiling corlib. 
12905
12906         * everywhere: Make use of the above in the relevant places.
12907
12908 2003-07-22  Martin Baulig  <martin@ximian.com>
12909
12910         * cs-parser.jay (invocation_expression): Moved
12911         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
12912         `cast_expression', but create a InvocationOrCast which later
12913         resolves to either an Invocation or a Cast.
12914
12915         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
12916         method; call this before EmitStatement() to make sure that this
12917         expression can be used as a statement.
12918
12919         * expression.cs (InvocationOrCast): New class; resolves to either
12920         an Invocation or a Cast.
12921
12922         * statement.cs (StatementExpression): Call ResolveStatement() on
12923         the ExpressionStatement before emitting it.
12924
12925 2003-07-21  Martin Baulig  <martin@ximian.com>
12926
12927         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
12928         `ref' and `out' attributes match; fixes #46220.
12929         (MemberAccess.ResolveMemberAccess): You can't reference a type
12930         through an expression; fixes #33180.
12931         (Indexers.GetIndexersForType): Don't return the indexers from
12932         interfaces the class implements; fixes #46502.
12933
12934 2003-07-21  Martin Baulig  <martin@ximian.com>
12935
12936         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
12937         CS0661 checks; fixes bug #30442.
12938
12939 2003-07-21  Martin Baulig  <martin@ximian.com>
12940
12941         * decl.cs (AdditionResult): Added `Error'.
12942
12943         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
12944
12945         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
12946         cs0031.cs actually work.
12947
12948  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
12949  
12950         * cs-parser.jay (namespace_name): do not use
12951         namespace_or_type_name, use qualified_identifier, because
12952         namespace_or_type_name will soon return a composed expression
12953         instead of a string.
12954  
12955         (namespace_or_type_name): Instead of returning a string, now this
12956         production returns an expression.
12957  
12958         * codegen.cs (EmitContext): Setup IsGeneric property based on
12959         whether our DeclSpace is generic, our the method is generic.
12960  
12961         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
12962         the method is generic.
12963  
12964         * cs-parser.jay (type_arguments, opt_type_argument_list,
12965         type_parameters, type_parameter_list, opt_type_parameter_list,
12966         type_parameter,, opt_type_parameter_constraints_clauses,
12967         type_parameter_constraints_clauses,
12968         type_parameter_constraint_clause, type_parameter_constraint,
12969         interface_constraints): Add new production
12970  
12971         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
12972         DeclSpace is generic or not.
12973  
12974         (DeclSpace.SetParameterInfo): New routine, used to set the
12975         parameter info for a type.
12976  
12977         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
12978         returns a GenericTypeExpr
12979  
12980         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
12981         generic, lookup the generic argument.
12982  
12983         * attribute.cs: Do not allow TypeParameterExpressions in
12984         Attributes.
12985  
12986         * class.cs: Do not allow the Main method to be defined in a
12987         Generic container.
12988  
12989         * expression.cs (SizeOf): Do not allow generic types to be used as
12990         arguments to sizeof.
12991  
12992         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
12993         it: whether a type is generic or not.  Only works for types we are
12994         currently building for now.
12995         
12996 2003-07-20  Martin Baulig  <martin@ximian.com>
12997
12998         * namespace.cs: Fixed that bug which caused a crash when compiling
12999         the debugger's GUI.
13000
13001 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
13002
13003         * typemanager.cs (LookupTypeReflection): Never expose types which
13004         are NotPublic, NestedPrivate, NestedAssembly, or
13005         NestedFamANDAssem.  We used to return these, and later do a check
13006         that would report a meaningful error, but the problem is that we
13007         would not get the real match, if there was a name override.
13008
13009 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
13010
13011         * namespace.cs (Namespace, Name): Do not compute the namespace
13012         name dynamically, compute it in the constructor.  This reduced
13013         memory usage by 1697 KB.
13014
13015         * driver.cs: Use --pause to pause at the end.
13016
13017 2003-07-17  Peter Williams  <peter@newton.cx>
13018
13019         * Makefile: Change the name of the test target so that it doesn't
13020         conflict with the recursive test target.
13021
13022 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
13023
13024         * expression.cs (LocalVariableReference.Emit, EmitAssign,
13025         AddressOf): Do not use EmitThis, that was wrong, use the actual
13026         this pointer.
13027
13028 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
13029
13030         * class.cs (MethodData.Define): While checking if a method is an
13031         interface implementation, improve the test: If we are not public
13032         (use new test here: use the computed MethodAttributes directly,
13033         instead of the parsed modifier flags) check if the `implementing'
13034         method comes from an interface or not.
13035
13036         * pending.cs (VerifyPendingMethods): Slightly better error
13037         message.
13038
13039         * makefile: add test target that does the mcs bootstrap.
13040
13041 2003-07-16  Ravi Pratap  <ravi@ximian.com>
13042
13043         * interface.cs (Define): Do nothing here since there are no
13044         members to populate etc. Move the attribute emission out of here
13045         since this was just totally the wrong place to put it. Attribute
13046         application happens during the 'Emit' phase, not in the 'Define'
13047         phase.
13048
13049         (Emit): Add this method and move the attribute emission here
13050
13051         * rootcontext.cs (EmitCode): Call the Emit method on interface
13052         types too.
13053
13054 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13055
13056         * expression.cs (OverloadResolve): Report error only if Location
13057         is not 'Null' which means that there was a probe going on.
13058
13059 2003-07-14  Martin Baulig  <martin@ximian.com>
13060
13061         * expression.cs (ConditionalLogicalOperator): New public class to
13062         implement user defined conditional logical operators.
13063         This is section 14.11.2 in the spec and bug #40505.
13064
13065 2003-07-14  Martin Baulig  <martin@ximian.com>
13066
13067         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
13068
13069 2003-07-14  Martin Baulig  <martin@ximian.com>
13070
13071         * codegen.cs (EmitContext.InFixedInitializer): New public field.
13072
13073         * ecore.cs (IVariable.VerifyFixed): New interface method.
13074
13075         * expression.cs (Unary.ResolveOperator): When resolving the `&'
13076         operator, check whether the variable is actually fixed.  Fixes bug
13077         #36055.  Set a variable definitely assigned when taking its
13078         address as required by the spec.
13079
13080         * statement.cs (LocalInfo.IsFixed): New field.
13081         (LocalInfo.MakePinned): Set `IsFixed' to true.
13082
13083 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13084
13085         * attribute.cs (Attribute.Resolve): While doing a Member lookup
13086         for .ctors, ensure that we only ask for members declared in the
13087         attribute type (BindingFlags.DeclaredOnly).
13088
13089         Fixes bug #43632.
13090
13091         * expression.cs (Error_WrongNumArguments): Report error 1501
13092         correctly the way CSC does.
13093
13094 2003-07-13  Martin Baulig  <martin@ximian.com>
13095
13096         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
13097         lookup on the fully qualified name, to make things like "X.X" work
13098         where "X.X" is a fully qualified type name, but we also have a
13099         namespace "X" in the using list.  Fixes #41975.
13100
13101 2003-07-13  Martin Baulig  <martin@ximian.com>
13102
13103         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
13104         function. If we're a CompoundAssign, we need to create an embedded
13105         CompoundAssign, not an embedded Assign.
13106         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
13107         Fixes #45854.
13108
13109 2003-07-13  Martin Baulig  <martin@ximian.com>
13110
13111         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
13112         work to fix bug #46088.
13113
13114 2003-07-13  Ravi Pratap <ravi@ximian.com>
13115
13116         * class.cs (Operator.Emit): Do not emit attributes here - it is
13117         taken care of by the Method class that we delegate too. This takes
13118         care of bug #45876.
13119
13120 2003-07-10  Martin Baulig  <martin@ximian.com>
13121
13122         * expression.cs (TypeOfVoid): New class.
13123         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
13124
13125 2003-07-10  Martin Baulig  <martin@ximian.com>
13126
13127         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
13128         bug #35957.
13129
13130 2003-07-10  Martin Baulig  <martin@ximian.com>
13131
13132         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
13133         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
13134
13135         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
13136
13137         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
13138
13139 2003-07-10  Martin Baulig  <martin@ximian.com>
13140
13141         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
13142         of decimal.  Fixes #42850.
13143
13144         NOTE: I also fixed the created byte blob, but this doesn't work on
13145         the MS runtime and csc never produces any byte blobs for decimal
13146         arrays.
13147
13148 2003-07-10  Martin Baulig  <martin@ximian.com>
13149
13150         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
13151         structs; fixes #32068.
13152         (Block.AddChildVariableNames): Fixed #44302.
13153
13154 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13155
13156         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
13157
13158 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13159
13160         * attribute.cs: And this test is onger needed.
13161
13162 2003-07-08  Martin Baulig  <martin@ximian.com>
13163
13164         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
13165         inaccessible types.  Fixes #36313.
13166
13167         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
13168
13169         * namespace.cs (NamespaceEntry): Create implicit entries for all
13170         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
13171         implicit entries for N1.N2 and N1.
13172
13173 2003-07-08  Martin Baulig  <martin@ximian.com>
13174
13175         Rewrote the handling of namespaces to fix a lot of the issues
13176         wrt. `using' aliases etc.
13177
13178         * namespace.cs (Namespace): Splitted this class into a
13179         per-assembly `Namespace' and a per-file `NamespaceEntry'.
13180
13181         * typemanager.cs (TypeManager.IsNamespace): Removed.
13182         (TypeManager.ComputeNamespaces): Only compute namespaces from
13183         loaded assemblies here, not the namespaces from the assembly we're
13184         currently compiling.
13185
13186 2003-07-08  Martin Baulig  <martin@ximian.com>
13187
13188         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
13189
13190 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13191
13192         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
13193         already fixed it.  
13194
13195         I thought about the memory savings here, but LookupTypeReflection
13196         is used under already very constrained scenarios.  Compiling
13197         corlib or mcs only exposes one hit, so it would not really reduce
13198         any memory consumption.
13199
13200 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13201
13202         * typemanager.cs: fixes bug #45889 by only adding public types from
13203         other assemblies to the list of known types.
13204
13205 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13206
13207         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
13208         on the type we resolved.
13209
13210 2003-07-05  Martin Baulig  <martin@ximian.com>
13211
13212         * pending.cs (PendingImplementation.ParentImplements): Don't
13213         create the proxy if the parent is abstract.
13214
13215         * class.cs (TypeContainer.DefineIndexers): Process explicit
13216         interface implementations first.  Fixes #37714.
13217
13218 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
13219
13220         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
13221         defined recursively;  but since we modify the input parameters
13222         (left is set to `this' temporarily), we reset this value if the
13223         left_is_explicit is false, which gives the original semantics to
13224         the code.  
13225
13226         * literal.cs (NullPointer): new class used to represent a null
13227         literal in a pointer context.
13228
13229         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
13230         type is a pointer, use a NullPointer object instead of a
13231         NullLiteral.   Closes 43687
13232
13233         (ExplicitConversion): Convert pointer values using
13234         the conv opcode to the proper type.
13235
13236         * ecore.cs (New): change ValueTypeVariable property into a method,
13237         that returns whether the valuetype is suitable for being used.
13238
13239         * expression.cs (Binary.DoNumericPromotions): Only return if we
13240         the int constant was a valid uint, and we can return both left and
13241         right as uints.  If not, we continue processing, to trigger the
13242         type conversion.  This fixes 39018.
13243
13244         * statement.cs (Block.EmitMeta): During constant resolution, set
13245         the CurrentBlock property on the emitcontext, so that we resolve
13246         constants propertly.
13247
13248 2003-07-02  Martin Baulig  <martin@ximian.com>
13249
13250         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
13251         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
13252
13253         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13254         than emitting it here.
13255
13256         * statement.cs: Fixed some more flow analysis bugs.
13257
13258 2003-07-02  Martin Baulig  <martin@ximian.com>
13259
13260         * class.cs (MethodData.Define): When implementing interface
13261         methods, set Final unless we're Virtual.
13262
13263         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
13264         check work for interface methods.
13265
13266 2003-07-01  Martin Baulig  <martin@ximian.com>
13267
13268         * ecore.cs (EmitContext.This): Replaced this property with a
13269         GetThis() method which takes a Location argument.  This ensures
13270         that we get the correct error location for a CS0188.
13271
13272 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
13273
13274         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13275         ImplicitStandardConversion.
13276
13277         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13278
13279 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
13280
13281         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13282         optimization.
13283
13284 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
13285
13286         * class.cs (Constructor.Define): Turn off initlocals for unsafe
13287         constructors.
13288
13289         (MethodData.Define): Turn off initlocals for unsafe methods.
13290
13291 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
13292
13293         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13294         complete;  Fixes #37521.
13295
13296         * delegate.cs: Use Modifiers.TypeAttr to compute the
13297         TypeAttributes, instead of rolling our own.  This makes the flags
13298         correct for the delegates.
13299
13300 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
13301
13302         * class.cs (Constructor.Define): Set the private flag for static
13303         constructors as well.
13304
13305         * cs-parser.jay (statement_expression): Set the return value to
13306         null, to avoid a crash when we catch an error.
13307
13308 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
13309
13310         * cs-parser.jay: Applied patch from Jackson that adds support for
13311         extern and unsafe modifiers to destructor declarations.
13312
13313         * expression.cs: Report error 21 if the user is trying to index a
13314         System.Array.
13315
13316         * driver.cs: Add an error message, suggested by the bug report.
13317
13318         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13319         if we do not have a ": this ()" constructor initializer.  Fixes 45149
13320
13321 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
13322
13323         * namespace.cs: Add some information to reduce FAQs.
13324
13325 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
13326
13327         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13328         underlying enumeration types.  Fixes #43915.
13329
13330         * expression.cs: Treat ushort/short as legal values to be used in
13331         bitwise operations.
13332
13333 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13334
13335         * delegate.cs: transfer custom attributes for paramenters from
13336         the delegate declaration to Invoke and BeginInvoke.
13337
13338 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13339
13340         * attribute.cs: handle custom marshalers and emit marshal info
13341         for fields, too.
13342
13343 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
13344
13345         * makefile.gnu: Added anonymous.cs to the compiler sources.
13346
13347 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
13348
13349         * iterators.cs: Change the name of the proxy class to include two
13350         underscores.
13351
13352         * cs-parser.jay: Update grammar to include anonymous methods.
13353
13354         * anonymous.cs: new file.
13355
13356 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
13357
13358         * class.cs (Field.Define): Add missing test for pointers and
13359         safety. 
13360
13361 2003-05-27  Ravi Pratap  <ravi@ximian.com>
13362
13363         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13364         we use the stobj opcode.
13365
13366         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13367         since it wasn't the correct fix. 
13368
13369         It still is puzzling that we are required to use stobj for IntPtr
13370         which seems to be a ValueType.
13371
13372 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
13373
13374         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13375         during regular simple name resolution.   Now, the trick is that
13376         instead of returning for processing the simplename, we do a
13377         TypeManager.LookupType (ie, a rooted lookup as opposed to a
13378         contextual lookup type).   If a match is found, return that, if
13379         not, return for further composition.
13380
13381         This fixes long-standing 30485.
13382
13383         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13384         using the address to initialize an object, do an Stobj instead of
13385         using the regular Stelem.
13386
13387         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13388         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13389         Because if we are a BaseIndexerAccess that value will be true.
13390         Fixes 43643.
13391
13392         * statement.cs (GotoCase.Resolve): Return after reporting an
13393         error, do not attempt to continue. 
13394
13395         * expression.cs (PointerArithmetic.Emit): If our operand is a
13396         long, convert our constants to match the operand before
13397         multiplying.  Convert to I type before adding.   Fixes 43670.
13398
13399 2003-05-14  Ravi Pratap  <ravi@ximian.com>
13400
13401         * enum.cs (ImplicitConversionExists) : Rename to
13402         ImplicitEnumConversionExists to remove ambiguity. 
13403
13404         * ecore.cs (NullCast): New type of cast expression class which
13405         basically is very similar to EmptyCast with the difference being
13406         it still is a constant since it is used only to cast a null to
13407         something else
13408         (eg. (string) null)
13409
13410         * convert.cs (ImplicitReferenceConversion): When casting a null
13411         literal, we return a NullCast.
13412
13413         * literal.cs (NullLiteralTyped): Remove - I don't see why this
13414         should be around anymore.
13415
13416         The renaming (reported was slightly wrong). Corrections:
13417
13418         ConvertImplicitStandard -> ImplicitConversionStandard
13419         ConvertExplicitStandard -> ExplicitConversionStandard
13420
13421         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13422         before passing them in !
13423
13424         * convert.cs (ImplicitConversionStandard): When comparing for
13425         equal expr and target types, ensure that expr is not a
13426         NullLiteral.
13427
13428         In general, we must not be checking (expr_type ==
13429         target_type) in the top level conversion methods
13430         (ImplicitConversion, ExplicitConversion etc). This checking is
13431         done in the methods that they delegate to.
13432
13433 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
13434
13435         * convert.cs: Move Error_CannotConvertType,
13436         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13437         ImplicitNumericConversion, ImplicitConversionExists,
13438         ImplicitUserConversionExists, StandardConversionExists,
13439         FindMostEncompassedType, FindMostSpecificSource,
13440         FindMostSpecificTarget, ImplicitUserConversion,
13441         ExplicitUserConversion, GetConversionOperators,
13442         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13443         TryImplicitIntConversion, Error_CannotConvertImplicit,
13444         ConvertImplicitRequired, ConvertNumericExplicit,
13445         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13446         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13447         its own file.
13448
13449         Perform the following renames:
13450
13451         StandardConversionExists -> ImplicitStandardConversionExists
13452         ConvertImplicit -> ImplicitConversion
13453         ConvertImplicitStandard -> ImplicitStandardConversion
13454         TryImplicitIntConversion -> ImplicitIntConversion
13455         ConvertImplicitRequired -> ImplicitConversionRequired
13456         ConvertNumericExplicit -> ExplicitNumericConversion
13457         ConvertReferenceExplicit -> ExplicitReferenceConversion
13458         ConvertExplicit -> ExplicitConversion
13459         ConvertExplicitStandard -> ExplicitStandardConversion
13460
13461 2003-05-19  Martin Baulig  <martin@ximian.com>
13462
13463         * statement.cs (TypeInfo.StructInfo): Made this type protected.
13464         (TypeInfo): Added support for structs having structs as fields.
13465
13466         * ecore.cs (FieldExpr): Implement IVariable.
13467         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13468         VariableInfo for the field.
13469
13470 2003-05-18  Martin Baulig  <martin@ximian.com>
13471
13472         * expression.cs (This.DoResolve): Report a CS0027 if we're
13473         emitting a field initializer.
13474
13475 2003-05-18  Martin Baulig  <martin@ximian.com>
13476
13477         * expression.cs (This.ResolveBase): New public function.
13478         (This.DoResolve): Check for CS0188.
13479
13480         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13481         This.Resolve().
13482
13483         * ecore.cs (MethodGroupExpr.DoResolve): Set the
13484         `instance_expression' to null if we don't have any non-static
13485         methods.
13486
13487 2003-05-18  Martin Baulig  <martin@ximian.com>
13488
13489         Reworked the way how local variables and parameters are handled by
13490         the flow analysis code.
13491
13492         * statement.cs (TypeInfo, VariableMap): New public classes.
13493         (VariableInfo): New public class.  This is now responsible for
13494         checking whether a variable has been assigned.  It is used for
13495         parameters and local variables.
13496         (Block.EmitMeta): Take the InternalParameters as argument; compute
13497         the layout of the flow vectors here.
13498         (Block.LocalMap, Block.ParameterMap): New public properties.
13499         (FlowBranching): The .ctor doesn't get the InternalParameters
13500         anymore since Block.EmitMeta() now computes the layout of the flow
13501         vector.
13502         (MyStructInfo): This class is now known as `StructInfo' and nested
13503         in `TypeInfo'; we don't access this directly anymore.
13504
13505         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13506         property and removed IsAssigned(), IsFieldAssigned(),
13507         SetAssigned() and SetFieldAssigned(); we now call them on the
13508         VariableInfo so we don't need to duplicate this code everywhere.
13509
13510         * expression.cs (ParameterReference): Added `Block block' argument
13511         to the .ctor.
13512         (LocalVariableReference, ParameterReference, This): The new
13513         VariableInfo class is now responsible for all the definite
13514         assignment stuff.
13515
13516         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13517         IsParameterAssigned, SetParameterAssigned): Removed.
13518
13519 2003-05-18  Martin Baulig  <martin@ximian.com>
13520
13521         * typemanager.cs (InitCoreTypes): Try calling
13522         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13523         the 3-args-version.  Corlib now also needs our `void_type'.
13524         (GetMethod): Added overloaded version which takes an optional
13525         `bool report_errors' to allow lookups of optional methods.
13526
13527 2003-05-12  Martin Baulig  <martin@ximian.com>
13528
13529         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13530         only used for locals and not for parameters.
13531
13532 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
13533
13534         * support.cs (InternalParameters.ParameterType): Return the
13535         ExternalType of the parameter.
13536
13537         * parameter.cs (Parameter.ExternalType): drop the two arguments,
13538         they were unused.
13539
13540 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
13541
13542         * class.cs (MethodData.Define): Do not set the `newslot' on
13543         interface members, if they are also flagged as "override".
13544
13545         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
13546         better code for ++i and i++.  This only works for static fields
13547         and local variables.
13548
13549         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
13550         want to pull the DeclSpace out of the builder_to_declspace instead
13551         of the TypeBuilder (like in TypeContainer.FindMembers).
13552
13553         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
13554         instead of LookupTypeContainer.  Fixes the crash on .NET for
13555         looking up interface members.
13556
13557         * const.cs: Create our own emit context during the Definition
13558         stage, so that constants are evaluated in the proper context, when
13559         a recursive definition happens.
13560
13561 2003-05-11  Martin Baulig  <martin@ximian.com>
13562
13563         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
13564         new block for a switch section.
13565         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
13566         the adding/lookup in the switch block.  Fixes #39828.
13567
13568 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
13569
13570         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
13571         functionality: I needed to convert the data after I had performed
13572         the add/sub operation into the operands type size.
13573
13574         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
13575         pass the type for the box operation, otherwise the resulting
13576         object would have been of type object.
13577
13578         (BoxedCast): Add constructor to specify the type to box as.
13579
13580 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
13581
13582         * iterators.cs: I was reusing the `count' variable inadvertently,
13583         take steps to not allow this to happen.
13584
13585 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
13586
13587         * attribute.cs (Attribute.Resolve): Params attributes are encoded
13588         by creating an array at the point where the params starts and
13589         putting all those arguments there, then adjusting the size of the
13590         array.
13591
13592 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
13593
13594         * expression.cs (New.AddressOf): Implement interface
13595         IMemoryLocation.  This is used when the `new' operator is used in
13596         the context of an invocation to a method on a value type.
13597
13598         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
13599         example. 
13600
13601         * namespace.cs: Also check the using aliases here.
13602
13603         * driver.cs: Move the test for using validity after the types have
13604         been entered, so we do a single pass that also includes the using
13605         aliases. 
13606
13607         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
13608         in the regular case.   CreateSiblingForFinally is doing extra
13609         error checking.
13610
13611         * attribute.cs (GetAttributeArgumentExpression): Store the result
13612         on an out value, and use the return value to indicate failure
13613         instead of using null (which is a valid return for Constant.GetValue).
13614
13615         * statement.cs: Perform the analysis flow for the increment
13616         portion after the statement, because this will be the real flow of
13617         execution.  Fixes #42385
13618
13619         * codegen.cs (EmitContext.EmitArgument,
13620         EmitContext.EmitStoreArgument): New helper functions when the
13621         RemapToProxy flag is set.
13622
13623         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
13624         function.
13625
13626         Add support for remapping parameters. 
13627
13628         * iterators.cs: Propagate parameter values;  Store parameter
13629         values in the proxy classes.
13630
13631 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
13632
13633         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
13634         need a proxy reference;  I do not know what I was thinking
13635
13636         * cs-parser.jay (constructor_initializer): catch another error,
13637         and display nice message.
13638
13639         (field_declaration): catch void field declaration
13640         to flag a better error. 
13641
13642         * class.cs (MemberBase.CheckBase): Report an error instead of a
13643         warning if a new protected member is declared in a struct. 
13644         (Field.Define): catch the error of readonly/volatile.
13645
13646         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
13647
13648         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
13649         volatile variable is taken
13650
13651 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
13652
13653         * statement.cs (Fixed.Resolve): Report an error if we are not in
13654         an unsafe context.
13655
13656 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
13657
13658         * typemanager.cs: reuse the code that handles type clashes for
13659         delegates and enumerations.
13660
13661         * class.cs (Report28): Always report.
13662
13663         * expression.cs (EncodeAsAttribute): Allow nulls here.
13664
13665 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
13666
13667         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
13668         the functionality for testing whether an expression is valid for
13669         an attribute here.  Also handle the case of arrays of elements
13670         being stored. 
13671
13672         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
13673         encoding a linear array into an array of objects that are suitable
13674         to be passed to an CustomAttributeBuilder.
13675
13676         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
13677
13678         * ecore.cs: (FieldExpr): Handle field remapping here.
13679
13680         * iteratators.cs: Pass the instance variable (if the method is an
13681         instance method) to the constructors, so we can access the field
13682         variables on the class.
13683
13684         TODO: Test this with structs.  I think the THIS variable on
13685         structs might have to be a pointer, and not a refenrece
13686
13687 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
13688
13689         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
13690         local variables to fields in a proxy class.
13691
13692         * iterators.cs (PopulateProxy): Rename our internal fields to
13693         <XXX>.  
13694         Create a <THIS> field if we are an instance method, so we can
13695         reference our parent container variables.
13696         (MapVariable): Called back from the EmitContext code to enter a
13697         new variable to field mapping into the proxy class (we just create
13698         a FieldBuilder).
13699
13700         * expression.cs
13701         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
13702         for using the remapped locals to fields.
13703
13704         I placed the code here, because that gives the same semantics to
13705         local variables, and only changes the Emit code.
13706
13707         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
13708         statements inside iterators.
13709         (VariableInfo): Add a FieldBuilder for the cases when we are
13710         remapping local variables to fields in a proxy class
13711
13712         * ecore.cs (SimpleNameResolve): Avoid testing two times for
13713         current_block != null.
13714
13715         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
13716         not cope with strings, as it has been moved to the
13717         TableSwitchEmit.  Fixed bug in switch generation.
13718
13719         * expression.cs (New.DoResolve): Provide more context for the user
13720         when reporting an error.
13721
13722         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
13723         pointers. 
13724
13725         * expression.cs (MemberAccess.DoResolve): When we get a type back,
13726         check the permissions for it.  Note than in a type-resolution
13727         context the check was already present in DeclSpace.ResolveType,
13728         but was missing from the MemberAccess.
13729
13730         (ArrayCreation.CheckIndices): warn if the user has
13731         more nested levels of expressions, but there are no more
13732         dimensions specified.  Avoids crash on bug 41906.
13733
13734 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
13735
13736         * statement.cs (Block): replace Implicit bool, for a generic
13737         flags.   
13738         New flag: `Unchecked'.  This is used during the EmitMeta phase
13739         (which is out-of-line with the regular Resolve/Emit process for a
13740         statement, as this is done ahead of time, but still gets a chance
13741         to call constant resolve).
13742
13743         (Block.Flags): new enum for adding a new flag.
13744
13745         (Block.EmitMeta): track the state of unchecked.
13746
13747         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
13748         to enable constant resolution to work there as well.
13749
13750 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
13751
13752         * typemanager.cs (ienumerable_type): Also look up
13753         System.Collections.IEnumerable. 
13754
13755 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
13756
13757         TODO: Test more than one conditional per method.
13758
13759         * class.cs (Indexer.Define): Report the location where the user is
13760         referencing the unsupported feature.
13761
13762         (MethodData): Overload the use of `conditionals' to
13763         minimize the creation of needless ArrayLists.   This saves roughly
13764         212kb on my machine.
13765
13766         (Method): Implement the new IIteratorContainer interface.
13767         (Method.SetYields): Implement the method by setting the ModFlags
13768         to contain METHOD_YIELDS.
13769
13770         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
13771         which just got set to null.
13772
13773         * iterators.cs: New file.
13774
13775         (Yield, YieldBreak): New statements.
13776
13777         * statement.cs (Return.Resolve): Flag an error if we are used in
13778         an iterator method.
13779
13780         * codegen.cs (InIterator): New flag set if the code is being
13781         compiled in an iterator method.
13782
13783         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
13784         internal modifier, and we just use it to avoid adding extra
13785         fields, as this is seldom used.  
13786
13787         * cs-parser.jay: Add yield_statement (yield and yield break).
13788
13789         * driver.cs: New flag -v2 to turn on version 2 features. 
13790
13791         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
13792         hashtable when v2 is enabled.
13793
13794 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
13795
13796         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
13797         there is already a namespace defined with this name.
13798
13799         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
13800         people upgraded their corlibs.
13801
13802         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
13803         always use fully qualified types, no need to use the compiler
13804         front end.
13805
13806         (TypeManager.IsNamespace): Use binarysearch.
13807
13808         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
13809         AddDelegate): I did not quite use the new IsValid API properly: I
13810         have to pass the short-name and the fullname.  I was passing only
13811         the basename instead of the fullname sometimes. 
13812
13813         (TypeContainer.DefineType): call NamespaceClash.
13814
13815         * interface.cs (Interface.DefineType): use NamespaceClash before
13816         defining the type.
13817
13818         * delegate.cs (Delegate.DefineType): use NamespaceClash before
13819         defining the type.
13820
13821         * enum.cs: (Enum.DefineType): use NamespaceClash before
13822         defining the type.
13823
13824         * typemanager.cs (: 3-line patch that gives us some tasty 11%
13825         speed increase.  First, use the negative_hits cache when we get a
13826         negative.  Second, add the type with its full original name
13827         instead of the new . and + encoded name (reflection uses + to
13828         separate type from a nested type).  Use LookupTypeReflection
13829         directly which bypasses the type->name hashtable (that we already
13830         know does not contain the type.
13831
13832         * decl.cs (DeclSpace.ResolveTypeExpr): track the
13833         location/container type. 
13834
13835         * driver.cs: When passing utf8, use directly the UTF8Encoding.
13836
13837 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
13838
13839         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
13840
13841         * delegate.cs (NewDelegate.Resolve): Test whether an instance
13842         method is being referenced in the method group from a static
13843         context, and report error 120 if so.
13844
13845         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
13846         Error118. 
13847
13848         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
13849         is created, we create the A namespace).
13850
13851         * cs-parser.jay: A namespace also introduces a DeclarationFound.
13852         Fixes #41591
13853
13854 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
13855
13856         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
13857         invocation to ModuleBuilder.GetType with the same values will
13858         return a new type instance, so we need to cache its return
13859         values. 
13860
13861         * expression.cs (Binary.ResolveOperator): Only allow the compare
13862         operators on enums if they are of the same type.
13863
13864         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
13865         types of ValueType on their own case.  Before we were giving them
13866         the same treatment as objects.
13867
13868         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
13869         fullname.  Short name is used to compare against container name.
13870         Fullname is used to check against defined namespace names.
13871
13872         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
13873         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
13874
13875         (Method.CheckBase): Call parent.
13876         (MemberBase.CheckBase): Check for protected members on sealed
13877         classes.
13878         (PropertyBase.CheckBase): Call parent.
13879         (Field.Define): Call parent.
13880
13881         * report.cs: Negative error codes are now mapped to 8000 - code,
13882         so that the display is render more nicely.
13883
13884         * typemanager.cs: Do not use try/catch, instead report a regular
13885         error. 
13886
13887         (GetPointerType, GetReferenceType): These methods provide
13888         mechanisms to obtain the T* and T& from a T.  We had the code
13889         previously scattered around the code base, and it also used
13890         TypeManager.LookupType that would go through plenty of caches.
13891         This one goes directly to the type source.
13892
13893         In some places we did the Type.GetType followed by
13894         ModuleBuilder.GetType, but not in others, so this unifies the
13895         processing as well.
13896
13897         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
13898         statements now that we have namespace information.
13899
13900         * typemanager.cs (IsNamespace): New method, returns whether the
13901         string presented is a namespace or not.
13902
13903         (ComputeNamespaces): New public entry point, computes the list of
13904         available namespaces, using the GetNamespaces API call in Mono, or
13905         the slower version in MS.NET.   
13906
13907         Now before we start the semantic analysis phase, we have a
13908         complete list of namespaces including everything that the user has
13909         provided.
13910
13911         Deleted old code to cache namespaces in .nsc files.
13912
13913 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
13914
13915         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
13916         class/struct location definition Location for the implicit
13917         constructor location.
13918
13919         (Operator.Define): Use the location of the operator for the
13920         implicit Method definition.
13921
13922         (Constructor.Emit): use the constructor location for the implicit
13923         base initializer constructor.
13924
13925         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
13926         and the Expression class now contains two new methods:
13927
13928         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
13929         isolate type lookup from the rest of the resolution process.
13930
13931         Since we use Expressions to hold type definitions due to the way
13932         we parse the input we have historically overloaded Resolve to
13933         perform the Type lookups if a special flag is passed.  Now this is
13934         eliminated and two methods take their place. 
13935
13936         The differences in the two methods between xStep and xTerminal is
13937         that xStep is involved in our current lookup system that uses
13938         SimpleNames to compose a name, while xTerminal is used just to
13939         catch the case where the simplename lookup failed.
13940
13941 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
13942
13943         * expression.cs (ResolveMemberAccess): Remove redundant code.
13944         TypeExpr expressions are always born fully resolved.
13945
13946         * interface.cs (PopulateMethod): Do not lookup the types twice.
13947         We were doing it once during SemanticAnalysis and once during
13948         PopulateMethod.
13949
13950         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
13951         in local variable type definitions, were being returned as a
13952         SimpleName (we decomposed everything into a string), that is
13953         because primary_expression was being used instead of a type in the
13954         grammar (reduce/reduce conflicts).
13955
13956         The part that was wrong is that we converted the expression into a
13957         string (an oversimplification in one hand, compounded with primary
13958         expressions doing string concatenation).
13959
13960         So things like:
13961
13962         A.B.C [] x;
13963
13964         Would return "A.B.C[]" as a SimpleName.  This stopped things like
13965         using clauses from working on this particular context.  And a type
13966         was being matched directly against "A.B.C[]".
13967
13968         We now use the correct approach, and allow for ComposedCast to be
13969         part of the unary expression.  So the "A.B.C []" become a composed
13970         cast of "A.B.C" (as a nested group of MemberAccess with a
13971         SimpleName at the end) plus the rank composition "[]". 
13972
13973         Also fixes 35567
13974
13975 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
13976
13977         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
13978         for the access level checking.
13979
13980         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
13981         `TypeContainer container', because I kept getting confused when I
13982         was debugging this code.
13983
13984         * expression.cs (Indexers): Instead of tracking getters/setters,
13985         we now track them in parallel.  We create one arraylist less, but
13986         most importantly it is possible now for the LValue code to find a
13987         matching get for a set.
13988
13989         (IndexerAccess.DoResolveLValue): Update the code.
13990         GetIndexersForType has been modified already to extract all the
13991         indexers from a type.  The code assumed it did not.
13992
13993         Also make the code set the correct return type for the indexer.
13994         This was fixed a long time ago for properties, but was missing for
13995         indexers.  It used to be void_type.
13996
13997         (Binary.Emit): Test first for doubles instead of
13998         floats, as they are more common.
13999
14000         (Binary.EmitBranchable): Use the .un version of the branch opcodes
14001         when dealing with floats and the <=, >= operators.  This fixes bug
14002         #39314 
14003
14004         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14005         to load the array value by emitting a load on the foreach variable
14006         type.  This was incorrect.  
14007
14008         We now emit the code to load an element using the the array
14009         variable type, and then we emit the conversion operator.
14010
14011         Fixed #40176
14012
14013 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
14014
14015         * attribute.cs: Avoid allocation of ArrayLists in the common case.
14016
14017 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
14018
14019         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
14020         test for protection before we test for signatures. 
14021
14022         (MethodSignature.ToString): implement.
14023
14024         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
14025         to the case where we reduced into a LongConstant.
14026
14027         * decl.cs (CheckAccessLevel): If the type is an array, we can not
14028         depend on whether the information is acurrate, because the
14029         Microsoft runtime will always claim that the array type is public,
14030         regardless of the real state.
14031
14032         If the type is a pointer, another problem happens: the type is
14033         reported as non-public in Microsoft.  
14034
14035         In both cases we have to call CheckAccessLevel recursively with
14036         the underlying type as the argument to be tested.
14037
14038 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
14039
14040         * assign.cs (Assign.Emit): If we are dealing with a compound
14041         assignment expression, we should use the code path that stores the
14042         intermediate result in a temporary value.  This fixes #40903.
14043
14044         *expression.cs (Indirection.ToString): Provide ToString method for
14045         debugging. 
14046
14047 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
14048
14049         * class.cs: Null out fields holding references to Block objects so
14050         they can be garbage collected.
14051
14052         * expression.cs (OverloadResolve): Remove unused local.
14053
14054 2003-04-07  Martin Baulig  <martin@ximian.com>
14055
14056         * codegen.cs (EmitContext.CurrentFile): New public field.
14057         (EmitContext.Mark): Use the CurrentFile to check whether the
14058         location is in the correct file.
14059         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
14060
14061 2003-04-07  Martin Baulig  <martin@ximian.com>
14062
14063         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
14064
14065         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
14066         location.  [FIXME: The location argument which gets passed to this
14067         method is sometimes wrong!]
14068
14069 2003-04-07  Nick Drochak <ndrochak@gol.com>
14070
14071         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
14072
14073 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
14074
14075         * expression.cs (Indirection.EmitAssign): We were using the
14076         temporary, but returning immediately instead of continuing the
14077         EmitAssing flow.
14078
14079 2003-04-06  Martin Baulig  <martin@ximian.com>
14080
14081         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
14082         if it's a nested child, but also deriving from the outer class.
14083         See test 190.cs.
14084
14085         * typemanager.cs (IsNestedChildOf): Make this work if it's a
14086         nested child, but also deriving from the outer class.  See
14087         test-190.cs.
14088         (FilterWithClosure): We may access private members of the outer
14089         class if we're a nested child and deriving from the outer class.
14090         (RealMemberLookup): Only set `closure_private_ok' if the
14091         `original_bf' contained BindingFlags.NonPublic.
14092
14093 2003-04-05  Martin Baulig  <martin@ximian.com>
14094
14095         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
14096         probe if its a type parameter, and if so, flag an error.
14097
14098         * decl.cs: Move here the SetParameterInfo code from class.cs.
14099         Handle IsGeneric here.
14100
14101         Handle a variety of errors in the parameter info definition.
14102
14103         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
14104         type parameters here.
14105
14106         * cs-parser.jay (class_declaration): report errors for parameters
14107         here as well.
14108
14109 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
14110
14111         * generic.cs: New file, contains support code for generics.
14112
14113         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
14114         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
14115
14116         Update parser for the above removals.
14117
14118         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
14119         now taken care of in the parser.
14120
14121 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
14122
14123         * class.cs (Event.Define): Do not allow abstract events to have
14124         initializers. 
14125
14126 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
14127
14128         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
14129         block in event declarations.
14130
14131         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
14132         value type, get its address.
14133
14134         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
14135         leaving a class on the stack instead of a boolean value (int
14136         0/1).  Change the code so we compare against null, and then the
14137         result against zero.
14138
14139         * class.cs (TypeContainer.GetClassBases): We were checking for the
14140         parent class being sealed too late.
14141
14142         * expression.cs (Binary.Emit): For <= and >= when dealing with
14143         floating point values, use cgt.un and clt.un instead of cgt and
14144         clt alone.
14145
14146 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
14147
14148         * statement.cs: Apply the same optimization as MS: skip the 
14149         GetEnumerator returning an IEnumerator, and use the one returning a 
14150         CharEnumerator instead. This allows us to avoid the try-finally block 
14151         and the boxing.
14152
14153 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
14154
14155         * cs-parser.jay: Attributes cannot be applied to
14156                          namespaces. Fixes #40473
14157
14158 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14159
14160         * class.cs:
14161         (Add*): check if the name is valid using the full name for constants,
14162         fields, properties and events.
14163
14164 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
14165
14166         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
14167         char constants to be part of the enumeration.
14168
14169         * expression.cs (Conditional.DoResolve): Add support for operator
14170         true. Implements the missing functionality from 14.12
14171
14172         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
14173         operator true/false as required by the spec.
14174
14175         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
14176         implicit conversion to boolean.
14177
14178         * statement.cs (Statement.ResolveBoolean): A boolean expression is
14179         also one where the type implements `operator true'. 
14180
14181         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
14182         get an expression that will invoke operator true based on an
14183         expression.  
14184
14185         (GetConversionOperators): Removed the hack that called op_True
14186         here.  
14187
14188         (Expression.ResolveBoolean): Move this from Statement.
14189
14190 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
14191
14192         * ecore.cs (FieldExpr): do not allow initialization of initonly
14193         fields on derived classes
14194
14195 2003-03-13  Martin Baulig  <martin@ximian.com>
14196
14197         * statement.cs (Block.Emit): Call ig.BeginScope() and
14198         ig.EndScope() when compiling with debugging info; call
14199         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
14200
14201 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
14202
14203         * expression.cs (Indexers): Do not construct immediately, allow
14204         for new members to be appended as we go.  Fixes 38143
14205
14206 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14207
14208         * expression.cs: save/restore context when resolving an unchecked
14209         expression.
14210
14211 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
14212
14213         * cfold.cs: Catch division by zero in modulus operator during
14214         constant folding.
14215
14216 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
14217
14218         * interface.cs (Interface.DefineMembers): Avoid defining members
14219         twice. 
14220
14221 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
14222
14223         * driver.cs: handle the +/- options for -noconfig
14224
14225         * statement.cs (Unckeched.Resolve): Also track the state of
14226         unchecked in the Resolve phase.
14227
14228 2003-02-27  Martin Baulig  <martin@ximian.com>
14229
14230         * ecore.cs (Expression.MemberLookup): Don't create a
14231         MethodGroupExpr for something which is not a method.  Fixes #38291.
14232
14233 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
14234
14235         * class.cs (MemberBase.CheckParameters): Also check that the type
14236         is unmanaged if it is a pointer.
14237
14238         * expression.cs (SizeOf.Resolve): Add location information.
14239
14240         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
14241         a managed type is declared.
14242
14243         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
14244         parameter modifiers as well.  Fixes bug 38606
14245
14246         * class.cs: Very sad.  Am backing out the speed up changes
14247         introduced by the ArrayList -> Array in the TypeContainer, as they
14248         were not actually that much faster, and introduced a bug (no error
14249         reports on duplicated methods).
14250
14251         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
14252         source first, this will guarantee that we have a valid expression
14253         before calling in lower levels functions that will require a
14254         resolved object.  Then use this original_source in the
14255         target.ResolveLValue instead of the original source that was
14256         passed to us.
14257
14258         Another change.  Use target.Resolve instead of LValueResolve.
14259         Although we are resolving for LValues, we will let the Assign code
14260         take care of that (it will be called again from Resolve).  This
14261         basically allows code like this:
14262
14263         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
14264         class Y { void A (X x) { x [0] += o; }
14265
14266         The problem was that the indexer was trying to resolve for
14267         set_Item (idx, object o) and never finding one.  The real set_Item
14268         was set_Item (idx, X).  By delaying the process we get the right
14269         semantics. 
14270
14271         Fixes bug 36505
14272
14273 2003-02-23  Martin Baulig  <martin@ximian.com>
14274
14275         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14276         while calling DoEmit ().
14277
14278         * codegen.cs (EmitContext.Mark): Don't mark locations in other
14279         source files; if you use the #line directive inside a method, the
14280         compiler stops emitting line numbers for the debugger until it
14281         reaches the end of the method or another #line directive which
14282         restores the original file.
14283
14284 2003-02-23  Martin Baulig  <martin@ximian.com>
14285
14286         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14287
14288 2003-02-23  Martin Baulig  <martin@ximian.com>
14289
14290         * statement.cs (Block.AddChildVariableNames): We need to call this
14291         recursively, not just for our immediate children.
14292
14293 2003-02-23  Martin Baulig  <martin@ximian.com>
14294
14295         * class.cs (Event.Define): Always make the field private, like csc does.
14296
14297         * typemanager.cs (TypeManager.RealMemberLookup): Make events
14298         actually work, fixes bug #37521.
14299
14300 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
14301
14302         * delegate.cs: When creating the various temporary "Parameters"
14303         classes, make sure that we call the ComputeAndDefineParameterTypes
14304         on those new parameters (just like we do with the formal ones), to
14305         allow them to be resolved in the context of the DeclSpace.
14306
14307         This fixes the bug that Dick observed in Bugzilla #38530.
14308
14309 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
14310
14311         * expression.cs (ResolveMemberAccess): When resolving a constant,
14312         do not attempt to pull a constant if the value was not able to
14313         generate a valid constant.
14314
14315         * const.cs (LookupConstantValue): Do not report more errors than required.
14316
14317 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14318
14319         * expression.cs: fixes bug #38328.
14320
14321 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14322
14323         * class.cs: Changed all the various members that can be part of a
14324         class from being an ArrayList to be an Array of the right type.
14325         During the DefineType type_list, interface_list, delegate_list and
14326         enum_list are turned into types, interfaces, delegates and enums
14327         arrays.  
14328
14329         And during the member population, indexer_list, event_list,
14330         constant_list, field_list, instance_constructor_list, method_list,
14331         operator_list and property_list are turned into their real arrays.
14332
14333         Although we could probably perform this operation earlier, for
14334         good error reporting we need to keep the lists and remove the
14335         lists for longer than required.
14336
14337         This optimization was triggered by Paolo profiling the compiler
14338         speed on the output of `gen-sample-program.pl' perl script. 
14339
14340         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
14341         not crash in methods like MemberLookupFailed that use this field.  
14342
14343         This problem arises when the compiler fails to resolve a type
14344         during interface type definition for example.
14345
14346 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14347
14348         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14349         inherit from System.Object, so we have to stop at null, not only
14350         when reaching System.Object.
14351
14352 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
14353
14354         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14355         DeclaredOnly because the parent indexer might have had a different
14356         name, but did not loop until the top of the hierarchy was reached.
14357
14358         The problem this one fixes is 35492: when a class implemented an
14359         indexer from an interface, we were getting the interface method
14360         (which was abstract) and we were flagging an error (can not invoke
14361         abstract method).
14362
14363         This also keeps bug 33089 functioning, and test-148 functioning.
14364
14365         * typemanager.cs (IsSpecialMethod): The correct way of figuring
14366         out if a method is special is to see if it is declared in a
14367         property or event, or whether it is one of the predefined operator
14368         names.   This should fix correctly #36804.
14369
14370 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
14371
14372         The goal here is to remove the dependency on EmptyCast.Peel ().
14373         Killing it completely.
14374
14375         The problem is that currently in a number of places where
14376         constants are expected, we have to "probe" for an EmptyCast, and
14377         Peel, which is not the correct thing to do, as this will be
14378         repetitive and will likely lead to errors. 
14379
14380         The idea is to remove any EmptyCasts that are used in casts that
14381         can be reduced to constants, so we only have to cope with
14382         constants. 
14383
14384         This bug hunt was triggered by Bug 37363 and the desire to remove
14385         the duplicate pattern where we were "peeling" emptycasts to check
14386         whether they were constants.  Now constants will always be
14387         constants.
14388
14389         * ecore.cs: Use an enumconstant here instead of wrapping with
14390         EmptyCast.  
14391
14392         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14393         throwing me off.  By handling this we can get rid of a few hacks.
14394
14395         * statement.cs (Switch): Removed Peel() code.
14396
14397 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
14398
14399         * class.cs: Location information for error 508
14400
14401         * expression.cs (New.DoResolve): Add a guard against double
14402         resolution of an expression.  
14403
14404         The New DoResolve might be called twice when initializing field
14405         expressions (see EmitFieldInitializers, the call to
14406         GetInitializerExpression will perform a resolve on the expression,
14407         and later the assign will trigger another resolution
14408
14409         This leads to bugs (#37014)
14410
14411         * delegate.cs: The signature for EndInvoke should contain any ref
14412         or out parameters as well.  We were not doing this in the past. 
14413
14414         * class.cs (Field.Define): Do not overwrite the type definition
14415         inside the `volatile' group.  Turns out that volatile enumerations
14416         were changing the type here to perform a validity test, which
14417         broke conversions. 
14418
14419 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
14420
14421         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14422         and structs, we do not want to load the instance variable
14423
14424         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14425         enum_type has to be handled like an object reference (implicit
14426         conversions exists from this to object), but the regular IsClass
14427         and IsValueType tests will never return true for this one.
14428
14429         Also we use TypeManager.IsValueType instead of type.IsValueType,
14430         just for consistency with the rest of the code (this is only
14431         needed if we ever use the construct exposed by test-180.cs inside
14432         corlib, which we dont today).
14433
14434 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
14435
14436         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14437         just InternalCall.
14438
14439 2003-02-09  Martin Baulig  <martin@ximian.com>
14440
14441         * namespace.cs (Namespace..ctor): Added SourceFile argument.
14442         (Namespace.DefineNamespaces): New static public method; this is
14443         called when we're compiling with debugging to add all namespaces
14444         to the symbol file.
14445
14446         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14447         pass it to the Namespace's .ctor.
14448
14449         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14450         and MethodBase arguments; pass the namespace ID to the symwriter;
14451         pass the MethodBase instead of the token to the symwriter.
14452         (SymbolWriter.DefineNamespace): New method to add a namespace to
14453         the symbol file.
14454
14455 2003-02-09  Martin Baulig  <martin@ximian.com>
14456
14457         * symbolwriter.cs: New file.  This is a wrapper around
14458         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
14459         methods here in near future.
14460
14461 2003-02-09  Martin Baulig  <martin@ximian.com>
14462
14463         * codegen.cs (EmitContext.Mark): Just pass the arguments to
14464         ILGenerator.MarkSequencePoint() which are actually used by the
14465         symbol writer.
14466
14467 2003-02-09  Martin Baulig  <martin@ximian.com>
14468
14469         * location.cs (SourceFile): New public sealed class.  This
14470         contains the name and an index which is used in the location's token.
14471         (Location): Reserve an appropriate number of bits in the token for
14472         the source file instead of walking over that list, this gives us a
14473         really huge performance improvement when compiling with debugging.
14474
14475         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14476         `SourceFile' argument instead of a string.
14477         (Driver.ProcessFile): Add all the files via Location.AddFile(),
14478         but don't parse/tokenize here, we need to generate the list of all
14479         source files before we do that.
14480         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
14481         the files.
14482
14483         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14484         instead of a string.
14485
14486         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14487         of a string.
14488
14489 2003-02-09  Martin Baulig  <martin@ximian.com>
14490
14491         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14492         filename on `#line default'.
14493
14494 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14495
14496         * statement.cs: don't clear the pinned var when the fixed statement
14497         returns from the method (fixes bug#37752).
14498
14499 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14500
14501         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
14502         to IsValueType.
14503
14504 2003-02-07  Martin Baulig  <martin@ximian.com>
14505
14506         * driver.cs: Removed the `--debug-args' command line argument.
14507
14508         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14509         automatically by the AsssemblyBuilder.
14510         (CodeGen.InitializeSymbolWriter): We don't need to call any
14511         initialization function on the symbol writer anymore.  This method
14512         doesn't take any arguments.
14513
14514 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
14515
14516         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14517         from referenced assemblies as well.
14518
14519 2003-02-02  Martin Baulig  <martin@ximian.com>
14520
14521         * class.cs (MethodData.Emit): Generate debugging info for external methods.
14522
14523 2003-02-02  Martin Baulig  <martin@ximian.com>
14524
14525         * class.cs (Constructor.Emit): Open the symbol writer before
14526         emitting the constructor initializer.
14527         (ConstructorInitializer.Emit): Call ec.Mark() to allow
14528         single-stepping through constructor initializers.
14529
14530 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
14531
14532         * class.cs: Handle error 549: do not allow virtual methods in
14533         sealed classes. 
14534
14535 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14536
14537         * decl.cs: Check access levels when resolving types
14538
14539 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14540
14541         * statement.cs: Add parameters and locals set in catch blocks that might 
14542         return to set vector
14543
14544 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
14545
14546         * class.cs (Operator): Set the SpecialName flags for operators.
14547
14548         * expression.cs (Invocation.DoResolve): Only block calls to
14549         accessors and operators on SpecialName methods.
14550
14551         (Cast.TryReduce): Handle conversions from char constants.
14552
14553
14554 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14555
14556         * statement.cs: small memory and time optimization in FlowBranching.
14557
14558 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
14559
14560         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14561         problem that the last fix but in the other sid (Set).
14562
14563         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14564         access when there is no indexer in the hierarchy.
14565
14566 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14567
14568         * class.cs: Combine some if statements.
14569
14570 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14571
14572         * driver.cs: fixed bug #37187.
14573
14574 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
14575
14576         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
14577         any indexer, it's needed to build a list with all the indexers in the
14578         hierarchy (AllGetters), else we have problems. Fixes #35653.
14579
14580 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
14581
14582         * class.cs (MethodData.Define): It is wrong for an interface
14583         implementation to be static in both cases: explicit and implicit.
14584         We were only handling this in one case.
14585
14586         Improve the if situation there to not have negations.
14587
14588         * class.cs (Field.Define): Turns out that we do not need to check
14589         the unsafe bit on field definition, only on usage.  Remove the test.
14590
14591 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14592
14593         * driver.cs: use assembly.Location instead of Codebase (the latest
14594         patch made mcs fail when using MS assemblies).
14595
14596 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
14597
14598         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
14599         get the path to *corlib.dll.
14600
14601 2003-01-21  Nick Drochak <ndrochak@gol.com>
14602
14603         * cs-tokenizer.cs:
14604         * pending.cs:
14605         * typemanager.cs: Remove compiler warnings
14606
14607 2003-01-20  Duncan Mak  <duncan@ximian.com>
14608
14609         * AssemblyInfo.cs: Bump the version number to 0.19.
14610
14611 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14612
14613         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
14614
14615 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
14616
14617         * class.cs (Constructor::Emit): Emit debugging info for constructors.
14618
14619 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
14620
14621         * cs-parser.jay: Small fix: we were not comparing the constructor
14622         name correctly.   Thanks to Zoltan for the initial pointer.
14623
14624 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
14625
14626         * cs-tokenizer.cs: Set file name when specified with #line
14627
14628 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
14629
14630         * cs-parser.jay: Only perform the constructor checks here if we
14631         are named like the class;  This will help provider a better
14632         error.  The constructor path is taken when a type definition is
14633         not found, but most likely the user forgot to add the type, so
14634         report that rather than the constructor error.
14635
14636 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
14637
14638         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
14639         allocations.
14640
14641 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14642
14643         * cs-parser.jay: Add cleanup call.
14644
14645 2003-01-13  Duncan Mak  <duncan@ximian.com>
14646
14647         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
14648         consistent with other methods.
14649
14650 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14651
14652         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
14653
14654 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
14655
14656         * attribute.cs: only set GuidAttr to true when we have a
14657         GuidAttribute.
14658
14659 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14660
14661         * ecore.cs:
14662         * expression.cs:
14663         * typemanager.cs: fixes to allow mcs compile corlib with the new
14664         Type.IsSubclassOf fix.
14665
14666 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
14667
14668         * expression.cs (LocalVariableReference.DoResolve): Classify a
14669         constant as a value, not as a variable.   Also, set the type for
14670         the variable.
14671
14672         * cs-parser.jay (fixed_statement): take a type instead of a
14673         pointer_type, so we can produce a better error message later.
14674
14675         * statement.cs (Fixed.Resolve): Flag types that are not pointers
14676         as an error.  
14677
14678         (For.DoEmit): Make inifinite loops have a
14679         non-conditional branch back.
14680
14681         (Fixed.DoEmit): First populate the pinned variables, then emit the
14682         statement, then clear the variables.  Before I was emitting the
14683         code once for each fixed piece.
14684
14685
14686 2003-01-08  Martin Baulig  <martin@ximian.com>
14687
14688         * statement.cs (FlowBranching.MergeChild): A break in a
14689         SWITCH_SECTION does not leave a loop.  Fixes #36155.
14690
14691 2003-01-08  Martin Baulig  <martin@ximian.com>
14692
14693         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
14694         lives in the same number space than `param_map'.  Fixes #36154.
14695
14696 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
14697
14698         * cs-parser.jay (constructor_declaration): Set the
14699         Constructor.ModFlags before probing for it.  This makes the
14700         compiler report 514, 515 and 132 (the code was there, but got
14701         broken). 
14702
14703         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
14704         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
14705         (GotoCase.Resolve): Set `Returns' to ALWAYS.
14706
14707 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
14708
14709         * enum.cs: create the enum static fields using the enum type.
14710
14711 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
14712
14713         * class.cs: don't try to create the ParamBuilder for the return
14714         type if it's not needed (and handle it breaking for the ms runtime
14715         anyway).
14716
14717 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
14718
14719         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
14720
14721 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
14722
14723         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
14724         the command.   This showed up while compiling the JANET source
14725         code, which used \r as its only newline separator.
14726
14727 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
14728
14729         * class.cs (Method.Define): If we are an operator (because it
14730         reuses our code), then set the SpecialName and HideBySig.  #36128
14731
14732 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
14733
14734         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
14735         exception, report error 120 `object reference required'.
14736
14737         * driver.cs: Add --pause option, used during to measure the size
14738         of the process as it goes with --timestamp.
14739
14740         * expression.cs (Invocation.DoResolve): Do not allow methods with
14741         SpecialName to be invoked.
14742
14743 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
14744
14745         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
14746         number before adding it.
14747
14748 2002-12-21  Ravi Pratap  <ravi@ximian.com>
14749
14750         * ecore.cs (StandardImplicitConversion): When in an unsafe
14751         context, we allow conversion between void * to any other pointer
14752         type. This fixes bug #35973.
14753
14754 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
14755
14756         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
14757         is not thrown when extensionless outputs are used 
14758
14759 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14760
14761         * rootcontext.cs: fixed compilation of corlib.
14762
14763 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
14764
14765         * attribute.cs (Attributes.Contains): Add new method.
14766
14767         * class.cs (MethodCore.LabelParameters): if the parameter is an
14768         `out' parameter, check that no attribute `[In]' has been passed.
14769
14770         * enum.cs: Handle the `value__' name in an enumeration.
14771
14772 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
14773
14774         * decl.cs: Added special case to allow overrides on "protected
14775         internal" methods
14776
14777 2002-12-18  Ravi Pratap  <ravi@ximian.com>
14778
14779         * attribute.cs (Attributes.AddAttributeSection): Rename to this
14780         since it makes much more sense.
14781
14782         (Attributes.ctor): Don't require a Location parameter.
14783
14784         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
14785
14786         * attribute.cs (ApplyAttributes): Remove extra Location parameters
14787         since we already have that information per attribute.
14788
14789         * everywhere : make appropriate changes.
14790
14791         * class.cs (LabelParameters): Write the code which actually
14792         applies attributes to the return type. We can't do this on the MS
14793         .NET runtime so we flag a warning in the case an exception is
14794         thrown.
14795
14796 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
14797
14798         * const.cs: Handle implicit null conversions here too.
14799
14800 2002-12-17  Ravi Pratap  <ravi@ximian.com>
14801
14802         * class.cs (MethodCore.LabelParameters): Remove the extra
14803         Type [] parameter since it is completely unnecessary. Instead
14804         pass in the method's attributes so that we can extract
14805         the "return" attribute.
14806
14807 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
14808
14809         * cs-parser.jay (parse): Use Report.Error to flag errors instead
14810         of ignoring it and letting the compile continue.
14811
14812         * typemanager.cs (ChangeType): use an extra argument to return an
14813         error condition instead of throwing an exception.
14814
14815 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
14816
14817         * expression.cs (Unary.TryReduce): mimic the code for the regular
14818         code path.  Perform an implicit cast in the cases where we can
14819         implicitly convert to one of the integral types, and then reduce
14820         based on that constant.   This fixes bug #35483.
14821
14822 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14823
14824         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
14825
14826 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14827
14828         * namespace.cs: fixed bug #35489.
14829
14830 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
14831
14832         * class.cs: Remove some dead code.
14833
14834         * cs-parser.jay: Estimate the number of methods needed
14835         (RootContext.MethodCount);
14836
14837         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
14838         numbers instead of StringBuilders.
14839
14840         * support.cs (PtrHashtable): Add constructor with initial size;
14841         We can now reduce reallocations of the method table.
14842
14843 2002-12-10  Ravi Pratap  <ravi@ximian.com>
14844
14845         * attribute.cs (ApplyAttributes): Keep track of the emitted
14846         attributes on a per-target basis. This fixes bug #35413.
14847
14848 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
14849
14850         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
14851         default to the Windows 1252 encoding.
14852
14853         (UnixParseOption): Support version, thanks to Alp for the missing
14854         pointer. 
14855
14856         * AssemblyInfo.cs: Add nice assembly information.
14857
14858         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
14859         (bug 35169).
14860
14861         * cs-parser.jay: Allow a trailing comma before the close bracked
14862         in the attribute_section production.
14863
14864         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
14865         address of the instance was being taken, I will take this out,
14866         because we take the address of the object immediately here.
14867
14868 2002-12-09  Ravi Pratap  <ravi@ximian.com>
14869
14870         * typemanager.cs (AreMultipleAllowed): Take care of the most
14871         obvious case where attribute type is not in the current assembly -
14872         stupid me ;-)
14873
14874 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
14875
14876         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
14877         definitions, instead of doing that afterwards.  
14878
14879         Also we use a nice little hack, depending on the constructor, we
14880         know if we are a "composed" name or a simple name.  Hence, we
14881         avoid the IndexOf test, and we avoid 
14882
14883         * codegen.cs: Add code to assist in a bug reporter to track down
14884         the source of a compiler crash. 
14885
14886 2002-12-07  Ravi Pratap  <ravi@ximian.com>
14887
14888         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
14889         types have been emitted for a given element and flag an error
14890         if something which does not have AllowMultiple set is used more
14891         than once.
14892
14893         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
14894         attribute types and their corresponding AllowMultiple properties
14895
14896         (AreMultipleAllowed): Check the property for a given type.
14897
14898         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
14899         property in the case we have a TypeContainer.
14900
14901         (Attributes.AddAttribute): Detect duplicates and just skip on
14902         adding them. This trivial fix catches a pretty gross error in our
14903         attribute emission - global attributes were being emitted twice!
14904
14905         Bugzilla bug #33187 is now fixed.
14906
14907 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
14908
14909         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
14910         instead of pp_and).
14911
14912         * expression.cs (Binary.ResolveOperator): I can only use the
14913         Concat (string, string, string) and Concat (string, string,
14914         string, string) if the child is actually a concatenation of
14915         strings. 
14916
14917 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
14918
14919         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
14920         context where we need a 2-character lookahead.
14921
14922         * pending.cs (PendingImplementation): Rework so we can keep track
14923         of interface types all the time, and flag those which were
14924         implemented by parents as optional.
14925
14926 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
14927
14928         * expression.cs (Binary.ResolveOperator): Use
14929         String.Concat(string,string,string) or
14930         String.Concat(string,string,string,string) when possible. 
14931
14932         * typemanager: More helper methods.
14933
14934
14935 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
14936
14937         * pending.cs: remove the bogus return from GetMissingInterfaces()
14938         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
14939
14940 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14941
14942         * namespace.cs: avoid duplicated 'using xxx' being added to
14943         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
14944         when we get more than one 'using' statement for the same namespace.
14945         Report a CS0105 warning for it.
14946
14947 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
14948
14949         * cs-tokenizer.cs (consume_identifier): use read directly, instead
14950         of calling getChar/putback, uses internal knowledge of it.    
14951
14952         (xtoken): Reorder tokenizer so most common patterns are checked
14953         first.  This reduces the compilation time in another 5% (from 8.11s
14954         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
14955
14956         The parsing time is 22% of the compilation in mcs, and from that
14957         64% is spent on the tokenization process.  
14958
14959         I tried using a binary search for keywords, but this is slower
14960         than the hashtable.  Another option would be to do a couple of
14961         things:
14962
14963                 * Not use a StringBuilder, instead use an array of chars,
14964                   with a set value.  Notice that this way we could catch
14965                   the 645 error without having to do it *afterwards*.
14966
14967                 * We could write a hand-parser to avoid the hashtable
14968                   compares altogether.
14969
14970         The identifier consumption process takes 37% of the tokenization
14971         time.  Another 15% is spent on is_number.  56% of the time spent
14972         on is_number is spent on Int64.Parse:
14973
14974                 * We could probably choose based on the string length to
14975                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
14976                   computations. 
14977
14978         Another 3% is spend on wrapping `xtoken' in the `token' function.
14979
14980         Handle 0xa0 as whitespace (#34752)
14981
14982 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
14983
14984         * typemanager.cs (IsCLRType): New routine to tell whether a type
14985         is one of the builtin types.  
14986
14987         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
14988         typecode in more places instead of doing pointer comparissions.
14989         We could leverage some knowledge about the way the typecodes are
14990         laid out.
14991
14992         New code to cache namespaces in assemblies, it is currently not
14993         invoked, to be used soon.
14994
14995         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
14996
14997         * expression.cs (Binary.ResolveOperator): specially handle
14998         strings, and do not perform user-defined operator overloading for
14999         built-in types.
15000
15001 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
15002
15003         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
15004         internalcall as it is a pretty simple operation;  Avoid whenever
15005         possible to call Char.IsLetter.
15006
15007         (consume_identifier): Cut by half the number of
15008         hashtable calls by merging the is_keyword and GetKeyword behavior.
15009
15010         Do not short-circuit, because if we do, we
15011         report errors (ie, #if false && true would produce an invalid
15012         directive error);
15013
15014
15015 2002-11-24  Martin Baulig  <martin@ximian.com>
15016
15017         * expression.cs (Cast.TryReduce): If we're in checked syntax,
15018         check constant ranges and report a CS0221.  Fixes #33186.
15019
15020 2002-11-24  Martin Baulig  <martin@ximian.com>
15021
15022         * cs-parser.jay: Make this work for uninitialized variable
15023         declarations in the `for' initializer.  Fixes #32416.
15024
15025 2002-11-24  Martin Baulig  <martin@ximian.com>
15026
15027         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
15028         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
15029
15030 2002-11-24  Martin Baulig  <martin@ximian.com>
15031
15032         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
15033         argument; if true, we also check for user-defined conversions.
15034         This is only needed if both arguments are of a user-defined type.
15035         Fixes #30443, added test-175.cs.
15036         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
15037
15038         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
15039
15040 2002-11-24  Martin Baulig  <martin@ximian.com>
15041
15042         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
15043         function to get the store opcode.
15044         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
15045         only emit the Ldelema if the store opcode is Stobj.  You must run
15046         both test-34 and test-167 to test this.  Fixes #34529.
15047
15048 2002-11-23  Martin Baulig  <martin@ximian.com>
15049
15050         * ecore.cs (Expression.MemberLookup): Added additional
15051         `qualifier_type' argument which is used when we're being called
15052         from MemberAccess.DoResolve() and null if we're called from a
15053         SimpleName lookup.
15054         (Expression.MemberLookupFailed): New method to report errors; this
15055         does the CS1540 check and reports the correct error message.
15056
15057         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
15058         argument for the CS1540 check and redone the way how we're dealing
15059         with private members.  See the comment in the source code for details.
15060         (FilterWithClosure): Reverted this back to revision 1.197; renamed
15061         `closure_start_type' to `closure_qualifier_type' and check whether
15062         it's not null.  It was not this filter being broken, it was just
15063         being called with the wrong arguments.
15064
15065         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
15066         and pass it the correct `qualifier_type'; this also does the error
15067         handling for us.
15068
15069 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
15070
15071         * expression.cs (Invocation.EmitParams): If the we are dealing
15072         with a non-built-in value type, load its address as well.
15073
15074         (ArrayCreation): Use a a pretty constant instead
15075         of the hardcoded value 2.   Use 6 instead of 2 for the number of
15076         static initializers.  
15077
15078         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
15079         because they are not really value types, just glorified integers. 
15080
15081         * driver.cs: Do not append .exe, the CSC compiler does not do it.
15082
15083         * ecore.cs: Remove redundant code for enumerations, make them use
15084         the same code path as everything else, fixes the casting issue
15085         with enumerations in Windows.Forms.
15086
15087         * attribute.cs: Do only cast to string if it is a string, the
15088         validation happens later.
15089
15090         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
15091         people upgrade their corlibs.
15092
15093         * ecore.cs: Oops, enumerations were not following the entire code path
15094
15095 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
15096
15097         * typemanager.cs (FilterWithClosure): Commented out the test for
15098         1540 in typemanager.cs, as it has problems when accessing
15099         protected methods from a parent class (see test-174.cs). 
15100
15101         * attribute.cs (Attribute.ValidateGuid): new method.
15102         (Attribute.Resolve): Use above.
15103
15104 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
15105
15106         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
15107
15108         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
15109         handling for enumerations, as we only needed the TypeContainer
15110         functionality to begin with (this is required for the fix below to
15111         work for enums that reference constants in a container class for
15112         example). 
15113
15114         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
15115
15116         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
15117         a valid TypeBuilder to perform lookups on.o
15118
15119         * class.cs (InheritableMemberSignatureCompare): Use true in the
15120         call to GetGetMethod and GetSetMethod, because we are comparing
15121         the signature, and we need to get the methods *even* if they are
15122         private. 
15123
15124         (PropertyBase.CheckBase): ditto.
15125
15126         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
15127         GotoCase.Resolve): Use Peel on EmpytCasts.
15128
15129         * ecore.cs (EmptyCast): drop child, add Peel method.
15130
15131 2002-11-17  Martin Baulig  <martin@ximian.com>
15132
15133         * ecore.cs (EmptyCast.Child): New public property.
15134
15135         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
15136         label resolved to an EmptyCast.  Fixes #34162.
15137         (GotoCase.Resolve): Likewise.
15138         (Block.EmitMeta): Likewise.
15139
15140 2002-11-17  Martin Baulig  <martin@ximian.com>
15141
15142         * expression.cs (Invocation.BetterConversion): Prefer int over
15143         uint; short over ushort; long over ulong for integer literals.
15144         Use ImplicitConversionExists instead of StandardConversionExists
15145         since we also need to check for user-defined implicit conversions.
15146         Fixes #34165.  Added test-173.cs.
15147
15148 2002-11-16  Martin Baulig  <martin@ximian.com>
15149
15150         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
15151         with the `true' and `false' literals.  Fixes #33151.
15152
15153 2002-11-16  Martin Baulig  <martin@ximian.com>
15154
15155         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
15156         October 22nd; don't do the cs1540 check for static members.
15157
15158         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
15159         now using our own filter here and doing the cs1540 check again.
15160
15161 2002-11-16  Martin Baulig  <martin@ximian.com>
15162
15163         * support.cs (InternalParameters): Don't crash if we don't have
15164         any fixed parameters.  Fixes #33532.
15165
15166 2002-11-16  Martin Baulig  <martin@ximian.com>
15167
15168         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
15169         when looking up static methods to make this work on Windows.
15170         Fixes #33773.
15171
15172 2002-11-16  Martin Baulig  <martin@ximian.com>
15173
15174         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
15175         a setter rather than using PropertyInfo.CanWrite.
15176
15177 2002-11-15  Nick Drochak  <ndrochak@gol.com>
15178
15179         * class.cs: Allow acces to block member by subclasses. Fixes build
15180         breaker.
15181
15182 2002-11-14  Martin Baulig  <martin@ximian.com>
15183
15184         * class.cs (Constructor.Emit): Added the extern/block check.
15185         Fixes bug #33678.
15186
15187 2002-11-14  Martin Baulig  <martin@ximian.com>
15188
15189         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
15190         iteration while looking for indexers, this is needed because the
15191         indexer may have a different name in our base classes.  Fixed the
15192         error reporting (no indexers at all, not get accessor, no
15193         overloaded match).  Fixes bug #33089.
15194         (IndexerAccess.DoResolveLValue): Likewise.
15195
15196 2002-11-14  Martin Baulig  <martin@ximian.com>
15197
15198         * class.cs (PropertyBase.CheckBase): Make this work for multiple
15199         indexers.  Fixes the first part of bug #33089.
15200         (MethodSignature.InheritableMemberSignatureCompare): Added support
15201         for properties.
15202
15203 2002-11-13  Ravi Pratap  <ravi@ximian.com>
15204
15205         * attribute.cs (Attribute.Resolve): Catch the
15206         NullReferenceException and report it since it isn't supposed to
15207         happen. 
15208
15209 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
15210
15211         * expression.cs (Binary.EmitBranchable): Also handle the cases for
15212         LogicalOr and LogicalAnd that can benefit from recursively
15213         handling EmitBranchable.  The code now should be nice for Paolo.
15214
15215 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
15216
15217         * typemanager.cs (LookupType): Added a negative-hit hashtable for
15218         the Type lookups, as we perform quite a number of lookups on
15219         non-Types.  This can be removed once we can deterministically tell
15220         whether we have a type or a namespace in advance.
15221
15222         But this might require special hacks from our corlib.
15223
15224         * TODO: updated.
15225
15226         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
15227         and double which avoids a conversion from an integer to a double.
15228
15229         * expression.cs: tiny optimization, avoid calling IsConstant,
15230         because it effectively performs the lookup twice.
15231
15232 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
15233
15234         But a bogus return here to keep the semantics of the old code
15235         until the Mono runtime is fixed.
15236
15237         * pending.cs (GetMissingInterfaces): New method used to remove all
15238         the interfaces that are already implemented by our parent
15239         classes from the list of pending methods. 
15240
15241         * interface.cs: Add checks for calls after ResolveTypeExpr.
15242
15243 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
15244
15245         * class.cs (Class.Emit): Report warning 67: event not used if the
15246         warning level is beyond 3.
15247
15248         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
15249         being a NullLiteral.
15250
15251         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
15252         specifiers. 
15253
15254         * class.cs (TypeContainer.GetClassBases): Cover a missing code
15255         path that might fail if a type can not be resolved.
15256
15257         * expression.cs (Binary.Emit): Emit unsigned versions of the
15258         operators. 
15259
15260         * driver.cs: use error 5.
15261
15262 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
15263
15264         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
15265
15266 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
15267
15268         * cs-parser.jay (switch_section): A beautiful patch from Martin
15269         Baulig that fixed 33094.
15270
15271 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
15272
15273         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15274         Check whether the base is abstract and report an error if so.
15275
15276         * expression.cs (IndexerAccess.DoResolveLValue,
15277         IndexerAccess.DoResolve): ditto. 
15278
15279         (Invocation.DoResolve): ditto.
15280
15281         (Invocation.FullMethodDesc): Improve the report string.
15282
15283         * statement.cs (Block): Eliminate IsVariableDefined as it is
15284         basically just a wrapper for GetVariableInfo.
15285
15286         * ecore.cs (SimpleName): Use new 
15287
15288         * support.cs (ReflectionParamter.ParameterType): We unwrap the
15289         type, as we return the actual parameter ref/unref state on a
15290         different call.
15291
15292 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
15293
15294         * support.cs: Return proper flags REF/OUT fixing the previous
15295         commit.  
15296
15297         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
15298         not used to mean `ref' but `ref or out' in ParameterReference
15299
15300         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15301         full type signature instead of calling TypeManger.CSharpName
15302         ourselves. 
15303
15304         * support.cs (InternalParameters.ParameterDesc): Do not compare
15305         directly to the modflags, because REF/OUT will actually be bitsets
15306         if set. 
15307
15308         * delegate.cs (VerifyMethod): Check also the modifiers.
15309
15310         * cs-tokenizer.cs: Fix bug where floating point values with an
15311         exponent where a sign was missing was ignored.
15312
15313         * driver.cs: Allow multiple assemblies to be specified in a single
15314         /r: argument
15315
15316 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
15317
15318         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
15319         because identifiers after a parenthesis would end up in this kind
15320         of production, and we needed to desamiguate it for having casts
15321         like:
15322
15323                 (UserDefinedType *) xxx
15324
15325 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
15326
15327         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
15328         we should set on the Bindingflags.NonPublic, but not turn on
15329         private_ok.  private_ok controls whether a Private member is
15330         returned (this is chekced on the filter routine), while the
15331         BindingFlags.NonPublic just controls whether private/protected
15332         will be allowed.   This fixes the problem part of the problem of
15333         private properties being allowed to be used in derived classes.
15334
15335         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
15336         so we can call the children DoResolveLValue method (this will
15337         properly signal errors on lvalue assignments to base properties)
15338
15339         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
15340         getter are null, and we have a property info, we know that this
15341         happened because the lookup failed, so we report an error 122 for
15342         protection level violation.
15343
15344         We also silently return if setter and getter are null in the
15345         resolve functions, this condition only happens if we have flagged
15346         the error before.  This is the other half of the problem. 
15347
15348         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15349         not have accessibility information, that is why we were returning
15350         true in the filter function in typemanager.cs.
15351
15352         To properly report 122 (property is inaccessible because of its
15353         protection level) correctly, we report this error in ResolveAccess
15354         by failing if both the setter and the getter are lacking (ie, the
15355         lookup failed). 
15356
15357         DoResolve and DoLResolve have been modified to check for both
15358         setter/getter being null and returning silently, the reason being
15359         that I did not want to put the knowledge about this error in upper
15360         layers, like:
15361
15362         int old = Report.Errors;
15363         x = new PropertyExpr (...);
15364         if (old != Report.Errors)
15365                 return null;
15366         else
15367                 return x;
15368
15369         So the property expr is returned, but it is invalid, so the error
15370         will be flagged during the resolve process. 
15371
15372         * class.cs: Remove InheritablePropertySignatureCompare from the
15373         class, as we no longer depend on the property signature to compute
15374         whether it is possible to implement a method or not.
15375
15376         The reason is that calling PropertyInfo.GetGetMethod will return
15377         null (in .NET, in Mono it works, and we should change this), in
15378         cases where the Get Method does not exist in that particular
15379         class.
15380
15381         So this code:
15382
15383         class X { public virtual int A { get { return 1; } } }
15384         class Y : X { }
15385         class Z : Y { public override int A { get { return 2; } } }
15386
15387         Would fail in Z because the parent (Y) would not have the property
15388         defined.  So we avoid this completely now (because the alternative
15389         fix was ugly and slow), and we now depend exclusively on the
15390         method names.
15391
15392         (PropertyBase.CheckBase): Use a method-base mechanism to find our
15393         reference method, instead of using the property.
15394
15395         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15396         routines are gone now.
15397
15398         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15399         names, they were incorrectly named.
15400
15401         * cs-tokenizer.cs: Return are more gentle token on failure. 
15402
15403         * pending.cs (PendingImplementation.InterfaceMethod): This routine
15404         had an out-of-sync index variable, which caused it to remove from
15405         the list of pending methods the wrong method sometimes.
15406
15407 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
15408
15409         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15410         CanWrite, because those refer to this particular instance of the
15411         property, and do not take into account the fact that we can
15412         override single members of a property.
15413
15414         Constructor requires an EmitContext.  The resolution process does
15415         not happen here, but we need to compute the accessors before,
15416         because the resolution does not always happen for properties.
15417
15418         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15419         subclass, before we did not update this flag, but we did update
15420         bindingflags. 
15421
15422         (GetAccessors): Drop this routine, as it did not work in the
15423         presence of partially overwritten set/get methods. 
15424
15425         Notice that this broke the cs1540 detection, but that will require
15426         more thinking. 
15427
15428 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15429
15430         * class.cs:
15431         * codegen.cs:
15432         * driver.cs: issue a warning instead of an error if we don't support
15433         debugging for the platform. Also ignore a couple of errors that may
15434         arise when trying to write the symbols. Undo my previous patch.
15435
15436 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15437
15438         * driver.cs: ignore /debug switch except for Unix platforms.
15439
15440 2002-10-23  Nick Drochak  <ndrochak@gol.com>
15441
15442         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15443
15444 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
15445
15446         * driver.cs: Do not make mcs-debug conditional, so we do not break
15447         builds that use it.
15448
15449         * statement.cs (UsageVector.MergeChildren): I would like Martin to
15450         review this patch.  But basically after all the children variables
15451         have been merged, the value of "Breaks" was not being set to
15452         new_breaks for Switch blocks.  I think that it should be set after
15453         it has executed.  Currently I set this to the value of new_breaks,
15454         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15455         conservative, but I do not understand this code very well.
15456
15457         I did not break anything in the build, so that is good ;-)
15458
15459         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15460
15461 2002-10-20  Mark Crichton  <crichton@gimp.org>
15462
15463         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
15464
15465 2002-10-20  Nick Drochak  <ndrochak@gol.com>
15466
15467         * cfold.cs: Fixed compile blocker.
15468
15469 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
15470
15471         * driver.cs: I was chekcing the key, not the file.
15472
15473 2002-10-19  Ravi Pratap  <ravi@ximian.com>
15474
15475         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15476         message that we were generating - we just need to silently return
15477         a null.
15478
15479 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
15480
15481         * class.cs (Event.Define): Change my previous commit, as this
15482         breaks the debugger.  This is a temporary hack, as it seems like
15483         the compiler is generating events incorrectly to begin with.
15484
15485         * expression.cs (Binary.ResolveOperator): Added support for 
15486         "U operator - (E x, E y)"
15487
15488         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15489         y)".
15490
15491         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15492         init-only variables, but this path did not take into account that
15493         there might be also instance readonly variables.  Correct this
15494         problem. 
15495
15496         This fixes bug 32253
15497
15498         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15499         delegates as well.
15500
15501         * driver.cs: Change the extension for modules to `netmodule'
15502
15503         * cs-parser.jay: Improved slightly the location tracking for
15504         the debugger symbols.
15505
15506         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15507         modifiers that were specified instead of the hardcoded value
15508         (FamAndAssem).  This was basically ignoring the static modifier,
15509         and others.  Fixes 32429.
15510
15511         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15512         fixed a bug in the process (32476)
15513
15514         * expression.cs (ArrayAccess.EmitAssign): Patch from
15515         hwang_rob@yahoo.ca that fixes bug 31834.3
15516
15517 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
15518
15519         * driver.cs: Make the module extension .netmodule.
15520
15521 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
15522
15523         * driver.cs: Report an error if the resource file is not found
15524         instead of crashing.
15525
15526         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15527         false, like Emit does.
15528
15529 2002-10-16  Nick Drochak  <ndrochak@gol.com>
15530
15531         * typemanager.cs: Remove unused private member.  Also reported mcs
15532         bug to report this as a warning like csc.
15533
15534 2002-10-15  Martin Baulig  <martin@gnome.org>
15535
15536         * statement.cs (Statement.Emit): Made this a virtual method; emits
15537         the line number info and calls DoEmit().
15538         (Statement.DoEmit): New protected abstract method, formerly knows
15539         as Statement.Emit().
15540
15541         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15542
15543 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
15544
15545         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15546         have fixed a remaining problem: not every AddXXXX was adding a
15547         fully qualified name.  
15548
15549         Now everyone registers a fully qualified name in the DeclSpace as
15550         being defined instead of the partial name.  
15551
15552         Downsides: we are slower than we need to be due to the excess
15553         copies and the names being registered this way.  
15554
15555         The reason for this is that we currently depend (on the corlib
15556         bootstrap for instance) that types are fully qualified, because
15557         we dump all the types in the namespace, and we should really have
15558         types inserted into the proper namespace, so we can only store the
15559         basenames in the defined_names array.
15560
15561 2002-10-10  Martin Baulig  <martin@gnome.org>
15562
15563         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15564         from bug #31834, see the bug report for a testcase which is
15565         miscompiled.
15566
15567 2002-10-10  Martin Baulig  <martin@gnome.org>
15568
15569         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
15570         flow analysis code for this.
15571
15572         * statement.cs (Do, While, For): Tell the flow analysis code about
15573         infinite loops.
15574         (FlowBranching.UsageVector): Added support for infinite loops.
15575         (Block.Resolve): Moved the dead code elimination here and use flow
15576         analysis to do it.
15577
15578 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
15579
15580         * class.cs (Field.Define): Catch cycles on struct type
15581         definitions. 
15582
15583         * typemanager.cs (IsUnmanagedtype): Do not recursively check
15584         fields if the fields are static.  We only need to check instance
15585         fields. 
15586
15587         * expression.cs (As.DoResolve): Test for reference type.
15588
15589         * statement.cs (Using.ResolveExpression): Use
15590         ConvertImplicitRequired, not ConvertImplicit which reports an
15591         error on failture
15592         (Using.ResolveLocalVariableDecls): ditto.
15593
15594         * expression.cs (Binary.ResolveOperator): Report errors in a few
15595         places where we had to.
15596
15597         * typemanager.cs (IsUnmanagedtype): Finish implementation.
15598
15599 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
15600
15601         * expression.cs: Use StoreFromPtr instead of extracting the type
15602         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
15603
15604         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
15605         an enumeration value to a System.Enum, but System.Enum is not a
15606         value type, but an class type, so we need to box.
15607
15608         (Expression.ConvertExplicit): One codepath could return
15609         errors but not flag them.  Fix this.  Fixes #31853
15610
15611         * parameter.cs (Resolve): Do not allow void as a parameter type.
15612
15613 2002-10-06  Martin Baulig  <martin@gnome.org>
15614
15615         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
15616         if it's a class type and not a struct.  Fixes #31815.
15617
15618 2002-10-06  Martin Baulig  <martin@gnome.org>
15619
15620         * statement.cs: Reworked the flow analysis code a bit to make it
15621         usable for dead code elimination.
15622
15623 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15624
15625         * cs-parser.jay: allow empty source files. Fixes bug #31781.
15626
15627 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15628
15629         * expression.cs (ComposedCast.DoResolveType): A quick workaround
15630         to fix the test 165, will investigate deeper.
15631
15632 2002-10-04  Martin Baulig  <martin@gnome.org>
15633
15634         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
15635         finally blocks actually work.
15636         (Try.Resolve): We don't need to create a sibling for `finally' if
15637         there is no finally block.
15638
15639 2002-10-04  Martin Baulig  <martin@gnome.org>
15640
15641         * class.cs (Constructor.Define): The default accessibility for a
15642         non-default constructor is private, not public.
15643
15644 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15645
15646         * class.cs (Constructor): Make AllowedModifiers public, add
15647         EXTERN.
15648
15649         * cs-parser.jay: Perform the modifiers test here, as the
15650         constructor for the Constructor class usually receives a zero
15651         because of the way we create it (first we create, later we
15652         customize, and we were never checking the modifiers).
15653
15654         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
15655         is a version of LookupTypeReflection that includes the type-name
15656         cache.  This can be used as a fast path for functions that know
15657         the fully qualified name and are only calling into *.GetType() to
15658         obtain a composed type.
15659
15660         This is also used by TypeManager.LookupType during its type
15661         composition.
15662
15663         (LookupType): We now also track the real type name, as sometimes
15664         we can get a quey for the real type name from things like
15665         ComposedCast.  This fixes bug 31422.
15666
15667         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
15668         complete type fullname, it does not have to go through the type
15669         resolution system to obtain the composed version of the type (for
15670         obtaining arrays or pointers).
15671
15672         (Conditional.Emit): Use the EmitBoolExpression to
15673         generate nicer code, as requested by Paolo.
15674
15675         (ArrayCreation.CheckIndices): Use the patch from
15676         hwang_rob@yahoo.ca to validate the array initializers. 
15677
15678 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
15679
15680         * class.cs (ConstructorInitializer.Emit): simplify code by using
15681         Invocation.EmitCall, and at the same time, fix the bugs in calling
15682         parent constructors that took variable arguments. 
15683
15684         * ecore.cs (Expression.ConvertNumericExplicit,
15685         Expression.ImplicitNumericConversion): Remove the code that
15686         manually wrapped decimal (InternalTypeConstructor call is now gone
15687         as well).
15688
15689         * expression.cs (Cast.TryReduce): Also handle decimal types when
15690         trying to perform a constant fold on the type.
15691
15692         * typemanager.cs (IsUnmanagedtype): Partially implemented.
15693
15694         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
15695         that only turned off an error report, and did nothing else. 
15696
15697 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
15698
15699         * driver.cs: Handle and ignore /fullpaths
15700
15701 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
15702
15703         * expression.cs (Binary.ResolveOperator): Catch the case where
15704         DoNumericPromotions returns true, 
15705
15706         (Binary.DoNumericPromotions): Simplify the code, and the tests.
15707
15708 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
15709
15710         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
15711         report error 70.
15712
15713 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
15714
15715         * ecore.cs (ConvertNumericExplicit): It is not enough that the
15716         conversion exists, but it is also required that the conversion be
15717         performed.  This manifested in "(Type64Enum) 2".  
15718
15719         * class.cs (TypeManager.AddMethod): The fix is not to change
15720         AddEnum, because that one was using a fully qualified name (every
15721         DeclSpace derivative does), but to change the AddMethod routine
15722         that was using an un-namespaced name.  This now correctly reports
15723         the duplicated name.
15724
15725         Revert patch until I can properly fix it.  The issue
15726         is that we have a shared Type space across all namespaces
15727         currently, which is wrong.
15728
15729         Options include making the Namespace a DeclSpace, and merge
15730         current_namespace/current_container in the parser.
15731
15732 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
15733
15734         * cs-parser.jay: Improve error reporting when we get a different
15735         kind of expression in local_variable_type and
15736         local_variable_pointer_type. 
15737
15738         Propagate this to avoid missleading errors being reported.
15739
15740         * ecore.cs (ImplicitReferenceConversion): treat
15741         TypeManager.value_type as a target just like object_type.   As
15742         code like this:
15743
15744         ValueType v = 1;
15745
15746         Is valid, and needs to result in the int 1 being boxed before it
15747         is assigned to the value type v.
15748
15749         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
15750         to validate the enumeration name.
15751
15752         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
15753         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
15754         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
15755
15756         * ecore.cs (TryImplicitIntConversion): When doing an
15757         implicit-enumeration-conversion, check if the type is 64-bits and
15758         perform a conversion before passing to EnumConstant.
15759
15760 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
15761
15762         * decl.cs (Error_AmbiguousTypeReference); New routine used to
15763         report ambiguous type references.  Unlike the MS version, we
15764         report what the ambiguity is.   Innovation at work ;-)
15765
15766         (DeclSpace.FindType): Require a location argument to
15767         display when we display an ambiguous error.
15768
15769         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
15770
15771         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
15772
15773         * expression.cs (EmitDynamicInitializers): Apply patch from
15774         hwang_rob@yahoo.ca that fixes the order in which we emit our
15775         initializers. 
15776
15777 2002-09-21  Martin Baulig  <martin@gnome.org>
15778
15779         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
15780         delegate takes no arguments.
15781
15782 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
15783
15784         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
15785         from integers.
15786
15787         * expression.cs: Extract the underlying type.
15788
15789         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
15790
15791         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
15792
15793 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
15794
15795         * class.cs (TypeContainer.DefineType): We can not use the nice
15796         PackingSize with the size set to 1 DefineType method, because it
15797         will not allow us to define the interfaces that the struct
15798         implements.
15799
15800         This completes the fixing of bug 27287
15801
15802         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
15803         means also structs.  This fixes part of the problem. 
15804         (Expresion.ImplicitReferenceConversionExists): ditto.
15805
15806         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
15807         error if there were no errors reported during the type lookup
15808         process, to avoid duplicates or redundant errors.  Without this
15809         you would get an ambiguous errors plus a type not found.  We have
15810         beaten the user enough with the first error.  
15811
15812         (DeclSparce.FindType): Emit a warning if we have an ambiguous
15813         reference. 
15814
15815         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
15816         during the resolution process, stop the lookup, this avoids
15817         repeated error reports (same error twice).
15818
15819         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
15820
15821         * typemanager.cs (LookupType): Redo the type lookup code to match
15822         the needs of System.Reflection.  
15823
15824         The issue is that System.Reflection requires references to nested
15825         types to begin with a "+" sign instead of a dot.  So toplevel
15826         types look like: "NameSpace.TopLevelClass", and nested ones look
15827         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
15828         levels. 
15829
15830 2002-09-19  Martin Baulig  <martin@gnome.org>
15831
15832         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
15833         says that a method always returns or always throws an exception,
15834         don't report the CS0161.
15835
15836         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
15837         set `Returns = new_returns'.
15838
15839 2002-09-19  Martin Baulig  <martin@gnome.org>
15840
15841         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
15842         to an enum constant, check for a CS0176.
15843
15844 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
15845
15846         * class.cs (TypeContainer.CheckPairedOperators): Now we check
15847         for operators that must be in pairs and report errors.
15848
15849         * ecore.cs (SimpleName.DoResolveType): During the initial type
15850         resolution process, when we define types recursively, we must
15851         check first for types in our current scope before we perform
15852         lookups in the enclosing scopes.
15853
15854         * expression.cs (MakeByteBlob): Handle Decimal blobs.
15855
15856         (Invocation.VerifyArgumentsCompat): Call
15857         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
15858         I thought we were supposed to always call this, but there are a
15859         few places in the code where we dont do it.
15860
15861 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
15862
15863         * driver.cs: Add support in -linkres and -resource to specify the
15864         name of the identifier.
15865
15866 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
15867
15868         * ecore.cs (StandardConversionExists): Sync with the conversion
15869         code: allow anything-* to void* conversions.
15870
15871         (FindMostSpecificSource): Use an Expression argument
15872         instead of a Type, because we might be handed over a Literal which
15873         gets a few more implicit conversions that plain types do not.  So
15874         this information was being lost.
15875
15876         Also, we drop the temporary type-holder expression when not
15877         required.
15878
15879 2002-09-17  Martin Baulig  <martin@gnome.org>
15880
15881         * class.cs (PropertyBase.CheckBase): Don't check the base class if
15882         this is an explicit interface implementation.
15883
15884 2002-09-17  Martin Baulig  <martin@gnome.org>
15885
15886         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
15887         different `IndexerName' attributes.
15888
15889         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
15890         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
15891         virtual CommonResolve().
15892
15893 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
15894
15895         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
15896         and convert that to the UnderlyingType.
15897
15898         * statement.cs (Foreach.Resolve): Indexers are just like variables
15899         or PropertyAccesses.
15900
15901         * cs-tokenizer.cs (consume_string): Track line numbers and columns
15902         inside quoted strings, we were not doing this before.
15903
15904 2002-09-16  Martin Baulig  <martin@gnome.org>
15905
15906         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
15907         resolve it.  This is needed for the definite assignment check of the
15908         instance expression, fixes bug #29846.
15909         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
15910
15911 2002-09-16  Nick Drochak  <ndrochak@gol.com>
15912
15913         * parameter.cs: Fix compile error.  Cannot reference static member
15914         from an instance object.  Is this an mcs bug?
15915
15916 2002-09-14  Martin Baulig  <martin@gnome.org>
15917
15918         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
15919         multiple times.  Fixes bug #30295, added test-166.cs.
15920
15921 2002-09-14  Martin Baulig  <martin@gnome.org>
15922
15923         * statement.cs (Block.Emit): Don't emit unreachable code.
15924         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
15925         `break' statements.
15926         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
15927
15928 2002-09-14  Martin Baulig  <martin@gnome.org>
15929
15930         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
15931         is set.
15932
15933 2002-09-14  Martin Baulig  <martin@gnome.org>
15934
15935         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
15936         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
15937         be false on the ms runtime.
15938
15939 2002-09-13  Martin Baulig  <martin@gnome.org>
15940
15941         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
15942         the CS0038 error message.
15943
15944 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
15945
15946         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
15947         constant inside, return it.
15948
15949 2002-09-12  Martin Baulig  <martin@gnome.org>
15950
15951         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
15952         implicit conversion can be done between enum types.
15953
15954         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
15955         check whether an implicit conversion to the current enum's UnderlyingType
15956         exists and report an error if not.
15957
15958         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
15959         without debugging support.
15960
15961         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
15962         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
15963
15964 2002-09-12  Martin Baulig  <martin@gnome.org>
15965
15966         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
15967
15968         * ecore.cs (IMemberExpr.DeclaringType): New property.
15969         (SimpleName.SimpleNameResolve): Check whether we're accessing a
15970         nonstatic member of an outer type (CS0038).
15971
15972 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
15973
15974         * driver.cs: Activate the using-error detector at warning level
15975         4 (at least for MS-compatible APIs).
15976
15977         * namespace.cs (VerifyUsing): Small buglett fix.
15978
15979         * pending.cs (PendingImplementation): pass the container pointer. 
15980
15981         * interface.cs (GetMethods): Allow for recursive definition.  Long
15982         term, I would like to move every type to support recursive
15983         definitions, not the current ordering mechanism that we have right
15984         now.
15985
15986         The situation is this: Attributes are handled before interfaces,
15987         so we can apply attributes to interfaces.  But some attributes
15988         implement interfaces, we will now handle the simple cases
15989         (recursive definitions will just get an error).  
15990
15991         * parameter.cs: Only invalidate types at the end if we fail to
15992         lookup all types.  
15993
15994 2002-09-09  Martin Baulig  <martin@gnome.org>
15995
15996         * ecore.cs (PropertyExpr.Emit): Also check for
15997         TypeManager.system_int_array_get_length so this'll also work when
15998         compiling corlib.  Fixes #30003.
15999
16000 2002-09-09  Martin Baulig  <martin@gnome.org>
16001
16002         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
16003         and throw an exception if we can't get the type's size.  Fixed #30040,
16004         added test-165.cs.
16005
16006 2002-09-09  Martin Baulig  <martin@gnome.org>
16007
16008         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
16009
16010         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
16011         context.  Fixes bug #30027.
16012
16013         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
16014         virtual functions.  Fixes bug #30043, added test-164.cs.
16015
16016 2002-09-08  Ravi Pratap  <ravi@ximian.com>
16017
16018         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
16019
16020 2002-09-08  Nick Drochak  <ndrochak@gol.com>
16021
16022         * driver.cs: Use an object to get the windows codepage since it's not a
16023         static property.
16024
16025 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
16026
16027         * statement.cs (For.Emit): for infinite loops (test == null)
16028         return whether there is a break inside, not always "true".
16029
16030         * namespace.cs (UsingEntry): New struct to hold the name of the
16031         using definition, the location where it is defined, and whether it
16032         has been used in a successful type lookup.
16033
16034         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
16035         strings.
16036
16037         * decl.cs: ditto.
16038
16039 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16040
16041         * attribute.cs : Fix incorrect code which relied on catching
16042         a NullReferenceException to detect a null being passed in
16043         where an object was expected.
16044
16045 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
16046
16047         * statement.cs (Try): flag the catch variable as assigned
16048
16049         * expression.cs (Cast): Simplified by using ResolveType instead of
16050         manually resolving.
16051
16052         * statement.cs (Catch): Fix bug by using ResolveType.
16053
16054 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16055
16056         * expression.cs (BetterConversion): Special case for when we have
16057         a NullLiteral as the argument and we have to choose between string
16058         and object types - we choose string the way csc does.
16059
16060         * attribute.cs (Attribute.Resolve): Catch the
16061         NullReferenceException and report error #182 since the Mono
16062         runtime no more has the bug and having this exception raised means
16063         we tried to select a constructor which takes an object and is
16064         passed a null.
16065
16066 2002-09-05  Ravi Pratap  <ravi@ximian.com>
16067
16068         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
16069         message (1502, 1503) when we can't locate a method after overload
16070         resolution. This is much more informative and closes the bug
16071         Miguel reported.
16072
16073         * interface.cs (PopulateMethod): Return if there are no argument
16074         types. Fixes a NullReferenceException bug.
16075
16076         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
16077         expressions too. Previously we were checking only in one place for
16078         positional arguments leaving out named arguments.
16079
16080         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
16081         type to the enum type is not allowed. Remove code corresponding to
16082         that.
16083
16084         (ConvertNumericExplicit): Allow explicit conversions from
16085         the underlying type to enum type. This precisely follows the spec
16086         and closes a bug filed by Gonzalo.
16087
16088 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16089
16090         * compiler.csproj:
16091         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
16092
16093 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
16094
16095         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
16096         it was important that we stored the right value after the
16097         reduction in `converted'.
16098
16099 2002-09-04  Martin Baulig  <martin@gnome.org>
16100
16101         * location.cs (Location.SymbolDocument): Use full pathnames for the
16102         source files.
16103
16104 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
16105
16106         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
16107         of the expression resolve mechanism, because that will catch the
16108         SimpleName error failures.
16109
16110         (Conditional): If we can not resolve the
16111         expression, return, do not crash.
16112
16113 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16114
16115         * cs-tokenizer.cs:
16116         (location): display token name instead of its number.
16117
16118 2002-08-28  Martin Baulig  <martin@gnome.org>
16119
16120         * expression.cs (Binary.ResolveOperator): Don't silently return
16121         but return an error if an operator cannot be applied between two
16122         enum types.
16123
16124 2002-08-28  Martin Baulig  <martin@gnome.org>
16125
16126         * class.cs (Constructor.Define): Set the permission attributes
16127         correctly instead of making all constructors public.
16128
16129 2002-08-28  Martin Baulig  <martin@gnome.org>
16130
16131         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
16132         for private members before reporting a CS0103; if we find anything,
16133         it's a CS0122.
16134
16135 2002-08-28  Martin Baulig  <martin@gnome.org>
16136
16137         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
16138         to check whether `closure_start_type == closure_invocation_type',
16139         we also need to check whether `m.DeclaringType == closure_invocation_type'
16140         before bypassing the permission checks.  We might be accessing
16141         protected/private members from the base class.
16142         (TypeManager.RealMemberLookup): Only set private_ok if private
16143         members were requested via BindingFlags.NonPublic.
16144
16145         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
16146
16147         * expression.cs (MemberAccess.ResolveMemberAccess): Set
16148         MethodGroupExpr.IsExplicitImpl if appropriate.
16149         (Invocation.DoResolve): Don't report the CS0120 for explicit
16150         interface implementations.
16151
16152 2002-08-27  Martin Baulig  <martin@gnome.org>
16153
16154         * expression.cs (Invocation.DoResolve): If this is a static
16155         method and we don't have an InstanceExpression, we must report
16156         a CS0120.
16157
16158 2002-08-25  Martin Baulig  <martin@gnome.org>
16159
16160         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
16161         `==' between a valuetype and an object.
16162
16163 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
16164
16165         * ecore.cs (TypeExpr): Provide a ToString method.
16166
16167 2002-08-24  Martin Baulig  <martin@gnome.org>
16168
16169         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
16170         now called proggie.dbg and it's a binary file.
16171
16172 2002-08-23  Martin Baulig  <martin@gnome.org>
16173
16174         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
16175
16176 2002-08-23  Martin Baulig  <martin@gnome.org>
16177
16178         * struct.cs (MyStructInfo.ctor): Make this work with empty
16179         structs; it's not allowed to use foreach() on null.
16180
16181 2002-08-23  Martin Baulig  <martin@gnome.org>
16182
16183         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
16184         writer the full pathname of the generated assembly.
16185
16186 2002-08-23  Martin Baulig  <martin@gnome.org>
16187
16188         * statements.cs (FlowBranching.UsageVector.MergeChildren):
16189         A `finally' block never returns or breaks; improved handling of
16190         unreachable code.
16191
16192 2002-08-23  Martin Baulig  <martin@gnome.org>
16193
16194         * statement.cs (Throw.Resolve): Allow `throw null'.
16195
16196 2002-08-23  Martin Baulig  <martin@gnome.org>
16197
16198         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
16199         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
16200         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
16201         MemberLookup would return a wrong event if this is an explicit
16202         interface implementation and the class has an event with the same
16203         name.
16204
16205 2002-08-23  Martin Baulig  <martin@gnome.org>
16206
16207         * statement.cs (Block.AddChildVariableNames): New public method.
16208         (Block.AddChildVariableName): Likewise.
16209         (Block.IsVariableNameUsedInChildBlock): Likewise.
16210         (Block.AddVariable): Check whether a variable name has already
16211         been used in a child block.
16212
16213         * cs-parser.jay (declare_local_variables): Mark all variable names
16214         from the current block as being used in a child block in the
16215         implicit block.
16216
16217 2002-08-23  Martin Baulig  <martin@gnome.org>
16218
16219         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
16220         find the symbol writer.
16221
16222         * driver.cs: csc also allows the arguments to /define being
16223         separated by commas, not only by semicolons.
16224
16225 2002-08-23  Martin Baulig  <martin@gnome.org>
16226
16227         * interface.cs (Interface.GetMembers): Added static check for events.
16228
16229 2002-08-15  Martin Baulig  <martin@gnome.org>
16230
16231         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
16232         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
16233
16234         * ecore.cs (Expression.MemberLookup): Added documentation and explained
16235         why the MethodData.EmitDestructor() change was necessary.
16236
16237 2002-08-20  Martin Baulig  <martin@gnome.org>
16238
16239         * class.cs (TypeContainer.FindMembers): Added static check for events.
16240
16241         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
16242
16243         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
16244         use Type.GetEvents(), not Type.FindMembers().
16245
16246 2002-08-20  Martin Baulig  <martin@gnome.org>
16247
16248         * decl.cs (MemberCache): Added a special method cache which will
16249         be used for method-only searched.  This ensures that a method
16250         search will return a MethodInfo with the correct ReflectedType for
16251         inherited methods.      
16252
16253 2002-08-20  Martin Baulig  <martin@gnome.org>
16254
16255         * decl.cs (DeclSpace.FindMembers): Made this public.
16256
16257 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16258
16259         * delegate.cs: fixed build on windows.
16260         [FIXME:  Filed as bug #29150: MCS must report these errors.]
16261
16262 2002-08-19  Ravi Pratap  <ravi@ximian.com>
16263
16264         * ecore.cs (StandardConversionExists): Return a false
16265         if we are trying to convert the void type to anything else
16266         since that is not allowed.
16267
16268         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16269         we flag error 70 in the event an event is trying to be accessed
16270         directly from outside the declaring type.
16271
16272 2002-08-20  Martin Baulig  <martin@gnome.org>
16273
16274         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16275         MemberCache from typemanager.cs to decl.cs.
16276
16277 2002-08-19  Martin Baulig  <martin@gnome.org>
16278
16279         * class.cs (TypeContainer): Implement IMemberContainer.
16280         (TypeContainer.DefineMembers): Create the MemberCache.
16281         (TypeContainer.FindMembers): Do better BindingFlags checking; only
16282         return public members if BindingFlags.Public was given, check
16283         whether members are static.
16284
16285 2002-08-16  Martin Baulig  <martin@gnome.org>
16286
16287         * decl.cs (DeclSpace.Define): Splitted this in Define and
16288         DefineMembers.  DefineMembers is called first and initializes the
16289         MemberCache.
16290
16291         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
16292         DefineMembers() on all our DeclSpaces.
16293
16294         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16295         but call DefineMembers() on all nested interfaces.  We call their
16296         Define() in our new Define() function.
16297
16298         * interface.cs (Interface): Implement IMemberContainer.
16299         (Interface.Define): Moved all code except the attribute stuf to
16300         DefineMembers().
16301         (Interface.DefineMembers): Initialize the member cache.
16302
16303         * typemanager.cs (IMemberFinder): Removed this interface, we don't
16304         need this anymore since we can use MemberCache.FindMembers directly.
16305
16306 2002-08-19  Martin Baulig  <martin@gnome.org>
16307
16308         * typemanager.cs (MemberCache): When creating the cache for an
16309         interface type, add all inherited members.
16310         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16311         to `out bool used_cache' and documented it.
16312         (TypeManager.MemberLookup): If we already used the cache in the first
16313         iteration, we don't need to do the interfaces check.
16314
16315 2002-08-19  Martin Baulig  <martin@gnome.org>
16316
16317         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
16318         here from IMemberFinder and don't implement this interface anymore.
16319         (DeclSpace.MemberCache): Moved here from IMemberFinder.
16320
16321         * typemanager.cs (IMemberFinder): This interface is now only used by
16322         classes which actually support the member cache.
16323         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16324         since we only put DeclSpaces into this Hashtable.
16325         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
16326         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
16327
16328 2002-08-16  Martin Baulig  <martin@gnome.org>
16329
16330         * typemanager.cs (ICachingMemberFinder): Removed.
16331         (IMemberFinder.MemberCache): New property.
16332         (TypeManager.FindMembers): Merged this with RealFindMembers().
16333         This function will never be called from TypeManager.MemberLookup()
16334         so we can't use the cache here, just the IMemberFinder.
16335         (TypeManager.MemberLookup_FindMembers): Check whether the
16336         IMemberFinder has a MemberCache and call the cache's FindMembers
16337         function.
16338         (MemberCache): Rewrote larger parts of this yet another time and
16339         cleaned it up a bit.
16340
16341 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
16342
16343         * driver.cs (LoadArgs): Support quoting.
16344
16345         (Usage): Show the CSC-like command line arguments.
16346
16347         Improved a few error messages.
16348
16349 2002-08-15  Martin Baulig  <martin@gnome.org>
16350
16351         * typemanager.cs (IMemberContainer.Type): New property.
16352         (IMemberContainer.IsInterface): New property.
16353
16354         The following changes are conditional to BROKEN_RUNTIME, which is
16355         defined at the top of the file.
16356
16357         * typemanager.cs (MemberCache.MemberCache): Don't add the base
16358         class'es members, but add all members from TypeHandle.ObjectType
16359         if we're an interface.
16360         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16361         is the current type.
16362         (MemberCache.CacheEntry.Container): Removed this field.
16363         (TypeHandle.GetMembers): Include inherited members.
16364
16365 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16366
16367         * typemanager.cs: fixed compilation and added a comment on a field that
16368         is never used.
16369
16370 2002-08-15  Martin Baulig  <martin@gnome.org>
16371
16372         * class.cs (ConstructorInitializer.Resolve): In the
16373         Expression.MemberLookup call, use the queried_type as
16374         invocation_type.
16375
16376         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16377         declared' attribute, it's always true.
16378         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16379         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16380         temporary wrapper for FindMembers which tells MemberLookup whether
16381         members from the base classes are included in the return value.
16382         This will go away soon.
16383         (TypeManager.MemberLookup): Use this temporary hack here; once the
16384         new MemberCache is completed, we don't need to do the DeclaredOnly
16385         looping here anymore since the MemberCache will take care of this.
16386         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16387         (MemberCache): When creating the MemberCache for a class, get
16388         members from the current class and all its base classes.
16389         (MemberCache.CacheEntry.Container): New field.  This is a
16390         temporary hack until the Mono runtime is fixed to distinguish
16391         between ReflectedType and DeclaringType.  It allows us to use MCS
16392         with both the MS runtime and the unfixed Mono runtime without
16393         problems and without accecting performance.
16394         (MemberCache.SearchMembers): The DeclaredOnly looping from
16395         TypeManager.MemberLookup is now done here.      
16396
16397 2002-08-14  Martin Baulig  <martin@gnome.org>
16398
16399         * statement.cs (MyStructInfo.MyStructInfo): Don't call
16400         Type.GetFields on dynamic types but get the fields from the
16401         corresponding TypeContainer.
16402         (MyStructInfo.GetStructInfo): Added check for enum types.
16403
16404         * typemanager.cs (MemberList.IsSynchronized): Implemented.
16405         (MemberList.SyncRoot): Implemented.
16406         (TypeManager.FilterWithClosure): No need to check permissions if
16407         closure_start_type == closure_invocation_type, don't crash if
16408         closure_invocation_type is null.
16409
16410 2002-08-13  Martin Baulig  <martin@gnome.org>
16411
16412         Rewrote TypeContainer.FindMembers to use a member cache.  This
16413         gives us a speed increase of about 35% for the self-hosting MCS
16414         build and of about 15-20% for the class libs (both on GNU/Linux).
16415
16416         * report.cs (Timer): New class to get enhanced profiling.  This
16417         whole class is "TIMER" conditional since it remarkably slows down
16418         compilation speed.
16419
16420         * class.cs (MemberList): New class.  This is an IList wrapper
16421         which we're now using instead of passing MemberInfo[]'s around to
16422         avoid copying this array unnecessarily.
16423         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16424         (ICachingMemberFinder, IMemberContainer): New interface.
16425         (TypeManager.FilterWithClosure): If `criteria' is null, the name
16426         has already been checked, otherwise use it for the name comparision.
16427         (TypeManager.FindMembers): Renamed to RealMemberFinder and
16428         provided wrapper which tries to use ICachingMemberFinder.FindMembers
16429         if possible.  Returns a MemberList, not a MemberInfo [].
16430         (TypeHandle): New class, implements IMemberContainer.  We create
16431         one instance of this class per type, it contains a MemberCache
16432         which is used to do the member lookups.
16433         (MemberCache): New class.  Each instance of this class contains
16434         all members of a type and a name-based hash table.
16435         (MemberCache.FindMembers): This is our new member lookup
16436         function.  First, it looks up all members of the requested name in
16437         the hash table.  Then, it walks this list and sorts out all
16438         applicable members and returns them.
16439
16440 2002-08-13  Martin Baulig  <martin@gnome.org>
16441
16442         In addition to a nice code cleanup, this gives us a performance
16443         increase of about 1.4% on GNU/Linux - not much, but it's already
16444         half a second for the self-hosting MCS compilation.
16445
16446         * typemanager.cs (IMemberFinder): New interface.  It is used by
16447         TypeManager.FindMembers to call FindMembers on a TypeContainer,
16448         Enum, Delegate or Interface.
16449         (TypeManager.finder_to_member_finder): New PtrHashtable.
16450         (TypeManager.finder_to_container): Removed.
16451         (TypeManager.finder_to_delegate): Removed.
16452         (TypeManager.finder_to_interface): Removed.
16453         (TypeManager.finder_to_enum): Removed.
16454
16455         * interface.cs (Interface): Implement IMemberFinder.
16456
16457         * delegate.cs (Delegate): Implement IMemberFinder.
16458
16459         * enum.cs (Enum): Implement IMemberFinder.
16460
16461         * class.cs (TypeContainer): Implement IMemberFinder.
16462
16463 2002-08-12  Martin Baulig  <martin@gnome.org>
16464
16465         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16466
16467 2002-08-12  Martin Baulig  <martin@gnome.org>
16468
16469         * ecore.cs (ITypeExpression): New interface for expressions which
16470         resolve to a type.
16471         (TypeExpression): Renamed to TypeLookupExpression.
16472         (Expression.DoResolve): If we're doing a types-only lookup, the
16473         expression must implement the ITypeExpression interface and we
16474         call DoResolveType() on it.
16475         (SimpleName): Implement the new ITypeExpression interface.
16476         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16477         hack, the situation that we're only looking up types can't happen
16478         anymore when this method is called.  Moved the type lookup code to
16479         DoResolveType() and call it.
16480         (SimpleName.DoResolveType): This ITypeExpression interface method
16481         is now doing the types-only lookup.
16482         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16483         (ResolveFlags): Added MaskExprClass.
16484
16485         * expression.cs (MemberAccess): Implement the ITypeExpression
16486         interface.
16487         (MemberAccess.DoResolve): Added support for a types-only lookup
16488         when we're called via ITypeExpression.DoResolveType().
16489         (ComposedCast): Implement the ITypeExpression interface.
16490
16491         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
16492         Expression.Resolve() with ResolveFlags.Type instead.
16493
16494 2002-08-12  Martin Baulig  <martin@gnome.org>
16495
16496         * interface.cs (Interface.Define): Apply attributes.
16497
16498         * attribute.cs (Attribute.ApplyAttributes): Added support for
16499         interface attributes.
16500
16501 2002-08-11  Martin Baulig  <martin@gnome.org>
16502
16503         * statement.cs (Block.Emit): Only check the "this" variable if we
16504         do not always throw an exception.
16505
16506         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16507         whether the property has a set accessor.
16508
16509 2002-08-11  Martin Baulig  <martin@gnome.org>
16510
16511         Added control flow analysis support for structs.
16512
16513         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16514         with control flow analysis turned off.
16515         (IVariable): New interface.
16516         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16517         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16518         (FieldExpr.DoResolve): Resolve the instance expression with flow
16519         analysis turned off and do the definite assignment check after the
16520         resolving when we know what the expression will resolve to.
16521
16522         * expression.cs (LocalVariableReference, ParameterReference):
16523         Implement the new IVariable interface, only call the flow analysis
16524         code if ec.DoFlowAnalysis is true.
16525         (This): Added constructor which takes a Block argument.  Implement
16526         the new IVariable interface.
16527         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16528         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16529         This does the definite assignment checks for struct members.
16530
16531         * class.cs (Constructor.Emit): If this is a non-static `struct'
16532         constructor which doesn't have any initializer, call
16533         Block.AddThisVariable() to tell the flow analysis code that all
16534         struct elements must be initialized before control returns from
16535         the constructor.
16536
16537         * statement.cs (MyStructInfo): New public class.
16538         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16539         argument to this indexer.  If non-zero, check an individual struct
16540         member, not the whole struct.
16541         (FlowBranching.CheckOutParameters): Check struct members.
16542         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16543         overloaded versions of these methods which take an additional
16544         `int field_idx' argument to check struct members.
16545         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16546         overloaded versions of these methods which take an additional
16547         `string field_name' argument to check struct member.s
16548         (VariableInfo): Implement the IVariable interface.
16549         (VariableInfo.StructInfo): New public property.  Returns the
16550         MyStructInfo instance of the variable if it's a struct or null.
16551         (Block.AddThisVariable): New public method.  This is called from
16552         Constructor.Emit() for non-static `struct' constructor which do
16553         not have any initializer.  It creates a special variable for the
16554         "this" instance variable which will be checked by the flow
16555         analysis code to ensure that all of the struct's fields are
16556         initialized before control returns from the constructor.
16557         (UsageVector): Added support for struct members.  If a
16558         variable/parameter is a struct with N members, we reserve a slot
16559         in the usage vector for each member.  A struct is considered fully
16560         initialized if either the struct itself (slot 0) or all its
16561         members are initialized.
16562
16563 2002-08-08  Martin Baulig  <martin@gnome.org>
16564
16565         * driver.cs (Driver.MainDriver): Only report an error CS5001
16566         if there were no compilation errors.
16567
16568         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
16569         `UnsafeContext' property to determine whether the parent is in
16570         unsafe context rather than checking the parent's ModFlags:
16571         classes nested in an unsafe class are unsafe as well.
16572
16573 2002-08-08  Martin Baulig  <martin@gnome.org>
16574
16575         * statement.cs (UsageVector.MergeChildren): Distinguish between
16576         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
16577         we return.  Added test17() and test18() to test-154.cs.
16578
16579 2002-08-08  Martin Baulig  <martin@gnome.org>
16580
16581         * typemanager.cs (TypeManager.FilterWithClosure): If we have
16582         Family access, make sure the invoking type isn't a subclass of the
16583         queried type (that'd be a CS1540).
16584
16585         * ecore.cs (Expression.MemberLookup): Added overloaded version of
16586         this method which takes an additional `Type invocation_type'.
16587
16588         * expression.cs (BaseAccess.DoResolve): Use the base type as
16589         invocation and query type.
16590         (MemberAccess.DoResolve): If the lookup failed and we're about to
16591         report a CS0122, try a lookup with the ec.ContainerType - if this
16592         succeeds, we must report a CS1540.
16593
16594 2002-08-08  Martin Baulig  <martin@gnome.org>
16595
16596         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
16597         (MethodGroupExpr): Implement the IMemberExpr interface.
16598
16599         * expression (MemberAccess.ResolveMemberAccess): No need to have
16600         any special code for MethodGroupExprs anymore, they're now
16601         IMemberExprs.   
16602
16603 2002-08-08  Martin Baulig  <martin@gnome.org>
16604
16605         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
16606         Family, FamANDAssem and FamORAssem permissions.
16607         (TypeManager.IsSubclassOrNestedChildOf): New public method.
16608
16609 2002-08-08  Martin Baulig  <martin@gnome.org>
16610
16611         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
16612         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
16613         or loop block.
16614
16615 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
16616
16617         * driver.cs: implemented /resource option to embed managed resources.
16618
16619 2002-08-07  Martin Baulig  <martin@gnome.org>
16620
16621         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
16622         (FieldBase.HasFieldInitializer): New public property.
16623         (FieldBase.GetInitializerExpression): New public method.  Resolves and
16624         returns the field initializer and makes sure it is only resolved once.
16625         (TypeContainer.EmitFieldInitializers): Call
16626         FieldBase.GetInitializerExpression to get the initializer, this ensures
16627         that it isn't resolved multiple times.
16628
16629         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
16630         the resolving process (SimpleName/MemberLookup) that we're currently
16631         emitting a field initializer (which must not access any instance members,
16632         this is an error CS0236).
16633
16634         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
16635         argument, if the `IsFieldInitializer' flag is set, we must report and
16636         error CS0236 and not an error CS0120.   
16637
16638 2002-08-07  Martin Baulig  <martin@gnome.org>
16639
16640         * ecore.cs (IMemberExpr): New public interface.
16641         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
16642         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
16643         if the expression is an IMemberExpr.
16644
16645         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
16646         to be null, implicitly default to `this' if we're non-static in
16647         this case.  Simplified the code a lot by using the new IMemberExpr
16648         interface.  Also fixed bug #28176 here.
16649
16650 2002-08-06  Martin Baulig  <martin@gnome.org>
16651
16652         * cs-parser.jay (SimpleLookup): Removed.  We need to create
16653         ParameterReferences during semantic analysis so that we can do a
16654         type-only search when resolving Cast, TypeOf and SizeOf.
16655         (block): Pass the `current_local_parameters' to the Block's
16656         constructor.
16657
16658         * class.cs (ConstructorInitializer): Added `Parameters parameters'
16659         argument to the constructor.
16660         (ConstructorInitializer.Resolve): Create a temporary implicit
16661         block with the parameters.
16662
16663         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
16664         references here if we aren't doing a type-only search.
16665
16666         * statement.cs (Block): Added constructor which takes a
16667         `Parameters parameters' argument.
16668         (Block.Parameters): New public property.
16669
16670         * support.cs (InternalParameters.Parameters): Renamed `parameters'
16671         to `Parameters' and made it public readonly.
16672
16673 2002-08-06  Martin Baulig  <martin@gnome.org>
16674
16675         * ecore.cs (Expression.Warning): Made this public as well.
16676
16677         * report.cs (Report.Debug): Print the contents of collections.
16678
16679 2002-08-06  Martin Baulig  <martin@gnome.org>
16680
16681         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
16682         used to tell Resolve() which kinds of expressions it may return.
16683         (Expression.Resolve): Added overloaded version of this method which
16684         takes a `ResolveFlags flags' argument.  This can be used to tell
16685         Resolve() which kinds of expressions it may return.  Reports a
16686         CS0118 on error.
16687         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
16688         ResolveFlags.SimpleName.
16689         (Expression.Error118): Added overloaded version of this method which
16690         takes a `ResolveFlags flags' argument.  It uses the flags to determine
16691         which kinds of expressions are allowed.
16692
16693         * expression.cs (Argument.ResolveMethodGroup): New public method.
16694         Resolves an argument, but allows a MethodGroup to be returned.
16695         This is used when invoking a delegate.
16696
16697         * TODO: Updated a bit.
16698
16699 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16700
16701         Fixed compilation with csc.
16702
16703         * ecore.cs: Expression.Error made public. Is this correct? Should
16704         Warning be made public too?
16705
16706         * expression.cs: use ea.Location instead of ea.loc.
16707         [FIXME:  Filed as bug #28607: MCS must report these errors.]
16708
16709 2002-08-06  Martin Baulig  <martin@gnome.org>
16710
16711         * ecore.cs (Expression.loc): Moved the location here instead of
16712         duplicating it in all derived classes.
16713         (Expression.Location): New public property.
16714         (Expression.Error, Expression.Warning): Made them non-static and
16715         removed the location argument.
16716         (Expression.Warning): Added overloaded version which takes an
16717         `int level' argument.
16718         (Expression.Error118): Make this non-static and removed the
16719         expression and location arguments.
16720         (TypeExpr): Added location argument to the constructor.
16721
16722         * expression.cs (StaticCallExpr): Added location argument to
16723         the constructor.
16724         (Indirection, PointerArithmetic): Likewise.
16725         (CheckedExpr, UnCheckedExpr): Likewise.
16726         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
16727         (StringPtr): Likewise.
16728
16729
16730 2002-08-05  Martin Baulig  <martin@gnome.org>
16731
16732         * expression.cs (BaseAccess.DoResolve): Actually report errors.
16733
16734         * assign.cs (Assign.DoResolve): Check whether the source
16735         expression is a value or variable.
16736
16737         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
16738         while resolving the corresponding blocks.
16739
16740         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
16741         an error, don't silently return null.
16742
16743         * statement.cs (Block.AddVariable): Do the error reporting here
16744         and distinguish between CS0128 and CS0136.
16745         (Block.DoResolve): Report all unused labels (warning CS0164).
16746         (LabeledStatement): Pass the location to the constructor.
16747         (LabeledStatement.HasBeenReferenced): New property.
16748         (LabeledStatement.Resolve): Set it to true here.
16749
16750         * statement.cs (Return.Emit): Return success even after reporting
16751         a type mismatch error (CS0126 or CS0127), this is what csc does and
16752         it avoids confusing the users with any consecutive errors.
16753
16754 2002-08-05  Martin Baulig  <martin@gnome.org>
16755
16756         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
16757
16758         * const.cs (Const.LookupConstantValue): Catch circular definitions.
16759
16760         * expression.cs (MemberAccess.DoResolve): Silently return if an
16761         error has already been reported.
16762
16763         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
16764         error has already been reported.
16765
16766 2002-08-05  Martin Baulig  <martin@gnome.org>
16767
16768         * statement.cs (UsageVector): Only initialize the `parameters'
16769         vector if we actually have any "out" parameters.
16770
16771 2002-08-05  Martin Baulig  <martin@gnome.org>
16772
16773         * expression.cs (Binary.ResolveOperator): When combining delegates,
16774         they must have the same type.
16775
16776 2002-08-05  Martin Baulig  <martin@gnome.org>
16777
16778         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
16779         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
16780         work with the ms runtime and we also don't need it: if we're a
16781         PropertyBuilder and not in the `indexer_arguments' hash, then we
16782         are a property and not an indexer.
16783
16784         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
16785         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
16786         since the latter one doesn't work with the ms runtime.
16787
16788 2002-08-03  Martin Baulig  <martin@gnome.org>
16789
16790         Fixed bugs #27998 and #22735.
16791
16792         * class.cs (Method.IsOperator): New public field.
16793         (Method.CheckBase): Report CS0111 if there's already a method
16794         with the same parameters in the current class.  Report CS0508 when
16795         attempting to change the return type of an inherited method.
16796         (MethodData.Emit): Report CS0179 if a method doesn't have a body
16797         and it's not marked abstract or extern.
16798         (PropertyBase): New abstract base class for Property and Indexer.
16799         (PropertyBase.CheckBase): Moved here from Property and made it work
16800         for indexers.
16801         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
16802         the same so we can reuse it there.
16803         (Property, Indexer): Derive from PropertyBase.
16804         (MethodSignature.inheritable_property_signature_filter): New delegate
16805         to find properties and indexers.
16806
16807         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
16808         argument and improved error reporting.
16809
16810         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
16811         EmptyReadOnlyParameters and made it a property.
16812
16813         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
16814         version of this method which takes a `PropertyInfo indexer'.
16815         (TypeManager.RegisterIndexer): New method.
16816
16817         * class.cs: Added myself as author of this file :-)
16818
16819 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16820
16821         * class.cs: fixed compilation on windoze.
16822
16823 2002-08-03  Martin Baulig  <martin@gnome.org>
16824
16825         * interface.cs (Interface.GetInterfaceBases): Check whether all
16826         base interfaces are at least as accessible than the current one.
16827
16828         * class.cs (TypeContainer.GetClassBases): Check whether base types
16829         are at least as accessible than the current type.
16830         (TypeContainer.AsAccessible): Implemented and made non-static.
16831         (MemberBase.CheckParameters): Report errors if the accessibility
16832         checks fail.
16833
16834         * delegate.cs (Delegate.Delegate): The default visibility is
16835         internal for top-level types and private for nested types.
16836         (Delegate.Define): Report errors if the accessibility checks fail.
16837
16838         * enum.cs (Enum.Enum): The default visibility is internal for
16839         top-level types and private for nested types.
16840         (Enum.DefineType): Compute the correct visibility.
16841
16842         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
16843         function which takes a `bool is_toplevel' instead of a TypeContainer.
16844
16845         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
16846         builtin type.
16847
16848 2002-08-02  Martin Baulig  <martin@gnome.org>
16849
16850         * expression.cs (LocalVariableReferenc): Added constructor which
16851         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
16852         (LocalVariableReference.IsReadOnly): New property.
16853         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
16854         variable is readonly, use our own readonly flag to do this; you can
16855         use the new constructor to get a writable reference to a read-only
16856         variable.
16857
16858         * cs-parser.jay (foreach_statement, using_statement): Get a writable
16859         reference to the local variable.
16860
16861 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
16862
16863         * rootcontext.cs (ResolveCore): Also include System.Exception
16864
16865         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
16866         we reach an EmptyStatement.
16867
16868         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
16869         is also fine.
16870
16871         * expression.cs (Binary.ResolveOperator): Check error result in
16872         two places.
16873
16874         use brtrue/brfalse directly and avoid compares to null.
16875
16876 2002-08-02  Martin Baulig  <martin@gnome.org>
16877
16878         * class.cs (TypeContainer.Define): Define all nested interfaces here.
16879         Fixes bug #28407, added test-155.cs.
16880
16881 2002-08-01  Martin Baulig  <martin@gnome.org>
16882
16883         * class.cs (Event.EmitDefaultMethod): Make this work with static
16884         events.  Fixes #28311, added verify-3.cs.
16885
16886 2002-08-01  Martin Baulig  <martin@gnome.org>
16887
16888         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
16889         `is_disposable' fields.
16890         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
16891         `hm.is_disposable' if we're using the collection pattern.
16892         (Foreach.EmitCollectionForeach): Use the correct type for the
16893         enumerator's local variable, only emit the try/finally block if
16894         necessary (fixes #27713).
16895
16896 2002-08-01  Martin Baulig  <martin@gnome.org>
16897
16898         * ecore.cs (Expression.report118): Renamed to Error118 and made
16899         it public static.
16900
16901         * statement.cs (Throw.Resolve): Check whether the expression is of
16902         the correct type (CS0118) and whether the type derives from
16903         System.Exception (CS0155).
16904         (Catch.Resolve): New method.  Do the type lookup here and check
16905         whether it derives from System.Exception (CS0155).
16906         (Catch.CatchType, Catch.IsGeneral): New public properties.
16907
16908         * typemanager.cs (TypeManager.exception_type): Added.
16909
16910 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
16911
16912         * driver.cs: Updated About function.
16913
16914 2002-07-31  Martin Baulig  <martin@gnome.org>
16915
16916         Implemented Control Flow Analysis.
16917
16918         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
16919         (EmitContext.CurrentBranching): Added.
16920         (EmitContext.StartFlowBranching): Added.
16921         (EmitContext.EndFlowBranching): Added.
16922         (EmitContext.KillFlowBranching): Added.
16923         (EmitContext.IsVariableAssigned): Added.
16924         (EmitContext.SetVariableAssigned): Added.
16925         (EmitContext.IsParameterAssigned): Added.
16926         (EmitContext.SetParameterAssigned): Added.
16927         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
16928         Added control flow analysis stuff here.
16929
16930         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
16931         resolve the expression as lvalue.
16932         (LocalVariableReference.DoResolve): Check whether the variable has
16933         already been assigned.
16934         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
16935         the parameter as assigned here.
16936         (ParameterReference.DoResolve): Check whether the parameter has already
16937         been assigned.
16938         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
16939         expression as lvalue.
16940
16941         * statement.cs (FlowBranching): New class for the flow analysis code.
16942         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
16943         (LabeledStatement.IsDefined): New public property.
16944         (LabeledStatement.AddUsageVector): New public method to tell flow
16945         analyis that the label may be reached via a forward jump.
16946         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
16947         flow analysis.
16948         (VariableInfo.Number): New public field.  This is used by flow analysis
16949         to number all locals of a block.
16950         (Block.CountVariables): New public property.  This is the number of
16951         local variables in this block (including the locals from all parent
16952         blocks).
16953         (Block.EmitMeta): Number all the variables.
16954
16955         * statement.cs: Added flow analysis support to all classes.
16956
16957 2002-07-31  Martin Baulig  <martin@gnome.org>
16958
16959         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
16960         To get debugging messages, compile mcs with /define:MCS_DEBUG and
16961         then use this argument.
16962
16963         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
16964
16965         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
16966         use this to specify /define options.
16967
16968 2002-07-29  Martin Baulig  <martin@gnome.org>
16969
16970         * statement.cs (Fixed): Moved all code that does variable lookups
16971         and resolvings from Emit to Resolve.
16972
16973         * statement.cs (For): Moved all code that does variable lookups
16974         and resolvings from Emit to Resolve.
16975
16976         * statement.cs (Using): Moved all code that does variable lookups
16977         and resolvings from Emit to Resolve.
16978
16979 2002-07-29  Martin Baulig  <martin@gnome.org>
16980
16981         * attribute.cs (Attribute.Resolve): Explicitly catch a
16982         System.NullReferenceException when creating the
16983         CustromAttributeBuilder and report a different warning message.
16984
16985 2002-07-29  Martin Baulig  <martin@gnome.org>
16986
16987         * support.cs (ParameterData.ParameterName): Added method to
16988         get the name of a parameter.
16989
16990         * typemanager.cs (TypeManager.IsValueType): New public method.
16991
16992 2002-07-29  Martin Baulig  <martin@gnome.org>
16993
16994         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
16995         is a flag which specifies that it's either ref or out.
16996         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
16997         the out parameter to `out Parameter.Modifier mod', also set the
16998         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
16999
17000         * support.cs (InternalParameters.ParameterModifier): Distinguish
17001         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17002         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17003
17004         * expression.cs (Argument.GetParameterModifier): Distinguish
17005         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17006         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17007
17008 2002-07-29  Martin Baulig  <martin@gnome.org>
17009
17010         * expression.cs (ParameterReference.ParameterReference): Added
17011         `Location loc' argument to the constructor.
17012
17013         * cs-parser.jay: Pass location to ParameterReference.
17014
17015 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
17016
17017         * statement.cs (Try): Initialize the location.
17018
17019         * cs-parser.jay: pass location to Try.
17020
17021         * expression.cs (Unary.Reduce): Change the prototype to return
17022         whether a constant fold could be performed or not.  The result is
17023         returned in an out parameters.  In the case of Indirection and
17024         AddressOf, we want to perform the full tests.
17025
17026 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
17027
17028         * statement.cs (Statement.Emit): Flag dead code.
17029
17030 2002-07-27  Andrew Birkett  <andy@nobugs.org>
17031
17032         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
17033
17034 2002-07-27  Martin Baulig  <martin@gnome.org>
17035
17036         * class.cs (MethodData.Define): Put back call to
17037         TypeManager.AddMethod(), accidentally commented this out.
17038
17039         * report.cs (Debug): New public method to print debugging information,
17040         this is `[Conditional ("DEBUG")]'.
17041
17042 2002-07-26  Martin Baulig  <martin@gnome.org>
17043
17044         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
17045         (switch_statement): Push the current_block to the switch_stack and
17046         pop it again when we're done with the switch.
17047         (switch_section): The new block is a child of the current_block.
17048         Fixes bug #24007, added test-152.cs.
17049
17050 2002-07-27  Martin Baulig  <martin@gnome.org>
17051
17052         * expression.cs (Invocation.EmitArguments): When calling a varargs
17053         function with only its fixed arguments, we need to pass an empty
17054         array.
17055
17056 2002-07-27  Martin Baulig  <martin@gnome.org>
17057
17058         Mono 0.13 has been released.
17059
17060 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
17061
17062         * driver.cs: Rename --resource to --linkres, because that is what
17063         we do currently, we dont support --resource yet.
17064
17065         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
17066
17067 2002-07-25  Martin Baulig  <martin@gnome.org>
17068
17069         * class.cs (MethodData): New public class.  This is a `method builder'
17070         class for a method or one accessor of a Property/Indexer/Event.
17071         (MethodData.GetMethodFlags): Moved here from MemberBase.
17072         (MethodData.ApplyAttributes): Likewise.
17073         (MethodData.ApplyObsoleteAttribute): Likewise.
17074         (MethodData.ApplyConditionalAttribute): Likewise.
17075         (MethodData.ApplyDllImportAttribute): Likewise.
17076         (MethodData.CheckAbstractAndExternal): Likewise.
17077         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
17078         (MethodData.Emit): Formerly known as Method.Emit().
17079         (MemberBase): Moved everything which was specific to a single
17080         accessor/method to MethodData.
17081         (Method): Create a new MethodData and call Define() and Emit() on it.
17082         (Property, Indexer, Event): Create a new MethodData objects for each
17083         accessor and call Define() and Emit() on them.
17084
17085 2002-07-25  Martin Baulig  <martin@gnome.org>
17086
17087         Made MethodCore derive from MemberBase to reuse the code from there.
17088         MemberBase now also checks for attributes.
17089
17090         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
17091         (MemberBase.GetMethodFlags): Moved here from class Method and marked
17092         as virtual.
17093         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
17094         `CallingConventions cc' and `Attributes opt_attrs' arguments.
17095         (MemberBase.ApplyAttributes): New virtual method; applies the
17096         attributes to a method or accessor.
17097         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
17098         (MemberBase.ApplyConditionalAttribute): Likewise.
17099         (MemberBase.ApplyDllImportAttribute): Likewise.
17100         (MemberBase.CheckAbstractAndExternal): Likewise.
17101         (MethodCore.ParameterTypes): This is now a property instead of a
17102         method, it's initialized from DoDefineParameters().
17103         (MethodCore.ParameterInfo): Removed the set accessor.
17104         (MethodCore.DoDefineParameters): New protected virtual method to
17105         initialize ParameterTypes and ParameterInfo.
17106         (Method.GetReturnType): We can now simply return the MemberType.
17107         (Method.GetMethodFlags): Override the MemberBase version and add
17108         the conditional flags.
17109         (Method.CheckBase): Moved some code from Define() here, call
17110         DoDefineParameters() here.
17111         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
17112         here to avoid some larger code duplication.
17113         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
17114         ensure that abstract and external accessors don't declare a body.
17115
17116         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
17117         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
17118         lookup in the attribute's parent classes, so we need to abort as soon
17119         as we found the first match.
17120         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
17121         the attribute has no arguments.
17122
17123         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
17124         of a Method.
17125
17126 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17127
17128         * cs-parser.jay: reverted previous patch.
17129
17130 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17131
17132         * cs-parser.jay: fixed bug #22119.
17133
17134 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17135
17136         * attribute.cs: fixed compilation. The error was:
17137         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
17138         be assigned to before control leaves the current method."
17139         [FIXME:  Filed as bug #28186: MCS must report this error.]
17140
17141 2002-07-25  Martin Baulig  <martin@gnome.org>
17142
17143         * attribute.cs (Attribute.Conditional_GetConditionName): New static
17144         method to pull the condition name ouf of a Conditional attribute.
17145         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
17146         the obsolete message and error flag out of an Obsolete attribute.
17147
17148         * class.cs (Method.GetMethodFlags): New public method to get the
17149         TypeManager.MethodFlags for this method.
17150         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
17151         private methods.
17152         (Method.Define): Get and apply the Obsolete and Conditional attributes;
17153         if we're overriding a virtual function, set the new private variable
17154         `parent_method'; call the new TypeManager.AddMethod().
17155
17156         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
17157         the MethodBuilder and the Method in a PtrHashtable.
17158         (TypeManager.builder_to_method): Added for this purpose.
17159         (TypeManager.MethodFlags): Added IsObsoleteError.
17160         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
17161         Obsolete and Conditional arguments in MethodBuilders.  If we discover
17162         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
17163         the message from the attribute.
17164
17165 2002-07-24  Martin Baulig  <martin@gnome.org>
17166
17167         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
17168         preprocessor directives, ensure that the argument to #define/#undef is
17169         exactly one identifier and that it's actually an identifier.
17170
17171         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
17172         did not work ....
17173
17174 2002-07-24  Martin Baulig  <martin@gnome.org>
17175
17176         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
17177         initialize it to TypeManager.object_type in the constructor.
17178         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
17179         of the `hm.get_current' method if we're using the collection pattern.
17180         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
17181         for the explicit conversion to make it work when we're using the collection
17182         pattern and the `Current' property has a different return type than `object'.
17183         Fixes #27713.
17184
17185 2002-07-24  Martin Baulig  <martin@gnome.org>
17186
17187         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
17188         does not match, but don't report any errors.  This method is called in
17189         order for all methods in a MethodGroupExpr until a matching method is
17190         found, so we don't want to bail out if the first method doesn't match.
17191         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
17192         matches, report the 123.  Fixes #28070.
17193
17194 2002-07-24  Martin Baulig  <martin@gnome.org>
17195
17196         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
17197         TypeManager.TypeToCoreType() to the top of the method so the
17198         following equality checks will work.  Fixes #28107.
17199
17200 2002-07-24  Martin Baulig  <martin@gnome.org>
17201
17202         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
17203         operand is of type uint, and the other operand is of type sbyte,
17204         short or int, the operands are converted to type long." -
17205         Actually do what this comment already told us.  Fixes bug #28106,
17206         added test-150.cs.
17207
17208 2002-07-24  Martin Baulig  <martin@gnome.org>
17209
17210         * class.cs (MethodBase): New abstract class.  This is now a base
17211         class for Property, Indexer and Event to avoid some code duplication
17212         in their Define() and DefineMethods() methods.
17213         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
17214         generic methods for Define() and DefineMethods().
17215         (FieldBase): Derive from MemberBase, not MemberCore.
17216         (Property): Derive from MemberBase, not MemberCore.
17217         (Property.DefineMethod): Moved all the code from this method to the
17218         new MethodBase.DefineAccessor(), just call it with appropriate
17219         argumetnts.
17220         (Property.Define): Call the new Property.DoDefine(), this does some
17221         sanity checks and we don't need to duplicate the code everywhere.
17222         (Event): Derive from MemberBase, not MemberCore.
17223         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
17224         accessors, this will also make them work with interface events.
17225         (Indexer): Derive from MemberBase, not MemberCore.
17226         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
17227         (Indexer.Define): Use the new MethodBase functions.
17228
17229         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
17230         argument to the constructor.
17231         (Interface.FindMembers): Added support for interface events.
17232         (Interface.PopluateEvent): Implemented.
17233
17234         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
17235
17236 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
17237
17238         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
17239         but this is required to check for a method name being the same as
17240         the containing class.  
17241
17242         Handle this now.
17243
17244 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17245
17246         * interface.cs: initialize variable.
17247
17248 2002-07-23  Martin Baulig  <martin@gnome.org>
17249
17250         Implemented the IndexerName attribute in interfaces.
17251
17252         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17253         name if this is an explicit interface implementation.
17254         (Indexer.InterfaceIndexerName): New public variable.  If we're
17255         implementing an interface indexer, this is the IndexerName in that
17256         interface.  Otherwise, it's the IndexerName.
17257         (Indexer.DefineMethod): If we're implementing interface indexer,
17258         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
17259         and Pending.ImplementIndexer methods.
17260         (Indexer.Define): Also define the PropertyBuilder if we're
17261         implementing an interface indexer and this is neither an explicit
17262         interface implementation nor do the IndexerName match the one in
17263         the interface.
17264
17265         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17266         If a method is defined here, then we always need to create a proxy
17267         for it.  This is used when implementing interface indexers.
17268         (Pending.IsInterfaceIndexer): New public method.
17269         (Pending.ImplementIndexer): New public method.
17270         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17271         This is used when implementing interface indexers to define a proxy
17272         if necessary.
17273         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17274         define a proxy if necessary.
17275
17276         * interface.cs (Interface.IndexerName): New public variable.
17277         (Interface.PopulateIndexer): Set the IndexerName.
17278         (Interface.DefineIndexers): New private method.  Populate all the
17279         indexers and make sure their IndexerNames match.
17280
17281         * typemanager.cs (IndexerPropertyName): Added support for interface
17282         indexers.
17283
17284 2002-07-22  Martin Baulig  <martin@gnome.org>
17285
17286         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17287         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17288         ret if HasReturnLabel.
17289         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17290         variables.
17291
17292         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17293         and set the ec.LoopBeginTryCatchLevel.
17294         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17295         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17296         the current ec.TryCatchLevel, the branch goes out of an exception
17297         block.  In this case, we need to use Leave and not Br.
17298
17299 2002-07-22  Martin Baulig  <martin@gnome.org>
17300
17301         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17302         block unless the block does not always return or it is contained in
17303         another try { ... } catch { ... } block.  Fixes bug #26506.
17304         Added verify-1.cs to the test suite.
17305
17306 2002-07-22  Martin Baulig  <martin@gnome.org>
17307
17308         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17309         then we do not always return.  Fixes bug #24985.
17310
17311 2002-07-22  Martin Baulig  <martin@gnome.org>
17312
17313         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17314         lookup on a per-class level; ie. walk up the class hierarchy until we
17315         found at least one applicable method, then choose the best among them.
17316         Fixes bug #24463 and test-29.cs.
17317
17318 2002-07-22  Martin Baulig  <martin@gnome.org>
17319
17320         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17321         return types of the methods.  The return type is not part of the
17322         signature and we must not check it to make the `new' modifier work.
17323         Fixes bug #27999, also added test-147.cs.
17324         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
17325
17326         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
17327         on the method's return type.
17328
17329 2002-07-21  Martin Baulig  <martin@gnome.org>
17330
17331         * assign.cs: Make this work if the rightmost source is a constant and
17332         we need to do an implicit type conversion.  Also adding a few more tests
17333         to test-38.cs which should have caught this.
17334
17335         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
17336         target in the makefile for this.  The makefile.gnu is primarily intended
17337         for end-users who don't want to debug the compiler.
17338
17339 2002-07-21  Martin Baulig  <martin@gnome.org>
17340
17341         * assign.cs: Improved the Assign class so it can now handle embedded
17342         assignments (X = Y = Z = something).  As a side-effect this'll now also
17343         consume less local variables.  test-38.cs now passes with MCS, added
17344         a few new test cases to that test.
17345
17346 2002-07-20  Martin Baulig  <martin@gnome.org>
17347
17348         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17349         instructions.  Fixes bug #27977, also added test-146.cs.
17350
17351 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17352
17353         * cs-tokenizer.cs: fixed getHex ().
17354
17355 2002-07-19  Martin Baulig  <martin@gnome.org>
17356
17357         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17358         not Type.GetType() to lookup the array type.  This is needed when
17359         we're constructing an array of a user-defined type.
17360         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17361         single-dimensional arrays, but also for single-dimensial arrays of
17362         type decimal.
17363
17364 2002-07-19  Martin Baulig  <martin@gnome.org>
17365
17366         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17367         this function is called, it's not allowed to share LocalBuilders
17368         among ILGenerators.
17369
17370 2002-07-19  Martin Baulig  <martin@gnome.org>
17371
17372         * expression.cs (Argument.Resolve): Report an error 118 when trying
17373         to pass a type as argument.
17374
17375 2002-07-18  Martin Baulig  <martin@gnome.org>
17376
17377         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17378         Conv_R_Un for the signed `long' type.
17379
17380 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
17381
17382         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17383         `expr' for the temporary result, as that will fail if we do
17384         multiple resolves on the same expression.
17385
17386 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
17387
17388         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17389         ec.TypeContainer for looking up aliases. 
17390
17391         * class.cs (TypeContainer): Remove LookupAlias from here.
17392
17393         * decl.cs (DeclSpace); Move here.
17394
17395 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
17396
17397         * class.cs (FindMembers): Only call filter if the constructor
17398         bulider is not null.
17399
17400         Also handle delegates in `NestedTypes' now.  Now we will perform
17401         type lookups using the standard resolution process.  This also
17402         fixes a bug.
17403
17404         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17405         This uses Expressions (the limited kind that can be parsed by the
17406         tree) instead of strings.
17407
17408         * expression.cs (ComposedCast.ToString): Implement, used to flag
17409         errors since now we have to render expressions.
17410
17411         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
17412         FormArrayType. 
17413
17414         * ecore.cs (SimpleName.ToString): ditto.
17415
17416         * cs-parser.jay: Instead of using strings to assemble types, use
17417         Expressions to assemble the type (using SimpleName, ComposedCast,
17418         MemberAccess).  This should fix the type lookups in declarations,
17419         because we were using a different code path for this.
17420
17421         * statement.cs (Block.Resolve): Continue processing statements
17422         even when there is an error.
17423
17424 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
17425
17426         * class.cs (Event.Define): Also remove the `remove' method from
17427         the list of pending items.
17428
17429         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17430         generate more compact code. 
17431
17432 2002-07-17  Martin Baulig  <martin@gnome.org>
17433
17434         * const.cs (Const.LookupConstantValue): Add support for constant
17435         `unchecked' and `checked' expressions.
17436         Also adding test case test-140.cs for this.
17437
17438 2002-07-17  Martin Baulig  <martin@gnome.org>
17439
17440         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17441         check whether mi.ReturnType implements the IEnumerator interface; the
17442         `==' and the IsAssignableFrom() will fail in this situation.
17443
17444 2002-07-16  Ravi Pratap  <ravi@ximian.com>
17445
17446         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
17447         here too.
17448
17449 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17450
17451         * expression.cs: fixed bug #27811.
17452
17453 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
17454
17455         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17456         Molaro: when we are a ref, the value already contains a pointer
17457         value, do not take the address of it.
17458
17459 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17460         * removed mb-parser.jay and mb-tokenizer.cs
17461
17462 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17463
17464         * expression.cs: check against the building corlib void type.
17465
17466 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17467
17468         * ecore.cs: fix for valuetype static readonly fields: when 
17469         initializing them, we need their address, not the address of a copy.
17470
17471 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17472
17473         * typemanager.cs: register also enum_type in corlib.
17474
17475 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17476
17477         * class.cs: allow calling this (but not base) initializers in structs.
17478
17479 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17480
17481         * ecore.cs: make sure we compare against the building base types
17482         in GetTypeSize ().
17483
17484 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
17485
17486         * typemanager.cs: fix TypeToCoreType() to handle void and object
17487         (corlib gets no more typerefs after this change).
17488
17489 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
17490
17491         * expression.cs (ArrayCreation.EmitArrayArguments): use
17492         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17493
17494         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17495         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
17496         array indexes, the runtime actually forbids them.
17497
17498         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17499         for array arguments here.
17500
17501         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17502         instead of the default for ValueTypes.
17503
17504         (New.DoEmit): Use IsValueType instead of
17505         IsSubclassOf (value_type)
17506         (New.DoResolve): ditto.
17507         (Invocation.EmitCall): ditto.
17508
17509         * assign.cs (Assign): ditto.
17510
17511         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17512         Statements *are* currently doing part of their resolution during
17513         Emit.  
17514
17515         Expressions do always resolve during resolve, but statements are
17516         only required to propagate resolution to their children.
17517
17518 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
17519
17520         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17521
17522         (LoadAssembly): Do not add the dll if it is already specified
17523
17524         (MainDriver): Add the System directory to the link path at the end,
17525         after all the other -L arguments. 
17526
17527         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17528         wrong opcode for loading bytes and bools (ldelem.i1 instead of
17529         ldelem.u1) and using the opposite for sbytes.
17530
17531         This fixes Digger, and we can finally run it.
17532
17533         * driver.cs (UnixParseOption): Move the option parsing here.  
17534         (CSCParseOption): Implement CSC-like parsing of options.
17535
17536         We now support both modes of operation, the old Unix way, and the
17537         new CSC-like way.  This should help those who wanted to make cross
17538         platform makefiles.
17539
17540         The only thing broken is that /r:, /reference: and /lib: are not
17541         implemented, because I want to make those have the same semantics
17542         as the CSC compiler has, and kill once and for all the confussion
17543         around this.   Will be doing this tomorrow.
17544
17545         * statement.cs (Unsafe.Resolve): The state is checked during
17546         resolve, not emit, so we have to set the flags for IsUnsfe here.
17547
17548 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17549
17550         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17551         not catch the Error_ObjectRefRequired in SimpleName (as it is
17552         possible to have a class/instance variable name that later gets
17553         deambiguated), we have to check this here.      
17554
17555 2002-07-10  Ravi Pratap  <ravi@ximian.com>
17556
17557         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17558         make static and put into Expression.
17559
17560         (Event.Define): Register the private field of the event with the 
17561         TypeManager so that GetFieldFromEvent can get at it.
17562
17563         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17564         keep track of the private field associated with an event which
17565         has no accessors.
17566
17567         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
17568         private field.
17569
17570         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
17571
17572 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17573
17574         * expression.cs (Binary.EmitBranchable): this routine emits the
17575         Binary expression in a branchable context.  This basically means:
17576         we need to branch somewhere, not just get the value on the stack.
17577
17578         This works together with Statement.EmitBoolExpression.
17579
17580         * statement.cs (Statement.EmitBoolExpression): Use
17581         EmitBranchable. 
17582
17583 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
17584
17585         * statement.cs (For): Reduce the number of jumps in loops.
17586
17587         (For): Implement loop inversion for the For statement.
17588
17589         (Break): We can be breaking out of a Try/Catch controlled section
17590         (foreach might have an implicit try/catch clause), so we need to
17591         use Leave instead of Br.
17592
17593         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
17594         now).  If the instace expression supports IMemoryLocation, we use
17595         the AddressOf method from the IMemoryLocation to extract the
17596         address instead of emitting the instance.
17597
17598         This showed up with `This', as we were emitting the instance
17599         always (Emit) instead of the Address of This.  Particularly
17600         interesting when This is a value type, as we dont want the Emit
17601         effect (which was to load the object).
17602
17603 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
17604
17605         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
17606
17607         * statement.cs (Checked): Set the CheckedState during the resolve
17608         process too, as the ConvCast operations track the checked state on
17609         the resolve process, and not emit.
17610
17611         * cs-parser.jay (namespace_member_declaration): Flag that we have
17612         found a declaration when we do.  This is used to flag error 1529
17613
17614         * driver.cs: Report ok when we display the help only.
17615
17616 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
17617
17618         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
17619
17620 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
17621
17622         * cs-tokenizer.cs (define): We also have to track locally the
17623         defines.  AllDefines is just used for the Conditional Attribute,
17624         but we also need the local defines for the current source code. 
17625
17626 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
17627
17628         * statement.cs (While, For, Do): These loops can exit through a
17629         Break statement, use this information to tell whether the
17630         statement is the last piece of code.
17631
17632         (Break): Flag that we break.
17633
17634         * codegen.cs (EmitContexts): New `Breaks' state variable.
17635
17636 2002-07-03  Martin Baulig  <martin@gnome.org>
17637
17638         * class.cs (TypeContainer.MethodModifiersValid): Allow override
17639         modifiers in method declarations in structs.  Otherwise, you won't
17640         be able to override things like Object.Equals().
17641
17642 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17643
17644         * class.cs (Method, Property, Indexer): Do not allow the public
17645         modifier to be used in explicit interface implementations.
17646
17647         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
17648         override modifiers in method declarations in structs
17649
17650 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
17651
17652         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
17653         integer or real overflow, report an error
17654
17655 2002-07-02  Martin Baulig  <martin@gnome.org>
17656
17657         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
17658         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
17659         to tell the runtime about our newly created System.Object and
17660         System.ValueType types.
17661
17662 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17663
17664         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
17665         struct instead of Ldarg/Starg.
17666
17667 2002-07-02  Martin Baulig  <martin@gnome.org>
17668
17669         * expression.cs (Indirection.Indirection): Call
17670         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
17671
17672 2002-07-02  Martin Baulig  <martin@gnome.org>
17673
17674         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
17675         ValueType, call TypeManager.TypeToCoreType() on it.
17676         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
17677         the OpCodes.Newarr argument.
17678
17679 2002-07-02  Martin Baulig  <martin@gnome.org>
17680
17681         * expression.cs (Invocation.EmitCall): When compiling corlib,
17682         replace all calls to the system's System.Array type to calls to
17683         the newly created one.
17684
17685         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
17686         System.Array methods.
17687         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
17688         from the system's System.Array type which must be replaced.
17689
17690 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
17691
17692         * typemanager.cs: load unverifiable_code_ctor so we can build
17693         corlib using the correct type. Avoid using GetTypeCode() with
17694         TypeBuilders.
17695         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
17696         TypeManager.object_type to allow building corlib.
17697
17698 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
17699
17700         * ecore.cs: handle System.Enum separately in LoadFromPtr().
17701
17702 2002-07-01  Martin Baulig  <martin@gnome.org>
17703
17704         * class.cs: Make the last change actually work, we need to check
17705         whether `ifaces != null' to avoid a crash.
17706
17707 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17708
17709         * class.cs: when we build structs without fields that implement
17710         interfaces, we need to add the interfaces separately, since there is
17711         no API to both set the size and add the interfaces at type creation
17712         time.
17713
17714 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17715
17716         * expression.cs: the dimension arguments to the array constructors
17717         need to be converted if they are a long.
17718
17719 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
17720
17721         * class.cs: don't emit ldarg.0 if there is no parent constructor
17722         (fixes showstopper for corlib).
17723
17724 2002-06-29  Martin Baulig  <martin@gnome.org>
17725
17726         MCS now compiles corlib on GNU/Linux :-)
17727
17728         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
17729         ie. check for MethodImplOptions.InternalCall.
17730
17731         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
17732         and TypeManager.attribute_type are null, so we must explicitly check
17733         whether parent is not null to find out whether it's an attribute type.
17734         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
17735         and SetBuilder, not only if the property is neither abstract nor external.
17736         This is necessary to set the MethodImplOptions on the accessor methods.
17737         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
17738         SetBuilder, see Property.Emit().
17739
17740         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
17741         populate "System.Object", "System.ValueType" and "System.Attribute" since
17742         they've already been populated from BootCorlib_PopulateCoreTypes().
17743
17744 2002-06-29  Martin Baulig  <martin@gnome.org>
17745
17746         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
17747         is the NullLiteral, we also need to make sure that target_type is not
17748         an enum type.   
17749
17750 2002-06-29  Martin Baulig  <martin@gnome.org>
17751
17752         * rootcontext.cs (RootContext.ResolveCore): We must initialize
17753         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
17754         before calling BootstrapCorlib_ResolveDelegate ().
17755
17756 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17757
17758         * statement.cs: fixed build-breaker. All tests passed ok.
17759
17760 2002-06-27  Martin Baulig  <martin@gnome.org>
17761
17762         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
17763         for System.Decimal when compiling corlib.
17764
17765 2002-06-27  Martin Baulig  <martin@gnome.org>
17766
17767         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
17768         switch blocks which contain nothing but a default clause.
17769
17770 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
17771
17772        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
17773
17774 2002-06-27  Martin Baulig  <martin@gnome.org>
17775
17776         * ecore.cs (PropertyExpr.PropertyExpr): Call
17777         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
17778
17779         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
17780         is already a TypeBuilder.
17781
17782 2002-06-27  Martin Baulig  <martin@gnome.org>
17783
17784         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
17785         `target_type == TypeManager.array_type', not IsAssignableFrom() in
17786         the "from an array-type to System.Array" case.  This makes it work
17787         when compiling corlib.
17788
17789 2002-06-27  Martin Baulig  <martin@gnome.org>
17790
17791         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
17792         non-static PropertyExpr, set its InstanceExpression.  This makes
17793         the `ICollection.Count' property work in System/Array.cs.
17794
17795 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
17796
17797         * driver.cs: Made error handling more consistent.  Errors now
17798         tracked by Report class, so many methods which used to return int
17799         now return void.  Main() now prints success/failure and 
17800         errors/warnings message.
17801
17802         Renamed '--probe' compiler argument to '--expect-error'.  Removed
17803         the magic number return values (123 and 124).  Now, if the
17804         expected error occurs, the compiler exits with success (exit value
17805         0).  If the compilation completes without seeing that particular
17806         error, the compiler exits with failure (exit value 1).  The
17807         makefile in mcs/errors has been changed to handle the new behaviour.
17808
17809         * report.cs: Made 'expected error' number a property and renamed
17810         it from 'Probe' to 'ExpectedError'.
17811
17812         * genericparser.cs: Removed error handling support, since it is
17813         now all done by Report class.
17814
17815         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
17816         class, so parse() no longer returns an int.
17817
17818         * namespace.cs: Use Report.Error instead of GenericParser.error
17819
17820 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
17821
17822         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
17823         TypeContainer.AddOperator): At the front of the list put the
17824         explicit implementations, so they get resolved/defined first. 
17825
17826 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
17827
17828         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
17829         interface type is implemented by this TypeContainer.  Used during
17830         explicit interface implementation.
17831
17832         (Property.Define, Indexer.Define, Method.Define): Validate that
17833         the given interface in the explicit implementation is one of the
17834         base classes for the containing type.
17835
17836         Also if we are explicitly implementing an interface, but there is
17837         no match in the pending implementation table, report an error.
17838
17839         (Property.Define): Only define the property if we are
17840         not explicitly implementing a property from an interface.  Use the
17841         correct name also for those properties (the same CSC uses,
17842         although that is really not needed).
17843
17844         (Property.Emit): Do not emit attributes for explicitly implemented
17845         properties, as there is no TypeBuilder.
17846
17847         (Indexer.Emit): ditto.
17848
17849         Hiding then means that we do not really *implement* a pending
17850         implementation, which makes code fail.
17851
17852 2002-06-22  Martin Baulig  <martin@gnome.org>
17853
17854         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
17855         the return value of Object.GetType().  [FIXME: we need to do this whenever
17856         we get a type back from the reflection library].
17857
17858 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
17859
17860         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
17861
17862 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
17863
17864         * attribute.cs: Return null if we can not look up the type.
17865
17866         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
17867         the interface types found.
17868
17869         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
17870         interface types found.
17871
17872         * typemanager.cs (GetInterfaces): Make this routine returns alll
17873         the interfaces and work around the lame differences between
17874         System.Type and System.Reflection.Emit.TypeBuilder in the results
17875         result for GetInterfaces.
17876
17877         (ExpandInterfaces): Given an array of interface types, expand and
17878         eliminate repeated ocurrences of an interface.  This expands in
17879         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
17880         be IA, IB, IC.
17881
17882 2002-06-21  Martin Baulig  <martin@gnome.org>
17883
17884         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
17885         on System.Enum.
17886
17887 2002-06-21  Martin Baulig  <martin@gnome.org>
17888
17889         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
17890         and called with one of the core types, return the corresponding typebuilder for
17891         that type.
17892
17893         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
17894         element type.
17895
17896 2002-06-21  Martin Baulig  <martin@gnome.org>
17897
17898         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
17899         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
17900         (Expression.ConvertReferenceExplicit): Likewise.
17901
17902         * expression.cs (ElementAccess.DoResolve): Likewise.
17903         (ElementAccess.DoResolveLValue): Likewise.
17904
17905 2002-06-10  Martin Baulig  <martin@gnome.org>
17906
17907         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
17908         add the "value" parameter to the parameter list.
17909
17910         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
17911         to our caller.
17912
17913 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
17914
17915         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
17916         the argument to an int, uint, long or ulong, per the spec.  Also
17917         catch negative constants in array creation.
17918
17919 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
17920
17921         * class.cs: do not allow the same interface to appear twice in
17922         the definition list.
17923
17924 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
17925
17926         * ecore.cs: don't use ldlen with System.Array.
17927
17928 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
17929
17930         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
17931
17932 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
17933
17934         * modifiers.cs: produce correct field attributes for protected
17935         internal. Easy fix so miguel can work on ther harder stuff:-)
17936
17937 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
17938
17939         * pending.cs: New file.  Move the code from class.cs here.
17940         Support clearning the pending flag for all methods (when not doing
17941         explicit interface implementation).
17942
17943 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
17944
17945         * rootcontext.cs: added a couple more types needed to bootstrap.
17946
17947 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
17948
17949         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
17950         constructor in the type, instead of any constructor in the type
17951         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
17952         a bug in the Mono runtime when applying the params attribute). 
17953
17954 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
17955         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
17956
17957 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
17958
17959         * expression.cs (Unary.ResolveOperator): Use TypeManager
17960         to resolve the type.
17961
17962 2002-06-13  Ravi Pratap  <ravi@ximian.com>
17963
17964         * cs-parser.jay (enum_member_declaration): Pass in the attributes
17965         attached.
17966
17967         * enum.cs (AddEnumMember): Add support to store the attributes associated 
17968         with each member too.
17969
17970         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
17971         field builders too - this takes care of the enum member case.
17972
17973 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
17974
17975         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
17976         address-of operator on both value types and pointers.
17977
17978 2002-06-10  Martin Baulig  <martin@gnome.org>
17979
17980         * interface.cs (Interface.PopulateIndexer): Add the indexer's
17981         PropertyBuilder to the `property_builders' list.
17982
17983         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
17984         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
17985         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
17986         find any indexers which are inherited from an interface.
17987
17988 2002-06-09  Martin Baulig  <martin@gnome.org>
17989
17990         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
17991         the same type as the constant if necessary.  There's also a test-130.cs
17992         for this.
17993
17994         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
17995
17996         * typemanager.cs (TypeManager.ChangeType): Previously known as
17997         Enum.ChangeEnumType().
17998
17999 2002-06-09  Martin Baulig  <martin@gnome.org>
18000
18001         * expression.cs (Cast.TryReduce): Added support for consts.
18002
18003 2002-06-08  Ravi Pratap  <ravi@ximian.com>
18004
18005         * class.cs (Accessor): Hold attributes information so we can pass
18006         it along.
18007
18008         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
18009         Modify to pass in attributes attached to the methods.
18010
18011         (add_accessor_declaration, remove_accessor_declaration): Ditto.
18012
18013         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
18014         to handle the Accessor kind :-)
18015
18016         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
18017
18018 2002-06-08  Martin Baulig  <martin@gnome.org>
18019
18020         * expression.cs (Unary.TryReduceNegative): Added support for
18021         ULongConstants.
18022
18023 2002-06-08  Martin Baulig  <martin@gnome.org>
18024
18025         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
18026         name can't be found in the `defined_names' - the caller will do a
18027         MemberLookup in this case and thus find methods in System.Enum
18028         such as Enum.IsDefined().
18029
18030 2002-06-08  Martin Baulig  <martin@gnome.org>
18031
18032         * enum.cs (Enum.ChangeEnumType): This is a custom version of
18033         Convert.ChangeType() which works with TypeBuilder created types.
18034         (Enum.LookupEnumValue, Enum.Define): Use it here.
18035
18036         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
18037         `TypeBuilder.BaseType != null' check.
18038         (TypeContainer.FindMembers): Only lookup parent members if we
18039         actually have a parent.
18040         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
18041         (ConstructorInitializer.Resolve): Likewise.
18042
18043         * interface.cs (Interface.FindMembers): Added
18044         `TypeBuilder.BaseType != null' check.
18045
18046         * rootcontext.cs (RootContext.ResolveCore): Added
18047         "System.Runtime.CompilerServices.IndexerNameAttribute" to
18048         classes_second_stage.
18049
18050         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
18051         debug_type and trace_type when compiling with --nostdlib.       
18052
18053 2002-06-07  Martin Baulig  <martin@gnome.org>
18054
18055         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
18056         (AddField): Set it to true when adding a non-static field.
18057         (DefineType): Use `have_nonstatic_fields' to find out whether we
18058         have non-static fields, not `Fields != null'.
18059
18060 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
18061
18062         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
18063         dereferencing a null on the static-field code path)
18064
18065 2002-05-30  Martin Baulig  <martin@gnome.org>
18066
18067         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
18068         to take command line arguments.  Use reflection to call the new
18069         custom `Initialize' function on the symbol writer and pass it the
18070         command line arguments.
18071
18072         * driver.cs (--debug-args): New command line argument to pass command
18073         line arguments to the symbol writer.
18074
18075 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
18076
18077         * assign.cs (DoResolve): Forgot to do the implicit conversion to
18078         the target type for indexers and properties.  Thanks to Joe for
18079         catching this.
18080
18081 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
18082
18083         * typemanager.cs (MethodFlags): returns the method flags
18084         (Obsolete/ShouldIgnore) that control warning emission and whether
18085         the invocation should be made, or ignored. 
18086
18087         * expression.cs (Invocation.Emit): Remove previous hack, we should
18088         not do this on matching a base type, we should do this based on an attribute
18089
18090         Only emit calls to System.Diagnostics.Debug and
18091         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
18092         on the command line.
18093
18094         * rootcontext.cs: Global settings for tracing and debugging.
18095
18096         * cs-tokenizer.cs (define): New utility function to track
18097         defines.   Set the global settings for TRACE and DEBUG if found.
18098
18099 2002-05-25  Ravi Pratap  <ravi@ximian.com>
18100
18101         * interface.cs (Populate*): Pass in the TypeContainer as well as
18102         the DeclSpace as parameters so that we can create EmitContexts and
18103         then use that to apply attributes etc.
18104
18105         (PopulateMethod, PopulateEvent, PopulateProperty)
18106         (PopulateIndexer): Apply attributes everywhere.
18107
18108         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
18109         etc.
18110
18111         (ApplyAttributes): Update accordingly.
18112
18113         We now apply interface attributes for all members too.
18114
18115 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
18116
18117         * class.cs (Indexer.Define); Correctly check if we are explicit
18118         implementation (instead of checking the Name for a ".", we
18119         directly look up if the InterfaceType was specified).
18120
18121         Delay the creation of the PropertyBuilder.
18122
18123         Only create the PropertyBuilder if we are not an explicit
18124         interface implementation.   This means that explicit interface
18125         implementation members do not participate in regular function
18126         lookups, and hence fixes another major ambiguity problem in
18127         overload resolution (that was the visible effect).
18128
18129         (DefineMethod): Return whether we are doing an interface
18130         implementation. 
18131
18132         * typemanager.cs: Temporary hack until we get attributes in
18133         interfaces (Ravi is working on that) and we get IndexerName
18134         support in interfaces.
18135
18136         * interface.cs: Register the indexers as properties.
18137
18138         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
18139         warning, I have verified that this is a bug in the .NET runtime
18140         (JavaScript suffers of the same problem).
18141
18142         * typemanager.cs (MemberLookup): When looking up members for
18143         interfaces, the parent of an interface is the implicit
18144         System.Object (so we succeed in searches of Object methods in an
18145         interface method invocation.  Example:  IEnumerable x;  x.ToString
18146         ()) 
18147
18148 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
18149
18150         * class.cs (Event): Events should also register if they do
18151         implement the methods that an interface requires.
18152
18153         * typemanager.cs (MemberLookup); use the new GetInterfaces
18154         method. 
18155
18156         (GetInterfaces): The code used to lookup interfaces for a type is
18157         used in more than one place, factor it here. 
18158
18159         * driver.cs: Track the errors at the bottom of the file, we kept
18160         on going.
18161
18162         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
18163         instance if the method we are calling is static!
18164
18165 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
18166
18167         * attribute.cs (ApplyAttributes): Make this function filter out
18168         the IndexerName attribute (as that attribute in reality is never
18169         applied) and return the string constant for the IndexerName
18170         attribute. 
18171
18172         * class.cs (TypeContainer.Emit): Validate that all the indexers
18173         have the same IndexerName attribute, and if so, set the
18174         DefaultName attribute on the class. 
18175
18176         * typemanager.cs: The return value might contain other stuff (not
18177         only methods).  For instance, consider a method with an "Item"
18178         property and an Item method.
18179
18180         * class.cs: If there is a problem with the parameter types,
18181         return. 
18182
18183 2002-05-24  Ravi Pratap  <ravi@ximian.com>
18184
18185         * ecore.cs (ImplicitConversionExists): Wrapper function which also
18186         looks at user defined conversion after making a call to 
18187         StandardConversionExists - we need this for overload resolution.
18188
18189         * expression.cs : Update accordingly the various method calls.
18190
18191         This fixes 2 bugs filed against implicit user defined conversions 
18192
18193 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
18194
18195         * statement.cs: Track the result of the assignment.
18196
18197 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
18198
18199         * expression.cs (MemberAccess): Improved error reporting for
18200         inaccessible members.
18201
18202 2002-05-22  Martin Baulig  <martin@gnome.org>
18203
18204         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
18205         itself with debugging support.
18206
18207 2002-05-22  Martin Baulig  <martin@gnome.org>
18208
18209         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
18210         Removed, this isn't needed anymore.
18211
18212 2002-05-20  Martin Baulig  <martin@gnome.org>
18213
18214         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
18215         be underlying type for an enum.
18216
18217 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
18218
18219         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
18220         that splits out the loading of just the core types.
18221
18222         * rootcontext.cs (ResolveCore): Split the struct resolution in
18223         two, so we can load the enumeration underlying types before any
18224         enums are used.
18225
18226         * expression.cs (Is): Bandaid until we fix properly Switch (see
18227         bug #24985 for details).
18228
18229         * typemanager.cs (ImplementsInterface): The hashtable will contain
18230         a null if there are no interfaces implemented.
18231
18232 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
18233
18234         * cs-parser.jay (indexer_declarator): It is fine to have array
18235         parameters
18236
18237 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18238
18239         * typemanager.cs: (RegisterBuilder): New function used to register
18240         TypeBuilders that implement interfaces.  Since
18241         TypeBuilder.GetInterfaces (as usual) does not work with lame
18242         Reflection.Emit. 
18243         (AddUserType): register interfaces.
18244
18245         (ImplementsInterface): Use the builder_to_ifaces hash if we are
18246         dealing with TypeBuilder.  Also, arrays are showing up as
18247         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
18248         methods can not be invoked on them!
18249
18250         * ecore.cs (ExplicitReferenceConversionExists): Made public.
18251         (ImplicitReferenceConversionExists): Split out from
18252         StandardConversionExists. 
18253
18254         * expression.cs (As): We were only implementing one of the three
18255         cases for the as operator.  We now implement them all.
18256         (Is): Implement the various other cases for Is as well.
18257
18258         * typemanager.cs (CACHE): New define used to control if we want or
18259         not the FindMembers cache.  Seems to have a negative impact on
18260         performance currently
18261
18262         (MemberLookup): Nested types have full acess to
18263         enclosing type members
18264
18265         Remove code that coped with instance/static returns for events, we
18266         now catch this in RealFindMembers.
18267
18268         (RealFindMembers): only perform static lookup if the instance
18269         lookup did not return a type or an event.  
18270
18271 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18272
18273         * assign.cs (CompoundAssign): We pass more semantic information
18274         now to Compound Assignments than we did before: now we have all
18275         the information at hand, and now we resolve the target *before* we
18276         do the expression expansion, which allows the "CacheValue" method
18277         to have the effect we intended (before, a [x] += 1 would generate
18278         two differen ArrayAccess expressions from the ElementAccess,
18279         during the resolution process).
18280
18281         (CompoundAssign.DoResolve): Resolve target and original_source here.
18282
18283 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
18284
18285         * expression.cs (ArrayAccess): dropped debugging information. 
18286
18287         * typemanager.cs: Small bug fix: I was always returning i_members,
18288         instead of one of i_members or s_members (depending on which had
18289         the content).
18290
18291         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
18292         method is invoked before any code generation takes place, and it
18293         is a mechanism to inform that the expression will be invoked more
18294         than once, and that the method should use temporary values to
18295         avoid having side effects
18296
18297         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18298
18299         * ecore.cs (Expression.CacheTemporaries): Provide empty default
18300         implementation.
18301
18302         * expression.cs (Indirection, ArrayAccess): Add support for
18303         CacheTemporaries in these two bad boys. 
18304
18305         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18306         ldobj or ldind_ref.  
18307         (StoreFromPtr): Handle stobj as well.
18308
18309         * expression.cs (UnaryMutator): Share more code.
18310
18311         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18312         down: I was not tracking the Filter function as well, which
18313         was affecting the results of the cache.
18314
18315 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
18316
18317         * attribute.cs: Remove the hack to handle the CharSet property on
18318         StructLayouts. 
18319
18320 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
18321
18322         * attribute.cs (DoResolve): More uglyness, we now only try to
18323         resolve the attribute partially, to extract the CharSet
18324         information (only if we are a StructLayout attribute).  Otherwise 
18325
18326         (GetExtraTypeInfo): Add some code to conditionally kill in the
18327         future this.   I am more and more convinced that the .NET
18328         framework has special code to handle the attribute setting on
18329         certain elements.
18330
18331         * expression.cs (IsParamsMethodApplicable): Revert my previous
18332         foreach change here, it was wrong.
18333
18334 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
18335
18336         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
18337         (pp_expr): do not abort on unknown input, just return.
18338         (eval): abort if there are pending chars.
18339
18340         * attribute.cs (Attribute.Resolve): Positional parameters are
18341         optional.  Deal with that case.
18342
18343         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
18344         the Ansi/Unicode/Auto information for the type.
18345
18346         (TypeContainer.DefineType): instantiate the EmitContext here, as
18347         we will be using it during the type definition (to resolve
18348         attributes) and during the emit phase.
18349
18350         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18351         to pull type information out of the attributes
18352
18353         (Attribute.Resolve): track the constructor builder, and allow for
18354         multiple invocations (structs and classes will use this).
18355
18356         * ecore.cs (MemberLookupFinal): new version with all the
18357         parameters customizable.
18358
18359         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18360         constructors.  Return if the result value is null (as the error
18361         would have been flagged already by MemberLookupFinal)
18362
18363         Do not allow instances of abstract classes or interfaces to be
18364         created.
18365
18366         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18367         We have to compare the assembly property here when dealing with
18368         FamANDAssem and Assembly access modifiers, because we might be
18369         creating an assembly from *modules* (that means that we are not
18370         getting TypeBuilders for types defined in other modules that are
18371         part of this assembly).
18372
18373         (Method.Emit): If the method is marked abstract and has a body,
18374         emit an error. 
18375
18376         (TypeContainer.DefineMembers): If both the defined member and the
18377         parent name match are methods, then do not emit any warnings: let
18378         the Method.Define routine take care of flagging warnings.  But if
18379         there is a mismatch (method overrides something else, or method is
18380         overriwritten by something, then emit warning).
18381
18382         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18383         set to null, this means `do not check for the return type on the
18384         signature'. 
18385
18386         (Method.Define): set the return type for the method signature to
18387         null, so that we get methods with the same name and parameters and
18388         different return types.  This is used to flag warning 114 (you are
18389         hiding a method, and you probably want to use the new/override
18390         keywords instead).
18391
18392         * typemanager.cs (MemberLookup): Implemented proper access
18393         control, closing a long standing set of bug reports.  The problem
18394         was that the Framework only has two bits: Public and NonPublic,
18395         and NonPublic includes private and protected methods, but we need
18396         to enforce the FamANDAssem, FamOrAssem and Family. 
18397
18398 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
18399
18400         * statement.cs (GotoCase): Return true: Ammounts to giving up
18401         knowledge on whether we return or not, and letting the other case
18402         be responsible for it.
18403
18404 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
18405
18406         * driver.cs: Do not load directories for each file processed, only
18407         do it if there is a pattern.
18408
18409         * ecore.cs: Report readonly assigns here as well, as we might have
18410         been resolved only by MemberAccess.
18411
18412         (SimpleName.SimpleNameResolve): Also be useful for LValue
18413         resolution.   We need this to propagate assign to local readonly variables
18414
18415         * typemanager.cs: Use a ptrhashtable for the criteria, because we
18416         do not want to reuse potential criteria memory.
18417
18418         * class.cs (MyEventBuilder): Set reflected_type;
18419
18420         * ecore.cs (Constantify): Added support for constifying bools.
18421
18422         (RootContext.LookupType): Added a cache for values looked up in
18423         the declaration space.
18424
18425         * typemanager.cs (FindMembers): Now is a front-end to
18426         RealFindMembers, and provides a two-level hashtable-based cache to
18427         the request.  
18428
18429         15% performance improvement: from 22.5 to 19.2 seconds.
18430
18431         * expression.cs (IsParamsMethodApplicable): use foreach.
18432         (Invocation.DoResolve): ditto.
18433         (New.DoResolve): ditto.
18434         (ArrayCreation.DoResolve): ditto.
18435
18436         * ecore.cs (FindMostEncompassingType): use foreach.
18437
18438         * delegate.cs (NewDelegate.DoResolve): Use foreach
18439
18440         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18441         (RemoveMethods): use foreach.
18442
18443         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18444         nested foreach statements instead of for, and also break out of
18445         the inner loop once a match is found.
18446
18447         (Invocation.OverloadResolve): Use foreach, simplify the code. 
18448
18449 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
18450
18451         * cfold.cs (BinaryFold): During an enumeration evaluation context,
18452         we actually unwrap the expression to allow for extra information
18453         to be extracted. 
18454
18455         * expression.cs: Use Shr_Un on unsigned operations. 
18456
18457 2002-05-08  Ravi Pratap  <ravi@ximian.com>
18458
18459         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
18460         applicable operators was not being considered correctly. This closes
18461         the bug Miguel reported.
18462
18463 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18464
18465         * attribute.cs: check that the type derives from System.Attribute
18466         and report the correct error in that case (moved the duplicate code to
18467         its own method, too).
18468
18469 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18470
18471         * attribute.cs: lookup attribute type name as the spec says: first the
18472         bare attribute name and then name + "Attribute" (nant compiles with
18473         mcs after this fix).
18474
18475 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
18476
18477         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
18478         Because of the way we parse things, we should try to see if a
18479         UIntConstant can fit in an integer.
18480
18481 2002-05-07  Ravi Pratap  <ravi@ximian.com>
18482
18483         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18484         when we are in an explicit context.
18485
18486         (ConvertReferenceExplicit): When converting from Iface type S to Class
18487         T make sure the rules are implemented as an OR.
18488
18489         * parameter.cs (ParameterType): Make it a property for now although the
18490         purpose really isn't anything immediate.
18491
18492         * expression.cs (Is*Applicable): Do better checking on the parameter type
18493         of a ref/out parameter. The ones from the system assemblies are already 
18494         marked with the correct type so we don't need to do any correction.
18495
18496         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
18497         the object type is standard too so include that.
18498
18499 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18500
18501         * ecore.cs (StandardConversionExists): Augment with missing code:
18502         deal with IntConstant, LongConstants and Enumerations.
18503
18504         * assign.cs: Report the error, instead of failing silently
18505
18506         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18507         typecontainer that they are declared, because the
18508         typecontainer/namespace will have the list of using clauses that
18509         need to be applied.
18510
18511         Assembly Attributes were escaping the normal registration
18512         mechanism. 
18513
18514         (EmitCode): Apply attributes within an EmitContext that represents
18515         the container they were declared on.
18516
18517         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
18518
18519 2002-05-06  Ravi Pratap  <ravi@ximian.com>
18520
18521         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18522         Revamp completely - make much cleaner as we now operate only
18523         on a set of Types.
18524
18525         (FindMostSpecificSource, FindMostSpecificTarget): New methods
18526         to implement the logic detailed in the spec more correctly.
18527
18528         (UserDefinedConversion): Update accordingly.
18529
18530 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18531
18532         * statement.cs: Return flow analysis information up.
18533
18534         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18535         and the default.
18536
18537         (token): Do not consume an extra character before calling
18538         decimal_digits.
18539
18540 2002-05-06  Piers Haken <piersh@friskit.com>
18541
18542         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18543
18544 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18545
18546         * class.cs (Constructor.Emit): Set the IsStatic flag in the
18547         EmitContext during the instance constructor initializer
18548         resolution, to stop access to instance variables.
18549
18550         This is mandated by the spec, last paragraph of the `constructor
18551         initializers' section. 
18552
18553 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
18554
18555         * cs-parser.jay, class.cs (Accessor): new class used to represent
18556         an accessor (get or set).  In the past we used `null' to represent
18557         a missing accessor.  But this is ambiguous because there was no
18558         way to tell in abstract indexers/properties if one of them was
18559         specified.
18560
18561         Now there is a way of addressing that.
18562
18563         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18564         instead of FindMembers.
18565
18566         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18567         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
18568
18569         * attribute.cs: Treat indexers and properties as the same in terms
18570         of applying attributes
18571
18572         * ecore.cs (FindMostEncompassedType): Use statically initialized
18573         EmptyExpressions()s like we do elsewhere to avoid creating useless
18574         objects (and we take this out of the tight loop).
18575
18576         (GetConversionOperators): Move the code to extract the actual
18577         operators to a separate routine to clean things up.
18578
18579 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
18580
18581         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
18582         events are always registered FieldBuilders.
18583
18584         * class.cs (FieldBase): New class shared by Fields 
18585
18586         * delegate.cs: If we are a toplevel delegate, use our full name.
18587         If we are a nested delegate, then only use our tail name.
18588
18589 2002-05-02  Ravi Pratap  <ravi@ximian.com>
18590
18591         * expression.cs (IsApplicable): Ensure that we add the "&" to
18592         ref/out types before comparing it with the type of the argument.
18593
18594         (IsParamsMethodApplicable): Ditto.
18595
18596         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
18597         silly me ;-)
18598
18599         * delegate.cs : Handle the case when we have more than one applicable
18600         method. Flag an error only when we finish checking all.
18601
18602 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
18603
18604         * expression.cs: Add support for boolean static initializers.
18605
18606 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
18607
18608         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
18609
18610         * parameter.cs (ComputeParameterTypes,
18611         ComputeAndDefineParameterTypes): Better error handling: now we
18612         clear the `types' cache if we fail during any of the type lookups.
18613         We also return the status code correctly to our caller
18614
18615         * delegate.cs: If we fail to define a delegate, abort the extra
18616         steps. 
18617
18618         * expression.cs (Binary.ResolveOperator): for
18619         operator==(object,object) and operator !=(object, object) we also
18620         have to verify that there is an implicit conversion from one to
18621         the other.
18622
18623         (ArrayAccess.DoResolve): Array Access can operate on
18624         non-variables. 
18625
18626 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
18627
18628         * assign.cs (CompoundAssign): A new class used as a "flag" that
18629         the assignment actually is happening as part of a compound
18630         assignment operator.
18631
18632         During compound assignment, a few new rules exist to enable things
18633         like:
18634
18635         byte b |= 1 + 2
18636
18637         From the spec:
18638
18639         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
18640         to the type of x) if y is implicitly convertible to the type of x,
18641         and the operator is a builtin operator and the return type of the
18642         operator is explicitly convertible to the type of x. 
18643
18644         * rootcontext.cs: Reset warning level to 2.  4 catches various
18645         "interesting" features in mcs, we must clean this up at some
18646         point, but currently am trying to kill other bugs ;-)
18647
18648         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
18649         in container classes as well.  
18650
18651         * expression.cs (Binary.ResolveOperator): Handle string case
18652         before anything else (as operator overloading does emit an error
18653         before doing anything else).
18654
18655         This code could go away when we move to a table driven model, but
18656         i could not come up with a good plan last night.
18657
18658 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
18659
18660         * typemanager.cs (CSharpName): reimplementation using regex.
18661         * class.cs: added null check for fields in Emit
18662         * rootcontext.cs: set warninglevel to 4
18663
18664 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
18665
18666         * typemanager.cs (CSharpName): reimplemented with Lupus
18667         suggestion.
18668
18669 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
18670
18671         * statement.cs (If): correclty implement Resolve, because we were
18672         not catching sem errors in there.  The same process is needed
18673         everywhere else. 
18674         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
18675
18676
18677         (Statement.Warning_DeadCodeFound): Factorize code.
18678         (While): Report dead code here too.
18679
18680         (Statement): Added Resolve virtual method to allow
18681         for resolution split from the emit code.
18682
18683 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
18684
18685         * statement.cs (EmitBoolExpression): No longer try to resolve the
18686         expression here.    
18687         (MakeBoolean): New utility function that resolve, implicitly
18688         converts to boolean and tags the expression. 
18689
18690
18691         (If, Do): Implement dead code elimination.
18692         (While): Implement loop inversion
18693
18694         (Do, While, For, If): Resolve the expression prior to calling our
18695         code generation.
18696
18697 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
18698
18699         * class.cs:
18700           - added method Report28 (warning: program has more than one entry point)
18701           - added method IsEntryPoint, implements paragraph 10.1 of the spec
18702           - modified method Method.Define, the part at the end of the method
18703
18704         * rootcontext.cs: added static public Location EntryPointLocation;
18705           
18706         * ../errors/cs0028.cs : Add test case for the above warning.              
18707
18708         * typemanager.cs:
18709           - modified method CSharpName to allow arrays of primitive type to
18710             be printed nicely (e.g. instead of System.Int32[][] it now prints
18711             int[][])
18712           - added method CSharpSignature: returns the signature of a method
18713             in string format to be used in reporting errors, warnings, etc.
18714
18715         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
18716         with String.Empty.
18717
18718 2002-04-26  Ravi Pratap  <ravi@ximian.com>
18719
18720         * delegate.cs (Define): Fix extremely silly bug where I was
18721         setting the type of the 'object' parameter of the BeginInvoke
18722         method to System.IAsyncResult instead of System.Object ;-)
18723
18724 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
18725
18726         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
18727         here. 
18728
18729         (Constructor.Emit): return if we fail to initialize the
18730         constructor.  Another door closed!  
18731
18732         * expression.cs (New.DoResolve): Improve error message (from -6 to
18733         1501).  Use DeclaredOnly lookup to find the exact constructor.
18734
18735         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
18736         loop.  This is useful.
18737
18738         * cs-parser.jay: Adjust the default parameters so that destructors
18739         have the proper signature.
18740
18741 2002-04-26  Martin Baulig  <martin@gnome.org>
18742
18743         * driver.cs (LoadAssembly): If `assembly' contains any characters
18744         which are only valid in path names and not in assembly names
18745         (currently slash, backslash and point), use Assembly.LoadFrom ()
18746         instead of Assembly.Load () on the `assembly' (before iteration
18747         over the link_paths).
18748
18749 2002-04-26  Martin Baulig  <martin@gnome.org>
18750
18751         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
18752
18753 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
18754
18755         * class.cs (Property): use the new typemanager.MemberLookup
18756
18757         (TypeContainer.MemberLookup): Implement using the
18758         TypeManager.MemberLookup now. 
18759
18760         * typemanager.cs: Make MemberLookup a function of the TypeManager,
18761         and return MemberInfos, so that these can be used without an
18762         EmitContext (what we had before).
18763
18764 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
18765
18766         * expression.cs: Fix the case where the argument to params if the
18767         type of the params.  I omitted handling this before.   Fixed
18768
18769 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
18770
18771         * driver.cs: Call BootCorlib_PopulateCoreType
18772
18773         * class.cs (Property.CheckBase): Check for properties only, not
18774         for all members. 
18775
18776         * interface.cs: Temporary hack: try/catch around the
18777         CustomAttributeBuilder, because I am getting an exception that I
18778         do not understand.
18779
18780         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
18781         types whose definitions are required to be there (attributes are
18782         defined before standard types).
18783
18784         Compute definitions as we boot the various types, as they are used
18785         immediately (value_type class will need object_type, but if we do
18786         not initialize object_type, we will pass a null, which will let
18787         the runtime pick the System.Object from the existing corlib, which
18788         is not what we want).
18789
18790 2002-04-22  Patrik Torstensson <totte@labs2.com>
18791
18792         * cs-tokenizer.cs: fixed a number of trim() issues.
18793
18794 2002-04-22  Ravi Pratap  <ravi@ximian.com>
18795
18796         * expression.cs (Argument.Type): Ensure that we return the correct
18797         type when we have out or ref parameters [in which case we 
18798         append a "&"].
18799
18800 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
18801
18802         * class.cs (Property, Indexer): Allow extern modifier in there. 
18803
18804         * typemanager.cs (InitBaseTypes): Initializes object_type and
18805         value_type, since those will be used early on during the bootstrap
18806         process to compile corlib.
18807
18808         (InitCoreTypes): Move code from here to InitBaseTypes.
18809
18810 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
18811
18812         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
18813         single-dimension arrays as using the ldlen opcode.  
18814
18815         Daniel Lewis discovered this optimization.  
18816
18817         * typemanager.cs: Add signature for System.Array::get_Length
18818
18819 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18820
18821         * statement.cs: report the error when the foreach does not apply to an
18822         array nor a collection.
18823
18824 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
18825
18826         * expression.cs: Add implicit conversions to the operator ~.
18827
18828         * constant.cs (DecimalConstant.Emit): Emit decimal value.
18829
18830         * typemanager.cs: Locate the decimal constructor.
18831
18832 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18833
18834         * attribute.cs: use the new property of TypeOf.
18835         * expression.cs: added 'get' property around typearg.
18836
18837         These changes fix a build breaker reported by NickD. Is this the
18838         correct way to fix?  If not, please, revert my changes and make it
18839         work :-).
18840
18841 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
18842
18843         * attribute.cs: Add support for typeof in attribute invocations.
18844         I am not sure that this is right though.
18845
18846 2002-04-14  Duncan Mak  <duncan@ximian.com>
18847
18848         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
18849         Binary.Operator.Division case.
18850
18851 2002-04-13  Ravi Pratap  <ravi@ximian.com>
18852
18853         * class.cs (DefineType): Ensure that we do a proper check on
18854         attribute types and also register it with the TypeManager.
18855
18856         (TypeContainer.Targets): The default for attribute types is
18857         AttributeTargets.All.
18858
18859         * attribute.cs (ApplyAttributes): Registering the attribute type
18860         is done elsewhere, not when we discover we have a Usage attribute.
18861
18862 2002-04-12  Ravi Pratap  <ravi@ximian.com>
18863
18864         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
18865         and get rid of is_delegate parameter.
18866
18867         * everywhere : update.
18868
18869 2002-04-12  Ravi Pratap  <ravi@ximian.com>
18870
18871         * cs-parser.jay (compilation_unit): Revamp completely to use
18872         some new ideas that I got from Rhys' grammar to solve the problems
18873         with assembly level attributes.
18874
18875         (outer_declaration): New grammar production.
18876
18877         (attribute_sections): Add.
18878
18879         (opt_attributes): Base on attribute_sections
18880
18881         (namespace_declaration): Allow opt_attributes to tackle the case
18882         when we have assembly level attributes - we are clever in this
18883         regard now ;-)
18884
18885         * attribute.cs (ApplyAttributes): Do not worry about assembly 
18886         attributes in the non-global context.
18887
18888         * rootcontext.cs (AddGlobalAttributes): Go back to using this
18889         instead of SetGlobalAttributes.
18890
18891         * class.cs, rootcontext.cs : Ensure we define and generate 
18892         attribute types before anything else.
18893
18894         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
18895         and flag the new error -20 for the case when the attribute type
18896         does not have valid targets specified. csc does not catch this.
18897
18898         * ../errors/errors.txt : update for error # -20
18899
18900 2002-04-11  Ravi Pratap  <ravi@ximian.com>
18901
18902         * support.cs (InternalParameters.ParameterModifier): Do some null
18903         checking and return sane values.
18904
18905         * class.cs (Method.Define): If we are a PInvoke method, ensure
18906         that we are static and extern. Report error # 601
18907
18908         * ../errors/cs0601.cs : Add test case for the above error.
18909
18910 2002-04-07  Ravi Pratap  <ravi@ximian.com>
18911
18912         * rootcontext.cs (attribute_types): We need to keep type of
18913         all attribute types separately and emit code for them first.
18914
18915         (RegisterAttribute) : Implement.
18916
18917         * class.cs (DefineType): Check if the current Type is a custom
18918         attribute type and register it accordingly.
18919
18920         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
18921         adding the first attribute twice and rename to
18922
18923         (SetGlobalAttributes): this.
18924
18925         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
18926         lookups.
18927
18928         * attribute.cs (ApplyAttributes): Take an additional argument telling us
18929         if we are processing global arguments. Hmm, I am unsure of this.
18930
18931 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18932
18933         * expression.cs: added static array of strings to avoid calling
18934         Enum.ToString () for Operator in Binary. Significant recover of
18935         performance.
18936
18937 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
18938
18939         * class.cs (FindMembers): Allow the Builders of the various
18940         members to be null.  If they are skip them.  This only happens
18941         during the PInvoke declaration.
18942
18943 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
18944
18945         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
18946         failure, so we do not keep going afterwards.
18947
18948         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
18949         wanted to pass `false' as the `is_delegate' argument.  If this is
18950         the case, why not use delegate_type == null to mean `is_delegate =
18951         false' and anything else as is_delegate = true.
18952
18953 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
18954
18955         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
18956         code for the section, not the beginning of the tests.
18957
18958 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
18959
18960         * cfold.cs: Handle operator + (Enum x, Underlying x) 
18961
18962         * expression.cs (Binary): same.  Warn about errors where we have
18963         Enum/Enum in operator + as well.
18964
18965 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
18966
18967         * statement.cs:
18968                 - added support for switch(bool)
18969                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
18970                 - add TableSwitchEmit() to handle table-based switch statements
18971
18972 2002-04-05  Ravi Pratap  <ravi@ximian.com>
18973
18974         * expression.cs (Invocation.OverloadResolve): Factor out code which
18975         does parameter compatibility checking with arguments so that we can 
18976         re-use the code even from Delegate.VerifyApplicability
18977
18978         (VerifyArgumentsCompat): Move above code here.
18979
18980         * delegate.cs (VerifyApplicability): Get rid of duplicate code
18981         and instead make a call to the above method.
18982
18983 2002-03-31  Ravi Pratap  <ravi@ximian.com>
18984
18985         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
18986         We use it to keep track of classes which are attribute types.
18987
18988 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
18989
18990         * delegate.cs (Delegate.Define): Correctly define the types in the
18991         presence of fixed and array parameters.
18992
18993         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
18994         doing FindMembers.
18995
18996         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
18997         include NonPublic after the first iteration.
18998
18999         * class.cs (Indexer.CheckBase): Only check if both parents are
19000         non-null. 
19001
19002         * cs-parser.jay (accessor_body): If empty, set to null.
19003
19004         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
19005         same code path here to resolve constants names that we did have in
19006         MemberAccess.DoResolve.  There is too much code duplicated here.
19007
19008 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
19009
19010         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
19011
19012         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
19013         to MakeUnionSet.
19014
19015         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
19016         tokens, numbers and strings.
19017
19018         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
19019         parenthesis.
19020
19021         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
19022         asyncronous parameters and the regular parameters.  
19023
19024         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
19025         specify the target directory.
19026
19027         * expression.cs: (This.DoResolve): Simplify
19028         (As.Emit): Optimize, do not generate IsInst if the expression is
19029         always of the given type.
19030
19031         (Is.DoResolve): Bug fix, we were reporting both always/never for
19032         the is expression.
19033
19034         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
19035         creating too many unnecessary arrays.
19036
19037 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
19038
19039         * class.cs (EmitFieldInitializer): Use Assign expression to assign
19040         fields instead of rolling our own initializer.   Takes care of all
19041         implicit conversions, and drops unnecessary static checks/argument.
19042
19043 2002-03-31  Dick Porter  <dick@ximian.com>
19044
19045         * driver.cs: use the GetDirectories() return values properly, and
19046         use "/" as path separator.
19047
19048 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
19049
19050         * expression.cs (Unary): Optimize - - expr into expr.
19051         (Binary): Optimize a + (-b) into a -b.
19052
19053         * codegen.cs (CodeGen): Made all methods static.
19054
19055 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
19056
19057         * rootcontext.cs: 
19058
19059         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
19060         TypeBuilder property.
19061
19062         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
19063         instead. 
19064
19065         * tree.cs: Removed the various RecordXXXX, and replaced with a
19066         single RecordDecl.  Removed all the accessor methods, and just
19067         left a single access point Type 
19068
19069         * enum.cs: Rename DefineEnum to DefineType.
19070
19071         * decl.cs: New abstract method `DefineType' used to unify the
19072         Defines for Enumerations, Interfaces, TypeContainers and
19073         Delegates.
19074
19075         (FindType): Moved LookupInterfaceOrClass here.  Moved the
19076         LookupBaseClasses method that used to live in class.cs and
19077         interface.cs here, and renamed to FindType.
19078
19079         * delegate.cs: Implement DefineType.  Take advantage of the
19080         refactored pattern for locating the parent builder without taking
19081         the parent_builder argument (which we know does not work if we are
19082         nested, and triggering a toplevel definition).
19083
19084 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19085
19086         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
19087         accessibility of a member has changed during override and report
19088         an error if so.
19089
19090         * class.cs (Method.Define, Property.Define): Only complain on
19091         overrides if the method is private, any other accessibility is
19092         fine (and since we just checked the permission is the same, we are
19093         good to go).
19094
19095         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
19096         and elif are processed always.  The other pre-processing
19097         directives are only processed if we are "taking" the path
19098
19099 2002-03-29  Martin Baulig  <martin@gnome.org>
19100
19101         * class.cs (Method.Emit): Only emit symbolic debugging info if the
19102         current location is not Null.
19103
19104         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
19105         a separate method so we can profile it.
19106
19107         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
19108         `span.Seconds' are just seconds, but no minutes or hours.
19109         (MainDriver): Profile the CodeGen.SaveSymbols calls.
19110
19111 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19112
19113         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
19114         Remove the gratuitous set of Final:
19115
19116                                 // If an interface implementation, then we can set Final.
19117                                 if (((flags & MethodAttributes.Abstract) == 0) &&
19118                                     implementing.DeclaringType.IsInterface)
19119                                         flags |= MethodAttributes.Final;
19120
19121         I do not know what I was smoking when I used that.
19122
19123
19124         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
19125         step into fixing the name resolution issues for delegates and
19126         unifying the toplevel name resolution.
19127
19128 2002-03-28  Martin Baulig  <martin@gnome.org>
19129
19130         * class.cs (Method.Emit): If we have a symbol writer, call its
19131         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
19132         tell it about the current method.
19133
19134         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
19135         writer that we're going to emit the first byte of IL code for a new
19136         statement (a new source line).
19137         (EmitContext.EmitTopBlock): If we have a symbol writer, call
19138         EmitContext.Mark() before emitting any code.
19139
19140         * location.cs (SymbolDocument): Return null when we're Null.
19141
19142         * statement.cs (Statement): Moved the `Location loc' variable here.
19143         (Statement.EmitBoolExpression): If we have a symbol writer, call
19144         ec.Mark() before emitting any code to tell it that we're at the
19145         beginning of a new statement.
19146         (StatementExpression): Added `Location' argument to the constructor.
19147         (Block): Added public readonly variable `StartLocation' and public
19148         variable `EndLocation'.  The latter is to be set using SetEndLocation().
19149         (Block): Added constructor which takes a start and end location.
19150         (Block.SetEndLocation): New method. This sets the end location.
19151         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
19152         local variables we create.
19153         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
19154         each statement and do also mark the begin and end of the block.
19155
19156         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
19157         tell it the current lexer.Location, use Location.Null for the end of the
19158         block.
19159         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
19160         current block, set its end location using SetEndLocation().
19161         (statement_expression): StatementExpression constructor now takes the
19162         lexer.Location as additional argument.
19163         (for_statement, declare_local_variables): Likewise.
19164         (declare_local_variables): When creating a new implicit block, use the
19165         new Block constructor and pass it the lexer.Location.
19166
19167 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19168
19169         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
19170         members also on the parent interfaces recursively.
19171
19172 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
19173
19174         * report.cs: Use new formats, since Gonzalo finished the missing
19175         bits. 
19176
19177         * expression.cs (Binary.ResolveOperator): added missing operator|
19178         operator& and operator^ for bool/bool.
19179
19180         * cs-parser.jay: CheckDef now takes a Location argument that is
19181         used to report errors more precisly (instead of reporting the end
19182         of a definition, we try to track something which is a lot closer
19183         to the source of the problem).
19184
19185         * cs-tokenizer.cs: Track global token use, so we can properly flag
19186         the use of #define/#undef after the first token has been seen.
19187
19188         Also, rename the reportXXXX to Error_DescriptiveName
19189
19190         * decl.cs (DeclSpace.IsTopLevel): Move property here from
19191         TypeContainer, so that Enum and Interface can use this too.
19192
19193         * class.cs (TypeContainer.LookupInterfaceOrClass,
19194         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
19195         `builder' argument.  Typically this was used to pass the parent
19196         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
19197         the definition).  
19198
19199         The problem is that a nested class could trigger the definition of
19200         a toplevel class, and the builder would be obviously wrong in that
19201         case. 
19202
19203         So we drop this argument, and we compute dynamically the
19204         TypeBuilder/ModuleBuilder (the correct information was available
19205         to us anyways from DeclSpace.Parent)
19206
19207         * interface.cs (Interface.DefineInterface): Drop builder
19208         parameter cleanup like class.cs
19209
19210         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
19211         like class.cs
19212
19213         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
19214         values. 
19215
19216         (Try.Emit): Propagate the returns value from the statement.
19217
19218         (Return.Emit): Even if we are leavning 
19219
19220         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
19221
19222         * modifiers.cs: Fix the computation of MethodAttributes flags.
19223
19224 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
19225
19226         * driver.cs: allow compilation of files that start with '/'.
19227         Add a default case when checking the argument of --target.
19228
19229 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
19230
19231         * interface.cs: Implement the same search algorithm for types in
19232         the interface code.
19233
19234         * delegate.cs: Do not allow multiple definition.
19235
19236         * Recovered ChangeLog that got accidentally amputated
19237
19238         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
19239
19240         * rootcontext.cs: Load manually enum to allow core classes to
19241         contain enumerations.
19242
19243         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
19244         Update to new static methods in TypeManager.
19245
19246         * typemanager.cs (GetMethod, GetConstructor): Use our
19247         implementation of FindMembers to find the members, since during
19248         corlib compilation, the types are TypeBuilders and GetMethod and
19249         GetConstructor do not work.
19250
19251         Make all methods in TypeManager static.
19252
19253         (InitCodeHelpers): Split the functionality from
19254         the InitCodeTypes function.
19255
19256         * driver.cs: Call InitCodeHelpers after we have populated the
19257         types. 
19258
19259         * cs-parser.jay (delegate_declaration): we did not used to compute
19260         the delegate name correctly for void delegates.
19261
19262 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
19263
19264         * rootcontext.cs (RootContext): Init the interface_resolve_order
19265         and type_container_resolve_order always.
19266
19267         (ResolveCore, BootstrapCorlib_ResolveClass,
19268         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19269         compiler when compiling with --nostdlib
19270
19271         * class.cs (TypeContainer.DefineType): Check that our parent is
19272         not null.  This test is most important when we are bootstraping
19273         the core types.
19274
19275         * codegen.cs: Split out the symbol writing code.
19276
19277 2002-03-25  Martin Baulig  <martin@gnome.org>
19278
19279         * driver.cs (-g): Made -g an alias for --debug.
19280
19281 2002-03-24  Martin Baulig  <martin@gnome.org>
19282
19283         * codegen.cs (SymbolWriter): New public variable. Returns the
19284         current symbol writer.
19285         (CodeGen): Added `bool want_debugging_support' argument to the
19286          constructor. If true, tell the ModuleBuild that we want debugging
19287         support and ask it for the ISymbolWriter.
19288         (Save): If we have a symbol writer, call it's Close() method after
19289         saving the assembly.
19290
19291         * driver.c (--debug): New command line argument to create a
19292         debugger information file.
19293
19294         * location.cs (SymbolDocument): New public property. Returns an
19295         ISymbolDocumentWriter object for the current source file or null
19296         if we don't have a symbol writer.
19297
19298 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
19299
19300         * driver.cs (LoadAssembly): Correctly return when all the paths
19301         have been tried and not before.
19302
19303         * statement.cs (Switch.Emit): return the actual coverage for this
19304         statement (returns/not-returns)
19305
19306         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19307         switch of the statement if we are the last switch section.  That
19308         kills two problems: try/catch problems (we used to emit an empty
19309         nop at the end) and switch statements where all branches would
19310         return. 
19311
19312 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
19313
19314         * driver.cs: Add default assemblies (the equivalent to the
19315         Microsoft CSC.RSP file)
19316
19317         * cs-tokenizer.cs: When updating `cols and setting it to zero,
19318         also update tokens_seen and set it to false.
19319
19320         * driver.cs: Implement --recurse for Mike.
19321
19322         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19323         correctly splitting out the paths.
19324
19325 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
19326
19327         * interface.cs (Interface.PopulateProperty): Instead of using
19328         `parent' as the declaration space for the set parameters, use
19329         `this' 
19330
19331         * support.cs (InternalParameters): InternalParameters constructor
19332         takes a DeclSpace instead of a TypeContainer.
19333
19334         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
19335         types are being initialized, load the address of it before calling
19336         the function.  
19337
19338         (New): Provide a mechanism to disable the generation of local
19339         value type temporaries when the caller will be providing us with
19340         an address to store it.
19341
19342         (ArrayCreation.EmitDynamicInitializers): Use it.
19343
19344 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
19345
19346         * expression.cs (Invocation.EmitArguments): Only probe for array
19347         property if there is more than one argument.  Sorry about that.
19348
19349         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19350         empty param arrays.
19351
19352         * class.cs (Method.LabelParameters): Fix incorrect code path that
19353         prevented the `ParamArrayAttribute' from being applied to the
19354         params attribute.
19355
19356 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
19357
19358         * support.cs (ReflectionParameters): Correctly compute whether the
19359         last argument is a params array.  Fixes the problem with
19360         string.Split ('a')
19361
19362         * typemanager.cs: Make the assemblies array always be non-null
19363         (empty, but non-null)
19364
19365         * tree.cs (RecordDecl): New function that abstracts the recording
19366         of names.  This reports error 101, and provides a pointer to the
19367         previous declaration.  Fixes a crash in the compiler.
19368
19369         * cs-parser.jay (constructor_declaration): Update to new grammar,
19370         and provide a constructor_body that can be empty.
19371
19372 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
19373
19374         * driver.cs: Add support for --resources.
19375
19376         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19377         Make all types for the various array helper methods be integer.
19378
19379         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19380         CheckState to ConvCast.
19381
19382         (ConvCast): Now it takes a `checked' state argument, to avoid
19383         depending on the emit context for the conversion, and just using
19384         the resolve time setting.
19385
19386         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19387         instead of Invocation.EmitArguments.  We do not emit the original
19388         arguments, instead we emit those which have been converted to
19389         unsigned int expressions.
19390
19391         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19392
19393         * codegen.cs: ditto.
19394
19395         * expression.cs (LocalVariableReference): Drop the use of the
19396         Store function that depended on the variable index.
19397
19398         * statement.cs (VariableInfo): Drop the `Idx' property from this
19399         class, as this is not taking into account the indexes for
19400         temporaries tat we generate during the execution, getting the
19401         indexes wrong.
19402
19403         * class.cs: First emit class initializers, then call the parent
19404         constructor. 
19405
19406         * expression.cs (Binary): Fix opcode emision.
19407         (UnaryMutator.EmitCode): Support checked code generation
19408
19409         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19410         matches for events for both the Static and Instance scans,
19411         pointing to the same element.   Fix that.
19412
19413 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
19414
19415         * rootcontext.cs (ResolveTree): Always set the
19416         interface_resolve_order, because nested interfaces will be calling
19417         into us.
19418
19419         * class.cs (GetInterfaceOrClass): Track the same resolution
19420         process used by TypeManager.LookupType.  This fixes the nested
19421         type lookups in class declarations (separate path from
19422         LookupType). 
19423
19424         (TypeContainer.DefineType): Also define nested interfaces.
19425         (TypeContainer.RegisterOrder): New public function used to
19426         register the order in which child interfaces need to be closed.
19427
19428         Nested interfaces need to be closed after their parents have been
19429         created. 
19430
19431         * interface.cs (InterfaceAttr): Put all the logic for computing
19432         the interface attribute here. 
19433
19434         (DefineInterface): Register our interface order with the
19435         RootContext or with the TypeContainer depending on the case.
19436
19437 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19438
19439         * cs-parser.jay: rework foreach statement to work with the new
19440         changes to the policy on SimpleNames.
19441
19442         * report.cs: support Stacktrace on warnings as well.
19443
19444         * makefile: drop --unsafe and /unsafe from the compile.
19445
19446 2002-03-13  Ravi Pratap  <ravi@ximian.com>
19447
19448         * ecore.cs (StandardConversionExists): Modify to take an Expression
19449         as the first parameter. Ensure we do null -> reference type conversion
19450         checking.
19451
19452         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19453         temporary Expression objects.
19454
19455 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19456
19457         * interface.cs: workaround bug in method overloading resolution
19458         (there is already a bugzilla bug for it).
19459
19460 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19461
19462         We could also solve this problem by having a separate path for
19463         performing type lookups, instead of DoResolve, we could have a
19464         ResolveType entry point, and only participating pieces of the
19465         production (simplename, deref, array) would implement this. 
19466
19467         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19468         signal SimpleName to only resolve type names and not attempt to
19469         resolve anything else.
19470
19471         * expression.cs (Cast): Set the flag.
19472
19473         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19474
19475         * class.cs: Only report 108 if there is no `new' modifier.
19476
19477         * cs-parser.jay: rework foreach statement to work with the new
19478         changes to the policy on SimpleNames.
19479         
19480         * report.cs: support Stacktrace on warnings as well.
19481
19482         * makefile: drop --unsafe and /unsafe from the compile.
19483
19484 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
19485
19486         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19487         lookups here, instead of doing that at parse time.  This means
19488         that our grammar will not introduce `LocalVariableReferences' as
19489         expressions at this point.  That solves the problem of code like
19490         this:
19491
19492         class X {
19493            static void Main ()
19494            { int X = 1;
19495             { X x = null }}}
19496
19497         This is only half the fix.  The full fix requires parameters to
19498         also be handled in this way.
19499
19500         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19501         makes the use more obvious of the DeclSpace.  The
19502         ec.TypeContainer.TypeBuilder is now only used to pull the
19503         TypeBuilder for it.
19504
19505         My theory is that I can get rid of the TypeBuilder completely from
19506         the EmitContext, and have typecasts where it is used (from
19507         DeclSpace to where it matters).  
19508
19509         The only pending problem is that the code that implements Aliases
19510         is on TypeContainer, and probably should go in DeclSpace.
19511
19512         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19513         lookups here, instead of doing that at parse time.  This means
19514         that our grammar will not introduce `LocalVariableReferences' as
19515         expressions at this point.  That solves the problem of code like
19516         this:
19517
19518         class X {
19519            static void Main ()
19520            { int X = 1;
19521             { X x = null }}}
19522
19523         This is only half the fix.  The full fix requires parameters to
19524         also be handled in this way.
19525
19526         * class.cs (Property.DefineMethod): When implementing an interface
19527         method, set newslot, when implementing an abstract method, do not
19528         set the flag (before we tried never setting it, or always setting
19529         it, which is the difference).
19530         (Indexer.DefineMethod): same.
19531         (Method.DefineMethod): same.
19532
19533         * ecore.cs: Only set the status used flag if we get back a Field.
19534
19535         * attribute.cs: Temporary hack, so Paolo can keep working.
19536
19537 2002-03-08  Ravi Pratap  <ravi@ximian.com>
19538
19539         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19540         the unmanaged type in the case we have a MarshalAs attribute.
19541
19542         (Resolve): Handle the case when we are parsing the special MarshalAs
19543         attribute [we need to store the unmanaged type to use later]
19544
19545         * typemanager.cs (marshal_as_attr_type): Built in type for the 
19546         MarshalAs Attribute.
19547
19548         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
19549         on parameters and accordingly set the marshalling info.
19550
19551 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
19552
19553         * class.cs: Optimizing slightly by removing redundant code after
19554         we switched to the `NoTypes' return value.
19555         (Property.DefineMethod): use NoTypes here too.
19556
19557         This fixes the bug I introduced in my last batch of changes.
19558
19559 2002-03-05  Ravi Pratap  <ravi@ximian.com>
19560
19561         * tree.cs (RecordEnum): Add. We now keep track of enums too.
19562
19563         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19564         Enums since those are types too. 
19565
19566         * cs-parser.jay (enum_declaration): Record enums as we parse them.
19567
19568         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
19569         thanks to a call during the lookup process.
19570
19571 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
19572
19573         * statement.cs (Foreach): Lots of work to accomodate a particular
19574         kind of foreach statement that I had not kept in mind.  It is
19575         possible to have foreachs on classes that provide a GetEnumerator
19576         method that return objects that implement the "pattern" for using
19577         a foreach, there is no need to support GetEnumerator
19578         specifically. 
19579
19580         This is needed to compile nant.
19581
19582         * decl.cs: Only report 114 if the member is not `Finalize' and if
19583         the warning level is at least 2.
19584
19585         * class.cs: Moved the compare function from Method to
19586         MethodSignature. 
19587
19588         (MethodSignature.InheritableMemberSignatureCompare): Add new
19589         filter function that is used to extract inheritable methods from a
19590         class. 
19591
19592         (Method.Define): Use the new `inheritable_method_signature_filter'
19593         delegate
19594
19595         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
19596         command. 
19597
19598 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
19599
19600         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
19601
19602         * cs-parser.jay: Add opt_semicolon to the interface declaration.
19603
19604         * expression.cs: Pass location information to
19605         ConvertImplicitStandard. 
19606
19607         * class.cs: Added debugging code to track return values from
19608         interfaces. 
19609
19610 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
19611
19612         * expression.cs (Is.DoResolve): If either side of the `is' is an
19613         interface, do not flag the warning.
19614
19615         * ecore.cs (ImplicitReferenceConversion): We need a separate test
19616         for interfaces
19617
19618         * report.cs: Allow for --fatal to be used with --probe.
19619
19620         * typemanager.cs (NoTypes): Move the definition for the empty Type
19621         array here. 
19622
19623         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
19624         properties. 
19625         (TypeContainer.DefineProxy): New function used to proxy to parent
19626         implementations when implementing interfaces.
19627         (TypeContainer.ParentImplements): used to lookup if our parent
19628         implements a public function that is required by an interface.
19629         (TypeContainer.VerifyPendingMethods): Hook this up.
19630
19631         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
19632         `modules' and `assemblies' arraylists into arrays.  We only grow
19633         these are the very early start up of the program, so this improves
19634         the speedof LookupType (nicely measured).
19635
19636         * expression.cs (MakeByteBlob): Replaced unsafe code with
19637         BitConverter, as suggested by Paolo.
19638
19639         * cfold.cs (ConstantFold.Binary): Special case: perform constant
19640         folding of string concatenation, but if either side is a string,
19641         and the other is not, then return null, and let the runtime use
19642         the concatenation on the string plus the object (using
19643         `Object.ToString'). 
19644
19645 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
19646
19647         Constant Folding has been implemented now.
19648
19649         * expression.cs (Unary.Reduce): Do not throw an exception, catch
19650         the error instead on types that are not supported in one's
19651         complement. 
19652
19653         * constant.cs (Constant and all children): New set of functions to
19654         perform implict and explicit conversions.
19655
19656         * ecore.cs (EnumConstant): Implement the new functions to perform
19657         conversion by proxying to the child expression.
19658
19659         * codegen.cs: (ConstantCheckState): Constant evaluation has its
19660         own separate setting that can not be turned off from the command
19661         line using --unchecked or --checked and is only controlled using
19662         the checked/unchecked statements and expressions.  This setting is
19663         used by the constant folder to flag errors.
19664
19665         * expression.cs (CheckedExpr, UncheckedExpr): Set the
19666         ConstantCheckState as well.   
19667
19668         During Resolve, they also have to flag the state, because the
19669         constant folder runs completely in the Resolve phase.
19670
19671         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
19672         well.
19673
19674 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
19675
19676         * cfold.cs: New file, this file contains the constant folder.
19677
19678         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
19679         argument to track whether we are using the resulting address to
19680         load or store a value and provide better error messages. 
19681
19682         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
19683         new AddressOf arguments.
19684
19685         * statement.cs (Foreach.EmitCollectionForeach): Update
19686
19687         * expression.cs (Argument.Emit): Call AddressOf with proper
19688         arguments to track usage.
19689
19690         (New.DoEmit): Call AddressOf with new arguments.
19691
19692         (Unary.Emit): Adjust AddressOf call.
19693
19694 2002-03-01  Ravi Pratap  <ravi@ximian.com>
19695
19696         * cs-parser.jay (member_access): Change the case for pre-defined types
19697         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
19698         this suggestion.
19699
19700         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
19701         a method body.
19702
19703         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
19704         essentially like methods and apply attributes like MethodImplOptions to them too.
19705
19706         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
19707         not being null.
19708
19709         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
19710         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
19711         is the DeclSpace.
19712
19713         * Update code everywhere accordingly.
19714
19715         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
19716
19717         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
19718
19719 2002-02-28  Ravi Pratap  <ravi@ximian.com>
19720
19721         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
19722         try performing lookups against those instead of jumping straight into using
19723         the 'using' clauses.
19724
19725         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
19726
19727         (LookupType): Perform lookups in implicit parents too.
19728
19729         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
19730         sequence as RootContext.LookupType. 
19731
19732         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
19733         the various cases of namespace lookups into this method.
19734
19735 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
19736
19737         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
19738         in positional arguments)
19739
19740         * class.cs (Operator): Update the AllowedModifiers to contain
19741         extern. 
19742
19743         * cs-parser.jay: Update operator declaration to allow for the
19744         operator body to be empty.
19745
19746         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
19747         values. 
19748
19749 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
19750
19751         * class.cs (Method.Emit): Label parameters.
19752
19753         * driver.cs: Return 1 or 0 as the program exit code.
19754
19755 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
19756
19757         * expression.cs: Special case the `null' object when trying to
19758         auto-compute the type, as anything can be explicitly converted to
19759         that. 
19760
19761         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
19762         spotting this Paolo.
19763
19764         (Expression.ImplicitNumericConversion): Perform comparissions of
19765         the type using the underlying type in the case of an enumeration
19766         rather than using the enumeration type for the compare.
19767
19768         Cope with the underlying == type case, which is not possible to
19769         catch before. 
19770
19771         (Expression.ConvertNumericExplicit): Perform comparissions of
19772         the type using the underlying type in the case of an enumeration
19773         rather than using the enumeration type for the compare.
19774
19775         * driver.cs: If the user does not supply an extension, assume .exe
19776
19777         * cs-parser.jay (if_statement): Rewrote so that we can track the
19778         location for the if statement.
19779
19780         * expression.cs (Binary.ConstantFold): Only concat strings when
19781         the operation is "+", not everything ;-)
19782
19783         * statement.cs (Statement.EmitBoolExpression): Take a location
19784         argument. 
19785         (If, While, Do): Track location.
19786
19787         * expression.cs (Binary.ResolveOperator): In the object + string
19788         case, I was missing a call to ConvertImplicit
19789
19790 2002-02-25  Ravi Pratap  <ravi@ximian.com>
19791
19792         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
19793         Location arguments. Ensure we use RootContext.LookupType to do our work
19794         and not try to do a direct Type.GetType and ModuleBuilder.GetType
19795
19796         * interface.cs (PopulateMethod): Handle the type of the parameter being
19797         null gracefully.
19798
19799         * expression.cs (Invocation.BetterFunction): Handle the case when we 
19800         have a params method with no fixed arguments and a call is made with no
19801         arguments.
19802
19803 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
19804
19805         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
19806         the verbatim-string-literal
19807
19808         * support.cs (InternalParameters.ParameterModifier): handle null
19809         fixed parameters.
19810         (InternalParameters.ParameterType): ditto.
19811
19812         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
19813         duplicating the name of the variable parameter.
19814         (GetParameterByName): Fix bug where we were not looking up array
19815         paramters if they were the only present (thanks Paolo!).
19816         (GetParameterInfo): We only have an empty set of types if both
19817         fixed and array are set to null.
19818         (GetParameterInfo-idx): Handle FixedParameter == null
19819
19820         * cs-parser.jay: Handle the case where there is no catch
19821         statements (missing null test).
19822
19823 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
19824
19825         * driver.cs (MainDriver): Be conservative on our command line
19826         handling.
19827
19828         Catch DirectoryNotFoundException when calling GetFiles.
19829
19830         (SplitPathAndPattern): Used to split the input specification into
19831         a path and a pattern that we can feed to Directory.GetFiles.
19832
19833 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
19834
19835         * statement.cs (Fixed): Implement the last case of the Fixed
19836         statement (string handling).
19837
19838         * expression.cs (StringPtr): New class used to return a char * to
19839         a string;  Used by the Fixed statement.
19840
19841         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
19842
19843         * expression.cs (Binary.ResolveOperator): Remove redundant
19844         MemberLookup pn parent type.
19845         Optimize union call, we do not need a union if the types are the same.
19846         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
19847         type.
19848
19849         Specialize the use of MemberLookup everywhere, instead of using
19850         the default settings. 
19851
19852         (StackAlloc): Implement stackalloc keyword.
19853
19854         * cs-parser.jay: Add rule to parse stackalloc.
19855
19856         * driver.cs: Handle /h, /help, /?
19857
19858         * expression.cs (MakeByteBlob): Removed the hacks we had in place
19859         before we supported unsafe code.
19860
19861         * makefile: add --unsafe to the self compilation of mcs.
19862
19863 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
19864
19865         * expression.cs (PointerArithmetic): New class that is used to
19866         perform pointer arithmetic.
19867         (Binary.Resolve): Handle pointer arithmetic
19868         Handle pointer comparission.
19869         (ArrayPtr): Utility expression class that is used to take the
19870         address of an array.
19871
19872         (ElementAccess): Implement array access for pointers
19873
19874         * statement.cs (Fixed): Implement fixed statement for arrays, we
19875         are missing one more case before we are done.
19876
19877         * expression.cs (Indirection): Implement EmitAssign and set the
19878         ExprClass to Variable.  This allows pointer dereferences to be
19879         treated as variables, and to have values assigned to them.
19880
19881         * ecore.cs (Expression.StoreFromPtr): New utility function to
19882         store values dereferencing.
19883
19884 2002-02-20  Ravi Pratap  <ravi@ximian.com>
19885
19886         * expression.cs (Binary.ResolveOperator): Ensure that we are
19887         not trying to operate on a void type - this fixes the reported
19888         bug.
19889
19890         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
19891         the parent implementation is sealed.
19892
19893         * ../errors/cs0239.cs : Add.
19894
19895         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
19896
19897         * typemanager.cs (unverifiable_code_type): Corresponds to 
19898         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
19899         which have unsafe code in them.
19900
19901         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
19902         unsafe context.
19903
19904 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
19905
19906         * cs-tokenizer.cs: Add support for @"litreal strings"
19907
19908         Make tokenizer accept pre-processor directives
19909         on any column (remove the old C-like limitation). 
19910
19911         * rootcontext.cs (EmitCode): Emit any global attributes.
19912         (AddGlobalAttributes): Used to keep track of assembly attributes. 
19913
19914         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
19915
19916         * cs-parser.jay: Add support for global attributes.  
19917
19918 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
19919
19920         * expression.cs (Indirection): New helper class.  Unary will
19921         create Indirection classes to be able to implement the
19922         IMemoryLocation interface on it.
19923
19924 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
19925
19926         * cs-parser.jay (fixed_statement): reference the right statement.
19927
19928         * statement.cs (Fixed.Emit): Finish implementing the fixed
19929         statement for the &x case.
19930
19931 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
19932
19933         * class.cs (Property.Define, Method.Define): Remove newslot when
19934         `implementing'.  
19935
19936         * modifiers.cs: My use of NewSlot when `Abstract' was set was
19937         wrong.  NewSlot should only be used if the `new' keyword is present.
19938
19939         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
19940         locating our system dir.  Sorry about this.
19941
19942 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
19943
19944         * driver.cs (GetSystemDir): Compute correctly the location of our
19945         system assemblies.  I was using the compiler directory instead of
19946         the library directory.
19947
19948 2002-02-13  Ravi Pratap  <ravi@ximian.com>
19949
19950         * expression.cs (BetterFunction): Put back in what Miguel commented out
19951         since it is the correct fix. The problem is elsewhere ;-)
19952
19953         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
19954         parameters of the parms method are themselves compatible or not !
19955
19956         (StandardConversionExists): Fix very dangerous bug where we were forgetting
19957         to check that a class implements an interface before saying that an implicit
19958         conversion was allowed. Use ImplementsInterface to do the checking.
19959
19960 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
19961
19962         * class.cs (Method.Define): Track whether we are an explicit
19963         implementation or not.  And only call DefineMethodOverride if we
19964         are an explicit implementation.
19965
19966         (Property.DefineMethod): Ditto.
19967
19968 2002-02-11  Ravi Pratap  <ravi@ximian.com>
19969
19970         * expression.cs (BetterFunction): Catch hideous bug which was
19971          preventing us from detecting ambiguous calls due to implicit casts i.e
19972         cs0121.
19973
19974 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
19975
19976         * support.cs (Pair): Remove un-needed method.  I figured why I was
19977         getting the error in cs-parser.jay, the variable in a foreach loop
19978         is readonly, and the compiler does not really treat this as a variable.
19979
19980         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
19981         instead of EQUALS in grammar.  
19982
19983         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
19984
19985         * expression.cs (Unary.DoResolve): Check whether the argument is
19986         managed or not.
19987
19988 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
19989
19990         * support.cs: Api for Pair to set a value.  Despite the fact that
19991         the variables are public the MS C# compiler refuses to compile
19992         code that accesses the field if the variable is part of a foreach
19993         statement. 
19994
19995         * statement.cs (Fixed): Begin implementation of the fixed
19996         statement.
19997
19998         (Block.AddVariable): Return the VariableInfo on success and null
19999         on failure instead of true/false. 
20000
20001         * cs-parser.jay (foreach): Catch errors on variables already
20002         defined (we were ignoring this value before) and properly unwind
20003         the block hierarchy
20004
20005         (fixed_statement): grammar for the fixed statement.
20006
20007 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
20008
20009         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
20010         pointer types to be incretemented.
20011
20012         (SizeOf): Implement.
20013
20014         * cs-parser.jay (pointer_member_access): Implement
20015         expr->IDENTIFIER production.
20016
20017         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
20018         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
20019         on safe contexts.
20020
20021         (Unary): Implement indirection.
20022
20023         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
20024         use in non-unsafe context).
20025
20026         (SimpleName.DoResolve): Check for pointers in field access on safe
20027         contexts. 
20028
20029         (Expression.LoadFromPtr): Factor the load-indirect code in this
20030         function.  This was duplicated in UnboxCast and ParameterReference
20031
20032 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
20033
20034         * expression.cs (ComposedCast): report an error if a pointer cast
20035         is used in a safe region.
20036
20037         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
20038         pointer type casts in unsafe context.
20039
20040         * codegen.cs (EmitContext): Set up IsUnsafe.
20041
20042         * cs-parser.jay (non_expression_type): Add productions for pointer
20043         casts. 
20044
20045         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
20046         code.  We should not use force into static mode if the method is
20047         not virtual.  Fixes bug in MIS
20048
20049         * statement.cs (Do.Emit, While.Emit, For.Emit,
20050         Statement.EmitBoolExpression): Add support to Do and While to
20051         propagate infinite loop as `I do return' semantics.
20052
20053         Improve the For case to also test for boolean constants.
20054
20055         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
20056         to the list of attributes we can add.
20057
20058         Remove `EmitContext' argument.
20059
20060         * class.cs (Method.Define): Apply parameter attributes.
20061         (Constructor.Define): Apply parameter attributes.
20062         (MethodCore.LabelParameters): Move here the core of labeling
20063         parameters. 
20064
20065         * support.cs (ReflectionParameters.ParameterModifier,
20066         InternalParameters.ParameterModifier): Use IsByRef on the type and
20067         only return the OUT bit for these parameters instead of in/out/ref
20068         flags.
20069
20070         This is because I miss-understood things.  The ParameterInfo.IsIn
20071         and IsOut represent whether the parameter has the [In] and [Out]
20072         attributes set.  
20073
20074 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
20075
20076         * ecore.cs (FieldExpr.Emit): Release temporaries.
20077
20078         * assign.cs (LocalTemporary.Release): new function.
20079
20080         * codegen.cs (EmitContext.GetTemporaryStorage,
20081         EmitContext.FreeTemporaryStorage): Rework the way we deal with
20082         temporary storage.  Now we can "put back" localbuilders when we
20083         are done with them
20084
20085 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
20086
20087         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
20088         need to make a copy of the variable to generate verifiable code.
20089
20090 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
20091
20092         * driver.cs: Compute dynamically the system directory.
20093
20094         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
20095         Slower, but more generally useful.  Used by the abstract
20096         registering implementation. 
20097
20098         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
20099         the rules for the special rule on Type/instances.  First check if
20100         we have the same name, and if so, try that special static path
20101         rather than the instance path.
20102
20103 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
20104
20105         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
20106         for, while and if.
20107
20108         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
20109         Enum, ValueType, Delegate or Array for non-corlib compiles.
20110
20111         * cs-tokenizer.cs: Catch long identifiers (645)
20112
20113         * typemanager.cs (IndexerPropetyName): Ravi never tested this
20114         piece of code.
20115
20116         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
20117         fix, we were returning too early, so we were not registering
20118         pending methods from abstract classes.
20119
20120         Do not register pending methods if the class is abstract.
20121
20122         * expression.cs (Conditional.DoResolve): Report circular implicit
20123         conversions when we neecd to compute it for conditional
20124         expressions. 
20125
20126         (Is.DoResolve): If the expression is always of the provided type,
20127         flag warning 183.  If the expression can not ever be of the
20128         provided type flag warning 184.
20129
20130         * class.cs: Catch 169 as well.
20131
20132         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
20133         read. 
20134
20135 2002-01-18  Nick Drochak  <ndrochak@gol.com>
20136
20137         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
20138
20139 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
20140
20141         * interface.cs: (PopulateMethod): Check for pointers being defined
20142         only if the unsafe context is active.
20143         (PopulateProperty): ditto.
20144         (PopulateIndexer): ditto.
20145
20146         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
20147         specified.  If pointers are present, make sure that they are
20148         present in an unsafe context.
20149         (Constructor, Constructor.Define): ditto.
20150         (Field, Field.Define): ditto.
20151         (Property, Property.Define): ditto.
20152         (Event, Event.Define): ditto.
20153
20154         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
20155         hashtable if there are classes or structs defined.
20156
20157         * expression.cs (LocalVariableReference.DoResolve): Simplify this
20158         code, as the constant resolution moved.
20159
20160         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
20161         the metadata, so we can flag error 133. 
20162
20163         * decl.cs (MemberCore.UnsafeOK): New function to test that a
20164         pointer is being declared in an unsafe context.
20165
20166 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
20167
20168         * modifiers.cs (Modifiers.Check): Require a Location argument.
20169         Report error 227 for Unsafe use.
20170
20171         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
20172
20173         * statement.cs (For.Emit): If the test is null, then report that
20174         we do `return', as we wont reach anything afterwards.
20175
20176         (Switch.SwitchGoverningType): Track the expression that matched
20177         the conversion.
20178
20179         * driver.cs: Allow negative numbers as an error code to flag.
20180
20181         * cs-parser.jay: Handle 1551.
20182
20183         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
20184
20185 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20186
20187         * cs-parser.jay: Report 1518 (type declaration can only contain
20188         class, struct, interface, enum or delegate)
20189
20190         (switch_label): Report 1523 (keywords `case' or `default' must
20191         preced code)
20192
20193         (opt_switch_sections): Report 1522 (empty switch)
20194
20195         * driver.cs: Report 1515 (response file specified multiple times)
20196         Report 1516 (Source file specified multiple times).
20197
20198         * expression.cs (Argument.Resolve): Signal 1510
20199
20200         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
20201         access not allowed in static code)
20202
20203 2002-01-11  Ravi Pratap  <ravi@ximian.com>
20204
20205         * typemanager.cs (IsPointerType): Utility method which we are going
20206         to need a lot.
20207
20208         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
20209         the object type, so we take care of that.
20210
20211         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
20212
20213         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
20214         added to non-params parameters :-)
20215
20216         * typemanager.cs (CSharpName): Include 'void' type too. 
20217
20218         (void_ptr_type): Include in the set of core types.
20219
20220         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
20221         duplicating code.
20222
20223         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
20224         an unsafe context.
20225
20226         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
20227         completely forgotten about it.
20228
20229 2002-01-10  Ravi Pratap  <ravi@ximian.com>
20230
20231         * cs-parser.jay (pointer_type): Add. This begins our implementation
20232         of parsing rules for unsafe code.
20233
20234         (unsafe_statement): Implement.
20235
20236         (embedded_statement): Modify to include the above.
20237
20238         * statement.cs (Unsafe): Implement new class for unsafe blocks.
20239
20240         * codegen.cs (EmitContext.InUnsafe): Add. This determines
20241         if the current context is an unsafe one.
20242
20243         * cs-parser.jay (local_variable_pointer_type): Since local variable types
20244         are handled differently, we need separate rules for them.
20245
20246         (local_variable_declaration): Update to use local_variable_pointer_type
20247         to allow variable declarations of unmanaged pointer types.
20248
20249         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
20250         in unsafe contexts.
20251
20252         * ../errors/cs0214.cs : Add.
20253
20254 2002-01-16  Nick Drochak  <ndrochak@gol.com>
20255
20256         * makefile: remove 'response' file when cleaning.
20257
20258 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20259
20260         * cs-parser.jay: Report 1524.
20261
20262 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
20263
20264         * typemanager.cs (RegisterMethod): drop checking if we have
20265         registered this from here
20266
20267 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
20268
20269         * class.cs (Method.EmitDestructor): Implement calling our base
20270         destructor. 
20271
20272         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20273         value of InFinally.
20274
20275         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20276         this routine and will wrap the call in a try/catch block.  Deal
20277         with the case.
20278
20279 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
20280
20281         * ecore.cs (Expression.MemberLookup): instead of taking a
20282         parameter `same_type' that was used to tell whether we could
20283         access private members we compute our containing type from the
20284         EmitContext.
20285
20286         (FieldExpr): Added partial support for volatile fields.  This does
20287         not work for volatile fields exposed from assemblies, as I can not
20288         figure out how to extract the modreq from it.
20289
20290         Updated all the source files to use this.
20291
20292         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20293         because it is referenced by MemberLookup very often. 
20294
20295 2002-01-09  Ravi Pratap  <ravi@ximian.com>
20296
20297         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20298         TypeBuilder.GetCustomAttributes to retrieve what we need.
20299
20300         Get rid of redundant default_member_attr_type as this is the same as
20301         default_member_type which already exists.
20302
20303         * interface.cs, attribute.cs : Update accordingly.
20304
20305 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
20306
20307         * typemanager.cs: Enable IndexerPropertyName again.  It does not
20308         work for TYpeBuilders though.  Ravi, can you please fix this?
20309
20310         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20311
20312         * expression.cs (Argument.Emit): Handle the case of ref objects
20313         being passed to ref functions;  
20314
20315         (ParameterReference.EmitLoad): Loads the content of the pointer
20316         without dereferencing.
20317
20318 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20319
20320         * cs-tokenizer.cs: Implemented the pre-processing expressions.
20321
20322 2002-01-08  Ravi Pratap  <ravi@ximian.com>
20323
20324         * class.cs (Indexer.DefineMethod): Incorporate the interface
20325         type in the name of the method if we are doing explicit interface
20326         implementation.
20327
20328         * expression.cs (ConversionExists): Remove as it is completely obsolete.
20329
20330         (BetterConversion): Fix extremely trivial bug where we were referring to
20331         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
20332         again !
20333
20334         * ../errors/bug16.cs : Add although we have fixed it.
20335
20336 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20337
20338         * expression.cs (BaseIndexer): Begin implementation.
20339
20340         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
20341
20342         * cs-parser.jay (indexer_declarator): Use qualified_identifier
20343         production directly to remove a shift/reduce, and implement
20344         explicit interface implementation.
20345
20346         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
20347         after a floating point suffix.
20348
20349         * expression.cs (DoNumericPromotions): Improved the conversion for
20350         uint/uint.  If we have a constant, we avoid doing a typecast to a
20351         larger type.
20352
20353         * class.cs (Indexer): Implement explicit interface implementation
20354         for indexers.
20355
20356 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20357
20358         * class.cs: make the default instance constructor public and hidebysig.
20359
20360 2001-01-03  Ravi Pratap  <ravi@ximian.com>
20361
20362         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20363         so we can call it from elsewhere.
20364
20365         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20366         we emit it internally if the class has a defined indexer; otherwise the user
20367         emits it by decorating the class definition with the DefaultMemberAttribute.
20368
20369         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20370         attribute is not used on a type which defines an indexer.
20371
20372         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20373         character when we skip whitespace.
20374
20375         * ../errors/cs0646.cs : Add.
20376
20377 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
20378
20379         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20380         again. 
20381
20382         * makefile: Add practical target `mcs3.exe' which builds the third
20383         generation compiler. 
20384
20385         * expression.cs (New): Fix structures constructor calling.
20386
20387         * class.cs (Property, Method, Indexer): Emit Final flag on the
20388         method if we are an interface implementation and we are not
20389         abstract. 
20390
20391         * ecore.cs (PropertyExpr): New public field `IsBase', tells
20392         whether this property is referencing a `base' method.
20393
20394         * expression.cs (Invocation.EmitCall): take an extra argument:
20395         is_base, this is used to determine whether the `call' or
20396         `callvirt' opcode should be used.
20397
20398
20399         * delegate.cs: update EmitCall.
20400
20401         * class.cs (Method.Define): Set NewSlot for the cases where we are
20402         not implementing an interface method.
20403
20404         (Property.Define): ditto.
20405
20406 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
20407
20408         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20409         'r'.  Allows mcs to parse itself fully.
20410
20411 2002-01-02  Ravi Pratap  <ravi@ximian.com>
20412
20413         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20414         of the number of initializers that require the InitializeArray method.
20415
20416         (CheckIndices): Store the Expression in all cases - not the plain value. Also
20417         update the above field where necessary.
20418
20419         (MakeByteBlob): Update accordingly.
20420
20421         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
20422         greater than 2.
20423
20424         (EmitDynamicInitializers): Update in accordance with the new optimization.
20425
20426         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20427         same OpCode applies.
20428
20429         * cs-parser.jay : Fix some glaring errors I introduced.
20430
20431 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
20432
20433         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20434         so that we can check for name clashes there too.
20435
20436         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20437         for interface indexers.
20438
20439         * interfaces.cs (Define): Emit the default member attribute.
20440
20441         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20442         variable was being referred to while setting the value ;-)
20443
20444 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
20445
20446         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20447         byte-by-byte information when we know the data is zero.
20448
20449         Make the block always a multiple of 4, because
20450         DefineInitializedData has a bug.
20451
20452         * assign.cs: Fix, we should assign from the temporary, not from
20453         the source. 
20454
20455         * expression.cs (MakeByteBlob): Fix my incorrect code.
20456
20457 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
20458
20459         * typemanager.cs (EnumToUnderlying): This function is used to get
20460         the underlying type from an enumeration, because it does not
20461         always work. 
20462
20463         * constant.cs: Use the I4_S form for values between -128 and 127.
20464
20465         * statement.cs (Block.LookupLabel): Looks up a label.
20466         (Block): Drop support for labeled blocks.
20467
20468         (LabeledStatement): New kind of statement that represents a label
20469         only.
20470
20471         (Goto): Finally implement this bad boy.
20472
20473         * cs-parser.jay: Update to reflect new mechanism to implement
20474         labels.
20475
20476 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
20477
20478         * codegen.cs (EmitContext.This): a codegen property that keeps the
20479         a single instance of this instead of creating many different this
20480         instances. 
20481
20482         * delegate.cs (Delegate.DoResolve): Update to use the property;
20483
20484         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
20485
20486         * expression.cs (BaseAccess.DoResolve): Ditto.
20487
20488 2001-12-29  Ravi Pratap  <ravi@ximian.com>
20489
20490         * typemanager.cs (methodimpl_attr_type): Add to hold the type
20491         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20492
20493         (InitCoreTypes): Update accordingly.
20494
20495         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20496         so we can quickly store the state.
20497
20498         (ApplyAttributes): Set the correct implementation flags
20499         for InternalCall methods.
20500
20501 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
20502
20503         * expression.cs (EmitCall): if a method is not virtual, then do
20504         not use callvirt on it.
20505
20506         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20507         user defined stuff) requires the use of stobj, which takes an
20508         address on the stack instead of an array and an index.  So emit
20509         the Ldelema operation for it.
20510
20511         (EmitStoreOpcode): Use stobj for valuetypes.
20512
20513         (UnaryMutator.EmitCode): Use the right 1 value depending on
20514         whether we are dealing with int64/uint64, float or doubles.
20515
20516         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20517         constructors that I implemented last night.
20518
20519         (Constructor.IsDefault): Fix to work properly for static
20520         constructors.
20521
20522         * cs-parser.jay (CheckDef): report method signature errors.
20523         Update error number 103 to be 132.
20524
20525         * decl.cs: New AdditionResult enumeration value: MethodExists.
20526         Although we do this check for methods later on in the semantic
20527         analysis, catching repeated default constructors is so easy that
20528         we catch these here. 
20529
20530         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20531         promotions code.
20532
20533         (ParameterReference.EmitAssign, Emit): handle
20534         bools as bytes.
20535
20536         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20537         (ArrayAccess.EmitStoreOpcode): ditto.
20538
20539         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20540
20541         * expression.cs (MakeByteBlob): Complete all the missing types
20542         (uint, short, ushort, byte, sbyte)
20543
20544         * class.cs: Only init instance field initializers on instance
20545         constructors. 
20546
20547         Rename `constructors' to instance_constructors. 
20548
20549         (TypeContainer.AddConstructor): Only add constructors to the list
20550         if it is not static.
20551
20552         Make sure that we handle default_static_constructor independently
20553         everywhere where we handle instance_constructors
20554
20555 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
20556
20557         * class.cs: Do not lookup or create a base initializer for a
20558         static constructor.
20559
20560         (ConstructorInitializer.Resolve): use the proper type to lookup
20561         for constructors.
20562
20563         * cs-parser.jay: Report error 1585 (modifiers between type and name).
20564
20565         * enum.cs, interface.cs: Remove CloseType, this is taken care by
20566         in DeclSpace. 
20567
20568         * decl.cs: CloseType is now an virtual method, the default
20569         implementation just closes this type.
20570
20571 2001-12-28  Ravi Pratap  <ravi@ximian.com>
20572
20573         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
20574         to PreserveSig by default. Also emit HideBySig on such methods.
20575
20576         Basically, set the defaults to standard values.
20577
20578         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
20579         argument, if candidate is better, it can't be worse than the best !
20580
20581         (Invocation): Re-write bits to differentiate between methods being
20582         applicable in their expanded form and their normal form - for params
20583         methods of course.
20584
20585         Get rid of use_standard everywhere as only standard conversions are allowed
20586         in overload resolution. 
20587
20588         More spec conformance.
20589
20590 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20591
20592         * driver.cs: Add --timestamp, to see where the compiler spends
20593         most of its time.
20594
20595         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
20596         `this' in static code.
20597
20598         (SimpleName.DoResolve): Implement in terms of a helper function
20599         that allows static-references to be passed upstream to
20600         MemberAccess.
20601
20602         (Expression.ResolveWithSimpleName): Resolve specially simple
20603         names when called by MemberAccess to implement the special
20604         semantics. 
20605
20606         (Expression.ImplicitReferenceConversion): Handle conversions from
20607         Null to reference types before others, as Null's type is
20608         System.Object. 
20609
20610         * expression.cs (Invocation.EmitCall): Handle the special case of
20611         calling methods declared on a reference type from a ValueType
20612         (Base classes System.Object and System.Enum)
20613
20614         (MemberAccess.Resolve): Only perform lookups on Enumerations if
20615         the left hand side is a TypeExpr, not on every enumeration. 
20616
20617         (Binary.Resolve): If types are reference types, then do a cast to
20618         object on operators != and == of both arguments.
20619
20620         * typemanager.cs (FindMembers): Extract instance and static
20621         members if requested.
20622
20623         * interface.cs (PopulateProperty): Use void_type instead of null
20624         as the return type for the setter method.
20625
20626         (PopulateIndexer): ditto.
20627
20628 2001-12-27  Ravi Pratap  <ravi@ximian.com>
20629
20630         * support.cs (ReflectionParameters): Fix minor bug where we
20631         were examining the wrong parameter for the ParamArray attribute.
20632
20633         Cope with requests for the type of the parameter at position
20634         greater than the params parameter's. We now return the element
20635         type of the params array as that makes more sense.
20636
20637         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
20638         accordingly as we no longer have to extract the element type
20639         ourselves.
20640
20641         (Invocation.OverloadResolve): Update.
20642
20643 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20644
20645         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
20646         against IEnumerator, test whether the return value is a descendant
20647         of the IEnumerator interface.
20648
20649         * class.cs (Indexer.Define): Use an auxiliary method to implement
20650         the other bits of the method definition.  Begin support for
20651         explicit interface implementation.
20652
20653         (Property.DefineMethod): Use TypeManager.void_type instead of null
20654         for an empty return value.
20655
20656 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
20657
20658         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
20659         dealing with a FieldExpr which is composed of a FieldBuilder, in
20660         the code path we did extract the constant, but we should have
20661         obtained the underlying value to be able to cast it (otherwise we
20662         end up in an infinite loop, this is what Ravi was running into).
20663
20664         (ArrayCreation.UpdateIndices): Arrays might be empty.
20665
20666         (MemberAccess.ResolveMemberAccess): Add support for section
20667         14.5.4.1 that deals with the special case of E.I when E is a type
20668         and something else, that I can be a reference to a static member.
20669
20670         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
20671         handle a particular array type to create byte blobs, it is just
20672         something we dont generate byteblobs for.
20673
20674         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
20675         arguments. 
20676
20677         * location.cs (Push): remove the key from the hashtable that we
20678         are about to add.   This happens for empty files.
20679
20680         * driver.cs: Dispose files after we have parsed them.
20681
20682         (tokenize): new function that only runs the tokenizer on its
20683         input, for speed testing.
20684
20685 2001-12-26  Ravi Pratap  <ravi@ximian.com>
20686
20687         * class.cs (Event.Define): Define the private field only if there
20688         are no accessors defined.
20689
20690         * expression.cs (ResolveMemberAccess): If there is no associated
20691         field with the event, that means we have an event defined with its
20692         own accessors and we should flag error cs0070 since transforming
20693         ourselves into a field is not valid in that case.
20694
20695         * ecore.cs (SimpleName.DoResolve): Same as above.
20696
20697         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
20698         and charset to sane values.
20699
20700 2001-12-25  Ravi Pratap  <ravi@ximian.com>
20701
20702         * assign.cs (DoResolve): Perform check on events only if they 
20703         are being accessed outside the declaring type.
20704
20705         * cs-parser.jay (event_declarations): Update rules to correctly
20706         set the type of the implicit parameter etc.
20707
20708         (add_accessor, remove_accessor): Set current local parameters.
20709
20710         * expression.cs (Binary): For delegate addition and subtraction,
20711         cast the return value from the method into the appropriate delegate
20712         type.
20713
20714 2001-12-24  Ravi Pratap  <ravi@ximian.com>
20715
20716         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
20717         of these as the workaround is unnecessary.
20718
20719         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
20720         delegate data - none of that is needed at all.
20721
20722         Re-write bits to extract the instance expression and the delegate method
20723         correctly.
20724
20725         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
20726         on delegates too.
20727
20728         * attribute.cs (ApplyAttributes): New method to take care of common tasks
20729         of attaching attributes instead of duplicating code everywhere.
20730
20731         * everywhere : Update code to do attribute emission using the above method.
20732
20733 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
20734
20735         * expression.cs (IsParamsMethodApplicable): if there are not
20736         parameters, return immediately.
20737
20738         * ecore.cs: The 0 literal can be implicity converted to an enum
20739         type. 
20740
20741         (SimpleName.DoResolve): First lookup the type, then lookup the
20742         members. 
20743
20744         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
20745         want to get its address.  If the InstanceExpression is not
20746         addressable, store the result in a temporary variable, then get
20747         the address of it.
20748
20749         * codegen.cs: Only display 219 errors on warning level or above. 
20750
20751         * expression.cs (ArrayAccess): Make it implement the
20752         IMemoryLocation interface.
20753
20754         (Binary.DoResolve): handle the operator == (object a, object b)
20755         and operator != (object a, object b) without incurring into a
20756         BoxedCast (because 5 != o should never be performed).
20757
20758         Handle binary enumerator operators.
20759
20760         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
20761         value type, otherwise use Ldelem_ref.
20762
20763         Use precomputed names;
20764
20765         (AddressOf): Implement address of
20766
20767         * cs-parser.jay (labeled_statement): Fix recursive block
20768         addition by reworking the production.
20769
20770         * expression.cs (New.DoEmit): New has a special case:
20771                 
20772                  If we are dealing with a ValueType, we have a few
20773                  situations to deal with:
20774                 
20775                     * The target of New is a ValueType variable, that is
20776                       easy, we just pass this as the variable reference
20777                 
20778                     * The target of New is being passed as an argument,
20779                       to a boxing operation or a function that takes a
20780                       ValueType.
20781                 
20782                       In this case, we need to create a temporary variable
20783                       that is the argument of New.
20784
20785
20786 2001-12-23  Ravi Pratap  <ravi@ximian.com>
20787
20788         * rootcontext.cs (LookupType): Check that current_type is not null before
20789         going about looking at nested types.
20790
20791         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
20792         not implement the IAssignMethod interface any more.
20793
20794         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
20795         where we tranform them into FieldExprs if they are being resolved from within
20796         the declaring type.
20797
20798         * ecore.cs (SimpleName.DoResolve): Do the same here.
20799
20800         * assign.cs (DoResolve, Emit): Clean up code considerably. 
20801
20802         * ../errors/bug10.cs : Add.
20803
20804         * ../errors/cs0070.cs : Add.
20805
20806         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
20807
20808         * assign.cs : Get rid of EventIsLocal everywhere.
20809
20810 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
20811
20812         * ecore.cs (ConvertIntLiteral): finished the implementation.
20813
20814         * statement.cs (SwitchLabel): Convert the value we are using as a
20815         key before looking up the table.
20816
20817 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
20818
20819         * codegen.cs (EmitTopBlock): Require a Location argument now.
20820
20821         * cs-parser.jay (constructor_declarator): We need to setup
20822         current_local_parameters before we parse the
20823         opt_constructor_initializer, to allow the variables to be bound
20824         to the constructor arguments.
20825
20826         * rootcontext.cs (LookupType): First lookup nested classes in our
20827         class and our parents before we go looking outside our class.
20828
20829         * expression.cs (ConstantFold): Extract/debox the values at the
20830         beginnning. 
20831
20832         * rootcontext.cs (EmitCode): Resolve the constants first before we
20833         resolve the types.  This is not really needed, but it helps debugging.
20834
20835         * statement.cs: report location.
20836
20837         * cs-parser.jay: pass location to throw statement.
20838
20839         * driver.cs: Small bug fix.
20840
20841         * report.cs: Updated format to be 4-zero filled digits.
20842
20843 2001-12-22  Ravi Pratap  <ravi@ximian.com>
20844
20845         * expression.cs (CheckIndices): Fix minor bug where the wrong
20846         variable was being referred to ;-)
20847
20848         (DoEmit): Do not call EmitStaticInitializers when the 
20849         underlying type is System.Object.
20850
20851 2001-12-21  Ravi Pratap  <ravi@ximian.com>
20852
20853         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
20854         and do the usual workaround for SRE.
20855
20856         * class.cs (MyEventBuilder.EventType): New member to get at the type
20857         of the event, quickly.
20858
20859         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
20860
20861         * assign.cs (Assign.DoResolve): Handle the case when the target
20862         is an EventExpr and perform the necessary checks.
20863
20864         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
20865         interface.
20866
20867         (SimpleName.MemberStaticCheck): Include check for EventExpr.
20868
20869         (EventExpr): Set the type in the constructor itself since we 
20870         are meant to be born fully resolved.
20871
20872         (EventExpr.Define): Revert code I wrote earlier.
20873                 
20874         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
20875         instance expression is null. The instance expression is a This in that case
20876         or a null, depending on whether it is a static method or not.
20877
20878         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
20879         refers to more than one method.
20880
20881         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
20882         and accordingly flag errors.
20883
20884 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
20885
20886         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
20887
20888 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
20889
20890         * location.cs (ToString): Provide useful rutine.
20891
20892 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
20893
20894         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
20895         objects, return the actual integral boxed.
20896
20897         * statement.cs (SwitchLabel): define an ILLabel for each
20898         SwitchLabel. 
20899
20900         (Switch.CheckSwitch): If the value is a Literal, extract
20901         the underlying literal.
20902
20903         Also in the unused hashtable we had, add the SwitchLabel so we can
20904         quickly look this value up.
20905
20906         * constant.cs: Implement a bunch of new constants.  Rewrite
20907         Literal based on this.  Made changes everywhere to adapt to this.
20908
20909         * expression.cs (Expression.MakeByteBlob): Optimize routine by
20910         dereferencing array only once, and also copes with enumrations.
20911
20912         bytes are two bytes wide, not one.
20913
20914         (Cast): Perform constant conversions.
20915
20916         * ecore.cs (TryImplicitIntConversion): Return literals instead of
20917         wrappers to the literals here.
20918
20919         * expression.cs (DoNumericPromotions): long literals can converted
20920         to ulong implicity (this is taken care of elsewhere, but I was
20921         missing this spot).
20922
20923         * ecore.cs (Expression.Literalize): Make the return type Literal,
20924         to improve type checking.
20925
20926         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
20927
20928 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
20929
20930         * literal.cs: Revert code from ravi that checked the bounds.  The
20931         bounds are sane by the definition of the type itself. 
20932
20933         * typemanager.cs: Fix implementation of ImplementsInterface.  We
20934         need to actually look up in our parent hierarchy for interfaces
20935         implemented. 
20936
20937         * const.cs: Use the underlying type for enumerations
20938
20939         * delegate.cs: Compute the basename for the delegate creation,
20940         that should fix the delegate test case, and restore the correct
20941         Type Lookup semantics in rootcontext
20942
20943         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
20944         referencing a nested type with the Reflection API is using the "+"
20945         sign. 
20946
20947         * cs-parser.jay: Do not require EOF token at the end.
20948
20949 2001-12-20  Ravi Pratap  <ravi@ximian.com>
20950
20951         * rootcontext.cs (LookupType): Concatenate type names with
20952         a '.' instead of a '+' The test suite passes again.
20953
20954         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
20955         field of the enumeration.
20956
20957         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
20958         the case when the member is an EventExpr.
20959
20960         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
20961         static has an associated instance expression.
20962
20963         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
20964
20965         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
20966
20967         * class.cs (Event.Define): Register event and perform appropriate checks
20968         for error #111.
20969
20970         We define the Add and Remove methods even if the use provides none because
20971         in that case, we provide default implementations ourselves.
20972
20973         Define a private field of the type of the event. This is done by the CSC compiler
20974         and we should be doing it too ;-)
20975
20976         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
20977         More methods we use in code we generate.
20978
20979         (multicast_delegate_type, delegate_type): Two separate types since the distinction
20980         is important.
20981
20982         (InitCoreTypes): Update accordingly for the above.
20983
20984         * class.cs (Event.Emit): Generate code for default accessors that we provide
20985
20986         (EmitDefaultMethod): Do the job in the above.
20987
20988         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
20989         appropriate place.
20990
20991 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
20992
20993         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
20994         builders even if we were missing one.
20995
20996         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
20997         pass the Basename as our class name instead of the Name.  The
20998         basename will be correctly composed for us.
20999
21000         * parameter.cs (Paramters): Now takes a Location argument.
21001
21002         * decl.cs (DeclSpace.LookupType): Removed convenience function and
21003         make all the code call directly LookupType in RootContext and take
21004         this chance to pass the Location information everywhere.
21005
21006         * Everywhere: pass Location information.
21007
21008 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
21009
21010         * class.cs (Constructor.Define): Updated way of detecting the
21011         length of the parameters.
21012
21013         (TypeContainer.DefineType): Use basename as the type name for
21014         nested types.
21015
21016         (TypeContainer.Define): Do not recursively define types here, as
21017         definition is taken care in order by the RootContext.
21018
21019         * tree.cs: Keep track of namespaces in a per-file basis.
21020
21021         * parameter.cs (Parameter.ComputeSignature): Update to use
21022         DeclSpace. 
21023
21024         (Parameters.GetSignature): ditto.
21025
21026         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
21027         instead of a TypeContainer.
21028
21029         (Interface.SemanticAnalysis): Use `this' instead of our parent to
21030         resolve names.  Because we need to be resolve in our context, not
21031         our parents.
21032
21033         * driver.cs: Implement response files.
21034
21035         * class.cs (TypeContainer.DefineType): If we are defined, do not
21036         redefine ourselves.
21037
21038         (Event.Emit): Emit the code for add/remove handlers.
21039         (Event.Define): Save the MethodBuilders for add/remove.
21040
21041         * typemanager.cs: Use pair here too.
21042
21043         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
21044         DictionaryEntry requires the first argument to be non-null.  
21045
21046         (enum_declaration): Compute full name for registering the
21047         enumeration.
21048
21049         (delegate_declaration): Instead of using
21050         formal_parameter_list, use opt_formal_parameter_list as the list
21051         can be empty.
21052
21053         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
21054         (EventParsing): New property that controls whether `add' and
21055         `remove' are returned as tokens or identifiers (for events);
21056
21057 2001-12-19  Ravi Pratap  <ravi@ximian.com>
21058
21059         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
21060         use MyEventBuilder only and let it wrap the real builder for us.
21061
21062         (MyEventBuilder): Revamp constructor etc.
21063
21064         Implement all operations that we perform on EventBuilder in precisely the same
21065         way here too.
21066
21067         (FindMembers): Update to use the EventBuilder member.
21068
21069         (Event.Emit): Update accordingly.
21070
21071 2001-12-18  Ravi Pratap  <ravi@ximian.com>
21072
21073         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
21074         by calling the appropriate methods.
21075
21076         (GetCustomAttributes): Make stubs as they cannot possibly do anything
21077         useful.
21078
21079         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
21080
21081 2001-12-17  Ravi Pratap  <ravi@ximian.com>
21082
21083         * delegate.cs (Delegate.Populate): Check that the return type
21084         and various parameters types are indeed accessible.
21085
21086         * class.cs (Constructor.Define): Same here.
21087
21088         (Field.Define): Ditto.
21089
21090         (Event.Define): Ditto.
21091
21092         (Operator.Define): Check that the underlying Method defined itself
21093         correctly - so it's MethodBuilder should not be null.
21094
21095         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
21096         expression happens to be null.
21097
21098         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
21099         members but as of now we don't seem to be able to do anything really useful with it.
21100
21101         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
21102         not the EventBuilder.
21103
21104 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
21105
21106         * cs-tokenizer.cs: Add support for defines.
21107         Add support for #if, #elif, #else, #endif
21108
21109         (eval_var): evaluates a variable.
21110         (eval): stubbed for evaluating functions.
21111
21112         * cs-parser.jay: Pass the defines information
21113
21114         * driver.cs: Add --define command line option.
21115
21116         * decl.cs: Move MemberCore here.
21117
21118         Make it the base class for DeclSpace.  This allows us to catch and
21119         report 108 and 109 for everything now.
21120
21121         * class.cs (TypeContainer.Define): Extract all the members
21122         before populating and emit the warning 108 (new keyword required
21123         to override) instead of having each member implement this.
21124
21125         (MemberCore.Define): New abstract method, we will be using this in
21126         the warning reporting engine in Populate.
21127
21128         (Operator.Define): Adjust to new MemberCore protocol. 
21129
21130         * const.cs (Const): This does not derive from Expression, it is a
21131         temporary object we use to create fields, it is a MemberCore. 
21132
21133         * class.cs (Method.Define): Allow the entry point to be in a
21134         specific class.
21135
21136         * driver.cs: Rewrite the argument handler to clean it up a bit.
21137
21138         * rootcontext.cs: Made it just an auxiliary namespace feature by
21139         making everything static.
21140
21141         * driver.cs: Adapt code to use RootContext type name instead of
21142         instance variable.
21143
21144         * delegate.cs: Remove RootContext argument.
21145
21146         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
21147         argument. 
21148
21149         * class.cs (Event.Define): The lookup can fail.
21150
21151         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
21152
21153         * expression.cs: Resolve the this instance before invoking the code.
21154
21155 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
21156
21157         * cs-parser.jay: Add a production in element_access that allows
21158         the thing to become a "type" reference.  This way we can parse
21159         things like "(string [])" as a type.
21160
21161         Note that this still does not handle the more complex rules of
21162         casts. 
21163
21164
21165         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
21166
21167         * ecore.cs: (CopyNewMethods): new utility function used to
21168         assemble the list of methods from running FindMembers.
21169
21170         (MemberLookup): Rework FindMembers so that 
21171
21172 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
21173
21174         * class.cs (TypeContainer): Remove Delegates who fail to be
21175         defined.
21176
21177         * delegate.cs (Populate): Verify that we dont get null return
21178         values.   TODO: Check for AsAccessible.
21179
21180         * cs-parser.jay: Use basename to emit error 574 (destructor should
21181         have the same name as container class), not the full name.
21182
21183         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
21184         possible representation.  
21185
21186         Also implements integer type suffixes U and L.
21187
21188 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
21189
21190         * expression.cs (ArrayCreation.DoResolve): We need to do the
21191         argument resolution *always*.
21192
21193         * decl.cs: Make this hold the namespace.  Hold the root context as
21194         well.
21195         (LookupType): Move here.
21196
21197         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
21198
21199         * location.cs (Row, Name): Fixed the code, it was always returning
21200         references to the first file.
21201
21202         * interface.cs: Register properties defined through interfaces.
21203
21204         * driver.cs: Add support for globbing on the command line
21205
21206         * class.cs (Field): Make it derive from MemberCore as well.
21207         (Event): ditto.
21208
21209 2001-12-15  Ravi Pratap  <ravi@ximian.com>
21210
21211         * class.cs (Event::Define): Check that the type of the event is a delegate
21212         type else flag error #66.
21213
21214         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
21215         same.
21216
21217         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
21218         values of EntryPoint, CharSet etc etc.
21219
21220         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
21221
21222         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
21223         be null and we should ignore this. I am not sure if this is really clean. Apparently,
21224         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
21225         which needs this to do its work.
21226
21227         * ../errors/cs0066.cs : Add.
21228
21229 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
21230
21231         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
21232         helper functions.
21233
21234         * class.cs: (MethodSignature.MethodSignature): Removed hack that
21235         clears out the parameters field.
21236         (MemberSignatureCompare): Cleanup
21237
21238         (MemberCore): New base class used to share code between MethodCore
21239         and Property.
21240
21241         (RegisterRequiredImplementations) BindingFlags.Public requires
21242         either BindingFlags.Instace or Static.  Use instance here.
21243
21244         (Property): Refactored code to cope better with the full spec.
21245
21246         * parameter.cs (GetParameterInfo): Return an empty array instead
21247         of null on error.
21248
21249         * class.cs (Property): Abstract or extern properties have no bodies.
21250
21251         * parameter.cs (GetParameterInfo): return a zero-sized array.
21252
21253         * class.cs (TypeContainer.MethodModifiersValid): Move all the
21254         method modifier validation to the typecontainer so we can reuse
21255         this on properties.
21256
21257         (MethodCore.ParameterTypes): return an empty sized array of types.
21258
21259         (Property.Define): Test property modifier validity.
21260
21261         Add tests for sealed/override too.
21262
21263         (Method.Emit): abstract or extern methods have no bodies.
21264
21265 2001-12-14  Ravi Pratap  <ravi@ximian.com>
21266
21267         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21268         thing.
21269
21270         (Method::Define, ::Emit): Modify accordingly.
21271
21272         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21273
21274         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21275
21276         * makefile: Pass in /unsafe.
21277
21278 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
21279
21280         * class.cs (MakeKey): Kill routine.
21281
21282         * class.cs (TypeContainer.Define): Correctly define explicit
21283         method implementations (they require the full interface name plus
21284         the method name).
21285
21286         * typemanager.cs: Deply the PtrHashtable here and stop using the
21287         lame keys.  Things work so much better.
21288
21289         This of course broke everyone who depended on `RegisterMethod' to
21290         do the `test for existance' test.  This has to be done elsewhere.
21291
21292         * support.cs (PtrHashtable): A hashtable that avoid comparing with
21293         the object stupid Equals method (because, that like fails all over
21294         the place).  We still do not use it.
21295
21296         * class.cs (TypeContainer.SetRequiredInterface,
21297         TypeContainer.RequireMethods): Killed these two routines and moved
21298         all the functionality to RegisterRequiredImplementations.
21299
21300         (TypeContainer.RegisterRequiredImplementations): This routine now
21301         registers all the implementations required in an array for the
21302         interfaces and abstract methods.  We use an array of structures
21303         which can be computed ahead of time to reduce memory usage and we
21304         also assume that lookups are cheap as most classes will not
21305         implement too many interfaces.
21306
21307         We also avoid creating too many MethodSignatures.
21308
21309         (TypeContainer.IsInterfaceMethod): Update and optionally does not
21310         clear the "pending" bit if we find that there are problems with
21311         the declaration.
21312
21313         (TypeContainer.VerifyPendingMethods): Update to report errors of
21314         methods that look like implementations but are not.
21315
21316         (TypeContainer.Define): Add support for explicit interface method
21317         implementation. 
21318
21319 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
21320
21321         * typemanager.cs: Keep track of the parameters here instead of
21322         being a feature of the TypeContainer.
21323
21324         * class.cs: Drop the registration of parameters here, as
21325         InterfaceMethods are also interface declarations.
21326
21327         * delegate.cs: Register methods with the TypeManager not only with
21328         the TypeContainer.  This code was buggy.
21329
21330         * interface.cs: Full registation here.
21331
21332 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
21333
21334         * expression.cs: Remove reducer for binary expressions, it can not
21335         be done this way.
21336
21337         * const.cs: Put here the code that used to go into constant.cs
21338
21339         * constant.cs: Put here the code for constants, this is a new base
21340         class for Literals.
21341
21342         * literal.cs: Make Literal derive from Constant.
21343
21344 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
21345
21346         * statement.cs (Return.Emit): Report error 157 if the user
21347         attempts to return from a finally block.
21348
21349         (Return.Emit): Instead of emitting a return, jump to the end of
21350         the function.
21351
21352         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21353         LocalBuilder to store the result of the function.  ReturnLabel is
21354         the target where we jump.
21355
21356
21357 2001-12-09  Radek Doulik  <rodo@ximian.com>
21358
21359         * cs-parser.jay: remember alias in current namespace
21360
21361         * ecore.cs (SimpleName::DoResolve): use aliases for types or
21362         namespaces
21363
21364         * class.cs (LookupAlias): lookup alias in my_namespace
21365
21366         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21367         aliases hashtable
21368         (LookupAlias): lookup alias in this and if needed in parent
21369         namespaces
21370
21371 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
21372
21373         * support.cs: 
21374
21375         * rootcontext.cs: (ModuleBuilder) Made static, first step into
21376         making things static.  I need this to avoid passing the
21377         TypeContainer when calling ParameterType.
21378
21379         * support.cs (InternalParameters.ParameterType): Remove ugly hack
21380         that did string manipulation to compute the type and then call
21381         GetType.  Use Parameter.ParameterType instead.
21382
21383         * cs-tokenizer.cs: Consume the suffix for floating values.
21384
21385         * expression.cs (ParameterReference): figure out whether this is a
21386         reference parameter or not.  Kill an extra variable by computing
21387         the arg_idx during emission.
21388
21389         * parameter.cs (Parameters.GetParameterInfo): New overloaded
21390         function that returns whether a parameter is an out/ref value or not.
21391
21392         (Parameter.ParameterType): The type of the parameter (base,
21393         without ref/out applied).
21394
21395         (Parameter.Resolve): Perform resolution here.
21396         (Parameter.ExternalType): The full type (with ref/out applied).
21397
21398         * statement.cs (Using.Emit, Using.EmitExpression): Implement
21399         support for expressions on the using statement.
21400
21401 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
21402
21403         * statement.cs (Using.EmitLocalVariableDecls): Split the
21404         localvariable handling of the using statement.
21405
21406         (Block.EmitMeta): Keep track of variable count across blocks.  We
21407         were reusing slots on separate branches of blocks.
21408
21409         (Try.Emit): Emit the general code block, we were not emitting it. 
21410
21411         Check the type of the declaration to be an IDisposable or
21412         something that can be implicity converted to it. 
21413
21414         Emit conversions if required.
21415
21416         * ecore.cs (EmptyExpression): New utility class.
21417         (Expression.ImplicitConversionExists): New utility function.
21418
21419 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
21420
21421         * statement.cs (Using): Implement.
21422
21423         * expression.cs (LocalVariableReference): Support read only variables.
21424
21425         * statement.cs: Remove the explicit emit for the Leave opcode.
21426         (VariableInfo): Add a readonly field.
21427
21428 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
21429
21430         * ecore.cs (ConvCast): new class used to encapsulate the various
21431         explicit integer conversions that works in both checked and
21432         unchecked contexts.
21433
21434         (Expression.ConvertNumericExplicit): Use new ConvCast class to
21435         properly generate the overflow opcodes.
21436
21437 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21438
21439         * statement.cs: The correct type for the EmptyExpression is the
21440         element_type, not the variable type.  Ravi pointed this out.
21441
21442 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21443
21444         * class.cs (Method::Define): Handle PInvoke methods specially
21445         by using DefinePInvokeMethod instead of the usual one.
21446
21447         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21448         above to do the task of extracting information and defining the method.
21449
21450 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21451
21452         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21453         of the condition for string type.
21454
21455         (Emit): Move that here. 
21456
21457         (ArrayCreation::CheckIndices): Keep string literals in their expression
21458         form.
21459
21460         (EmitDynamicInitializers): Handle strings appropriately.
21461
21462 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21463
21464         * codegen.cs (EmitContext): Replace multiple variables with a
21465         single pointer to the current Switch statement.
21466
21467         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21468         EmitContext.
21469
21470 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21471
21472         * statement.cs 
21473
21474         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21475         default'.
21476
21477         (Foreach.Emit): Foreach on arrays was not setting
21478         up the loop variables (for break/continue).
21479
21480         (GotoCase): Semi-implented.
21481
21482 2001-12-03  Ravi Pratap  <ravi@ximian.com>
21483
21484         * attribute.cs (CheckAttribute): Handle system attributes by using
21485         Attribute.GetAttributes to examine information we need.
21486
21487         (GetValidPlaces): Same here.
21488
21489         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21490
21491         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21492
21493         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21494
21495         (Method::Define): Set appropriate flags if we have a DllImport attribute.
21496
21497         (Method::Emit): Handle the case when we are a PInvoke method.
21498
21499 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21500
21501         * expression.cs: Use ResolveWithSimpleName on compound names.
21502
21503 2001-12-02  Ravi Pratap  <ravi@ximian.com>
21504
21505         * constant.cs (EmitConstant): Make sure we resolve the associated expression
21506         before trying to reduce it.
21507
21508         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21509
21510         * constant.cs (LookupConstantValue): Implement.
21511
21512         (EmitConstant): Use the above in emitting the constant.
21513
21514         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21515         that are user-defined by doing a LookupConstantValue on them.
21516
21517         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21518         too, like above.
21519
21520 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
21521
21522         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21523
21524         (BaseAccess.DoResolve): Implement.
21525
21526         (MemberAccess.DoResolve): Split this routine into a
21527         ResolveMemberAccess routine that can be used independently
21528
21529 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
21530
21531         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21532         As that share bits of the implementation.  Is returns a boolean,
21533         while As returns the Type that is being probed.
21534
21535 2001-12-01  Ravi Pratap  <ravi@ximian.com>
21536
21537         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21538         instead of a Literal - much easier.
21539
21540         (EnumInTransit): Remove - utterly useless :-)
21541
21542         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21543
21544         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21545
21546         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21547         chain when we have no associated expression.
21548
21549 2001-11-30  Ravi Pratap  <ravi@ximian.com>
21550
21551         * constant.cs (Define): Use Location while reporting the errror.
21552
21553         Also emit a warning when 'new' is used and there is no inherited
21554         member to hide.
21555
21556         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
21557         populated.
21558
21559         (LookupEnumValue): Implement to lookup an enum member's value and define it
21560         if necessary.
21561
21562         (Populate): Re-write accordingly to use the above routine.
21563
21564 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
21565
21566         * expression.cs (This): Fix prototype for DoResolveLValue to
21567         override the base class DoResolveLValue.
21568
21569         * cs-parser.cs: Report errors cs574 and cs575 (destructor
21570         declarations) 
21571
21572         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
21573         (we need to load the address of the field here).  This fixes
21574         test-22. 
21575
21576         (FieldExpr.DoResolveLValue): Call the DoResolve
21577         function to initialize the Instance expression.
21578
21579         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
21580         correctly the GetEnumerator operation on a value type.
21581
21582         * cs-parser.jay: Add more simple parsing error catches.
21583
21584         * statement.cs (Switch): Add support for string switches.
21585         Handle null specially.
21586
21587         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
21588
21589 2001-11-28  Ravi Pratap  <ravi@ximian.com>
21590
21591         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
21592
21593         (declare_local_constant): New helper function.
21594
21595         * statement.cs (AddConstant): Keep a separate record of constants
21596
21597         (IsConstant): Implement to determine if a variable is a constant.
21598
21599         (GetConstantExpression): Implement.
21600
21601         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
21602
21603         * statement.cs (IsVariableDefined): Re-write.
21604
21605 2001-11-27  Ravi Pratap  <ravi@ximian.com>
21606
21607         * class.cs (TypeContainer::FindMembers): Look for constants
21608         in the case when we are looking for MemberTypes.Field
21609
21610         * expression.cs (MemberAccess::DoResolve): Check that in the
21611         case we are a FieldExpr and a Literal, we are not being accessed
21612         by an instance reference.
21613
21614         * cs-parser.jay (local_constant_declaration): Implement.
21615
21616         (declaration_statement): Implement for constant declarations.
21617
21618 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
21619
21620         * statement.cs (Switch): Catch double defaults.
21621
21622         (Switch): More work on the switch() statement
21623         implementation.  It works for integral values now, need to finish
21624         string support.
21625
21626
21627 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21628
21629         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
21630         integer literals into other integer literals.  To be used by
21631         switch. 
21632
21633 2001-11-24  Ravi Pratap  <ravi@ximian.com>
21634
21635         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
21636         some memory.
21637
21638         (EmitDynamicInitializers): Cope with the above since we extract data
21639         directly from ArrayData now.
21640
21641         (ExpectInitializers): Keep track of whether initializers are mandatory
21642         or not.
21643
21644         (Bounds): Make it a hashtable to prevent the same dimension being 
21645         recorded for every element in that dimension.
21646
21647         (EmitDynamicInitializers): Fix bug which prevented the Set array method
21648         from being found.
21649
21650         Also fix bug which was causing the indices to be emitted in the reverse
21651         order.
21652
21653 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21654
21655         * expression.cs (ArrayCreation): Implement the bits that Ravi left
21656         unfinished.  They do not work, because the underlying code is
21657         sloppy.
21658
21659 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21660
21661         * cs-parser.jay: Remove bogus fixme.
21662
21663         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
21664         on Switch statement.
21665
21666 2001-11-23  Ravi Pratap  <ravi@ximian.com>
21667
21668         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
21669         the same. 
21670
21671         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
21672         parameter. Apparently, any expression is allowed. 
21673
21674         (ValidateInitializers): Update accordingly.
21675
21676         (CheckIndices): Fix some tricky bugs thanks to recursion.
21677
21678         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
21679         I was being completely brain-dead.
21680
21681         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
21682         and re-write acordingly.
21683
21684         (DelegateInvocation): Re-write accordingly.
21685
21686         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
21687
21688         (MakeByteBlob): Handle types more correctly.
21689
21690         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
21691         initialization from expressions but it is incomplete because I am a complete
21692         Dodo :-|
21693
21694 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21695
21696         * statement.cs (If.Emit): Fix a bug that generated incorrect code
21697         on If.  Basically, we have to return `true' (ie, we do return to
21698         our caller) only if both branches of the if return.
21699
21700         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
21701         short-circuit operators, handle them as short circuit operators. 
21702
21703         (Cast.DoResolve): Resolve type.
21704         (Cast.Cast): Take an expression as the target type.
21705
21706         * cs-parser.jay (cast_expression): Remove old hack that only
21707         allowed a limited set of types to be handled.  Now we take a
21708         unary_expression and we resolve to a type during semantic
21709         analysis.
21710
21711         Use the grammar productions from Rhys to handle casts (this is
21712         not complete like Rhys syntax yet, we fail to handle that corner
21713         case that C# has regarding (-x), but we will get there.
21714
21715 2001-11-22  Ravi Pratap  <ravi@ximian.com>
21716
21717         * class.cs (EmitFieldInitializer): Take care of the case when we have a
21718         field which is an array type.
21719
21720         * cs-parser.jay (declare_local_variables): Support array initialization too.
21721
21722         * typemanager.cs (MakeKey): Implement.
21723
21724         (everywhere): Use the above appropriately.
21725
21726         * cs-parser.jay (for_statement): Update for array initialization while
21727         declaring variables.
21728
21729         * ecore.cs : The error message was correct, it's the variable's names that
21730         were misleading ;-) Make the code more readable.
21731
21732         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
21733         the correct type etc.
21734
21735         (ConvertExplicit): Handle Enum types by examining the underlying type.
21736
21737 2001-11-21  Ravi Pratap  <ravi@ximian.com>
21738
21739         * parameter.cs (GetCallingConvention): Always return
21740         CallingConventions.Standard for now.
21741
21742 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21743
21744         * expression.cs (Binary.ResolveOperator): Update the values of `l'
21745         and `r' after calling DoNumericPromotions.
21746
21747         * ecore.cs: Fix error message (the types were in the wrong order).
21748
21749         * statement.cs (Foreach.ProbeCollectionType): Need to pass
21750         BindingFlags.Instance as well 
21751
21752         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
21753         implicit int literal conversion in an empty cast so that we
21754         propagate the right type upstream.
21755
21756         (UnboxCast): new class used to unbox value types.
21757         (Expression.ConvertExplicit): Add explicit type conversions done
21758         by unboxing.
21759
21760         (Expression.ImplicitNumericConversion): Oops, forgot to test for
21761         the target type before applying the implicit LongLiterals to ULong
21762         literal cast.
21763
21764 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
21765
21766         * cs-parser.jay (for_statement): Reworked the way For works: now
21767         we declare manually any variables that are introduced in
21768         for_initializer to solve the problem of having out-of-band code
21769         emition (that is what got for broken).
21770
21771         (declaration_statement): Perform the actual variable declaration
21772         that used to be done in local_variable_declaration here.
21773
21774         (local_variable_declaration): Do not declare anything, just pass
21775         the information on a DictionaryEntry
21776
21777 2001-11-20  Ravi Pratap  <ravi@ximian.com>
21778
21779         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
21780         re-write of the logic to now make it recursive.
21781
21782         (UpdateIndices): Re-write accordingly.
21783
21784         Store element data in a separate ArrayData list in the above methods.
21785
21786         (MakeByteBlob): Implement to dump the array data into a byte array.
21787
21788 2001-11-19  Ravi Pratap  <ravi@ximian.com>
21789
21790         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
21791         into CheckIndices.
21792
21793         * constant.cs (Define): Implement.
21794
21795         (EmitConstant): Re-write fully.
21796
21797         Pass in location info.
21798
21799         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
21800         respectively.
21801
21802         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
21803         DictionaryEntry since we need location info too.
21804
21805         (constant_declaration): Update accordingly.
21806
21807         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
21808         code into another method : UpdateIndices.
21809
21810 2001-11-18  Ravi Pratap  <ravi@ximian.com>
21811
21812         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
21813         some type checking etc.
21814
21815 2001-11-17  Ravi Pratap  <ravi@ximian.com>
21816
21817         * expression.cs (ArrayCreation::ValidateInitializers): Implement
21818         bits to provide dimension info if the user skips doing that.
21819
21820         Update second constructor to store the rank correctly.
21821
21822 2001-11-16  Ravi Pratap  <ravi@ximian.com>
21823
21824         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
21825         and try to implement.
21826
21827         * ../errors/cs0150.cs : Add.
21828
21829         * ../errors/cs0178.cs : Add.
21830
21831 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
21832
21833         * statement.cs: Implement foreach on multi-dimensional arrays. 
21834
21835         * parameter.cs (Parameters.GetParameterByName): Also lookup the
21836         name of the params argument.
21837
21838         * expression.cs: Use EmitStoreOpcode to get the right opcode while
21839         initializing the array.
21840
21841         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
21842         we can use this elsewhere.
21843
21844         * statement.cs: Finish implementation of foreach for single
21845         dimension arrays.
21846
21847         * cs-parser.jay: Use an out-of-band stack to pass information
21848         around, I wonder why I need this.
21849
21850         foreach_block: Make the new foreach_block the current_block.
21851
21852         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
21853         function used to return a static Parameters structure.  Used for
21854         empty parameters, as those are created very frequently.
21855
21856         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
21857
21858 2001-11-15  Ravi Pratap  <ravi@ximian.com>
21859
21860         * interface.cs : Default modifier is private, not public. The
21861         make verify test passes again.
21862
21863 2001-11-15  Ravi Pratap  <ravi@ximian.com>
21864
21865         * support.cs (ReflectionParameters): Fix logic to determine
21866         whether the last parameter is a params one. Test 9 passes again.
21867
21868         * delegate.cs (Populate): Register the builders we define with
21869         RegisterParameterForBuilder. Test 19 passes again.
21870
21871         * cs-parser.jay (property_declaration): Reference $6 instead
21872         of $$ to get at the location.
21873
21874         (indexer_declaration): Similar stuff.
21875
21876         (attribute): Ditto.
21877
21878         * class.cs (Property): Register parameters for the Get and Set methods
21879         if they exist. Test 23 passes again.
21880
21881         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
21882         call to EmitArguments as we are sure there aren't any params arguments. 
21883         Test 32 passes again.
21884
21885         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
21886         IndexOutOfRangeException. 
21887
21888         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
21889         Test 33 now passes again.
21890
21891 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
21892
21893         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
21894         broke a bunch of things.  Will have to come up with a better way
21895         of tracking locations.
21896
21897         * statement.cs: Implemented foreach for single dimension arrays.
21898
21899 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
21900
21901         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
21902         an error.  This removes the lookup from the critical path.
21903
21904         * cs-parser.jay: Removed use of temporary_loc, which is completely
21905         broken. 
21906
21907 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
21908
21909         * support.cs (ReflectionParameters.ParameterModifier): Report
21910         whether the argument is a PARAMS argument or not.
21911
21912         * class.cs: Set the attribute `ParamArrayAttribute' on the
21913         parameter argument.
21914
21915         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
21916         and cons_param_array_attribute (ConstructorInfo for
21917         ParamArrayAttribute)., 
21918
21919         * codegen.cs: Emit the return using the `Return' statement, that
21920         way we can report the error correctly for missing return values. 
21921
21922         * class.cs (Method.Emit): Clean up.
21923
21924         * expression.cs (Argument.Resolve): Take another argument: the
21925         location where this argument is used.  Notice that this is not
21926         part of the "Argument" class as to reduce the size of the
21927         structure (we know the approximate location anyways).
21928
21929         Test if the argument is a variable-reference, if not, then
21930         complain with a 206.
21931
21932         (Argument.Emit): Emit addresses of variables.
21933
21934         (Argument.FullDesc): Simplify.
21935
21936         (Invocation.DoResolve): Update for Argument.Resolve.
21937
21938         (ElementAccess.DoResolve): ditto.
21939
21940         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
21941         method should be virtual, as this method is always virtual.
21942
21943         (NewDelegate.DoResolve): Update for Argument.Resolve.
21944
21945         * class.cs (ConstructorInitializer.DoResolve): ditto.
21946
21947         * attribute.cs (Attribute.Resolve): ditto.
21948
21949 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
21950
21951         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
21952
21953         * expression.cs (ParameterReference): Drop IStackStorage and implement
21954         IAssignMethod instead. 
21955
21956         (LocalVariableReference): ditto.
21957
21958         * ecore.cs (FieldExpr): Drop IStackStorage and implement
21959         IAssignMethod instead. 
21960
21961 2001-11-13  Miguel de Icaza <miguel@ximian.com>
21962
21963         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
21964         enumerations that are used in heavily used structures derive from
21965         byte in a laughable and pathetic attempt to reduce memory usage.
21966         This is the kind of pre-optimzations that you should not do at
21967         home without adult supervision.
21968
21969         * expression.cs (UnaryMutator): New class, used to handle ++ and
21970         -- separatedly from the other unary operators.  Cleans up the
21971         code, and kills the ExpressionStatement dependency in Unary.
21972
21973         (Unary): Removed `method' and `Arguments' from this class, making
21974         it smaller, and moving it all to SimpleCall, so I can reuse this
21975         code in other locations and avoid creating a lot of transient data
21976         strucutres when not required.
21977
21978         * cs-parser.jay: Adjust for new changes.
21979
21980 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
21981
21982         * enum.cs (Enum.Populate): If there is a failure during
21983         definition, return
21984
21985         * cs-parser.jay (opt_enum_base): we used to catch type errors
21986         here, but this is really incorrect.  The type error should be
21987         catched during semantic analysis.
21988
21989 2001-12-11  Ravi Pratap  <ravi@ximian.com>
21990
21991         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
21992         current_local_parameters as expected since I, in my stupidity, had forgotten
21993         to do this :-)
21994
21995         * attribute.cs (GetValidPlaces): Fix stupid bug.
21996
21997         * class.cs (Method::Emit): Perform check on applicability of attributes.
21998
21999         (Constructor::Emit): Ditto.
22000
22001         (Field::Emit): Ditto.
22002
22003         (Field.Location): Store location information.
22004
22005         (Property, Event, Indexer, Operator): Ditto.
22006
22007         * cs-parser.jay (field_declaration): Pass in location for each field.
22008
22009         * ../errors/cs0592.cs : Add.
22010
22011 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22012
22013         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
22014
22015         (InitCoreTypes): Update accordingly.
22016
22017         (RegisterAttrType, LookupAttr): Implement.
22018
22019         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
22020         info about the same.
22021
22022         (Resolve): Update to populate the above as necessary.
22023
22024         (Error592): Helper.
22025
22026         (GetValidPlaces): Helper to the above.
22027
22028         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
22029
22030         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
22031
22032 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22033
22034         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
22035
22036         * ../errors/cs0617.cs : Add.
22037
22038 2001-11-11  Ravi Pratap  <ravi@ximian.com>
22039
22040         * enum.cs (Emit): Rename to Populate to be more consistent with what
22041         we expect it to do and when exactly it is called.
22042
22043         * class.cs, rootcontext.cs : Update accordingly.
22044
22045         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
22046         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
22047
22048         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
22049
22050         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
22051         of a fieldinfo using the above, when dealing with a FieldBuilder.
22052
22053 2001-11-10  Ravi Pratap  <ravi@ximian.com>
22054
22055         * ../errors/cs0031.cs : Add.
22056
22057         * ../errors/cs1008.cs : Add.
22058
22059         * ../errrors/cs0543.cs : Add.
22060
22061         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
22062         enum type.
22063
22064         (FindMembers): Implement.
22065
22066         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
22067         enums and delegates too.
22068
22069         (enum_types): Rename to builder_to_enum.
22070
22071         (delegate_types): Rename to builder_to_delegate.
22072
22073         * delegate.cs (FindMembers): Implement.
22074
22075 2001-11-09  Ravi Pratap  <ravi@ximian.com>
22076
22077         * typemanager.cs (IsEnumType): Implement.
22078
22079         * enum.cs (Emit): Re-write parts to account for the underlying type
22080         better and perform checking etc.
22081
22082         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
22083         of the underlying type.
22084
22085         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
22086         value
22087
22088         * enum.cs (error31): Helper to report error #31.
22089
22090         * cs-parser.jay (enum_declaration): Store location of each member too.
22091
22092         * enum.cs (member_to_location): New hashtable. 
22093
22094         (AddEnumMember): Update location hashtable.
22095
22096         (Emit): Use the location of each member while reporting errors.
22097
22098 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22099
22100         * cs-parser.jay: A for_initializer if is a
22101         local_variable_declaration really ammount to have an implicit
22102         block with the variable declaration and no initializer for for.
22103
22104         * statement.cs (For.Emit): Cope with null initializers.
22105
22106         This fixes the infinite loop on for initializers.
22107
22108 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
22109
22110         * enum.cs: More cleanup.
22111
22112         * ecore.cs: Remove dead code.
22113
22114         * class.cs (Property.Emit): More simplification.
22115         (Event.Emit): ditto.
22116
22117         Reworked to have less levels of indentation.
22118
22119 2001-11-08  Ravi Pratap  <ravi@ximian.com>
22120
22121         * class.cs (Property): Emit attributes.
22122
22123         (Field): Ditto.
22124
22125         (Event): Ditto.
22126
22127         (Indexer): Ditto.
22128
22129         (Operator): Ditto.
22130
22131         * enum.cs (Emit): Ditto.
22132
22133         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
22134         Enums too.
22135
22136         * class.cs (Field, Event, etc.): Move attribute generation into the
22137         Emit method everywhere.
22138
22139         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
22140         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
22141         as we had no way of defining nested enums !
22142
22143         * rootcontext.cs : Adjust code accordingly.
22144
22145         * typemanager.cs (AddEnumType): To keep track of enum types separately.
22146
22147 2001-11-07  Ravi Pratap  <ravi@ximian.com>
22148
22149         * expression.cs (EvalConstantExpression): Move into ecore.cs
22150
22151         * enum.cs (Enum): Rename some members and make them public and readonly
22152         according to our convention.
22153
22154         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
22155         nothing else.
22156
22157         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
22158
22159         (Enum::Emit): Write a simple version for now which doesn't try to compute
22160         expressions. I shall modify this to be more robust in just a while.
22161
22162         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
22163
22164         (TypeContainer::CloseType): Create the Enum types too.
22165
22166         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
22167
22168         * expression.cs (EvalConstantExpression): Get rid of completely.
22169
22170         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
22171         user-defined values and other cases.
22172
22173         (IsValidEnumLiteral): Helper function.
22174
22175         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
22176         out there in the case we had a literal FieldExpr.
22177
22178         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
22179
22180         (Literalize): Revamp a bit to take two arguments.
22181
22182         (EnumLiteral): New class which derives from Literal to wrap enum literals.
22183
22184 2001-11-06  Ravi Pratap  <ravi@ximian.com>
22185
22186         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
22187
22188         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
22189
22190         (Resolve): Use the above to ensure we have proper initializers.
22191
22192 2001-11-05  Ravi Pratap  <ravi@ximian.com>
22193
22194         * expression.cs (Expression::EvalConstantExpression): New method to 
22195         evaluate constant expressions.
22196
22197         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
22198
22199 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
22200
22201         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
22202         in an array.
22203
22204         (Binary.ResolveOperator): Handle operator != (object a, object b)
22205         and operator == (object a, object b);
22206
22207         (Binary.DoNumericPromotions): Indicate whether the numeric
22208         promotion was possible.
22209
22210         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
22211         Implement.  
22212
22213         Made the ArrayAccess implement interface IAssignMethod instead of
22214         IStackStore as the order in which arguments are passed reflects
22215         this.
22216
22217         * assign.cs: Instead of using expr.ExprClass to select the way of
22218         assinging, probe for the IStackStore/IAssignMethod interfaces.
22219
22220         * typemanager.cs: Load InitializeArray definition.
22221
22222         * rootcontext.cs (RootContext.MakeStaticData): Used to define
22223         static data that can be used to initialize arrays. 
22224
22225 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
22226
22227         * expression.cs: Handle operator== and operator!= for booleans.
22228
22229         (Conditioal.Reduce): Implement reducer for the ?: operator.
22230
22231         (Conditional.Resolve): Implement dead code elimination.
22232
22233         (Binary.Resolve): Catch string literals and return a new
22234         concatenated string.
22235
22236         (Unary.Reduce): Implement reduction of unary expressions.
22237
22238         * ecore.cs: Split out the expression core handling here.
22239
22240         (Expression.Reduce): New method used to perform constant folding
22241         and CSE.  This is needed to support constant-expressions. 
22242
22243         * statement.cs (Statement.EmitBoolExpression): Pass true and false
22244         targets, and optimize for !x.
22245
22246 2001-11-04  Ravi Pratap  <ravi@ximian.com>
22247
22248         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
22249         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
22250         set custom atttributes.
22251
22252         * literal.cs (Literal::GetValue): New abstract method to return the actual
22253         value of the literal, cast as an object.
22254
22255         (*Literal): Implement GetValue method.
22256
22257         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22258         expressions to the arraylist but objects of type Argument.
22259
22260         * class.cs (TypeContainer::Emit): Emit our attributes too.
22261
22262         (Method::Emit, Constructor::Emit): Ditto.
22263
22264         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
22265         to be ignoring earlier.
22266
22267 2001-11-03  Ravi Pratap  <ravi@ximian.com>
22268
22269         * attribute.cs (AttributeSection::Define): Implement to do the business
22270         of constructing a CustomAttributeBuilder.
22271
22272         (Attribute): New trivial class. Increases readability of code.  
22273
22274         * cs-parser.jay : Update accordingly.
22275
22276         (positional_argument_list, named_argument_list, named_argument): New rules
22277
22278         (attribute_arguments): Use the above so that we are more correct.
22279
22280 2001-11-02  Ravi Pratap  <ravi@ximian.com>
22281
22282         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22283         to perform all checks for a method with a params parameter.
22284
22285         (Invocation::OverloadResolve): Update to use the above method and therefore
22286         cope correctly with params method invocations.
22287
22288         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
22289         params too.
22290
22291         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22292         constructors in our parent too because we can't afford to miss out on 
22293         protected ones ;-)
22294
22295         * attribute.cs (AttributeSection): New name for the class Attribute
22296
22297         Other trivial changes to improve readability.
22298
22299         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22300         use the new class names.
22301
22302 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22303
22304         * class.cs (Method::Define): Complete definition for params types too
22305
22306         (Indexer::Define): Ditto.
22307
22308         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22309         Cope everywhere with a request for info about the array parameter.
22310
22311 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22312
22313         * tree.cs (RecordNamespace): Fix up to check for the correct key.
22314
22315         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
22316         local_variable_type to extract the string corresponding to the type.
22317
22318         (local_variable_type): Fixup the action to use the new helper method.
22319
22320         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
22321         go.
22322
22323         * expression.cs : Clean out code which uses the above.
22324
22325 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22326
22327         * typemanager.cs (RegisterMethod): Check if we already have an existing key
22328         and bale out if necessary by returning a false.
22329
22330         (RegisterProperty): Ditto.
22331
22332         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
22333         and print out appropriate error messages.
22334
22335         * interface.cs (everywhere): Ditto.
22336
22337         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
22338         location to constructor.
22339
22340         * class.cs (Property, Event, Indexer): Update accordingly.
22341
22342         * ../errors/cs111.cs : Added.
22343
22344         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
22345         of a method, as laid down by the spec.
22346
22347         (Invocation::OverloadResolve): Use the above method.
22348
22349 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22350
22351         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22352         now take a TypeContainer and a Parameters object.
22353
22354         (ParameterData): Modify return type of ParameterModifier method to be 
22355         Parameter.Modifier and not a string.
22356
22357         (ReflectionParameters, InternalParameters): Update accordingly.
22358
22359         * expression.cs (Argument::GetParameterModifier): Same here.
22360
22361         * support.cs (InternalParameters::ParameterType): Find a better way of determining
22362         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22363         symbol in it at all so maybe this is only for now.
22364
22365 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22366
22367         * support.cs (InternalParameters): Constructor now takes an extra argument 
22368         which is the actual Parameters class.
22369
22370         (ParameterDesc): Update to provide info on ref/out modifiers.
22371
22372         * class.cs (everywhere): Update call to InternalParameters to pass in
22373         the second argument too.
22374
22375         * support.cs (ParameterData): Add ParameterModifier, which is a method 
22376         to return the modifier info [ref/out etc]
22377
22378         (InternalParameters, ReflectionParameters): Implement the above.
22379
22380         * expression.cs (Argument::ParameterModifier): Similar function to return
22381         info about the argument's modifiers.
22382
22383         (Invocation::OverloadResolve): Update to take into account matching modifiers 
22384         too.
22385
22386         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22387         a new SetFormalParameters object which we pass to InternalParameters.
22388
22389 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22390
22391         * expression.cs (NewArray): Merge into the ArrayCreation class.
22392
22393 2001-10-29  Ravi Pratap  <ravi@ximian.com>
22394
22395         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
22396         NewUserdefinedArray into one as there wasn't much of a use in having
22397         two separate ones.
22398
22399         * expression.cs (Argument): Change field's name to ArgType from Type.
22400
22401         (Type): New readonly property which returns the proper type, taking into 
22402         account ref/out modifiers.
22403
22404         (everywhere): Adjust code accordingly for the above.
22405
22406         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22407         whether we are emitting for a ref or out parameter.
22408
22409         * expression.cs (Argument::Emit): Use the above field to set the state.
22410
22411         (LocalVariableReference::Emit): Update to honour the flag and emit the
22412         right stuff.
22413
22414         * parameter.cs (Attributes): Set the correct flags for ref parameters.
22415
22416         * expression.cs (Argument::FullDesc): New function to provide a full desc.
22417
22418         * support.cs (ParameterData): Add method ParameterDesc to the interface.
22419
22420         (ReflectionParameters, InternalParameters): Implement the above method.
22421
22422         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22423         reporting errors.
22424
22425         (Invocation::FullMethodDesc): Ditto. 
22426
22427 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
22428
22429         * cs-parser.jay: Add extra production for the second form of array
22430         creation. 
22431
22432         * expression.cs (ArrayCreation): Update to reflect the above
22433         change. 
22434
22435         * Small changes to prepare for Array initialization.
22436
22437 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
22438
22439         * typemanager.cs (ImplementsInterface): interface might be null;
22440         Deal with this problem;
22441
22442         Also, we do store negative hits on the cache (null values), so use
22443         this instead of calling t.GetInterfaces on the type everytime.
22444
22445 2001-10-28  Ravi Pratap  <ravi@ximian.com>
22446
22447         * typemanager.cs (IsBuiltinType): New method to help determine the same.
22448
22449         * expression.cs (New::DoResolve): Get rid of array creation code and instead
22450         split functionality out into different classes.
22451
22452         (New::FormArrayType): Move into NewBuiltinArray.
22453
22454         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22455         quite useless.
22456
22457         (NewBuiltinArray): New class to handle creation of built-in arrays.
22458
22459         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22460         account creation of one-dimensional arrays.
22461
22462         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22463
22464         (NewUserdefinedArray::DoResolve): Implement.
22465
22466         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22467
22468         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22469         we maintain inside the TypeManager. This is necessary to perform lookups on the
22470         module builder.
22471
22472         (LookupType): Update to perform GetType on the module builders too.     
22473
22474         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22475
22476         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22477
22478 2001-10-23  Ravi Pratap  <ravi@ximian.com>
22479
22480         * expression.cs (New::DoResolve): Implement guts of array creation.
22481
22482         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22483
22484 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
22485
22486         * expression.cs: Fix bug I introduced lsat night that broke
22487         Delegates. 
22488
22489         (Expression.Resolve): Report a 246 error (can not resolve name)
22490         if we find a SimpleName in the stream.
22491
22492         (Expression.ResolveLValue): Ditto.
22493
22494         (Expression.ResolveWithSimpleName): This function is a variant of
22495         ResolveName, this one allows SimpleNames to be returned without a
22496         warning.  The only consumer of SimpleNames is MemberAccess
22497
22498 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
22499
22500         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22501         might arrive here.  I have my doubts that this is correct.
22502
22503         * statement.cs (Lock): Implement lock statement.
22504
22505         * cs-parser.jay: Small fixes to support `lock' and `using'
22506
22507         * cs-tokenizer.cs: Remove extra space
22508
22509         * driver.cs: New flag --checked, allows to turn on integer math
22510         checking. 
22511
22512         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22513         Threading.Monitor.Exit 
22514
22515 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
22516
22517         * expression.cs (IndexerAccess::DoResolveLValue): Set the
22518         Expression Class to be IndexerAccess.
22519
22520         Notice that Indexer::DoResolve sets the eclass to Value.
22521
22522 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
22523
22524         * class.cs (TypeContainer::Emit): Emit code for indexers.
22525
22526         * assign.cs (IAssignMethod): New interface implemented by Indexers
22527         and Properties for handling assignment.
22528
22529         (Assign::Emit): Simplify and reuse code. 
22530
22531         * expression.cs (IndexerAccess, PropertyExpr): Implement
22532         IAssignMethod, clean up old code. 
22533
22534 2001-10-22  Ravi Pratap  <ravi@ximian.com>
22535
22536         * typemanager.cs (ImplementsInterface): New method to determine if a type
22537         implements a given interface. Provides a nice cache too.
22538
22539         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22540         method.
22541
22542         (ConvertReferenceExplicit): Ditto.
22543
22544         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
22545         various methods, with correct names etc.
22546
22547         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
22548         Operator.UnaryNegation.
22549
22550         * cs-parser.jay (operator_declarator): Be a little clever in the case where
22551         we have a unary plus or minus operator.
22552
22553         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
22554         UnaryMinus.
22555
22556         * everywhere : update accordingly.
22557
22558         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22559         respectively.
22560
22561         * class.cs (Method::Define): For the case where we are implementing a method
22562         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
22563         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22564
22565 2001-10-21  Ravi Pratap  <ravi@ximian.com>
22566
22567         * interface.cs (FindMembers): Implement to work around S.R.E
22568         lameness.
22569
22570         * typemanager.cs (IsInterfaceType): Implement.
22571
22572         (FindMembers): Update to handle interface types too.
22573
22574         * expression.cs (ImplicitReferenceConversion): Re-write bits which
22575         use IsAssignableFrom as that is not correct - it doesn't work.
22576
22577         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
22578         and accordingly override EmitStatement.
22579
22580         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
22581         using the correct logic :-)
22582
22583 2001-10-19  Ravi Pratap  <ravi@ximian.com>
22584
22585         * ../errors/cs-11.cs : Add to demonstrate error -11 
22586
22587 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
22588
22589         * assign.cs (Assign::Resolve): Resolve right hand side first, and
22590         then pass this as a hint to ResolveLValue.
22591
22592         * expression.cs (FieldExpr): Add Location information
22593
22594         (FieldExpr::LValueResolve): Report assignment to readonly
22595         variable. 
22596
22597         (Expression::ExprClassFromMemberInfo): Pass location information.
22598
22599         (Expression::ResolveLValue): Add new method that resolves an
22600         LValue. 
22601
22602         (Expression::DoResolveLValue): Default invocation calls
22603         DoResolve. 
22604
22605         (Indexers): New class used to keep track of indexers in a given
22606         Type. 
22607
22608         (IStackStore): Renamed from LValue, as it did not really describe
22609         what this did.  Also ResolveLValue is gone from this interface and
22610         now is part of Expression.
22611
22612         (ElementAccess): Depending on the element access type
22613
22614         * typemanager.cs: Add `indexer_name_type' as a Core type
22615         (System.Runtime.CompilerServices.IndexerNameAttribute)
22616
22617         * statement.cs (Goto): Take a location.
22618
22619 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22620
22621         * delegate.cs (Delegate::VerifyDelegate): New method to verify
22622         if two delegates are compatible.
22623
22624         (NewDelegate::DoResolve): Update to take care of the case when
22625         we instantiate a delegate from another delegate.
22626
22627         * typemanager.cs (FindMembers): Don't even try to look up members
22628         of Delegate types for now.
22629
22630 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22631
22632         * delegate.cs (NewDelegate): New class to take care of delegate
22633         instantiation.
22634
22635         * expression.cs (New): Split the delegate related code out into 
22636         the NewDelegate class.
22637
22638         * delegate.cs (DelegateInvocation): New class to handle delegate 
22639         invocation.
22640
22641         * expression.cs (Invocation): Split out delegate related code into
22642         the DelegateInvocation class.
22643
22644 2001-10-17  Ravi Pratap  <ravi@ximian.com>
22645
22646         * expression.cs (New::DoResolve): Implement delegate creation fully
22647         and according to the spec.
22648
22649         (New::DoEmit): Update to handle delegates differently.
22650
22651         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
22652         because of which we were printing out arguments in reverse order !
22653
22654         * delegate.cs (VerifyMethod): Implement to check if the given method
22655         matches the delegate.
22656
22657         (FullDelegateDesc): Implement.
22658
22659         (VerifyApplicability): Implement.
22660
22661         * expression.cs (Invocation::DoResolve): Update to accordingly handle
22662         delegate invocations too.
22663
22664         (Invocation::Emit): Ditto.
22665
22666         * ../errors/cs1593.cs : Added.
22667
22668         * ../errors/cs1594.cs : Added.
22669
22670         * delegate.cs (InstanceExpression, TargetMethod): New properties.
22671
22672 2001-10-16  Ravi Pratap  <ravi@ximian.com>
22673
22674         * typemanager.cs (intptr_type): Core type for System.IntPtr
22675
22676         (InitCoreTypes): Update for the same.
22677
22678         (iasyncresult_type, asynccallback_type): Ditto.
22679
22680         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
22681         correct.
22682
22683         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
22684         too.
22685
22686         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
22687         the builders for the 4 members of a delegate type :-)
22688
22689         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
22690         type.
22691
22692         * expression.cs (New::DoResolve): Implement guts for delegate creation.
22693
22694         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
22695
22696 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
22697
22698         * statement.cs (Break::Emit): Implement.   
22699         (Continue::Emit): Implement.
22700
22701         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22702         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22703         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22704         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
22705         end loop
22706
22707         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
22708         properties that track the label for the current loop (begin of the
22709         loop and end of the loop).
22710
22711 2001-10-15  Ravi Pratap  <ravi@ximian.com>
22712
22713         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
22714         use of emitting anything at all.
22715
22716         * class.cs, rootcontext.cs : Get rid of calls to the same.
22717
22718         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
22719
22720         (Populate): Define the constructor correctly and set the implementation
22721         attributes.
22722
22723         * typemanager.cs (delegate_types): New hashtable to hold delegates that
22724         have been defined.
22725
22726         (AddDelegateType): Implement.
22727
22728         (IsDelegateType): Implement helper method.
22729
22730         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
22731
22732         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
22733         and accordingly handle it.
22734
22735         * delegate.cs (Populate): Take TypeContainer argument.
22736         Implement bits to define the Invoke method. However, I still haven't figured out
22737         how to take care of the native int bit :-(
22738
22739         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
22740         Qualify the name of the delegate, not its return type !
22741
22742         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
22743         conversion.
22744
22745         (StandardConversionExists): Checking for array types turns out to be recursive.
22746
22747         (ConvertReferenceExplicit): Implement array conversion.
22748
22749         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
22750
22751 2001-10-12  Ravi Pratap  <ravi@ximian.com>
22752
22753         * cs-parser.jay (delegate_declaration): Store the fully qualified
22754         name as it is a type declaration.
22755
22756         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
22757         readonly.
22758
22759         (DefineDelegate): Renamed from Define. Does the same thing essentially,
22760         as TypeContainer::DefineType.
22761
22762         (Populate): Method in which all the definition of the various methods (Invoke)
22763         etc is done.
22764
22765         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
22766         see.
22767
22768         (CloseDelegate): Finally creates the delegate.
22769
22770         * class.cs (TypeContainer::DefineType): Update to define delegates.
22771         (Populate, Emit and CloseType): Do the same thing here too.
22772
22773         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
22774         delegates in all these operations.
22775
22776 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
22777
22778         * expression.cs: LocalTemporary: a new expression used to
22779         reference a temporary that has been created.
22780
22781         * assign.cs: Handle PropertyAccess back here, so that we can
22782         provide the proper semantic access to properties.
22783
22784         * expression.cs (Expression::ConvertReferenceExplicit): Implement
22785         a few more explicit conversions. 
22786
22787         * modifiers.cs: `NEW' modifier maps to HideBySig.
22788
22789         * expression.cs (PropertyExpr): Make this into an
22790         ExpressionStatement, and support the EmitStatement code path. 
22791
22792         Perform get/set error checking, clean up the interface.
22793
22794         * assign.cs: recognize PropertyExprs as targets, and if so, turn
22795         them into toplevel access objects.
22796
22797 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
22798
22799         * expression.cs: PropertyExpr::PropertyExpr: use work around the
22800         SRE.
22801
22802         * typemanager.cs: Keep track here of our PropertyBuilders again to
22803         work around lameness in SRE.
22804
22805 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
22806
22807         * expression.cs (LValue::LValueResolve): New method in the
22808         interface, used to perform a second resolution pass for LValues. 
22809
22810         (This::DoResolve): Catch the use of this in static methods.
22811
22812         (This::LValueResolve): Implement.
22813
22814         (This::Store): Remove warning, assigning to `this' in structures
22815         is 
22816
22817         (Invocation::Emit): Deal with invocation of
22818         methods on value types.  We need to pass the address to structure
22819         methods rather than the object itself.  (The equivalent code to
22820         emit "this" for structures leaves the entire structure on the
22821         stack instead of a pointer to it). 
22822
22823         (ParameterReference::DoResolve): Compute the real index for the
22824         argument based on whether the method takes or not a `this' pointer
22825         (ie, the method is static).
22826
22827         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
22828         value types returned from functions when we need to invoke a
22829         method on the sturcture.
22830
22831
22832 2001-10-11  Ravi Pratap  <ravi@ximian.com>
22833
22834         * class.cs (TypeContainer::DefineType): Method to actually do the business of
22835         defining the type in the Modulebuilder or Typebuilder. This is to take
22836         care of nested types which need to be defined on the TypeBuilder using
22837         DefineNestedMethod.
22838
22839         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
22840         methods in RootContext, only ported to be part of TypeContainer.
22841
22842         (TypeContainer::GetInterfaceOrClass): Ditto.
22843
22844         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
22845
22846         * interface.cs (Interface::DefineInterface): New method. Does exactly
22847         what RootContext.CreateInterface did earlier, only it takes care of nested types 
22848         too.
22849
22850         (Interface::GetInterfaces): Move from RootContext here and port.
22851
22852         (Interface::GetInterfaceByName): Same here.
22853
22854         * rootcontext.cs (ResolveTree): Re-write.
22855
22856         (PopulateTypes): Re-write.
22857
22858         * class.cs (TypeContainer::Populate): Populate nested types too.
22859         (TypeContainer::Emit): Emit nested members too.
22860
22861         * typemanager.cs (AddUserType): Do not make use of the FullName property,
22862         instead just use the name argument passed in as it is already fully
22863         qualified.
22864
22865         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
22866         to TypeContainer mapping to see if a type is user-defined.
22867
22868         * class.cs (TypeContainer::CloseType): Implement. 
22869
22870         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
22871         the default constructor.
22872
22873         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
22874         twice.
22875
22876         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
22877
22878         * interface.cs (CloseType): Create the type here.
22879
22880         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
22881         the hierarchy.
22882
22883         Remove all the methods which are now in TypeContainer.
22884
22885 2001-10-10  Ravi Pratap  <ravi@ximian.com>
22886
22887         * delegate.cs (Define): Re-write bits to define the delegate
22888         correctly.
22889
22890 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
22891
22892         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
22893
22894         * expression.cs (ImplicitReferenceConversion): handle null as well
22895         as a source to convert to any reference type.
22896
22897         * statement.cs (Return): Perform any implicit conversions to
22898         expected return type.  
22899
22900         Validate use of return statement.  
22901
22902         * codegen.cs (EmitContext): Pass the expected return type here.
22903
22904         * class.cs (Method, Constructor, Property): Pass expected return
22905         type to EmitContext.
22906
22907 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
22908
22909         * expression.cs: Make DoResolve take an EmitContext instead of a
22910         TypeContainer.
22911
22912         Replaced `l' and `location' for `loc', for consistency.
22913
22914         (Error, Warning): Remove unneeded Tc argument.
22915
22916         * assign.cs, literal.cs, constant.cs: Update to new calling
22917         convention. 
22918
22919         * codegen.cs: EmitContext now contains a flag indicating whether
22920         code is being generated in a static method or not.
22921
22922         * cs-parser.jay: DecomposeQI, new function that replaces the old
22923         QualifiedIdentifier.  Now we always decompose the assembled
22924         strings from qualified_identifier productions into a group of
22925         memberaccesses.
22926
22927 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
22928
22929         * rootcontext.cs: Deal with field-less struct types correctly now
22930         by passing the size option to Define Type.
22931
22932         * class.cs: Removed hack that created one static field. 
22933
22934 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
22935
22936         * statement.cs: Moved most of the code generation here. 
22937
22938 2001-10-09  Ravi Pratap  <ravi@ximian.com>
22939
22940         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
22941         seem very right.
22942
22943         (ElementAccess): Remove useless bits for now - keep checks as the spec
22944         says.
22945
22946 2001-10-08  Ravi Pratap  <ravi@ximian.com>
22947
22948         * expression.cs (ElementAccess::DoResolve): Remove my crap code
22949         and start performing checks according to the spec.
22950
22951 2001-10-07  Ravi Pratap  <ravi@ximian.com>
22952
22953         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
22954         rank_specifiers instead.
22955
22956         (rank_specifiers): Change the order in which the rank specifiers are stored
22957
22958         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
22959
22960         * expression.cs (ElementAccess): Implement the LValue interface too.
22961
22962 2001-10-06  Ravi Pratap  <ravi@ximian.com>
22963
22964         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
22965         except that user defined conversions are not included.
22966
22967         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
22968         perform the conversion of the return type, if necessary.
22969
22970         (New::DoResolve): Check whether we are creating an array or an object
22971         and accordingly do the needful.
22972
22973         (New::Emit): Same here.
22974
22975         (New::DoResolve): Implement guts of array creation.
22976
22977         (New::FormLookupType): Helper function.
22978
22979 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
22980
22981         * codegen.cs: Removed most of the code generation here, and move the
22982         corresponding code generation bits to the statement classes. 
22983
22984         Added support for try/catch/finalize and throw.
22985
22986         * cs-parser.jay: Added support for try/catch/finalize.
22987
22988         * class.cs: Catch static methods having the flags override,
22989         virtual or abstract.
22990
22991         * expression.cs (UserCast): This user cast was not really doing
22992         what it was supposed to do.  Which is to be born in fully resolved
22993         state.  Parts of the resolution were being performed at Emit time! 
22994
22995         Fixed this code.
22996
22997 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
22998
22999         * expression.cs: Implicity convert the result from UserCast.
23000
23001 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23002
23003         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
23004         prevented it from working correctly. 
23005
23006         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
23007         merely ConvertImplicit.
23008
23009 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23010
23011         * typemanager.cs: Make the LookupTypeContainer function static,
23012         and not per-instance.  
23013
23014         * class.cs: Make static FindMembers (the one that takes a Type
23015         argument). 
23016
23017         * codegen.cs: Add EmitForeach here.
23018
23019         * cs-parser.jay: Make foreach a toplevel object instead of the
23020         inline expansion, as we need to perform semantic analysis on it. 
23021
23022 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23023
23024         * expression.cs (Expression::ImplicitUserConversion): Rename to
23025         UserDefinedConversion.
23026
23027         (Expression::UserDefinedConversion): Take an extra argument specifying 
23028         whether we look for explicit user conversions too.
23029
23030         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
23031
23032         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
23033
23034         (ExplicitUserConversion): Make it a call to UserDefinedConversion
23035         with the appropriate arguments.
23036
23037         * cs-parser.jay (cast_expression): Record location too.
23038
23039         * expression.cs (Cast): Record location info.
23040
23041         (Expression::ConvertExplicit): Take location argument.
23042
23043         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
23044         to determine if we are doing explicit conversions.
23045
23046         (UserCast::Emit): Update accordingly.
23047
23048         (Expression::ConvertExplicit): Report an error if everything fails.
23049
23050         * ../errors/cs0030.cs : Add.
23051
23052 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
23053
23054         * modifiers.cs: If the ABSTRACT keyword is present, also set the
23055         virtual and newslot bits. 
23056
23057         * class.cs (TypeContainer::RegisterRequiredImplementations):
23058         Record methods we need.
23059
23060         (TypeContainer::MakeKey): Helper function to make keys for
23061         MethodBases, since the Methodbase key is useless.
23062
23063         (TypeContainer::Populate): Call RegisterRequiredImplementations
23064         before defining the methods.   
23065
23066         Create a mapping for method_builders_to_methods ahead of time
23067         instead of inside a tight loop.
23068
23069         (::RequireMethods):  Accept an object as the data to set into the
23070         hashtable so we can report interface vs abstract method mismatch.
23071
23072 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23073
23074         * report.cs: Make all of it static.
23075
23076         * rootcontext.cs: Drop object_type and value_type computations, as
23077         we have those in the TypeManager anyways.
23078
23079         Drop report instance variable too, now it is a global.
23080
23081         * driver.cs: Use try/catch on command line handling.
23082
23083         Add --probe option to debug the error reporting system with a test
23084         suite. 
23085
23086         * report.cs: Add support for exiting program when a probe
23087         condition is reached.
23088
23089 2001-10-03  Ravi Pratap  <ravi@ximian.com>
23090
23091         * expression.cs (Binary::DoNumericPromotions): Fix the case when
23092         we do a forcible conversion regardless of type, to check if 
23093         ForceConversion returns a null.
23094
23095         (Binary::error19): Use location to report error.
23096
23097         (Unary::error23): Use location here too.
23098
23099         * ../errors/cs0019.cs : Check in.
23100
23101         * ../errors/cs0023.cs : Check in.
23102
23103         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
23104         case of a non-null MethodInfo object with a length of 0 !
23105
23106         (Binary::ResolveOperator): Flag error if overload resolution fails to find
23107         an applicable member - according to the spec :-)
23108         Also fix logic to find members in base types.
23109
23110         (Unary::ResolveOperator): Same here.
23111
23112         (Unary::report23): Change name to error23 and make first argument a TypeContainer
23113         as I was getting thoroughly confused between this and error19 :-)
23114
23115         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
23116         (::FindMostEncompassedType): Implement.
23117         (::FindMostEncompassingType): Implement.
23118         (::StandardConversionExists): Implement.
23119
23120         (UserImplicitCast): Re-vamp. We now need info about most specific
23121         source and target types so that we can do the necessary conversions.
23122
23123         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
23124         mathematical union with no duplicates.
23125
23126 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23127
23128         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
23129         in order from base classes to child classes, so that we can in
23130         child classes look up in our parent for method names and
23131         attributes (required for handling abstract, virtual, new, override
23132         constructs: we need to instrospect our base class, and if we dont
23133         populate the classes in order, the introspection might be
23134         incorrect.  For example, a method could query its parent before
23135         the parent has any methods and would determine that the parent has
23136         no abstract methods (while it could have had them)).
23137
23138         (RootContext::CreateType): Record the order in which we define the
23139         classes.
23140
23141 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
23142
23143         * class.cs (TypeContainer::Populate): Also method definitions can
23144         fail now, keep track of this.
23145
23146         (TypeContainer::FindMembers): Implement support for
23147         DeclaredOnly/noDeclaredOnly flag.
23148
23149         (Constructor::Emit) Return the ConstructorBuilder.
23150
23151         (Method::Emit) Return the MethodBuilder. 
23152         Check for abstract or virtual methods to be public.
23153
23154         * rootcontext.cs (RootContext::CreateType): Register all the
23155         abstract methods required for the class to be complete and the
23156         interface methods that must be implemented. 
23157
23158         * cs-parser.jay: Report error 501 (method requires body if it is
23159         not marked abstract or extern).
23160
23161         * expression.cs (TypeOf::Emit): Implement.
23162
23163         * typemanager.cs: runtime_handle_type, new global type.
23164
23165         * class.cs (Property::Emit): Generate code for properties.
23166
23167 2001-10-02  Ravi Pratap  <ravi@ximian.com>
23168
23169         * expression.cs (Unary::ResolveOperator): Find operators on base type
23170         too - we now conform exactly to the spec.
23171
23172         (Binary::ResolveOperator): Same here.
23173
23174         * class.cs (Operator::Define): Fix minor quirk in the tests.
23175
23176         * ../errors/cs0215.cs : Added.
23177
23178         * ../errors/cs0556.cs : Added.
23179
23180         * ../errors/cs0555.cs : Added.
23181
23182 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23183
23184         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
23185         single integer which is really efficient
23186
23187 2001-10-01  Ravi Pratap  <ravi@ximian.com>
23188
23189         *  expression.cs (Expression::ImplicitUserConversion): Use location
23190         even in the case when we are examining True operators.
23191  
23192         * class.cs (Operator::Define): Perform extensive checks to conform
23193         with the rules for operator overloading in the spec.
23194
23195         * expression.cs (Expression::ImplicitReferenceConversion): Implement
23196         some of the other conversions mentioned in the spec.
23197
23198         * typemanager.cs (array_type): New static member for the System.Array built-in
23199         type.
23200
23201         (cloneable_interface): For System.ICloneable interface.
23202
23203         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
23204         we start resolving the tree and populating types.
23205
23206         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
23207  
23208 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23209
23210         * expression.cs (Expression::ExprClassFromMemberInfo,
23211         Expression::Literalize): Create literal expressions from
23212         FieldInfos which are literals.
23213
23214         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
23215         type casts, because they were wrong.  The test suite in tests
23216         caught these ones.
23217
23218         (ImplicitNumericConversion): ushort to ulong requires a widening
23219         cast. 
23220
23221         Int32 constant to long requires widening cast as well.
23222
23223         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
23224         for integers because the type on the stack is not i4.
23225
23226 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
23227
23228         * expression.cs (report118): require location argument. 
23229
23230         * parameter.cs: Do not dereference potential null value.
23231
23232         * class.cs: Catch methods that lack the `new' keyword when
23233         overriding a name.  Report warnings when `new' is used without
23234         anything being there to override.
23235
23236         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
23237
23238         * class.cs: Only add constructor to hashtable if it is non-null
23239         (as now constructors can fail on define).
23240
23241         (TypeManager, Class, Struct): Take location arguments.
23242
23243         Catch field instance initialization in structs as errors.
23244
23245         accepting_filter: a new filter for FindMembers that is static so
23246         that we dont create an instance per invocation.
23247
23248         (Constructor::Define): Catch errors where a struct constructor is
23249         parameterless 
23250
23251         * cs-parser.jay: Pass location information for various new
23252         constructs. 
23253
23254         * delegate.cs (Delegate): take a location argument.
23255
23256         * driver.cs: Do not call EmitCode if there were problesm in the
23257         Definition of the types, as many Builders wont be there. 
23258
23259         * decl.cs (Decl::Decl): Require a location argument.
23260
23261         * cs-tokenizer.cs: Handle properly hex constants that can not fit
23262         into integers, and find the most appropiate integer for it.
23263
23264         * literal.cs: Implement ULongLiteral.
23265
23266         * rootcontext.cs: Provide better information about the location of
23267         failure when CreateType fails.
23268
23269 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
23270
23271         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23272         as well.
23273
23274         * expression.cs (Binary::CheckShiftArguments): Add missing type
23275         computation.
23276         (Binary::ResolveOperator): Add type to the logical and and logical
23277         or, Bitwise And/Or and Exclusive Or code paths, it was missing
23278         before.
23279
23280         (Binary::DoNumericPromotions): In the case where either argument
23281         is ulong (and most signed types combined with ulong cause an
23282         error) perform implicit integer constant conversions as well.
23283
23284 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23285
23286         * expression.cs (UserImplicitCast): Method should always be
23287         non-null. 
23288         (Invocation::BetterConversion): Simplified test for IntLiteral.
23289
23290         (Expression::ImplicitNumericConversion): Split this routine out.
23291         Put the code that performs implicit constant integer conversions
23292         here. 
23293
23294         (Expression::Resolve): Become a wrapper around DoResolve so we can
23295         check eclass and type being set after resolve.
23296
23297         (Invocation::Badness): Remove this dead function
23298
23299         (Binary::ResolveOperator): Do not compute the expensive argumnets
23300         unless we have a union for it.
23301
23302         (Probe::Emit): Is needs to do an isinst and then
23303         compare against null.
23304
23305         (::CanConvert): Added Location argument.  If the Location argument
23306         is null (Location.Null), then we do not report errors.  This is
23307         used by the `probe' mechanism of the Explicit conversion.  We do
23308         not want to generate an error for something that the user
23309         explicitly requested to be casted.  But the pipeline for an
23310         explicit cast first tests for potential implicit casts.
23311
23312         So for now, if the Location is null, it means `Probe only' to
23313         avoid adding another argument.   Might have to revise this
23314         strategy later.
23315
23316         (ClassCast): New class used to type cast objects into arbitrary
23317         classes (used in Explicit Reference Conversions).
23318
23319         Implement `as' as well.
23320
23321         Reverted all the patches from Ravi below: they were broken:
23322
23323                 * The use of `level' as a mechanism to stop recursive
23324                   invocations is wrong.  That was there just to catch the
23325                   bug with a strack trace but not as a way of addressing
23326                   the problem.
23327
23328                   To fix the problem we have to *understand* what is going
23329                   on and the interactions and come up with a plan, not
23330                   just get things going.
23331
23332                 * The use of the type conversion cache that I proposed
23333                   last night had an open topic: How does this work across
23334                   protection domains.  A user defined conversion might not
23335                   be public in the location where we are applying the
23336                   conversion, a different conversion might be selected
23337                   (ie, private A->B (better) but public B->A (worse),
23338                   inside A, A->B applies, but outside it, B->A will
23339                   apply).
23340
23341                 * On top of that (ie, even if the above is solved),
23342                   conversions in a cache need to be abstract.  Ie, `To
23343                   convert from an Int to a Short use an OpcodeCast', not
23344                   `To convert from an Int to a Short use the OpcodeCast on
23345                   the variable 5' (which is what this patch was doing).
23346
23347 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23348
23349         * expression.cs (Invocation::ConversionExists): Re-write to use
23350         the conversion cache
23351
23352         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23353         cache all conversions done, not just user-defined ones.
23354
23355         (Invocation::BetterConversion): The real culprit. Use ConversionExists
23356         to determine if a conversion exists instead of acutually trying to 
23357         perform the conversion. It's faster too.
23358
23359         (Expression::ConvertExplicit): Modify to use ConversionExists to check
23360         and only then attempt the implicit conversion.
23361
23362 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23363
23364         * expression.cs (ConvertImplicit): Use a cache for conversions
23365         already found. Check level of recursion and bail out if necessary.
23366
23367 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23368
23369         * typemanager.cs (string_concat_string_string, string_concat_object_object):
23370         Export standard methods that we expect for string operations.
23371
23372         * statement.cs (Block::UsageWarning): Track usage of variables and
23373         report the errors for not used variables.
23374
23375         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23376         operator. 
23377
23378 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23379
23380         * codegen.cs: remove unnneded code 
23381
23382         * expression.cs: Removed BuiltinTypeAccess class
23383
23384         Fix the order in which implicit conversions are
23385         done.  
23386
23387         The previous fixed dropped support for boxed conversions (adding a
23388         test to the test suite now)
23389
23390         (UserImplicitCast::CanConvert): Remove test for source being null,
23391         that code is broken.  We should not feed a null to begin with, if
23392         we do, then we should track the bug where the problem originates
23393         and not try to cover it up here.
23394
23395         Return a resolved expression of type UserImplicitCast on success
23396         rather than true/false.  Ravi: this is what I was talking about,
23397         the pattern is to use a static method as a "constructor" for
23398         objects. 
23399
23400         Also, do not create arguments until the very last minute,
23401         otherwise we always create the arguments even for lookups that
23402         will never be performed. 
23403
23404         (UserImplicitCast::Resolve): Eliminate, objects of type
23405         UserImplicitCast are born in a fully resolved state. 
23406
23407         * typemanager.cs (InitCoreTypes): Init also value_type
23408         (System.ValueType). 
23409
23410         * expression.cs (Cast::Resolve): First resolve the child expression.
23411
23412         (LValue): Add new method AddressOf to be used by
23413         the `&' operator.  
23414
23415         Change the argument of Store to take an EmitContext instead of an
23416         ILGenerator, because things like FieldExpr need to be able to call
23417         their children expression to generate the instance code. 
23418
23419         (Expression::Error, Expression::Warning): Sugar functions for
23420         reporting errors.
23421
23422         (Expression::MemberLookup): Accept a TypeContainer instead of a
23423         Report as the first argument.
23424
23425         (Expression::ResolvePrimary): Killed.  I still want to improve
23426         this as currently the code is just not right.
23427
23428         (Expression::ResolveMemberAccess): Simplify, but it is still
23429         wrong. 
23430
23431         (Unary::Resolve): Catch errors in AddressOf operators.
23432
23433         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23434         index to a byte for the short-version, or the compiler will choose
23435         the wrong Emit call, which generates the wrong data.
23436
23437         (ParameterReference::Emit, ::Store): same.
23438
23439         (FieldExpr::AddressOf): Implement.
23440
23441         * typemanager.cs: TypeManager: made public variable instead of
23442         property.
23443
23444         * driver.cs: document --fatal.
23445
23446         * report.cs (ErrorMessage, WarningMessage): new names for the old
23447         Error and Warning classes.
23448
23449         * cs-parser.jay (member_access): Turn built-in access to types
23450         into a normal simplename
23451
23452 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23453
23454         * expression.cs (Invocation::BetterConversion): Fix to cope
23455         with q being null, since this was introducing a bug.
23456
23457         * expression.cs (ConvertImplicit): Do built-in conversions first.
23458
23459 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23460
23461         * expression.cs (UserImplicitCast::Resolve): Fix bug.
23462
23463 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23464
23465         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23466         I had introduced long ago (what's new ?).
23467
23468         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
23469         the work of all the checking. 
23470         (ConvertImplicit): Call CanConvert and only then create object if necessary.
23471         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23472
23473         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23474         that is the right way. 
23475
23476         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
23477         overloading resolution. Use everywhere instead of cutting and pasting code.
23478
23479         (Binary::ResolveOperator): Use MakeUnionSet.
23480
23481         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
23482         we have to convert to bool types. Not complete yet.
23483
23484 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23485
23486         * typemanager.cs (TypeManager::CSharpName): support ushort.
23487
23488         * expression.cs (Expression::TryImplicitIntConversion): Attempts
23489         to provide an expression that performsn an implicit constant int
23490         conversion (section 6.1.6).
23491         (Expression::ConvertImplicitRequired): Reworked to include
23492         implicit constant expression conversions.
23493
23494         (Expression::ConvertNumericExplicit): Finished.
23495
23496         (Invocation::Emit): If InstanceExpression is null, then it means
23497         that we perform a call on this.
23498
23499 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23500
23501         * expression.cs (Unary::Emit): Remove some dead code.
23502         (Probe): Implement Resolve and Emit for `is'.
23503         (Expression::ConvertImplicitRequired): Attempt to do constant
23504         expression conversions here.  Maybe should be moved to
23505         ConvertImplicit, but I am not sure.
23506         (Expression::ImplicitLongConstantConversionPossible,
23507         Expression::ImplicitIntConstantConversionPossible): New functions
23508         that tell whether is it possible to apply an implicit constant
23509         expression conversion.
23510
23511         (ConvertNumericExplicit): Started work on explicit numeric
23512         conversions.
23513
23514         * cs-parser.jay: Update operator constants.
23515
23516         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23517         (Parameters::GetSignature): Hook up VerifyArgs here.
23518         (Parameters::VerifyArgs): Verifies that no two arguments have the
23519         same name. 
23520
23521         * class.cs (Operator): Update the operator names to reflect the
23522         ones that the spec expects (as we are just stringizing the
23523         operator names).
23524
23525         * expression.cs (Unary::ResolveOperator): Fix bug: Use
23526         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23527         previous usage did only work for our methods.
23528         (Expression::ConvertImplicit): Handle decimal implicit numeric
23529         conversions as well.
23530         (Expression::InternalTypeConstructor): Used to invoke constructors
23531         on internal types for default promotions.
23532
23533         (Unary::Emit): Implement special handling for the pre/post
23534         increment/decrement for overloaded operators, as they need to have
23535         the same semantics as the other operators.
23536
23537         (Binary::ResolveOperator): ditto.
23538         (Invocation::ConversionExists): ditto.
23539         (UserImplicitCast::Resolve): ditto.
23540
23541 2001-09-26  Ravi Pratap  <ravi@ximian.com>
23542
23543         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23544         operator, return after emitting body. Regression tests pass again !
23545
23546         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23547         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23548         (Invocation::OverloadResolve): Ditto.
23549         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23550
23551         * everywhere : update calls to the above methods accordingly.
23552
23553 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23554
23555         * assign.cs (Assign): Make it inherit from ExpressionStatement.
23556
23557         * expression.cs (ExpressionStatement): New base class used for
23558         expressions that can appear in statements, so that we can provide
23559         an alternate path to generate expression that do not leave a value
23560         on the stack.
23561
23562         (Expression::Emit, and all the derivatives): We no longer return
23563         whether a value is left on the stack or not.  Every expression
23564         after being emitted leaves a single value on the stack.
23565
23566         * codegen.cs (EmitContext::EmitStatementExpression): Use the
23567         facilties of ExpressionStatement if possible.
23568
23569         * cs-parser.jay: Update statement_expression.
23570
23571 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
23572
23573         * driver.cs: Change the wording of message
23574
23575 2001-09-25  Ravi Pratap  <ravi@ximian.com>
23576
23577         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
23578         the type of the expression to the return type of the method if
23579         we have an overloaded operator match ! The regression tests pass again !
23580         (Unary::ResolveOperator): Ditto.
23581
23582         * expression.cs (Invocation::ConversionExists): Correct the member lookup
23583         to find "op_Implicit", not "implicit" ;-)
23584         (UserImplicitCast): New class to take care of user-defined implicit conversions.
23585         (ConvertImplicit, ForceConversion): Take TypeContainer argument
23586
23587         * everywhere : Correct calls to the above accordingly.
23588
23589         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
23590         (ConvertImplicit): Do user-defined conversion if it exists.
23591
23592 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
23593
23594         * assign.cs: track location.
23595         (Resolve): Use implicit conversions on assignment.
23596
23597         * literal.cs: Oops.  Not good, Emit of short access values should
23598         pass (Bytes) or the wrong argument will be selected.
23599
23600         * expression.cs (Unary::Emit): Emit code for -expr.
23601
23602         (Unary::ResolveOperator): Handle `Substract' for non-constants
23603         (substract from zero from the non-constants).
23604         Deal with Doubles as well. 
23605
23606         (Expression::ConvertImplicitRequired): New routine that reports an
23607         error if no implicit conversion exists. 
23608
23609         (Invocation::OverloadResolve): Store the converted implicit
23610         expressions if we make them
23611
23612 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23613
23614         * class.cs (ConstructorInitializer): Take a Location argument.
23615         (ConstructorBaseInitializer): Same here.
23616         (ConstructorThisInitializer): Same here.
23617
23618         * cs-parser.jay : Update all calls accordingly.
23619
23620         * expression.cs (Unary, Binary, New): Take location argument.
23621         Update accordingly everywhere.
23622
23623         * cs-parser.jay : Update all calls to the above to take a location
23624         argument.
23625
23626         * class.cs : Ditto.
23627
23628 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23629
23630         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
23631         (Invocation::BetterConversion): Same here
23632         (Invocation::ConversionExists): Ditto.
23633
23634         (Invocation::ConversionExists): Implement.
23635
23636 2001-09-22  Ravi Pratap  <ravi@ximian.com>
23637
23638         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
23639         Also take an additional TypeContainer argument.
23640
23641         * All over : Pass in TypeContainer as argument to OverloadResolve.
23642
23643         * typemanager.cs (CSharpName): Update to check for the string type and return
23644         that too.
23645
23646         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
23647         a given method.
23648
23649 2001-09-21  Ravi Pratap  <ravi@ximian.com>
23650
23651         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
23652         (Invocation::BetterFunction): Implement.
23653         (Invocation::BetterConversion): Implement.
23654         (Invocation::ConversionExists): Skeleton, no implementation yet.
23655
23656         Okay, things work fine !
23657
23658 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
23659
23660         * typemanager.cs: declare and load enum_type, delegate_type and
23661         void_type. 
23662
23663         * expression.cs (Expression::Emit): Now emit returns a value that
23664         tells whether a value is left on the stack or not.  This strategy
23665         might be reveted tomorrow with a mechanism that would address
23666         multiple assignments.
23667         (Expression::report118): Utility routine to report mismatches on
23668         the ExprClass.
23669
23670         (Unary::Report23): Report impossible type/operator combination
23671         utility function.
23672
23673         (Unary::IsIncrementableNumber): Whether the type can be
23674         incremented or decremented with add.
23675         (Unary::ResolveOperator): Also allow enumerations to be bitwise
23676         complemented. 
23677         (Unary::ResolveOperator): Implement ++, !, ~,
23678
23679         (Invocation::Emit): Deal with new Emit convetion.
23680
23681         * All Expression derivatives: Updated their Emit method to return
23682         whether they leave values on the stack or not.
23683
23684         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
23685         stack for expressions that are statements. 
23686
23687 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
23688
23689         * expression.cs (LValue): New interface.  Must be implemented by
23690         LValue objects.
23691         (LocalVariableReference, ParameterReference, FieldExpr): Implement
23692         LValue interface.
23693
23694         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
23695         interface for generating code, simplifies the code.
23696
23697 2001-09-20  Ravi Pratap  <ravi@ximian.com>
23698
23699         * expression.cs (everywhere): Comment out return statements in ::Resolve
23700         methods to avoid the warnings.
23701
23702 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
23703
23704         * driver.cs (parse): Report error 2001 if we can not open the
23705         source file.
23706
23707         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
23708         not resolve it.
23709
23710         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
23711         object. 
23712
23713         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
23714         otherwise nested blocks end up with the same index.
23715
23716         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
23717
23718         * expression.cs:  Instead of having FIXMEs in the Resolve
23719         functions, throw exceptions so it is obvious that we are facing a
23720         bug. 
23721
23722         * cs-parser.jay (invocation_expression): Pass Location information.
23723
23724         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
23725         Use a basename for those routines because .NET does not like paths
23726         on them. 
23727
23728         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
23729         already defined.
23730
23731 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
23732
23733         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
23734         are loading the correct data types (throws an exception if not).
23735         (TypeManager::InitCoreTypes): Use CoreLookupType
23736
23737         * expression.cs (Unary::ResolveOperator): return the child
23738         expression for expressions which are just +expr.
23739         (Unary::ResolveOperator): Return negative literals for -LITERAL
23740         expressions (otherwise they are Unary {Literal}).
23741         (Invocation::Badness): Take into account `Implicit constant
23742         expression conversions'.
23743
23744         * literal.cs (LongLiteral): Implement long literal class.
23745         (IntLiteral): export the `Value' of the intliteral. 
23746
23747 2001-09-19  Ravi Pratap  <ravi@ximian.com>
23748
23749         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
23750
23751         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
23752         instead of 'Operator'
23753
23754         * expression.cs (Binary::ResolveOperator): Update accordingly.
23755         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
23756         and 'Minus'
23757
23758         * cs-parser.jay (unary_expression): Update to use the new names.
23759
23760         * gen-treedump.cs (GetUnary): Same here.
23761
23762         * expression.cs (Unary::Resolve): Implement.
23763         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
23764         operators are found instead of making noise ;-)
23765         (Unary::ResolveOperator): New method to do precisely the same thing which
23766         Binary::ResolveOperator does for Binary expressions.
23767         (Unary.method, .Arguments): Add.
23768         (Unary::OperName): Implement.   
23769         (Unary::ForceConversion): Copy and Paste !
23770
23771         * class.cs (Operator::Define): Fix a small bug for the case when we have 
23772         a unary operator.
23773
23774         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
23775         for the inbuilt operators. Only overloading works for now ;-)
23776
23777 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
23778
23779         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
23780         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
23781
23782         * expression.cs (This::Emit): Implement. 
23783         (This::Resolve): Implement.
23784         (TypeOf:Resolve): Implement.
23785         (Expression::ResolveSimpleName): Add an implicit this to instance
23786         field references. 
23787         (MemberAccess::Resolve): Deal with Parameters and Fields. 
23788         Bind instance variable to Field expressions.
23789         (FieldExpr::Instance): New field used to track the expression that
23790         represents the object instance.
23791         (FieldExpr::Resolve): Track potential errors from MemberLookup not
23792         binding 
23793         (FieldExpr::Emit): Implement.
23794
23795         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
23796         the last instruction contains a return opcode to avoid generating
23797         the last `ret' instruction (this generates correct code, and it is
23798         nice to pass the peverify output).
23799
23800         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
23801         initializer for static and instance variables.
23802         (Constructor::Emit): Allow initializer to be null in the case of
23803         static constructors.  Only emit initializer for instance
23804         constructors. 
23805
23806         (TypeContainer::FindMembers): Return a null array if there are no
23807         matches.
23808
23809         Also fix the code for the MemberTypes.Method branch, as it was not
23810         scanning that for operators (or tried to access null variables before).
23811
23812         * assign.cs (Assign::Emit): Handle instance and static fields. 
23813
23814         * TODO: Updated.
23815
23816         * driver.cs: Stop compilation if there are parse errors.
23817
23818         * cs-parser.jay (constructor_declaration): Provide default base
23819         initializer for non-static constructors.
23820         (constructor_declarator): Do not provide a default base
23821         initializers if none was specified.
23822         Catch the fact that constructors should not have parameters.
23823
23824         * class.cs: Do not emit parent class initializers for static
23825         constructors, that should be flagged as an error.
23826
23827 2001-09-18  Ravi Pratap  <ravi@ximian.com>
23828
23829         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
23830         Move back code into TypeContainer::Populate.
23831
23832 2001-09-18  Ravi Pratap  <ravi@ximian.com>
23833
23834         * class.cs (TypeContainer::AddConstructor): Fix the check to
23835         compare against Name, not Basename. 
23836         (Operator::OpType): Change Plus and Minus to Add and Subtract.
23837
23838         * cs-parser.jay : Update accordingly.
23839
23840         * class.cs (TypeContainer::FindMembers): For the case where we are searching
23841         for methods, don't forget to look into the operators too.
23842         (RegisterMethodBuilder): Helper method to take care of this for
23843         methods, constructors and operators.
23844         (Operator::Define): Completely revamp.
23845         (Operator.OperatorMethod, MethodName): New fields.
23846         (TypeContainer::Populate): Move the registering of builders into
23847         RegisterMethodBuilder.
23848         (Operator::Emit): Re-write.
23849
23850         * expression.cs (Binary::Emit): Comment out code path to emit method
23851         invocation stuff for the case when we have a user defined operator. I am
23852         just not able to get it right !
23853
23854 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
23855
23856         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
23857         argument. 
23858
23859         (Expression::MemberLookup): Provide a version that allows to
23860         specify the MemberTypes and BindingFlags. 
23861
23862         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
23863         so it was not fetching variable information from outer blocks.
23864
23865         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
23866         Beforefieldinit as it was buggy.
23867
23868         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
23869         that Ravi put here.  
23870
23871         * class.cs (Constructor::Emit): Only emit if block is not null.
23872         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
23873         deal with this by semantically definining it as if the user had
23874         done it.
23875
23876         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
23877         constructors as we now "emit" them at a higher level.
23878
23879         (TypeContainer::DefineDefaultConstructor): Used to define the
23880         default constructors if none was provided.
23881
23882         (ConstructorInitializer): Add methods Resolve and Emit. 
23883
23884         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
23885
23886 2001-09-17  Ravi Pratap  <ravi@ximian.com>
23887
23888         * class.cs (TypeContainer::EmitDefaultConstructor): Register
23889         the default constructor builder with our hashtable for methodbuilders
23890         to methodcores.
23891
23892         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
23893         and argument_count is 0 in which case we have a match.
23894         (Binary::ResolveOperator): More null checking and miscellaneous coding
23895         style cleanup.
23896
23897 2001-09-17  Ravi Pratap  <ravi@ximian.com>
23898
23899         * rootcontext.cs (IsNameSpace): Compare against null.
23900
23901         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
23902
23903         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
23904         and Unary::Operator.
23905
23906         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
23907         accordingly.
23908
23909         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
23910         we have overloaded operators.
23911         (Binary::ResolveOperator): Implement the part which does the operator overload
23912         resolution.
23913
23914         * class.cs (Operator::Emit): Implement.
23915         (TypeContainer::Emit): Emit the operators we have too.
23916
23917         * expression.cs (Binary::Emit): Update to emit the appropriate code for
23918         the case when we have a user-defined operator.
23919
23920 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
23921
23922         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
23923
23924 2001-09-16  Ravi Pratap  <ravi@ximian.com>
23925
23926         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
23927         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
23928         (Constructor::Emit): Implement.
23929         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
23930         if we have no work to do. 
23931         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
23932         Emit method.
23933
23934         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
23935         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
23936
23937         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
23938         of parent.parent.
23939
23940 2001-09-15  Ravi Pratap  <ravi@ximian.com>
23941
23942         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
23943         in the source.
23944         (Tree::RecordNamespace): Method to do what the name says ;-)
23945         (Tree::Namespaces): Property to get at the namespaces hashtable.
23946
23947         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
23948         keep track.
23949
23950         * rootcontext.cs (IsNamespace): Fixed it :-)
23951
23952 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
23953
23954         * class.cs (TypeContainer::FindMembers): Add support for
23955         constructors. 
23956         (MethodCore): New class that encapsulates both the shared aspects
23957         of a Constructor and a Method.  
23958         (Method, Constructor): Factored pieces into MethodCore.
23959
23960         * driver.cs: Added --fatal which makes errors throw exceptions.
23961         Load System assembly as well as part of the standard library.
23962
23963         * report.cs: Allow throwing exceptions on errors for debugging.
23964
23965         * modifiers.cs: Do not use `parent', instead use the real type
23966         container to evaluate permission settings.
23967
23968         * class.cs: Put Ravi's patch back in.  He is right, and we will
23969         have to cope with the
23970
23971 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23972
23973         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
23974         FamORAssem, not FamANDAssem.
23975
23976 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
23977
23978         * driver.cs: Added --parse option that only parses its input files
23979         and terminates.
23980
23981         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
23982         incorrect.  IsTopLevel is not used to tell whether an object is
23983         root_types or not (that can be achieved by testing this ==
23984         root_types).  But to see if this is a top-level *class* (not
23985         necessarly our "toplevel" container). 
23986
23987 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23988
23989         * enum.cs (Enum::Define): Modify to call the Lookup method on the
23990         parent instead of a direct call to GetType.
23991
23992 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23993
23994         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
23995         Modifiers.TypeAttr. This should just be a call to that method.
23996
23997         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
23998         object so that we can determine if we are top-level or not.
23999
24000         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
24001         TypeContainer too.
24002
24003         * enum.cs (Enum::Define): Ditto.
24004
24005         * modifiers.cs (FieldAttr): Re-write.
24006
24007         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
24008         (TypeContainer::HaveStaticConstructor): New property to provide access
24009         to precisely that info.
24010
24011         * modifiers.cs (MethodAttr): Re-write.
24012         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
24013
24014         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
24015         of top-level types as claimed.
24016
24017 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24018
24019         * expression.cs (MemberLookup): Fruitless attempt to lookup
24020         constructors.  Maybe I need to emit default constructors?  That
24021         might be it (currently .NET emits this for me automatically).
24022         (Invocation::OverloadResolve): Cope with Arguments == null.
24023         (Invocation::EmitArguments): new function, shared by the new
24024         constructor and us.
24025         (Invocation::Emit): Handle static and instance methods.  Emit
24026         proper call instruction for virtual or non-virtual invocations.
24027         (New::Emit): Implement.
24028         (New::Resolve): Implement.
24029         (MemberAccess:Resolve): Implement.
24030         (MethodGroupExpr::InstanceExpression): used conforming to the spec
24031         to track instances.
24032         (FieldExpr::Resolve): Set type.
24033
24034         * support.cs: Handle empty arguments.
24035                 
24036         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
24037         SimpleLookup): Auxiliary routines to help parse a qualifier
24038         identifier.  
24039
24040         Update qualifier_identifier rule.
24041
24042         * codegen.cs: Removed debugging messages.
24043
24044         * class.cs: Make this a global thing, this acts just as a "key" to
24045         objects that we might have around.
24046
24047         (Populate): Only initialize method_builders_to_methods once.
24048
24049         * expression.cs (PropertyExpr): Initialize type from the
24050         PropertyType. 
24051
24052         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
24053         Resolve pattern.  Attempt to implicitly convert value to boolean.
24054         Emit code.
24055
24056         * expression.cs: Set the type for the int32/int32 argument case.
24057         (Binary::ResolveOperator): Set the return type to boolean for
24058         comparission operators
24059
24060         * typemanager.cs: Remove debugging print code.
24061
24062         (Invocation::Resolve): resolve type.
24063
24064         * class.cs: Allocate a MemberInfo of the correct size, as the code
24065         elsewhere depends on the test to reflect the correct contents.
24066
24067         (Method::) Keep track of parameters, due to System.Reflection holes
24068
24069         (TypeContainer::Populate): Keep track of MethodBuilders to Method
24070         mapping here.
24071
24072         (TypeContainer::FindMembers): Use ArrayList and then copy an array
24073         of the exact size and return that.
24074
24075         (Class::LookupMethodByBuilder): New function that maps
24076         MethodBuilders to its methods.  Required to locate the information
24077         on methods because System.Reflection bit us again.
24078
24079         * support.cs: New file, contains an interface ParameterData and
24080         two implementations: ReflectionParameters and InternalParameters
24081         used to access Parameter information.  We will need to grow this
24082         as required.
24083
24084         * expression.cs (Invocation::GetParameterData): implement a cache
24085         and a wrapper around the ParameterData creation for methods. 
24086         (Invocation::OverloadResolve): Use new code.
24087
24088 2001-09-13  Ravi Pratap  <ravi@ximian.com>
24089
24090         * class.cs (TypeContainer::EmitField): Remove and move into 
24091         (Field::Define): here and modify accordingly.
24092         (Field.FieldBuilder): New member.
24093         (TypeContainer::Populate): Update accordingly.
24094         (TypeContainer::FindMembers): Implement.
24095
24096 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24097
24098         * statement.cs: (VariableInfo::VariableType): New field to be
24099         initialized with the full type once it is resolved. 
24100
24101 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
24102
24103         * parameter.cs (GetParameterInfo): Use a type cache to compute
24104         things only once, and to reuse this information
24105
24106         * expression.cs (LocalVariableReference::Emit): Implement.
24107         (OpcodeCast::Emit): fix.
24108
24109         (ParameterReference::Resolve): Implement.
24110         (ParameterReference::Emit): Implement.
24111
24112         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
24113         that are expressions need to stay as Expressions.
24114
24115         * typemanager.cs (CSharpName): Returns the C# name of a type if
24116         possible. 
24117
24118         * expression.cs (Expression::ConvertImplicit): New function that
24119         implements implicit type conversions.
24120
24121         (Expression::ImplicitReferenceConversion): Implements implicit
24122         reference conversions.
24123
24124         (EmptyCast): New type for transparent casts.
24125
24126         (OpcodeCast): New type for casts of types that are performed with
24127         a sequence of bytecodes.
24128
24129         (BoxedCast): New type used for casting value types into reference
24130         types.  Emits a box opcode.
24131
24132         (Binary::DoNumericPromotions): Implements numeric promotions of
24133         and computation of the Binary::Type.
24134
24135         (Binary::EmitBranchable): Optimization.
24136
24137         (Binary::Emit): Implement code emission for expressions.
24138
24139         * typemanager.cs (TypeManager): Added two new core types: sbyte
24140         and byte.
24141
24142 2001-09-12  Ravi Pratap  <ravi@ximian.com>
24143
24144         * class.cs (TypeContainer::FindMembers): Method which does exactly
24145         what Type.FindMembers does, only we don't have to use reflection. No
24146         implementation yet.
24147
24148         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
24149         typecontainer objects as we need to get at them.
24150         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
24151
24152         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
24153         typecontainer object.
24154
24155         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
24156         of just a Report object.
24157
24158 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24159
24160         * class.cs (Event::Define): Go back to using the prefixes "add_" and
24161         "remove_"
24162         (TypeContainer::Populate): Now define the delegates of the type too.
24163         (TypeContainer.Delegates): Property to access the list of delegates defined
24164         in the type.
24165
24166         * delegates.cs (Delegate::Define): Implement partially.
24167
24168         * modifiers.cs (TypeAttr): Handle more flags.
24169
24170 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24171
24172         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
24173         and not <=
24174         (Operator::Define): Re-write logic to get types by using the LookupType method
24175         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
24176         (Indexer::Define): Ditto.
24177         (Event::Define): Ditto.
24178         (Property::Define): Ditto.
24179
24180 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24181
24182         * class.cs (TypeContainer::Populate): Now define operators too. 
24183         (TypeContainer.Operators): New property to access the list of operators
24184         in a type.
24185         (Operator.OperatorMethodBuilder): New member to hold the method builder
24186         for the operator we are defining.
24187         (Operator::Define): Implement.
24188
24189 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24190
24191         * class.cs (Event::Define): Make the prefixes of the accessor methods
24192         addOn_ and removeOn_ 
24193
24194         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
24195         of the location being passed in too. Ideally, this should go later since all
24196         error reporting should be done through the Report object.
24197
24198         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
24199         (Populate): Iterate thru the indexers we have and define them too.
24200         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
24201         for the get and set accessors.
24202         (Indexer::Define): Implement.
24203
24204 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
24205
24206         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
24207         my previous implementation, did not work.
24208
24209         * typemanager.cs: Add a couple of missing types (the longs).
24210
24211         * literal.cs: Use TypeManager.bool_type instead of getting it.
24212
24213         * expression.cs (EventExpr): New kind of expressions.
24214         (Expressio::ExprClassFromMemberInfo): finish
24215
24216 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
24217
24218         * assign.cs: Emit stores to static fields differently.
24219
24220 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24221
24222         * Merge in changes and adjust code to tackle conflicts. Backed out my
24223         code in Assign::Resolve ;-) 
24224
24225 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24226
24227         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
24228         instead Report.Error and also pass in the location.
24229         (CSharpParser::Lexer): New readonly property to return the reference
24230         to the Tokenizer object.
24231         (declare_local_variables): Use Report.Error with location instead of plain 
24232         old error.
24233         (CheckDef): Ditto.
24234
24235         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
24236         (Operator.CheckBinaryOperator): Ditto.
24237
24238         * cs-parser.jay (operator_declarator): Update accordingly.
24239
24240         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
24241         (CheckBinaryOperator): Same here.
24242
24243         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
24244         on the name without any prefixes of namespace names etc. This is because we
24245         already might have something already fully qualified like 
24246         'System.Console.WriteLine'
24247
24248         * assign.cs (Resolve): Begin implementation. Stuck ;-)
24249
24250 2001-09-07  Ravi Pratap  <ravi@ximian.com>
24251
24252         * cs-tokenizer.cs (location): Return a string which also contains
24253         the file name.
24254
24255         * expression.cs (ElementAccess): New class for expressions of the
24256         type 'element access.'
24257         (BaseAccess): New class for expressions of the type 'base access.'
24258         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
24259         respectively.
24260
24261         * cs-parser.jay (element_access): Implement action.
24262         (base_access): Implement actions.
24263         (checked_expression, unchecked_expression): Implement.
24264
24265         * cs-parser.jay (local_variable_type): Correct and implement.
24266         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24267
24268         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24269
24270         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24271         name and the specifiers.
24272
24273         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24274
24275         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
24276         making them all public ;-)
24277
24278         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24279         class anyways.
24280
24281 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
24282
24283         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24284         PropertyExprs.
24285         (FieldExpr, PropertyExprs): New resolved expressions.
24286         (SimpleName::MemberStaticCheck): Perform static checks for access
24287         to non-static fields on static methods. Maybe this should be
24288         generalized for MemberAccesses. 
24289         (SimpleName::ResolveSimpleName): More work on simple name
24290         resolution. 
24291
24292         * cs-parser.jay (primary_expression/qualified_identifier): track
24293         the parameter index.
24294
24295         * codegen.cs (CodeGen::Save): Catch save exception, report error.
24296         (EmitContext::EmitBoolExpression): Chain to expression generation
24297         instead of temporary hack.
24298         (::EmitStatementExpression): Put generic expression code generation.
24299
24300         * assign.cs (Assign::Emit): Implement variable assignments to
24301         local variables, parameters and fields.
24302
24303 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
24304
24305         * statement.cs (Block::GetVariableInfo): New method, returns the
24306         VariableInfo for a variable name in a block.
24307         (Block::GetVariableType): Implement in terms of GetVariableInfo
24308
24309         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24310         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24311
24312 2001-09-06  Ravi Pratap  <ravi@ximian.com>
24313
24314         * cs-parser.jay (operator_declaration): Continue on my quest : update
24315         to take attributes argument.
24316         (event_declaration): Ditto.
24317         (enum_declaration): Ditto.
24318         (indexer_declaration): Ditto.
24319
24320         * class.cs (Operator::Operator): Update constructor accordingly.
24321         (Event::Event): Ditto.
24322
24323         * delegate.cs (Delegate::Delegate): Same here.
24324
24325         * enum.cs (Enum::Enum): Same here.
24326
24327 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24328
24329         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
24330
24331         * ../tests/cs0658.cs : New file to demonstrate error 0658.
24332
24333         * attribute.cs (Attributes): New class to encapsulate all attributes which were
24334         being passed around as an arraylist.
24335         (Attributes::AddAttribute): Method to add attribute sections.
24336
24337         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
24338         (struct_declaration): Update accordingly.
24339         (constant_declaration): Update.
24340         (field_declaration): Update.
24341         (method_header): Update.
24342         (fixed_parameter): Update.
24343         (parameter_array): Ditto.
24344         (property_declaration): Ditto.
24345         (destructor_declaration): Ditto.
24346
24347         * class.cs (Struct::Struct): Update constructors accordingly.
24348         (Class::Class): Ditto.
24349         (Field::Field): Ditto.
24350         (Method::Method): Ditto.
24351         (Property::Property): Ditto.
24352         (TypeContainer::OptAttribute): update property's return type.
24353
24354         * interface.cs (Interface.opt_attributes): New member.
24355         (Interface::Interface): Update to take the extra Attributes argument.
24356
24357         * parameter.cs (Parameter::Parameter): Ditto.
24358
24359         * constant.cs (Constant::Constant): Ditto.
24360
24361         * interface.cs (InterfaceMemberBase): New OptAttributes field.
24362         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
24363         the attributes as a parameter.
24364         (InterfaceProperty): Update constructor call.
24365         (InterfaceEvent): Ditto.
24366         (InterfaceMethod): Ditto.
24367         (InterfaceIndexer): Ditto.
24368
24369         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
24370         pass the attributes too.
24371         (interface_event_declaration): Ditto.
24372         (interface_property_declaration): Ditto.
24373         (interface_method_declaration): Ditto.
24374         (interface_declaration): Ditto.
24375
24376 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
24377
24378         * class.cs (Method::Define): Track the "static Main" definition to
24379         create an entry point. 
24380
24381         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24382         EntryPoint if we find it. 
24383
24384         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24385         (EmitContext::ig): Make this variable public.
24386
24387         * driver.cs: Make the default output file be the first file name
24388         with the .exe extension.  
24389
24390         Detect empty compilations
24391
24392         Handle various kinds of output targets.  Handle --target and
24393         rename -t to --dumper.
24394
24395         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24396         methods inherited from Expression return now an Expression.  This
24397         will is used during the tree rewriting as we resolve them during
24398         semantic analysis.
24399
24400         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24401         the spec.  Missing entirely is the information about
24402         accessability of elements of it.
24403
24404         (Expression::ExprClassFromMemberInfo): New constructor for
24405         Expressions that creates a fully initialized Expression based on
24406         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24407         a Type.
24408
24409         (Invocation::Resolve): Begin implementing resolution of invocations.
24410
24411         * literal.cs (StringLiteral):  Implement Emit.
24412
24413 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24414
24415         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24416         member.
24417
24418 2001-09-04  Ravi Pratap  <ravi@ximian.com>
24419
24420         * cs-parser.jay (attribute_arguments): Implement actions.
24421         (attribute): Fix bug in production. Implement action.
24422         (attribute_list): Implement.
24423         (attribute_target): Implement.
24424         (attribute_target_specifier, opt_target_specifier): Implement
24425         (CheckAttributeTarget): New method to check if the attribute target
24426         is valid.
24427         (attribute_section): Implement.
24428         (opt_attributes): Implement.
24429
24430         * attribute.cs : New file to handle attributes.
24431         (Attribute): Class to hold attribute info.
24432
24433         * cs-parser.jay (opt_attribute_target_specifier): Remove production
24434         (attribute_section): Modify production to use 2 different rules to 
24435         achieve the same thing. 1 s/r conflict down !
24436         Clean out commented, useless, non-reducing dimension_separator rules.
24437
24438         * class.cs (TypeContainer.attributes): New member to hold list
24439         of attributes for a type.
24440         (Struct::Struct): Modify to take one more argument, the attribute list.
24441         (Class::Class): Ditto.
24442         (Field::Field): Ditto.
24443         (Method::Method): Ditto.
24444         (Property::Property): Ditto.
24445
24446         * cs-parser.jay (struct_declaration): Update constructor call to
24447         pass in the attributes too.
24448         (class_declaration): Ditto.
24449         (constant_declaration): Ditto.
24450         (field_declaration): Ditto.
24451         (method_header): Ditto.
24452         (fixed_parameter): Ditto.
24453         (parameter_array): Ditto.
24454         (property_declaration): Ditto.
24455
24456         * constant.cs (Constant::Constant): Update constructor similarly.
24457         Use System.Collections.
24458
24459         * parameter.cs (Parameter::Parameter): Update as above.
24460
24461 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24462
24463         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24464         (TypeContainer.delegates): New member to hold list of delegates.
24465
24466         * cs-parser.jay (delegate_declaration): Implement the action correctly 
24467         this time as I seem to be on crack ;-)
24468
24469 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
24470
24471         * rootcontext.cs (RootContext::IsNamespace): new function, used to
24472         tell whether an identifier represents a namespace.
24473
24474         * expression.cs (NamespaceExpr): A namespace expression, used only
24475         temporarly during expression resolution.
24476         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24477         utility functions to resolve names on expressions.
24478
24479 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
24480
24481         * codegen.cs: Add hook for StatementExpressions. 
24482
24483         * class.cs: Fix inverted test for static flag in methods.
24484
24485 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24486
24487         * class.cs (Operator::CheckUnaryOperator): Correct error number used
24488         to make it coincide with MS' number.
24489         (Operator::CheckBinaryOperator): Ditto.
24490
24491         * ../errors/errors.txt : Remove error numbers added earlier.
24492
24493         * ../errors/cs1019.cs : Test case for error # 1019
24494
24495         * ../errros/cs1020.cs : Test case for error # 1020
24496
24497         * cs-parser.jay : Clean out commented cruft.
24498         (dimension_separators, dimension_separator): Comment out. Ostensibly not
24499         used anywhere - non-reducing rule.
24500         (namespace_declarations): Non-reducing rule - comment out.
24501
24502         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24503         with TypeContainer::AddEnum.
24504
24505         * delegate.cs : New file for delegate handling classes.
24506         (Delegate): Class for declaring delegates.
24507
24508         * makefile : Update.
24509
24510         * cs-parser.jay (delegate_declaration): Implement.
24511
24512 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
24513
24514         * class.cs (Event::Define): Implement.
24515         (Event.EventBuilder): New member.
24516
24517         * class.cs (TypeContainer::Populate): Update to define all enums and events
24518         we have.
24519         (Events): New property for the events arraylist we hold. Shouldn't we move to using
24520         readonly fields for all these cases ?
24521
24522 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24523
24524         * class.cs (Property): Revamp to use the convention of making fields readonly.
24525         Accordingly modify code elsewhere.
24526
24527         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24528         the Define method of the Property class.
24529
24530         * class.cs : Clean up applied patch and update references to variables etc. Fix 
24531         trivial bug.
24532         (TypeContainer::Populate): Update to define all the properties we have. Also
24533         define all enumerations.
24534
24535         * enum.cs (Define): Implement.
24536
24537 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24538
24539         * cs-parser.jay (overloadable_operator): The semantic value is an
24540         enum of the Operator class.
24541         (operator_declarator): Implement actions.
24542         (operator_declaration): Implement.
24543
24544         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24545         validity of definitions.
24546         (Operator::CheckBinaryOperator): Static method to check for binary operators
24547         (TypeContainer::AddOperator): New method to add an operator to a type.
24548
24549         * cs-parser.jay (indexer_declaration): Added line to actually call the
24550         AddIndexer method so it gets added ;-)
24551
24552         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
24553         already taken care of by the MS compiler ?  
24554
24555 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24556
24557         * class.cs (Operator): New class for operator declarations.
24558         (Operator::OpType): Enum for the various operators.
24559
24560 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24561
24562         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24563         ostensibly handle this in semantic analysis.
24564
24565         * cs-parser.jay (general_catch_clause): Comment out
24566         (specific_catch_clauses, specific_catch_clause): Ditto.
24567         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24568         (catch_args, opt_catch_args): New productions.
24569         (catch_clause): Rewrite to use the new productions above
24570         (catch_clauses): Modify accordingly.
24571         (opt_catch_clauses): New production to use in try_statement
24572         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
24573         and re-write the code in the actions to extract the specific and
24574         general catch clauses by being a little smart ;-)
24575
24576         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
24577         Hooray, try and catch statements parse fine !
24578
24579 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24580
24581         * statement.cs (Block::GetVariableType): Fix logic to extract the type
24582         string from the hashtable of variables.
24583
24584         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
24585         I end up making that mistake ;-)
24586         (catch_clauses): Fixed gross error which made Key and Value of the 
24587         DictionaryEntry the same : $1 !!
24588
24589 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24590
24591         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
24592
24593         * cs-parser.jay (event_declaration): Correct to remove the semicolon
24594         when the add and remove accessors are specified. 
24595
24596 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24597
24598         * cs-parser.jay (IndexerDeclaration): New helper class to hold
24599         information about indexer_declarator.
24600         (indexer_declarator): Implement actions.
24601         (parsing_indexer): New local boolean used to keep track of whether
24602         we are parsing indexers or properties. This is necessary because 
24603         implicit_parameters come into picture even for the get accessor in the 
24604         case of an indexer.
24605         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
24606
24607         * class.cs (Indexer): New class for indexer declarations.
24608         (TypeContainer::AddIndexer): New method to add an indexer to a type.
24609         (TypeContainer::indexers): New member to hold list of indexers for the
24610         type.
24611
24612 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24613
24614         * cs-parser.jay (add_accessor_declaration): Implement action.
24615         (remove_accessor_declaration): Implement action.
24616         (event_accessors_declaration): Implement
24617         (variable_declarators): swap statements for first rule - trivial.
24618
24619         * class.cs (Event): New class to hold information about event
24620         declarations.
24621         (TypeContainer::AddEvent): New method to add an event to a type
24622         (TypeContainer::events): New member to hold list of events.
24623
24624         * cs-parser.jay (event_declaration): Implement actions.
24625
24626 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24627
24628         * cs-parser.jay (dim_separators): Implement. Make it a string
24629         concatenating all the commas together, just as they appear.
24630         (opt_dim_separators): Modify accordingly
24631         (rank_specifiers): Update accordingly. Basically do the same
24632         thing - instead, collect the brackets here.
24633         (opt_rank_sepcifiers): Modify accordingly.
24634         (array_type): Modify to actually return the complete type string
24635         instead of ignoring the rank_specifiers.
24636         (expression_list): Implement to collect the expressions
24637         (variable_initializer): Implement. We make it a list of expressions
24638         essentially so that we can handle the array_initializer case neatly too.
24639         (variable_initializer_list): Implement.
24640         (array_initializer): Make it a list of variable_initializers
24641         (opt_array_initializer): Modify accordingly.
24642
24643         * expression.cs (New::NType): Add enumeration to help us
24644         keep track of whether we have an object/delegate creation
24645         or an array creation.
24646         (New:NewType, New::Rank, New::Indices, New::Initializers): New
24647         members to hold data about array creation.
24648         (New:New): Modify to update NewType
24649         (New:New): New Overloaded contructor for the array creation
24650         case.
24651
24652         * cs-parser.jay (array_creation_expression): Implement to call
24653         the overloaded New constructor.
24654
24655 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
24656
24657         * class.cs (TypeContainer::Constructors): Return member
24658         constructors instead of returning null.
24659
24660 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
24661
24662         * typemanager.cs (InitCoreTypes): Initialize the various core
24663         types after we have populated the type manager with the user
24664         defined types (this distinction will be important later while
24665         compiling corlib.dll)
24666
24667         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
24668         on Expression Classification.  Now all expressions have a method
24669         `Resolve' and a method `Emit'.
24670
24671         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
24672         generation from working.     Also add some temporary debugging
24673         code. 
24674
24675 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
24676
24677         * codegen.cs: Lots of code generation pieces.  This is only the
24678         beginning, will continue tomorrow with more touches of polish.  We
24679         handle the fundamentals of if, while, do, for, return.  Others are
24680         trickier and I need to start working on invocations soon.
24681
24682         * gen-treedump.cs: Bug fix, use s.Increment here instead of
24683         s.InitStatement. 
24684
24685         * codegen.cs (EmitContext): New struct, used during code
24686         emission to keep a context.   Most of the code generation will be
24687         here. 
24688
24689         * cs-parser.jay: Add embedded blocks to the list of statements of
24690         this block.  So code generation proceeds in a top down fashion.
24691
24692 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
24693
24694         * statement.cs: Add support for multiple child blocks.
24695
24696 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
24697
24698         * codegen.cs (EmitCode): New function, will emit the code for a
24699         Block of code given a TypeContainer and its ILGenerator. 
24700
24701         * statement.cs (Block): Standard public readonly optimization.
24702         (Block::Block constructors): Link children. 
24703         (Block::Child): Child Linker.
24704         (Block::EmitVariables): Emits IL variable declarations.
24705
24706         * class.cs: Drop support for MethodGroups here, delay until
24707         Semantic Analysis.
24708         (Method::): Applied the same simplification that I did before, and
24709         move from Properties to public readonly fields.
24710         (Method::ParameterTypes): Returns the parameter types for the
24711         function, and implements a cache that will be useful later when I
24712         do error checking and the semantic analysis on the methods is
24713         performed.
24714         (Constructor::GetCallingConvention): Renamed from CallingConvetion
24715         and made a method, optional argument tells whether this is a class
24716         or a structure to apply the `has-this' bit.
24717         (Method::GetCallingConvention): Implement, returns the calling
24718         convention. 
24719         (Method::Define): Defines the type, a second pass is performed
24720         later to populate the methods.
24721
24722         (Constructor::ParameterTypes): implement a cache similar to the
24723         one on Method::ParameterTypes, useful later when we do semantic
24724         analysis. 
24725
24726         (TypeContainer::EmitMethod):  New method.  Emits methods.
24727
24728         * expression.cs: Removed MethodGroup class from here.
24729
24730         * parameter.cs (Parameters::GetCallingConvention): new method.
24731
24732 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
24733
24734         * class.cs (TypeContainer::Populate): Drop RootContext from the
24735         argument. 
24736
24737         (Constructor::CallingConvention): Returns the calling convention.
24738         (Constructor::ParameterTypes): Returns the constructor parameter
24739         types. 
24740
24741         (TypeContainer::AddConstructor): Keep track of default constructor
24742         and the default static constructor.
24743
24744         (Constructor::) Another class that starts using `public readonly'
24745         instead of properties. 
24746
24747         (Constructor::IsDefault): Whether this is a default constructor. 
24748
24749         (Field::) use readonly public fields instead of properties also.
24750
24751         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
24752         track of static constructors;  If none is used, turn on
24753         BeforeFieldInit in the TypeAttributes. 
24754
24755         * cs-parser.jay (opt_argument_list): now the return can be null
24756         for the cases where there are no arguments. 
24757
24758         (constructor_declarator): If there is no implicit `base' or
24759         `this', then invoke the default parent constructor. 
24760
24761         * modifiers.cs (MethodAttr): New static function maps a set of
24762         modifiers flags into a MethodAttributes enum
24763         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
24764         MethodAttr, TypeAttr to represent the various mappings where the
24765         modifiers are used.
24766         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
24767
24768 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
24769
24770         * parameter.cs (GetParameterInfo): Fix bug where there would be no
24771         method arguments.
24772
24773         * interface.cs (PopulateIndexer): Implemented the code generator
24774         for interface indexers.
24775
24776 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
24777
24778         * interface.cs (InterfaceMemberBase): Now we track the new status
24779         here.  
24780
24781         (PopulateProperty): Implement property population.  Woohoo!  Got
24782         Methods and Properties going today. 
24783
24784         Removed all the properties for interfaces, and replaced them with
24785         `public readonly' fields. 
24786
24787 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
24788
24789         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
24790         initialize their hashtables/arraylists only when they are needed
24791         instead of doing this always.
24792
24793         * parameter.cs: Handle refs and out parameters.
24794
24795         * cs-parser.jay: Use an ArrayList to construct the arguments
24796         instead of the ParameterCollection, and then cast that to a
24797         Parameter[] array.
24798
24799         * parameter.cs: Drop the use of ParameterCollection and use
24800         instead arrays of Parameters.
24801
24802         (GetParameterInfo): Use the Type, not the Name when resolving
24803         types. 
24804
24805 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
24806
24807         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
24808         and instead use public readonly fields.
24809
24810         * class.cs: Put back walking code for type containers.
24811
24812 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
24813
24814         * class.cs (MakeConstant): Code to define constants.
24815
24816         * rootcontext.cs (LookupType): New function.  Used to locate types 
24817
24818
24819 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
24820
24821         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
24822         this System.Reflection code is.  Kudos to Microsoft
24823
24824         * typemanager.cs: Implement a type cache and avoid loading all
24825         types at boot time.  Wrap in LookupType the internals.  This made
24826         the compiler so much faster.  Wow.  I rule!
24827
24828         * driver.cs: Make sure we always load mscorlib first (for
24829         debugging purposes, nothing really important).
24830
24831         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
24832         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
24833
24834         * rootcontext.cs: Lookup types on their namespace;  Lookup types
24835         on namespaces that have been imported using the `using' keyword.
24836
24837         * class.cs (TypeContainer::TypeAttr): Virtualize.
24838         (Class::TypeAttr): Return attributes suitable for this bad boy.
24839         (Struct::TypeAttr): ditto.
24840         Handle nested classes.
24841         (TypeContainer::) Remove all the type visiting code, it is now
24842         replaced with the rootcontext.cs code
24843
24844         * rootcontext.cs (GetClassBases): Added support for structs. 
24845
24846 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
24847
24848         * interface.cs, statement.cs, class.cs, parameter.cs,
24849         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
24850         Drop use of TypeRefs, and use strings instead.
24851
24852 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
24853
24854         * rootcontext.cs: 
24855
24856         * class.cs (Struct::Struct): set the SEALED flags after
24857         checking the modifiers.
24858         (TypeContainer::TypeAttr): new property, returns the
24859         TypeAttributes for a class.  
24860
24861         * cs-parser.jay (type_list): Oops, list production was creating a
24862         new list of base types.
24863
24864         * rootcontext.cs (StdLib): New property.
24865         (GetInterfaceTypeByName): returns an interface by type name, and
24866         encapsulates error handling here.
24867         (GetInterfaces): simplified.
24868         (ResolveTree): Encapsulated all the tree resolution here.
24869         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
24870         types. 
24871
24872         * driver.cs: Add support for --nostdlib, to avoid loading the
24873         default assemblies.
24874         (Main): Do not put tree resolution here. 
24875
24876         * rootcontext.cs: Beginning of the class resolution.
24877
24878 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
24879
24880         * rootcontext.cs: Provide better error reporting. 
24881
24882         * cs-parser.jay (interface_base): set our $$ to be interfaces.
24883
24884         * rootcontext.cs (CreateInterface): Handle the case where there
24885         are no parent interfaces.
24886
24887         (CloseTypes): Routine to flush types at the end.
24888         (CreateInterface): Track types.
24889         (GetInterfaces): Returns an array of Types from the list of
24890         defined interfaces.
24891
24892         * typemanager.c (AddUserType): Mechanism to track user types (puts
24893         the type on the global type hash, and allows us to close it at the
24894         end). 
24895
24896 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
24897
24898         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
24899         RecordInterface instead.
24900
24901         * cs-parser.jay: Updated to reflect changes above.
24902
24903         * decl.cs (Definition): Keep track of the TypeBuilder type that
24904         represents this type here.  Not sure we will use it in the long
24905         run, but wont hurt for now.
24906
24907         * driver.cs: Smaller changes to accomodate the new code.
24908
24909         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
24910         when done. 
24911
24912         * rootcontext.cs (CreateInterface):  New method, used to create
24913         the System.TypeBuilder type for interfaces.
24914         (ResolveInterfaces): new entry point to resolve the interface
24915         hierarchy. 
24916         (CodeGen): Property, used to keep track of the code generator.
24917
24918 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
24919
24920         * cs-parser.jay: Add a second production for delegate_declaration
24921         with `VOID'.
24922
24923         (enum_body): Put an opt_comma here instead of putting it on
24924         enum_body or enum_member_declarations so we can handle trailing
24925         commas on enumeration members.  Gets rid of a shift/reduce.
24926
24927         (type_list): Need a COMMA in the middle.
24928
24929         (indexer_declaration): Tell tokenizer to recognize get/set
24930
24931         * Remove old targets.
24932
24933         * Re-add the parser target.
24934
24935 2001-07-13  Simon Cozens <simon@simon-cozens.org>
24936
24937         * cs-parser.jay: Add precendence rules for a number of operators
24938         ot reduce the number of shift/reduce conflicts in the grammar.
24939
24940 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
24941
24942         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
24943         and put it here.
24944
24945         Get rid of old crufty code.
24946
24947         * rootcontext.cs: Use this to keep track of the parsed
24948         representation and the defined types available to the program. 
24949
24950         * gen-treedump.cs: adjust for new convention.
24951
24952         * type.cs: Split out the type manager, and the assembly builder
24953         from here. 
24954
24955         * typemanager.cs: the type manager will live here now.
24956
24957         * cil-codegen.cs: And the code generator here. 
24958
24959 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
24960
24961         * makefile: Fixed up for easy making.
24962
24963 2001-07-13  Simon Cozens <simon@simon-cozens.org>
24964
24965         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
24966         the 
24967
24968         (unary_expression): Expand pre_increment_expression and
24969         post_decrement_expression to reduce a shift/reduce.
24970
24971 2001-07-11  Simon Cozens
24972
24973         * cs-tokenizer.cs: Hex numbers should begin with a 0.
24974
24975         Improve allow_keyword_as_indent name.
24976
24977 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
24978
24979         * Adjustments for Beta2. 
24980
24981 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
24982
24983         * decl.cs: Added `Define' abstract method.
24984         (InTransit): new property, used to catch recursive definitions. 
24985
24986         * interface.cs: Implement `Define'. 
24987
24988         * modifiers.cs: Map Modifiers.constants to
24989         System.Reflection.TypeAttribute flags.
24990
24991         * class.cs: Keep track of types and user-defined types.
24992         (BuilderInit): New method for creating an assembly
24993         (ResolveType): New function to launch the resolution process, only
24994         used by interfaces for now.
24995
24996         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
24997         that are inserted into the name space. 
24998
24999 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
25000
25001         * ARGH.  I have screwed up my tree so many times due to the use of
25002         rsync rather than using CVS.  Going to fix this at once. 
25003
25004         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
25005         load types.
25006
25007 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
25008
25009         * Experiment successful: Use System.Type rather that our own
25010         version of Type.  
25011
25012 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
25013
25014         * cs-parser.jay: Removed nsAliases from here.
25015
25016         Use new namespaces, handle `using XXX;' 
25017
25018         * namespace.cs: Reimplemented namespace handling, use a recursive
25019         definition of the class.  Now we can keep track of using clauses
25020         and catch invalid using clauses.
25021
25022 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
25023
25024         * gen-treedump.cs: Adapted for all the renaming.
25025
25026         * expression.cs (Expression): this class now has a Type property
25027         which returns an expression Type.
25028
25029         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
25030         `Type', as this has a different meaning now in the base
25031
25032 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
25033
25034         * interface.cs, class.cs: Removed from all the sources the
25035         references to signature computation, as we can not do method
25036         signature computation during the parsing time, as we are not
25037         trying to solve at that point distinguishing:
25038
25039         class X {
25040                 void a (Blah x) {}
25041                 void a (NS.Blah x) {}
25042         }
25043
25044         Which depending on the context might be valid or not, as we do not
25045         know if Blah is the same thing as NS.Blah at that point.
25046
25047         * Redid everything so the code uses TypeRefs now instead of
25048         Types.  TypeRefs are just temporary type placeholders, that need
25049         to be resolved.  They initially have a pointer to a string and the
25050         current scope in which they are used.  This is used later by the
25051         compiler to resolve the reference to an actual Type. 
25052
25053         * DeclSpace is no longer a CIR.Type, and neither are
25054         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
25055         are all DeclSpaces, but no Types. 
25056
25057         * type.cs (TypeRefManager): This implements the TypeRef manager,
25058         which keeps track of all the types that need to be resolved after
25059         the parsing has finished. 
25060
25061 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
25062
25063         * ARGH.  We are going to have to store `foreach' as a class rather
25064         than resolving it, as we need to verify error 1579 after name
25065         resolution.   *OR* we could keep a flag that says `This request to
25066         IEnumerator comes from a foreach statement' which we can then use
25067         to generate the error.
25068
25069 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
25070
25071         * class.cs (TypeContainer.AddMethod): we now add methods to the
25072         MethodGroup instead of the method hashtable.  
25073
25074         * expression.cs: Add MethodGroup abstraction, which gets us one
25075         step closer to the specification in the way we handle method
25076         declarations.  
25077
25078         * cs-parser.jay (primary_expression): qualified_identifier now
25079         tried to match up an identifier to a local variable reference or
25080         to a parameter reference.
25081
25082         current_local_parameters is now a parser global variable that
25083         points to the current parameters for the block, used during name
25084         lookup.
25085
25086         (property_declaration): Now creates an implicit `value' argument to
25087         the set accessor.
25088
25089 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
25090
25091         * parameter.cs: Do not use `param' arguments as part of the
25092         signature, per the spec.
25093
25094 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
25095
25096         * decl.cs: Base class for classes, structs and interfaces.  This
25097         is the "Declaration Space" 
25098
25099         * cs-parser.jay: Use CheckDef for checking declaration errors
25100         instead of having one on each function.
25101
25102         * class.cs: Factor out some code for handling error handling in
25103         accordance to the "Declarations" section in the "Basic Concepts"
25104         chapter in the ECMA C# spec.
25105
25106         * interface.cs: Make all interface member classes derive from
25107         InterfaceMemberBase.
25108
25109 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
25110
25111         * Many things: all interfaces are parsed and generated in
25112         gen-treedump.  Support for member variables, constructors,
25113         destructors, properties, constants is there.
25114
25115         Beginning of the IL backend, but very little done, just there for
25116         testing purposes. 
25117
25118 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
25119
25120         * cs-parser.jay: Fix labeled statement.
25121
25122         * cs-tokenizer.cs (escape): Escape " and ' always.
25123         ref_line, ref_name: keep track of the line/filename as instructed
25124         by #line by the compiler.
25125         Parse #line.
25126
25127 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
25128
25129         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
25130         to match the values in System.CodeDOM.
25131
25132         Divid renamed to Divide.
25133
25134         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
25135         statements. 
25136         (Statements.set): remove.
25137
25138         * System.CodeDOM/CodeCatchClause.cs: always have a valid
25139         statements. 
25140
25141         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
25142         falseStatements always have valid values. 
25143
25144         * cs-parser.jay: Use System.CodeDOM now.
25145