*** merged revisions from mcs: 57916, 58040, 58050, 58115
[mono.git] / mcs / gmcs / ChangeLog
1 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
2
3         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
4
5 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
6
7         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
8         classes.
9
10 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
11
12         * class.cs (Operator.Define): An error for base conversion was not
13         reported correctly.
14
15 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
16
17         A fix for #77593, #77574.
18
19         * class.cs (MethodCore.CheckBase): Another if for operator.
20
21 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
22
23         A fix for #77822.
24
25         * expression.cs (VerifyArgumentsCompat): Reverted to double error
26         reporting, it's more tricky than I thought.
27
28 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
29
30         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
31         were not resolved
32
33         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
34         (DelegateCreation.ImplicitStandardConversionExists): New method for just
35         conversion test.
36         
37         * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
38         not needed.
39
40 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
41
42         A fix for #77353.
43
44         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
45         (Event.Define): ditto
46         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
47
48         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
49         Removed redundant code and set NewSlot for Invoke method too.
50
51         * parameter.cs (Parameters.ctor): Add custom, type ctor.
52         (Parameters.MergeGenerated): New method. Use this method when you merge
53         compiler generated argument with user arguments.
54
55 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
56
57         * attribute.cs (ResolveAsTypeTerminal): Removed.
58
59         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
60         specialization for predefined types; 30% speed up.
61         Finally placed obsolete check to right place.
62         (Expression.ResolveType): Removed.
63
64         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
65         Updated after ResolveType was removed.
66
67         * expression.cs (Cast.ctor): Check void cast.
68         (Binary.ResolveAsTypeTerminal): Is never type.
69         (Conditional.ResolveAsTypeTerminal): Is never type.
70
71         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
72
73 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
74
75         * rootcontext.cs (ResolveCore): Removed System.INullableValue.
76
77 2006-03-23  Martin Baulig  <martin@ximian.com>
78
79         * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
80         type check if either of the types is an open generic type.
81
82 2006-03-23  Martin Baulig  <martin@ximian.com>
83
84         * convert.cs
85         (Convert.ExplicitTypeParameterConversion): New method; implement
86         explicit type parameter conversions.
87
88 2006-03-23  Martin Baulig  <martin@ximian.com>
89
90         * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
91         blindly allow all conversions if we do not have any constraints.
92
93 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
94
95         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
96         these two separated members to simplify the code.
97         (Attribute.Resolve): Refactored to use new fields and methods.
98         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
99         implemented obsolete attribute checking.
100         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
101         implemented obsolete checking again. It look line never ending quest ;-)
102         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
103
104         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
105
106         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
107
108         *class.cs (Property.Define): Add RegisterProperty call.
109
110         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
111         argument groups (only 2).
112
113         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
114         encoding expression to arguments.
115         (Expression.ExprClassToResolveFlags): Just turned to property.
116
117         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
118         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
119         optimized as well as implemented support for zero-length attributes.
120
121         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
122         Add caching of PropertyInfo's.
123
124 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
125
126         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
127         error multiple times.
128
129 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
130
131         New partial class implementation.
132         A fix for #77027, #77029, #77403
133
134         * attribute.cs (Attributable): Made attributes protected.
135
136         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
137         the replacements of ClassPart and PartialContainer.
138         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
139         (TypeContainer.AddInterface): Ditto.
140         (TypeContainer.AddPartial): The main method for partial classes. It checks
141         for errors and merges ModFlags and attributes. At the end class is added to
142         partial_parts list.
143         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
144         required here.
145         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
146         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
147         from the rest of partial classes.
148         (TypeContainer.GetClassBases): Simplified.
149         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
150         DefineType.
151         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
152         (TypeContainer.HasExplicitLayout): Uses Flags now.
153         (PartialContainer): Removed.
154         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
155         (StaticClass): Was merged with Class.
156         (Class.GetClassBases): class and static class bases are verified here.
157         (Class.TypeAttr): Added static attributes when class is static.
158         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
159         (MemberBase): In some cases we need to call parent container for partial
160         class. It should be eliminated but it's not easy now.
161
162         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
163
164         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
165         partial classed to accumulate class comments.
166         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
167
168         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
169
170         * driver.cs (MainDriver): Tree.GetDecl was removed.
171
172         * modifiers.cs (Modifiers): Add partial modifier.
173
174         * tree.cs (Tree.decl): Removed.
175         (RootTypes): Started to use this class more often for root types
176         specializations.
177
178 2006-03-23  Raja R Harinath  <rharinath@novell.com>
179
180         * generic.cs (TypeParameter.UpdateConstraints): Update
181         'constraints' if null.
182
183 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
184
185         A fix for #77615
186
187         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
188         external interface does not have an attribute.
189
190 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
191
192         Another prerequisites for new partial classs implementation.
193         
194         * attribute.cs (Attribute.Equal): Implemented.
195         (Attribute.Emit): Changed as attributes can be applied more than twice.
196         (Attributes.Emit): Check for duplicate attributes here.
197
198         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
199         as a parameter, clean-up.
200
201 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
202
203         A fix for #77485
204
205         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
206         contains obsolete attribute check which can in some cases look for base
207         type of current class which is not initialized yet.
208         (TypeContainer.BaseType): Replacement of ptype.
209
210         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
211
212 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
213
214         First of prerequisites for new partial classs implemention.
215         
216         * attribute.cs (Attributable): Extended by ResolveContext;
217         Attributes finally have correct context for resolving in all cases.
218         (AttachTo): Attribute owner is assigned here.
219
220         * codegen.cs (IResolveContext): Introduce new interface to hold
221         all information needed in resolving phase.
222         (EmitContext): Implements IResolveContext; more clean-up needed here.
223         
224         * decl.cs (MemberCore): Implemented IResolveContext.
225
226         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
227         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
228         parameter.cs, statement.cs, tree.cs, typemanager.cs:
229         Refactored to use new IResolveContext instead of EmitContext; cleanup
230
231 2006-03-22  Raja R Harinath  <rharinath@novell.com>
232
233         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
234         mcs to keep code differences small.
235         * attribute.cs (Attribute.GetParameterDefaultValue): New.
236         * typemanager.cs (parameter_default_value_attribute_type): New.
237         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
238         CS1908 check.
239
240 2006-03-22  Martin Baulig  <martin@ximian.com>
241
242         * generic.cs
243         (Nullable.NullableLiteral): Derive from `NullLiteral'.
244
245         * convert.cs
246         (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
247         instead of the normal `NullLiteral'.
248
249 2006-03-21  Martin Baulig  <martin@ximian.com>
250
251         Fix #77583.
252         * generic.cs (TypeManager.InferType): If `pt' is a generic
253         parameter, don't check whether `pt == at'.
254
255 2006-03-20  Raja R Harinath  <rharinath@novell.com>
256
257         Fix #77852
258         * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
259         (TypeParameter.Resolve): Update to change.
260         (ConstraintChecker.CheckConstraints): Resolve type-argument
261         constraints before use.
262
263 2006-03-16  Martin Baulig  <martin@ximian.com>
264
265         * generic.cs
266         (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
267         and don't have any instance constructors, also lookup in the base class.
268         (TypeManager.IsNullableValueType): New public method.
269
270         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
271         `BindingFlags.DeclaredOnly' flag and set `used_cache'.
272         (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
273
274         * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
275         instead of just TypeManager.IsNullableType() to determine whether
276         a lifted operator exists.
277         (UnaryMutator.DoResolve): Likewise.
278         (Conditional.DoResolve): Likewise.
279         (Binary.DoResolve): A lifted operator only exists if both operands
280         are valuetypes and at least one of them is a nullable type.
281
282 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
283
284         * iterator.cs : yield break is allowed in try statement which has
285           catch clauses. Fixed bug #77767.
286
287 2006-03-12  Martin Baulig  <martin@ximian.com>
288
289         * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
290         private IsSignatureEqual() to compare types; see the comment in
291         that method; fixes #77674.
292
293 2006-03-10  Raja R Harinath  <rharinath@novell.com>
294
295         * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
296         (Expression.ResolveAsTypeTerminal): Likewise.
297         * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
298         * expression.cs, generic.cs, iterators.cs: Likewise.
299         * parameter.cs, statement.cs, typemanager.cs: Likewise.
300
301 2006-03-09  Martin Baulig  <martin@ximian.com>
302
303         * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
304         TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
305
306 2006-03-09  Martin Baulig  <martin@ximian.com>
307
308         * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
309         `prepared' flag is set.
310
311         * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
312         (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
313         issues; see gtest-254.cs.
314
315 2006-03-07  Martin Baulig  <martin@ximian.com>
316
317         * generic.cs (TypeManager.InferType): Allow infering
318         `IEnumerable<T>' with an array of T; see gtest-251.cs.
319
320 2006-03-06  Martin Baulig  <martin@ximian.com>
321
322         * generic.cs
323         (TypeManager.InferType): Fix gtest-250.cs.
324
325         * typemanager.cs
326         (TypeManager.IsSubclassOf): Also check the base class.
327
328         * expression.cs
329         (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
330         fixes gtest-249.cs.
331
332 2006-03-01  Raja R Harinath  <rharinath@novell.com>
333
334         Fix #77679.
335         * expression.cs (ParameterReference.DoResolveBase): Change return
336         type to bool.
337         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
338         Update.
339
340         Fix #77628.
341         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
342
343         Fix #77642.
344         * typemanager.cs (GetFullNameSignature): Don't nullref on
345         protected accessors.
346
347 2006-02-16  Martin Baulig  <martin@ximian.com>
348
349         * generic.cs
350         (TypeManager.GetGenericFieldDefinition): New public method; use it
351         instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
352
353 2006-02-14  Martin Baulig  <martin@ximian.com>
354
355         * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
356
357 2006-02-14  Martin Baulig  <martin@ximian.com>
358
359         * generic.cs
360         (TypeManager.DropGenericMethodArguments): New public method; don't
361         use GetGenericMethodDefinition() on something which is not a
362         generic method.
363
364 2006-02-14  Martin Baulig  <martin@ximian.com>
365
366         * generic.cs
367         (ConstraintChecker.CheckConstraints): If a type parameter has the
368         `struct' constraint, the type must be a non-nullable valuetype.
369
370 2006-02-10  Martin Baulig  <martin@ximian.com>
371
372         * typemanager.cs
373         (TypeManager.IsOverride): Make this work for instantiated methods
374         in a generic class; fixes #77509.
375         (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
376         rather than calling it directly; fixes #77488.  
377
378 2006-02-08  Martin Baulig  <martin@ximian.com>
379
380         * generic.cs (ConstraintChecker.CheckConstraints): Move the error
381         reporting into CheckConstraint() so we can use the correctly
382         instantiated type.
383
384 2006-02-08  Martin Baulig  <martin@ximian.com>
385
386         * expression.cs (BaseAccess): Add support for generic methods.
387
388         * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
389         the new MethodGroupExpr.
390
391 2006-02-07  Martin Baulig  <martin@ximian.com>
392
393         * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
394         also reference types; fixes #77483.
395
396 2006-02-07  Martin Baulig  <martin@ximian.com>
397
398         * generic.cs
399         (TypeManager.IsGenericMethod): We now return whether something is
400         an instantiated generic method (and not a generic method def).
401         (TypeManager.IsGenericMethodDefinition): New public method.
402
403         * typemanager.cs
404         (TypeManager.CSharpSignature): Only include type arguments for
405         "real" generic methods, not for any instantiated method.
406         (TypeManager.GetMethodName): Likewise, but also allow generic
407         method definitions here.
408
409 2006-02-06  Miguel de Icaza  <miguel@novell.com>
410
411         * codegen.cs (EmitScopeInitFromBlock): check here the
412         capture_context, there is no need to make two calls to the
413         EmitContext. 
414
415         * anonymous.cs: Add some debugging messages that might help me
416         track other instances of this problem in the future (the
417         regression of test 467).
418
419         * cs-parser.jay: track the variable block, as we need to initalize
420         any captured variables declared in this block for the "catch"
421         portion of the "Try" statement.
422
423         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
424         scope initialization for captured variables. 
425
426         Also, move the emit for the variables after the block location has
427         been marked.
428
429 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
430
431        * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
432         
433 2006-02-06  Martin Baulig  <martin@ximian.com>
434
435         * class.cs (TypeContainer.DefineType): If we're a struct, pass
436         `TypeManager.value_type' as parent type to
437         ModuleBuilder.DefineType().  Fixes #77358.      
438
439 2006-02-02  Miguel de Icaza  <miguel@novell.com>
440
441         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
442         commit yesterday, the initialization for the roots is necessary.
443         What is not necessary is the scope activation.
444
445 2006-02-02  Raja R Harinath  <rharinath@novell.com>
446
447         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
448         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
449         CS0206 checks.
450         (Argument.Resolve): Remove CS0206 checks.
451
452 2006-02-01  Miguel de Icaza  <miguel@novell.com>
453
454         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
455         scopes for all the roots, the scopes will now be emitted when the
456         Blocks are entered. [This change was wrong, fixed on 2006-02-02]
457
458         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
459         code.  This reduces a lot of existing cruft.
460         
461         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
462         that the ScopeInfo is generated as we enter the scope, not at the
463         time of use, which is what we used to do before.
464
465         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
466         every time a Block is about to be emitted if we have a
467         CaptureContext. 
468
469 2006-02-01  Raja R Harinath  <rharinath@novell.com>
470
471         * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
472         attribute for mscorlib too.
473
474         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
475         (Reset): Update.
476         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
477
478         * typemanager.cs (cons_param_array_attribute): Make private.
479         (Reset): Set it to null.
480         (InitCoreHelpers): Don't initialize it.
481         (ConsParamArrayAttribute): New.  Initialize it as needed.
482         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
483
484 2006-01-31  Miguel de Icaza  <miguel@novell.com>
485
486         * expression.cs: There might be errors reported during the
487         selection of applicable methods.  If there are errors, do not
488         continue execution as it will lead the compiler to crash.
489
490 2006-01-30  Miguel de Icaza  <miguel@novell.com>
491
492         * expression.cs: Member access is not allowed on anonymous
493         methods.  Fixes #77402.
494
495 2006-01-30  Raja R Harinath  <rharinath@novell.com>
496
497         Fix #77401
498         * cs-parser.jay (VariableDeclaration): Don't set
499         current_array_type to null.
500         (field_declaration, event_declaration, declaration_statement):
501         Set it to null here.
502
503 2006-01-29  Raja R Harinath  <harinath@gmail.com>
504
505         Fix part of #77397
506         * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
507
508 2006-01-28  Raja R Harinath  <harinath@gmail.com>
509
510         * typemanager.cs (GenericParameterPosition): New.
511         * doc.cs: Use it.
512
513 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
514
515         * doc.cs : To process "include" elements, first we should create
516           another list than XmlNodeList, because it could result in node
517           removal, which could result in that the XmlNodeList gives up
518           yielding next node.
519
520 2006-01-25  Miguel de Icaza  <miguel@novell.com>
521
522         * expression.cs: Introduce an error report that we were not
523         catching before.   Gonzalo ran into it.
524
525 2006-01-23  Miguel de Icaza  <miguel@novell.com>
526
527         A fix for bug: #76957
528         
529         * iterators.cs (MoveNextMethod.CreateMethodHost): call
530         ComputeMethodHost before creating the method, this is a new
531         requirement. 
532
533         * anonymous.cs (AnonymousContainer): Now we track all the scopes
534         that this method references (RegisterScope).  The actual scope
535         where the method is hosted is computed with the ComputeMethodHost
536         before we create the method.
537
538         Moved the Deepest routine here.
539
540         (AnonymousContainer.ComputeMethodHost): New routine used to
541         compute the proper ScopeInfo that will host the anonymous method.
542
543         (ScopeInfo): Deal with multiple roots.  The problem was that we
544         did not have a unique root where all ScopeInfos could be hanged
545         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
546         of roots.  
547
548         Remove AdjustMethodScope which is now computed at the end.  Remove
549         LinkScope which did a partial link, instead link all ScopeInfos
550         before code generation from the new "LinkScopes" routine. 
551
552         Simplify all the Add* routines as they no longer need to maintain
553         the tree, they just need to record that they are using variables
554         from a ScopeInfo.
555
556         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
557         routines to produce the forest of ScopeInfo trees.
558
559         * class.cs (TypeContainer.AppendMethod): This is just like
560         AddMethod, but ensures that an interface implementation method
561         (IEnumerable.XXX) is not inserted at the beginning of the queue of
562         methods, but at the end.
563
564         We use this functionality to ensure that the generated MoveNext
565         method in the iterator class is resolved/emitted before the
566         enumerator methods created.   
567
568         This is required because the MoveNext method computes the right
569         ScopeInfo for the method.  And the other methods will eventually
570         need to resolve and fetch information computed from the anonymous
571         method. 
572
573         
574 2006-01-23  Raja R Harinath  <rharinath@novell.com>
575
576         Improve implementation of section 14.4.2.2 (Better function member).
577         * expression.cs (Invocation.MoreSpecific): Compare all type
578         arguments before deciding if one type is more specific than
579         another.  Handle array types too.  Return the more specific type.
580         (Invocation.BetterFunction): Add more tie-breaking rules from
581         section 14.4.2.2.  Perform "more specific" check after
582         other tie-breaking rules.  Compare all parameter types before
583         choosing the "more specific" method.
584
585 2006-01-21  Raja R Harinath  <harinath@gmail.com>
586             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
587
588         Fix rest of #76995.
589         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
590         the 'aliases' hash.
591         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
592         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
593
594 2006-01-18  Martin Baulig  <martin@ximian.com>
595
596         * class.cs (TypeContainer.AddToMemberContainer): Use
597         `symbol.MemberName.MethodName' instead of just `symbol.Name';
598         fixes #77124.
599
600 2006-01-18  Martin Baulig  <martin@ximian.com>
601
602         Fix #76417: a generic class may now have methods which may unify
603         for some type parameter substitutions.
604
605         * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
606         for methods which may unify anymore.
607
608         * expression.cs (Invocation.MoreSpecific): New private static
609         method; checks whether one method is more specific than another
610         according to 14.4.2.2 of the spec.
611         (Invocation.BetterFunction): Implement the tie-breaking rules from
612         14.4.2.2 of the spec: if two methods unify for some type parameter
613         substitution, we need to pick the more specific one.
614
615 2006-01-18  Raja R Harinath  <rharinath@novell.com>
616
617         Fix #76656, cs0231-2.cs.
618         * cs-parser.jay (formal_parameter_list): Make error case catch
619         more issues.
620         (parenthesized_expression_0): Add CS1026 check.
621         (invocation_expression): Remove unused { $$ = lexer.Location }.
622
623 2006-01-17  Raja R Harinath  <rharinath@novell.com>
624
625         Fix #76824.
626         * cs-parser.jay (statement_expression): Don't list out the
627         individual statement-expressions.  Convert syntax error into
628         CS0201 check.
629
630 2006-01-16  Raja R Harinath  <rharinath@novell.com>
631
632         Fix #76874.
633         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
634         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
635         CheckIntermediateModification.
636         (FieldExpr.DoResolve): Add new two-argument version that
637         allows us to resolve the InstanceExpression as an lvalue.
638         The one-argument variant is now just a wrapper.
639         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
640         Resolve the lhs as an lvalue if the it has a value type.
641         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
642         from Assign.DoResolve.
643         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
644         resolved as an lvalue.
645         (PropertyExpr.DoResolve): Update.
646         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
647         has a value type.  Move CS1612 check here from
648         CheckIntermediateModification.
649         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
650         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
651         'right_side' of a ResolveLValue on an 'out' argument.
652         (EmptyExpression.LValueMemberAccess): New.  Used as the
653         'right_side' of a propagated ResolveLValue on a value type.
654         (LocalVariableReference.DoResolveBase): Recognize
655         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
656         Add CS1654 check.
657         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
658         EmptyExpression.Null.
659
660 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
661
662         * typemanager.cs : added IsGenericParameter(). In gmcs it returns
663           Type.IsGenericParameter(). Fixed bug #77183.
664         * doc.cs : it is now identical to doc.cs in mcs.
665
666 2006-01-16  Martin Baulig  <martin@ximian.com>
667
668         * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
669
670 2006-01-16  Martin Baulig  <martin@ximian.com>
671
672         * typemanager.cs (TypeManager.CSharpSignature): Make this work for
673         ctors; fixes #77250.
674
675 2006-01-12  Miguel de Icaza  <miguel@novell.com>
676
677         This fixes the problem where we used ldfld instead of ldflda to
678         load the "THIS" pointer on captured parameters, when THIS is a
679         value type.  See bug #77205.
680         
681         * iterators.cs (CapturedThisReference.Emit): Pass false to
682         EmitThis (we do not need the address).
683
684         * codegen.cs (EmitThis): it needs to know whether we need the
685         address of `this' or not.  This is used by value types.  
686
687         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
688         every other call passes false.
689
690 2006-01-12  Raja R Harinath  <rharinath@novell.com>
691
692         Fix #77221.
693         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
694         GetOverride.
695         * expression.cs (Invocation.OverloadResolve): Update.
696         (Invocation.DoResolve): Avoid double resolution of invocation.
697
698 2006-01-11  Raja R Harinath  <rharinath@novell.com>
699
700         Fix #77180.
701         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
702         unary negation of floating point types as 0-expr; negation cannot
703         overflow in floating point types.
704
705         Fix #77204.
706         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
707         on operands of 'void' type.
708
709         Fix #77200.
710         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
711         and ExclusiveOr for boolean constants too.
712
713 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
714
715         * expression.cs: Fix Console.WriteLine ((this = x).foo);
716
717 2006-01-12  Miguel de Icaza  <miguel@novell.com>
718
719         * cs-tokenizer.cs (Position): New class used to save and restore
720         the position state in the tokenizer.  Before this patch the save
721         and restore was not complete enough so the line and columns would
722         start to drift and the debugger and stack traces will get the
723         wrong data.
724
725 2006-01-10  Martin Baulig  <martin@ximian.com>
726
727         * generic.cs
728         (TypeParameter.InflateConstraints): New public method.
729
730         * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
731         constraints; fixes #77042.
732
733 2006-01-10  Martin Baulig  <martin@ximian.com>
734
735         * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
736         instead of the `TypeBuilder' for this "<>THIS" variable; fixes
737         #77061. 
738
739 2006-01-09  Raja R Harinath  <rharinath@novell.com>
740
741         Fix #75636.
742         * expression.cs (Invocation.OverloadResolve): Replace reflected
743         override methods with their base virtual methods, rather than
744         skipping over them.
745         * typemanager.cs (TypeManager.GetOverride): New.
746
747 2005-12-21  Miguel de Icaza  <miguel@novell.com>
748
749         * driver.cs: Report the case of no source files and no -out:
750         argument provided.
751
752 2005-12-20  Raja R Harinath  <rharinath@novell.com>
753
754         Fix #77035.
755         * expression.cs (ComposedCast.GetSignatureForError): Define.
756
757 2006-01-05  Jb Evain  <jbevain@gmail.com>
758
759         * class.cs (Property.Define, Indexer.Define): do not tag the
760         properties as SpecialName | RTSpecialName.
761
762 2006-01-04  Miguel de Icaza  <miguel@novell.com>
763
764         * class.cs (MethodCore.IsDuplicateImplementation): This method was
765         doing a low-level comparission of parameter types.  It was lacking
766         a check for __argslist. 
767
768 2005-12-30  Miguel de Icaza  <miguel@novell.com>
769
770         * expression.cs (ParameterReference.DoResolveBase): Allow
771         reference parameters if they are local to this block. 
772
773         This allows the ref and out parameters of a delegate to be used in
774         an anonymous method, for example:
775
776         delegate void set (out int x);
777
778         set s = delegate (out int x){
779                 x = 0;
780         };
781
782         This is used by functionality introduced late in the C# language.
783         
784         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
785         method that take ref and out parameters. 
786
787         Fixes #77119 which was a late change in the spec.
788
789 2005-12-23  Miguel de Icaza  <miguel@novell.com>
790
791         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
792         parent if its the same scope.  Fixes #77060.
793
794 2005-12-22  Marek Safar  <marek.safar@seznam.cz>
795
796         * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
797
798 2005-12-21  Carlos Alberto Cortez <calberto.cortez@gmail.com>
799
800         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
801         errors 1726 for strong named assemblies with InternalsVisibleToAttribute 
802         that doesn't contain the full public key. This is a update of the
803         friend assemblies in .Net 2.0 release.
804         
805 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
806
807         Fix #76995
808
809         * namespace.cs (NamespaceEntry): Add extern_aliases as a
810         ListDictionary, to contain the ExternAliasEntry entries (in
811         addition to the NamespaceEntry.aliases hashtable). This field is
812         shared between the original entry and its doppelganger (bodyless 
813         copy of it).
814         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
815         extern_aliases field.
816         (NamespaceEntry.Lookup): Move the IsImplicit check after the
817         lookup in extern_aliases.
818
819 2005-12-16  Raja R Harinath  <rharinath@novell.com>
820
821         Fix #77006.
822         * class.cs (TypeContainer.Mark_HasEquals): New.
823         (TypeContainer.Mark_HasGetHashCode): New.
824         (ClassPart): Override them.
825         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
826
827         * generic.cs (GenericMethod.DefineMembers): Update to changes.
828         (TypeParameter.TypeParameter): Change type of 'parent' argument to
829         DeclSpace.
830
831         Fix #77008.
832         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
833         'parent' argument to the base constructor.
834
835         Remove all mention of TypeContainer from decl.cs.
836         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
837         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
838         (DeclSpace.DeclSpace): Likewise.
839         (DeclSpace.DefineMembers): Remove unused argument.
840         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
841         debugging check -- we don't care if the debug code throws an
842         InvalidCastException instead of an InternalErrorException.
843         * class.cs (TypeContainer.DefineMembers): Update to changes.
844         (TypeContainer.DoDefineMembers): Likewise.
845         (TypeContainer.GetMethods): Likewise.
846         (PropertyMember.Define): Likewise.
847         (MemberBase.Parent): New property that forwards to
848         MemberCore.Parent, but ensures that we get a TypeContainer.
849         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
850         (RootContext.PopulateTypes): Likewise.  Remove special case code
851         for !RootContext.StdLib: DefineMembers is idempotent.
852
853 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
854
855         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
856
857 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
858
859         * doc.cs : The search for referenced namespace was insufficient to
860           get global one as it used to do. Fixed bug #76965.
861
862 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
863
864         * doc.cs : check name in cref in the last phase that whether it is
865           namespace or not.
866
867 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
868
869         * cs-tokenizer.cs : reverted the latest change: it somehow broke
870           Mono.C5.
871
872 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
873
874         * doc.cs : so it turned out that we cannot skip override check for 
875           interface members. Fixed bug #76954.
876
877 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
878
879         * cs-tokenizer.cs : fixed bug #75984:
880           - #warning and #error should not be handled when the source line
881             is disabled.
882           - #line is not checked strictly when the source line is disabled.
883           - #define and #undef is on the other hand checked strictly at any
884             state.
885
886 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
887
888         * cs-tokenizer.cs : missing Location (actually, filename) in one of
889           CS1027 report.
890
891 2005-12-15  Raja R Harinath  <rharinath@novell.com>
892
893         * generic.cs (TypeManager.IsGeneric): Remove unused method.
894
895         * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
896         nested types.
897
898 2005-12-14  Martin Baulig  <martin@ximian.com>
899
900         * typemanager.cs (TypeManager.GetFullName): Make this public;
901         `Type.Fullname' now never returns null.
902
903         * class.cs (Method.Define): Use TypeManager.GetFullName() for
904         explicit interface implementations; we're now using the same
905         naming convention than csc does.
906
907 2005-12-14  Miguel de Icaza  <miguel@novell.com>
908
909         * convert.cs (ExplicitConversionCore): Check the return value from
910         ExplicitConversionCore which can return null on failure.  Fixes #76914
911
912 2005-12-09  Raja R Harinath  <rharinath@novell.com>
913
914         * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
915         instead of IsGenericInstance.
916         * generic.cs (TypeManager.IsEqual): Likewise.  Delete redundant
917         code that's now covered by the more general test.
918         * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
919
920         * generic.cs (DropGenericTypeArguments): New.  Captures the common
921         pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
922         * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
923         * generic.cs, report.cs, typemanager.cs: Likewise.
924
925 2005-12-08  Martin Baulig  <martin@ximian.com>
926
927         * generic.cs (TypeArguments.Resolve): Added CS1547 check.
928
929         * typemanager.cs (TypeManager.CSharpSignature): Include type
930         arguments in the signature of a generic method.
931
932 2005-12-07  Martin Baulig  <martin@ximian.com>
933
934         Add support for custom attributes on type parameters.
935
936         * cs-parser.jay (type_arguments): Added `opt_attributes'.
937
938         * generic.cs (TypeParameterName): New public class; we use this
939         instead of a `string' to store the name of a type parameter, so we
940         can also have `Attributes'.
941         (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
942         array instead of a `string[]' array.
943         (TypeParameter.ctor): We now also take an `Attributes' argument.
944         (TypeParameter.EmitAttributes): New public method; emit our
945         `OptAttributes' here.
946         (GenericMethod.EmitAttributes): New public method; emit the custom
947         attributes on all our type parameters.
948
949         * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
950         our type parameters.
951         (MethodData.Define): If we're a generic method, call
952         EmitAttributes() on it.
953
954 2005-12-07  Martin Baulig  <martin@ximian.com>
955
956         * generic.cs
957         (ConstraintChecker): New public abstract class; move the
958         constraint checking here from `ConstructedType' and also do
959         constraint checking for generic methods here.
960
961         * expression.cs (Invocation.OverloadResolve): Use
962         ConstraintChecker.CheckConstraints() if we resolved to a generic
963         method.  Fix #76806.
964
965 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
966
967         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
968
969         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
970         event initializers.
971         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
972         (FieldBase.Initializer): Initializer is now optional.
973         (EventField.Define): Only event field can have initializer.
974
975         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
976
977         * const.cs (Const): Reuse initializer.
978
979         * cs-parser.jay: Updated after FieldBase changes.
980         Added current_array_type to simplify array initializers.
981
982         * ecore.cs (NullCast.IsDefaultValue): Implemented.
983
984         * expression.cs, iterators.cs: Updated.
985
986         * namespace.cs (NamespaceEntry): Made UsingFound private.
987
988 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
989
990         * parameterCollection.cs: Obsolete, removed.
991         * parser.cs: Obsolete, removed.
992
993 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
994
995         Fix #76849.
996         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
997
998         * enum.cs (Enum.Define): Set obsolete context here.
999
1000 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1001
1002         * doc.cs :
1003           - FindDocumentedMember() now expects 1) paramList as null
1004             when "we don't have to check the number of parameters" and
1005             2) Type.EmptyTypes when "there is no arguments".
1006           - Introduced FoundMember struct to hold the exact type which was
1007             used to find the documented member (the above change broke
1008             test-xml-044; it might be better just to use DeclaringType than
1009             what MS does, like this change does, but it depends on usage.)
1010
1011 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1012
1013         * doc.cs : documented member might be from DeclaringType for nested
1014           types. Fixed bug #76782.
1015
1016 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
1017
1018         * anonymous.cs: Have the param code handle leaving copies on the
1019         stack etc. Allows anonymous params to take part in the assignment
1020         code (++, +=, etc). Fixes bug #76550
1021
1022         * expression.cs: Handle the prepare_for_load/leave_copy by passing
1023         it down to the anon code.
1024
1025         * iterators.cs: Use dummy var here
1026
1027         * codegen.cs: Handle new vars
1028
1029 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1030
1031         Fix #76849.
1032         * class.cs (MethodData.Define): Set proper Obsolete context.
1033
1034         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1035         obsolete context.
1036         (FieldExpr.DoResolve): Ditto.
1037
1038 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1039
1040         Fix #76849.
1041         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1042         parent is not obsolete.
1043
1044 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
1045
1046         * doc.cs : (FindDocumentedMember) find parameterless members first
1047           and get CS0419 in the early stage. Fixed first case of bug #76727.
1048
1049 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
1050
1051         Fix #76859.
1052         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1053         no error was reported.
1054
1055         *expression.cs (Binary.DoResolve): left can be null.
1056
1057 2005-12-06  Raja R Harinath  <rharinath@novell.com>
1058
1059         * class.cs (MethodCore.CheckGenericOverride): Delete unused
1060         abstract method and all overrides.
1061         * support.cs (ParameterData.GenericConstraints): Delete.
1062         (ReflectionParameters.type_params): Delete.
1063         (ReflectionParameters.ReflectionParameters): Make private.
1064         (ReflectionParameters.GetConstaints): New factory method.
1065         * generic.cs (TypeParameterDefineType): Use it.
1066         (TypeManager.GetTypeParameterConstraints): Likewise.
1067
1068 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
1069
1070         Fix #76783.
1071         * class.cs (MethodData.Emit): Parameters should be labeled first.
1072
1073 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
1074
1075         Fix #76761.
1076         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1077
1078 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
1079
1080         * attribute.cs (AreParametersCompliant): Moved to Parameter.
1081
1082         * class.cs (MethodCore): Parameter clean up.
1083         (IMethodData): Added ParameterInfo.
1084         (MethodData): Parameter clean up.
1085         (Indexer.Define): Parameter clean up.
1086
1087         * anonymous.cs,
1088         * codegen.cs,
1089         * cs-parser.jay,
1090         * decl.cs,
1091         * doc.cs,
1092         * ecore.cs,
1093         * flowanalysis.cs,
1094         * iterators.cs,
1095         * pending.cs,
1096         * statement.cs,
1097         * typemanager.cs: Parameter clean up.
1098
1099         * delegate.cs (Define): Get rid of duplicated code.
1100
1101         * expression.cs (ParameterReference): Removed useless parameters
1102         and simplified.
1103         (Invocation): Ditto.
1104
1105         * parameter.cs (ParamsParameter): New class, params specialization.
1106         (ArglistParameter): Attemp to separate arglist.
1107         (Parameter): Refactored to be reusable and faster.
1108         (Parameter.Modifier): Made understandable.
1109         (Parameters): Changed to be used as a class for `this' assembly
1110         parameters. Refactored to use new specialized classes.
1111
1112         * support.cs (ParameterData): Added Types property.
1113         (InternalParameters): Deleted.
1114
1115 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1116
1117         * doc.cs : the previous patch does not actually fix the bug.
1118           PropertyInfo override check is now implemented and really fixed it.
1119         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
1120
1121 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1122
1123         * doc.cs : apply "override filter" also to properties.
1124           Fixed bug #76730.
1125
1126 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1127
1128         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
1129           no need to check overrides. For classes, omit those results from 
1130           interfaces since they must exist in the class. Fixed bug #76726.
1131
1132 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1133
1134         * typemanager.cs : (GetFullNameSignature) differentiate indexers
1135           with different parameters. Fixed the second problem in #76685.
1136
1137 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1138
1139         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
1140           get expected 'protected' access in CheckValidFamilyAccess()).
1141           Fixed bug #76692.
1142
1143 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1144
1145         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
1146           Fixed bug #76705.  CS1569 was incorrectly commented out.
1147
1148 2005-11-23  Martin Baulig  <martin@ximian.com>
1149
1150         * generic.cs (Constraints.Define): Removed.
1151         (TypeParameter.DefineConstraints): Removed.
1152         (TypeParameter.DefineType): Call SetGenericParameterAttributes()
1153         on the GenericTypeParameterBuilder here.
1154
1155 2005-11-23  Martin Baulig  <martin@ximian.com>
1156
1157         * typemanager.cs (TypeManager.GetProperty): Make this public.
1158
1159         * generic.cs (Nullable.NullableInfo.ctor): Use
1160         TypeManager.GetProperty() rather than using reflection directly.
1161
1162 2005-11-17  Martin Baulig  <martin@ximian.com>
1163
1164         * expression.cs (Indexers.GetIndexersForType): Added support for
1165         generic parameters; fixes #76587.
1166
1167 2005-11-17  Martin Baulig  <martin@ximian.com>
1168
1169         * anonymous.cs
1170         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
1171         inherit the scope from our parent.  Fixes #76653.
1172
1173 2005-11-15  Martin Baulig  <martin@ximian.com>
1174
1175         * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
1176         instead of `ScopeTypeBuilder' to refer to the "current" type.
1177         (AnonymousMethod.CreateScopeType): Correctly create the helper
1178         class if we're inside a generic type definition.
1179
1180 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1181
1182         * doc.cs : use Invocation.IsOverride() to do real override check.
1183         * expression.cs : made Invocation.IsOverride() internal.
1184
1185 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1186
1187         * doc.cs : use TypeManager.FindMembers() instead of (possible)
1188           TypeBuilder.FindMembers() and filter overriden base members out.
1189           Fixed bug #76990.
1190
1191 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1192
1193         * doc.cs : ref/out parameters are represented as '@' (instead of
1194           '&' in type FullName). Fixed bug #76630 (additionally crefs).
1195
1196 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1197
1198         * doc.cs : when there was no '.' in cref to methods in doc comment,
1199           then parameters were missing in the output. Fixed bug #76691.
1200
1201 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1202
1203         * driver.cs : don't output docs when there is an error.
1204           Fixed bug #76693.
1205
1206 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1207
1208         * doc.cs :
1209           Now it should detect indexers. Fixed primary concern in bug #76685.
1210           Fixed CS0419 message to not show the identical member signature in
1211           the message.
1212
1213 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1214
1215         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
1216           instead of Type.FindMembers() since it does not handle events.
1217           Fixed bug #71604.
1218
1219 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
1220
1221         * codegen.cs: Fixed typo (speficied -> specified).
1222
1223 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1224
1225         Fix #76369.
1226         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
1227
1228 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1229
1230         * attribute.cs: Changed error message.
1231
1232         * cs-tokenizer.cs: One more check.
1233
1234 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1235
1236         * statement.cs (Block.Resolve): Ignore empty statement.
1237
1238 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1239
1240         * report.cs: Made error/warning methods more strict to avoid
1241         their misuse.
1242
1243         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
1244         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
1245         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
1246         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
1247
1248 2005-11-11  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1249
1250         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): 
1251         Use the more explicit AssemblyName.FullName instead of 
1252         AssemblyName.Name to report errors.
1253         
1254 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1255
1256         * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
1257         with mcs.
1258
1259 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1260
1261         * class.cs,
1262         * convert.cs,
1263         * cs-parser.jay,
1264         * decl.cs,
1265         * enum.cs,
1266         * expression.cs,
1267         * generic.cs,
1268         * pending.cs,
1269         * report.cs: Fixed error reporting and typos.
1270
1271         * generic.cs (TypeParameter.GetSignatureForError): New method.
1272         (ConstructedType.GetSignatureForError): Instead of DeclarationName.
1273
1274         * typemanager.cs (GetFullName): Refactored.
1275
1276 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
1277
1278         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
1279         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
1280
1281         * class.cs (TypeContainer.IsComImport): New property.
1282         (Constructor.Define): Create proper ctor for ComImport types.
1283
1284         * expression.cs (New.CheckComImport): Fixed.
1285
1286 2005-11-07  Miguel de Icaza  <miguel@novell.com>
1287
1288         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
1289         that a parameter has been captured does not mean that we do not
1290         have to do the rest of the processing.  This fixes the second part
1291         of #76592.  If there was another anonymous method capturing
1292         values in the past, the Scope would never be set for the second
1293         method that captured the same parameter.
1294
1295         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
1296         properly manipulate the stack.   Second part of fix for #76592.
1297
1298         * expression.cs (New): Add support for invoking "new" on
1299         interfaces that have been flagged with the ComImport attribute and
1300         the CoClass.  Fixes #76637 
1301
1302         * statement.cs (Try.DoEmit): When a variable is captured, do not
1303         try to emit the vi.LocalBuilder variable as it has been captured.
1304         Create a temporary variable and store the results on the
1305         FieldBuilder.  Fixes #76642
1306
1307 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1308
1309         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
1310
1311         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
1312
1313         * expression.cs (Binary.DoResolve): Added && optimalization.
1314     
1315         * typemanager.cs (AddUserType): Removed useless argument.
1316
1317 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
1318
1319         * statement.cs (Block.variables): Uses ListDictionary.
1320
1321 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1322
1323         Fix #75969.
1324         * class.cs (PartialContainer.EmitType): Customized to emit
1325         security attributes.
1326         (ClassPart.ApplyAttributeBuilder): Transform security attribute
1327         for partial classes.
1328
1329 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1330
1331         Fix #76599.
1332         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
1333         access has to be fixed.
1334         
1335         * typemanager.cs (IsUnmanagedType): Wrong common field type.
1336
1337 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
1338
1339         Fix #76590.
1340         * ecore.cs (NullCast.Reduce): Implemented.
1341
1342         * expression.cs (ArrayCreation.CheckIndices): Correcly check
1343         constant type.
1344         
1345         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
1346         properly.
1347         (Foreach.Resolve): Catch null properly.
1348
1349 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1350  
1351         * cs-tokenizer.cs: Warning text fix.
1352
1353         * driver.cs: AllWarningNumbers exposed on public interface.
1354
1355         * report.cs (): Reviewed warning numbers.
1356         (IsValidWarning): Use binary search.
1357
1358 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1359  
1360         * driver.cs: Implemeted resource visibility.
1361         (Resources): New class for code sharing between /res: and
1362         /linkres:
1363  
1364 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1365
1366         decl.cs (CurrentTypeParameters): Fixed to be public.
1367
1368 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1369
1370         generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
1371
1372 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1373
1374         gmcs.exe.sources: Use CryptoConvert.cs from corlib.
1375
1376 2005-11-05  Kornél Pál  <kornelpal@hotmail.com>
1377
1378         * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
1379
1380 2005-11-04  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1381
1382         Add friend assembly access support.
1383         * typemanager.cs: assembly_internals_vis_attrs
1384         cache for friend assembly access. 
1385         (TypeManager.IsFriendAssembly): New method for
1386         checking friend assembly access.
1387         (TypeManager.Error_FriendAccessNameNotMatching): New
1388         helper method.
1389         (TypeManager.CompareKeyTokens): Likewise.
1390         (TypeManager.Filter): Handle friend accessible
1391         members.
1392
1393         * namespace.cs (RootNamespace.GetTypeInAssembly): Return
1394         friend accessible types.
1395
1396         * ecore.cs (Expression.IsAccessorAccessible): Handle
1397         friend accessible properties.
1398
1399         * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
1400         accessible types.
1401         
1402 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
1403
1404         Fix #76568.
1405         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
1406         folding.
1407         
1408         * convert (Convert.ImplicitReferenceConversion): NullCast holds
1409         contants only.
1410         
1411         * ecore.cs (NullCast): Child is contant only.
1412         
1413         * literal.cs (NullLiteral.Reduce): null can be converted to any
1414         reference type.
1415
1416 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
1417
1418         * driver.cs: Use Encoding.Default as default code page instead
1419           of ISO-28591.
1420
1421 2005-10-27  Raja R Harinath  <rharinath@novell.com>
1422
1423         Fix #76085.
1424         * expression.cs (Invocation.Error_InvalidArguments): Handle
1425         __arglist parameters.
1426         (Invocation.VerifyArgumentsCompat): Likewise.
1427         * support.cs (ReflectionParameters.GetSignatureForError): Print
1428         __arglist parameters.
1429         (InternalParamters.GetSignatureForError): Likewise.
1430         * parameter.cs (Parameters.GetSignatureForError): Likewise.
1431
1432 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
1433
1434         * attribute.cs (GetPropertyValue): Made public.
1435
1436         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
1437         Resolve.
1438         Add new property WrapNonExceptionThrows to handle 2.0 assembly
1439         attribute.
1440         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
1441         is not defined.
1442         
1443         * driver.cs: Reflect method name change.
1444         
1445         * statement.cs (Try.Resolve): Warn when try has both general
1446         exception handlers.
1447         
1448         * typemanager.cs: runtime_compatibility_attr_type new predefined
1449         type.
1450
1451 2005-10-26  Raja R Harinath  <harinath@gmail.com>
1452
1453         Fix #76419.
1454         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
1455         treat it as an empty parameter list.
1456
1457 2005-10-26  Raja R Harinath  <rharinath@novell.com>
1458
1459         Fix #76271.     
1460         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
1461         ResolveAsTypeStep silent.
1462         * statement.cs (Block.AddConstant): Mark block as used.
1463         (Block.ResolveMeta): Avoid piling on error messages
1464         if a constant initializer resolution fails.
1465
1466 2005-10-25  Raja R Harinath  <rharinath@novell.com>
1467
1468         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
1469         Remove.
1470         (NamespaceEntry.VerifyAllUsing): New.
1471         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
1472         behaviour.  Delegates actual resolution of alias to ...
1473         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
1474         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
1475         Update.
1476         * driver.cs (Driver.MainDriver): Update.
1477         
1478         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
1479         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
1480         property.
1481         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
1482         Remove.
1483         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
1484         RootNamespace.DefineNamespacesForAll.
1485
1486 2005-10-24  Raja R Harinath  <harinath@gmail.com>
1487
1488         * typemanager.cs (assemblies, external_aliases, modules)
1489         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
1490         (ComputeNamespaces, GetRootNamespace): Remove extra staging
1491         overhead.  Move resposibility ...
1492         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
1493         * driver.cs, attribute.cs, codegen.cs: Update to changes.
1494
1495 2005-10-23  Raja R Harinath  <harinath@gmail.com>
1496
1497         * namespace.cs (RootNamespace.all_namespaces): Renamed from
1498         cached_namespaces.  Improve usage.
1499         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
1500         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
1501         Move from GlobalRootNamespace and simplify.
1502         (RootNamespace.Global): Make instance variable.
1503         (RootNamespace.RootNamespace): Add "alias name" parameter.
1504         (GlobalRootNamespace): Simplify drastically.
1505         (Namespace.Lookup): Don't use GetNamespace.
1506         * typemanager.cs (GetRootNamespace): Rename from
1507         ComputeNamespaceForAlias.
1508         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
1509
1510 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1511
1512         * anonymous.cs (AnonymousContainer): Don't crash when container
1513         doesn't exist.
1514
1515 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1516
1517         * expression.cs (Binary.DoResolve): Warn when comparing same
1518         values.
1519
1520 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1521
1522         Fix #76486.
1523         * expression.cs (Binary.DoResolve): It looks like there are no
1524         convetsion rules in enum context.
1525
1526 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1527
1528         Add support for extern alias qualifiers.
1529         * typemanager.cs: Move some LookupTypeReflection code
1530         to namespace.cs, to have cleaner code. Added some methods
1531         to help us keep track of the extern aliased references.
1532         * driver.cs: Add suport for extern alias assemblies on command
1533         line and check for their warnings/errors. Also keep track of the
1534         extern aliased assemblies.
1535         * namespace.cs: Move the global functionality of Namespace
1536         to GlobalRootNamespace/RootNamespace. Now the global namespace
1537         is GlobalRootNamespace.Globa. Also the code moved from 
1538         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
1539         Finally added LocalAliasEntry (AliasEntry before) and
1540         ExternAliasEntry, to handle alias statements.
1541         * cs-parser.jay: Add support in the grammar for extern alias
1542         statement.
1543         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
1544         Update callings to Namespace (now in GlobalRootNamespace).
1545
1546 2005-10-25  Martin Baulig  <martin@ximian.com>
1547
1548         * convert.cs (ImplicitTypeParameterConversion): Make base
1549         interfaces actually work; fixes #76557.
1550
1551 2005-10-25  Martin Baulig  <martin@ximian.com>
1552
1553         * generic.cs
1554         (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
1555         all the type parameters; fixes #76551.
1556
1557 2005-10-25  Martin Baulig  <martin@ximian.com>
1558
1559         Fix #76472.
1560
1561         * generic.cs
1562         (GenericMethod.ctor): Added `Expression return_type' and
1563         `Parameters parameters' arguments.
1564         (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
1565         parameter and return types to check their constraints if they're
1566         generic types.
1567
1568         * codegen.cs (EmitContext.ResolvingGenericMethod): New public
1569         boolean field.
1570
1571         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
1572         constraints of a generic type if `ec.ResolvingGenericMethod'.
1573
1574         * class.cs (MethodCore.DoDefineParameters): Set
1575         `ec.ResolvingGenericMethod' if we're a generic method.
1576         (MemberBase.MemberType): Likewise.
1577
1578 2005-10-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1579
1580         * typemanager.cs (TypeManager): Added 
1581         TypeManager.internals_visible_attr_type to cache
1582         S.R.CompilerServices.InternalsVisibleToAttribute.
1583
1584         * codegen.cs (AssemblyClass): Added checks for 
1585         InternalsVisibleToAttribute in new method 
1586         CheckInternalsVisibleAttribute () and also cache the
1587         AssemblyName in AssemblyClass.Name.
1588         
1589 2005-10-24  Martin Baulig  <martin@ximian.com>
1590
1591         * typemanager.cs
1592         (TypeManager.ExpandInterfaces): Added overloaded version which
1593         just takes a `Type[]' array.
1594
1595         * generic.cs
1596         (Constraints.Resolve): Don't expand the interfaces here; ie. we
1597         just use the interfaces which were explicitly specified and not
1598         the interfaces they inherit.  Fixes #76482.
1599         (TypeParameter.FindMembers): Expand the interfaces here.
1600
1601 2005-10-21  Martin Baulig  <martin@ximian.com>
1602
1603         * generic.cs
1604         (Constraints.Resolve): Also resolve the actual types here.
1605         (Constraints.ResolveTypes): Just check the constraints here.
1606         Fixes #76363; see gtest-218.cs.
1607
1608 2005-10-21  Martin Baulig  <martin@ximian.com>
1609
1610         * convert.cs
1611         (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
1612         instead of a `BoxedCast'; fixes gtest-217.cs.
1613
1614 2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
1615
1616         * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
1617           1) "new()" is specified as generic parameter constraint and 2) the
1618           type is TypeBuilder and 3) the type is abstract even if it has a
1619           default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
1620
1621 2005-10-20  Martin Baulig  <martin@ximian.com>
1622
1623         * generic.cs
1624         (GenericConstraints.TypeParameter): New public property.
1625         (TypeParameter.ctor): Also take a `DeclSpace' argument.
1626         (TypeParameter.DeclSpace): New public property.
1627         (TypeParameter.DefineType): Inflate the constraints if our
1628         `DeclSpace' is an `Iterator'.   
1629
1630 2005-10-19  Atsushi Enomoto  <atsushi@ximian.com>
1631
1632         * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added 
1633           GenericMethod argument to compare methods' generic type arguments.
1634           Fixed bug #76382.
1635
1636 2005-10-19  Martin Baulig  <martin@ximian.com>
1637
1638         * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
1639         not ResolveType() when resolving the base type, so we're not
1640         checking the constraints here.
1641         (TypeContainer.ResolveType): Call ResolveType() on our base_type
1642         if we have any.
1643
1644 2005-10-19  Martin Baulig  <martin@ximian.com>
1645
1646         * generic.cs (ConstructedType.CheckConstraints): Committing
1647         untested fix for #76441.
1648
1649 2005-10-18  Raja R Harinath  <rharinath@novell.com>
1650
1651         Fix #76371.
1652         * class.cs (TypeContainer.DefineType): Move updating of
1653         topological sort earlier in the code.
1654         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
1655
1656 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
1657
1658         Fix #76273.
1659         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
1660         
1661         * constant.cs (Constant.TryReduce): Moved from Cast class.
1662         (Reduce): Made little bit more OO and fixed missing conversions.
1663         
1664         * ecore.cs (Reduce): Implemented.
1665         (Binary.EnumLiftUp): New method to upgrade values to enum values.
1666         
1667         * literal.cs (Reduce): Implemented.
1668         
1669         * class.cs: Reverted Miguel's wrong commit.
1670
1671 2005-10-14  Miguel de Icaza  <miguel@novell.com>
1672
1673         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
1674
1675 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
1676
1677         * cs-parser.jay, expression.cs : CS0214 was missing error location
1678           for constants. Fixed bug #76404.
1679
1680 2005-10-10  Raja R Harinath  <rharinath@novell.com>
1681
1682         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
1683         InstanceExpression.
1684         (PropertyExpr.EmitCall): Likewise.
1685         * expression.cs (Invocation.EmitArguments): Handle case where
1686         arguments == null.
1687         (Invocation.EmitCall): Avoid allocating temporary variable if
1688         there are no arguments.
1689
1690 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
1691
1692         Fix #76370.
1693         * convert.cs (ExplicitConversionCore): Fixed object->enum
1694         conversion.
1695
1696 2005-10-07  Raja R Harinath  <rharinath@novell.com>
1697
1698         Fix #76323.
1699         * convert.cs (ImplicitConversionStandard): Move conversion of
1700         void* to arbitrary pointer types ...
1701         (ExplicitConversionStandard): .. here.
1702         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
1703         error to always print typenames.
1704
1705 2005-10-07  Raja R Harinath  <rharinath@novell.com>
1706
1707         * convert.cs (GetConversionOperator): Rename from
1708         GetConversionOperators.  Move operator selection code from ...
1709         (UserDefinedConversion): ... here.
1710
1711 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
1712
1713         * convert.cs (ExplicitConversionCore): Removed duplicate enum
1714         conversion.
1715
1716 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
1717
1718         * assign.cs (Assign.DoResolve): Error method changed.
1719
1720         * cfold.cs (DoConstantNumericPromotions): Error method changed.
1721         
1722         * const.cs (ResolveValue): Reset in_transit immediately.
1723         
1724         * constant.cs: Error method changed.
1725         
1726         * convert.cs: Removed useless location parameter.
1727         (ExplicitNumericConversion): Don't do double enum check.
1728         (ExplicitConversionCore): Renamed from ExplicitConversion.
1729         (ExplicitUnsafe): Extracted from ExplicitConversion.
1730         (ExplicitConversion): Uses for error reporting.
1731         
1732         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
1733         error messages.
1734         (ResolveBoolean): Uses common error method.
1735         (CastToDecimal): Get rid of ec.
1736         (CastFromDecimal): Optimized.
1737         (ConvCast): Get rid of ec.
1738         
1739         * enum.cs (ResolveValue): Reset in_transit immediately.
1740         (Emit): Return after first error.
1741         
1742         * expression.cs: Convert changes.
1743         
1744         * literal.cs: Error method changed.
1745         
1746         * statement.cs: Error method changed.
1747
1748 2005-10-06  Raja R Harinath  <rharinath@novell.com>
1749
1750         Fix gtest-131.cs and gtest-211.cs.
1751         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
1752         Only emit code for a label if it is used.  Unreachable code can
1753         violate ECMA evaluation stack invariants.
1754
1755 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
1756
1757         * anonymous.cs: Implemented ExprClassName.
1758         
1759         * assign.cs (Assign.DoResolve): Don't chrash when type is not
1760         delegate.
1761         
1762         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
1763         check.
1764         
1765         * class.cs (StaticClass.DefineContainerMembers): Report protected
1766         members as error.
1767         
1768         * codegen.cs: if(ed) PRODUCTION.
1769         
1770         * convert.cs (Error_CannotImplicitConversion): Better error
1771         distinction.
1772         
1773         * cs-parser.jay: More error checks.
1774         
1775         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
1776         
1777         * driver.cs (CSCParseOption): Enabled wrong option check.
1778         
1779         * ecore.cs (Expression.ExprClassName): Turned to property.
1780         (MemberExpr.CheckIntermediateModification): For checking boxed
1781         value types     modification.
1782         
1783         * statement.cs (Fixed.Resolve): Expression type must be
1784         convertible to fixed type.
1785         (CollectionForeach.GetEnumeratorFilter,TryType):
1786         Small refactoring for easier error checking.
1787
1788 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
1789
1790         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
1791         attributes.
1792         
1793         * class.cs (GeneratedBaseInitializer): New class for customization
1794         compiler generated initializers.
1795         (MemberBase.DoDefine): Check Obsolete attribute here.
1796         (FieldMember.DoDefine): Ditto.
1797         
1798         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
1799         constants.
1800         
1801         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
1802         (MemberCore.GetObsoleteAttribute): Removed argument.
1803         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
1804         (MemberCore.CheckObsoleteType): New helper.
1805         
1806         * delegate.cs,
1807         * enum.cs,
1808         * statement.cs: Updates after MemberCore changes.
1809         
1810         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
1811         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
1812         
1813         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
1814         obsolete attribute for compiler construct.
1815         (As.DoResolve): Cache result.
1816         
1817         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
1818
1819 2005-10-01  Miguel de Icaza  <miguel@novell.com>
1820
1821         * expression.cs (Probe): instead of having a "Type probe_type"
1822         keep the extra information as a TypeExpr probe_type_expr since the
1823         "As" operator needs to perform some type checks.
1824
1825         * (As.DoResolve): If the type is a type parameter, ensure that it
1826         is constrained by a class.
1827
1828 2005-09-22  Miguel de Icaza  <miguel@novell.com>
1829
1830         * statement.cs (Lock): Use the TemporaryVariable class instead of
1831         manually using local variables as those do not work when variables
1832         are captured.
1833
1834         * ecore.cs: Moved the TemporaryVariable class from being a nested
1835         class inside Foreach to be a public class that can be employed in
1836         other places. 
1837
1838 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
1839
1840         * cs-parser.jay: interface_accessors replaced by
1841         accessor_declarations.
1842
1843         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
1844         location.
1845         
1846         * statement.cs (GotoCase.Resolve): Convert null constant to
1847         null case.
1848         (SwitchLabel.ResolveAndReduce): Ditto.
1849         (SwitchLabel.NullStringCase): Custom null stamp.
1850         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
1851         
1852         typemanager.cs (CSharpSignature): Don't skip first argument
1853         for full names.
1854
1855 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
1856
1857         * cfold.cs, constant.cs, convert.cs, ecore.cs,
1858         expression.cs, iterators.cs, literal.cs: Store constants and
1859         literals location.
1860         
1861         * class.cs (MemberBase.ShortName): Pass location.
1862         
1863         * cs-parser.jay: Some location fixes.
1864         
1865         * ecore.cs (Expression.Location): Made virtual.
1866
1867 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
1868
1869         Fix #72930.
1870         * const.cs (Const.ResolveValue): Check for assigning non-null
1871         value to reference type.
1872
1873 2005-09-26  Raja R Harinath  <rharinath@novell.com>
1874
1875         Fix #76133.
1876         * expression.cs (This.VerifyFixed): In a value type T, the type of
1877         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
1878         value type R, 'this' is treated as a value parameter.
1879
1880 2005-09-05  Miguel de Icaza  <miguel@novell.com>
1881
1882         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
1883         if the underlying types are the same, otherwise we need to produce
1884         code that will do the proper cast.
1885
1886         This was exposed by Marek's constant rewrite which produced
1887         invalid code for the call site:
1888
1889         enum X : long { a }
1890         void Method (X v) {}
1891
1892         Method ((X) 5)
1893
1894         This fixes test-49.cs
1895
1896 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
1897
1898         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
1899           Type/Object should be allowed as well. Fixed bug #75968.
1900
1901 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
1902
1903         * expression.cs : (Binary.DoResolve): when one is enum constant and
1904           another is constant 0, then return enum one *as enum type*.
1905           Fixed bug 74846.
1906
1907 2005-10-04  Martin Baulig  <martin@ximian.com>
1908
1909         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
1910         `SetMemberIsUsed()' work for generics, too.
1911
1912 2005-10-04  Martin Baulig  <martin@ximian.com>
1913
1914         * expression.cs (DelegateInvocation.EmitStatement): Make this work
1915         for corlib.  Fixes #75691.
1916
1917 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
1918
1919         Fix #76255.
1920         * driver.cs: Fix compilation files with full root path.
1921
1922 2005-09-25  Miguel de Icaza  <miguel@novell.com>
1923
1924         * report.cs (SymbolRelatedToPreviousError): Format the output so
1925         it does not use an open parenthesis that is never closed. 
1926
1927         * driver.cs: Follow coding guidelines
1928
1929 2005-09-18  Miguel de Icaza  <miguel@novell.com>
1930
1931         * driver.cs: Set InEmacs based on the environment variable EMACS. 
1932
1933         * location.cs (InEmacs): in this mode, do not report column
1934         location as it confuses Emacs.
1935
1936 2005-10-03  Raja R Harinath  <rharinath@novell.com>
1937
1938         * support.cs (SeekableStreamReader.Position): Don't error out when
1939         the requested position is just beyond the end of the current
1940         buffered data.
1941
1942 2005-09-28  Raja R Harinath  <rharinath@novell.com>
1943
1944         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
1945         try to keep in sync with the byte count of the underlying Stream.
1946         However, this limits us to a window size of 2048 characters: i.e.,
1947         the maximum lookahead of our lexer/parser can be 2048 characters.
1948
1949 2005-09-22  Martin Baulig  <martin@ximian.com>
1950
1951         * driver.cs: Removed a debugging FIXME.
1952
1953 2005-09-21  Raja R Harinath  <rharinath@novell.com>
1954
1955         * cs-parser.jay (type_arguments): Add CS1644 check.
1956         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
1957
1958 2005-09-15  Raja R Harinath  <rharinath@novell.com>
1959
1960         * Makefile (PROGRAM): Make profile specific.
1961         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
1962         the current directory.
1963
1964         Fix test-455.cs.
1965         * expression.cs (Invocation.EmitCall): Remove optimization on
1966         this_call since it doesn't handle 'this' being a value type.
1967
1968 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
1969
1970         * driver.cs: Ensure file handles are closed after parsing
1971
1972 2005-09-05  Miguel de Icaza  <miguel@novell.com>
1973
1974         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
1975         if the underlying types are the same, otherwise we need to produce
1976         code that will do the proper cast.
1977
1978         This was exposed by Marek's constant rewrite which produced
1979         invalid code for the call site:
1980
1981         enum X : long { a }
1982         void Method (X v) {}
1983
1984         Method ((X) 5)
1985
1986         This fixes test-49.cs
1987
1988 2005-09-05  Martin Baulig  <martin@ximian.com>
1989
1990         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
1991         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
1992
1993         * cs-parser.jay (delegate_declaration): Small fix for #75852.
1994
1995 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
1996
1997         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
1998           to be a pointer type due to the spec 25.2, so check if declaring
1999           type is generic type definition. Fixed bug #75772.
2000
2001 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2002
2003         Fixed bug #75957.
2004         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
2005           both types are not defined by methods.
2006         * expression.cs : (Invocation.IsApplicable): it should work when
2007           the argument type is equal to the parameter type, not only when
2008           ImplicitConversionExists() returns true.
2009
2010 2005-09-02  Raja R Harinath  <rharinath@novell.com>
2011
2012         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2013         internal.
2014
2015         Fix #75941.
2016         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2017         flow-branching for LocalVariableReferences in case we were invoked
2018         from a MemberAccess.
2019         * expression.cs (LocalVariableReference.VerifyAssigned): New.
2020         Carved out of ...
2021         (LocalVariableReference.DoResolveBase): ... this.
2022         (MemberAccess.Resolve): Do the check that was disabled during
2023         SimpleNameResolve.
2024
2025 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2026
2027         * class.cs :
2028           (PartialContainer.Create): check abstract/sealed/static strictly
2029           but abstract/sealed can exist only at one side. Fixed bug #75883.
2030
2031 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
2032
2033         Fix #75945.
2034         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2035         specified, don't default to UnmanagedType.I4.
2036
2037 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2038
2039         * expression.cs : conditional operator should check possibly
2040           incorrect assign expression. Fixed bug #75946.
2041
2042 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2043
2044         Fix #75934.
2045         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2046         (ScopeInfo.EmitScopeType): Use it to construct field names from
2047         names of captured locals.
2048
2049         Fix #75929.
2050         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2051         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2052         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
2053         (ExplicitConversion): Remove enum cases already handled by
2054         implicit conversion.  Move implicit conversion check to the beginning.
2055         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2056         * expression.cs (ArrayCreation.EmitDynamicInitializers):
2057         Don't treat System.Enum as a struct.
2058
2059 2005-08-30  Jb Evain  <jbevain@gmail.com>
2060
2061         * attribute.cs: handles as expression in parameters.
2062
2063 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2064
2065         Fix #75802.
2066         * class.cs (TypeContainer.VerifyClsName): Don't use a
2067         PartialContainer when verifying CLS compliance.
2068         (AbstractPropertyEventMethod): Set Parent here, ...
2069         (PropertyMethod): ... not here.
2070
2071 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
2072
2073         * attribute.cs : escaped attribute name should not be allowed to be
2074           resolved (e.g. @class as classAttribute). Fixed bug #75930.
2075
2076 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2077
2078         Fix #75927.
2079         * convert.cs (ImplicitStandardConversionExists): Allow zero also
2080         when converting a long constant to unsigned long.
2081         * expression.cs (Invocation.OverloadResolve): Add sanity check to
2082         detect where IsApplicable and VerifyArgumentsCompat disagree.
2083
2084 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2085         and Carlos Alberto Cortez  <carlos@unixmexico.org>
2086
2087         Fix #75848.
2088         * class.cs (TypeContainer.CanElideInitializer): New helper.
2089         (TypeContainer.EmitFieldInitializers): Use it to determine if we
2090         can safely emitting the initializer of a field.
2091
2092 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2093
2094         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2095           allowed inside a switch (without loop). Fixed bug #75433.
2096
2097 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
2098
2099         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2100         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2101
2102 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2103
2104         * driver.cs : kinda reverting the default encoding changes (not exact 
2105           revert since I noticed that "codepage:reset" might not work fine).
2106
2107 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2108
2109         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2110           Location. Now getter and setter store location correctly.
2111           (errors/cs0111-12.cs now reports the expected location.)
2112
2113 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2114
2115         * driver.cs : Use default encoding on the environment.
2116           Removed (now that) extra parameter for SeekableStreamReader.
2117         * support.cs : (SeekableStreamReader) third .ctor() argument for
2118           StreamReader is not required (always true). preamble size could
2119           be acquired in simpler and safe way.
2120
2121 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
2122
2123         * cs-parser.jay: report CS0642 at warning level 3
2124           and report CS0642 for an if else statement also
2125           fixes bug #74745. Patch by John Luke (and a bit
2126           modified by me).
2127           Removed extra CS0642 warning check for "while",
2128           "for" and "fixed".
2129         * statement.cs: In Block.Resolve(), CS0642 check
2130           is reimplemented to check a sequence of an empty
2131           statement and a block.
2132
2133           Both fix bug #66777.
2134
2135 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
2136
2137         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2138         detection until I fix it.
2139         
2140         * cs-tokenizer.cs: Changed error message.
2141         
2142         * cs-parser.jay: Fixed 2 error locations.
2143         
2144         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2145         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2146         properties.
2147         
2148         * enum.cs (GetSignatureForError): Fixed.
2149         
2150         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2151         method detection.
2152         
2153         * class.cs,
2154         * typemanager.cs (RegisterProperty): Removed.
2155         
2156         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2157
2158 2005-08-24  Raja R Harinath  <rharinath@novell.com>
2159
2160         Fix #75874.
2161         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2162         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2163
2164 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2165
2166         * expression.cs : tiny fix is required for not warning positive ulong.
2167           See test-441.cs.
2168
2169 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2170
2171         * expression.cs : add CS0652 check for constant and integral
2172           expression. Fixed bug #53974.
2173
2174 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2175
2176         * expression.cs : in DoNumericPromotions(), check if there is implicit
2177           conversion overload for string (to check CS0034). Fixed bug #52492.
2178
2179 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2180
2181         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2182
2183 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2184
2185         * ecore.cs : report location when it is *not* Null.
2186
2187 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2188
2189         * codegen.cs,
2190           ecore.cs,
2191           flowanalysis.cs,
2192           expression.cs:
2193           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2194           correctly. Fixed bug #75721.
2195
2196 2005-08-23  Raja R Harinath  <rharinath@novell.com>
2197
2198         * support.cs (SeekableStreamReader.Position): Avoid an expensive
2199         loop that performs 'min (pos, char_count)'.
2200
2201         Fix #75862.
2202         * expression.cs (Unary.ResolveOperator): Don't discard implicit
2203         converted value in Operator.OnesComplement.
2204
2205 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
2206
2207         * anonymous.cs: If the anon method is pulled into a helper class,
2208         it needs to be `internal' not `private'. Fixes runtime behavior on
2209         msft. bug #75704
2210
2211 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
2212
2213         Fix #75803
2214         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2215         is a partial class.
2216
2217 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
2218
2219         The big constants rewrite
2220         Fix #75746, #75685 and more
2221         As a side effect saved 1MB for MWF ;-)
2222         
2223         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
2224         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
2225         enum based for corlib compilation.
2226         
2227         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
2228         subtractions.
2229         
2230         * class.cs (FixedField.Define): Use ResolveAsConstant.
2231         
2232         * const.cs (IConstant): Interface constants and enums.
2233         (Const.ResolveValue): New method for constant resolvning.
2234         (ExternalConstant): Constants from imported assemblies.
2235         
2236         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
2237         conversion; like enums.
2238         (Constant.ToType): Converts this constant to different type.
2239         (Constant.Increment): Adds 1.
2240         
2241         * convert.cs (ImplicitConversionRequired): Simplified.
2242         
2243         * cs-parser.jay: Create EnumMember directly.
2244         
2245         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
2246         
2247         * doc.cs (GenerateEnumDocComment): Removed.
2248         
2249         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
2250         (ConvertIntLiteral): Removed.
2251         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
2252         
2253         * enum.cs (EnumMember): Implement IConstant.
2254         (Enum.IsValidEnumConstant): Removed.
2255         (Enum.GetNextDefaultValue): Removed.
2256         (Enum.FindMembers): Updated.
2257         (Enum.GenerateDocComment): Iterate enum members.
2258         
2259         * expression.cs (Cast.TryReduce): Handle enums correctly.
2260         (New.Constantify): Made public.
2261         (MemberAccess.DoResolve): Removed contant specific if(s).
2262         
2263         * literal.cs (NullLiteral): Implement new abstract methods.
2264         
2265         * statement.cs (GotoCase.Resolve): Use new constant methods.
2266         (SwitchLabel.ResolveAndReduce): Use new constant methods.
2267         
2268         * typemanager.cs (LookupEnum): Removed.
2269         (IsEnumType): Fixed to work with corlib.
2270         (RegisterConstant): Removed.
2271         (LookupConstant): Removed.
2272         (GetConstant): Changed to work with IConstant.
2273
2274 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
2275
2276         * location.cs : Fixed overflown (>255) column number.
2277
2278 2005-08-03  Raja R Harinath  <rharinath@novell.com>
2279
2280         First cut of the qualified-alias-member feature.
2281         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
2282         token.
2283         * cs-parser.jay (DOUBLE_COLON): New token.
2284         (namespace_or_type_name): Add rule for recognizing
2285         qualified-alias-members.
2286         (primary_expression): Likewise.
2287         (element_access): Allow QualifiedAliasMember as a possible
2288         type-bearing expression.
2289         (local_variable_type, local_variable_pointer_type): Likewise.
2290         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
2291         aliases in the current and enclosing namespace declarations.
2292         (NamespaceEntry.UsingAlias): Add CS0440 warning.
2293         * decl.cs (MemberName.is_double_colon): New.
2294         (MemberName.MemberName): Add new constructor for alias-member.
2295         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
2296         * expression.cs (QualifiedAliasMember): New expression type.
2297
2298 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2299
2300         * location.cs : it borked when no argument was specified.
2301
2302 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2303
2304         * location.cs : tiny ToString() format fix.
2305
2306 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2307
2308         * statement.cs : oops, it was missing.
2309
2310 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2311
2312         A set of fixes for precise line/column location.
2313
2314         * location.cs :
2315           "token" field now holds a file/line "delta", a line number offset 
2316           from the segment, and a column number. See also:
2317           http://lists.ximian.com/pipermail/mono-devel-list/2004-
2318           December/009508.html
2319           Removed static IsNull. Use instance IsNull property instead.
2320         * cs-tokenizer.cs :
2321           For some tokens it stores Location. For Identifier it stores
2322           LocatedToken which is a pair of string name and location.
2323           Column numbers are adjusted only at getChar().
2324         * report.cs :
2325           Use Location.ToString() for reporting (it now contains column).
2326         * cs-parser.jay :
2327           Largely modified to use LocatedToken instead of
2328           string (IDENTIFIER), and to acquire Location from some tokens.
2329         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2330           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2331           codegen.cs :
2332           Now MemberName holds Location. DeclSpace.ctor() receives Location
2333           as a parameter. Removed extra parameters to all derived classes.
2334           Replaced Location.IsNull() with instance property.
2335         * assign.cs, expression.cs :
2336           Added .ctor() overload that omits Location.
2337         * attribute.cs :
2338           Added "nameEscaped" flag that indicates the identifier was escaped
2339           in the source file. This fixes bug #57047.
2340
2341 2005-09-02  Martin Baulig  <martin@ximian.com>
2342
2343         * class.cs: Make CS3005 a warning, not an error.
2344
2345 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
2346
2347         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2348         New method, looking for lo-case imported cls type.
2349
2350         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2351         here.
2352
2353         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2354
2355         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2356
2357         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2358         all_imported_types.
2359         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2360
2361         Optimized to save 3.5 MB for SWF compilation.
2362
2363 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2364
2365         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
2366         (PartialContainer.Create): Moved logic AddToContainer.
2367         (PartialContainer.MarkForDuplicationCheck): Shares name.
2368         
2369         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
2370         place.
2371         
2372         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
2373         initialization.
2374         (Namespace.GetSignatureForError): New method.
2375         
2376         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
2377         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
2378
2379 2005-08-01  Raja R Harinath  <rharinath@novell.com>
2380
2381         Fix #75669.
2382         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
2383         member lookup rather than qualifier_type, since qualifier_type can
2384         be null.
2385
2386 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2387
2388         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
2389         enum member.
2390
2391 2005-07-31  Miguel de Icaza  <miguel@novell.com>
2392
2393         * statement.cs: Copy the local exception into the exception
2394         captured local.  Fixes 75674
2395
2396 2005-07-31  Raja R Harinath  <harinath@gmail.com>
2397
2398         Fix #75658.
2399         * expression.cs (Invocation.OverloadResolve): Don't report error
2400         CS1501 if error CS1502 has been reported.
2401         (New.DoResolve): Delegate CS1501 reporting to
2402         Invocation.OverloadResolve.
2403
2404         Fix #75656.
2405         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
2406         invariant-meaning-in-block property in an enclosing block if
2407         necessary.
2408
2409 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
2410
2411         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
2412         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
2413         (Switch.CheckSwitch): Just save 50kb for SWF.
2414
2415 2005-07-27  Martin Baulig  <martin@ximian.com>
2416
2417         * anonymous.cs (CaptureContext.AddField): Added
2418         `AnonymousContainer am' argument; compute its toplevel scope if
2419         it's not already computed.  Fixes #75649.
2420
2421 2005-07-26  Raja R Harinath  <rharinath@novell.com>
2422
2423         Fix #75628.
2424         * class.cs (Constructor.Emit): Reset block to null if the block
2425         resolve fails.
2426
2427 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
2428
2429         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
2430
2431 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
2432
2433         * class.cs (MethodData.Define): Check whether accessor implementing
2434         interface is public.
2435
2436         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
2437
2438 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
2439
2440         Fix #57245
2441         * namespace.cs (LookupType): Moved same type check to...
2442         
2443         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
2444         with the same name.
2445
2446 2005-07-21  Raja R Harinath  <rharinath@novell.com>
2447
2448         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
2449         already found a typebuilder.
2450         * class.cs (MethodCore.IsDuplicateImplementation): Compare
2451         MemberNames, not strings.
2452
2453         * const.cs (Error_ExpressionMustBeConst): 
2454         Rename from Error_EpressionMustBeConst.
2455         * const.cs, class.cs, statement.cd: Update.
2456
2457 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
2458
2459         Fix #65573
2460
2461         * const.cs (Const.LookupConstantValue): Report missing contant expression
2462         everytime.
2463         (Error_EpressionMustBeConstant): Only one error method.
2464
2465         * class.cs, statement.c: Updated.
2466
2467 2005-07-20  Raja R Harinath  <rharinath@novell.com>
2468
2469         * statement.cs (Block.Flags): Add back HasVarargs.
2470         (Block.flags): Make protected.
2471         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
2472
2473         * typemanager.cs (types, typecontainers, user_types): Remove.
2474         (UserTypes, TypeContainers): Likewise.
2475         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
2476         (CleanUp, Reset): Update.
2477         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
2478         (GetNestedType): Use Type.GetNestedType.
2479         (CoreLookupType): Take two arguments, the namespace and the
2480         basename of the type.  Update to use the Namespace.Lookup
2481         mechanism.
2482         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
2483         (RealMemberLookup): Use IsNestedChildOf instead of playing with
2484         string concatenation and substring matches.
2485         * class.cs, enum.cs, delegate.cs: Update to changes.
2486
2487 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
2488
2489         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
2490         Expression and made virtual.
2491
2492         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
2493         (ImplicitStandardConversionExists): Fixed `byte' typo ?
2494
2495         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
2496
2497         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
2498         error message.
2499
2500         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
2501         change.
2502
2503 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
2504
2505         Fix #57707
2506         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
2507         AssemblyCultureAttribute is not used on executable.
2508
2509         * rootcontext.cs,
2510         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
2511
2512 2005-07-16  Raja R Harinath  <rharinath@novell.com>
2513
2514         Fix #60638.
2515         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
2516         New.  Reports CS0252/CS0253.
2517         Mostly taken from preliminary patch by Duncak Mak.
2518         (Binary.DoResolveOperator): Store results of operator lookup.
2519         Use them to detect if we need to warn about unintended reference
2520         comparisons.
2521
2522 2005-07-15  Raja R Harinath  <rharinath@novell.com>
2523
2524         Fix #72969.
2525         * namespace.cs (Namespace.Lookup): Add back location parameter.
2526         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
2527         * delegate.cs, ecore.cs, expression.cs: Update to changes.
2528
2529         * codegen.cs (EmitContext.DeclSpace): Make readonly.
2530         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
2531         (Namespace.LookupType): ... this.
2532         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
2533         of namespaces.
2534         * typemanager.cs (LookupTypeReflection): Remove buggy code that
2535         purported to handle pointers.
2536         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
2537         CoreLookupType.
2538
2539 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
2540
2541         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2542         type as namespace.
2543
2544 2005-07-15  Raja R Harinath  <rharinath@novell.com>
2545
2546         * namespace.cs (Namespace.Lookup): Drop location parameter.
2547         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
2548         (NamespaceEntry.Lookup): ... this.
2549         (NamespaceEntry.Error_AmbiguousTypeReference):
2550         Move here from DeclSpace.
2551         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
2552         names ...
2553         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
2554         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
2555         Move to NamespaceEntry.
2556         * delegate.cs, expression.cs: Update to changes.
2557
2558 2005-08-31  Martin Baulig  <martin@ximian.com>
2559
2560         Committing a patch from Atsushi Enomoto for #75850.
2561
2562         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
2563         Prefer a generic enumerator over a non-generic one.
2564
2565 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
2566
2567         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2568         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2569
2570 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2571
2572         * driver.cs : reverting default encoding change as well as mcs.
2573
2574 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2575
2576         * driver.cs, support.cs : merged r48826.
2577           Marek Safer wrote:
2578           > could you integrate your mcs changes to gmcs otherwise
2579           > gmcs cannot compile some files.
2580
2581 2005-08-20  Martin Baulig  <martin@ximian.com>
2582
2583         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2584         scope if we don't already have it.
2585
2586         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2587         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2588         fixes #75867.
2589
2590 2005-07-31  Miguel de Icaza  <miguel@novell.com>
2591
2592         * statement.cs: Copy the local exception into the exception
2593         captured local.  Fixes 75674
2594
2595 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
2596
2597         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2598         type as namespace.
2599
2600 2005-08-12  Martin Baulig  <martin@ximian.com>
2601
2602         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
2603         for nested types here to avoid hitting the cache too early.
2604
2605 2005-08-09  Miguel de Icaza  <miguel@novell.com>
2606
2607         * enum.cs: On the new compiler CLS error 3005 is now a warning not
2608         an error. 
2609
2610 2005-08-03  Martin Baulig  <martin@ximian.com>
2611
2612         Make iterators in generic methods work; see gtest-191.cs.
2613
2614         * generic.cs
2615         (Constraints.Resolve): Protect against being called twice.
2616
2617         * class.cs
2618         (TypeContainer.GetClassBases): Make this `protected virtual'.
2619
2620         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
2621         (Iterator.GetClassBases): Override this and compute the base
2622         classes here.
2623         (Iterator.DefineNestedTypes): If we're a generic method, all our
2624         method type parameters become class type parameters on the proxy
2625         class.
2626
2627         * statement.cs
2628         (ToplevelBlock.Parameters): Make this a property, not a field.
2629         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
2630
2631 2005-08-03  Martin Baulig  <martin@ximian.com>
2632
2633         * typemanager.cs (TypeManager.IsSubclassOf): Use
2634         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
2635         (TypeManager.GetFullName_recursed): Improved.
2636
2637 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2638
2639         Fix #75417
2640         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
2641         Private accessor case, using TypeManager.IsPrivateAccessible instead of
2642         invocation_type == mi.DeclaringType, since the first one also checks
2643         other condition used by generic instances.
2644         
2645 2005-07-27  Martin Baulig  <martin@ximian.com>
2646
2647         * anonymous.cs (CaptureContext.AddField): Added
2648         `AnonymousContainer am' argument; compute its toplevel scope if
2649         it's not already computed.  Fixes #75649.
2650
2651 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
2652
2653         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
2654         CheckAttributeType and refactored.
2655         (Attribute.ResolvePossibleAttributeType): Changed to reuse
2656         ResolveAsTypeTerminal error handling.
2657         (ResolveAsTypeTerminal): Introduced because of global attributes extra
2658         handling.
2659         (GetSignatureForError): Print errors in same way.
2660
2661         * class.cs,
2662         * codegen.cs: Reflect attribute GetSignatureForError change.
2663
2664         * ecore.cs,
2665         * expression.cs: Add silent parameter to ResolveAsTypeStep.
2666
2667         * namespace.cs (UsingEntry): Refactored to make fields private.
2668
2669         * assign.cs,
2670         statement.cs: Error_UnexpectedKind has extra parameter.
2671
2672 2005-07-14  Raja R Harinath  <rharinath@novell.com>
2673
2674         * ecore.cs (IAlias): Remove.
2675         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
2676         that implement the interface.
2677         * namespace.cs (Namespace): Likewise.
2678         (Namespace.declspaces): Renamed from 'defined_names'.
2679         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
2680         DeclSpace instead of an IAlias.
2681         * tree.cs (Tree.AddDecl): Update.
2682
2683 2005-07-12  Raja R Harinath  <rharinath@novell.com>
2684
2685         * statement.cs (Block.Flags); Remove HasVarargs.
2686         (Block.HasVarargs): Move to ToplevelBlock.
2687         (Block.ThisVariable, Block.AddThisVariable): Likewise.
2688         (Block.Variables): Make protected.  Initialize variable hashtable
2689         if necessary.
2690         (Block.AddVariable): Update.
2691         (Block.Resolve): Update to changes.
2692         (ToplevelBlock.HasVarargs): New boolean.
2693         (ToplevelBlock.ThisVariable): Move here from Block.
2694         (ToplevelBlock.AddThisVariable): Likewise.
2695         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
2696         * expression.cs (This.ResolveBase): Update to changes.
2697         (ArglistAccess.DoResolve): Likewise.
2698
2699 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
2700
2701         Fix #75321
2702         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
2703
2704         * class.cs (TypeContainer.VerifyMembers): Distinguish between
2705         not used and not used & assigned.
2706         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
2707
2708 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
2709
2710         Fix #75053
2711         * expression.cs (Is.DoResolve): null is never provided type.
2712
2713 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
2714
2715         Fix #52496
2716         * cs-parser.jay: Less strict event error rule to catch more errors.
2717
2718 2005-07-11  Martin Baulig  <martin@ximian.com>
2719
2720         * generic.cs (ConstructedType.CheckConstraints): Improve the check
2721         for the constructor constraint: we do not only have to check
2722         whether the class has a public constructor, but also ensure that
2723         it's parameterless.  Fixes #75492.
2724
2725 2005-07-11  Martin Baulig  <martin@ximian.com>
2726
2727         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
2728         between type parameters if they either have the reference type
2729         constraint or the class constraint.
2730
2731 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
2732
2733         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
2734
2735 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
2736
2737         Fix #74975
2738         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
2739         (ExtractSecurityPermissionSet): Cope with self referencing security
2740         attributes properly.
2741
2742         * driver.cs (SetOutputFile): Made public property OutputFile.
2743
2744 2005-07-07  Raja R Harinath  <rharinath@novell.com>
2745
2746         Fix #75486.
2747         * class.cs (TypeContainer.first_nonstatic_field): Rename from
2748         has_nonstatic_fields.  Make into a FieldBase pointer.
2749         (TypeContainer.AddField): Add CS0282 check.
2750         (TypeContainer.EmitType): Update.
2751
2752 2005-07-06  Miguel de Icaza  <miguel@novell.com>
2753
2754         * cs-tokenizer.cs (consume_identifier): Do not create strings to
2755         compare if they start with __.
2756
2757 2005-07-06  Raja R Harinath  <rharinath@novell.com>
2758
2759         * statement.cs (Switch.SwitchGoverningType): Only look at
2760         UserCasts that don't need implicit standard conversions to one of
2761         the allowed switch types (Fixes test-322.cs).
2762         (LocalInfo.Resolve): Re-enable sanity-test.
2763
2764 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
2765
2766         * cs-tokenizer.cs (consume_identifier): Detect double undescores
2767         
2768         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
2769         
2770         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
2771
2772 2005-07-06  Raja R Harinath  <rharinath@novell.com>
2773
2774         Fix #75472.
2775         * ecore.cs (SimpleName.GetSignatureForError): Add.
2776         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
2777         (MemberAccess.GetSignatureForError): Add.
2778
2779 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
2780  
2781         The big error and warning messages review.
2782         
2783         * anonymous.cs,
2784         * assign.cs,
2785         * attribute.cs,
2786         * class.cs,
2787         * codegen.cs,
2788         * convert.cs,
2789         * cs-parser.jay,
2790         * cs-tokenizer.cs,
2791         * decl.cs,
2792         * delegate.cs,
2793         * doc.cs,
2794         * driver.cs,
2795         * ecore.cs,
2796         * enum.cs,
2797         * expression.cs,
2798         * flowanalysis.cs,
2799         * iterators.cs,
2800         * literal.cs,
2801         * location.cs,
2802         * modifiers.cs,
2803         * namespace.cs,
2804         * parameter.cs,
2805         * pending.cs,
2806         * report.cs,
2807         * rootcontext.cs,
2808         * statement.cs,
2809         * support.cs,
2810         * tree.cs,
2811         * typemanager.cs: Updated.
2812         
2813         * class.cs: (MethodCore.SetYields): Moved here to share.
2814         (PropertyMethod.Define): Moved iterator setup here.
2815         
2816         * iterators.cs: Add orig_method to have full access to parent
2817         container.
2818
2819 2005-07-05  Raja R Harinath  <rharinath@novell.com>
2820
2821         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
2822         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
2823         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
2824         variable of struct type.
2825         * expression.cs (Unary.ResolveOperator): Update to change.
2826         (Indirection.VerifyFixed): Likewise.
2827         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
2828         (ParameterReference.VerifyFixed): Value parameters are fixed.
2829         (This.VerifyFixed): Treat 'this' as a value parameter.
2830         * statement.cs (LocalInfo.IsFixed): Remove.
2831
2832 2005-07-01  Martin Baulig  <martin@ximian.com>
2833
2834         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
2835         `ec.EmitThis ()' to get the correct scope.
2836
2837 2005-07-01  Martin Baulig  <martin@ximian.com>
2838
2839         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
2840         instance is a ParameterReference; fixes #75299.
2841
2842 2005-06-30  Raja R Harinath  <rharinath@novell.com>
2843
2844         Fix #75412.
2845         * expression.cs (Indexers.map): Remove.
2846         (Indexers.Append): Filter out inaccessible setters and getters.
2847         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
2848
2849         Fix #75283.
2850         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
2851         Refactored from ...
2852         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
2853         (FieldExpr.Emit, PropertyExpr.Emit): Update.
2854         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
2855         * expression.cs (Invocation.EmitCall): Add CS0120 check.
2856
2857 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
2858
2859         Fix #75322
2860         * class.cs (FieldBase.GetInitializerExpression): One more field
2861         for backup.
2862
2863 2005-06-28  Miguel de Icaza  <miguel@novell.com>
2864
2865         * pending.cs: Do not define a proxy if the base method is virtual,
2866         it will be picked up by the runtime (bug 75270).
2867
2868 2005-07-08  Martin Baulig  <martin@ximian.com>
2869
2870         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
2871         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
2872
2873 2005-07-07  Martin Baulig  <martin@ximian.com>
2874
2875         * generic.cs (ConstructedType.CheckConstraint): Use
2876         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
2877         called recursively; fixes #75329.
2878
2879 2005-07-06  Martin Baulig  <martin@ximian.com>
2880
2881         * generic.cs (TypeManager.InferTypeArguments): Added support for
2882         anonymous methods; fixes #75461.
2883
2884 2005-07-01  Martin Baulig  <martin@ximian.com>
2885
2886         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
2887         `ec.EmitThis ()' to get the correct scope.
2888
2889 2005-07-01  Martin Baulig  <martin@ximian.com>
2890
2891         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
2892         instance is `This'; fixes #75299.
2893
2894 2005-06-30  Martin Baulig  <martin@ximian.com>
2895
2896         * class.cs (Indexer): Implement IIteratorContainer; added support
2897         for iterators in indexers.
2898
2899         * codegen.cs
2900         (EmitContext.CurrentIterator): Make this a property, not a field.
2901
2902         * anonymous.cs (AnonymousContainer.Iterator): New public property.
2903
2904 2005-06-28  Miguel de Icaza  <miguel@novell.com>
2905
2906         * pending.cs: Do not define a proxy if the base method is virtual,
2907         it will be picked up by the runtime (bug 75270).
2908
2909 2005-06-28  Martin Baulig  <martin@ximian.com>
2910
2911         * cs-parser.jay (interface_method_declaration): Avoid a
2912         reduce/reduce conflict by moving some of the code into a separate
2913         `interface_method_declaration_body' rule; fixes #75368.
2914
2915 2005-06-28  Martin Baulig  <martin@ximian.com>
2916
2917         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
2918         array check after the check for TypeBuilder's.
2919
2920 2005-06-21  Raja R Harinath  <rharinath@novell.com>
2921
2922         * convert.cs (FindMostEncompassedType): Add two trivial special
2923         cases (number_of_types == 0 || number_of_types == 1).
2924         (FindMostEncompasingType): Likewise.
2925
2926 2005-06-17  Raja R Harinath  <rharinath@novell.com>
2927
2928         Some cleanups preparing for the fix of #75283.
2929         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
2930         error testing.
2931         (EventExpr.InstanceResolve): Likewise.
2932         (EventExpr.DoResolve): Remove redundant checks.
2933
2934 2005-06-08  Miguel de Icaza  <miguel@novell.com>
2935
2936         * class.cs: Small fix.
2937
2938 2005-06-08  Raja R Harinath  <rharinath@novell.com>
2939
2940         Fix #75160.
2941         * class.cs (GetPartialBases): Fix return value check of
2942         part.GetClassBases.
2943
2944 2005-06-07  Raja R Harinath  <rharinath@novell.com>
2945
2946         Ensure that partial classes are registered in their enclosing
2947         namespace.  Initial part of fix of #75160.
2948         * tree.cs (Tree.RecordDecl): Add new namespace argument.
2949         Register declspace with namespace here, not in
2950         DeclSpace.RecordDecl.
2951         * cs-parser.jay: Pass namespace to RecordDecl.
2952         * class.cs (PartialContainer.Create): Likewise.
2953         (ClassPart.DefineType): New sanity-check.  Throws an exception if
2954         called.
2955         * decl.cs (Declspace.RecordDecl): Remove.
2956         * namespace.cs (NamespaceEntry.DefineName): Remove.
2957
2958 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
2959
2960         * rootcontext.cs: Reset TargetExt as well.
2961
2962 2005-06-03  Raja R Harinath  <rharinath@novell.com>
2963
2964         * ecore.cs (Expression.Resolve): Emit CS0654 error when
2965         -langversion:ISO-1.
2966
2967 2005-06-02  Raja R Harinath  <rharinath@novell.com>
2968
2969         Fix #75080, cs0119.cs.
2970         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
2971         of ...
2972         (Expression.Resolve): ... this.  Use it.  Remove bogus code
2973         allowing ExprClass.Type and ExprClass.Namespace for
2974         ResolveFlags.VariableOrValue.
2975         (Expression.Resolve) [1-argument variant]: Change default resolve
2976         flags based on language version.
2977         (Expression.Error_UnexpectedKind): Use a simple string array
2978         rather than an ArrayList.
2979         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
2980         not ExprClass.Type.
2981         (TypeOfVoid.DoResolve): Likewise.
2982         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
2983         flags argument -- it always has the same value.
2984
2985 2005-05-31  Raja R Harinath  <rharinath@novell.com>
2986
2987         Fix #75081.
2988         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
2989         Use it in the error message.
2990         * assign.cs, expression.cs, statement.cs: Update.
2991
2992 2005-05-30  Raja R Harinath  <rharinath@novell.com>
2993
2994         Fix #75088.
2995         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
2996         the "almostMatchedMember" case too.
2997         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
2998         that failed the accessibility checks to 'almost_match'.
2999
3000 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
3001
3002         * attribute.cs: Use internal MethodBuilder methods to set
3003         ExactSpelling and SetLastError on PInvoke methods, instead
3004         of passing them via charset.  Fixes #75060.
3005
3006 2005-05-27  Raja R Harinath  <rharinath@novell.com>
3007
3008         * parameter.cs (Parameter): Remove TODO comment.
3009         (Parameter.DefineParameter): Remove Location parameter.
3010         (Parameters.LabelParameters): Likewise.
3011         * class.cs (Constructor.Emit): Update to change.
3012         (MethodData.Emit): Likewise.
3013         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
3014         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3015
3016 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
3017
3018         * parameter.cs,
3019           Removed Parameters.Location and added Parameter.Location instead.
3020           Removed Location parameter from Emit() and GetSignature().
3021         * anonymous.cs,
3022           class.cs,
3023           cs-parser.jay,
3024           delegate.cs,
3025           iterators.cs,
3026           statement.cs :
3027           Modified all related calls.
3028
3029 2005-06-21  Martin Baulig  <martin@ximian.com>
3030
3031         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
3032         left-hand side is not a nullable type; fixes #75328.
3033
3034 2005-06-21  Martin Baulig  <martin@ximian.com>
3035
3036         * typemanager.cs
3037         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
3038         (TypeManager.GetFullNameSignature): Likewise.
3039
3040         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
3041         `source.FullName' and `target.FullName' to check whether there are
3042         two conflicting definitions.
3043
3044 2005-06-21  Martin Baulig  <martin@ximian.com>
3045
3046         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
3047         a BoxedCast - also for reference types - to be compatible with csc.
3048
3049 2005-06-21  Martin Baulig  <martin@ximian.com>
3050
3051         * expression.cs (MemberAccess.DoResolve): Add support for nested
3052         types in a generic instance; fixes #75320.
3053
3054 2005-06-20  Martin Baulig  <martin@ximian.com>
3055
3056         * generic.cs (TypeManager.InferType): Also walk the class
3057         hierarchy for generic instances; fixes #75261.
3058
3059 2005-06-17  Martin Baulig  <martin@ximian.com>
3060
3061         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
3062         to make things work for corlib.
3063
3064 2005-06-15  Martin Baulig  <martin@ximian.com>
3065
3066         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
3067         obsolete `SecurityAction' values.
3068
3069 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3070
3071         * rootcontext.cs: Reset TargetExt as well.
3072         
3073 2005-06-09  Martin Baulig  <martin@ximian.com>
3074
3075         * delegate.cs (Delegate.VerifyMethod): Added
3076         `MethodGroupExpr old_mg' argument; inherit its
3077         `HasTypeParameters'; fix #75085.
3078
3079 2005-06-09  Martin Baulig  <martin@ximian.com>
3080
3081         * expression.cs (Invocation.OverloadResolve): Correctly handle
3082         generic methods for the SetMemberIsUsed(); fix #75064.
3083
3084 2005-06-09  Martin Baulig  <martin@ximian.com>
3085
3086         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
3087         fixes #75062.
3088
3089 2005-06-08  Martin Baulig  <martin@ximian.com>
3090
3091         * cs-parser.jay (nullable_type_or_conditional): If we put the
3092         nullable back and our `type' is a `ComposedCast', remove the
3093         nullable from it.  Fixes #75156.
3094
3095         * expression.cs (ComposedCast.RemoveNullable): New public method.
3096
3097 2005-06-08  Martin Baulig  <martin@ximian.com>
3098
3099         The big Iterators rewrite :-)
3100
3101         * iterators.cs: Rewrite this to use the anonymous methods framework.
3102
3103         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3104         before the TypeContainers; see 2test-21.cs.
3105
3106         * class.cs
3107         (TypeContainer.DefineType): Don't create a new EmitContext if we
3108         already have one (this only happens if we're an Iterator).
3109         (TypeContainer.Define): Also call Define() on all our iterators.
3110         (Method.CreateEmitContext): Added support for iterators.
3111
3112         * anonymous.cs
3113         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3114         (AnonymousContainer.CreateMethodHost): Moved here from
3115         AnonymousMethod and made abstract.
3116         (AnonymousContainer.CreateScopeType): New abstract method.
3117         (AnonymousContainer.IsIterator): New public property.
3118         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3119         get the ScopeTypeBuilder rather than manually defining it here. 
3120         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3121         iterators here.
3122
3123         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3124         before RootContext.DefineTypes().
3125
3126         * codegen.cs (EmitContext.RemapToProxy): Removed.
3127         (EmitContext.CurrentAnonymousMethod): Changed type from
3128         AnonymousMethod -> AnonymousContainer.
3129         (EmitContext.ResolveTopBlock): Protect from being called twice.
3130         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3131         (EmitContext.EmitThis): Removed the iterators hacks; use the
3132         anonymous methods framework for that.
3133
3134         * statement.cs
3135         (ToplevelBlock.Container): Make this a property, not a field.
3136         (ToplevelBlock.ReParent): New public method; move the
3137         ToplevelBlock into a new container.
3138         (Foreach.TemporaryVariable): Simplify.
3139
3140 2005-06-05  Martin Baulig  <martin@ximian.com>
3141
3142         * statement.cs (LocalInfo.CompilerGenerated): New flag.
3143         (Block.AddTemporaryVariable): New public method; creates a new
3144         `LocalInfo' for a temporary variable.
3145         (Block.EmitMeta): Create the LocalBuilders for all the temporary
3146         variables here.
3147         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3148         non-iterator variables.
3149
3150 2005-06-05  Martin Baulig  <martin@ximian.com>
3151
3152         * statement.cs (Foreach.TemporaryVariable): Create the
3153         LocalBuilder in the Emit phase and not in Resolve since in some
3154         situations, we don't have an ILGenerator during Resolve; see
3155         2test-19.cs for an example.
3156
3157 2005-06-04  Martin Baulig  <martin@ximian.com>
3158
3159         The big Foreach rewrite - Part II.
3160
3161         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3162         with `PropertyInfo ienumerator_getcurrent'.
3163
3164         * codegen.cs (VariableStorage): Removed.
3165
3166         * statement.cs
3167         (Foreach): Derive from Statement, not ExceptionStatement.
3168         (Foreach.CollectionForeach): New nested class.  Moved all the code
3169         dealing with collection foreach here.
3170         (Foreach.ForeachHelperMethods): Removed.
3171         (Foreach.TemporaryVariable): Implement IMemoryLocation.
3172
3173 2005-05-23  Martin Baulig  <martin@ximian.com>
3174
3175         * statement.cs (Try.DoResolve): Don't create a `finally' if we
3176         don't need to.  Fix #75014.
3177
3178 2005-05-26  Raja R Harinath  <rharinath@novell.com>
3179
3180         Improve user-defined conversion handling.
3181         * convert.cs (GetConversionOperators): Rewrite.  Return only the
3182         applicable operators.
3183         (AddConversionOperators): New.  Helper for GetConversionOperators.
3184         (FindMostEncompassedType, FindMostEncompassingType): Verify that
3185         there is only one most encompassed/encompassing type.
3186         (FindMostSpecificSource, FindMostSpecificTarget): Remove
3187         "applicable operator" handling.
3188         (UserConversion): Move cache here from GetConversionOperators.
3189         Directly cache the chosen operator, rather than the whole
3190         MethodGroup.
3191         (ExplicitNumericConversion): Fix buggy implementation of Decimal
3192         case.  Allow conversion of decimal to sbyte and byte too.
3193         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3194         New static methods.  Used to avoid allocating EmptyExpressions in
3195         convert.cs.
3196
3197 2005-05-24  Duncan Mak  <duncan@novell.com>
3198
3199         * ecore.cs (CastFromDecimal): New class for casting a decimal to
3200         another class, used in Convert.ExplicitNumericConversion.
3201         (CastToDecimal): New class, similar to above, but casts to
3202         System.Decimal, used in Convert.ImplicitNumericConversion and also
3203         in explicit convesion from double/float to decimal.
3204
3205         * convert.cs (ImplicitNumericConversion): Handle implicit
3206         conversions to System.Decimal.
3207         (ExplicitNumericConversion): handle explicit conversions to
3208         System.Decimal.
3209
3210         This fixes #68711.
3211         
3212 2005-05-20  Miguel de Icaza  <miguel@novell.com>
3213
3214         * typemanager.cs: Do not throw an exception in the TypeBuilder
3215         case, we take care of it on the TypeCode.
3216
3217 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
3218         
3219         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
3220         is back.
3221         
3222         * cs-parser.jay: Catch more lexical errors.
3223         
3224         * report.cs: Add one more Error method.
3225         
3226         * rootcontext.cs,
3227         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
3228
3229 2005-05-20  Martin Baulig  <martin@ximian.com>
3230
3231         * class.cs (TypeContainer.CircularDepException): Removed.
3232         (TypeContainer.DefineType): Removed the `InTransit' stuff.
3233         (TypeContainer.CheckRecursiveDefinition): Check for circular class
3234         (CS0146) and interface (CS0529) dependencies here.
3235
3236 2005-05-20  Martin Baulig  <martin@ximian.com>
3237
3238         * expression.cs (New.DoResolve): Move the CS0712 check above the
3239         CS0144 check; otherwise it can never be reached.
3240
3241 2005-05-20  Martin Baulig  <martin@ximian.com>
3242
3243         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
3244
3245 2005-05-20  Martin Baulig  <martin@ximian.com>
3246
3247         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
3248
3249         * typemanager.cs (TypeManager.IsAttributeType): New public method.
3250
3251 2005-05-19  Martin Baulig  <martin@ximian.com>
3252
3253         * delegate.cs
3254         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
3255         to disable error reporting.
3256
3257         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
3258         here since we don't want to report an error; see the new test-336.cs.
3259
3260 2005-05-19  Raja R Harinath  <rharinath@novell.com>
3261
3262         * statement.cs (ToplevelBlock.GetParameterReference)
3263         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
3264         Move here from class Block.
3265         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
3266         * expression.cs (ParameterReference.DoResolveBase): Likewise.
3267
3268 2005-05-18  Martin Baulig  <martin@ximian.com>
3269
3270         Fix #74978.
3271
3272         * flowanalysis.cs
3273         (FlowBranching.Reachability): Add non-static public And() and Or()
3274         methods.
3275         (FlowBranchingSwitch): New class; do the `break_origins' thing
3276         like in FlowBranchingLoop.
3277         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
3278         reachability, not just locals and parameters.
3279         (FlowBranching.MergeChild): Remove some of the hacks for loop and
3280         switch; MergeBreakOrigins() now takes care of that.
3281
3282 2005-05-18  Martin Baulig  <martin@ximian.com>
3283
3284         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3285         a loop and may leave it, reset the barrier; fixes #74974.
3286
3287 2005-05-16  Raja R Harinath  <rharinath@novell.com>
3288
3289         Fix test-382.cs.  Emit values of decimal constants.
3290         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3291         Carved out of ...
3292         (TypeContainer.AddField): ... this.
3293         (TypeContainer.EmitFieldInitializers): Allow the list of fields
3294         with initializers to include 'Const's.
3295         (ClassPart.RegisterFieldForInitialization): Forward to
3296         PartialContainer.
3297         * const.cs (Const.Const): Pass initializer to base class.
3298         (Const.Define): In case of decimal constants, register them for
3299         initialization in a static constructor.
3300
3301 2005-05-14  Martin Baulig  <martin@ximian.com>
3302
3303         * statement.cs (Block.Resolve): Correctly handle unreachable code;
3304         do not call ResolveUnreachable() on unreachable statements in
3305         here, see the comment in the source code.
3306
3307 2005-05-13  Raja R Harinath  <rharinath@novell.com>
3308
3309         Fix #74934.
3310         * expression.cs (BinaryResolveOperator): If one of the operands of
3311         an equality comparison is 'null' and the other is a pointer type,
3312         convert the null to a NullPointer.
3313         * convert.cs (ImplicitReferenceConversion): If the expression is a
3314         NullLiteral and the target type is a pointer type, return a
3315         NullPointer instead.
3316         (ImplicitConversionStandard): Likewise.
3317
3318 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
3319         
3320         * cs-parser.jay: Set readonly context based on special constructs.
3321         
3322         * expression.cs (LocalVariableReference.DoResolveBase): Improved
3323         readonly variable error handling.
3324         
3325         * rootcontext.cs (EmitCode): Don't verify members when error
3326         occurred.
3327         
3328         * statement.cs (LocalInfo): Add reaodnly context information.
3329         (SetReadOnlyContext, GetReadOnlyContext): New methods.
3330
3331 2005-05-17  Martin Baulig  <martin@ximian.com>
3332
3333         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3334         #70970. 
3335
3336 2005-05-13  Martin Baulig  <martin@ximian.com>
3337
3338         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
3339         handle unreachable blocks.
3340
3341 2005-05-13  Martin Baulig  <martin@ximian.com>
3342
3343         * class.cs
3344         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
3345         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
3346         #74905. 
3347
3348 2005-05-13  Martin Baulig  <martin@ximian.com>
3349
3350         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3351         instance variable, not a local.  Fix #74873.
3352         (Block.ResolveUnreachable): Set it to true here.
3353
3354 2005-05-12  Martin Baulig  <martin@ximian.com>
3355
3356         * cs-parser.jay (property_declaration): Pass the `current_class',
3357         not the `current_container' to Property's .ctor.  Fixes #74912.
3358
3359 2005-05-11  Martin Baulig  <martin@ximian.com>
3360
3361         * typemanager.cs (Closure): Copy this from MCS and merge all the
3362         GMCS-specific changes into it.
3363
3364 2005-05-12  Raja R Harinath  <harinath@gmail.com>
3365
3366         Fix #74920.
3367         * typemanager.cs (unmanaged_enclosing_types): New.
3368         (IsUnmanagedType): Avoid infloops by using
3369         'unmanaged_enclosing_types' to talk with recursive invocations.
3370
3371 2005-05-11  Duncan Mak  <duncan@novell.com>
3372
3373         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3374         continuing to process for 'arg'.
3375         (handle_preprocessing_directive): Check the argument of the #endif
3376         directive and report error CS1025 if there are any trailing
3377         characters.
3378
3379         According to the C# spec, having even whitespace after the #endif
3380         directive is illegal; however, because we call arg.TrimEnd ()
3381         beforehand, we have the same behavior as csc, allowing whitespace
3382         after the directive.
3383
3384         Fixes #74892.
3385
3386 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
3387
3388         Fix #74863.
3389         
3390         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3391         (Constructor.GetObsoleteAttribute): Implemented correctly.
3392
3393 2005-05-10  Martin Baulig  <martin@ximian.com>
3394
3395         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
3396         resolve the type; fixes #74864.
3397         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
3398         in DoResolve(); fixes #74862.
3399
3400 2005-05-10  Martin Baulig  <martin@ximian.com>
3401
3402         * support.cs (ReflectionParameters.ParameterModifier): Use
3403         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3404         and `ParameterAttributes.In'.  Fixes #74884.
3405
3406 2005-05-10  Martin Baulig  <martin@ximian.com>
3407
3408         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
3409         the cache if we're just looking for `MemberTypes.NestedType' in a
3410         generic instance.
3411
3412         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3413         constraints if we're still resolving the type tree.
3414         (Expression.MemberLookup): If we're resolving the type tree, only
3415         look for `MemberTypes.NestedType' since we're only interested in
3416         getting types.
3417
3418         * class.cs (TypeContainer.DefineType): Don't resolve the type
3419         parameters here; do this later in ResolveType() after the type
3420         tree has been resolved.
3421         (TypeContainer.ResolveType): New public method; this is called
3422         after the type tree is resolved and before the types are being
3423         populated.  We resolve the generic constraints here.
3424         (TypeContainer.DoDefineMember): Check the constraints on our base
3425         class and interfaces.
3426
3427         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
3428         set the `ResolvingTypeTree' flag on the EmitContext.
3429
3430         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
3431
3432 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
3433
3434         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3435         
3436         * expression.cs (Argument.GetParameterModifier): Turned to property.
3437         (Invocation.Error_InvalidArguments): Add more descriptive errors.
3438         
3439         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3440         its C# equivalent.
3441         
3442 2005-05-09  Raja R Harinath  <rharinath@novell.com>
3443
3444         Fix #74852.
3445         * decl.cs (MemberCache.AddMethods): Register override methods,
3446         rather than non-override methods.
3447         * typemanager.cs (RegisterOverride): New.
3448         (IsOverride): Update.
3449
3450 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3451
3452         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
3453
3454 2005-05-06  Martin Baulig  <martin@ximian.com>
3455
3456         * attribute.cs
3457         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
3458         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
3459
3460 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3461
3462         Fix #73105.
3463         
3464         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3465         recursive declaration.
3466         
3467         * statement.cs (Block.ResolveMeta): Report any error in resolving.
3468         
3469 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
3470
3471         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
3472         
3473         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
3474
3475 2005-05-05  Raja R Harinath  <rharinath@novell.com>
3476
3477         Fix #74797.
3478         * decl.cs (DeclSpace.FamilyAccessible): 
3479         Use TypeManager.IsNestedFamilyAccessible.
3480
3481         Fix reopened #64812.
3482         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
3483         internal'.
3484
3485 2005-05-04  Raja R Harinath  <rharinath@novell.com>
3486             Abin Thomas  <projectmonokochi@rediffmail.com>
3487             Anoob V E  <projectmonokochi@rediffmail.com>
3488             Harilal P R  <projectmonokochi@rediffmail.com>
3489
3490         Fix #64812.
3491         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
3492         allow access to all static members.
3493
3494 2005-05-04  Martin Baulig  <martin@ximian.com>
3495
3496         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
3497
3498 2005-05-04  Martin Baulig  <martin@ximian.com>
3499
3500         Fix #74655.
3501
3502         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
3503         section at the end; make things work if `default' is not the last
3504         section.        
3505
3506 2005-05-04  Martin Baulig  <martin@ximian.com>
3507
3508         Fix #70400.
3509
3510         * statement.cs (Switch): Replaced the `got_default' field with a
3511         `default_section' one.
3512         (Switch.CheckSwitch): Set `default_section' here.
3513         (Switch.Resolve): If we're a constant switch and the constant is
3514         not found, use the default section.
3515
3516 2005-05-03  Martin Baulig  <martin@ximian.com>
3517
3518         * expression.cs (ArrayAccess.EmitGetLength): New public method.
3519
3520         * statement.cs (Foreach.ArrayForeach): New nested class.
3521         (Foreach.TemporaryVariable): New nested class.
3522         (Foreach.EmitArrayForeach): Removed; this is now in the new
3523         ArrayForeach class.
3524
3525 2005-05-03  Raja R Harinath  <rharinath@novell.com>
3526
3527         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
3528         more conservative.
3529         (VerifyPendingMethods): Revert change below.
3530
3531         * typemanager.cs (IsOverride, RegisterNonOverride): New.
3532         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
3533         that used to trigger warning -28.  Remove warning -28.
3534         * expression.cs (Invocation.OverloadResolve): Use
3535         TypeManager.IsOverride to distinguish override methods.
3536
3537         Fix #74773.
3538         * pending.cs (VerifyPendingMethods): If a base type implements the
3539         requested interface, don't bother checking individual methods of
3540         the base type.  As a side-effect, this prevents the creation of
3541         unnecessary proxies.
3542
3543 2005-05-02  Martin Baulig  <martin@ximian.com>
3544
3545         Fix #70182.
3546
3547         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3548         Also `And' the locals if the old vector is null.
3549         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
3550         null; in this case we basically reset all the variables.        
3551
3552 2005-05-02  Martin Baulig  <martin@ximian.com>
3553
3554         Fix #74529.
3555
3556         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
3557         Added `FlowBranching branching' argument; always `and' the
3558         variables instead of `or'ing them unless we're an infinite loop.
3559
3560         * statement.cs (While.Resolve): Create a new sibling unless we're
3561         infinite.       
3562
3563 2005-05-02  Martin Baulig  <martin@ximian.com>
3564
3565         Fix #70140.
3566
3567         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
3568         arguments; use it instead of creating a new TopLevelBlock.
3569         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
3570         our ConstructorInitializer.
3571
3572         * statement.cs
3573         (TopLevelBlock.TopLevelBranching): New public property.
3574         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
3575         and create our `TopLevelBranching'.
3576
3577         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
3578         anonymous method host, use `block.TopLevelBranching' rather than
3579         creating a new branching.
3580
3581 2005-04-20  Miguel de Icaza  <miguel@novell.com>
3582
3583         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
3584         a ScopeInfo, if any of the current children is a child of the new
3585         entry, move those children there.
3586
3587 2005-04-30  Martin Baulig  <martin@ximian.com>
3588
3589         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
3590         at the beginning of a SwitchSection.  Fix #73335.
3591
3592 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
3593
3594         Fix #74378
3595         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
3596         
3597         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
3598         (FieldExpr.DoResolve): Obsolete members are ignored for field
3599         initializers.
3600         
3601 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
3602
3603         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
3604         of arrays detection.
3605
3606         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
3607         verification.
3608         (Field.VerifyClsCompliance): Volatile fields are not compliant.
3609
3610         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
3611         arrays report.
3612
3613 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
3614
3615         * cs-parser.jay: Use the prefered version of -unsafe in error
3616         message.
3617
3618 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
3619
3620         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
3621         circumstances.
3622
3623 2005-04-20  John Luke  <john.luke@gmail.com>
3624
3625         * driver.cs: fix typo in error message, --outout to --output
3626
3627 2005-04-30  Martin Baulig  <martin@ximian.com>
3628
3629         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
3630         handle the .NET 2.x security attributes.
3631
3632 2005-04-30  Martin Baulig  <martin@ximian.com>
3633
3634         * typemanager.cs
3635         (TypeManager.ExpandInterfaces): Don't add things twice.
3636
3637         * class.cs
3638         (TypeContainer.VerifyClsCompliance): Allow generic instances.
3639
3640 2005-04-29  Martin Baulig  <martin@ximian.com>
3641
3642         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
3643
3644         * anonymous.cs: Added support for anonymous generic methods.
3645
3646 2005-04-29  Martin Baulig  <martin@ximian.com>
3647
3648         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
3649         generic instances.
3650
3651 2005-04-29  Martin Baulig  <martin@ximian.com>
3652
3653         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
3654
3655         * expression.cs (New.DoResolve): Fix the CS0304 check.
3656
3657 2005-04-29  Martin Baulig  <martin@ximian.com>
3658
3659         * typemanager.cs (TypeManager.GetFullName): Updated to the new
3660         naming schema.
3661
3662         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
3663         explicit interface implementation, compare the interface types.
3664         (MethodData.Define): Use the new naming scheme from the latest
3665         .NET 2.x beta2.
3666         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
3667
3668         * decl.cs (MemberName.GetMemberName): Removed.
3669         (MemberName.MethodName, FullName): New properties.
3670
3671 2005-04-25  Raja R Harinath  <rharinath@novell.com>
3672
3673         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
3674
3675 2005-04-22  Martin Baulig  <martin@ximian.com>
3676
3677         * generic.cs (GenericMethod): Create the EmitContext in the
3678         `Define()'; in `Define(MethodBuilder)', create the type parameters
3679         before calling `Define()'.  Fixes #73933.
3680
3681 2005-04-22  Martin Baulig  <martin@ximian.com>
3682
3683         * generic.cs
3684         (Constraints.Resolve): Make things work wrt. the new type lookup system.
3685         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
3686
3687         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
3688         ConstructedType, check its constraints.
3689
3690 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
3691
3692         * codegen.cs (InRefOutArgumentResolving): New field.
3693         
3694         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
3695         fields outside contructor.
3696         
3697         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
3698         
3699 2005-04-19  Miguel de Icaza  <miguel@novell.com>
3700
3701         * anonymous.cs (CaptureContext.EmitParameterInstance): The
3702         parameter code was not completed ever, so it was not as up-to-date
3703         as local variables.  Must finish it.
3704
3705         The bug fix was to compare the Toplevel of the block, not the
3706         current block.  Thanks for Ben for pointing this out. 
3707
3708 2005-04-19  Raja R Harinath  <rharinath@novell.com>
3709
3710         * decl.cs (AddMethods): Use the declaring type of the problem
3711         method to determine if we want to squash a warning.
3712
3713 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
3714
3715         * attribute.cs: Removed debug output.
3716
3717         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
3718         
3719         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
3720         Report.Stderr.
3721         
3722 2005-04-18  Raja R Harinath  <rharinath@novell.com>
3723
3724         Fix #74481.
3725         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
3726         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
3727         all null comparisons against reference types.
3728
3729 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
3730
3731         Fix# 74565
3732         * class.cs (TypeContainer.CircularDepException) New nested
3733         exception class.
3734         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
3735         (TypeContainer.DefineType): Removed error, reset InTransit before
3736         exit.
3737         (Class.DefineType): Throw exception when is in Transit.
3738         Catch exception and report error.
3739         (Struct.DefineType): Throw exception when is in Transit.
3740         Catch exception and report error.
3741         (Interface.DefineType): Throw exception when is in Transit.
3742         Catch exception and report error.
3743
3744         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
3745         handle nested exception handlers.
3746
3747         * flowanalysis.cs (InTryWithCatch): New method, search for try with
3748         a catch.
3749
3750         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
3751         InFinally and InCatch storage.
3752
3753         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
3754         (Catch.Resolve): Set and Restore ec.InCatch.
3755         (Try.Resolve): Set and Restore ec.InFinally.
3756         (Try.HasCatch): True when try has catch.
3757
3758 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
3759
3760         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
3761           for the same event member, so exclude such cases from warning 419.
3762           Fixed bug #74633.
3763
3764 2005-04-16  Miguel de Icaza  <miguel@novell.com>
3765
3766         * expression.cs (Binary.ResolveOperator): Apply patch from John
3767         Luke to fix bug 59864: operators &, | and ^ on enumerations
3768         require that the same enum type on both sides.
3769
3770         * driver.cs: Add warnings to old flag usage, this is to assist
3771         people who produce Makefiles and hope that the Makefiles will be
3772         used on Windows.
3773
3774         * class.cs (TypeContainer.EmitType): Moved the definition of the
3775         special $PRIVATE$ field from the resolve phase to the Emit phase.
3776         During resolve we do not know if we are a struct with
3777         HasExplicitLayout, we know this only after the attributes for the
3778         type are emitted.
3779
3780         Set the FieldOffset to zero on the dummy field that we create for
3781         the class.   Fixes 74590.
3782
3783 2005-04-16  Raja R Harinath  <rharinath@novell.com>
3784
3785         Fix #73834.
3786         * ecore.cs (PropertyExpr.resolved): New.
3787         (DoResolve): Use it to handle a case of double resolution here.
3788         Handle a case of identical-name-and-type-name.
3789         * expression.cs (ArrayCreation.CheckIndices): Avoid double
3790         resolution by storing the results of expression resolution back
3791         into the "probes" array.
3792
3793 2005-04-15  Raja R Harinath  <rharinath@novell.com>
3794
3795         Fix cs0208-7.cs and cs0208-8.cs.
3796         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
3797         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
3798         error reporting to point out the reason a struct is not unmanaged.
3799
3800 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
3801
3802         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
3803           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
3804
3805 2005-04-13  Raja R Harinath  <rharinath@novell.com>
3806
3807         Fix #74528.
3808         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
3809         IdenticalNameAndTypeName here.
3810         (EventExpr.InstanceResolve): Likewise.
3811
3812 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
3813
3814         C# 2.0 DefaultCharSetAttribute implementation
3815         
3816         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
3817         which allows us to set GlobalNamespace for every resolve.
3818         (Attribute.ResolveArguments): Cut from Resolve.
3819         (Attribute.GetCharSetValue): Returns CharSet named argument.
3820         (Attribute.DefinePInvokeMethod): Gets default charset from
3821         module settings.
3822         (GlobalAttribute.ResolveAsTypeStep): Override.
3823         (GlobalAttribute.ResolveArguments): Override.
3824         
3825         * class.cs (TypeAttr): Is protected.
3826         
3827         * codegen.cs (ModuleClass.DefaultCharSet): New member.
3828         (ModuleClass.DefaultCharSetType): New memeber.
3829         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
3830         
3831         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
3832         charset from module.
3833         
3834         * delegate.cs (TypeAttr): Override.
3835         (Delegate.DefineType): Use this TypeAttr.
3836         
3837         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
3838         at very early stage (before types are defined) to resolve model
3839         module attributes. It will probably not work with corlib but it
3840         should be ok.
3841         
3842         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
3843         charset from module.
3844         
3845         * typemanager.cs (default_charset_type): New type.
3846
3847 2005-04-13  Raja R Harinath  <rharinath@novell.com>
3848
3849         * decl.cs (MemberCache.AddMethods): Don't warn if
3850         System.Object.Finalize has buggy MethodAttributes.
3851
3852         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
3853         removed below.
3854
3855 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
3856
3857         * doc.cs : detect ambiguous reference to overloaded members.
3858           Fixed bug #71603. MS 1.1 csc does not detect it.
3859
3860 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
3861
3862         * doc.cs : delegates must not be referenced with parameters.
3863           Fixed bug #71605.
3864
3865 2005-04-12  Miguel de Icaza  <miguel@novell.com>
3866
3867         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
3868
3869 2005-04-10  Miguel de Icaza  <miguel@novell.com>
3870
3871         * driver.cs (MainDriver): Stop processing if the CLS stage found
3872         errors. 
3873
3874         (CompilerCallableEntryPoint.InvokeCompiler): Always
3875         reset after execution;   Take a TextWriter argument for the
3876         output.
3877
3878         * report.cs: Use the error stream instead of hardcoding stderr. 
3879
3880 2005-04-09  Miguel de Icaza  <miguel@novell.com>
3881
3882         * class.cs: Reduce code paths to test, too small of an
3883         optimization to make it worth the extra testing.  Always perform
3884         it. 
3885
3886 2005-04-08  Raja R Harinath  <rharinath@novell.com>
3887
3888         Fix #74510.
3889         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
3890         operators that had errors reported on them.
3891
3892 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
3893
3894         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
3895         argument types.
3896         (Attribute.Resolve): Add named argument type checking.
3897         
3898         * class.cs (FixedField.Define): Use IsPrimitiveType
3899         
3900         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
3901         
3902         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
3903         unsafe parameter types.
3904         
3905         * statement.cs (Using.ResolveExpression): Add better error description.
3906         
3907         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
3908         
3909 2005-04-08  Raja R Harinath  <rharinath@novell.com>
3910
3911         Fix #74484.
3912         * attribute.cs (Attribute.GetAttributeUsage): Resolve
3913         AttributeUsageAttribute in the emitcontext of the attribute class,
3914         not in the emitcontext of the attributable entity it was attached to.
3915         * cs-parser.jay: Use 'current_class', not 'current_container',
3916         when creating a GlobalAttribute.
3917
3918 2005-04-08  Alp Toker  <alp@atoker.com>
3919
3920         * pending.cs: The fix to #58413 failed to compile methods implementing
3921         interfaces with/without params modifiers and vice versa, even though
3922         params modifiers aren't part of the signature. Make the modifier check
3923         less strict as in csc.
3924
3925 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
3926             Anoob V E  <projectmonokochi@rediffmail.com>
3927             Harilal P R  <projectmonokochi@rediffmail.com>
3928
3929         Fix #58413.
3930         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
3931         modifiers of pending methods.
3932         (PendingImplementation.PendingImplementation): Initialize it.
3933         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
3934         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
3935         with ParameterData.  Add check for modifiers.
3936         * class.cs (MethodData.Define): Update to changes.
3937
3938 2005-04-07  Raja R Harinath  <rharinath@novell.com>
3939
3940         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
3941
3942 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
3943
3944         * class.cs (PropertyMethod.Define): Check private accessor in abstract
3945         property.
3946         
3947         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
3948         
3949         * rootcontext.cs,
3950         * typemanager.cs: Registered RequiredAttributeAttribute.
3951         
3952 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
3953
3954         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
3955         Warning CS0169 is back at level 3.
3956         (IMethodData.SetMemberIsUsed): New method.
3957         
3958         * decl.cs (IsUsed): New value; moved from FieldBase.Status
3959         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
3960         
3961         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
3962
3963         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
3964         contants.
3965         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
3966         is used.
3967         
3968         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
3969         is used.
3970         
3971         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
3972         to avoid the problems with nested types.
3973
3974 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
3975             Anoob V.E  <projectmonokochi@rediffmail.com>
3976             Harilal P.R  <projectmonokochi@rediffmail.com>
3977             Raja R Harinath  <rharinath@novell.com>
3978
3979         Fix #73820.
3980         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
3981         attribute.
3982         * typemanager (GetConstructor): Make public.
3983
3984 2005-04-05  John Luke  <john.luke@gmail.com>
3985             Raja R Harinath  <rharinath@novell.com>
3986
3987         Fix #62232.
3988         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
3989         struct too.  Return false quicker in a few cases.
3990         (VerifyUnManaged): Use it.
3991
3992 2005-04-05  Raja R Harinath  <rharinath@novell.com>
3993
3994         Fix #74041.
3995         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
3996         not 'unreachable_seen'.
3997
3998 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
3999
4000         * attribute.cs (Attribute.GetValue): Removed unused.
4001         
4002         * codegen.cs (CodeGen.TrimExt): Removed unused.
4003         
4004         * cs-parser.jay (output): Removed unused.
4005         
4006         * cs-tokenizer.cs (hex_digits): Removed unused.
4007         
4008         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4009         
4010         * expression.cs (Indirection.LoadExprValue): Removed unused.
4011         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4012         
4013         * iterators.cs (Iterator.param_types): Removed unused.
4014         
4015         * statement.cs (Goto.block): Removed unused.
4016         (ToplevelBlock.did): Removed unused.
4017         (Switch.ResolveConstantSwitch): Removed unused.
4018
4019 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
4020
4021         * rootcontext.cs: Allow mcs to bootstrap with the compilation
4022         resetting thingy.
4023
4024 2005-04-19  Martin Baulig  <martin@ximian.com>
4025
4026         Merged r42462 from MCS and made it work for GMCS.
4027
4028         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
4029
4030         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
4031
4032 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4033
4034         Fix #74232 and cs0208-3.cs.
4035         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4036         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4037         unmanaged type.  Don't use FieldBuilders when 't' is a
4038         TypeBuilder.  Use ModFlags and MemberType fields.
4039         * class.cs (MemberBase.member_type): Rename from MemberType.
4040         (MemberBase.MemberType): New property.  Determines member_type on
4041         demand.
4042         (MemberBase.DoDefine): Don't initialize MemberType here.
4043         (FieldMember.Define): Likewise.
4044
4045 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
4046
4047         Fix #74241
4048         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4049         Attributes are emitted there.
4050         
4051 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4052
4053         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4054         keyword in 'partial enum' too.
4055         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4056         is not allowed).
4057         Report from Kamil Skalski <nazgul@omega.pl>.
4058
4059         Fix #74309.
4060         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4061         have partial containers too.
4062
4063         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4064         in block' checks to Block.CheckInvariantMeaningInBlock.
4065         * statement.cs (Block.GetKnownVariableInfo): Make private.
4066         (Block.IsVariableUsedInChildBlock): Remove.
4067         (Block.IsVariableUsedInBlock): Likewise.
4068         (Block.CheckInvariantMeaningInBlock): New.  Show location of
4069         conflicting declaration.
4070         (Block.AddVariable): Make error messages less long-winded and more
4071         specific.  Show location of conflicting declaration.
4072         * parameter.cs (Parameters.Location): New readonly property.
4073
4074 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4075
4076         Clean up semantics of invoking ResolveMemberAccess.
4077         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4078         can have an instance, ensure that we pass in a non-TypeExpression
4079         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
4080         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4081         argument.  Update to changes and simplify.
4082         (FieldExpr.Emitinstance): Remove CS0120 check.
4083         (PropertyExpr.EmitInstance): Likewise.
4084         * expression.cs (Argument.Resolve): Likewise.
4085         (Invocation.DoResolve): Update to changes in semantics of
4086         InstanceExpression.
4087
4088 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
4089
4090         Fix #74241
4091         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4092         customization.
4093         
4094         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4095
4096 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4097
4098         Fix difference in behaviour with commandline invocation.
4099         * driver.cs (Driver.Reset): New.
4100         (CompilerCallableEntryPoint): Call it.
4101
4102         * statement.cs (If.Resolve): Avoid spurious "uninitialized
4103         variable" warnings if the boolean expression failed to resolve.
4104
4105 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
4106
4107         * attribute.cs: Fix the union of several permissions when some of them
4108         are unrestricted (so the result isn't an unrestricted permission set).
4109         Fix #74036.
4110
4111 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4112
4113         * ecore.cs (MemberExpr): New class.  Convert from interface
4114         IMemberExpr.
4115         (MemberExpr.ResolveMemberAccess): Refactor and move here from
4116         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
4117         error checks.
4118         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4119         (MethodGroupExpr.IsExplicitImpl): Remove.
4120         (Expression.GetFieldFromEvent): Remove.
4121         (SimpleName.MemberStaticCheck): Remove.
4122         (SimpleName.DoSimpleNameResolve): Update to changes.
4123         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4124         (MemberAccess.IdenticalNameAndTypeName): Remove.
4125         (MemberAccess.error176): Move to MemberExpr.
4126         (MemberAccess.DoResolve): Update to changes.
4127         (BaseAccess.DoResolve): Likewise.
4128
4129 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
4130
4131         C# 2.0 Conditional attribute class implementation
4132         
4133         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4134         Analyzes class whether it has attribute which has ConditionalAttribute
4135         and its condition is not defined.
4136         
4137         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4138         (Class.IsExcluded): New method. Search for at least one defined
4139         condition in ConditionalAttribute of attribute class.
4140
4141 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4142
4143         * ecore.cs (PropertyExpr): Derive from Expression, not
4144         ExpressionStatement.
4145         (PropertyExpr.EmitStatement): Remove.
4146
4147 2005-03-29  Raja R Harinath  <rharinath@novell.com>
4148
4149         Fix #74060.
4150         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4151         internal field "value__" of an enum be private.  The examples for
4152         "value__" that I found on MSDN all used FieldAttributes.Private.
4153
4154         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4155         Don't mention IL method attribute names.
4156
4157         Fix #47991.  Remove a TODO.
4158         * statement.cs (Block.Toplevel): Make into a field.
4159         (Block.Parameters): Move into ToplevelBlock.
4160         (Block.known_variables): Rename from child_variable_names.
4161         (Block.Block): Remove variants that take Parameters.  Initialize
4162         'Toplevel' with the immediately surrounding toplevel block.
4163         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
4164         LocalInfo parameter.
4165         (Block.GetKnownVariableInfo): New.
4166         (Block.IsVariableNameUsedInChildBlock): Update.
4167         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
4168         the block, even though it may not be in scope.
4169         (Block.AddVariable): Remove Parameters parameter.  Use
4170         Toplevel.Parameters instead.
4171         (Block.AddConstant): Remove Parameters parameter.
4172         (Block.GetParameterReference): Update to use Toplevel.Parameters.
4173         (Block.IsParamaterReference): Likewise.
4174         (Block.IsLocalParameter): Likewise.  Simplify a lot.
4175         (ToplevelBlock.Parameters): New.  Moved from Block.
4176         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
4177         initialize Parameters to a non-null value.
4178         * cs-parser.jay: Update to changes.
4179         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4180         simple names that mean different things in the same block.  Use
4181         Block.IsVariableNameUsedInBlock.
4182
4183 2005-03-28  Raja R Harinath  <rharinath@novell.com>
4184
4185         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4186
4187 2005-03-26  Raja R Harinath  <harinath@acm.org>
4188
4189         Fix #73038.
4190         * assign.cs (Assign.DoResolve): When the RHS of an assignment
4191         fails to resolve, ensure that the LHS is still resolved as an
4192         lvalue.
4193
4194 2005-03-25  Raja R Harinath  <harinath@acm.org>
4195
4196         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4197         ec.ContainerType.
4198         (Enum.current_ec): Remove.
4199         (Enum.LookupEnumValue): Remove EmitContext argument.
4200         Just uses the one created during DefineType.
4201         (Enum.FindMembers): Update.
4202         * expression.cs (MemberAccess.DoResolve): Update.
4203
4204 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
4205
4206         * assign.cs (Assign.DoResolve): Check for CS1717 when
4207         source and target are same (uses Equals).
4208
4209         * expression.cs (LocalVariableReference, ParameterReference,
4210         This): Implemented Equals, GetHashCode.
4211
4212         * statement.cs (Block.GetParameterReference): Removed useless
4213         local variable.
4214
4215 2005-03-22  Raja R Harinath  <rharinath@novell.com>
4216
4217         Fix cs0128.cs
4218         * statement.cs (Block.AddVariable): Ensure that we skip implicit
4219         blocks before deciding whether the error is cs0136 or cs0128.
4220
4221         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4222         (using_alias_directive, using_namespace_directive): Pass
4223         MemberName, not an expression to Namespace.UsingAlias and
4224         Namespace.Using.
4225         (MakeName): Use the MemberName of the namespace.
4226         * namespace.cs (Namespace.MemberName): New.
4227         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4228         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4229         Likewise.
4230         * decl.cs (MemberName.Name): Make readonly.
4231         (MemberName.FromDotted): New "constructor".
4232         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4233         (MemberCore.Name): Compute from MemberName on demand.
4234         (MemberCore.SetMemberName): Provide a way to change the
4235         MemberName.
4236         (MemberCore.AddToContainer): Don't take a fullname parameter.
4237         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4238         fully qualified name of the container to the member name.
4239         (TypeContainer.AddToTypeContainer): Use a fully qualified name
4240         only if the type is a member of the root container.
4241         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4242         MemberName.Left rather than searching for an embedded ".".
4243         (PartialContainer.CreatePart): Update to changes in RootContext.
4244         (MemberBase.ShortName): Turn into a property.  Use
4245         MemberCore.SetMemberName.
4246         (MemberBase.ExplicitInterfaceName): Remove.
4247         (MemberBase.UpdateMemberName): Remove.
4248         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4249         (PropertyBase.SetMemberName): New override.
4250         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4251         (Tree.GetDecl): New.
4252         (Tree.AllDecls): Rename from Decls.
4253         * attribute.cs, enum.cs, report.cs: Update to changes.
4254         * driver.cs (MainDriver): Use MemberName.FromDotted on
4255         RootContext.MainClass.
4256
4257 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
4258
4259         * class.cs (FixedField.Define): Check for CS1664 and more sanity
4260         checks.
4261
4262         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4263
4264 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
4265
4266         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4267         property accessor modifiers.
4268
4269         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4270         fixed buffer attribute (CS1716).
4271         (PropertyMethod.HasCustomAccessModifier): When property accessor
4272         has custom modifier.
4273
4274         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4275         modifiers.
4276         (PropertyExpr.DoResolveLValue): Add CS0272.
4277
4278 2005-03-17  Miguel de Icaza  <miguel@novell.com>
4279
4280         * convert.cs: When converting to a pointer, use the proper Conv.U
4281         or Conv.I depending on the source data type.
4282
4283         * cs-tokenizer.cs: Make the size for large decimal constants,
4284         fixes #72957.
4285
4286 2005-03-17  Martin Baulig  <martin@ximian.com>
4287
4288         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4289         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
4290
4291 2005-03-17  Martin Baulig  <martin@ximian.com>
4292
4293         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4294         to bool so we can return an error condition.
4295         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4296         returned an error.
4297
4298 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
4299
4300         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4301         attributes.
4302
4303 2005-03-16  Raja R Harinath  <rharinath@novell.com>
4304
4305         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4306         Refactor to avoid traversing the list of assemblies, and to avoid
4307         string concatenation.
4308         * typemanager.cs (guid_attr_type): Remove.
4309         (negative_hits, pointers, references): Remove hashes.
4310         (type_hash): New.
4311         (GetConstructedType): New.  Uses type_hash to handle constructed
4312         types (arrays, references, pointers).
4313         (GetReferenceType, GetPointerType): Use it.
4314         (GetNestedType): New.  Uses type_hash to handle nested types of
4315         reflected types.
4316         (LookupType, LookupTypeDirect): Remove.
4317         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
4318         'types' hash and LookupTypeReflection directly.
4319         (params_string, params_object): Use GetConstructedType.
4320         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
4321         top-level types.
4322         (Namespace.Lookup): Use cached_types.
4323         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4324         provided by old TypeManager.LookupType.
4325         * rootcontext.cs (MakeFQN): Remove.
4326         * decl.cs (DeclSpace.MakeFQN): Likewise.
4327         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4328         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4329         TypeManager.GetConstructedType.
4330         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4331
4332 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
4333
4334         * cs-parser.jay: Fix build.
4335
4336 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
4337
4338         * class.cs (TypeContainer.CircularDepException) New nested
4339         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
4340
4341         * cs-parser.jay: Reports CS1527 for any namespace element.
4342
4343         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4344         Added CS0407.
4345
4346         * expression.cs (ParameterReference.IsAssigned): Changed error to
4347         CS0269.
4348         (Error_WrongNumArguments): Moved CS0245 detection here.
4349
4350         * statement.cs (Return.Resolve): Add CS1622 report.
4351
4352 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
4353
4354         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4355
4356 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
4357
4358         * attribute.cs expression.cs: Get rid of some allocations.
4359
4360 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
4361
4362         * doc.cs : just eliminate the latest change.
4363
4364 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4365
4366         * doc.cs : commented out the latest change. It breaks xml-030.cs
4367
4368 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4369
4370         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4371           fail. So invoke CreateType() in FindDocumentedType().
4372
4373 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4374
4375         * cs-tokenizer.cs : added IsKeyword().
4376         * doc.cs : Detect keyword incorrectly used as identifier.
4377           Allow identifiers prefixed by @.
4378
4379 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
4380
4381         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4382         It caused exception in namespace resolving (again!).
4383         
4384         * class.cs (Class.ctor): Removed exit.
4385         (PropertyMethod.ctor): ditto.
4386         
4387         * codegen.cs (Codegen.Reset): Reset static data.
4388         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4389         
4390         * cs-tokenizer.cs (Cleanup): Removed.
4391         
4392         * driver.cs (GetSystemDir): Rewrote to one line command.
4393         It caused problem with unloaded dynamic modules.
4394         (UnixParseOption): Removed Exit.
4395         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4396         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4397         Now can be mcs used as library.
4398         
4399         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4400         empty location.
4401         
4402         * location.cs (Reset): Reset static data.
4403         
4404         * namespace.cs (Reset): Reset static data.
4405         
4406         * report.cs (Report.Reset): Reset static data.
4407         
4408         * rootcontext.cs (RootContext.Reset): Reset static data.
4409         
4410         * tree.cs (RootTypes.ctor): Use Location.Null
4411         
4412         * typemanager.cs (TypeManager.Reset): Reset static data.
4413         (CoreLookupType): Removed Exit.
4414         (TypeHandle.Reset): Reset static data.
4415         
4416 2005-03-10  Raja R Harinath  <rharinath@novell.com>
4417
4418         Fix #73516.
4419         * typemanager.cs (ComputeNamespaces): Import namespaces from
4420         referenced modules too.
4421
4422 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4423
4424         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4425         than '.'.
4426
4427 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4428
4429         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4430         enclosing DeclSpace.  This ensures that a name-lookup populates
4431         more caches and there are fewer 'TypeExpression's.  Carve out
4432         nested type lookup into ...
4433         (LookupNestedTypeInHierarchy): ... this.
4434
4435 2005-04-15  Martin Baulig  <martin@ximian.com>
4436
4437         Merged r41590 from MCS and make it work in the generics land.
4438
4439         * generic.cs (TypeParameter.UpdateConstraints): Removed the
4440         `check' argument.
4441
4442         * class.cs (PartialContainer.UpdateConstraints): Removed.
4443         (PartialContainer.CheckConstraints): Removed.
4444         (PartialContainer.SetParameterInfo): Store the constraints here.
4445         (PartialContainer.DefineTypeParameters): New public method;
4446         resolve the type parameter's constraints here.  Note that the
4447         PartialContainer doesn't have an EmitContext anymore, so we must
4448         do this in the ClassPart.
4449
4450 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4451
4452         Clean up a few partial-class semantics.  
4453         Fixes test-357.cs and cs1618-2.cs.
4454         * cs-parser.jay (struct_declaration): Use 'current_class' as
4455         parent of newly-created struct.  Remove call to Register ().
4456         Use 'pop_current_class' to complete handing the current struct.
4457         (interface_declaration): Likewise.
4458         (class_declaration): Likewise.
4459         (enum_declaration): Use 'current_class' as parent of newly created
4460         enum.
4461         (delegate_declaration): Likewise.
4462         (pop_current_class): New function.  This is used to handle closing
4463         up the 'current_class' and 'current_container', and pointing them
4464         to the enclosing class/container.
4465         (CSharpParser): Initialize 'current_class' too.
4466         * decl.cs (MemberCore): Add check for invariant: a partial
4467         container is not a parsed entity, and thus does not enclose any
4468         parsed members.
4469         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4470         (DeclSpace.BaseTypeExpr): Use it.
4471         (DeclSpace.LookupType): Add check for invariant.
4472         * class.cs (TypeContainer): Add check for invariant: a nested
4473         class should have the same NamespaceEntry as its enclosing class.
4474         (TypeContainer.EmitFieldInitializers): Make virtual.
4475         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4476         MemberCore.
4477         (TypeContainer.Register): Remove.
4478         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4479         null.  Use TypeResolveEmitContext for resolving base types and
4480         interfaces.  Move initialization of Parts.TypeBuilder here from
4481         ...
4482         (TypeContainer.DefineNestedTypes): ... here.
4483         (PartialContainer): Take a Namespace not a NamespaceEntry.
4484         (PartialContainer.Create): Don't use Register.  Call the
4485         appropriate Add... function directly.
4486         (ClassPart): Take both the PartialContainer and the enclosing
4487         class as constructor arguments.
4488         (ClassPart.EmitFieldInitializers): Override.
4489         (ClassPart.PartFindNestedTypes): Remove.
4490         (FieldBase.GetInitializerExpression): Resolve the initializer
4491         expression in the emit context of the enclosing class.
4492         * tree.cs (RootTypes): Remove Register ().
4493         
4494 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
4495
4496         * cs-parser.jay: Removed CS0134.
4497         
4498         * driver.cs: Removed CS1901.
4499         
4500         * expression.cs (SizeOf.DoResolve): Don't report CS0233
4501         for predefined types.
4502
4503 2005-03-07  Duncan Mak  <duncan@novell.com>
4504
4505         * codegen.cs (Save):  Catch UnauthorizedAccessException as
4506         well. Fixes bug #73454.
4507
4508 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
4509
4510         * cs-tokenizer.cs (xtoken): Add CS1035.
4511         
4512         * class.cs (MethodData.Define): Add CS0683.
4513         (FieldMember.ctor): Add CS0681.
4514
4515 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4516
4517         * ecore.cs (SimpleName.DoResolve): Rename from
4518         SimpleName.DoResolveAllowStatic.
4519         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4520         Pass 'intermediate' flag to MemberStaticCheck.
4521         (SimpleName.MemberStaticCheck): Skip "static check" only in case
4522         of "intermediate" lookups via MemberAccess.
4523         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
4524         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4525
4526 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4527
4528         Fix #73394.
4529         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4530         slipped in because of variable names that are identical to a
4531         builtin type's BCL equivalent ('string String;', 'int Int32;').
4532         (PropertyExpr.EmitInstance): Likewise.
4533
4534 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
4535
4536         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4537         
4538         * report.cs (warning_ignore_table): Made public.
4539
4540 2005-03-04  Raja R Harinath  <rharinath@novell.com>
4541
4542         Fix #73282.
4543         * class.cs (MethodData.Emit): Pass 'container' to
4544         container.GetObsoleteAttribute instead of 'container.Parent'.
4545
4546 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
4547
4548         * cs-parser.jay: Add 1534 error test.
4549
4550         * iterators.cs (Yield.CheckContext): Add error 1629.
4551         (Iterator.ctor): Save unsafe modifier.
4552         (MoveNextMethod.DoEmit): Restore unsafe context.
4553
4554         * namespace.cs (UsingAlias): Better error message.
4555
4556 2005-03-03  Dan Winship  <danw@novell.com>
4557
4558         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
4559         the warning message [#73219]
4560
4561 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4562
4563         Fix compile with MCS 1.0.0.0.
4564         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
4565         w_restore to not depend on string constant folding.
4566
4567 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4568
4569         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
4570         CS0246 check to users who passed 'silent = false'.
4571         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
4572         check.
4573         (SimpleName.SimpleNameResolve): Update.
4574         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
4575         (MemberAccess.IdenticalNameAndTypeName): Update.
4576         * doc.cs (FindDocumentedTypeNonArray): Update.
4577
4578 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
4579
4580         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
4581         * parameters.cs (ComputeAndDefineParameters): Remove.
4582         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
4583         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
4584         Use GetParameterInfo.
4585
4586 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
4587
4588         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
4589
4590 2005-03-02  Raja R Harinath  <rharinath@novell.com>
4591
4592         Unify DeclSpace.LookupType and DeclSpace.FindType.
4593         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
4594         is in charge of defining nested types on demand.
4595         (DeclSpace.LookupType): Use it when the current_type is a
4596         TypeBuilder.  Use LookupTypeDirect for reflected types.
4597         (DeclSpace.FindType): Remove.
4598         (DeclSpace.LookupInterfaceOrClass): Likewise.
4599         (DeclSpace.DefineTypeAndParents): Likewise.
4600         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
4601         DeclSpace.LookupType.
4602         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
4603         * typemanager.cs (LookupType): Simplify.
4604         (AddUserType): Remove type from negative_hits.
4605         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
4606         * class.cs (TypeContainer.FindMembers): Move handling of nested
4607         types ...
4608         (TypeContainer.FindMembers_NestedTypes): ... here.
4609         (TypeContainer.FindNestedType): Implement override.
4610         (ClassPart.FindNestedType): Delegate to PartialContainer.
4611         (ClassPart.PartFindNestedType): Looks up the nested types of the
4612         part alone.
4613
4614 2005-04-14  Martin Baulig  <martin@ximian.com>
4615
4616         * generic.cs (ConstructedType): Moved all the type lookup and
4617         nested class logic into SimpleName.
4618         (ConstructedType.ResolveConstructedType): Our underlying type is
4619         already fully resolved; all the type lookup stuff is in
4620         SimpleName.
4621
4622         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
4623         constructed types here instead of in ConstructedType.
4624
4625         * decl.cs (MemberName.GetTypeExpression): Always create a
4626         SimpleName, not a ConstructedType.
4627         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
4628
4629 2005-03-02  Martin Baulig  <martin@ximian.com>
4630
4631         * class.cs (TypeContainer.DoDefineMembers): We also need a default
4632         static constructor in static classes.
4633
4634 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
4635
4636         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
4637         sizeParamIndex is not specified.
4638
4639 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
4640
4641         Fix #73117
4642         * report.cs (WarningMessage.IsEnabled): Missing null check.
4643
4644 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4645
4646         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
4647         in the fields and not in the properties.
4648
4649 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
4650
4651         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
4652         fields as well.
4653
4654 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4655
4656         * attribute.cs: Small refactoring (improved robustness).
4657         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
4658         (ValidateGuid): Removed.
4659         (Resolve): Removed referenced to above mentioned.
4660         (GetAttributeUsage): Made private and changed to work without
4661         class assistance.
4662         (GetIndexerAttributeValue): Don't crash.
4663         (GetConditionalAttributeValue): Ditto.
4664         (GetClsCompliantAttributeValue): Ditto.
4665         (ExtractSecurityPermissionSet): All attributes exceptions are
4666         error 648.
4667         (GetPropertyValue): New helper.
4668         (GetMethodImplOptions): New method.
4669         (DefinePInvokeMethod): Reuse common code. Implemented handling of
4670         some missing properties.
4671         
4672         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
4673         (Method.ApplyAttributeBuilder): Updated.
4674         
4675         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
4676         exception.
4677
4678 2005-02-28  Raja R Harinath  <rharinath@novell.com>
4679
4680         Fix #73052.
4681         * report.cs (Report.SymbolRelatedToPreviousError): Handle
4682         non-simple types (array, pointer, reference).
4683
4684 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4685
4686         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
4687
4688         * class.cs (MethodCore.IsDuplicateImplementation): Special error
4689         for operators.
4690         (Method.CheckBase): Catch wrong destructor here.
4691         (MethodData.Define): Add errors 550, 668.
4692
4693         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
4694
4695         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
4696
4697         * pending.cs (VerifyPendingMethods): Add error 551.
4698
4699         * typemanager.cs (CSharpName): Next error report helper.
4700
4701 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
4702
4703         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
4704         attributes. Removed useless attribute double check.
4705         It saves almost 2MBs for corlib.
4706
4707 2005-02-25  Raja R Harinath  <rharinath@novell.com>
4708
4709         Fix #72924.
4710         * statement.cs (ExpressionStatement.Resolve): Make robust to being
4711         called twice in case of error.
4712
4713 2005-02-23  Chris Toshok  <toshok@ximian.com>
4714
4715         Fix compiler portions of #72827.
4716         * statement.cs (Block.Emit): call Begin/EndScope on the
4717         EmitContext instead of the ILGenerator.
4718
4719         * codegen.cs (EmitContext.BeginScope): new method, call
4720         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
4721         we have one.)
4722         (EmitContext.BeginScope): same, but EndScope and CloseScope
4723
4724         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
4725         offset and call the superclass's OpenScope(int) with it.
4726         (SymbolWriter.CloseScope): get the current il
4727         offset and call superclass's CloseScope(int) with it.
4728
4729 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
4730
4731         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
4732         CS1677 for out and ref as well.
4733
4734         * class.cs (Method.Define): Add error CS1599 detection.
4735         
4736         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
4737         
4738         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
4739         
4740         * delegate.cs (Delegate.Define): Add error CS1599 detection.
4741         
4742         * support.cs.cs (ModifierDesc): New helper method.
4743
4744 2005-02-23  Raja R Harinath  <rharinath@novell.com>
4745             Abin Thomas  <projectmonokochi@rediffmail.com>
4746             Anoob V E  <projectmonokochi@rediffmail.com>
4747             Harilal P R  <projectmonokochi@rediffmail.com>
4748
4749         Fix #57851, #72718.
4750         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
4751         MemberLookup (used for error reporting) actually returns a result.
4752         Fix error report number (122, not 112).
4753
4754 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
4755             Anoob V E  <projectmonokochi@rediffmail.com>
4756             Harilal P R  <projectmonokochi@rediffmail.com>
4757
4758         Fix #71134.
4759         * pending.cs (PendingImplementation.GetAbstractMethods):
4760         Find NonPublic members too.
4761
4762 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
4763
4764         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
4765         Fixed error 217.
4766         
4767         * class.cs (MethodCore.CheckMethodAgainstBase):
4768         Add error 239 report.
4769
4770 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
4771
4772         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
4773         
4774         * class.cs (Operator.Define): Add error 217 report.
4775         
4776 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4777
4778         Fix #68955.
4779         * expression.cs (Invocation.IsApplicable): Make public.
4780         (Invocation.IsParamsMethodApplicable): Likewise.
4781         * delegate.cs (Delegate.VerifyApplicability): Don't use
4782         Invocation.VerifyArgumentCompat for parameter applicability
4783         testing.  Use Invocation.IsApplicable and
4784         Invocation.IsParamsMethodApplicable.
4785
4786 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
4787
4788         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
4789         
4790         * class.cs (Operator.Define): Add error 217 report.
4791         
4792 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4793
4794         * namespace.cs (UsingEntry.Resolve): Undo change below.
4795
4796 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4797
4798         Fix #72756.
4799         * ecore.cs (Expression.MemberLookupFailed): Add argument to
4800         disable the error message when the extended MemberLookup also
4801         fails.
4802         (Expression.MemberLookupFinal): Update.
4803         (SimpleName.DoSimpleNameResolve): Update.
4804         * expression.cs (MemberAccess.ResolveNamespaceOrType):
4805         Don't use MemberLookupFinal.
4806         (New.DoResolve): Update.
4807         (BaseAccess.CommonResolve): Update.
4808
4809 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4810
4811         Fix #72732.
4812         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
4813         occured previously, don't resolve again.
4814
4815 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
4816
4817         Fix #69949
4818         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
4819         argument. Call ResolveAttributeUsage for unresolved.
4820         when types doesn't match ctor arguments.
4821         
4822         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
4823         for nested attribute classes.
4824         (Class.attribute_usage): Removed.
4825         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
4826         for attribute class.
4827         
4828         * ecore.cs (IsAttribute): Removed.
4829         
4830         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
4831         
4832         * rootcontext.cs (RegisterAttribute): Removed, attributes are
4833         now normal types.
4834         (attribute_types): Removed.
4835         (EmitCode): Global attributes are emited as the latest.
4836
4837 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
4838
4839         * class.cs (EmitFieldInitializers): Don't emit field initializer
4840         for default values when optimilization is on.
4841         
4842         * constant.cs (Constant.IsDefaultValue): New property.
4843         
4844         * driver.cs: Add /optimize handling.
4845         
4846         * constant.cs,
4847         * ecore.cs,
4848         * literal.cs: Implement new IsDefaultValue property.
4849         
4850         * rootcontext.cs (Optimize): New field, holds /optimize option.
4851
4852 2005-02-18  Raja R Harinath  <rharinath@novell.com>
4853
4854         Fix crasher in re-opened #72347.
4855         * namespace.cs (Namespace.Lookup): Return null if
4856         DeclSpace.DefineType returns null.
4857
4858         Fix #72678.
4859         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
4860
4861 2005-02-18  Raja R Harinath  <rharinath@novell.com>
4862
4863         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
4864         now returns null if it cannot resolve to an lvalue.
4865         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
4866         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
4867         returned null.  Remove check for SimpleName.
4868         (EventExpr.DoResolveLValue): New.
4869         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
4870         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
4871         error from ...
4872         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
4873         avoid CS0131 error.
4874         (Unary.ResolveOperator): Move CS0211 check ...
4875         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
4876         CS0131 error.
4877         (Unary.DoResolveLValue): Simplify.
4878         (AddressOf.DoResolveLValue): New.
4879         (ArrayAccess.DoResolveLValue): New.
4880
4881 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
4882
4883         * attribute.cs (Attribute.Resolve): Add arguments casting for
4884         when types doesn't match ctor arguments.
4885
4886 2005-02-16  Raja R Harinath  <rharinath@novell.com>
4887
4888         Fix parts of #63202.
4889         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
4890         lookup of operator in base type.  Ensure that all checks happen
4891         when the operator resolves to an "op_..." method.
4892
4893 2005-02-15  Raja R Harinath  <rharinath@novell.com>
4894
4895         Fix #71992.
4896         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
4897         'ignore_cs0104' parameter.  Pass it to ...
4898         (NamespaceEntry.Lookup): ... this.
4899         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
4900         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
4901         (TypeLookupExpression.DoResolveAsTypeStep): Update.
4902         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
4903         Update.  Request that cs0104 errors be ignored.
4904         (ComposedCast.ResolveAsTypeStep): Update.
4905
4906 2005-02-14  Raja R Harinath  <rharinath@novell.com>
4907
4908         Fix #59209.
4909         * expression.cs (Invocation.BetterFunction): Remove support for
4910         comparing virtual functions and their overrides.
4911         (Invocation.IsOverride): New.
4912         (Invocation.OverloadResolve): Don't consider 'override' functions
4913         during candidate selection.  Store them in a lookaside list.
4914         If the selected method is a 'virtual' function, use the list to
4915         find any overrides that are closer to the LHS type.
4916
4917 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
4918
4919         * expression.cs (New.DoResolve): Add complex core type reduction.
4920         (New.Constantify): Converts complex core type syntax like 'new int ()'
4921         to simple constant.
4922         
4923 2005-02-14  Raja R Harinath  <rharinath@novell.com>
4924
4925         * decl.cs (EntryType.EntryType): New constructor to create an
4926         updated copy of a cache entry.
4927         (MemberCache.AddMethods): Use it.
4928         (MemberCache.ClearDeclaredOnly): Remove.
4929         (MemberCache.MemberCache): Update.
4930
4931 2005-02-11  Miguel de Icaza  <miguel@novell.com>
4932
4933         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
4934         variable.  This one is represents the actual low-level declaration
4935         of the method, as opposed to the semantic level `IsStatic'.   
4936
4937         An anonymous method which is hosted into a static method might be
4938         actually an instance method.  IsStatic would reflect the
4939         container, while MethodIsStatic represents the actual code
4940         generated.
4941
4942         * expression.cs (ParameterReference): Use the new MethodIsStatic
4943         instead of IsStatic.
4944
4945         * anonymous.cs (AnonymousMethod.Compatible): Pass the
4946         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
4947         set on the current EmitContext. 
4948
4949         * expression.cs (Cast): Overload DoResolveLValue so we can pass
4950         resolve our casted expression as an LValue.  This triggers the
4951         proper LValue processing that is later required by Assign.
4952
4953         This fixes 72347.
4954
4955         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
4956
4957 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
4958
4959         C# 2.0 Fixed buffer implementation
4960
4961         * anonymous.cs: Update after RegisterHelperClass renaming.
4962
4963         * attribute.cs (AttributeTester.fixed_buffer_cache):
4964         Cache of external fixed buffers.
4965         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
4966         implementation if field is fixed buffer else null.
4967
4968         * class.cs
4969         (TypeContainer.AddField): Accept FieldMember instead of Field.
4970         (FieldBase.IsFieldClsCompliant): Extracted code from
4971         VerifyClsCompliance descendant customization.
4972         (FixedField): New class handles fixed buffer fields.
4973         (FixedFieldExternal): Keeps information about imported fixed
4974         buffer.
4975         (IFixedField): Make access to internal or external fixed buffer
4976         same.
4977
4978         * cs-parser.jay: Add fixed buffer parsing.
4979
4980         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
4981         buffer.
4982
4983         * expression.cs (Indirection): Extended implementation to accept
4984         fixed buffer field.
4985         (PointerArithmetic.Emit): Get element from fixed buffer as well.
4986         (ElementAccess.MakePointerAccess): Get type as parameter.
4987         (DoResolve): Add fixed buffer field expression conversion.
4988         (DoResolveLValue): Ditto.
4989         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
4990         (ArrayPtr): Derives from FixedBufferPtr.
4991         (ArrayPtr.Emit): Add extra emit for array elements.
4992
4993         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
4994
4995         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
4996         for compiler generated types.
4997         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
4998
4999         * statement.cs (Fixed): Refactored to be easier add fixed buffer
5000         and consume less memory.
5001         (Fixed.Resolve): Add fixed buffer case.
5002
5003         * typemanager.cs (compiler_generated_attr_ctor,
5004         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5005         (HasElementType): Add our own implementation to work on every
5006         runtime.
5007
5008 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5009
5010         * anonymous.cs (CaptureContext): Track whether `this' has been
5011         referenced.   
5012
5013         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
5014         only captured `this' if it was implicitly done (instance
5015         methods/variables were used). 
5016
5017         * codegen.cs (EmitContext.CaptureThis): New method to flag that
5018         `this' must be captured.
5019
5020 2005-01-30  Miguel de Icaza  <miguel@novell.com>
5021  
5022         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5023         is null it means that there has been no need to capture anything,
5024         so we just create a sibling.
5025
5026         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5027
5028         Just a partial fix.  The other half is fairly elusive.
5029         
5030 2005-02-10  Raja R Harinath  <rharinath@novell.com>
5031
5032         Fix #52586, cs0121-4.cs.
5033         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
5034         and return a hashtable.
5035         (MemberCache.ClearDeclaredOnly): New.
5036         (MemberCache.MemberCache): Update to change.  Make a deep copy of
5037         the method_hash of a base type too.
5038         (MemberCache.AddMethods): Adapt to having a deep copy of the base
5039         type methods.  Overwrite entries with the same MethodHandle so
5040         that the ReflectedType is correct.  The process leaves in base
5041         virtual functions and their overrides as distinct entries.
5042         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
5043         matters since it was boxed in a ArrayList before.
5044         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5045         modifier.
5046         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
5047         case of a virtual function and its override (choose the overload
5048         as better).
5049         (Invocation.OverloadResolve): Avoid 'override' members during
5050         'applicable_type' calculation.
5051
5052 2005-03-28  Raja R Harinath  <rharinath@novell.com>
5053
5054         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5055         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5056         GetTypeHandle.  It is possible for a reflected type to derive from
5057         a TypeBuilder (e.g., int[] derives from the TypeBuilder
5058         System.Array during mscorlib compilation).
5059         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5060         contain a method_hash, don't create one either.  Don't create a
5061         deep copy of the base cache's method_hash.
5062         (MemberCache.SetupCache): Rename back from DeepCopy.
5063         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5064         already initialized.  If we see an override function, add its
5065         underlying base virtual function to the member_hash too.
5066
5067 2005-02-09  Raja R Harinath  <rharinath@novell.com>
5068
5069         Combine two near-redundant caches.
5070         * typemanager.cs (method_params): Rename from method_internal_params.
5071         (TypeManager.GetParameterData): New.  Replace
5072         Invocation.GetParameterData.
5073         (TypeManager.LookupParametersByBuilder): Remove.
5074         * expression.cs (Invocation.method_parameter_cache): Remove.
5075         (Invocation.GetParameterData): Remove.
5076         Update to changes.
5077         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5078         Update to changes.
5079
5080 2005-02-08  Raja R Harinath  <rharinath@novell.com>
5081
5082         Fix #72015.
5083         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5084         TypeManager.multicast_delegate_type is null, resolve it by looking
5085         up "System.MulticastDelegate".
5086         * rootcontext.cs (RootContext.ResolveCore): Simplify.
5087
5088 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
5089             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
5090             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
5091
5092         Fix cs0164.cs.
5093         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5094         (LabeledStatement.AddReference): New.  Set 'referenced'.
5095         (Goto.Resolve): Use it.
5096
5097 2005-02-05  John Luke  <john.luke@gmail.com>
5098
5099         * driver.cs: remove duplicate -doc line in Usage ()
5100
5101 2005-02-04  Raja R Harinath  <rharinath@novell.com>
5102
5103         * location.cs (Location.AddFile): Fix CS2002 error report.
5104
5105 2005-02-02  Martin Baulig  <martin@ximian.com>
5106
5107         * delegate.cs (Delegate.DefineType): Report an internal error if
5108         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5109         details.        
5110
5111 2005-02-02  Raja R Harinath  <rharinath@novell.com>
5112
5113         Fix a crasher in a variant of #31984.
5114         * const.cs (Constant.CheckBase): New override that defers the
5115         new-or-override check in case the base type hasn't been populated
5116         yet.
5117         (Constant.Define): Ensure the new-or-override check is performed.
5118
5119 2005-02-01  Duncan Mak  <duncan@ximian.com>
5120
5121         * const.cs (LookupConstantValue): Check that `ce' is not null
5122         before calling GetValue ().
5123
5124 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5125
5126         Fix test-334.cs (#69519).
5127         * cs-parser.jay (using_alias_directive): Pass in an expression to
5128         NamespaceEntry.UsingAlias.
5129         (using_namespace_directive): Pass in an expression to
5130         NamespaceEntry.Using.
5131         (namespace_name): Don't flatten to a string.
5132         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5133         (NamespaceEntry.AliasEntry.Resolve): Lookup using
5134         ResolveAsTypeStep.
5135         (NamespaceEntry.UsingEntry): Likewise.
5136         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5137         changes.
5138         (NamespaceEntry.LookupForUsing): Remove.
5139         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5140         names.
5141         (NamespaceEntry.Lookup): Remove support for dotted names.
5142
5143 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5144
5145         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5146         split into two.
5147         (NamespaceEntry.ImplicitParent): Compute on demand.
5148         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5149         parallels the current.
5150         (NamespaceEntry.LookupForUsing): Use it.
5151         (NamespaceEntry.Lookup): If the current namespace-entry is
5152         implicit, don't search aliases and using tables.
5153
5154 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5155
5156         Fix #31984.
5157         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5158         BaseCache here.
5159         (TypeContainer.BaseCache): Compute on demand.
5160         (TypeContainer.FindMembers): Define constants and types if they're
5161         not already created.
5162         (FieldMember.Define): Move resetting of ec.InUnsafe before error
5163         check.
5164         * const.cs (Constant.Define): Make idempotent.
5165
5166 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5167
5168         * pending.cs: Produce better code (no nops produced by using Ldarg
5169         + value).
5170         
5171         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5172         i - 1' it should be arg + 1.
5173
5174         Fixes bug #71819.
5175
5176 2005-01-28  Raja R Harinath  <rharinath@novell.com>
5177
5178         * attribute.cs (Attribute.CheckAttributeType): Make private
5179         non-virtual.
5180         (Attribute.ResolveType): Make virtual.
5181         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5182         handling of RootContext.Tree.Types.
5183
5184 2005-01-27  Raja R Harinath  <rharinath@novell.com>
5185
5186         Update attribute-handling to use the SimpleName/MemberAccess
5187         mechanisms.
5188         * cs-parser.jay (attribute): Pass in an expression to the
5189         constructors of Attribute and GlobalAttribute.
5190         * attribute.cs (Attribute): Take an expression for the name.
5191         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
5192         passed in attribute name expression.
5193         (Attribute.CheckAttributeType): Use it.
5194         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5195         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5196         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
5197         argument to prevent error messages if the lookup fails.
5198
5199 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
5200
5201         * expression.cs (Indirection): Implemented IVariable interface
5202         to support indirection in AddressOf operator.
5203         (PointerArithmetic.Emit): Add optimalization for case where
5204         result can be precomputed.
5205
5206 2005-01-26  Martin Baulig  <martin@ximian.com>
5207
5208         * class.cs (TypeContainer.AttributeTargets): Return the correct
5209         AttributeTargets depending on our `Kind' instead of throwing an
5210         exception; fixes #71632.
5211
5212 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
5213
5214         Fix #71257
5215         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5216         constant members.
5217
5218 2005-03-17  Martin Baulig  <martin@ximian.com>
5219
5220         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5221         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
5222
5223 2005-03-17  Martin Baulig  <martin@ximian.com>
5224
5225         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5226         to bool so we can return an error condition.
5227         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5228         returned an error.
5229
5230 2005-03-17  Martin Baulig  <martin@ximian.com>
5231
5232         * generic.cs (TypeMananager.IsIEnumerable): New public method.
5233
5234         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
5235         converting from an array-type of T to `IEnumerable<T>'.
5236
5237 2005-03-16  Martin Baulig  <martin@ximian.com>
5238
5239         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
5240         (Nullable.LiftedUnaryMutator): New public class.
5241
5242         * expression.cs (UnaryMutator.DoResolve): Added support for
5243         Nullable Types.
5244
5245 2005-03-14  Martin Baulig  <martin@ximian.com>
5246
5247         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
5248
5249 2005-03-14  Martin Baulig  <martin@ximian.com>
5250
5251         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
5252         the comparision operators `<', `>', `<=' and `>='.
5253
5254 2005-03-13  Martin Baulig  <martin@ximian.com>
5255
5256         * generic.cs
5257         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
5258         avoid confusion with the `NullLiteral'.
5259         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
5260
5261 2005-03-13  Martin Baulig  <martin@ximian.com>
5262
5263         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
5264         comparing arbitrary types with the null literal.
5265
5266 2005-03-13  Martin Baulig  <martin@ximian.com>
5267
5268         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
5269         boolean operators '&&', '||', '&' and '|'.
5270         (Nullable.OperatorTrueOrFalse): New public class.
5271
5272         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
5273         instead of a `StaticCallExpr'; added support for nullables.
5274
5275 2005-03-10  Martin Baulig  <martin@ximian.com>
5276
5277         * expression.cs
5278         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
5279         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
5280
5281 2005-03-07  Martin Baulig  <martin@ximian.com>
5282
5283         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
5284         it work if `expr' is not an IMemoryLocation.
5285         (Nullable.Lifted): Implement IMemoryLocation.
5286         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
5287         target type.
5288
5289 2005-03-05  Martin Baulig  <martin@ximian.com>
5290
5291         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
5292         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
5293         (Nullable): Added support for lifted unary and binary operators.
5294
5295         * expression.cs (Unary.DoResolve): Added support for nullable types.
5296         (Binary.DoResolve): Likewise.
5297         (Conditional.DoResolve): Likewise.
5298
5299 2005-03-02  Martin Baulig  <martin@ximian.com>
5300
5301         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
5302
5303         * class.cs (ClassPart.SetParameterInfo): Override this.
5304         (PartialContainer.SetParameterInfo): Override this.
5305         (TypeContainer.CheckConstraints): New protected method.
5306         (PartialContainer.CheckConstraints): Override this and check
5307         whether the same contraints were specified in all parts of a
5308         partial generic type definition.
5309         (PartialContainer.UpdateConstraints): New public method.
5310
5311         * generic.cs (TypeParameter.UpdateConstraints): New public method.
5312
5313 2005-03-02  Martin Baulig  <martin@ximian.com>
5314
5315         Committing a patch from Carlos Alberto Cortez to fix #72887.
5316
5317         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
5318         casts from `T []' to `int []'.
5319
5320 2005-03-02  Martin Baulig  <martin@ximian.com>
5321
5322         * generic.cs (TypeManager.IsEqual): Make this symmetric.
5323
5324         * expression.cs (Binary.ResolveOperator): When resolving a
5325         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
5326         `=='.  Fixes #71866.  See gen-127.cs.
5327
5328 2005-03-02  Martin Baulig  <martin@ximian.com>
5329
5330         * class.cs (TypeContainer.DoDefineMembers): We also need a default
5331         static constructor in static classes.
5332
5333 2005-03-02  Martin Baulig  <martin@ximian.com>
5334
5335         * generic.cs
5336         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
5337         (Nullable.LiftedConversion): Added support for user-defined
5338         conversions.
5339
5340         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
5341
5342         * cs-parser.jay: Use ComposedCast everywhere instead of
5343         NullableType, so we don't need to check for NullableType
5344         everywhere.
5345         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
5346         case where we'll be resolved into a `parenthesized_expression_0'
5347         afterwards.
5348
5349         * convert.cs
5350         (Convert.UserDefinedConversion): Added nullable conversions.
5351
5352 2005-02-28  Martin Baulig  <martin@ximian.com>
5353
5354         * generic.cs (TypeManager.IsNullableType): New static method.
5355         (Nullable): New abstract class.
5356         (Nullable.NullLiteral): New public class.
5357         (Nullable.LiftedConversion): New public class.
5358
5359         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
5360         `builtin_types opt_nullable'.
5361
5362         * convert.cs
5363         (Convert.ImplicitConversionStandard): Added nullable conversions.
5364         (Convert.ExplicitConversionStandard): Likewise.
5365         (Convert.ExplicitConversion): Likewise.
5366
5367 2005-02-26  Martin Baulig  <martin@ximian.com>
5368
5369         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
5370         begin with a "?", for instance "?[]".  Don't do a type lookup if
5371         `dim' is empty.
5372
5373 2005-02-25  Martin Baulig  <martin@ximian.com>
5374
5375         The first part of Nullable Types :-)
5376
5377         * generic.cs (NullableType): New public class.
5378         (NullCoalescingOperator): New public class.
5379         (TypeArguments.Resolve): Add a CS0306 check.
5380
5381         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
5382         (opt_nullable): New rule.
5383         (type): Added `opt_nullable' to `namespace_or_type_name',
5384         `builtin_types' and `pointer_type'.
5385         (array_type): Added `opt_nullable'.
5386         (opt_rank_specifier_or_nullable): New rule; this is the
5387         combination of `opt_rank_specifier' and `opt_nullable'.
5388         (opt_error): New rule; catch errors here.
5389         (nullable_type_or_conditional): New rule; we use this to check for
5390         nullable and still detect the conditional operator.
5391         (local_variable_type): Use `opt_rank_specifier_or_nullable'
5392         instead `opt_rank_specifier'.
5393
5394         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
5395         for nullables.
5396
5397 2005-02-24  Martin Baulig  <martin@ximian.com>
5398
5399         * README, README.Changes: Removed; they're old and obsolete.
5400
5401 2005-02-22  Martin Baulig  <martin@ximian.com>
5402
5403         * generic.cs (TypeParameter.Resolve): If resolving the constraints
5404         returned an error, set `constraints' to null to avoid a crash
5405         later on.
5406         (TypeParameter.ResolveType): Likewise.
5407
5408 2005-02-22  Martin Baulig  <martin@ximian.com>
5409
5410         * generic.cs
5411         (Constraints.ResolveTypes): Protect against being called twice.
5412         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
5413         (TypeParameter.ResolveType): New public method; calls
5414         constraints.ResolveTypes().
5415         (TypeParameter.DefineType): Moved constraints.ResolveType() out
5416         into the new ResolveType().
5417         (GenericMethod.Define): Call ResolveType() on all our
5418         TypeParameter's.        
5419
5420 2005-02-21  Martin Baulig  <martin@ximian.com>
5421
5422         * generic.cs
5423         (TypeManager.generic_nullable_type): New static public field.
5424         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
5425
5426         * rootcontext.cs
5427         (RootContext.ResolveCore): Resolve "System.Nullable`1".
5428
5429 2005-02-15  Martin Baulig  <martin@ximian.com>
5430
5431         * generic.cs (ConstructedType.Constraints): Correctly check
5432         constraints if the argument type is a type parameter; fixes
5433         #72326. 
5434
5435 2005-02-02  Martin Baulig  <martin@ximian.com>
5436
5437         * delegate.cs (Delegate.DefineType): Report an internal error if
5438         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5439         details.        
5440
5441 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5442
5443         * pending.cs: Produce better code (no nops produced by using Ldarg
5444         + value).
5445         
5446         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5447         i - 1' it should be arg + 1.
5448
5449         Fixes bug #71819.
5450         
5451 2005-01-26  Martin Baulig  <martin@ximian.com>
5452
5453         * cs-parser.jay (indexer_declarator): Don't report an error if we
5454         have type parameters since we can be an explicit interface
5455         implementation; fixes #71449.
5456
5457 2005-01-26  Martin Baulig  <martin@ximian.com>
5458
5459         * class.cs (TypeContainer.AttributeTargets): Return the correct
5460         AttributeTargets depending on our `Kind' instead of throwing an
5461         exception; fixes #71632.
5462
5463 2005-01-26  Martin Baulig  <martin@ximian.com>
5464
5465         * delegate.cs (Delegate.DefineType): Correctly define our type
5466         parameters.  Fixes #71483.
5467
5468 2005-01-25  Raja R Harinath  <rharinath@novell.com>
5469
5470         Fix #71602.
5471         * expression.cs (MemberAccess.DoResolve): Don't complain with
5472         cs0572 when the LHS of a member access has identical name and type
5473         name.
5474
5475 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
5476
5477         Fix #71651, #71675
5478         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5479         CreatePermission.
5480         Create custom PermissionSet only for PermissionSetAttribute.
5481
5482 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
5483
5484         Fix #71649
5485         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5486         delegates in static class.
5487
5488 2005-01-24  Martin Baulig  <martin@ximian.com>
5489
5490         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5491         merging an implicit block, just use its reachability.
5492
5493         * statement.cs (Block.Resolve): Make the unreachable code check
5494         work wrt. implicit blocks; see test-337 from #63842.
5495
5496 2005-01-21  Alp Toker  <alp@atoker.com>
5497  
5498         * cs-parser.jay: destructor_declaration's container is PartialContainer
5499         not Class when partial types are used, so use Kind prop instead of
5500         'is'.
5501         
5502 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
5503
5504         * cs-parser.jay: Improve error reporting when an interface
5505         declares new types.
5506
5507 2005-01-20  Dick Porter  <dick@ximian.com>
5508
5509         * support.cs: SeekableStreamReader fix from Sandor Dobos
5510         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5511         chars are read.  Fixes bug 70369.
5512
5513 2005-01-20  Raja R Harinath  <rharinath@novell.com>
5514
5515         * cs-parser.jay (catch_clause): Simplify current_block handling
5516         somewhat.
5517
5518 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
5519
5520         * convert.cs (ImplicitStandardConversionExists): Synchronize the
5521         code with ImplicitStandardConversion to handle the implicit
5522         conversion of method groups into valid delegate invocations. 
5523
5524         The problem is that in parameter handling we were using this code
5525         path.  Fixes bug #64698
5526
5527 2005-01-19  Raja R Harinath  <rharinath@novell.com>
5528
5529         * cs-parser.jay: Fix several infelicities.
5530         - Avoid assigning to the parser value stack.  Code like 
5531           '$3 = null' is unclean.  Synthesize a value for the code block
5532           instead. 
5533         - Avoid using oob_stack for storing location information.  Use ...
5534         (_mark_): ... this.  New (empty) rule.  Saves the current location
5535         in $$.
5536         (foreach_statement): Avoid using oob_stack for current_block
5537         handling.  Use technique used in for_statement and
5538         using_statement.  Synthesize a value for the code block to store
5539         additional intermediate information.
5540
5541 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
5542
5543         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5544         of a different type is only allowed to private fields of a
5545         containing type, not on fields of a base class.
5546
5547         See test-174.cs and error cs0122-9.cs
5548
5549 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5550
5551         Fix test-335.cs (bug #58126).
5552         * cs-parser.jay (argument): Split out non-expression parts of the
5553         rule into 'non_simple_argument'.
5554         (invocation_expression): Support parenthesized invocations with
5555         multiple arguments, and with single non-simple arguments.
5556
5557 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5558
5559         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5560         places.
5561
5562 2005-01-12  Raja R Harinath  <rharinath@novell.com>
5563
5564         Fix cs0038-1.cs, cs1640-6.cs.
5565         * ecore.cs (Expression.Resolve): Remove special-case for
5566         SimpleName in error-handling.
5567         (Expression.almostMatchedMembers): Relax access permission to
5568         protected.
5569         (Expression.MemberLookupFailed): Handle duplicates in
5570         almostMatchedMembers list.
5571         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5572         * expression.cs (New.DoResolve): Report CS1540 for more cases.
5573         * typemanager.cs (GetFullNameSignature): Use the MethodBase
5574         overload if the passed in MemberInfo is a MethodBase.
5575
5576 2005-01-25  Martin Baulig  <martin@ximian.com>
5577
5578         * doc.cs
5579         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
5580
5581 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
5582
5583         Fix #70749
5584         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5585         for non-CAS & merge permission sets properly.
5586
5587 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5588
5589         Improve standard-compliance of simple name and member access 
5590         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
5591         * ecore.cs (FullNamedExpression): New abstract base class 
5592         for Namespaces and TypeExpressions.
5593         (ResolveFlags.SimpleName): Remove.
5594         (SimpleName): Remove support for dotted names.
5595         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
5596         DeclSpace.FindType and DeclSpace.LookupType.
5597         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5598         (Expression.ExprClassName): Make member function.
5599         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5600         a namespace.  Remove creation of dotted "SimpleName"s.
5601         (MemberAccess.DoResolve): Likewise.
5602         * decl.cs (DeclSpace.Cache): Make private.
5603         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5604         (DeclSpace.FindType): Update.
5605         (DeclSpace.LookupType): Move here from RootContext.  Return a 
5606         FullNamedExpression.
5607         * namespace.cs (Namespace): Derive from FullNamedExpression
5608         so that it can be part of expression resolution.
5609         (Namespace.Lookup): Return an FullNamedExpression.
5610         (NamespaceEntry.LookupAlias): Lookup aliases only in current
5611         namespace.
5612         * rootcontext.cs (NamespaceLookup): Remove.
5613         (LookupType): Move to DeclSpace.
5614         * attribute.cs (CheckAttributeType): Update.
5615         * doc.cs (FindDocumentedType): Remove allowAlias argument.
5616         (FindDocumentedTypeNonArray): Likewise.
5617
5618 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5619
5620         Fix cs0509.cs, cs1632.cs.
5621         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5622         is the same as IsInterface.
5623         (TypeContainer.GetClassBases): Likewise.
5624         * statement.cs (LabeledStatement.ig): New field.
5625         (LabeledStatement.LabelTarget): Save ILGenerator which created the
5626         label.
5627         (LabeledStatement.DoEmit): Check that the label was created with
5628         the same ILGenerator.
5629
5630 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5631
5632         Fix #71058
5633         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
5634         accessors to its properties.
5635
5636         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
5637         from accessors to property.
5638         
5639 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5640
5641         Fix #70722
5642         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
5643         only for overrides.
5644         
5645 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
5646
5647         * attribute.cs: Check for null and empty strings.  
5648
5649         I have lost another battle to Paolo.
5650
5651 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
5652
5653         Fix #70942
5654         * class.cs (PropertyMethod): Set Parent field in ctors.
5655         (SetMethod.InternalParameters): Add unsafe switch hack.
5656         Override MarkForDuplicationCheck where it is appropriate.
5657
5658         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
5659         It says whether container allows members with the same name.
5660         Base default is no.
5661         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
5662         Removed is_method parameter.
5663
5664 2005-01-06  Duncan Mak  <duncan@ximian.com>
5665
5666         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
5667         because the previous change led to incorrect reporting of CS1032
5668         ("Cannot define/undefine preprocessor symbols after first token in
5669         file"). Instead of using `tokens_seen' as the only flag that
5670         triggers CS1040, introduce `comments_seen'. This new flag is used
5671         to signify having seen comments on the current line, so it is
5672         unset after a newline.
5673
5674 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5675
5676         * doc.cs : When searching for a type, find nested type too.
5677           This fixes bug #71040.
5678
5679 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5680
5681         * doc.cs :
5682           - Warn missing member comment on those classes which also does not
5683             have doc comments. Fixed bug #71041.
5684           - Don't warn missing doc comment on default constructor.
5685             Fixed bug #71042.
5686
5687 2005-01-06  Duncan Mak  <duncan@ximian.com>
5688
5689         * cs-tokenizer.cs (xtoken): After handling traditional C-style
5690         comments, set `tokens_seen' to true. This allows us to detect
5691         misplaced preprocessor directives (i.e. not at the beginning of
5692         the a line, nor after whitespaces). In that case, report error
5693         CS1040. This fixes bug #56460.
5694
5695         * cs-parser.jay (interface_member_declaration): Add checks for
5696         IsExplicitImpl, and report CS0541 error if an interface member is
5697         defined as an explicit interface declaration.
5698
5699 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
5700
5701         Fix #70817
5702         * class.cs (PropertyMethod): Set Parent field in ctors.
5703         (SetMethod.InternalParameters): Add unsafe switch hack.
5704         
5705         * decl.cs (MemberCore.Parent): Cannot be readonly.
5706
5707 2005-01-06  Raja R Harinath  <rharinath@novell.com>
5708
5709         * decl.cs (DeclSpace.ResolveType): Remove.
5710         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
5711         Merge in code from ...
5712         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
5713         * class.cs, enum.cs: Update to changes.
5714
5715 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
5716
5717         * anonymous.cs: Ensure that we init the scope of our parent if it
5718         has not been initialized yet.
5719
5720 2004-12-30  Duncan Mak  <duncan@ximian.com>
5721
5722         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
5723         if field.FieldBuilder is null. Fixes #70758.
5724
5725         * convert.cs: Fixed some typos and updated some of the comments.
5726         (ImplicitStandardConversionExists):
5727         (TryImplicitIntConversion): If `target_type' is an interface and
5728         the type of `ic' implements this interface, return true or a new
5729         BoxedCast instead of null. This fixes #70468.
5730
5731 2004-12-29  Duncan Mak  <duncan@ximian.com>
5732
5733         * expression.cs (Argument.Emit): Check that Expr is
5734         IMemoryLocation before casting to it, and report CS1510 otherwise.
5735
5736         This fixes #70402.
5737
5738 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
5739
5740         * statement.cs (Block.ThisVariable): remove the recursion here, to
5741         make the --profile more sane.
5742
5743 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
5744
5745         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
5746         assembly, by JB Evain.
5747
5748 2004-12-17  Raja R Harinath  <rharinath@novell.com>
5749
5750         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
5751           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
5752         "parent" refers to enclosing type/class.  "base" refers to superclass.
5753
5754 2004-12-17  Raja R Harinath  <rharinath@novell.com>
5755
5756         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5757         Ensure that we only have GlobalAttributes.
5758         * attribute.cs (Attribute.Emit): Make non-virtual.
5759         (GlobalAttribute.Emit): Remove.
5760         (Attribute.Resolve): Make virtual.
5761         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
5762         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
5763         the argument. Don't create one.
5764         (Attribute.GetObsoleteAttribute): Likewise.
5765         (Attribute.GetClsCompliantAttributeValue): Likewise.
5766         * class.cs, decl.cs: Update to changes.
5767
5768 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
5769
5770         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
5771         
5772         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
5773         
5774         * statement.cs (Foreach.Resolve): Add error 186 report.
5775
5776 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
5777
5778         * expression.cs (Conditional.DoResolve): Add warning 429.
5779         
5780         * statement.cs (If.Resolve): Add warning 665.
5781
5782 2004-12-16  Raja R Harinath  <rharinath@novell.com>
5783
5784         New invariant: RootContext.Tree.Types.NamespaceEntry == null
5785         except when in the parser, and in GlobalAttribute.
5786         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
5787         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
5788         RootContext.Tree.Types.NamespaceEntry once work is done.
5789         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
5790         and resets RootContext.Tree.Types.NamespaceEntry.
5791
5792 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
5793
5794         * cs-parser.jay: Don't create a block for every variable.
5795
5796 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
5797
5798         * location.cs: Provide extra information.
5799
5800         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
5801         variables from the captured environment, it is the ldarg_0.
5802
5803 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
5804
5805         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
5806         find a conclusion.
5807         
5808         * class.cs: Changed warning level for 169 to avoid developer
5809         displeasure from warning flooding. It will be changed back when they
5810         fix most of current BCL warnings.
5811         
5812         * RootContext.cs: Pushed default WarningLevel to 3.
5813         
5814         * statement.cs: Removed unused variable.
5815
5816 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
5817
5818         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
5819         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
5820         Add error 502 report.
5821         (StaticClass.DefineType): Add error 441 report.
5822         (Class.AllowedModifiersProp): New virtual property as temporary
5823         extension to AllowedModifiers.
5824         (Class.DefineType): Add error 418 report. Moved ModFlags check here
5825         to share implementation with StaticClass and don't call virtual
5826         methods from ctor.
5827         
5828         * driver.cs (MainDriver): Add error 1558 test.
5829
5830         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
5831         report. Moved error 36 test here.
5832
5833         * statement.cs (Throw.Resolve): Add error 724 report.
5834
5835         * typemanager.cs: Add out_attribute_type core type.
5836         
5837 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
5838
5839         * class.cs (TypeContainer.VerifyClsCompliance): Add error
5840         3018 report.
5841         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
5842
5843         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
5844         3017 report.
5845         
5846         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
5847
5848         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
5849         Add error 3023 report.
5850         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
5851
5852         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
5853         implementation.
5854
5855 2004-12-12  John Luke  <john.luke@gmail.com>
5856
5857         * driver.cs (AddArgs): take -- into account when
5858         adding arguments, fixes bug 65710 
5859
5860 2004-12-12  Martin Baulig  <martin@ximian.com>
5861
5862         * expression.cs (Unary.TryReduceNegative): Added support for
5863         SByteConstant and ByteConstant.
5864         (Unary.Reduce): Check error values from TryReduceNegative().
5865
5866 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
5867
5868         * attributes.cs (Attribute.Resolve): Avoid multiple error report
5869         and report exception as error 182.
5870
5871 2004-12-10  Raja R Harinath  <rharinath@novell.com>
5872
5873         * driver.cs (Main): Fix message when there are warnings.
5874
5875 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
5876
5877         * delegate.cs: Fixed my fix from yesterday, sorry about that.
5878
5879 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
5880
5881         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
5882         Reduced number of warnings.
5883         
5884         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
5885
5886 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
5887
5888         * driver.cs: Removed message.
5889
5890         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
5891
5892 2004-12-08    <vargaz@freemail.hu>
5893
5894         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
5895
5896 2004-12-08  Martin Baulig  <martin@ximian.com>
5897
5898         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5899         instead of a CS3002 for properties and indexer.
5900
5901 2004-12-08  Martin Baulig  <martin@ximian.com>
5902
5903         * decl.cs (MemberName.ToString): Make this work again.
5904
5905 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
5906
5907         * attribute.cs (Resolve): Add error 591 detection.
5908
5909         * class.cs (FieldMember.Define): Add error 1547 detection.
5910         (Indexer.Define): Add error 620 detection.
5911         (Operator.Define): Add error 590 detection.
5912
5913         * ecore.cs: Missing argument for error 79.
5914
5915         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
5916         detection.
5917
5918 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
5919
5920         Fix #70106
5921         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
5922         only.
5923
5924 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
5925
5926         * cs-parser.jay : handle doc comments on implicit/explicit operators.
5927           Some operator comments were suppressed.
5928         * doc.cs : Implicit/explicit operator name in doc comments are like
5929           "op_Explicit(type)~returnType", so added suffix handling.
5930
5931 2005-01-21  Alp Toker  <alp@atoker.com>
5932
5933         * cs-parser.jay: destructor_declaration's container is PartialContainer
5934         not Class when partial types are used, so use Kind prop instead of 'is'.
5935
5936 2004-12-12  Martin Baulig  <martin@ximian.com>
5937
5938         * expression.cs (Unary.TryReduceNegative): Added support for
5939         SByteConstant and ByteConstant.
5940         (Unary.Reduce): Check error values from TryReduceNegative().
5941
5942 2004-12-11  Martin Baulig  <martin@ximian.com>
5943
5944         * support.cs (ReflectionParameters.ParameterName): If we have a
5945         `gpd', call `ParameterName' on it.
5946
5947         * parameter.cs (Parameter.GetParameterAttributes): New static method.
5948
5949         * pending.cs (PendingImplementation.DefineProxy): Call
5950         DefineParameter() for all of the MethodBuilder's arguments.
5951
5952 2004-12-09  Martin Baulig  <martin@ximian.com>
5953
5954         * doc.cs (DocUtil): Make this a static class.
5955
5956 2004-12-09  Martin Baulig  <martin@ximian.com>
5957
5958         * expression.cs (Invocation.InferType): Moved the type inference
5959         implementation into TypeManager.
5960
5961         * generics.cs (TypeManager): Moved the type inference
5962         implementation here.
5963
5964 2004-12-09  Martin Baulig  <martin@ximian.com>
5965
5966         * typemanager.cs (TypeManager): Make this a partial class.
5967
5968         * generics.cs
5969         (TypeManager): Move the generics part of `TypeManager' here.
5970
5971 2004-12-08  Martin Baulig  <martin@ximian.com>
5972
5973         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5974         instead of a CS3002 for properties and indexer.  Added CS3024
5975         check for generic interfaces.
5976
5977         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
5978         instances are not CLS-compliant.
5979
5980 2004-12-08  Martin Baulig  <martin@ximian.com>
5981
5982         * cs-parser.jay
5983         (void_pointer_expression): New rule for `void*', `void**' etc.
5984         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
5985
5986 2004-12-08  Martin Baulig  <martin@ximian.com>
5987
5988         * expression.cs (Invocation.InferType): Removed the hack for
5989         MethodCore.MayUnify().  
5990
5991         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
5992         this actually work.
5993
5994         * class.cs (MethodCore.MayUnify): Use
5995         TypeManager.MayBecomeEqualGenericTypes().       
5996
5997 2004-12-08  Martin Baulig  <martin@ximian.com>
5998
5999         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
6000         parameter, box it.  Fixes #69233.
6001
6002 2004-12-08  Martin Baulig  <martin@ximian.com>
6003
6004         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
6005         have the ctor constraint.  Fixes #68326.
6006
6007 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6008
6009         * cs-parser.jay : interface comment was not consumed because of
6010           extra opt_semicolon before doc handling.
6011
6012 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6013
6014         Fix test-327.cs, test-328.cs, and put in early infrastructure
6015         for eventually fixing #52697.
6016         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6017         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6018         from other methods.
6019         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6020         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6021         (VerifyUsing, error246): Update.
6022         * rootcontext.cs (RootContext.NamespaceLookup): Just use
6023         'NamespaceEntry.LookupNamespaceOrType'.
6024
6025 2004-12-07  Martin Baulig  <martin@ximian.com>
6026
6027         * driver.cs: Call it "BETA SOFTWARE" :-)
6028
6029 2004-12-06  Raja R Harinath  <rharinath@novell.com>
6030
6031         Fix crash on cs0657-17.cs.
6032         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6033         Use RootContext.Tree.Types, not 'new RootTypes ()'.
6034         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6035         the case where the NamespaceEntry gets overwritten.
6036
6037 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
6038
6039         Fixed #69195, #56821
6040         * ecore.cs (ResolveBoolean): Tiny refactoring.
6041
6042         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6043         of right expression resolving when left is false constant and
6044         operator is LogicalAnd OR true constant and operator is LogicalOr.
6045
6046         * statement.cs (ResolveUnreachable): Always reports warning.
6047
6048 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
6049
6050         * class.cs: Distinguish between 1721 and 1722 (just a little help
6051         for the programmer).
6052
6053 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
6054
6055         * delegate.cs: Only allow this on new versions of the language. 
6056
6057 2004-12-02  Duncan Mak  <duncan@ximian.com>
6058
6059         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6060         Expression class.
6061         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6062         here as a static method. Take an additional bool out parameter
6063         `must_do_cs1540_check' for signaling to InstanceResolve.
6064         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6065         member field from PropertyExpr class and made it an argument of
6066         the method instead.
6067         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6068         check for MarshalByRefObject, and report CS0122 instead of CS1540.
6069         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6070         and `remove_accessor' as well as InstanceResolve: report CS0122
6071         where applicable.
6072
6073         Fixes #70129.
6074
6075 2004-12-07  Martin Baulig  <martin@ximian.com>
6076
6077         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
6078         and CS0692 where appropriate.
6079
6080 2004-12-06  Martin Baulig  <martin@ximian.com>
6081
6082         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
6083         IsDuplicateImplementation() and improved it.
6084
6085         * expression.cs (Invocation.InferTypeArguments): Added
6086         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
6087         and removed the "ref" modifier from `infered_types'.
6088
6089         * decl.cs (MemberName.ToString): Removed the exception.
6090
6091 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
6092
6093         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6094           comments are allowed.
6095
6096 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6097
6098         * delegate.cs: Add checks for subtypes in paramaters and return values
6099         in VerifyMethod () to add support for Covariance/Contravariance
6100         in delegates.
6101         
6102 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6103
6104         * report.cs: Remove extra closing parenthesis.
6105
6106         * convert.cs (Error_CannotImplicitConversion): If the name of the
6107         types are the same, provide some extra information.
6108
6109 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
6110
6111         Fix bug #70102
6112         * attribute.cs (Resolve): Improved implementation of params
6113         attribute arguments.
6114
6115         * support.cs (ParameterData): Add HasParams to be faster.
6116
6117 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
6118
6119         all things are for /doc support:
6120
6121         * doc.cs: new file that supports XML documentation generation.
6122         * mcs.exe.sources: added doc.cs.
6123         * driver.cs:
6124           Handle /doc command line option.
6125           Report error 2006 instead of 5 for missing file name for /doc.
6126           Generate XML documentation when required, after type resolution.
6127         * cs-tokenizer.cs:
6128           Added support for picking up documentation (/// and /** ... */),
6129           including a new XmlCommentState enumeration.
6130         * cs-parser.jay:
6131           Added lines to fill Documentation element for field, constant,
6132           property, indexer, method, constructor, destructor, operator, event
6133           and class, struct, interface, delegate, enum.
6134           Added lines to warn incorrect comment.
6135         * rootcontext.cs :
6136           Added Documentation field (passed only when /doc was specified).
6137         * decl.cs:
6138           Added DocComment, DocCommentHeader, GenerateDocComment() and
6139           OnGenerateDocComment() and some supporting private members for
6140           /doc feature to MemberCore.
6141         * class.cs:
6142           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6143         * delegate.cs:
6144           Added overriden DocCommentHeader.
6145         * enum.cs:
6146           Added overriden DocCommentHeader and GenerateDocComment().
6147
6148 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
6149
6150         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6151         unwrapping the enumeration values, chain to
6152         DoConstantNumericPromotions again, so we can promote things to the
6153         fundamental types (takes care of enums that are bytes, sbytes).
6154
6155         Fixes bug #62054.
6156
6157 2004-12-01  Raja R Harinath  <rharinath@novell.com>
6158
6159         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6160         Fix long-standing bug in type-lookup.  Use FindType instead of
6161         LookupType when ec.ResolvingTypeTree.
6162         (Attribute.ResolveType, Attribute.Resolve)
6163         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6164         Update to changes.
6165         (Attributes.Search): Remove internal version.  Update.
6166         (Attributes.SearchMulti): Update.
6167         (Attributes.GetClsCompliantAttribute): Remove.
6168         (Attributes.GetIndexerNameAttribute): Remove.
6169         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6170         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6171         * class.cs (Indexer.Define): Likewise.
6172
6173 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
6174
6175         Fix bug #68790
6176         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6177         MarshallByReference members access.
6178
6179         * expression.cs: Use CheckMarshallByRefAccess;
6180         Better error CS0197 message.
6181
6182         * report.cs: Print whole related error message.
6183
6184 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6185
6186         * class (GetClassBases): Better error 60 report.
6187         (EventProperty): Disabled warning 67 detection.
6188
6189 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6190
6191         Fix bug #60324
6192         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6193
6194         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6195         precise values.
6196
6197 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6198
6199         Fix bug #49488
6200         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6201
6202         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6203
6204 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
6205
6206         * attribute.cs (Attribute.Resolve): Refine error reporting and
6207         report a cs0117 if the identifier does not exist, to distinguish
6208         from 0617 which is a miss-use of the actual identifier.
6209
6210         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6211         between cs0070 and cs0079.
6212
6213         * class.cs (MemberBase.DoDefine): When reporting a wrong
6214         accessibility level, we use MethodCore to compare instead of
6215         Method (this was a regression in some refactoring effort).
6216
6217         So now we correctly report cs0056 again.
6218
6219         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6220         testing the target_type (which was known to be object_type) and
6221         not the source type (which is anonymous_method).
6222
6223         Fixed reporting of error cs1660.
6224
6225         * expression.cs (UserCast.Source): Expose the underlying cast.
6226
6227         * statement.cs (Switch.SwitchGoverningType): Sort the list of
6228         allowed types to find a match to int32 first (most common).
6229
6230         In addition, it ignores any ImplicitUserConversions that did an
6231         internal implicit conversion (as the switch statement allows only
6232         one integral conversion to exist).
6233
6234         * class.cs (PartialContainer.Create): rename `name' to
6235         `member_name' for clarity.  Then replace the string calls with a
6236         call to MemberName.GetPartialName, as now using
6237         MemberName.ToString is an error (this is due to the side effects
6238         it had, that were fixed in the past).
6239
6240         This will restore the error reporting on a number of partial class
6241         errors that were missusing this (and getting an exception as a
6242         results, which is now just a plain textual warning, because
6243         yyparse debug output would crash otherwise).
6244
6245 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6246
6247         * Makefile (PROGRAM_INSTALL_DIR): Remove.
6248
6249 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6250
6251         * rootcontext.cs (LookupType): Make sure to cache lookups that
6252         don't give us a negative result. This saves about 5% of corlib
6253         compilation time.
6254
6255 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6256
6257         * report.cs (AbstractMessage.Print): messages are sent to stderr
6258
6259         * class.cs (TypeContainer.GetClassBases): It is an error to have a
6260         non-interface in the list of interfaces (at this point, either
6261         parent was properly set, or a base class is being listed in the
6262         interfaces section).
6263
6264         This flags error 1722, and resolves the crash from bug 69259.
6265
6266 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6267
6268         * statement.cs (Using.EmitExpressionFinally): make this work right
6269         for valuetypes. Fixes 69926.
6270
6271 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6272
6273         * const.cs (Const.ChangeType): Cope with the "0 literal can be
6274         converted to an enum" here, before we try to change the underlying
6275         type.  This code exists, but it is a different code path than the
6276         one used while encoding constants.
6277
6278         (ImplicitReferenceConversionExists): In addition, resynchronized
6279         the code here, so it matches the same code in
6280         ImplicitReferenceConversionExists for the `from any class-type S
6281         to any interface-type T'.       
6282
6283 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
6284
6285         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6286
6287 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
6288
6289         * cs-parser.jay: Use verbosity accordingly. 
6290
6291 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6292
6293         * expression.cs (Unary.ResolveOperator): Do not report warning;
6294         AddressOf reads from variable.
6295         
6296         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6297
6298 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6299
6300         Fix bug #69462
6301
6302         * attribute.cs (Attributable): Removed CheckTargets.
6303         (Attributes.Emit): Explicit attribute targets are tested here.
6304
6305         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6306         not enabled for interfaces.
6307
6308         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6309         (GetAssemblyName): Ouch next bug there.
6310
6311 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6312
6313         * expression.cs: Error 275 added.
6314         
6315 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
6316
6317         Fix bug #69177 (Implemented decimal constant support)
6318
6319         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6320         (BinaryFold): Add DecimalConstant.
6321
6322         * const.cs (Define): Decimal constant 
6323         (is not constant.
6324         (ChangeType): Add decimal type handling.
6325         (LookupConstantValue): Don't set value for decimal type but
6326         emit DecimalConstantAttribute. Needed for constant optimization.
6327
6328         * constant.cs (ToDecimal): New method.
6329         (ConvertToDecimal): New method.
6330         (IntConstant): Implemented ConvertToDecimal.
6331         (DecimalConstant.Emit): Emit optimized version for decimals in
6332         int range.
6333
6334         * expression.cs (ResolveOperator): Changed order of constant
6335         reduction to work correctly with native types which have
6336         overloaded operators.
6337         (ResolveMemberAccess): Extract constant value from attribute
6338         for decimal type.
6339
6340         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6341
6342         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6343         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6344         (ChangeType): Decimal is special.
6345         (TypeToCoreType): Add decimal type.
6346
6347 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6348
6349         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6350         decimal types.
6351
6352 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6353
6354         * class.cs (EventField.ApplyAttributeBuilder): Fix error
6355         test cs1667-5.cs.
6356
6357 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6358
6359         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6360
6361         * pending.cs (PendingImplementation): Grab only interfaces.
6362
6363 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6364
6365         * statement.cs (ForeachHelperMethods): Add location member and
6366         error 202 detection.
6367
6368 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
6369
6370         * expression.cs (DoResolveBase): Fixed wrong warning for out
6371         variables.
6372
6373 2004-12-04  Martin Baulig  <martin@ximian.com>
6374
6375         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
6376         to check whether the conversion is ok.
6377
6378         * typemanager.cs (TypeManager.GetTypeArguments): Just return
6379         `Type.EmptyTypes' if we're not a generic TypeContainer.
6380
6381 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6382
6383         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6384         old bug: when converting from the null literal to a pointer,
6385         return an EmptyCast, not the NullLiteral.
6386
6387         This fixes #69921, the recent null_type changes probably made this
6388         bug more prominent.
6389
6390 2004-12-03  Martin Baulig  <martin@ximian.com>
6391
6392         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6393         method as our child, call AnonymousMethod.Compatible() on it.
6394
6395 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6396
6397         * class.cs (FieldBase): Use an unused bit field from the field to
6398         encode the `has_offset' property from the FieldMember.  This saves
6399         a couple of Ks on bootstrap compilation.
6400
6401         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6402         method as our child, return the AnonymousMethod resolved
6403         expression.
6404
6405         * expression.cs (New.DoResolve): Allow return values from
6406         NewDelegate to also include AnonymousMethods.
6407
6408         Fixes #70150.
6409
6410 2004-11-29  Raja R Harinath  <rharinath@novell.com>
6411
6412         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
6413         cs1648 report.
6414         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
6415         System.Runtime.InteropServices._Exception, since it's a base
6416         interface of the core type System.Exception in the net_2_0 profile.
6417
6418 2004-11-27  Martin Baulig  <martin@ximian.com>
6419
6420         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
6421
6422 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6423
6424         * Makefile: Convert to use executable.make.
6425         * gmcs.exe.sources: New.
6426
6427 2004-11-25  Martin Baulig  <martin@ximian.com>
6428
6429         * expression.cs (Invocation.InferType): Added support for byref types.
6430
6431 2004-11-25  Martin Baulig  <martin@ximian.com>
6432
6433         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
6434         in TypeManager.TypeToCoreType().
6435
6436 2004-11-25  Martin Baulig  <martin@ximian.com>
6437
6438         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
6439         "Dispose" method from the `current_type'.
6440         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
6441         DoDefineMembers() instead of using the MethodBuilder; this is
6442         required for generic iterators.
6443
6444         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
6445
6446 2004-11-24  Martin Baulig  <martin@ximian.com>
6447
6448         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
6449
6450 2004-11-20  Martin Baulig  <martin@ximian.com>
6451
6452         * expression.cs (Invocation.InferType): Correctly infer generic
6453         instances; see gen-103.cs.
6454         (Invocation.InferTypeArguments): If a generic method doesn't have
6455         any unbound type parameters, we don't need to infer anything.
6456
6457 2004-11-19  Raja R Harinath  <rharinath@novell.com>
6458
6459         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
6460
6461 2004-11-17  Raja R Harinath  <rharinath@novell.com>
6462
6463         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6464         (TypeHandle.GetMemberCache): New.
6465         (TypeHandle.TypeHandle): Update.
6466         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6467         (TypeManager.LookupParentInterfacesCache):
6468         Rename from LookupInterfaceCache.  Optimize slightly.
6469         (TypeManager.MemberLookup_FindMembers): Update.
6470         * decl.cs (MemberCache.MemberCache): Set Container to null in the
6471         multi-type variant.
6472         (AddCacheContents): Rename from AddHashtable.
6473         * class.cs (TypeContainer.parent_container): Remove.
6474         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6475         (TypeContainer.DoDefineMembers): Don't initialize it.
6476         Update to name changes.
6477         
6478 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
6479
6480         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6481         that factors the code to check access modifiers on override.  
6482
6483         (PropertyBase): Use the code here.
6484
6485         Patch from Lluis S'anchez, fixes bug #69361.
6486
6487 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
6488
6489         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6490         routine that is used to report the use of a captured variable
6491         whose address has been taken.
6492
6493         There are two checks: one when variables are being captured and
6494         the other check is when the address of a variable is taken. 
6495         
6496         (because an anonymous methods might be resolved before *or* after
6497         the address has been taken) and 
6498
6499         * expression.cs (Conditional.DoResolve): Remove the special
6500         casing that Martin added to trueExpr and falseExpr being both
6501         NullLiteral.  We get the right behavior now just by introducing
6502         the null_type into the compiler. 
6503
6504         * convert.cs (ExplicitConversion): Change the code to use
6505         null_type instead of testing `expr is NullLiteral'.
6506         (ImplicitConversionStandard): use null_type too.
6507         (ImplicitReferenceConversionExists): use null_type too.
6508         (ImplicitReferenceConversion): use null_type too.
6509
6510         * literal.cs: The type of `NullLiteral' is now null_type instead
6511         of object_type. 
6512         (Resolve): Set the type here.
6513
6514         * typemanager.cs: Introduce null_type.
6515
6516 2004-11-18  Martin Baulig  <martin@ximian.com>
6517
6518         * rootcontext.cs
6519         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
6520
6521 2004-11-18  Martin Baulig  <martin@ximian.com>
6522
6523         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
6524
6525 2004-11-18  Martin Baulig  <martin@ximian.com>
6526
6527         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
6528         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
6529         call ResolveConstructedType() on it to resolve it without checking
6530         constraints.
6531         (Constraints.ResolveTypes): Check them here.
6532         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
6533         but don't check constraints.
6534         (ConstructedType.ResolveAsTypeTerminal): Override this and also
6535         check constraints here.
6536         (ConstructedType.ResolveConstructedType): New public method.  This
6537         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
6538         resolve ourselves without checking constraints.
6539
6540         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
6541
6542 2004-11-18  Martin Baulig  <martin@ximian.com>
6543
6544         * decl.cs
6545         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
6546
6547         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
6548
6549 2004-11-18  Martin Baulig  <martin@ximian.com>
6550
6551         * ecore.cs (TypeExpr.ResolveType): Removed.
6552         (Expression.ResolveAsTypeTerminal): We always return a fully
6553         resolved `TypeExpr', so we can just access its `Type'.
6554
6555         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
6556
6557 2004-11-17  Martin Baulig  <martin@ximian.com>
6558
6559         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
6560         sure we don't return any unresolved TypeExpr's.
6561         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
6562         a `TypeExpr'.
6563         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
6564
6565         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
6566         unresolved `ConstructedType's.
6567
6568 2004-11-17  Martin Baulig  <martin@ximian.com>
6569
6570         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
6571
6572 2004-11-17  Martin Baulig  <martin@ximian.com>
6573
6574         * ecore.cs
6575         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
6576
6577         * decl.cs (DeclSpace.ResolveType): Removed.
6578         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
6579
6580 2004-11-17  Martin Baulig  <martin@ximian.com>
6581
6582         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6583         direction, like FindMembers() does.  Fixes #69546, testcase is in
6584         test-315.cs.    
6585
6586 2004-11-16  Martin Baulig  <martin@ximian.com>
6587
6588         This is based on a patch from Marek Safar, see bug #69082.
6589         Fixes bugs #63705 and #67130.
6590
6591         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6592         method; create a MemberCache for an interface type and cache the
6593         result.
6594
6595         * decl.cs (IMemberContainer.ParentContainer): Removed.
6596         (IMemberContainer.ParentCache): New property.
6597         (MemberCache.SetupCacheForInterface): Removed.
6598         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6599         to create a cache for an interface's "parent".
6600
6601         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6602         interfaces too.
6603
6604 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
6605
6606         * statement.cs: Avoid adding bools to a hashtable.
6607
6608 2004-11-15  Martin Baulig  <martin@ximian.com>
6609
6610         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
6611
6612 2004-11-11  Martin Baulig  <martin@ximian.com>
6613
6614         * typemanager.cs (TypeManager.GetMethodName): New method.
6615
6616         * class.cs (MethodData.Define): Include the generic arity in the
6617         name of an explicit interface; also add it to the method name.
6618
6619         * pending.cs (PendingImplementation.InterfaceMethod): The method
6620         name now includes the generic arity.
6621
6622 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
6623
6624         * expression.cs (Invocation.OverloadResolve): Flag error if we are
6625         calling an unsafe method from a safe location.
6626
6627 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
6628
6629         Fix #69167
6630         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6631
6632 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
6633
6634         * namespace.cs (VerifyUsing): use GetPartialName instead of
6635         ToString. 
6636
6637 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
6638
6639         * statement.cs (Return.Resolve): Fix regression in typo: if
6640         `in_exc', we have to request a NeedReturnLabel, this was a typo
6641         introduced in the anonymous method check-in.  Fixes #69131.
6642
6643         * Indexers were using the ShortName when defining themselves,
6644         causing a regression in the compiler bootstrap when applying the
6645         patch from 2004-11-02 (first part), now they use their full name
6646         and the bug is gone.
6647
6648 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
6649
6650         * driver.cs: Strip the path from the names of embedded resources. Fixes
6651         #68519.
6652
6653 2004-11-04  Raja R Harinath  <rharinath@novell.com>
6654
6655         Fix error message regression: cs0104-2.cs.
6656         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6657         (AliasEntry.Resolve): Update.
6658         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
6659         'silent' flag.
6660         (RootContext.LookupType): Update.
6661
6662 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
6663
6664         * cs-parser.jay: Add support for handling accessor modifiers
6665         * class: Add support port accessor modifiers and error checking,
6666         define PropertyMethod.Define as virtual (not abstract anymore)
6667         * ecore.cs: Add checking for proeprties access with access modifiers
6668         * iterators.cs: Modify Accessor constructor call based in the modified
6669         constructor
6670 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
6671
6672         * expression.cs (StringConcat): Handle being called twice,
6673         as when we have a concat in a field init with more than two
6674         ctors in the class
6675
6676 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
6677
6678         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6679         special case explicit implementations, we should always produce
6680         the .property or .event declaration.
6681         
6682         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6683         since it will not return correct data if people use this
6684         unresolved in the presence of using statements (see test-313).
6685
6686         * class.cs (MethodData.Define): If we are an explicit interface
6687         implementation, set the method name to the full name of the
6688         interface plus the name of the method.  
6689
6690         Notice that using the method.MethodName.GetFullName() does not
6691         work, as it will only contain the name as declared on the source
6692         file (it can be a shorthand in the presence of using statements)
6693         and not the fully qualifed type name, for example:
6694
6695         using System;
6696
6697         class D : ICloneable {
6698                 object ICloneable.Clone ()  {
6699                 }
6700         }
6701
6702         Would produce a method called `ICloneable.Clone' instead of
6703         `System.ICloneable.Clone'.
6704
6705         * namespace.cs (Alias.Resolve): Use GetPartialName.
6706         
6707 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6708
6709         * cs-parser.jay: Add error 1055 report.
6710
6711 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
6712
6713         * assign.cs (Assign.DoResolve): Only do the transform of
6714         assignment into a New if the types are compatible, if not, fall
6715         through and let the implicit code deal with the errors and with
6716         the necessary conversions. 
6717
6718 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6719
6720         * cs-parser.jay: Add error 1031 report.
6721
6722         * cs-tokenizer.cs: Add location for error 1038.
6723
6724 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6725
6726         * cs-parser.jay: Add error 1016 report.
6727
6728 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6729
6730         * cs-parser.jay: Add errors 1575,1611 report.
6731
6732 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6733
6734         * cs-parser.jay: Add error 1001 report.
6735
6736 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6737
6738         Fix #68850
6739         * attribute.cs (GetMarshal): Add method argument for
6740         caller identification.
6741
6742         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
6743         agument for GetMarshal and RuntimeMissingSupport.
6744
6745 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6746
6747         * attribute.cs (ExtractSecurityPermissionSet): Removed
6748         TypeManager.code_access_permission_type.
6749
6750         * typemanager.cs: Removed TypeManager.code_access_permission_type.
6751
6752 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
6753
6754         * expression.cs (LocalVariableReference.DoResolveLValue): Check
6755         for obsolete use of a variable here.   Fixes regression on errors
6756         cs0619-25 and cs0619-26.
6757
6758 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
6759
6760         Fix #62358, implemented security attribute encoding.
6761
6762         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
6763         Tests permitted SecurityAction for assembly or other types.
6764         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
6765         data from SecurityPermissionAttribute to PermisionSet class.
6766
6767         * class.cs (ApplyAttributeBuilder): Added special handling
6768         for System.Security.Permissions.SecurityAttribute based types.
6769
6770         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
6771         special handling for System.Security.Permissions.SecurityAttribute
6772         based types.
6773
6774         * enum.cs (ApplyAttributeBuilder): Added special handling
6775         for System.Security.Permissions.SecurityAttribute based types.
6776
6777         * parameter.cs (ApplyAttributeBuilder): Added special handling
6778         for System.Security.Permissions.SecurityAttribute based types.
6779
6780         * rootcontext.cs: Next 2 core types.
6781
6782         * typemanager.cs (TypeManager.security_permission_attr_type):
6783         Built in type for the SecurityPermission Attribute.
6784         (code_access_permission_type): Build in type.
6785
6786 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
6787
6788         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
6789         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
6790         all of this information into
6791         EmitContext.EmitCapturedVariableInstance.
6792         
6793         * codegen.cs (EmitCapturedVariableInstance): move here the
6794         funcionality of emitting an ldarg.0 in the presence of a
6795         remapping.   This centralizes the instance emit code.
6796
6797         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
6798         then emit a load of this: it means that we have reached the
6799         topmost ScopeInfo: the one that contains the pointer to the
6800         instance of the class hosting the anonymous method.
6801
6802         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
6803         captures to the topmost CaptureContext.
6804
6805 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
6806
6807         * expression.cs (LocalVariableReference): Move the knowledge about
6808         the iterators into codegen's EmitCapturedVariableInstance.
6809
6810 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
6811
6812         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
6813         all code paths return a value from an anonymous method (it is the
6814         same as the 161 error, but for anonymous methods).
6815
6816 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
6817
6818         The introduction of anonymous methods in the compiler changed
6819         various ways of doing things in the compiler.  The most
6820         significant one is the hard split between the resolution phase
6821         and the emission phases of the compiler.
6822
6823         For instance, routines that referenced local variables no
6824         longer can safely create temporary variables during the
6825         resolution phase: they must do so from the emission phase,
6826         since the variable might have been "captured", hence access to
6827         it can not be done with the local-variable operations from the runtime.
6828         
6829         * statement.cs 
6830
6831         (Block.Flags): New flag `IsTopLevel' to indicate that this block
6832         is a toplevel block.
6833
6834         (ToplevelBlock): A new kind of Block, these are the blocks that
6835         are created by the parser for all toplevel method bodies.  These
6836         include methods, accessors and anonymous methods.
6837
6838         These contain some extra information not found in regular blocks:
6839         A pointer to an optional CaptureContext (for tracking captured
6840         local variables and parameters).  A pointer to the parent
6841         ToplevelBlock.
6842         
6843         (Return.Resolve): Catch missmatches when returning a value from an
6844         anonymous method (error 1662).
6845         Invoke NeedReturnLabel from the Resolve phase instead of the emit
6846         phase.
6847
6848         (Break.Resolve): ditto.
6849
6850         (SwitchLabel): instead of defining the labels during the
6851         resolution phase, we now turned the public ILLabel and ILLabelCode
6852         labels into methods called GetILLabelCode() and GetILLabel() that
6853         only define the label during the Emit phase.
6854
6855         (GotoCase): Track the SwitchLabel instead of the computed label
6856         (its contained therein).  Emit the code by using
6857         SwitchLabel.GetILLabelCode ().
6858
6859         (LocalInfo.Flags.Captured): A new flag has been introduce to track
6860         whether the Local has been captured or not.
6861
6862         (LocalInfo.IsCaptured): New property, used to tell whether the
6863         local has been captured.
6864         
6865         * anonymous.cs: Vastly updated to contain the anonymous method
6866         support.
6867
6868         The main classes here are: CaptureContext which tracks any
6869         captured information for a toplevel block and ScopeInfo used to
6870         track the activation frames for various local variables.   
6871
6872         Each toplevel block has an optional capture context associated
6873         with it.  When a method contains an anonymous method both the
6874         toplevel method and the anonymous method will create a capture
6875         context.   When variables or parameters are captured, they are
6876         recorded on the CaptureContext that owns them, for example:
6877
6878         void Demo () {
6879              int a;
6880              MyDelegate d = delegate {
6881                  a = 1;
6882              }
6883         }
6884
6885         Here `a' will be recorded as captured on the toplevel
6886         CapturedContext, the inner captured context will not have anything
6887         (it will only have data if local variables or parameters from it
6888         are captured in a nested anonymous method.
6889
6890         The ScopeInfo is used to track the activation frames for local
6891         variables, for example:
6892
6893         for (int i = 0; i < 10; i++)
6894                 for (int j = 0; j < 10; j++){
6895                    MyDelegate d = delegate {
6896                         call (i, j);
6897                    }
6898                 }
6899
6900         At runtime this captures a single captured variable `i', but it
6901         captures 10 different versions of the variable `j'.  The variable
6902         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
6903         recorded on a child.  
6904
6905         The toplevel ScopeInfo will also track information like the `this'
6906         pointer if instance variables were referenced (this is necessary
6907         as the anonymous method lives inside a nested class in the host
6908         type of the method). 
6909
6910         (AnonymousMethod): Expanded to track the Toplevel, implement
6911         `AnonymousMethod.Compatible' to tell whether an anonymous method
6912         can be converted to a target delegate type. 
6913
6914         The routine now also produces the anonymous method content
6915
6916         (AnonymousDelegate): A helper class that derives from
6917         DelegateCreation, this is used to generate the code necessary to
6918         produce the delegate for the anonymous method that was created. 
6919
6920         * assign.cs: API adjustments for new changes in
6921         Convert.ImplicitStandardConversionExists.
6922
6923         * class.cs: Adjustments to cope with the fact that now toplevel
6924         blocks are of type `ToplevelBlock'. 
6925
6926         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
6927         insteda of standard blocks.
6928
6929         Flag errors if params arguments are passed to anonymous methods.
6930
6931         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
6932         `CurrentAnonymousMethod' which points to the current Anonymous
6933         Method.  The variable points to the AnonymousMethod class that
6934         holds the code being compiled.  It is set in the new EmitContext
6935         created for the anonymous method.
6936
6937         (EmitContext.Phase): Introduce a variable and an enumeration to
6938         assist in enforcing some rules about when and where we are allowed
6939         to invoke certain methods (EmitContext.NeedsReturnLabel is the
6940         only one that enfonces this right now).
6941
6942         (EmitContext.HaveCaptureInfo): new helper method that returns
6943         whether we have a CapturedContext initialized.
6944
6945         (EmitContext.CaptureVariable): New method used to register that a
6946         LocalInfo must be flagged for capturing. 
6947
6948         (EmitContext.CapturedParameter): New method used to register that a
6949         parameters must be flagged for capturing. 
6950         
6951         (EmitContext.CapturedField): New method used to register that a
6952         field must be flagged for capturing. 
6953
6954         (EmitContext.HaveCapturedVariables,
6955         EmitContext.HaveCapturedFields): Return whether there are captured
6956         variables or fields. 
6957
6958         (EmitContext.EmitMethodHostInstance): This is used to emit the
6959         instance for the anonymous method.  The instance might be null
6960         (static methods), this (for anonymous methods that capture nothing
6961         and happen to live side-by-side with the current method body) or a
6962         more complicated expression if the method has a CaptureContext.
6963
6964         (EmitContext.EmitTopBlock): Routine that drives the emission of
6965         code: it will first resolve the top block, then emit any metadata
6966         and then emit the code.  The split is done so that we can extract
6967         any anonymous methods and flag any captured variables/parameters.
6968         
6969         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
6970         during this phase, the ILGenerator should not be used as labels
6971         and local variables declared here might not be accessible to any
6972         code that is part of an anonymous method.  
6973
6974         Exceptions to this include the temporary variables that are
6975         created by some statements internally for holding temporary
6976         variables. 
6977         
6978         (EmitContext.EmitMeta): New routine, in charge of emitting all the
6979         metadata for a cb
6980
6981         (EmitContext.TemporaryReturn): This method is typically called
6982         from the Emit phase, and its the only place where we allow the
6983         ReturnLabel to be defined other than the EmitMeta.  The reason is
6984         that otherwise we would have to duplicate a lot of logic in the
6985         Resolve phases of various methods that today is on the Emit
6986         phase. 
6987
6988         (EmitContext.NeedReturnLabel): This no longer creates the label,
6989         as the ILGenerator is not valid during the resolve phase.
6990
6991         (EmitContext.EmitThis): Extended the knowledge in this class to
6992         work in anonymous methods in addition to iterators. 
6993
6994         (EmitContext.EmitCapturedVariableInstance): This emits whatever
6995         code is necessary on the stack to access the instance to a local
6996         variable (the variable will be accessed as a field).
6997
6998         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
6999         EmitContext.EmitAddressOfParameter): Routines to support
7000         parameters (not completed at this point). 
7001         
7002         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
7003         will also remove the parameters.
7004
7005         * convert.cs (Convert): Define a `ConstantEC' which points to a
7006         null.  This is just to prefity some code that uses
7007         ImplicitStandardConversion code and do not have an EmitContext
7008         handy.
7009
7010         The idea is to flag explicitly that at that point in time, it is
7011         known that the conversion will not trigger the delegate checking
7012         code in implicit conversions (which requires a valid
7013         EmitContext). 
7014
7015         Everywhere: pass new EmitContext parameter since
7016         ImplicitStandardConversionExists now requires it to check for
7017         anonymous method conversions. 
7018
7019         (Convert.ImplicitStandardConversionExists): If the type of an
7020         expression is the anonymous_method_type, and the type is a
7021         delegate, we invoke the AnonymousMethod.Compatible method to check
7022         whether an implicit conversion is possible. 
7023
7024         (Convert.ImplicitConversionStandard): Only do implicit method
7025         group conversions if the language level is not ISO_1.
7026
7027         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7028         MethodInfo for the Invoke method.  used by Delegate and
7029         AnonymousDelegate.
7030
7031         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7032         method conversions if the target type is a delegate.
7033
7034         Removed extra debugging nops.
7035
7036         (LocalVariableReference): Turn the `local_info' into a public
7037         field. 
7038
7039         Add `prepared' field, the same hack used for FieldExprs to cope
7040         with composed assignments, as Local variables do not necessarily
7041         operate purely on the stack as they used to: they can be captured
7042         fields. 
7043
7044         Add `temp' for a temporary result, like fields.
7045
7046         Refactor DoResolve and DoResolveLValue into DoResolveBase.
7047
7048         It now copes with Local variables that are captured and emits the
7049         proper instance variable to load it from a field in the captured
7050         case. 
7051
7052         (ParameterReference.DoResolveBase): During the resolve phase,
7053         capture parameters if we are in an anonymous method.
7054
7055         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7056         anonymous method, use the EmitContext helper routines to emit the
7057         parameter reference.
7058
7059         * iterators.cs: Set RemapToProxy to true/false during the
7060         EmitDispose class.
7061
7062         * parameters.cs (GetParameterByName): New helper method. 
7063
7064         * typemanager.cs (anonymous_method_type) a new type that
7065         represents an anonyous method.  This is always an internal type,
7066         used as a fencepost to test against the anonymous-methodness of an
7067         expression. 
7068         
7069 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
7070
7071         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7072         561 report.
7073         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7074
7075 2004-11-10  Martin Baulig  <martin@ximian.com>
7076
7077         * expression.cs (Invocation.BetterFunction): If two methods have
7078         equal parameter types, but only one of them is generic, the
7079         non-generic one wins.
7080         (New.DoResolve): Don't set `is_struct' to false if we're a generic
7081         instance; just use `Type.IsValueType' to determine whether
7082         something is a struct or not.
7083         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
7084         so we can be called multiple times.
7085
7086 2004-11-10  Martin Baulig  <martin@ximian.com>
7087
7088         * generic.cs (TypeParameter.DefineConstraints): New public method.
7089         (TypeParameter.CheckAccessLevel): Override this and return true.
7090         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
7091         override ResolveType() anymore.
7092         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
7093
7094 2004-11-10  Martin Baulig  <martin@ximian.com>
7095
7096         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
7097         call DeclSpace.ResolveNestedType() on it.
7098
7099 2004-11-10  Martin Baulig  <martin@ximian.com>
7100
7101         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
7102         non-null, call ParameterModifier() on it.
7103
7104 2004-11-10  Martin Baulig  <martin@ximian.com>
7105
7106         * iterators.cs
7107         (Iterators): Added `current_type' and `this_type' fields.
7108         (Iterators.DefineIterator): Create a new EmitContext and store it
7109         in `ec'; compute `this_type'.
7110
7111 2004-11-10  Martin Baulig  <martin@ximian.com>
7112
7113         * typemanager.cs
7114         (TypeManager.IsPrivateAccessible): New public method.
7115         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
7116
7117 2004-11-10  Martin Baulig  <martin@ximian.com>
7118
7119         * class.cs (TypeContainer.DefineType): Call
7120         TypeBuilder.DefineGenericParameters() before resolving the type
7121         parameters.
7122         (MethodData.parent_method): New protected field.
7123         (MethodData..ctor): Added `MethodInfo parent_method' argument.
7124         (MethodData.Define): Compute `parent_method'.
7125
7126         * decl.cs
7127         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7128         (MemberCore.GetClsCompliantAttributeValue): Likewise.
7129         (DeclSpace.ec): New protected field; store the EmitContext here.
7130         (DeclSpace.EmitContext): New public property.
7131         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
7132         (DeclSpace.ResolveNestedType): New public method.
7133         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
7134         (DeclSpace.NestedAccessible): Added `Type tb' argument.
7135         (DeclSpace.FamilyAccessible): Likewise.
7136         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
7137         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7138         EmitContext.
7139
7140         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
7141         field.
7142
7143         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7144         (Enum.Emit): Don't create a new EmitContext.
7145
7146 2004-10-18  Martin Baulig  <martin@ximian.com>
7147
7148         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7149         `Type' directly, but call ResolveType() on it.
7150         (Catch.Resolve): Likewise.
7151         (Foreach.Resolve): Likewise.
7152
7153 2004-10-18  Martin Baulig  <martin@ximian.com>
7154
7155         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7156         `Type' directly, but call ResolveType() on it.
7157         (Probe.DoResolve): Likewise.
7158         (ArrayCreation.LookupType): Likewise.
7159         (TypeOf.DoResolve): Likewise.
7160         (SizeOf.DoResolve): Likewise.
7161
7162 2004-10-18  Raja R Harinath  <rharinath@novell.com>
7163
7164         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7165         the ResolveType.
7166
7167 2004-10-17  John Luke  <john.luke@gmail.com>
7168
7169         * class.cs (Operator.GetSignatureForError): use CSharpName
7170
7171         * parameter.cs (Parameter.GetSignatureForError): Returns
7172         correct name even if was not defined.
7173
7174 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7175
7176         Fix #65816.
7177         * class.cs (TypeContainer.EmitContext): New property.
7178         (DefineNestedTypes): Create an emitcontext for each part.
7179         (MethodCore.DoDefineParameters): Use container's emitcontext.
7180         Pass type array to InternalParameters.
7181         (MemberBase.DoDefine): Use container's emitcontext.
7182         (FieldMember.Define): Likewise.
7183         (Event.Define): Likewise.
7184         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7185         Pass type array to InternalParameters.
7186         (SetIndexerMethod.GetParameterInfo): Likewise.
7187         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7188         * delegate.cs (Define): Pass emitcontext to
7189         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7190         array to InternalParameters.
7191         * expression.cs (ParameterReference.DoResolveBase): Pass
7192         emitcontext to GetParameterInfo.
7193         (ComposedCast.DoResolveAsTypeStep): Remove check on
7194         ec.ResolvingTypeTree.
7195         * parameter.cs (Parameter.Resolve): Change argument to
7196         EmitContext.  Use ResolveAsTypeTerminal.
7197         (Parameter.GetSignature): Change argument to EmitContext.
7198         (Parameters.ComputeSignature): Likewise.
7199         (Parameters.ComputeParameterTypes): Likewise.
7200         (Parameters.GetParameterInfo): Likewise.
7201         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7202         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7203         * support.cs (InternalParameters..ctor): Remove variant that takes
7204         a DeclSpace.
7205         * typemanager.cs (system_intptr_expr): New.
7206         (InitExpressionTypes): Initialize it.
7207
7208 2004-10-12  Chris Toshok  <toshok@ximian.com>
7209
7210         * cs-parser.jay: fix location for try_statement and catch_clause.
7211
7212 2004-10-18  Martin Baulig  <martin@ximian.com>
7213
7214         * class.cs (FieldMember.Define): Don't access the TypeExpr's
7215         `Type' directly, but call ResolveType() on it.
7216         (MemberBase.DoDefine): Likewise.
7217
7218         * expression.cs (New.DoResolve): Don't access the TypeExpr's
7219         `Type' directly, but call ResolveType() on it.
7220         (ComposedCast.DoResolveAsTypeStep): Likewise.
7221
7222         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7223         `Type' directly, but call ResolveType() on it.
7224
7225 2004-10-17  John Luke  <john.luke@gmail.com>
7226
7227         * class.cs (Operator.GetSignatureForError): use CSharpName
7228
7229         * parameter.cs (Parameter.GetSignatureForError): Returns
7230         correct name even if was not defined.
7231
7232 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7233
7234         Fix #65816.
7235         * class.cs (TypeContainer.EmitContext): New property.
7236         (DefineNestedTypes): Create an emitcontext for each part.
7237         (MethodCore.DoDefineParameters): Use container's emitcontext.
7238         Pass type array to InternalParameters.
7239         (MemberBase.DoDefine): Use container's emitcontext.
7240         (FieldMember.Define): Likewise.
7241         (Event.Define): Likewise.
7242         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7243         Pass type array to InternalParameters.
7244         (SetIndexerMethod.GetParameterInfo): Likewise.
7245         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7246         * delegate.cs (Define): Pass emitcontext to
7247         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7248         array to InternalParameters.
7249         * expression.cs (ParameterReference.DoResolveBase): Pass
7250         emitcontext to GetParameterInfo.
7251         (ComposedCast.DoResolveAsTypeStep): Remove check on
7252         ec.ResolvingTypeTree.
7253         * parameter.cs (Parameter.Resolve): Change argument to
7254         EmitContext.  Use ResolveAsTypeTerminal.
7255         (Parameter.GetSignature): Change argument to EmitContext.
7256         (Parameters.ComputeSignature): Likewise.
7257         (Parameters.ComputeParameterTypes): Likewise.
7258         (Parameters.GetParameterInfo): Likewise.
7259         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7260         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7261         * support.cs (InternalParameters..ctor): Remove variant that takes
7262         a DeclSpace.
7263         * typemanager.cs (system_intptr_expr): New.
7264         (InitExpressionTypes): Initialize it.
7265
7266 2004-10-12  Chris Toshok  <toshok@ximian.com>
7267
7268         * cs-parser.jay: fix location for try_statement and catch_clause.
7269
7270 2004-10-07  Raja R Harinath  <rharinath@novell.com>
7271
7272         More DeclSpace.ResolveType avoidance.
7273         * decl.cs (MemberCore.InUnsafe): New property.
7274         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
7275         with newly created EmitContext.
7276         (FieldMember.Define): Likewise.
7277         * delegate.cs (Delegate.Define): Likewise.
7278         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7279         only if normal name-lookup fails.
7280         (TypeExpr.DoResolve): Enable error-checking.
7281         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7282         (SizeOf.DoResolve): Likewise.
7283         (ComposedCast.DoResolveAsTypeStep): Likewise.
7284         (StackAlloc.DoResolve): Likewise.
7285         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7286         (Block.Unsafe): New property.
7287         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7288         (Unsafe): Set 'unsafe' flag of contained block.
7289         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7290         (Fixed.Resolve): Likewise.
7291         (Catch.Resolve): Likewise.
7292         (Using.ResolveLocalVariableDecls): Likewise.
7293         (Foreach.Resolve): Likewise.
7294
7295 2004-10-05  John Luke <john.luke@gmail.com>
7296
7297         * cs-parser.jay: add location to error CS0175
7298
7299 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
7300
7301         * ecore.cs (Expression.Constantity): Add support for turning null
7302         into a constant.
7303
7304         * const.cs (Const.Define): Allow constants to be reference types
7305         as long as the value is Null.
7306
7307 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
7308
7309         * namespace.cs (NamespaceEntry.Using): No matter which warning
7310         level is set, check if this namespace name has already been added.
7311
7312 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
7313
7314         * expression.cs: reftype [!=]= null should always use br[true,false].
7315         # 67410
7316
7317 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
7318
7319         Fix #67108
7320         * attribute.cs: Enum conversion moved to 
7321         GetAttributeArgumentExpression to be applied to the all
7322         expressions.
7323
7324 2004-10-01  Raja R Harinath  <rharinath@novell.com>
7325
7326         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7327         * class.c (TypeContainer.DefineType): Flag error if
7328         base types aren't accessible due to access permissions.
7329         * decl.cs (DeclSpace.ResolveType): Move logic to
7330         Expression.ResolveAsTypeTerminal.
7331         (DeclSpace.ResolveTypeExpr): Thin layer over
7332         Expression.ResolveAsTypeTerminal.
7333         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7334         Refactor code into NestedAccess.  Use it.
7335         (DeclSpace.NestedAccess): New.
7336         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7337         argument to silence errors.  Check access permissions.
7338         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7339         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7340         (Cast.DoResolve): Likewise.
7341         (New.DoResolve): Likewise.
7342         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7343         (TypeOf.DoResolve): Likewise.
7344
7345         * expression.cs (Invocation.BetterConversion): Return the Type of
7346         the better conversion.  Implement section 14.4.2.3 more faithfully.
7347         (Invocation.BetterFunction): Make boolean.  Make correspondence to
7348         section 14.4.2.2 explicit.
7349         (Invocation.OverloadResolve): Update.
7350         (Invocation): Remove is_base field.
7351         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
7352         (Invocation.Emit): Likewise.
7353
7354 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
7355
7356         * cs-parser.jay: Reverted 642 warning fix.
7357
7358 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7359
7360         Fix bug #66615
7361         * decl.cs (FindMemberWithSameName): Indexer can have more than
7362         1 argument.
7363
7364 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7365
7366         * expression.cs (LocalVariableReference.DoResolveLValue):
7367         Do not report warning 219 for out values.
7368         (EmptyExpression.Null): New member to avoid extra allocations.
7369
7370 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7371
7372         * cs-parser.jay: Fix wrong warning 642 report.
7373
7374         * cs-tokenizer.cs (CheckNextToken): New helper;
7375         Inspect next character if is same as expected.
7376
7377 2004-09-23  Martin Baulig  <martin@ximian.com>
7378
7379         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7380         (Convert.ImplicitReferenceConversionExists): Likewise.
7381
7382 2004-11-09  Raja R Harinath  <rharinath@novell.com>
7383
7384         * Makefile (DISTFILES): Comment out a few missing files.
7385
7386 2004-10-29  Raja R Harinath  <rharinath@novell.com>
7387
7388         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
7389         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
7390         (gmcs.exe): Invoke bootstrap-libs.
7391         (clean-local): Clean the net_2_0_bootstrap profile too.
7392         (PROGRAM_INSTALL_DIR): New.
7393         (install-local): Use it.
7394
7395 2004-10-13  Martin Baulig  <martin@ximian.com>
7396
7397         * generic.cs (TypeManager.InflatedConstraints): New nested class.
7398         (TypeParameter.DefineType): If we're a method type parameter and
7399         that method is overriding something, "inflate" its constraints.
7400
7401 2004-10-12  Martin Baulig  <martin@ximian.com>
7402
7403         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
7404         and have type arguments, create and resolve a ConstructedType.
7405
7406 2004-10-12  Martin Baulig  <martin@ximian.com>
7407
7408         * decl.cs (MemberCache.FindMemberToOverride): Use
7409         TypeManager.IsEqual() to compare the parameters and Type.Equals()
7410         to compare the invocationType.
7411
7412         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
7413         When comparing two type parameters, only do the signature-only
7414         comparision for method type parameters.
7415
7416 2004-10-11  Martin Baulig  <martin@ximian.com>
7417
7418         * report.cs: Don't make --fatal abort on warnings, we have
7419         -warnaserror for that.
7420
7421 2004-10-11  Martin Baulig  <martin@ximian.com>
7422
7423         * typemanager.cs
7424         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
7425         (TypeManager.IsEqual): Call ourself recursively instead of using
7426         Type.IsEqual(). 
7427
7428 2004-10-11  Martin Baulig  <martin@ximian.com>
7429
7430         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
7431         on our own type parameters, not on the ones we inherit from a containing
7432         class.
7433
7434         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
7435         the comparision.
7436
7437         * generic.cs (TypeParameter.Define): We may only be called once.
7438
7439         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
7440         instead of TypeManager.IsEqual().
7441
7442 2004-09-28  Martin Baulig  <martin@ximian.com>
7443
7444         * generic.cs
7445         (GenericConstraints.EffectiveBaseClass): New public property.
7446         (TypeParameter.GenericConstraints): New public property.
7447         (ConstructedType.CheckConstraints): Improved.
7448
7449         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
7450         (Convert.TypeParameterConversion): New private method; use this in
7451         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
7452         for all conversions related to type parameters.
7453
7454 2004-09-24  Martin Baulig  <martin@ximian.com>
7455
7456         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
7457         type parameter conversions for type parameters which are known to
7458         be reference types.
7459
7460 2004-09-24  Martin Baulig  <martin@ximian.com>
7461
7462         * generic.cs (GenericConstraints): Added `IsReferenceType' and
7463         `IsValueType' properties.
7464
7465         * support.cs (ReflectionConstraints): Use
7466         Type.GetGenericParameterConstraints() instead of the old hack.
7467
7468 2004-09-24  Martin Baulig  <martin@ximian.com>
7469
7470         * generic.cs (GenericConstraints): Moved here and made it an
7471         abstract class.
7472
7473         * support.cs (GenericConstraints): Moved to generic.cs.
7474
7475 2004-09-24  Martin Baulig  <martin@ximian.com>
7476
7477         * support.cs
7478         (ReflectionConstraints): Un-nested this class and made it public.
7479
7480         * typemanager.cs
7481         (TypeManager.GetTypeParameterConstraints): New public method.
7482         (TypeManager.HasConstructorConstraint): Use the attributes.
7483
7484 2004-09-24  Martin Baulig  <martin@ximian.com>
7485
7486         * support.cs (GenericConstraints): Replaced `HasConstructor',
7487         `IsReferenceType' and `IsValueType' with `Attributes'.
7488         (ReflectionParameters.ReflectionConstraints): Removed the Create()
7489         method and made the .ctor public.
7490
7491         * generic.cs (Constraints.Attributes): New public property.
7492         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
7493         `IsReferenceType' -> `HasReferenceTypeConstraint' and
7494         `IsValueType' -> `HasValueTypeConstraint'.
7495
7496 2004-09-23  Martin Baulig  <martin@ximian.com>
7497
7498         * generic.cs (Constraints): Reflect latest runtime changes.
7499
7500 2004-09-23  Martin Baulig  <martin@ximian.com>
7501
7502         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7503         (Convert.ImplicitReferenceConversionExists): Likewise.
7504
7505 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7506
7507         * class.cs (Operator.Define): Add error 448 and 559 report.
7508         
7509 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7510
7511         * class.cs (MemberBase.IsTypePermitted): New protected
7512         method for checking error CS0610.
7513
7514 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7515
7516         * class.cs (TypeContainer.HasExplicitLayout): New property
7517         Returns whether container has StructLayout attribute set Explicit.
7518         (FieldMember): New abstract class for consts and fields.
7519         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7520         (Field): Reuse FieldMember.
7521
7522         * const.cs (Const): Reuse FieldMember.
7523
7524         * rootcontext.cs: EmitConstants call moved to class.
7525
7526 2004-09-22  Martin Baulig  <martin@ximian.com>
7527
7528         Marek and me just fixed one of our oldest bugs: #28562 :-)
7529
7530         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7531
7532         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7533         we're an EnumConstant, just return that.
7534         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7535         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
7536         to get the value which'll actually be written into the attribute.
7537         However, we have to use GetValue() to access the attribute's value
7538         in the compiler.        
7539
7540 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7541
7542         * constant.cs (Constant.IsNegative): New abstract property
7543         IsNegative.
7544
7545         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7546         (StackAlloc.DoResolve): Reused IsNegative.
7547
7548 2004-09-22  Martin Baulig  <martin@ximian.com>
7549
7550         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
7551         public method; like LookupTypeContainer, but also works for
7552         generic instances.
7553
7554         * report.cs (Report.SymbolRelatedToPreviousError): Use
7555         TypeManager.LookupGenericTypeContainer().       
7556
7557 2004-09-22  Martin Baulig  <martin@ximian.com>
7558
7559         Thanks to Peter Sestoft for this bug report.
7560
7561         * expression.cs (Conditional): If both the `trueExpr' and the
7562         `falseExpr' is a NullLiteral, return a NullLiteral.
7563
7564 2004-09-22  Martin Baulig  <martin@ximian.com>
7565
7566         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7567         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7568         for the "get_Current" call.
7569
7570 2004-09-21  Martin Baulig  <martin@ximian.com>
7571
7572         * convert.cs (Convert.ImplicitReferenceConversion): When
7573         converting to an interface type, first check whether we're
7574         converting from a reference type.
7575
7576 2004-09-14  Martin Baulig  <martin@ximian.com>
7577
7578         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7579
7580 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7581
7582         Fixed bug #61902
7583         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7584         called and is obsolete then this member suppress message
7585         when call is inside next [Obsolete] method or type.
7586
7587         * expression.cs: Use TestObsoleteMethodUsage member.
7588
7589 2004-09-14  Martin Baulig  <martin@ximian.com>
7590
7591         * genericparser.cs: Removed.
7592
7593 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
7594
7595         * class.cs (MethodCore.CheckBase): Fix bug #65757.
7596
7597 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
7598
7599         * attribute.cs (Attribute.Resolve): Add error 653 report.
7600
7601         * class.cs (Class.ApplyAttributeBuilder): Add error 641
7602         report.
7603         (Method.ApplyAttributeBuilder): Add error 685 report.
7604         (Operator.Define): Add error 564 report.
7605
7606         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7607
7608         * expression.cs (Invocation.DoResolve): Add error
7609         245 and 250 report.
7610
7611         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7612         error 674 report.
7613
7614 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7615
7616         * class.cs (ConstructorInitializer.Resolve):
7617         Wrong error number (515->516).
7618
7619 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7620
7621         * class.cs (Indexer.Define): Add error 631 report.
7622
7623 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7624
7625         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7626
7627 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7628
7629         * expression.cs (Probe.DoResolve): Add error CS0241 report.
7630
7631 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
7632
7633         * cs-parser.jay: Added error CS0241 report.
7634
7635 2004-09-10  Raja R Harinath  <rharinath@novell.com>
7636
7637         * cs-parser.jay (fixed_statement): Introduce a scope for the
7638         declaration in the 'fixed' statement.
7639
7640 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7641
7642         * cs-parser.jay: Added CS0230 error report.
7643
7644 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7645
7646         * cs-parser.jay: Added errors CS0231 and CS0257 report.
7647
7648 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7649
7650         * expression.cs (Argument.Resolve): Added error CS0192 and
7651         CS0199 report.
7652
7653 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7654
7655         C# 2.0 #pragma warning feature
7656
7657         * cs-tokenizer.cs (PreProcessPragma): New method; 
7658         Handles #pragma directive.
7659
7660         * report.cs (WarningRegions): New class; Support
7661         class for #pragma warning directive. It tests whether
7662         warning is enabled for a given line.
7663
7664 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
7665
7666         * const.cs: Add more descriptive error report, tahnks to
7667         Sebastien. 
7668
7669 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
7670
7671         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7672
7673 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
7674
7675         * expression.cs: Apply patch from Ben: Remove dead code from
7676         ArrayCreation, and remove the TurnintoConstant call in const.cs,
7677         as that code just threw an exception anwyays.
7678
7679         * const.cs: Remove the call to the turnintoconstant, for details
7680         see bug: #63144
7681         
7682         * literal.cs: The type of the null-literal is the null type;  So
7683         we use a placeholder type (literal.cs:System.Null, defined here)
7684         for it.
7685
7686         * expression.cs (Conditional.DoResolve): Remove some old code that
7687         is no longer needed, conversions have been fixed.
7688
7689         (ArrayCreationExpression.DoResolve): Return false if we fail to
7690         resolve the inner expression.
7691
7692 2004-09-07  Raja R Harinath  <rharinath@novell.com>
7693
7694         Fix test-290.cs.
7695         * cs-parser.jay (delegate_declaration): Record a delegate
7696         declaration as a type declaration.
7697         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7698
7699 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
7700
7701         * parameter.cs: Do not crash if the type can not be resolved. 
7702
7703         * expression.cs: Report errors with unsafe pointers, fixes #64896
7704
7705 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7706
7707         * expression.cs: Pointer arith always needs to do a conv.i
7708         if the operand is a long. fix 65320
7709
7710 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7711
7712         Fixed cs0619-37.cs, cs0619-38.cs
7713
7714         * enum.cs (GetObsoleteAttribute): Removed.
7715
7716         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7717         on Enum member is double staged. The first is tested member
7718         and then enum.
7719
7720 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7721
7722         Fixed #56986, #63631, #65231
7723
7724         * class.cs: (TypeContainer.AddToMemberContainer): New method,
7725         adds member to name container.
7726         (TypeContainer.AddToTypeContainer): New method, adds type to
7727         name container.
7728         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
7729         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
7730         AddOperator): Simplified by reusing AddToMemberContainer.
7731         (TypeContainer.UserDefinedStaticConstructor): Changed to property
7732         instead of field.
7733         (Method.CheckForDuplications): Fixed implementation to test all
7734         possibilities.
7735         (MemberBase): Detection whether member is explicit interface
7736         implementation is now in constructor.
7737         (MemberBase.UpdateMemberName): Handles IndexerName.
7738         (Accessor): Changed to keep also location information.
7739         (AbstractPropertyEventMethod): Is derived from MemberCore.
7740         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
7741         will be emited or not.
7742         (PropertyBase.AreAccessorsDuplicateImplementation):
7743         Tests whether accessors are not in collision with some method.
7744         (Operator): Is derived from MethodCore to simplify common
7745         operations.
7746
7747         * decl.cs (Flags.TestMethodDuplication): Test for duplication
7748         must be performed.
7749         (DeclSpace.AddToContainer): Adds the member to defined_names
7750         table. It tests for duplications and enclosing name conflicts.
7751
7752         * enum.cs (EnumMember): Clean up to reuse the base structures
7753
7754 2004-09-03  Martin Baulig  <martin@ximian.com>
7755
7756         Merged latest changes into gmcs.  Please keep this comment in
7757         here, it makes it easier for me to see what changed in MCS since
7758         the last time I merged.
7759
7760 2004-09-03  Martin Baulig  <martin@ximian.com>
7761
7762         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7763         into TypeContainer, to make partial classes work again.
7764
7765 2004-09-03  Martin Baulig  <martin@ximian.com>
7766
7767         * rootcontext.cs (RootContext.V2): Removed.
7768
7769 2004-03-23  Martin Baulig  <martin@ximian.com>
7770
7771         * expression.cs (Invocation.OverloadResolve): Added `bool
7772         may_fail' argument and use it instead of the Location.IsNull() hack.
7773
7774 2004-09-09  Martin Baulig  <martin@ximian.com>
7775
7776         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
7777
7778 2004-09-09  Martin Baulig  <martin@ximian.com>
7779
7780         * generic.cs (TypeParameter.DefineType): Added support for
7781         explicit interface methods.
7782
7783 2004-09-09  Martin Baulig  <martin@ximian.com>
7784
7785         * README.Changes: New document.  Started to list important changes
7786         between MCS and GMCS here.
7787
7788 2004-09-08  Martin Baulig  <martin@ximian.com>
7789
7790         * class.cs
7791         (TypeContainer.CheckRecursiveDefinition): New protected method.
7792         (TypeContainer.DefineType): Move the CS0146 check into
7793         CheckRecursiveDefinition().     
7794
7795 2004-09-06  Martin Baulig  <martin@ximian.com>
7796
7797         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
7798         types for the constructor constraint.
7799
7800 2004-09-03  Martin Baulig  <martin@ximian.com>
7801
7802         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7803         into TypeContainer, to make partial classes work again.
7804
7805 2004-09-03  Martin Baulig  <martin@ximian.com>
7806
7807         * rootcontext.cs (RootContext.V2): Removed.
7808
7809 2004-03-23  Martin Baulig  <martin@ximian.com>
7810
7811         * expression.cs (Invocation.OverloadResolve): Added `bool
7812         may_fail' argument and use it instead of the Location.IsNull() hack.
7813
7814 2004-09-03  Martin Baulig  <martin@ximian.com>
7815
7816         Merged latest changes into gmcs.  Please keep this comment in
7817         here, it makes it easier for me to see what changed in MCS since
7818         the last time I merged.
7819
7820 2004-09-03  Raja R Harinath  <rharinath@novell.com>
7821
7822         Fix #61128.
7823         * expression.cs (BetterConversion): Don't allow either conversion 
7824         to be null.  Remove redundant implicit conversion test when 'q ==
7825         null' -- when this function is invoked, we already know that the
7826         implicit conversion exists.
7827         (BetterFunction): Assume that 'best' is non-null.  Remove
7828         redundant reimplementation of IsApplicable when 'best' is null.
7829         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
7830         number of arguments.
7831         (IsAncestralType): Extract from OverloadResolve.
7832         (OverloadResolve): Make robust to the MethodGroupExpr being
7833         unsorted.  Implement all the logic of Section 14.5.5.1, and
7834         support overloading of methods from multiple applicable types.
7835         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
7836
7837         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
7838         (RealError, Warning): Append type of report to related symbol.
7839
7840 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
7841
7842         * enum.cs: Fixed CLS-Compliance checks for enum members.
7843         Error tests cs3008-8.cs, cs3014-8.cs
7844
7845 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
7846
7847         Fixed bug #62342, #63102
7848         * class.cs: ImplementIndexer uses member.IsExplicitImpl
7849         like ImplementMethod.
7850
7851 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
7852
7853         * attribute.cs (Attribute.GetAttributeArgumentExpression):
7854         Fixed bug #65170.
7855
7856 2004-09-02  Martin Baulig  <martin@ximian.com>
7857
7858         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7859         TypeManager.GetArgumentTypes() rather than calling GetParameters()
7860         on the MethodBase.
7861
7862 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
7863
7864         C# 2.0 Static classes implemented
7865
7866         * class.cs (TypeContainer): instance_constructors,
7867         initialized_fields, initialized_static_fields,
7868         default_constructor, base_inteface_types are protected to be
7869         accessible from StaticClass.
7870         (TypeContainer.DefineDefaultConstructor): New virtual method
7871         for custom default constructor generating
7872         (StaticClass): New class to handle "Static classes" feature.
7873
7874         * cs-parser.jay: Handle static keyword on class like instance
7875         of StaticClass.
7876
7877         * driver.cs: Added "/langversion" command line switch with two
7878         options (iso-1, default).
7879
7880 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
7881
7882         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
7883
7884 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
7885
7886         * delegate.cs: Style.
7887
7888 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7889
7890         * delegate.cs: Add seperate instance expr field for miguel.
7891
7892 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7893
7894         * PointerArithmetic (Resolve): make sure we are not doing
7895         pointer arith on void*. Also, make sure we are resolved
7896         by not setting eclass until resolve.
7897
7898         All callers: Make sure that PointerArithmetic gets resolved.
7899
7900 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7901
7902         * ArrayCreation (LookupType): If the type does not resolve 
7903         to an array, give an error.
7904
7905 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
7906
7907         * statement.cs (Try.Resolve): Fixed bug #64222
7908
7909 2004-08-27  Martin Baulig  <martin@ximian.com>
7910
7911         * class.cs
7912         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7913         crash here.     
7914
7915 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
7916
7917         * ecore.cs (Constantify): Get underlying type via
7918         System.Enum.GetUnderlyingType to avoid StackOverflow on the
7919         Windows in special cases.
7920
7921 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
7922
7923         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
7924         for obtaining also private methods.
7925         (GetRemoveMethod): Used GetRemoveMethod (true)
7926         for obtaining also private methods.
7927
7928 2004-09-02  Martin Baulig  <martin@ximian.com>
7929
7930         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7931         TypeManager.GetArgumentTypes() rather than calling GetParameters()
7932         on the MethodBase.
7933
7934 2004-08-27  Martin Baulig  <martin@ximian.com>
7935
7936         * class.cs
7937         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7938         crash here.     
7939
7940 2004-08-25  Martin Baulig  <martin@ximian.com>
7941
7942         * support.cs (ReflectionParameters..ctor): If this is a generic
7943         method, retrieve and store its type parameters.
7944         (InternalParameters..ctor): Added `TypeParameter[]' argument.
7945         (ReflectionParameters.GenericConstraints): The argument specifies
7946         the type parameter, not the method parameter.
7947         (InternalParameters.GenericConstraints): Likewise.
7948
7949         * generic.cs (TypeParameter.DefineType): Correctly handle
7950         constraints wrt. generic methods in interfaces and their
7951         implementations.        
7952
7953 2004-08-24  Martin Baulig  <martin@ximian.com>
7954
7955         * generic.cs (TypeParameter.IsSubclassOf): New public method.
7956         (Constraints.IsSubclassOf): New internal method.
7957
7958         * typemanager.cs (TypeManager.FindMembers): Added special support
7959         for GenericTypeParameterBuilder's.      
7960         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
7961         type parameters.
7962
7963 2004-08-24  Martin Baulig  <martin@ximian.com>
7964
7965         * typemanager.cs
7966         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
7967         this for accessibility checks.
7968         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
7969         IsNestedFamilyAccessible.
7970         (TypeManager.IsSubclassOf): New method, do what the name actually
7971         says.   
7972
7973 2004-08-24  Martin Baulig  <martin@ximian.com>
7974
7975         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
7976         as a SimpleName, include the generic arity.
7977
7978 2004-08-24  Martin Baulig  <martin@ximian.com>
7979
7980         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
7981         MethodAttributes.HideBySig for operators.
7982
7983 2004-08-23  Martin Baulig  <martin@ximian.com>
7984
7985         Back to the old error reporting system :-)
7986
7987         * report.cs (Message): Removed.
7988         (Report.MessageData, ErrorData, WarningData): Removed.
7989         (Report.Error, Warning): Back to the old system.
7990
7991 2004-08-23  Martin Baulig  <martin@ximian.com>
7992
7993         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
7994
7995         * class.cs (TypeContainer.ParentContainer): New public virtual
7996         method; replaces the explicit interface implementation.
7997         (ClassPart.ParentContainer): Override.
7998
7999 2004-08-23  Martin Baulig  <martin@ximian.com>
8000
8001         * statement.cs (Switch): Added support for constant switches; see
8002         #59428 or test-285.cs.
8003
8004 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8005
8006         Fixed bug #62740.
8007         * statement.cs (GetEnumeratorFilter): Removed useless
8008         logic because C# specs is strict. GetEnumerator must be
8009         public.
8010
8011 2004-08-22  Martin Baulig  <martin@ximian.com>
8012
8013         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8014         a switch and may break, reset the barrier.  Fixes #59867.
8015
8016 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8017
8018         CLS-Compliance speed up (~5% for corlib)
8019
8020         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8021         New method. Tests container for CLS-Compliant names
8022
8023         * class.cs (TypeContainer.VerifyClsName): New method.
8024         Checks whether container name is CLS Compliant.
8025         (Constructor): Implements IMethodData.
8026
8027         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8028         low-case table for CLS Compliance test.
8029         (MemberCache.VerifyClsParameterConflict): New method.
8030         Checks method parameters for CS3006 error.
8031
8032         * enum.cs (EnumMember): Is derived from MemberCore.
8033         (Enum.VerifyClsName): Optimized for better performance.
8034
8035 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8036
8037         * report.cs: Renamed Error_T to Error and changed all
8038         references.
8039
8040 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8041
8042         * class.cs (TypeContainer.IndexerArrayList): New inner class
8043         container for indexers.
8044         (TypeContainer.DefaultIndexerName): New constant for default
8045         indexer name. Replaced all "Item" with this constant.
8046         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8047
8048         * typemanager.cs (TypeManager.default_member_ctor): Cache here
8049         DefaultMemberAttribute constructor.
8050
8051 2004-08-05  Martin Baulig  <martin@ximian.com>
8052
8053         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8054         Fix bug #59429.
8055
8056 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
8057
8058         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8059         multi platforms problem.
8060
8061         * compiler.csproj: Included shared files.
8062
8063 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8064
8065         Fix bug 60333, 55971 in the more general way
8066         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8067         Added arg_type argument for constant conversion.
8068         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8069
8070 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8071
8072         Fix bug #59760
8073         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
8074         OperatorArrayList, MethodCoreArrayList for typecontainer
8075         containers. Changed class member types to these new types.
8076         (MethodArrayList.DefineMembers): Added test for CS0659.
8077
8078 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
8079
8080         * cfold.cs: Synchronize the folding with the code in expression.cs
8081         Binary.DoNumericPromotions for uint operands.
8082
8083         * attribute.cs: Revert patch from Raja, it introduced a regression
8084         while building Blam-1.2.1 (hard to isolate a test case).
8085
8086 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8087
8088         Fix for #55382
8089         * class.cs:
8090         (TypeContainer.Define): Renamed to DefineContainerMembers because of
8091         name collision.
8092         (MethodCore.parent_method): New member. The method we're overriding
8093         if this is an override method.
8094         (MethodCore.CheckBase): Moved from Method class and made common.
8095         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8096         private.
8097         (MethodCore.CheckForDuplications): New abstract method. For custom
8098         member duplication search in a container
8099         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8100         method and its return type.
8101         (Event.conflict_symbol): New member. Symbol with same name in the
8102         parent class.
8103
8104         * decl.cs:
8105         (MemberCache.FindMemberWithSameName): New method. The method
8106         is looking for conflict with inherited symbols.
8107
8108 2004-08-04  Martin Baulig  <martin@ximian.com>
8109
8110         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8111
8112         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8113
8114 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8115
8116         * report.cs (Message): New enum for better error, warning reference in
8117         the code.
8118         (MessageData): New inner abstract class. It generally handles printing of
8119         error and warning messages.
8120         Removed unused Error, Warning, Message methods.
8121
8122 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8123
8124         Fix for cs0592-8.cs test
8125         * attribute.cs
8126         (Attributable.ValidAttributeTargets): Made public.
8127         (Attribute.ExplicitTarget): New member for explicit target value.
8128         (Attribute.CheckTargets): Now we translate explicit attribute
8129         target to Target here.
8130
8131 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
8132
8133         * ecore.cs (MethodGroupExpr): new IsBase property.
8134
8135         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8136
8137         * delegate.cs (DelegateCreation): store a MethodGroupExpr
8138         rather than an instance expr.
8139
8140         (DelegateCreation.Emit): Use the method group rather than
8141         the instance expression. Also, if you have base.Foo as the
8142         method for a delegate, make sure to emit ldftn, not ldftnvirt.
8143
8144         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
8145
8146         (NewDelegate.DoResolve): Only check for the existance of Invoke
8147         if the method is going to be needed. Use MethodGroupExpr.
8148
8149         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
8150
8151         * expression.cs: For pointer arith., make sure to use
8152         the size of the type, not the size of the pointer to
8153         the type.
8154
8155 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8156
8157         Fix for #60722
8158         * class.cs (Class): Added error CS0502 test.
8159
8160 2004-08-03  John Luke  <jluke@cfl.rr.com>
8161             Raja R Harinath  <rharinath@novell.com>
8162
8163         Fix for #60997.
8164         * attribute.cs (Attribute.complained_before): New flag.
8165         (Attribute.ResolveType, Attribute.Resolve),
8166         (Attribute.DefinePInvokeMethod): Set it.
8167         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8168         
8169 2004-08-03  Martin Baulig  <martin@ximian.com>
8170
8171         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8172         use a user-defined operator; we still need to do numeric
8173         promotions in case one argument is a builtin type and the other
8174         one has an implicit conversion to that type.  Fixes #62322.
8175
8176 2004-08-18  Martin Baulig  <martin@ximian.com>
8177
8178         * class.cs (Method.Define): Use the correct method name when
8179         creating the MethodBuilder for a generic method.
8180
8181 2004-08-17  Martin Baulig  <martin@ximian.com>
8182
8183         * generic.cs (Constraints): Support type parameter constraints.
8184
8185 2004-08-16  Martin Baulig  <martin@ximian.com>
8186
8187         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
8188         (Token.GENERIC_DIMENSION): New token; this is returned if we
8189         encounter an unbound generic type in a typeof() expression.
8190
8191         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
8192         this token is only generated while parsing a typeof() expression.
8193         (typeof_expression): Removed the old unbound_type hack.
8194
8195         * generic.cs (TypeArguments.IsUnbound): New public property.
8196
8197         * decl.cs (MemberName): Added support for unbound types.
8198
8199 2004-08-14  Martin Baulig  <martin@ximian.com>
8200
8201         * typemanager.cs
8202         (TypeManager.IsEqualGenericInstance): New static method.
8203         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
8204         just used to check accessibility, so follow the rules of 26.1.6.        
8205
8206         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
8207         ConstructedType instead of a TypeExpression if we have type arguments.
8208
8209         * cs-parser.jay (typeof_expression): Support unbound generic types.
8210
8211         * ecore.cs (UnboundTypeExpression): New public class.
8212
8213 2004-08-12  Martin Baulig  <martin@ximian.com>
8214
8215         * typemanager.cs (TypeManager.IsNestedChildOf): Use
8216         TypeManager.IsEqual() rather than `=='.
8217
8218         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
8219         generic instances as well.
8220
8221 2004-08-12  Martin Baulig  <martin@ximian.com>
8222
8223         * expression.cs (Invocation.InferType): We can only infer method
8224         type parameters.  Fixes #62647.
8225
8226 2004-08-11  Martin Baulig  <martin@ximian.com>
8227
8228         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
8229         before resolving the base classes.
8230
8231 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8232
8233         * Makefile: install .mdb file too.
8234
8235 2004-08-05  Martin Baulig  <martin@ximian.com>
8236
8237         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
8238         initializer, the current type is just the TypeBuilder, not the
8239         instantiated generic type.
8240         (FieldExpr.IsFieldInitializer): New public property.
8241
8242 2004-08-04  Martin Baulig  <martin@ximian.com>
8243
8244         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8245
8246         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8247
8248 2004-08-03  Martin Baulig  <martin@ximian.com>
8249
8250         * class.cs (MethodData.Define): If we're an explicit
8251         implementation, remove the generic arity from the type name.
8252
8253 2004-08-03  Martin Baulig  <martin@ximian.com>
8254
8255         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8256         use a user-defined operator; we still need to do numeric
8257         promotions in case one argument is a builtin type and the other
8258         one has an implicit conversion to that type.  Fixes #62322.
8259
8260 2004-08-02  Martin Baulig  <martin@ximian.com>
8261
8262         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
8263         `TypeExpr[]' array.
8264         (TypeContainer.GetClassBases): Return the unexpanded list of
8265         interfaces; we expand them later.
8266         (TypeContainer.DefineType): After creating the TypeBuilder, call
8267         TypeManager.ExpandInterfaces() to get an expanded and resolved
8268         list of interfaces.
8269
8270         * ecore.cs (TypeExpr.GetInterfaces): Removed
8271
8272         * generics.cs (Constraints.InterfaceConstraints): Remove.
8273         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
8274         register the interface constraints.
8275
8276         * typemanager.cs
8277         (TypeManager.AddUserType): Removed the `ifaces' argument.
8278         (TypeManager.AddTypeParameter): Likewise.
8279         (TypeManager.AddUserInterface): Removed, was unused.
8280         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
8281         `TypeExpr[]' array for the interfaces.
8282         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
8283         has been defined, returns a list of the resolved interfaces types.
8284         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
8285         (TypeManager.GetExplicitInterfaces): Likewise.  
8286
8287 2004-08-02  Martin Baulig  <martin@ximian.com>
8288
8289         * expression.cs (Invocation.EmitCall): If we're invoking a method
8290         on a type parameter, use the new `Constrained' prefix opcode.
8291
8292 2004-08-02  Martin Baulig  <martin@ximian.com>
8293
8294         * statement.cs (LocalInfo.Flags): Added `IsThis'.
8295         (LocalInfo.IsThis): New public property.
8296         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8297
8298 2004-08-01  Martin Baulig  <martin@ximian.com>
8299
8300         * class.cs (TypeContainer.GetClassBases): Don't set the default
8301         here since we may get called from GetPartialBases().
8302         (TypeContainer.DefineType): If GetClassBases() didn't return a
8303         parent, use the default one.
8304
8305 2004-07-30  Martin Baulig  <martin@ximian.com>
8306
8307         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8308
8309         * class.cs (SourceMethod): New public class, derive from the
8310         symbol writer's ISourceMethod.
8311         (Method): Use the new symbol writer API.
8312
8313         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8314         as argument and use the new symbol writer.
8315
8316         * location.cs
8317         (SourceFile): Implement the symbol writer's ISourceFile.
8318         (Location.SymbolDocument): Removed.
8319         (Location.SourceFile): New public property.
8320
8321         * symbolwriter.cs: Use the new symbol writer API.
8322
8323 2004-07-30  Raja R Harinath  <rharinath@novell.com>
8324
8325         * Makefile (install-local): Remove.  Functionality moved to
8326         executable.make.
8327
8328 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
8329
8330         * Makefile: Install mcs.exe.config file together with mcs.exe.
8331         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8332         correct runtime version.
8333         
8334 2004-07-25  Martin Baulig  <martin@ximian.com>
8335
8336         * class.cs
8337         (TypeContainer.RegisterOrder): Removed, this was unused.
8338         (TypeContainer, interface_order): Removed.
8339         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8340         TypeContainer as argument since we can also be called with a
8341         `PartialContainer' for a partial class/struct/interface.
8342         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8343         of checking whether we're an `Interface' - we could be a
8344         `PartialContainer'.
8345         (PartialContainer.Register): Override; call
8346         AddClass()/AddStruct()/AddInterface() on our parent.
8347
8348         * cs-parser.jay (interface_member_declaration): Add things to the
8349         `current_container', not the `current_class'.
8350
8351         * rootcontext.cs (RegisterOrder): The overloaded version which
8352         takes an `Interface' was unused, removed.
8353
8354         * typemanager.cs (TypeManager.LookupInterface): Return a
8355         `TypeContainer', not an `Interface'.
8356         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8357         contain a `PartialContainer' for an interface, so check it's
8358         `Kind' to figure out what it is.
8359
8360 2004-07-25  Martin Baulig  <martin@ximian.com>
8361
8362         * class.cs (Class.DefaultTypeAttributes): New public constant.
8363         (Struct.DefaultTypeAttributes): Likewise.
8364         (Interface.DefaultTypeAttributes): Likewise.
8365         (PartialContainer.TypeAttr): Override this and add the
8366         DefaultTypeAttributes.
8367
8368 2004-07-25  Martin Baulig  <martin@ximian.com>
8369
8370         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8371         we can just use the `Parent' field instead.
8372
8373 2004-07-25  Martin Baulig  <martin@ximian.com>
8374
8375         * class.cs (TypeContainer.Emit): Renamed to EmitType().
8376
8377 2004-07-25  Martin Baulig  <martin@ximian.com>
8378
8379         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8380         our parts before defining any methods.
8381         (TypeContainer.VerifyImplements): Make this virtual.
8382         (ClassPart.VerifyImplements): Override and call VerifyImplements()
8383         on our PartialContainer.
8384
8385 2004-07-25  Martin Baulig  <martin@ximian.com>
8386
8387         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8388
8389         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8390         argument, we can just use the `Parent' field instead.
8391
8392         * class.cs
8393         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
8394         (MemberBase.DoDefine): Likewise.
8395
8396 2004-07-24  Martin Baulig  <martin@ximian.com>
8397
8398         * decl.cs (MemberCore.Parent): New public field.
8399         (DeclSpace.Parent): Moved to MemberCore.
8400
8401         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8402         (MemberBase.ctor): Added TypeContainer argument, pass it to our
8403         parent's .ctor.
8404         (FieldBase, Field, Operator): Likewise.
8405         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8406         (EventField, Event): Likewise.
8407
8408 2004-07-23  Martin Baulig  <martin@ximian.com>
8409
8410         * class.cs (PartialContainer): New public class.
8411         (ClassPart): New public class.
8412         (TypeContainer): Added support for partial classes.
8413         (TypeContainer.GetClassBases): Splitted some of the functionality
8414         out into GetNormalBases() and GetPartialBases().
8415
8416         * cs-tokenizer.cs (Token.PARTIAL): New token.
8417         (Tokenizer.consume_identifier): Added some hacks to recognize
8418         `partial', but only if it's immediately followed by `class',
8419         `struct' or `interface'.
8420
8421         * cs-parser.jay: Added support for partial clases.
8422
8423 2004-07-23  Martin Baulig  <martin@ximian.com>
8424
8425         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8426         a `DeclSpace' and also made it readonly.
8427         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8428         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8429         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8430
8431         * cs-parser.jay: Pass the `current_class', not the
8432         `current_container' (at the moment, this is still the same thing)
8433         to a new Method, Property, Event, Indexer or Constructor.
8434
8435 2004-07-23  Martin Baulig  <martin@ximian.com>
8436
8437         * cs-parser.jay (CSharpParser): Added a new `current_class' field
8438         and removed the `current_interface' one.
8439         (struct_declaration, class_declaration, interface_declaration):
8440         Set `current_class' to the newly created class/struct/interface;
8441         set their `Bases' and call Register() before parsing their body.
8442
8443 2004-07-23  Martin Baulig  <martin@ximian.com>
8444
8445         * class.cs (Kind): New public enum.
8446         (TypeContainer): Made this class abstract.
8447         (TypeContainer.Kind): New public readonly field.
8448         (TypeContainer.CheckDef): New public method; moved here from
8449         cs-parser.jay.
8450         (TypeContainer.Register): New public abstract method.
8451         (TypeContainer.GetPendingImplementations): New public abstract
8452         method.
8453         (TypeContainer.GetClassBases): Removed the `is_class' and
8454         `is_iface' parameters.
8455         (TypeContainer.DefineNestedTypes): Formerly known as
8456         DoDefineType().
8457         (ClassOrStruct): Made this class abstract.
8458
8459         * tree.cs (RootTypes): New public type. 
8460
8461 2004-07-20  Martin Baulig  <martin@ximian.com>
8462
8463         * tree.cs (Tree.RecordNamespace): Removed.
8464         (Tree.Namespaces): Removed.
8465
8466         * rootcontext.cs (RootContext.IsNamespace): Removed.
8467
8468         * cs-parser.jay (namespace_declaration): Just create a new
8469         NamespaceEntry here.
8470
8471 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
8472
8473         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
8474         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
8475         entry to make sure it runs in the correct runtime version.
8476         
8477 2004-07-18  Martin Baulig  <martin@ximian.com>
8478
8479         * generic.cs (ConstructedType.CheckConstraints): Improved
8480         constraints checking.
8481
8482 2004-07-18  Martin Baulig  <martin@ximian.com>
8483
8484         * expression.cs (Invocation.BetterMethod): Call
8485         TypeManager.TypeToCoreType() on all types and removed my previous
8486         hack; we're already doig the right thing here.
8487
8488 2004-07-17  Martin Baulig  <martin@ximian.com>
8489
8490         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
8491
8492 2004-07-16  Martin Baulig  <martin@ximian.com>
8493
8494         * iterators.cs: Added generics support.
8495
8496 2004-07-16  Martin Baulig  <martin@ximian.com>
8497
8498         * iterators.cs: Rewrote this.  We're now using one single Proxy
8499         class for both the IEnumerable and the IEnumerator interface and
8500         `Iterator' derives from Class so we can use the high-level API.
8501
8502         * class.cs (TypeContainer.AddIterator): New method.
8503         (TypeContainer.DoDefineType): New protected virtual method, which
8504         is called from DefineType().
8505         (TypeContainer.DoDefineMembers): Call DefineType() and
8506         DefineMembers() on all our iterators.
8507         (TypeContainer.Emit): Call Emit() on all our iterators.
8508         (TypeContainer.CloseType): Call CloseType() on all our iterators.
8509
8510         * codegen.cs (EmitContext.CurrentIterator): New public field.
8511
8512 2004-07-15  Martin Baulig  <martin@ximian.com>
8513
8514         * typemanager.cs
8515         (TypeManager.not_supported_exception_type): New type.   
8516
8517 2004-07-14  Martin Baulig  <martin@ximian.com>
8518
8519         * typemanager.cs
8520         (TypeManager.generic_ienumerable_type): New type.
8521         (TypeManager.generic_ienumerator_type): New type.
8522
8523         * rootcontext.cs
8524         (RootContext.interfaces_first_stage): Added
8525         "System.Collections.Generic.IEnumerator`1" and
8526         "System.Collections.Generic.IEnumerable`1".     
8527
8528 2004-07-14  Martin Baulig  <martin@ximian.com>
8529
8530         * iterators.cs: Use real error numbers.
8531
8532 2004-07-14  Martin Baulig  <martin@ximian.com>
8533
8534         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8535         requires this to be a System.Collection.IEnumerable and not a
8536         class implementing that interface.
8537         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
8538
8539 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
8540
8541         * class.cs: Fixed previous fix, it broke some error tests.
8542
8543 2004-07-12  Martin Baulig  <martin@ximian.com>
8544
8545         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8546         Fixes #61293.
8547
8548 2004-07-14  Martin Baulig  <martin@ximian.com>
8549
8550         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
8551         an exclamation mark (!) for the generic arity to reflect the
8552         latest spec changes; ie. use "System.Collections.Generic.IList`1".
8553
8554 2004-07-13  Martin Baulig  <martin@ximian.com>
8555
8556         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
8557         specifiers being part of a type argument.
8558
8559 2004-07-13  Martin Baulig  <martin@ximian.com>
8560
8561         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
8562         name for generic types.
8563
8564 2004-07-13  Martin Baulig  <martin@ximian.com>
8565
8566         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
8567         bit to fix #60119.
8568
8569 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
8570
8571         * assign.cs (LocalTemporary): Add new argument: is_address,If
8572         `is_address' is true, then the value that we store is the address
8573         to the real value, and not the value itself.
8574         
8575         * ecore.cs (PropertyExpr): use the new local temporary
8576         stuff to allow us to handle X.Y += z (where X is a struct)
8577
8578 2004-07-08  Martin Baulig  <martin@ximian.com>
8579
8580         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8581         not always return, just like we're doing in Using.Resolve().
8582
8583 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
8584
8585         * cs-parser.jay (fixed_statement): flag this as Pinned.
8586
8587 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
8588
8589         * typemanager.cs (TypeManager): Removed MakePinned method, this
8590         mechanism is replaced with the .NET 2.x compatible mechanism of
8591         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8592
8593         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
8594         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8595         `IsFixed' property which has a different meaning.
8596
8597 2004-07-02  Raja R Harinath  <rharinath@novell.com>
8598
8599         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8600         visible from inside a nested class, not just the names of the
8601         immediately enclosing class.
8602         Fix for bug #60730.
8603
8604 2004-06-24  Raja R Harinath  <rharinath@novell.com>
8605
8606         * expression.cs (BetterConversion): Remove buggy special-case
8607         handling of "implicit constant expression conversions".  At this
8608         point, we already know that the conversion is possible -- we're
8609         only checking to see which is better.
8610
8611 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8612
8613         * cs-parser.jay: Added error CS0210 test.
8614
8615 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8616
8617         * cs-parser.jay: Added error CS0134 test.
8618
8619 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8620
8621         Fix bug #52507
8622         * cs-parser.jay: Added error CS0145 test.
8623
8624 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8625
8626         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8627
8628 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
8629         
8630         * expression.cs (StackAlloc.Resolve): The argument may not
8631         be a constant; deal with this case.
8632         
8633 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
8634
8635         * attribute.cs (IndexerName_GetIndexerName): Renamed to
8636         GetIndexerAttributeValue.
8637         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8638
8639         * class.cs (Indexer.Define): Added error tests for CS0415,
8640         CS0609.
8641
8642 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
8643
8644         * attribute.cs (Attribute.Resolve): Keep field code in sync with
8645         property code.
8646
8647 2004-06-23  Martin Baulig  <martin@ximian.com>
8648
8649         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8650         neither return nor throw, reset the barrier as well.  Fixes #60457.
8651
8652 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
8653
8654         * class.cs : EventAttributes is now set to None by default.
8655           This fixes bug #60459.
8656
8657 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8658
8659         Fix bug #60219
8660         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8661         Don't throw exception but return null (it's sufficient now).
8662
8663 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8664
8665         * typemanager.cs (GetArgumentTypes): Faster implementation.
8666
8667 2004-06-18  Martin Baulig  <martin@ximian.com>
8668
8669         * attribute.cs (Attribute.Resolve): Check whether we're an
8670         EmptyCast which a Constant child.  Fixes #60333.
8671
8672 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
8673
8674         * statement.cs (EmitCollectionForeach): Account for the fact that
8675         not all valuetypes are in areas which we can take the address of.
8676         For these variables, we store to a temporary variable. Also, make
8677         sure that we dont emit a `callvirt' on a valuetype method.
8678
8679 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8680
8681         * expression.cs (StackAlloc.DoReSolve): Added test for
8682         negative parameter (CS0247).
8683
8684 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8685
8686         Fix bug #59792
8687         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8688
8689 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8690
8691         Fix bug #59781
8692         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8693         ulong.
8694
8695 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8696
8697         Fix bug #58254 & cs1555.cs, cs1556.cs
8698         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8699
8700 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8701
8702         * cs-parser.jay: Added error CS1669 test for indexers.
8703
8704 2004-06-18  Martin Baulig  <martin@ximian.com>
8705
8706         * generics.cs (GenericMethod.ctor): Don't take an Attributes
8707         argument.  Fixes #60441.
8708
8709 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
8710         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
8711         The name needs to have the actual name of the method in order
8712         for other tests (such as the one in OverloadResolve for Invoke
8713         on a delegate) to work. As well, it does not really help
8714         error reporting because the method group had multiple methods.
8715         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
8716         Make profiling work.
8717         
8718 2004-06-13  Martin Baulig  <martin@ximian.com>
8719
8720         * cs-parser.jay: Don't allow generic attributes.
8721
8722 2004-06-13  Martin Baulig  <martin@ximian.com>
8723
8724         * class.cs (MemberBase.DoDefineBase): New protected method.
8725         (MemberBase.DoDefine): Compute the `flags' in the new
8726         DoDefineBase() which must be called first.
8727         (Method.Define): Call DoDefineBase() first so we have the flags
8728         when defining the generic method.
8729
8730         * cs-parser.jay (interface_method_declaration): Support generic methods.
8731
8732 2004-06-13  Martin Baulig  <martin@ximian.com>
8733
8734         * decl.cs (TypeName): Removed.
8735         (MemberName): Removed TypeName and MemberNow; now we just have
8736         MemberName.
8737
8738         * cs-parser.jay: Don't distinguish between type arguments and type
8739         parameters in the grammar and simplified the rules a bit.  The
8740         reduce/reduce conflicts are now gone (except the one we inherited
8741         from mcs).
8742
8743 2004-06-11  Martin Baulig  <martin@ximian.com>
8744
8745         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
8746         call this twice: for params and varargs methods.
8747
8748 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8749
8750         * class.cs:
8751         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
8752
8753 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8754
8755         * attribute.cs (Attribute.GetValidTargets): Made public.
8756
8757         * class.cs: 
8758         (AbstractPropertyEventMethod): New class for better code sharing.
8759         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
8760         CS1667 report.
8761         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
8762
8763 2004-06-09  Martin Baulig  <martin@ximian.com>
8764
8765         * cs-parser.jay: Removed a reduce/reduce conflict.
8766
8767 2004-06-03  Martin Baulig  <martin@ximian.com>
8768
8769         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
8770         GetSimpleName() and return a SimpleName.
8771
8772         * ecore.cs (SimpleName.Arguments): New public field.
8773         (SimpleName): Added overloaded ctor which takes an additional
8774         TypeArguments argument.
8775         (SimpleName.SimpleNameResolve): Added support for generic methods.
8776         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
8777         formerly in MemberAccess.DoResolve(), but we also need it in
8778         SimpleNameResolve().
8779
8780         * expression.cs (MemberAccess.DoResolve): Use the new
8781         MethodGroupExpr.ResolveGeneric().       
8782
8783 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8784
8785         * decl.cs: If possible, use lookuptypedirect here. We can only do
8786         this if there is no `.' after the namespace. Avoids using
8787         LookupType, which does lots of slow processing.
8788         (FindNestedType) New method, does what it says :-).
8789         * namespace.cs: use LookupTypeDirect.
8790         * rootcontext.cs: use membercache, if possible.
8791         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8792
8793 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8794
8795         * expression.cs:
8796         According to the spec, 
8797
8798         In a member access of the form E.I, if E is a single identifier,
8799         and if the meaning of E as a simple-name (§7.5.2) is a constant,
8800         field, property, localvariable, or parameter with the same type as
8801         the meaning of E as a type-name (§3.8), then both possible
8802         meanings of E are permitted.
8803
8804         We did not check that E as a simple-name had the same type as E as
8805         a type name.
8806
8807         This trivial check gives us 5-7% on bootstrap time.
8808
8809 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8810
8811         * expression.cs (Invocation.OverloadResolve): Avoid the
8812         use of hashtables and boxing here by allocating on demand.
8813
8814 2004-05-30  Martin Baulig  <martin@ximian.com>
8815
8816         * rootcontext.cs (RootContext.LookupType): Don't cache things if
8817         we're doing a silent lookup.  Don't try to lookup nested types in
8818         TypeManager.object_type (thanks to Ben Maurer).
8819
8820 2004-05-30  Martin Baulig  <martin@ximian.com>
8821
8822         Committing a patch from Ben Maurer.
8823
8824         * rootcontext.cs (RootContext.LookupType): Cache negative results.
8825
8826 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8827
8828         * convert.cs: add a trivial cache for overload operator resolution.
8829
8830 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
8831
8832         * attribute.cs
8833         (AttributeTester.GetObsoleteAttribute): Returns instance of
8834         ObsoleteAttribute when type is obsolete.
8835
8836         * class.cs
8837         (TypeContainer.VerifyObsoleteAttribute): Override.
8838         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
8839         (MethodCode.VerifyObsoleteAttribute): Override.
8840         (MemberBase.VerifyObsoleteAttribute): Override.
8841
8842         * decl.cs
8843         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
8844         and report proper error.
8845
8846         *delegate.cs
8847         (Delegate.VerifyObsoleteAttribute): Override.
8848
8849         * ecore.cs
8850         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
8851         and report proper error.
8852         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
8853
8854         * enum.cs
8855         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
8856         and enum member.
8857
8858         * expression.cs
8859         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
8860         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
8861         Added test for ObsoleteAttribute.
8862
8863         * statement.cs
8864         (Catch): Derived from Statement.
8865
8866 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8867
8868         * decl.cs: If possible, use lookuptypedirect here. We can only do
8869         this if there is no `.' after the namespace. Avoids using
8870         LookupType, which does lots of slow processing.
8871         (FindNestedType) New method, does what it says :-).
8872         * namespace.cs: use LookupTypeDirect.
8873         * rootcontext.cs: use membercache, if possible.
8874         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8875
8876 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8877
8878         * expression.cs:
8879         According to the spec, 
8880
8881         In a member access of the form E.I, if E is a single identifier,
8882         and if the meaning of E as a simple-name (§7.5.2) is a constant,
8883         field, property, localvariable, or parameter with the same type as
8884         the meaning of E as a type-name (§3.8), then both possible
8885         meanings of E are permitted.
8886
8887         We did not check that E as a simple-name had the same type as E as
8888         a type name.
8889
8890         This trivial check gives us 5-7% on bootstrap time.
8891
8892 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
8893
8894         Fixed bug #59071 & cs0160.cs
8895         * statement.cs (Try.Resolve): Check here whether order of catch
8896         clauses matches their dependencies.
8897
8898 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
8899
8900         Fixed bug #58624
8901         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
8902         unsafe type.
8903
8904 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8905
8906         * expression.cs (Invocation.OverloadResolve): Avoid the
8907         use of hashtables and boxing here by allocating on demand.
8908
8909 2004-05-30  Martin Baulig  <martin@ximian.com>
8910
8911         * rootcontext.cs (RootContext.LookupType): Don't cache things if
8912         we're doing a silent lookup.  Don't try to lookup nested types in
8913         TypeManager.object_type (thanks to Ben Maurer).
8914
8915 2004-05-30  Martin Baulig  <martin@ximian.com>
8916
8917         Committing a patch from Ben Maurer.
8918
8919         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
8920
8921 2004-05-29  Martin Baulig  <martin@ximian.com>
8922
8923         * class.cs (IMethodData.ShouldIgnore): New method.
8924
8925         * typemanager.cs (TypeManager.MethodFlags): Don't take a
8926         `Location' argument, we don't need it anywhere.  Use
8927         `IMethodData.ShouldIgnore ()' instead of
8928         `MethodData.GetMethodFlags ()'.
8929         (TypeManager.AddMethod): Removed.
8930         (TypeManager.AddMethod2): Renamed to AddMethod.
8931
8932 2004-05-29  Martin Baulig  <martin@ximian.com>
8933
8934         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
8935
8936         * convert.cs (Convert.ImplicitReferenceConversion): If we're
8937         converting from a class type S to an interface type and we already
8938         have an object on the stack, don't box it again.  Fixes #52578.
8939
8940 2004-05-29  Martin Baulig  <martin@ximian.com>
8941
8942         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8943         Added support for `params' parameters.  Fixes #59267.
8944
8945 2004-05-29  Martin Baulig  <martin@ximian.com>
8946
8947         * literal.cs (NullPointer): Provide a private .ctor which sets
8948         `type' to TypeManager.object_type.  Fixes #59048.
8949
8950 2004-05-29  Martin Baulig  <martin@ximian.com>
8951
8952         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
8953         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
8954
8955         * ecore.cs (EventExpr.instance_expr): Make the field private.
8956
8957 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
8958
8959         Fixed bug #50080 & cs0214-2.cs
8960         * expression.cs (Cast.DoResolve): Check unsafe context here.
8961         
8962         * statement.cs (Resolve.DoResolve): Likewise.
8963
8964 2004-05-26  Martin Baulig  <martin@ximian.com>
8965
8966         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
8967
8968         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
8969         (RootContext.LookupType): Pass down the `silent' flag.
8970
8971 2004-05-25  Martin Baulig  <martin@ximian.com>
8972
8973         * expression.cs
8974         (MethodGroupExpr.IdenticalTypeName): New public property.
8975         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
8976         expression actually refers to a type.
8977
8978 2004-05-25  Martin Baulig  <martin@ximian.com>
8979
8980         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
8981         for #56176 and made it actually work.
8982
8983 2004-05-25  Martin Baulig  <martin@ximian.com>
8984
8985         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
8986         (FieldExpr, PropertyExpr): Override and implement
8987         CacheTemporaries.  Fixes #52279.
8988
8989 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
8990
8991         * location.cs: In the new compiler listing a file twice is a
8992         warning, not an error.
8993
8994 2004-05-24  Martin Baulig  <martin@ximian.com>
8995
8996         * enum.cs (Enum.DefineType): For the `BaseType' to be a
8997         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
8998
8999 2004-05-24  Martin Baulig  <martin@ximian.com>
9000
9001         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9002         walking the `using' list.  Fixes #53921.
9003
9004 2004-05-24  Martin Baulig  <martin@ximian.com>
9005
9006         * const.cs (Const.LookupConstantValue): Added support for
9007         EmptyCast's; fixes #55251.
9008
9009 2004-05-24  Martin Baulig  <martin@ximian.com>
9010
9011         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9012         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9013         which does the CS0135 check.  The reason is that we first need to
9014         check whether the variable actually exists.
9015
9016 2004-05-24  Martin Baulig  <martin@ximian.com>
9017
9018         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9019         than RootContext.LookupType() to find the explicit interface
9020         type.  Fixes #58584.
9021
9022 2004-05-24  Raja R Harinath  <rharinath@novell.com>
9023
9024         * Makefile: Simplify.  Use executable.make.
9025         * mcs.exe.sources: New file.  List of sources of mcs.exe.
9026
9027 2004-05-24  Anders Carlsson  <andersca@gnome.org>
9028
9029         * decl.cs:
9030         * enum.cs:
9031         Use the invariant culture when doing String.Compare for CLS case
9032         sensitivity.
9033         
9034 2004-05-23  Martin Baulig  <martin@ximian.com>
9035
9036         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9037         don't have any dots.  Fixes #52622, added cs0246-8.cs.
9038
9039         * namespace.cs (NamespaceEntry.Lookup): Likewise.
9040
9041 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9042
9043         * class.cs (MemberBase.Define): Reuse MemberType member for 
9044         resolved type. Other methods can use it too.
9045
9046 2004-05-23  Martin Baulig  <martin@ximian.com>
9047
9048         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9049         the variable also exists in the current block (otherwise, we need
9050         to report a CS0103).  Fixes #58670.
9051
9052 2004-05-23  Martin Baulig  <martin@ximian.com>
9053
9054         * flowanalysis.cs (Reachability.Reachable): Compute this
9055         on-the-fly rather than storing it as a field.
9056
9057 2004-05-23  Martin Baulig  <martin@ximian.com>
9058
9059         * flowanalysis.cs (Reachability.And): Manually compute the
9060         resulting `barrier' from the reachability.      
9061        
9062 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9063
9064         Fix bug #57835
9065         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9066         instance of ObsoleteAttribute when symbol is obsolete.
9067
9068         * class.cs
9069         (IMethodData): Extended interface for ObsoleteAttribute support.
9070
9071 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9072
9073         * attribute.cs: Fix bug #55970
9074
9075 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9076
9077         Fix bug #52705
9078         * attribute.cs
9079         (GetObsoleteAttribute): New method. Creates the instance of
9080         ObsoleteAttribute.
9081         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9082         ObsoleteAttribute when member is obsolete.
9083         (AttributeTester.Report_ObsoleteMessage): Common method for
9084         Obsolete error/warning reporting.
9085
9086         * class.cs
9087         (TypeContainer.base_classs_type): New member for storing parent type.
9088
9089         * decl.cs
9090         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9091         for this MemberCore.
9092
9093 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9094
9095         * attribute.cs, const.cs: Fix bug #58590
9096
9097 2004-05-21  Martin Baulig  <martin@ximian.com>
9098
9099         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9100         out parameters if the end of the method is unreachable.  Fixes
9101         #58098. 
9102
9103 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9104
9105         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9106         Hari was right, why extra method.
9107
9108 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9109
9110         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9111
9112 2004-05-20  Martin Baulig  <martin@ximian.com>
9113
9114         * delegate.cs: Convert this file to Unix mode - like the original
9115         version in mcs is.
9116
9117 2004-05-20  Martin Baulig  <martin@ximian.com>
9118
9119         * attribute.cs: Convert this file to Unix mode - like the original
9120         version in mcs is.
9121
9122 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
9123
9124        Fix bug #58688 (MCS does not report error when the same attribute
9125        is assigned twice)
9126
9127        * attribute.cs (Attribute.Emit): Distinction between null and default.
9128
9129 2004-05-19  Raja R Harinath  <rharinath@novell.com>
9130
9131        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9132        of a top-level attribute without an attribute target.
9133        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
9134        Make non-static.
9135        (Attribute.Conditional_GetConditionName), 
9136        (Attribute.Obsolete_GetObsoleteMessage): Update.
9137        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
9138        part of ScanForIndexerName.
9139        (Attribute.CanIgnoreInvalidAttribute): New function.
9140        (Attribute.ScanForIndexerName): Move to ...
9141        (Attributes.ScanForIndexerName): ... here.
9142        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9143        (Attributes.Search): New internal variant that can choose not to
9144        complain if types aren't resolved.  The original signature now
9145        complains.
9146        (Attributes.GetClsCompliantAttribute): Use internal variant, with
9147        complaints suppressed.
9148        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9149        only if it not useful.
9150        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9151        top-level for attributes that are shared between the assembly
9152        and a top-level class.
9153        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9154        * class.cs: Update to reflect changes.
9155        (DefineIndexers): Fuse loops.
9156        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
9157        a couple more variants of attribute names.
9158
9159 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
9160
9161         Fix bug #52585 (Implemented explicit attribute declaration)
9162
9163         * attribute.cs:
9164         (Attributable.ValidAttributeTargets): New abstract method. It gets
9165         list of valid attribute targets for explicit target declaration.
9166         (Attribute.Target): It holds target itself.
9167         (AttributeSection): Removed.
9168         (Attribute.CheckTargets): New method. It checks whether attribute
9169         target is valid for the current element.
9170
9171         * class.cs:
9172         (EventProperty): New class. For events that are declared like
9173         property (with add and remove accessors).
9174         (EventField): New class. For events that are declared like field.
9175         class.cs
9176
9177         * cs-parser.jay: Implemented explicit attribute target declaration.
9178
9179         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
9180         Override ValidAttributeTargets.
9181
9182         * parameter.cs:
9183         (ReturnParameter): Class for applying custom attributes on 
9184         the return type.
9185         (ParameterAtribute): New class. Class for applying custom
9186         attributes on the parameter type.
9187
9188 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
9189
9190         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9191         definitions. 
9192
9193         (Method): Allow UNSAFE here.
9194
9195         * modifiers.cs: Support unsafe reporting.
9196
9197 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
9198
9199         * decl.cs: Fix bug #58478.
9200
9201 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9202
9203         * statement.cs: When checking for unreachable code on an EmptyStatement,
9204         set the location. Fixes bug #58488.
9205
9206 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
9207
9208         * driver.cs: Add -pkg handling.
9209
9210         From Gonzalo: UseShelLExecute=false
9211
9212 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
9213
9214         * attribute.cs:
9215         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9216         for attribute.
9217         (Attribute.IsClsCompliaceRequired): Moved to base for better
9218         accesibility.
9219         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9220         when attribute is AttributeUsageAttribute.
9221         (Attribute.GetValidTargets): Simplified.
9222         (Attribute.GetAttributeUsage): New method returns AttributeUsage
9223         attribute for this type.
9224         (Attribute.ApplyAttributes): Method renamed to Emit and make
9225         non-static.
9226         (GlobalAttributeSection): New class for special handling of global
9227         attributes (assembly, module).
9228         (AttributeSection.Emit): New method.
9229
9230         * class.cs: Implemented Attributable abstract methods.
9231         (MethodCore.LabelParameters): Moved to Parameter class.
9232         (Accessor): Is back simple class.
9233         (PropertyMethod): Implemented Attributable abstract class.
9234         (DelegateMethod): Implemented Attributable abstract class.
9235         (Event): New constructor for disctintion between normal Event
9236         and Event with accessors.
9237
9238         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9239
9240         * codegen.cs, const.cs, decl.cs, delegate.cs:
9241         (CommonAssemblyModulClass): Implemented Attributable abstract class
9242         and simplified.
9243
9244         * enum.cs: Implement IAttributeSupport interface.
9245         (EnumMember): New class for emum members. Implemented Attributable
9246         abstract class
9247
9248         * parameter.cs:
9249         (ParameterBase): Is abstract.
9250         (ReturnParameter): New class for easier [return:] attribute handling.
9251
9252         * typemanager.cs: Removed builder_to_attr.
9253
9254 2004-05-11  Raja R Harinath  <rharinath@novell.com>
9255
9256         Fix bug #57151.
9257         * attribute.cs (Attribute.GetPositionalValue): New function.
9258         * class.cs (TypeContainer.VerifyMembers): New function.
9259         (TypeContainer.Emit): Use it.
9260         (ClassOrStruct): New base class for Class and Struct.
9261         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
9262         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9263         class.
9264         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9265         then each non-static field should have a FieldOffset attribute.
9266         Otherwise, none of the fields should have a FieldOffset attribute.
9267         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
9268         and FieldOffset attributes.
9269         * typemanager.cs (TypeManager.struct_layout_attribute_type)
9270         (TypeManager.field_offset_attribute_type): New core types.
9271         (TypeManager.InitCoreTypes): Initialize them.
9272
9273 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
9274
9275         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9276         Return correct type.
9277         From bug #58270.
9278
9279 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
9280
9281         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9282         be implicitly converted to ulong.
9283         
9284         * expression.cs: The logic for allowing operator &, | and ^ worked
9285         was wrong, it worked before because we did not report an error in
9286         an else branch.  Fixes 57895.
9287
9288         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9289         allow volatile fields to be reference types.
9290
9291 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
9292
9293         * driver.cs: Add support for /debug-
9294
9295 2004-05-07  Raja R Harinath  <rharinath@novell.com>
9296
9297         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
9298         Add a 'complain' parameter to silence errors.
9299         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
9300         silently overlooked type-resolutions.
9301         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9302         to reflect changes.
9303         (Attributes.Search): New function.
9304         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9305         (Attributes.GetAttributeFullName): Remove hack.
9306         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
9307         Update to reflect changes.
9308         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9309         Use Attributes.Search instead of nested loops.
9310
9311 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
9312
9313         * decl.cs:
9314         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9315         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9316         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9317
9318         * report.cs: (Report.Warning): Renamed to Warning_T because of
9319         parameter collision.
9320
9321 2004-05-05  Raja R Harinath  <rharinath@novell.com>
9322
9323         * expression.cs (MemberAccess.ResolveMemberAccess):
9324         Exit with non-zero status after Report.Error.
9325         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9326         Likewise.
9327         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9328
9329 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9330
9331         * support.cs: Don't hang when the file is empty.
9332
9333 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9334
9335         * support.cs: In SeekableStreamReader, compute the preamble size of the
9336           underlying stream. Position changes should take into account that initial
9337           count of bytes.
9338
9339 2004-05-03  Todd Berman  <tberman@sevenl.net>
9340
9341         * driver.cs: remove unused GetSysVersion function.
9342
9343 2004-05-03  Todd Berman  <tberman@sevenl.net>
9344
9345         * driver.cs: Remove the hack from saturday, as well as the hack
9346         from jackson (LoadAssemblyFromGac), also adds the CWD to the
9347         link_paths to get that bit proper.
9348
9349 2004-05-01  Todd Berman  <tberman@sevenl.net>
9350
9351         * driver.cs: Try a LoadFrom before a Load, this checks the current
9352         path. This is currently a bug in mono that is be fixed, however, this
9353         provides a workaround for now. This will be removed when the bug
9354         is fixed.
9355
9356 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
9357
9358         * CryptoConvert.cs: Updated to latest version. Fix issue with 
9359         incomplete key pairs (#57941).
9360
9361 2004-05-01  Todd Berman  <tberman@sevenl.net>
9362
9363         * driver.cs: Remove '.' from path_chars, now System.* loads properly
9364         from the GAC
9365
9366 2004-04-30  Jackson Harper  <jackson@ximian.com>
9367
9368         * codegen.cs: Open keys readonly.
9369         
9370 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9371
9372         * typemanager.cs: don't report cyclic struct layout when a struct
9373         contains 2 or more fields of the same type. Failed for Pango.AttrShape
9374         which has 2 Pango.Rectangle fields.
9375
9376 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9377
9378         * expression.cs: Handle IntPtr comparisons with IL code
9379         rather than a method call.
9380
9381 2004-04-29  Martin Baulig  <martin@ximian.com>
9382
9383         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
9384         the list of PropertyInfo's in class hierarchy and find the
9385         accessor.  Fixes #56013.
9386
9387 2004-04-29  Martin Baulig  <martin@ximian.com>
9388
9389         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9390
9391 2004-04-29  Martin Baulig  <martin@ximian.com>
9392
9393         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9394
9395         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9396
9397 2004-04-29  Martin Baulig  <martin@ximian.com>
9398
9399         * class.cs (ConstructorInitializer.Resolve): Check whether the
9400         parent .ctor is accessible.  Fixes #52146.
9401
9402 2004-04-29  Martin Baulig  <martin@ximian.com>
9403
9404         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9405
9406         * statement.cs (Using.EmitLocalVariableDecls): Use
9407         TypeManager.idisposable_type, not typeof (IDisposable).
9408         (Foreach.EmitCollectionForeach): Added support for valuetypes.
9409
9410 2004-04-29  Martin Baulig  <martin@ximian.com>
9411
9412         * class.cs (Event.Define): Don't emit the field and don't set
9413         RTSpecialName and SpecialName for events on interfaces.  Fixes
9414         #57703. 
9415
9416 2004-04-29  Raja R Harinath  <rharinath@novell.com>
9417
9418         Refactor Attribute.ApplyAttributes.
9419         * attribute.cs (Attributable): New base class for objects that can
9420         have Attributes applied on them.
9421         (Attribute): Make AttributeUsage fields public.
9422         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9423         (Attribute.IsInternalCall): New property.
9424         (Attribute.UsageAttr): Convert to a public read-only property.
9425         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9426         (Attribute.ResolveType, Attribute.Resolve)
9427         (Attribute.ScanForIndexerName): Update to reflect changes.
9428         (Attribute.CheckAttributeTarget): Re-format.
9429         (Attribute.ApplyAttributes): Refactor, to various
9430         Attributable.ApplyAttributeBuilder methods.
9431         * decl.cs (MemberCore): Make Attributable.
9432         * class.cs (Accessor): Make Attributable.
9433         (MethodData.ApplyAttributes): Use proper attribute types, not
9434         attribute names.
9435         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9436         (TypeContainer.ApplyAttributeBuilder)
9437         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9438         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
9439         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9440         (Operator.ApplyAttributeBuilder): New factored-out methods.
9441         * const.cs (Const.ApplyAttributeBuilder): Likewise.
9442         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9443         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9444         * parameter.cs (ParameterBase): New Attributable base class
9445         that can also represent Return types.
9446         (Parameter): Update to the changes.
9447
9448 2004-04-29  Jackson Harper  <jackson@ximian.com>
9449
9450         * driver.cs: Prefer the corlib system version when looking for
9451         assemblies in the GAC. This is still a hack, but its a better hack
9452         now.
9453         
9454 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
9455
9456         * decl.cs, enum.cs: Improved error 3005 reporting.
9457   
9458         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9459         (related_symbols): New private member for list of symbols
9460         related to reported error/warning.
9461         
9462         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9463
9464 2004-04-29  Martin Baulig  <martin@ximian.com>
9465
9466         * ecore.cs (Expression.Constantify): If we're an enum and
9467         TypeManager.TypeToCoreType() doesn't give us another type, use
9468         t.UnderlyingSystemType.  Fixes #56178.  
9469
9470 2004-04-29  Martin Baulig  <martin@ximian.com>
9471
9472         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9473         interfaces and for each interface, only add members directly
9474         declared in that interface.  Fixes #53255.
9475
9476 2004-04-28  Martin Baulig  <martin@ximian.com>
9477
9478         * expression.cs (ConditionalLogicalOperator): Use a temporary
9479         variable for `left' to avoid that we evaluate it more than once;
9480         bug #52588.
9481
9482 2004-04-28  Martin Baulig  <martin@ximian.com>
9483
9484         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9485         `void[]' (CS1547).
9486
9487 2004-04-28  Martin Baulig  <martin@ximian.com>
9488
9489         * statement.cs (LocalInfo.Resolve): Check whether the type is not
9490         void (CS1547).
9491
9492         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9493         whether the type is not void (CS1547).
9494
9495 2004-04-28  Martin Baulig  <martin@ximian.com>
9496
9497         * expression.cs (Unary.DoResolveLValue): Override this and report
9498         CS0131 for anything but Operator.Indirection.
9499
9500 2004-04-28  Martin Baulig  <martin@ximian.com>
9501
9502         Committing a patch from Ben Maurer; see bug #50820.
9503
9504         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9505         check for classes.
9506
9507         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9508         classes.        
9509
9510 2004-04-28  Martin Baulig  <martin@ximian.com>
9511
9512         Committing a patch from Ben Maurer; see bug #50820.
9513
9514         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9515         check for classes.
9516
9517         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9518         classes.        
9519
9520 2004-04-28  Martin Baulig  <martin@ximian.com>
9521
9522         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9523         (Block.AddLabel): Call DoLookupLabel() to only search in the
9524         current block.
9525
9526 2004-04-28  Martin Baulig  <martin@ximian.com>
9527
9528         * cfold.cs (ConstantFold.BinaryFold): Added special support for
9529         comparing StringConstants and NullLiterals in Equality and Inequality.
9530
9531 2004-04-28  Jackson Harper  <jackson@ximian.com>
9532
9533         * driver.cs: Attempt to load referenced assemblies from the
9534         GAC. This is the quick and dirty version of this method that
9535         doesnt take into account versions and just takes the first
9536         canidate found. Will be good enough for now as we will not have more
9537         then one version installed into the GAC until I update this method.
9538
9539 2004-04-28  Martin Baulig  <martin@ximian.com>
9540
9541         * typemanager.cs (TypeManager.CheckStructCycles): New public
9542         static method to check for cycles in the struct layout.
9543
9544         * rootcontext.cs (RootContext.PopulateTypes): Call
9545         TypeManager.CheckStructCycles() for each TypeContainer.
9546         [Note: We only need to visit each type once.]
9547
9548 2004-04-28  Martin Baulig  <martin@ximian.com>
9549
9550         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9551
9552         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9553         success and added `out object value'.  Use a `bool resolved' field
9554         to check whether we've already been called rather than
9555         `ConstantValue != null' since this breaks for NullLiterals.
9556
9557 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9558
9559         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9560         setting of this flag, since the 'set' method may be non-public.
9561
9562 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9563
9564         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9565         check on current_vector.Block.
9566
9567 2004-04-27  Martin Baulig  <martin@ximian.com>
9568
9569         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9570         a field initializer.  Fixes #56459.
9571
9572 2004-04-27  Martin Baulig  <martin@ximian.com>
9573
9574         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9575         we're not attempting to use an indexer.  Fixes #52154.
9576
9577 2004-04-27  Martin Baulig  <martin@ximian.com>
9578
9579         * statement.cs (Return): Don't create a return label if we don't
9580         need it; reverts my change from January 20th.  Thanks to Ben
9581         Maurer for this.
9582
9583 2004-04-27  Martin Baulig  <martin@ximian.com>
9584
9585         According to the spec, `goto' can only leave a nested scope, but
9586         never enter it.
9587
9588         * statement.cs (Block.LookupLabel): Only lookup in the current
9589         block, don't recurse into parent or child blocks.
9590         (Block.AddLabel): Check in parent and child blocks, report
9591         CS0140/CS0158 if we find a duplicate.
9592         (Block): Removed this indexer for label lookups.
9593         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9594         this already does the error reporting for us.
9595
9596         * flowanalysis.cs
9597         (FlowBranching.UsageVector.Block): New public variable; may be null.
9598         (FlowBranching.CreateSibling): Added `Block' argument.
9599         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
9600         label for the target of a `goto' and check whether we're not
9601         leaving a `finally'.
9602
9603 2004-04-27  Martin Baulig  <martin@ximian.com>
9604
9605         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9606         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9607         just for returns).
9608
9609 2004-04-27  Martin Baulig  <martin@ximian.com>
9610
9611         * statement.cs (Block.AddLabel): Also check for implicit blocks
9612         and added a CS0158 check.
9613
9614 2004-04-27  Martin Baulig  <martin@ximian.com>
9615
9616         * flowanalysis.cs (FlowBranchingLoop): New class.
9617         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9618         UsageVector's instead of an ArrayList.
9619         (FlowBranching.Label): Likewise.
9620         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9621         (FlowBranching.AddBreakVector): New method.
9622
9623 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
9624
9625         * attribute.cs: Small regression fix: only convert the type if we
9626         the type is different, fixes System.Drawing build.
9627
9628 2004-04-27  Martin Baulig  <martin@ximian.com>
9629
9630         * attribute.cs (Attribute.Resolve): If we have a constant value
9631         for a named field or property, implicity convert it to the correct
9632         type.
9633
9634 2004-04-27  Raja R Harinath  <rharinath@novell.com>
9635
9636         * statement.cs (Block.Block): Implicit blocks share
9637         'child_variable_names' fields with parent blocks.
9638         (Block.AddChildVariableNames): Remove.
9639         (Block.AddVariable): Mark variable as "used by a child block" in
9640         every surrounding block.
9641         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9642         been used in a child block, complain about violation of "Invariant
9643         meaning in blocks" rule.
9644         * cs-parser.jay (declare_local_variables): Don't use
9645         AddChildVariableNames.
9646         (foreach_statement): Don't create an implicit block: 'foreach'
9647         introduces a scope.
9648
9649 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
9650
9651         * convert.cs (ImplicitNumericConversion): 0 is also positive when
9652         converting from 0L to ulong.  Fixes 57522.
9653
9654 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9655
9656         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9657         derived class hides via 'new' keyword field from base class (test-242.cs).
9658         TODO: Handle this in the more general way.
9659         
9660         * class.cs (CheckBase): Ditto.
9661
9662 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9663
9664         * decl.cs (caching_flags): New member for storing cached values
9665         as bit flags.
9666         (MemberCore.Flags): New enum where bit flags for caching_flags
9667         are defined.
9668         (MemberCore.cls_compliance): Moved to caching_flags.
9669         (DeclSpace.Created): Moved to caching_flags.
9670
9671         * class.cs: Use caching_flags instead of DeclSpace.Created
9672         
9673 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
9674
9675         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9676         if we are only a derived class, not a nested class.
9677
9678         * typemanager.cs: Same as above, but do this at the MemberLookup
9679         level (used by field and methods, properties are handled in
9680         PropertyExpr).   Allow for the qualified access if we are a nested
9681         method. 
9682
9683 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
9684
9685         * class.cs: Refactoring.
9686         (IMethodData): New inteface; Holds links to parent members
9687         to avoid member duplication (reduced memory allocation).
9688         (Method): Implemented IMethodData interface.
9689         (PropertyBase): New inner classes for get/set methods.
9690         (PropertyBase.PropertyMethod): Implemented IMethodData interface
9691         (Event): New inner classes for add/remove methods.
9692         (Event.DelegateMethod): Implemented IMethodData interface.
9693
9694         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9695         EmitContext (related to class.cs refactoring).
9696
9697 2004-04-21  Raja R Harinath  <rharinath@novell.com>
9698
9699         * delegate.cs (Delegate.VerifyApplicability): If the number of
9700         arguments are the same as the number of parameters, first try to
9701         verify applicability ignoring  any 'params' modifier on the last
9702         parameter.
9703         Fixes #56442.
9704
9705 2004-04-08  Martin Baulig  <martin@ximian.com>
9706
9707         Merged latest changes into gmcs.  Please keep this comment in
9708         here, it makes it easier for me to see what changed in MCS since
9709         the last time I merged.
9710
9711 2004-04-16  Raja R Harinath  <rharinath@novell.com>
9712
9713         * class.cs (TypeContainer.AddIndexer): Use
9714         'ExplicitInterfaceName' to determine if interface name was
9715         explicitly specified.  'InterfaceType' is not initialized at this time.
9716         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
9717         Indexers array is already in the required order.  Initialize
9718         'IndexerName' only if there are normal indexers.
9719         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
9720         (TypeContainer.Emit): Emit DefaultMember attribute only if
9721         IndexerName is initialized.
9722         Fixes #56300.
9723
9724 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
9725
9726         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
9727         Fixes #57007
9728
9729 2004-04-15  Raja R Harinath  <rharinath@novell.com>
9730
9731         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
9732         attributes.
9733         Fix for #56456.
9734
9735         * attribute.cs (Attribute.Resolve): Check for duplicate named
9736         attributes.
9737         Fix for #56463.
9738
9739 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
9740
9741         * iterators.cs (MarkYield): track whether we are in an exception,
9742         and generate code accordingly.  Use a temporary value to store the
9743         result for our state.
9744
9745         I had ignored a bit the interaction of try/catch with iterators
9746         since their behavior was not entirely obvious, but now it is
9747         possible to verify that our behavior is the same as MS .NET 2.0
9748
9749         Fixes 54814
9750
9751 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
9752
9753         * iterators.cs: Avoid creating temporaries if there is no work to
9754         do. 
9755
9756         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
9757         Enumerations, use TypeManager.EnumToUnderlying and call
9758         recursively. 
9759
9760         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
9761         bug #57013
9762
9763         (This.Emit): Use EmitContext.EmitThis to emit our
9764         instance variable.
9765
9766         (This.EmitAssign): Ditto.
9767
9768         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
9769         codepaths, we will move all the functionality into
9770         Mono.CSharp.This 
9771
9772         (FieldExpr.EmitAssign): Ditto.
9773
9774         This fixes several hidden bugs that I uncovered while doing a code
9775         review of this today.
9776
9777         * codegen.cs (EmitThis): reworked so the semantics are more clear
9778         and also support value types "this" instances.
9779
9780         * iterators.cs: Changed so that for iterators in value types, we
9781         do not pass the value type as a parameter.  
9782
9783         Initialization of the enumerator helpers is now done in the caller
9784         instead of passing the parameters to the constructors and having
9785         the constructor set the fields.
9786
9787         The fields have now `assembly' visibility instead of private.
9788
9789 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
9790
9791         * expression.cs (Argument.Resolve): Check if fields passed as ref
9792         or out are contained in a MarshalByRefObject.
9793
9794         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
9795         another compiler type.
9796
9797 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
9798
9799         * class.cs (Indexer.Define): use the new name checking method.
9800         Also, return false on an error.
9801         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
9802         (is_identifier_[start/part]_character): make static.
9803
9804 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
9805
9806         * expression.cs (Binary.ResolveOperator): Do no append strings
9807         twice: since we can be invoked more than once (array evaluation)
9808         on the same concatenation, take care of this here.  Based on a fix
9809         from Ben (bug #56454)
9810
9811 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
9812
9813         * codegen.cs: Fix another case where CS1548 must be reported (when 
9814         delay-sign isn't specified and no private is available #56564). Fix
9815         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
9816         error when MCS is used on the MS runtime and we need to delay-sign 
9817         (which seems unsupported by AssemblyBuilder - see #56621).
9818
9819 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
9820
9821         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
9822         (TypeManager.ComputeNamespaces): Faster implementation for
9823         Microsoft runtime.
9824
9825         * compiler.csproj: Updated AssemblyName to mcs.
9826
9827 2004-05-11  Jackson Harper  <jackson@ximian.com>
9828
9829         * Makefile: Preserve MONO_PATH
9830         
9831 2004-05-11  Jackson Harper  <jackson@ximian.com>
9832
9833         * Makefile: Use mono and mcs to build gmcs
9834         
9835 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
9836
9837         * codegen.cs: Add patch from Robert Shade
9838         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
9839         sync with mcs.
9840
9841 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
9842
9843         * CryptoConvert.cs: Updated to latest version. Fix issue with 
9844         incomplete key pairs (#57941).
9845
9846 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
9847
9848         * codegen.cs: Fix another case where CS1548 must be reported (when 
9849         delay-sign isn't specified and no private is available #56564). Fix
9850         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
9851         error when MCS is used on the MS runtime and we need to delay-sign 
9852         (which seems unsupported by AssemblyBuilder - see #56621).
9853
9854 2004-04-29  Jackson Harper  <jackson@ximian.com>
9855
9856         * Makefile: Set MONO_PATH to use the bootstrap corlib
9857         * driver.cs: Check the GAC for referenced assemblies.
9858                 
9859 2004-04-29  Martin Baulig  <martin@ximian.com>
9860
9861         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
9862
9863 2004-04-07  Martin Baulig  <martin@ximian.com>
9864
9865         * expression.cs (Binary.ResolveOperator): Added special case for
9866         Equality/Inequality between a type parameter and a null literal.
9867
9868 2004-04-07  Martin Baulig  <martin@ximian.com>
9869
9870         * convert.cs: Check null literal -> type parameter conversions.
9871
9872 2004-04-07  Martin Baulig  <martin@ximian.com>
9873
9874         * generic.cs (ConstructedType.CheckConstraints): Enforce the
9875         `class' and `struct' constraints.
9876
9877 2004-04-07  Martin Baulig  <martin@ximian.com>
9878
9879         * generic.cs (SpecialConstraint): New public enum.
9880         (Constraints.Resolve): Added support for the `class' and `struct'
9881         constraints.
9882
9883         * cs-parser.jay (type_parameter_constraint): Added support for the
9884         `class' and `struct' constraints.
9885
9886 2004-04-07  Martin Baulig  <martin@ximian.com>
9887
9888         * support.cs (GenericConstraints): Replaced `Types' by
9889         `ClassConstraint' and `InterfaceConstraints'; added
9890         `HasClassConstraint'.   
9891
9892 2004-04-07  Martin Baulig  <martin@ximian.com>
9893
9894         * generic.cs
9895         (Constraints.InterfaceConstraints): New public property.
9896         (Constraints.Types): Make this property public
9897         (TypeParameter): Implement IMemberContainer.
9898         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
9899         instead of a TypeBuilder/MethodBuilder; pass the interface
9900         constraints to TypeManager.AddTypeParameter().
9901         (TypeParameter.DefineType): Just take an EmitContext and no
9902         TypeBuilder/MethodBuilder.  Use the new public API.
9903
9904         * typemanager.cs (TypeManager.AddTypeParameter): Added
9905         `TypeExpr[]' argument; add the interfaces to the
9906         `builder_to_ifaces' hash.
9907         (TypeManager.LookupMemberContainer): For
9908         GenericTypeParameterBuilders, get the TypeParameter from the
9909         `builder_to_type_param'.
9910         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
9911         the TypeParameter and call FindMembers on it.
9912
9913 2004-04-07  Martin Baulig  <martin@ximian.com>
9914
9915         * class.cs
9916         (MethodCore.GenericMethod): Moved this field here from Method.
9917         (MethodCore.IsDuplicateImplementation): Take the number of type
9918         parameters into account if we're a generic method.
9919
9920         * expression.cs (Invocation.InferTypeArguments): Don't return true
9921         if `arguments' is null; we still need to check whether we actually
9922         don't need to infer anything in this case.
9923         (MemberAccess): Merged the functionality from GenericMemberAccess
9924         into this class.
9925
9926         * generic.cs (GenericMemberAccess): Removed.
9927
9928 2004-04-05  Martin Baulig  <martin@ximian.com>
9929
9930         * decl.cs (MemberCore): For generic classes, interfaces and
9931         structs, `Name' now includes the number of type parameters
9932         ("Stack!1.Node!1").
9933         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
9934         encode the number of type arguments in the type name.
9935
9936         * expression.cs (Expression.MemberLookup): Removed the
9937         `num_type_args' argument; we now encode the number of type
9938         arguments in the type name.
9939
9940         * ecore.cs (SimpleName): Encode the number of type arguments in
9941         the type name itself.
9942
9943         * generic.cs (ConstructedType): Likewise.
9944
9945         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
9946         `MemberName'; we now include the number of type parameters in the
9947         type name.
9948
9949         * typemanager.cs (TypeManager.CheckGeneric): Removed.
9950         (TypeManager.MemberLookup): Removed the
9951         `num_type_args' argument; we now encode the number of type
9952         arguments in the type name.     
9953
9954 2004-04-03  Martin Baulig  <martin@ximian.com>
9955
9956         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
9957         (MemberCore.MemberName): Moved here from MemberBase.
9958         (DeclSpace.SetParameterInfo): Just take the constraints as an
9959         ArrayList; we already have the type parameters in our
9960         `MemberName'; also do the CS0080 reporting here.
9961
9962         * cs-parser.jay (struct_declaration): Use `member_name' instead of
9963         `IDENTIFIER opt_type_parameter_list'; when constructing our
9964         `MemberName', it'll already include our type parameters.
9965         (class_declaration, interface_declaration): Likewise.
9966         (delegate_declaration): Likewise.
9967         (MakeName): Take a MemberName and return a MemberName.
9968         The following two changes are required to avoid shift/reduce conflicts:
9969         (member_name): Don't include a TypeName anymore; ie. this is now
9970         just 'IDENTIFIER opt_type_parameter_list'.
9971         (property_declaration, event_declaration): Use a
9972         `namespace_or_type_name' instead of a `member_name'.            
9973
9974 2004-04-03  Martin Baulig  <martin@ximian.com>
9975
9976         * decl.cs (MemberName): Renamed to `TypeName' and created a new
9977         `MemberName' class.
9978         (TypeName): Formerly known as MemberName.
9979
9980         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
9981         instead of a `MemberName'.
9982
9983         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
9984         (member_name): New rule; create a MemberName.
9985
9986 2004-04-02  Martin Baulig  <martin@ximian.com>
9987
9988         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
9989         (CS0305 and CS0308).
9990
9991 2004-04-02  Martin Baulig  <martin@ximian.com>
9992
9993         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
9994         support for nested types.
9995
9996 2004-04-02  Martin Baulig  <martin@ximian.com>
9997
9998         * ecore.cs (IAlias): New public interface.
9999         (TypeExpr, TypeExpression): Implement IAlias.
10000         (TypeAliasExpression): New public class.
10001
10002         * namespace.cs (Namespace): Implement IAlias.
10003         (Namespace.Lookup): Return an IAlias instead on an object.
10004         (Namespace.DefineName): Take an IAlias instead of an object.
10005         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
10006         an object.
10007         (NamespaceEntry.UsingAlias): Take a Membername instead of an
10008         Expression.
10009         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
10010         object.
10011         (NamespaceEntry.Lookup): Likewise.
10012
10013         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
10014         instead of a Type.      
10015
10016         * decl.cs (DeclSpace): Implement IAlias.
10017         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
10018
10019         * generic.cs (ConstructedType): Improved error checking.
10020
10021 2004-04-02  Martin Baulig  <martin@ximian.com>
10022
10023         * convert.cs: Added type parameter conversions.
10024
10025         * ecore.cs
10026         (UnboxCast.Emit): Emit an `unbox.any' for type params.
10027         (ClassCast.Emit): If the source type is a type parameter, box it.
10028         If the target type is a type parameter, emit an `unbox.any'
10029         instead of a `classcast'.1      
10030
10031 2004-04-01  Martin Baulig  <martin@ximian.com>
10032
10033         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
10034
10035 2004-04-01  Martin Baulig  <martin@ximian.com>
10036
10037         * generic.cs (ConstructedType.CheckConstraints): Use
10038         Convert.ImplicitStandardConversionExists(); user-defined implicit
10039         conversions are not allowed according to the spec.
10040
10041 2004-03-30  Martin Baulig  <martin@ximian.com>
10042
10043         * expression.cs (New): Added support for type parameters.
10044
10045         * typemanager.cs
10046         (TypeManager.activator_type): New public static field.
10047         (TypeManager.activator_create_instance): Likewise.
10048
10049 2004-03-30  Martin Baulig  <martin@ximian.com>
10050
10051         * typemanager.cs (TypeManager.HasConstructorConstraint): New
10052         public method.
10053
10054 2004-03-30  Martin Baulig  <martin@ximian.com>
10055
10056         * generic.cs (ConstructedType.CheckConstraints): Actually follow
10057         the spec here: the argument type must be convertible to the
10058         constraints.
10059
10060 2004-03-30  Martin Baulig  <martin@ximian.com>
10061
10062         * generic.cs
10063         (TypeParameter.Define, TypeParameter.DefineMethod): Call
10064         TypeManager.AddTypeParameter().
10065         (ConstructedType.CheckConstraints): Re-enable this and actually
10066         check whether we have a constructor constraint.
10067
10068         * typemanager.cs
10069         (TypeManager.builder_to_type_param): New static field.
10070         (TypeManager.AddTypeParameter): New static method.
10071         (TypeManager.LookupTypeParameter): New public method.
10072
10073 2004-03-30  Martin Baulig  <martin@ximian.com>
10074
10075         * generic.cs (TypeParameter.DefineType): Return a boolean and use
10076         the new API to actually define the constructor constraint.
10077
10078         * typemanager.cs
10079         (TypeManager.new_constraint_attr_type): New static field.
10080         (TypeManager.InitCoreTypes): Initialize it.
10081
10082 2004-03-30  Martin Baulig  <martin@ximian.com>
10083
10084         * generic.cs (Constraints): Completed error checking, use correct
10085         error numbers.
10086
10087 2004-03-29  Martin Baulig  <martin@ximian.com>
10088
10089         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
10090
10091         * expression.cs (Invocation.InferTypeArguments): Added overloaded
10092         public version which takes a `ParameterData pd' instead of an
10093         `ArrayList args'.
10094
10095 2004-03-29  Martin Baulig  <martin@ximian.com>
10096
10097         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
10098         not a MethodInfo.       
10099
10100 2004-03-29  Martin Baulig  <martin@ximian.com>
10101
10102         * expression.cs (Argument.ResolveMethodGroup): If we're a
10103         ConstructedType, call GetMemberAccess() on it.  
10104
10105 2004-03-29  Martin Baulig  <martin@ximian.com>
10106
10107         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
10108         (MethodCore.CheckGenericOverride): When overriding a generic
10109         method, check whether the constraints match.
10110
10111         * support.cs (GenericConstraints): New public interface.
10112         (ParameterData.GenericConstraints): New public method.
10113
10114         * parameter.cs (Parameter.Resolve): Check whether we're a generic
10115         method parameter and compute our constraints if appropriate.
10116         (Parameter.GenericConstraints): New public property.
10117
10118         * generic.cs (Constraints): Implement GenericConstraints.
10119
10120 2004-03-29  Martin Baulig  <martin@ximian.com>
10121
10122         * decl.cs (MemberCache.FindMemberToOverride): Use
10123         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
10124
10125 2004-03-29  Martin Baulig  <martin@ximian.com>
10126
10127         * generic.cs (GenericMethod.Define): Resolve our type parameters.
10128
10129 2004-03-29  Martin Baulig  <martin@ximian.com>
10130
10131         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
10132         not allowed on non-generic declarations").
10133
10134 2004-03-29  Martin Baulig  <martin@ximian.com>
10135
10136         * expression.cs (Invocation.InferTypeArguments): Added overloaded
10137         public version of this method.
10138
10139         * class.cs (MethodCore.IsDuplicateImplementation): Use
10140         Invocation.InferTypeArguments() to check this.
10141
10142 2004-03-29  Martin Baulig  <martin@ximian.com>
10143
10144         * convert.cs: Use TypeManager.IsDelegateType() instead of
10145         comparing types correctly.
10146
10147 2004-03-29  Martin Baulig  <martin@ximian.com>
10148
10149         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
10150         types directly to make it work for generic instances.
10151
10152         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
10153
10154 2004-03-29  Martin Baulig  <martin@ximian.com>
10155
10156         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
10157         support for arrays.     
10158
10159 2004-03-24  Martin Baulig  <martin@ximian.com>
10160
10161         * decl.cs (DeclSpace.FindType): Also use
10162         TypeManager.CheckGeneric() for types from the using clauses.
10163
10164 2004-03-23  Martin Baulig  <martin@ximian.com>
10165
10166         * expression.cs (Invocation.OverloadResolve): Added `bool
10167         may_fail' argument and use it instead of the Location.IsNull() hack.
10168
10169 2004-03-23  Martin Baulig  <martin@ximian.com>
10170
10171         * expression.cs (Invocation.InferType): Use correct type inference
10172         rules here.     
10173
10174 2004-03-23  Martin Baulig  <martin@ximian.com>
10175
10176         * ecore.cs (MethodGroupExpr.Name): Use
10177         TypeManager.CSharpSignature() instead of just the name.
10178
10179         * expression.cs (Invocation.OverloadResolve): Provide better error
10180         reporting.
10181         (Invocation.DoResolve): OverloadResolve() never returns null
10182         without reporting an error, so removed the error -6 reporting here.
10183
10184 2004-03-23  Martin Baulig  <martin@ximian.com>
10185
10186         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
10187         generic methods.
10188
10189         * cs-parser.jay (delegate_declaration): Support generic delegates.
10190
10191         * delegate.cs: Support generic delegates.
10192
10193 2004-03-22  Martin Baulig  <martin@ximian.com>
10194
10195         * expression.cs (Invocation.InferParamsTypeArguments): New static
10196         method; does type inference for params arguments.
10197
10198 2004-03-21  Martin Baulig  <martin@ximian.com>
10199
10200         * typemanager.cs (TypeManager.IsGenericMethod): New public static
10201         method; checks whether a method is a generic method.    
10202
10203         * expression.cs (Invocation.InferTypeArguments): New static method;
10204         infer type arguments for generic method invocation.
10205
10206         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
10207         property; we set this to true if we're resolving a generic method
10208         invocation and the user specified type arguments, ie. we're not
10209         doing type inference.
10210
10211 2004-03-20  Martin Baulig  <martin@ximian.com>
10212
10213         * class.cs (MethodData.DeclaringType): New public property.
10214         (MethodData.Define): Set DeclaringType here.
10215         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
10216         instead of OperatorMethodBuilder.DeclaringType.
10217
10218 2004-03-20  Martin Baulig  <martin@ximian.com>
10219
10220         * cs-tokenizer.cs (xtoken): Return a special
10221         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
10222
10223         * cs-parser.jay (default_value_expression): Switch to the new
10224         syntax (14.5.13).
10225
10226 2004-03-19  Martin Baulig  <martin@ximian.com>
10227
10228         * decl.cs (MemberName): New class.  We use this to "construct"
10229         namespace_or_type_name's.
10230
10231         * generics.cs (TypeArguments.GetDeclarations): New public method;
10232         returns the type arguments as a string[] and reports a CS0081 if
10233         one of them is not an identifier.
10234
10235         * class.cs (MemberBase): The .ctor now takes the name as a
10236         MemberName instead of a string.
10237         (MemberBase.ExplicitInterfaceName): Changed type from string to
10238         Expression.
10239         (MemberBase.DoDefine): If we're an explicit implementation, the
10240         InterfaceType may be a generic instance.
10241
10242         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
10243         (namespace_name): Call MemberName.GetName () to transform the
10244         MemberName into a string and ensure we don't have any type
10245         arguments.
10246         (type_name): Call MemberName.GetTypeExpression() to transfrom the
10247         MemberName into an expression.
10248         (method_header): Use namespace_or_type_name instead of member_name.     
10249
10250 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
10251
10252         * rootcontext.cs: Add new types to the boot resolution.
10253
10254         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
10255         MulticastDelegate is not allowed.
10256
10257         * typemanager.cs: Add new types to lookup: System.TypedReference
10258         and ArgIterator.
10259
10260         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
10261         check for TypedReference or ArgIterator, they are not allowed. 
10262
10263         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
10264         makes us properly catch 1510 in some conditions (see bug 56016 for
10265         details). 
10266
10267 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
10268
10269         * CryptoConvert.cs: update from corlib version
10270         with endian fixes.
10271
10272 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
10273
10274         * class.cs (Indexer.Define): Check indexername declaration
10275
10276 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
10277
10278         * attribute.cs (IsClsCompliant): Fixed problem with handling
10279         all three states (compliant, not-compliant, undetected).
10280
10281 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
10282
10283         * attribute.cs (Attribute): Location is now public.
10284         (Resolve): Store resolved arguments (pos_values) in attribute class.
10285         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
10286         (GetClsCompliantAttributeValue): New method that gets
10287         CLSCompliantAttribute value.
10288         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
10289         if exists else null.
10290         (AttributeTester): New class for CLS-Compliant verification routines.
10291
10292         * class.cs (Emit): Add CLS-Compliant verification.
10293         (Method.GetSignatureForError): Implemented.
10294         (Constructor.GetSignatureForError): Implemented
10295         (Constructor.HasCompliantArgs): Returns if constructor has
10296         CLS-Compliant arguments.
10297         (Constructor.Emit): Override.
10298         (Construcor.IsIdentifierClsCompliant): New method; For constructors
10299         is needed to test only parameters.
10300         (FieldBase.GetSignatureForError): Implemented.
10301         (TypeContainer): New member for storing base interfaces.
10302         (TypeContainer.FindMembers): Search in base interfaces too.
10303
10304         * codegen.cs (GetClsComplianceAttribute): New method that gets
10305         assembly or module CLSCompliantAttribute value.
10306         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10307         for assembly.
10308         (ModuleClass.Emit): Add error 3012 test.
10309
10310         * const.cs (Emit): Override and call base for CLS-Compliant tests.
10311
10312         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10313         state for all decl types.
10314         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10315         if CLS-Compliant tests are required.
10316         (IsClsCompliaceRequired): New method. Analyze whether code
10317         must be CLS-Compliant.
10318         (IsExposedFromAssembly): New method. Returns true when MemberCore
10319         is exposed from assembly.
10320         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10321         value or gets cached value.
10322         (HasClsCompliantAttribute): New method. Returns true if MemberCore
10323         is explicitly marked with CLSCompliantAttribute.
10324         (IsIdentifierClsCompliant): New abstract method. This method is
10325         used to testing error 3005.
10326         (IsIdentifierAndParamClsCompliant): New method. Common helper method
10327         for identifier and parameters CLS-Compliant testing.
10328         (VerifyClsCompliance): New method. The main virtual method for
10329         CLS-Compliant verifications.
10330         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10331         null. I don't know why is null (too many public members !).
10332         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10333         and get value of first CLSCompliantAttribute that found.
10334
10335         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10336         (VerifyClsCompliance): Override and add extra tests.
10337
10338         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10339         clscheck- disable CLS-Compliant verification event if assembly is has
10340         CLSCompliantAttribute(true).
10341
10342         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10343         ApllyAttribute is now called in emit section as in the other cases.
10344         Possible future Emit integration.
10345         (IsIdentifierClsCompliant): New override.
10346         (VerifyClsCompliance): New override.
10347         (GetEnumeratorName): Returns full enum name.
10348
10349         * parameter.cs (GetSignatureForError): Implemented.
10350
10351         * report.cs (WarningData): New struct for Warning message information.
10352         (LocationOfPreviousError): New method.
10353         (Warning): New method. Reports warning based on the warning table.
10354         (Error_T): New method. Reports error based on the error table.
10355
10356         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10357         verifications are done here.
10358
10359         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10360
10361         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10362         CLSCompliantAttribute.
10363         (all_imported_types): New member holds all imported types from other
10364         assemblies.
10365         (LoadAllImportedTypes): New method fills static table with exported types
10366         from all referenced assemblies.
10367         (Modules): New property returns all assembly modules.
10368
10369 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
10370
10371         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10372         throwing a parser error.
10373
10374         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10375         which removes the hardcoded get_/set_ prefixes for properties, as
10376         IL allows for the properties to be named something else.  
10377
10378         Bug #56013
10379
10380         * expression.cs: Do not override operand before we know if it is
10381         non-null.  Fix 56207
10382
10383 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10384
10385         * typemanager.cs: support for pinned variables.
10386
10387 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10388
10389         * decl.cs, typemanager.cs: Avoid using an arraylist
10390         as a buffer if there is only one result set.
10391
10392 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10393
10394         * expression.cs: Make sure you cant call a static method
10395         with an instance expression, bug #56174.
10396
10397 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
10398
10399         * class.cs (IsDuplicateImplementation): Improve error reporting to
10400         flag 663 (method only differs in parameter modifier).
10401
10402         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10403         in preprocessor directives.
10404
10405         * location.cs (LookupFile): Allow for the empty path.
10406
10407         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
10408         better approach for some of that patch, but its failing with the
10409         CharSet enumeration.  For now try/catch will do.
10410
10411         * typemanager.cs: Do not crash if a struct does not have fields.
10412         Fixes 56150.
10413
10414 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10415
10416         * expression.cs: cs0213, cant fix a fixed expression.
10417         fixes 50231.
10418
10419 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10420
10421         * cs-parser.jay: detect invalid embeded statements gracefully.
10422         bug #51113.
10423
10424 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10425
10426         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10427         As a regex:
10428         s/
10429         the invocation type may not be a subclass of the tye of the item/
10430         The type of the item must be a subclass of the invocation item.
10431         /g
10432
10433         Fixes bug #50820.
10434
10435 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
10436
10437         * attribute.cs: Added methods to get a string and a bool from an
10438         attribute. Required to information from AssemblyKeyFileAttribute,
10439         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10440         * codegen.cs: Modified AssemblyName creation to include support for
10441         strongnames. Catch additional exceptions to report them as CS1548.
10442         * compiler.csproj: Updated include CryptoConvert.cs.
10443         * compiler.csproj.user: Removed file - user specific configuration.
10444         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
10445         Mono.Security assembly. The original class is maintained and tested in
10446         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10447         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10448         like CSC 8.0 (C# v2) supports.
10449         * Makefile: Added CryptoConvert.cs to mcs sources.
10450         * rootcontext.cs: Added new options for strongnames.
10451
10452 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
10453
10454         * driver.cs: For --expect-error, report error code `2'
10455         if the program compiled with no errors, error code `1' if
10456         it compiled with an error other than the one expected.
10457
10458 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
10459
10460         * compiler.csproj: Updated for Visual Studio .NET 2003.
10461         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10462         * compiler.sln: Updated for Visual Studio .NET 2003.
10463
10464 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
10465
10466         * expression.cs: Fix bug #47234. We basically need to apply the
10467         rule that we prefer the conversion of null to a reference type
10468         when faced with a conversion to 'object' (csc behaviour).
10469
10470 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10471
10472         * statement.cs: Shorter form for foreach, eliminates
10473         a local variable. r=Martin.
10474
10475 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10476
10477         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10478         checks if we can use brtrue/brfalse to test for 0.
10479         * expression.cs: use the above in the test for using brtrue/brfalse.
10480         cleanup code a bit.
10481
10482 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10483
10484         * expression.cs: Rewrite string concat stuff. Benefits:
10485
10486         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10487         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10488         rather than a concat chain.
10489
10490         * typemanager.cs: Add lookups for more concat overloads.
10491
10492 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10493
10494         * expression.cs: Emit shorter il code for array init.
10495
10496         newarr
10497         dup
10498         // set 1
10499
10500         // set 2
10501
10502         newarr
10503         stloc.x
10504
10505         ldloc.x
10506         // set 1
10507
10508         ldloc.x
10509         // set 2
10510
10511 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
10512
10513         * statement.cs: Before, two switch blocks would be merged if the
10514         total size of the blocks (end_item - begin_item + 1) was less than
10515         two times the combined sizes of the blocks.
10516
10517         Now, it will only merge if after the merge at least half of the
10518         slots are filled.
10519
10520         fixes 55885.
10521
10522 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
10523
10524         * class.cs : csc build fix for GetMethods(). See bug #52503.
10525
10526 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
10527
10528         * expression.cs: Make sure fp comparisons work with NaN.
10529         This fixes bug #54303. Mig approved this patch a long
10530         time ago, but we were not able to test b/c the runtime
10531         had a related bug.
10532
10533 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
10534
10535         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
10536
10537 2004-03-19  Martin Baulig  <martin@ximian.com>
10538
10539         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
10540         two overloads may unify for some type parameter substitutions and
10541         report a CS0408 if appropriate.
10542
10543 2004-03-19  Martin Baulig  <martin@ximian.com>
10544
10545         * class.cs (MemberCore.IsDuplicateImplementation): Report the
10546         error here and not in our caller.
10547
10548 2004-03-19  Martin Baulig  <martin@ximian.com>
10549
10550         * interface.cs: Completely killed this file.
10551         (Interface): We're now a TypeContainer and live in class.cs.
10552
10553         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
10554         argument; we're now also called for interfaces.
10555         (TypeContainer.DefineMembers): Allow this method being called
10556         multiple times.
10557         (TypeContainer.GetMethods): New public method; formerly known as
10558         Interface.GetMethod().  This is used by PendingImplementation.
10559         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
10560         it's now private and non-static.
10561         (Interface): Moved this here; it's now implemented similar to
10562         Class and Struct.
10563         (Method, Property, Event, Indexer): Added `bool is_interface'
10564         argument to their .ctor's.
10565         (MemberBase.IsInterface): New public field.
10566
10567         * cs-parser.jay: Create normal Method, Property, Event, Indexer
10568         instances instead of InterfaceMethod, InterfaceProperty, etc.
10569         (opt_interface_base): Removed; we now use `opt_class_base' instead.
10570         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
10571
10572 2004-03-19  Martin Baulig  <martin@ximian.com>
10573
10574         * class.cs (MethodCore.IsDuplicateImplementation): New private
10575         method which does the CS0111 checking.
10576         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
10577         Use IsDuplicateImplementation().
10578
10579 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
10580
10581         * decl.cs (FindMemberToOverride): New method to find the correct
10582         method or property to override in the base class.
10583         * class.cs
10584             - Make Method/Property use the above method to find the
10585               version in the base class.
10586             - Remove the InheritableMemberSignatureCompare as it is now
10587               dead code.
10588
10589         This patch makes large code bases much faster to compile, as it is
10590         O(n) rather than O(n^2) to do this validation.
10591
10592         Also, it fixes bug 52458 which is that nested classes are not
10593         taken into account when finding the base class member.
10594
10595         Reviewed/Approved by Martin.
10596
10597 2004-03-17  Martin Baulig  <martin@ximian.com>
10598
10599         * expression.cs (MemberAccess.DoResolve): Take the parent's number
10600         of type arguments into account; use the `real_num_type_args'
10601         approach like in DoResolveAsTypeStep().
10602
10603         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
10604         nested types.
10605
10606 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
10607
10608         * interface.cs: In all interface classes removed redundant
10609         member initialization.
10610
10611 2004-03-16  Martin Baulig  <martin@ximian.com>
10612
10613         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10614
10615 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
10616
10617         * decl.cs (DefineTypeAndParents): New helper method to define a
10618         type's containers before the type itself is defined;  This is a
10619         bug exposed by the recent changes to Windows.Forms when an
10620         implemented interface was defined inside a class that had not been
10621         built yet.   
10622
10623         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10624
10625         (Check): Loop correctly to report errors modifiers
10626         (UNSAFE was not in the loop, since it was the same as TOP).
10627
10628         * interface.cs: Every interface member now takes a ModFlags,
10629         instead of a "is_new" bool, which we set on the base MemberCore. 
10630
10631         Every place where we called "UnsafeOk" in the interface, now we
10632         call the proper member (InterfaceMethod.UnsafeOK) instead to get
10633         the unsafe settings from the member declaration instead of the
10634         container interface. 
10635
10636         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
10637
10638         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10639         `set_indexer_name' to the pending bits (one per type).
10640
10641         We fixed a bug today that was picking the wrong method to
10642         override, since for properties the existing InterfaceMethod code
10643         basically ignored the method name.  Now we make sure that the
10644         method name is one of the valid indexer names.
10645
10646 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
10647  
10648         * support.cs (SeekableStreamReader): Keep track of stream byte
10649         positions and don't mix them with character offsets to the buffer.
10650
10651         Patch from Gustavo Giráldez
10652
10653 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
10654
10655         * interface.cs (InterfaceSetGetBase): Removed double member
10656         initialization, base class does it as well.
10657
10658 2004-03-13  Martin Baulig  <martin@ximian.com>
10659
10660         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10661         when compiling corlib.
10662
10663 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
10664
10665         * convert.cs (ExplicitConversion): We were reporting an error on
10666         certain conversions (object_type source to a value type, when the
10667         expression was `null') before we had a chance to pass it through
10668         the user defined conversions.
10669
10670         * driver.cs: Replace / and \ in resource specifications to dots.
10671         Fixes 50752
10672
10673         * class.cs: Add check for duplicate operators.  Fixes 52477
10674
10675 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
10676
10677         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10678         that are in the middle of the statements, not only at the end.
10679         Fixes #54987
10680
10681         * class.cs (TypeContainer.AddField): No longer set the
10682         `HaveStaticConstructor' flag, now we call it
10683         `UserDefineStaticConstructor' to diferentiate the slightly
10684         semantic difference.
10685
10686         The situation is that we were not adding BeforeFieldInit (from
10687         Modifiers.TypeAttr) to classes that could have it.
10688         BeforeFieldInit should be set to classes that have no static
10689         constructor. 
10690
10691         See:
10692
10693         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10694
10695         And most importantly Zoltan's comment:
10696
10697         http://bugzilla.ximian.com/show_bug.cgi?id=44229
10698
10699         "I think beforefieldinit means 'it's ok to initialize the type sometime 
10700          before its static fields are used', i.e. initialization does not need
10701          to be triggered by the first access to the type. Setting this flag
10702          helps the JIT to compile better code, since it can run the static
10703          constructor at JIT time, and does not need to generate code to call it
10704          (possibly lots of times) at runtime. Unfortunately, mcs does not set
10705          this flag for lots of classes like String. 
10706          
10707          csc sets this flag if the type does not have an explicit static 
10708          constructor. The reasoning seems to be that if there are only static
10709          initalizers for a type, and no static constructor, then the programmer
10710          does not care when this initialization happens, so beforefieldinit
10711          can be used.
10712          
10713          This bug prevents the AOT compiler from being usable, since it 
10714          generates so many calls to mono_runtime_class_init that the AOT code
10715          is much slower than the JITted code. The JITted code is faster, 
10716          because it does not generate these calls if the vtable is type is
10717          already initialized, which is true in the majority of cases. But the
10718          AOT compiler can't do this."
10719
10720 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
10721
10722         * class.cs (MethodData.Emit): Refactor the code so symbolic
10723         information is generated for destructors;  For some reasons we
10724         were taking a code path that did not generate symbolic information
10725         before. 
10726
10727 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
10728
10729         * class.cs: Create a Constructor.CheckBase method that
10730         takes care of all validation type code. The method
10731         contains some code that was moved from Define.
10732
10733         It also includes new code that checks for duplicate ctors.
10734         This fixes bug #55148.
10735
10736 2004-03-09  Joshua Tauberer <tauberer@for.net>
10737
10738         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
10739         a { ... }-style array creation invokes EmitStaticInitializers
10740         which is not good for reference-type arrays.  String, decimal
10741         and now null constants (NullCast) are not counted toward
10742         static initializers.
10743
10744 2004-03-05  Martin Baulig  <martin@ximian.com>
10745
10746         * location.cs (SourceFile.HasLineDirective): New public field;
10747         specifies whether the file contains or is referenced by a "#line"
10748         directive.
10749         (Location.DefineSymbolDocuments): Ignore source files which
10750         either contain or are referenced by a "#line" directive.        
10751
10752 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
10753
10754         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10755         direct access to our parent, so check the method inline there.
10756
10757 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
10758
10759         * expression.cs (Invocation.EmitCall): Miguel's last commit
10760         caused a regression. If you had:
10761
10762             T t = null;
10763             t.Foo ();
10764
10765         In Foo the implict this would be null.
10766
10767 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
10768
10769         * expression.cs (Invocation.EmitCall): If the method is not
10770         virtual, do not emit a CallVirt to it, use Call.
10771
10772         * typemanager.cs (GetFullNameSignature): Improve the method to
10773         cope with ".ctor" and replace it with the type name.
10774
10775         * class.cs (ConstructorInitializer.Resolve): Now the method takes
10776         as an argument the ConstructorBuilder where it is being defined,
10777         to catch the recursive constructor invocations.
10778
10779 2004-03-16  Martin Baulig  <martin@ximian.com>
10780
10781         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
10782         ConstructedType, call ResolveType() on it to get the type rather
10783         than just using `expr.Type'.
10784
10785 2004-03-16  Martin Baulig  <martin@ximian.com>
10786
10787         * generics.cs (ConstructedType.GetMemberAccess): Take the
10788         EmitContext instead on the TypeExpr and use
10789         ec.TypeContainer.CurrentType/ec.ContainerType.
10790
10791 2004-03-16  Martin Baulig  <martin@ximian.com>
10792
10793         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
10794         parameters before aliases.
10795
10796 2004-03-16  Martin Baulig  <martin@ximian.com>
10797
10798         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
10799         New oublic function; checks whether two generic instances may become
10800         equal under some instantiations (26.3.1).
10801
10802         * class.cs (TypeContainer.Define): Call
10803         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
10804         error.
10805
10806 2004-03-16  Martin Baulig  <martin@ximian.com>
10807
10808         * class.cs (TypeContainer.GetClassBases): Moved
10809         Error_TypeParameterAsBase() here and also check whether the base
10810         class is not an attribute.
10811
10812 2004-03-16  Martin Baulig  <martin@ximian.com>
10813
10814         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10815
10816 2004-03-16  Martin Baulig  <martin@ximian.com>
10817
10818         * class.cs (Error_TypeParameterAsBase): Use correct error number
10819         here (CS0689).  
10820
10821 2004-03-16  Martin Baulig  <martin@ximian.com>
10822
10823         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
10824         for generics.
10825
10826         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
10827         error reporting.
10828
10829 2004-03-15  Martin Baulig  <martin@ximian.com>
10830
10831         * typemanager.cs (TypeManager.GetFullName): New public method.
10832         (TypeManager.MemberLookup): Added `int_num_type_arguments'
10833         argument; only return members with the correct number of type
10834         arguments.
10835         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
10836         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
10837         whether the number of type arguments matches.
10838
10839         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
10840         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
10841
10842         * expression.cs (MemberAccess): Added public `NumTypeArguments'
10843         field; it's set by the protected .ctor when we're actually a
10844         GenericMemberAccess.
10845         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
10846         arguments and pass it to MemberLookupFinal ().
10847
10848         * ecore.cs (Expression.MemberLookup): Added `int
10849         num_type_arguments' argument; only return members with the correct
10850         number of type arguments.
10851         (Expression.MemberLookupFailed): Check whether the MemberLookup
10852         failed because we did not have the correct number of type
10853         arguments; report CS0305 in this case.
10854
10855         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
10856         `e.ResolveAsTypeTerminal()' already did so.
10857
10858 2004-03-15  Martin Baulig  <martin@ximian.com>
10859
10860         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
10861         we're a ConstructedType; in this case, the caller must report an
10862         error (for instance CS0131).
10863
10864         * generic.cs (TypeArguments): Added Location argument to the .ctor.
10865         (TypeArguments.Resolve): Actually report errors here.
10866
10867 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
10868
10869         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10870         `set_indexer_name' to the pending bits (one per type).
10871
10872         We fixed a bug today that was picking the wrong method to
10873         override, since for properties the existing InterfaceMethod code
10874         basically ignored the method name.  Now we make sure that the
10875         method name is one of the valid indexer names.
10876
10877 2004-03-15  Martin Baulig  <martin@ximian.com>
10878
10879         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
10880         for generic instances.
10881
10882 2004-03-13  Martin Baulig  <martin@ximian.com>
10883
10884         * class.cs (TypeContainer.DefineType): Call
10885         TypeManager.AddUserType() immediately after creating the
10886         TypeBuilder; pass all type parameters when creating the
10887         CurrentType.
10888
10889         * decl.cs (DeclSpace.FindNestedType): New public method.
10890         (DeclSpace.FindType): Added `int num_type_args' argument; only
10891         return types with the correct number of type parameters.
10892         (DeclSpace.CountTypeParams): New public property.
10893
10894         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
10895         the number of type parameters; defaults to zero.
10896
10897         * generic.cs (TypeArguments.Count): New public property.
10898         (ConstructedType.DoResolveAsTypeStep): First call
10899         ds.FindNestedType() to find out whether we're nested in the
10900         current generic type; in this case, we inherit all type parameters
10901         from the current class.
10902
10903         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
10904         num_type_args' argument.
10905         (RootContext.LookupType): Added overloaded version which takes the
10906         number of type arguments; only return types with the correct
10907         number of type arguments.
10908
10909         * typemanager.cs (TypeManager.CheckGeneric): New public function;
10910         checks whether `Type t' has `int num_type_args'.
10911
10912 2004-03-13  Martin Baulig  <martin@ximian.com>
10913
10914         * generic.cs (GenericMethod.DefineType): New method; calls
10915         DefineType() on all the type parameters.
10916
10917         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
10918         (MethodData.Define): If we're a generic method, call
10919         GenericMethod.DefineType() to define the type parameters.       
10920
10921 2004-03-10  Martin Baulig  <martin@ximian.com>
10922
10923         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
10924         instead of IsAssignableFrom.    
10925
10926 2004-03-10  Martin Baulig  <martin@ximian.com>
10927
10928         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
10929
10930         * support.cs (ParameterData.HasArrayParameter): New property.
10931         (ReflectionParameters.ctor): Take a MethodBase instead of a
10932         ParameterInfo[].  If we have any type parameters, get the generic
10933         method definition and ask it whether we have variable arguments.
10934
10935 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
10936
10937         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
10938         routines to check if a type is an enumerable/enumerator allow
10939         classes that implement the IEnumerable or IEnumerator interfaces.
10940
10941         * class.cs (Property, Operator): Implement IIteratorContainer, and
10942         implement SetYields.
10943
10944         (Property.Define): Do the block swapping for get_methods in the
10945         context of iterators.   We need to check if Properties also
10946         include indexers or not.
10947
10948         (Operator): Assign the Block before invoking the
10949         OperatorMethod.Define, so we can trigger the Iterator code
10950         replacement. 
10951
10952         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
10953         Property and Operator classes are not created when we parse the
10954         declarator but until we have the block completed, so we use a
10955         singleton SimpleIteratorContainer.Simple to flag whether the
10956         SetYields has been invoked.
10957
10958         We propagate this setting then to the Property or the Operator to
10959         allow the `yield' to function.
10960
10961 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
10962
10963         * codegen.cs: Implemented attribute support for modules.
10964         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
10965         Assembly/Module functionality.
10966
10967         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
10968         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
10969         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
10970
10971 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
10972
10973         * interface.cs (FindMembers): The operation is performed on all base
10974         interfaces and not only on the first. It is required for future CLS Compliance patch.
10975
10976 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
10977
10978         * statement.cs, codegen.cs:
10979         This patch deals with patterns such as:
10980
10981         public class List : IEnumerable {
10982
10983                 public MyEnumerator GetEnumerator () {
10984                         return new MyEnumerator(this);
10985                 }
10986
10987                 IEnumerator IEnumerable.GetEnumerator () {
10988                         ...
10989                 }
10990                 
10991                 public struct MyEnumerator : IEnumerator {
10992                         ...
10993                 }
10994         }
10995
10996         Before, there were a few things we did wrong:
10997         1) we would emit callvirt on a struct, which is illegal
10998         2) we emited ldarg when we needed to emit ldarga
10999         3) we would mistakenly call the interface methods on an enumerator
11000         type that derived from IEnumerator and was in another assembly. For example:
11001
11002         public class MyEnumerator : IEnumerator
11003
11004         Would have the interface methods called, even if there were public impls of the
11005         method. In a struct, this lead to invalid IL code.
11006
11007 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
11008
11009         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11010           renamed to Emit.
11011
11012         * delegate.cs (Define): Fixed crash when delegate type is undefined.
11013
11014 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
11015
11016         * cs-parser.jay: Fix small regression: we were not testing V2
11017         compiler features correctly.
11018
11019         * interface.cs: If the emit context is null, then create one
11020
11021 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
11022
11023         * decl.cs (GetSignatureForError): New virtual method to get full name
11024           for error messages.
11025
11026         * attribute.cs (IAttributeSupport): New interface for attribute setting.
11027           Now it is possible to rewrite ApplyAttributes method to be less if/else.
11028
11029         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11030           Duplicated members and code in these classes has been removed.
11031           Better encapsulation in these classes.
11032
11033 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
11034
11035         * assign.cs (Assign.DoResolve): When dealing with compound
11036         assignments, there is a new rule in ECMA C# 2.4 (might have been
11037         there before, but it is documented here) that states that in:
11038
11039         a op= b;
11040
11041         If b is of type int, and the `op' is a shift-operator, then the
11042         above is evaluated as:
11043
11044         a = (int) a op b 
11045
11046         * expression.cs (Binary.ResolveOperator): Instead of testing for
11047         int/uint/long/ulong, try to implicitly convert to any of those
11048         types and use that in pointer arithmetic.
11049
11050         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11051         method to print information for from the type, not from the
11052         null-method we were given.
11053
11054 2004-02-01  Duncan Mak  <duncan@ximian.com>
11055
11056         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11057         parsing for cmd, fixes bug #53694.
11058
11059 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
11060
11061         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11062         in the member name duplication tests. Property and operator name duplication
11063         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11064
11065 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
11066
11067         * interface.cs (PopulateMethod): Fixed crash when interface method
11068         returns not existing type (error test cs0246-3.cs).
11069
11070 2004-02-02  Ravi Pratap M <ravi@ximian.com>
11071
11072         * cs-parser.jay (interface_accessors): Re-write actions to also
11073         store attributes attached to get and set methods. Fix spelling
11074         while at it.
11075
11076         (inteface_property_declaration): Modify accordingly.
11077
11078         (InterfaceAccessorInfo): New helper class to store information to pass
11079         around between rules that use interface_accessors.
11080
11081         * interface.cs (Emit): Apply attributes on the get and set
11082         accessors of properties and indexers too.
11083
11084         * attribute.cs (ApplyAttributes): Modify accordingly to use the
11085         right MethodBuilder when applying attributes to the get and set accessors.
11086
11087 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
11088
11089         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11090
11091 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
11092
11093         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11094
11095 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
11096
11097         * cs-parser.jay: Remove YIELD token, instead use the new grammar
11098         changes that treat `yield' specially when present before `break'
11099         or `return' tokens.
11100
11101         * cs-tokenizer.cs: yield is no longer a keyword.
11102
11103 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
11104
11105         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11106         setting for default constructors.
11107         For default constructors are almost every time set wrong Modifier. The
11108         generated IL code has been alright. But inside mcs this values was
11109         wrong and this was reason why several of my CLS Compliance tests
11110         failed.
11111
11112 2004-02-27  Martin Baulig  <martin@ximian.com>
11113
11114         * generics.cs (ConstructedType.ResolveType): Make the nested type
11115         stuff actually work.
11116
11117 2004-02-25  Martin Baulig  <martin@ximian.com>
11118
11119         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
11120         property; returns the type parameters just from the current type,
11121         ie. with the ones from outer classes.
11122         (DeclSpace.LookupGeneric): First search in the current class, then
11123         in outer classes.
11124         (DeclSpace.initialize_type_params): When hiding a type parameter
11125         from an outer class, put it into the `type_param_list' anyways.
11126
11127         * expression.cs (MemberAccess.expr): Made this field protected.
11128
11129         * class.cs (TypeContainer.Define): The `CurrentType' just contains
11130         the type parameters from the current class.
11131
11132         * generic.cs (ConstructedType.ResolveType): Support nested generic
11133         types by taking the type parameters which we inherit from outer
11134         classes into account.
11135         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
11136         support for nested generic types.
11137
11138 2004-02-23  Martin Baulig  <martin@ximian.com>
11139
11140         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
11141         field and check whether we're nested inside a generic type.
11142         (DeclSpace.ResolveType): If we're resolving to a generic type
11143         definition, create a ConstructedType and return its resolved type.
11144         (DeclSpace.initialize_type_params): New private method;
11145         initializes the `type_param_list' field from the type parameters
11146         from this and all enclosing classes.
11147         (DeclSpace.TypeParameters): Call initialize_type_params() unless
11148         we're already initialized.
11149
11150 2004-02-23  Martin Baulig  <martin@ximian.com>
11151
11152         * class.cs (Method.Define): Create the generic method before
11153         calling DoDefine().
11154         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
11155         the TypeContainer one); we use this for generic methods.
11156
11157         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
11158         parent's TypeBuilder.
11159
11160 2004-02-18  Martin Baulig  <martin@ximian.com>
11161
11162         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
11163         to check for equality.
11164
11165 2004-02-05  Martin Baulig  <martin@ximian.com>
11166
11167         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
11168         `ec.TypeContainer.CurrentType', use it instead of
11169         `ec.ContainerType' to check whether we're in the type's ctor.
11170
11171 2004-01-29  Martin Baulig  <martin@ximian.com>
11172
11173         * expression.cs (Invocation.DoResolve): If we're a
11174         `ConstructedType', then we're actually a generic method, so
11175         rewrite the expr as a GenericMemberAccess.
11176
11177         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
11178         here; manually parse it into a string.
11179
11180 2004-01-28  Martin Baulig  <martin@ximian.com>
11181
11182         * typemanager.cs (TypeManager.IsEqual): New static method.
11183         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
11184         check for equality instead of using `=='.
11185
11186 2004-01-26  Martin Baulig  <martin@ximian.com>
11187
11188         * decl.cs (DeclSpace.CurrentType): New public field.
11189
11190         * expression.cs (This.ResolveBase): If we have an
11191         `ec.TypeContainer.CurrentType', use it instead of
11192         `ec.ContainerType'.
11193
11194         * class.cs (TypeContainer.DefineType): If we're a generic type,
11195         create the `CurrentType' (unresolved).
11196         (TypeContainer.GenericType): New private field.
11197         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
11198         it and store it in `GenericType' before creating the MemberCache.
11199         (TypeContainer.GetMembers): If we have a `GenericType', call
11200         TypeManager.FindMembers() on it.
11201
11202         * interface.cs (Interface.GenericType): New private field.
11203         (Interface.DefineType): If we're a generic type, create the
11204         `CurrentType' (unresolved).
11205         (Interface.DefineMembers): If we have a `CurrentType', resolve it
11206         and store it in `GenericType' before creating the MemberCache.
11207         (Interface.GetMembers): If we have a `GenericType', call
11208         TypeManager.FindMembers() on it.
11209
11210 2004-01-22  Martin Baulig  <martin@ximian.com>
11211
11212         * cs-parser.jay (namespace_or_type_name): Return an Expression,
11213         not a QualifiedIdentifier.  This is what `type_name_expression'
11214         was previously doing.
11215         (type_name_expression): Removed; the code is now in
11216         `namespace_or_type_name'.
11217         (qualified_identifier): Removed, use `namespace_or_type_name'
11218         instead.
11219         (QualifiedIdentifier): Removed this class.      
11220
11221 2004-01-22  Martin Baulig  <martin@ximian.com>
11222
11223         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11224         not a string as alias name.
11225
11226 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
11227
11228         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11229         #52730 bug, and instead compute correctly the need to use a
11230         temporary variable when requesting an address based on the
11231         static/instace modified of the field and the constructor.
11232  
11233 2004-01-21  Martin Baulig  <martin@ximian.com>
11234
11235         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11236         class and namespace before looking up aliases.  Fixes #52517.
11237
11238 2004-01-21  Martin Baulig  <martin@ximian.com>
11239
11240         * flowanalysis.cs (UsageVector.Merge): Allow variables being
11241         assinged in a 'try'; fixes exception4.cs.
11242
11243 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11244         * class.cs : Implemented parameter-less constructor for TypeContainer
11245
11246         * decl.cs: Attributes are now stored here. New property OptAttributes
11247
11248         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
11249
11250         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
11251
11252 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11253
11254         * typemanager.cs (CSharpSignature): Now reports also inner class name.
11255           (CSharpSignature): New method for indexer and property signature.
11256
11257 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11258
11259         * pending.cs (IsVirtualFilter): Faster implementation.
11260
11261 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11262
11263         * typemanager.cs: Avoid inclusion of same assembly more than once.
11264
11265 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11266
11267         * cs-parser.jay: Fixed problem where the last assembly attribute
11268           has been applied also to following declaration (class, struct, etc.)
11269           
11270 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11271
11272         * class.cs: Added error CS0538, CS0539 reporting.
11273         Fixed crash on Microsoft runtime when field type is void.
11274
11275         * cs-parser.jay: Added error CS0537 reporting.
11276
11277         * pending.cs: Added error CS0535 reporting.
11278         Improved error report for errors CS0536, CS0534.
11279
11280 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
11281
11282         Merge a few bits from the Anonymous Method MCS tree.
11283
11284         * statement.cs (ToplevelBlock): New class for toplevel methods,
11285         will hold anonymous methods, lifted variables.
11286
11287         * cs-parser.jay: Create toplevel blocks for delegates and for
11288         regular blocks of code. 
11289
11290 2004-01-20  Martin Baulig  <martin@ximian.com>
11291
11292         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11293         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11294         and `NeedExplicitReturn'; added `IsLastStatement'.
11295         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11296         have a `ReturnLabel' or we're not unreachable.
11297
11298         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
11299         child's reachability; don't just override ours with it.  Fixes
11300         #58058 (lluis's example).
11301         (FlowBranching): Added public InTryOrCatch(), InCatch(),
11302         InFinally(), InLoop(), InSwitch() and
11303         BreakCrossesTryCatchBoundary() methods.
11304
11305         * statement.cs (Return): Do all error checking in Resolve().
11306         Unless we are the last statement in a top-level block, always
11307         create a return label and jump to it.
11308         (Break, Continue): Do all error checking in Resolve(); also make
11309         sure we aren't leaving a `finally'.
11310         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
11311         statement in a top-level block.
11312         (Block.Flags): Added `IsDestructor'.
11313         (Block.IsDestructor): New public property.
11314
11315 2004-01-20  Martin Baulig  <martin@ximian.com>
11316
11317         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11318
11319 2004-01-20  Martin Baulig  <martin@ximian.com>
11320
11321         * statement.cs (Statement.ResolveUnreachable): New public method.
11322         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11323         (Block.Resolve): Resolve unreachable statements.
11324
11325 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11326
11327         * expression.cs: We need to fix the case where we do
11328         not have a temp variable here.
11329
11330         * assign.cs: Only expression compound assignments need
11331         temporary variables.
11332
11333 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11334
11335         * flowanalysis.cs: Reduce memory allocation in a few ways:
11336           - A block with no variables should not allocate a bit
11337             vector for itself.
11338           - A method with no out parameters does not need any tracking
11339             for assignment of the parameters, so we need not allocate
11340             any data for it.
11341           - The arrays:
11342                 public readonly Type[] VariableTypes;
11343                 public readonly string[] VariableNames;
11344             Are redundant. The data is already stored in the variable
11345             map, so we need not allocate another array for it.
11346           - We need to add alot of checks for if (params | locals) == null
11347             due to the first two changes.
11348
11349 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
11350
11351         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11352         implement IMemoryLocation, we store a copy on a local variable and
11353         take the address of it.  Patch from Benjamin Jemlich
11354
11355         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11356         to use a special "type_name_expression" rule which reduces the
11357         number of "QualifiedIdentifier" classes created, and instead
11358         directly creates MemberAccess expressions.
11359
11360 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
11361
11362         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11363         that fixes #52853.  Null literal assignment to ValueType
11364
11365         * class.cs (MethodData.Emit): Instead of checking the name of the
11366         method to determine if its a destructor, create a new derived
11367         class from Method called Destructor, and test for that.  
11368
11369         * cs-parser.jay: Create a Destructor object instead of a Method.  
11370
11371         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11372
11373         Fixes: 52933
11374
11375 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
11376
11377         * expression.cs (Binary.ResolveOperator): Perform an implicit
11378         conversion from MethodGroups to their delegate types on the
11379         Addition operation.
11380
11381         * delegate.cs: Introduce a new class DelegateCreation that is the
11382         base class for `NewDelegate' and `ImplicitDelegateCreation',
11383         factor some code in here.
11384
11385         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11386         conversion from MethodGroups to compatible delegate types. 
11387
11388         * ecore.cs (Expression.Resolve): Do not flag error 654
11389         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11390         we allow conversions from MethodGroups to delegate types now.
11391
11392         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11393         assignments in v2 either.
11394
11395 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
11396
11397         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11398         static read-only fields in ctors.
11399
11400         Applied patch from Benjamin Jemlich 
11401
11402         * expression.cs (UnaryMutator): Avoid leaking local variables. 
11403
11404 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
11405
11406         * cs-tokenizer.cs (IsCastToken): Allow the various native types
11407         here to return true, as they can be used like this:
11408
11409                 (XXX) int.MEMBER ()
11410
11411         Fixed 49836 and all the other dups
11412
11413 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
11414
11415         * driver.cs: Implement /win32res and /win32icon.
11416
11417 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
11418
11419         * cs-parser.jay: Add a rule to improve error handling for the
11420         common mistake of placing modifiers after the type.
11421
11422 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
11423
11424         * cs-parser.jay (interface_event_declaration): Catch
11425         initialization of events on interfaces, and report cs0068
11426
11427         * cs-parser.jay (interface_event_declaration): Catch
11428         initialization of events. 
11429
11430         * ecore.cs: Better report missing constructors.
11431
11432         * expression.cs (Binary.ResolveOperator): My previous bug fix had
11433         the error reporting done in the wrong place.  Fix.
11434
11435         * expression.cs (Binary.ResolveOperator): Catch the 
11436         operator + (E x, E y) error earlier, and later allow for implicit
11437         conversions in operator +/- (E e, U x) from U to the underlying
11438         type of E.
11439
11440         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11441         52596, if the container class is abstract, the default constructor
11442         is protected otherwise its public (before, we were always public).
11443
11444         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11445         fixed statement.
11446
11447         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11448         Jemlich that fixes bug #52597, MCS was generating invalid code for
11449         idisposable structs.   Thanks to Ben for following up with this
11450         bug as well.
11451
11452 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
11453
11454         * driver.cs: Allow assemblies without code to be generated, fixes
11455         52230.
11456
11457 2004-01-07  Nick Drochak <ndrochak@gol.com>
11458
11459         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11460
11461 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
11462
11463         * cs-parser.jay: Add rules to improve error reporting if fields or
11464         methods are declared at the namespace level (error 116)
11465
11466         * Add rules to catch event add/remove
11467
11468 2004-01-04  David Sheldon <dave-mono@earth.li>
11469
11470   * expression.cs: Added matching ")" to error message for 
11471   CS0077
11472
11473 2004-01-03 Todd Berman <tberman@gentoo.org>
11474
11475         * ecore.cs, attribute.cs:
11476         Applying fix from #52429.
11477
11478 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11479
11480         * ecore.cs, expression.cs, statement.cs:
11481         Total rewrite of how we handle branching. We
11482         now handle complex boolean expressions with fewer
11483         jumps. As well if (x == 0) no longer emits a ceq.
11484
11485         if (x is Foo) is much faster now, because we generate
11486         better code.
11487
11488         Overall, we get a pretty big improvement on our benchmark
11489         tests. The code we generate is smaller and more readable.
11490
11491         I did a full two-stage bootstrap. The patch was reviewed
11492         by Martin and Miguel.
11493
11494 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11495
11496         * cs-parser.jay: Make primary_expression not take a QI.
11497         we dont need this because the member_access rule covers
11498         us here. So we replace the rule with just IDENTIFIER.
11499
11500         This has two good effects. First, we remove a s/r conflict.
11501         Second, we allocate many fewer QualifiedIdentifier objects.
11502
11503 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11504
11505         * attribute.cs: Handle MarshalAs attributes as pseudo, and
11506         set the correct information via SRE. This prevents
11507         hanging on the MS runtime. Fixes #29374.
11508
11509 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11510
11511         * convert.cs: correctly handle conversions to value types
11512         from Enum and ValueType as unboxing conversions.
11513
11514         Fixes bug #52569. Patch by Benjamin Jemlich.
11515
11516 2004-01-02  Ravi Pratap  <ravi@ximian.com>
11517
11518         * expression.cs (BetterConversion): Prefer int -> uint
11519         over int -> ulong (csc's behaviour). This fixed bug #52046.
11520
11521 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11522
11523         * decl.cs (MemberCache.FindMembers): now returns a
11524         MemberInfo [].
11525
11526         * typemanager.cs: In general, go with with ^^.
11527         (CopyNewMethods): take an IList.
11528         (RealMemberLookup): Only allocate an arraylist
11529         if we copy from two sets of methods.
11530
11531         This change basically does two things:
11532         1) Fewer array lists allocated due to CopyNewMethods.
11533         2) the explicit cast in MemberList costed ALOT.
11534
11535 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
11536
11537         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
11538         a hashtable to avoid needless string allocations when an identifier is
11539         used more than once (the common case).
11540
11541 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11542
11543         * pending.cs: MS's TypeBuilder.GetInterfaces ()
11544         is broken, it will not return anything. So, we
11545         have to use the information we have in mcs to
11546         do the task.
11547
11548         * typemanager.cs: Add a cache for GetInterfaces,
11549         since this will now be used more often (due to ^^)
11550
11551         (GetExplicitInterfaces) New method that gets the
11552         declared, not effective, interfaces on a type
11553         builder (eg, if you have interface IFoo, interface
11554         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
11555         { IBar }.
11556
11557         This patch makes MCS able to bootstrap itself on
11558         Windows again.
11559
11560 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11561
11562         * expression.cs: Remove the Nop's that Miguel put
11563         in by mistake.
11564
11565 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11566
11567         * report.cs, codegen.cs: Give the real stack trace to
11568         the error when an exception is thrown.
11569
11570 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11571
11572         * decl.cs: only allocate hashtables for ifaces if 
11573         it is an iface!
11574
11575 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11576
11577         * expression.cs: fix the error from cs0121-2.cs
11578         (a parent interface has two child interfaces that
11579         have a function with the same name and 0 params
11580         and the function is called through the parent).
11581
11582 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11583
11584         * class.cs, rootcontext.cs, typmanager.cs: do not
11585         leak pointers.
11586
11587 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11588
11589         * codegen.cs: remove stack for the ec flow branching.
11590         It is already a linked list, so no need.
11591
11592 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11593
11594         * Makefile: Allow custom profiler here.
11595
11596 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11597
11598         * typemanager.cs (LookupType):
11599           - Use a static char [], because split takes
11600             a param array for args, so it was allocating
11601             every time.
11602           - Do not store true in a hashtable, it boxes.
11603
11604 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11605
11606         * flowanalysis.cs: bytify common enums.
11607
11608 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11609
11610         * modifiers.cs: Add a new set of flags for the
11611         flags allowed on explicit interface impls.
11612         * cs-parser.jay: catch the use of modifiers in
11613         interfaces correctly.
11614         * class.cs: catch private void IFoo.Blah ().
11615
11616         All related to bug #50572.
11617
11618 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11619
11620         * decl.cs: Rewrite the consistant accessability checking.
11621         Accessability is not linear, it must be implemented in
11622         a tableish way. Fixes #49704.
11623
11624 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11625
11626         * expression.cs: Handle negation in a checked context.
11627         We must use subtraction from zero. Fixes #38674.
11628
11629 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11630
11631         * class.cs: Ignore static void main in DLLs.
11632         * rootcontext.cs: Handle the target type here,
11633         since we are have to access it from class.cs
11634         * driver.cs: account for the above.
11635
11636 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11637
11638         * report.cs: Give line numbers and files if available.
11639
11640 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
11641
11642         * driver.cs: Implement /addmodule.
11643
11644         * typemanager.cs:  Change 'modules' field so it now contains Modules not
11645         ModuleBuilders.
11646
11647 2003-12-20  Martin Baulig  <martin@ximian.com>
11648
11649         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11650         (FieldBase.IsAssigned): Removed this field.
11651         (FieldBase.SetAssigned): New public method.
11652         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11653
11654 2003-12-20  Martin Baulig  <martin@ximian.com>
11655
11656         * expression.cs (LocalVariableReference.DoResolve): Don't set
11657         `vi.Used' if we're called from DoResolveLValue().
11658
11659         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11660         returns the usage vector it just merged into the current one -
11661         pass this one to UsageWarning().
11662         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11663         of the `EmitContext', don't call this recursively on our children.
11664
11665 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
11666
11667         * driver.cs: Implement /target:module.
11668
11669 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
11670
11671         * support.cs (CharArrayHashtable): New helper class.
11672
11673         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
11674         char arrays, not strings, so we can avoid creating a string in
11675         consume_identifier if the identifier is a keyword.
11676
11677 2003-12-16  Martin Baulig  <martin@ximian.com>
11678
11679         * statement.cs (LocalInfo.Assigned): Removed this property.
11680         (LocalInfo.Flags): Removed `Assigned'.
11681         (LocalInfo.IsAssigned): New public method; takes the EmitContext
11682         and uses flow analysis.
11683         (Block.UsageWarning): Made this method private.
11684         (Block.Resolve): Call UsageWarning() if appropriate.
11685
11686         * expression.cs (LocalVariableReference.DoResolve): Always set
11687         LocalInfo.Used here.
11688
11689 2003-12-13  Martin Baulig  <martin@ximian.com>
11690
11691         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11692         any value here; we're now using flow analysis to figure out
11693         whether a statement/block returns a value.
11694
11695 2003-12-13  Martin Baulig  <martin@ximian.com>
11696
11697         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
11698         working again.
11699         (FlowBranching.MergeFinally): Don't call
11700         `branching.CheckOutParameters()' here, this is called in
11701         MergeTopBlock().
11702         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
11703         when adding the `finally' vector.       
11704
11705 2003-12-13  Martin Baulig  <martin@ximian.com>
11706
11707         * flowanalysis.cs
11708         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
11709         actually work and also fix #48962.
11710
11711 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11712
11713         * decl.cs: Do not check System.Object for nested types,
11714         since we know it does not have any. Big bang for buck:
11715
11716         BEFORE:
11717            Run 1:   8.35 seconds
11718            Run 2:   8.32 seconds
11719            corlib:  17.99 seconds
11720         AFTER:
11721            Run 1:   8.17 seconds
11722            Run 2:   8.17 seconds
11723            corlib:  17.39 seconds
11724
11725 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
11726
11727         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
11728         time we are returning 0 members, so we save alot here.
11729
11730 2003-12-11  Martin Baulig  <martin@ximian.com>
11731
11732         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
11733         `MergeChild()', also just take the `FlowBranching' as argument;
11734         call Merge() on it and return the result.
11735         (FlowBranching.Merge): We don't need to do anything if we just
11736         have one sibling.
11737
11738 2003-12-11  Martin Baulig  <martin@ximian.com>
11739
11740         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
11741         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
11742         Maurer for this idea.
11743
11744 2003-12-11  Martin Baulig  <martin@ximian.com>
11745
11746         * flowanalysis.cs (MergeResult): This class is now gone; we now
11747         use the `UsageVector' for this.  The reason for this is that if a
11748         branching just has one sibling, we don't need to "merge" them at
11749         all - that's the next step to do.
11750         (FlowBranching.Merge): We now return a `UsageVector' instead of a
11751         `MergeResult'.
11752
11753 2003-12-11  Martin Baulig  <martin@ximian.com>
11754
11755         Reworked flow analyis and made it more precise and bug-free.  The
11756         most important change is that we're now using a special `Reachability'
11757         class instead of having "magic" meanings of `FlowReturns'.  I'll
11758         do some more cleanups and optimizations and also add some more
11759         documentation this week.
11760
11761         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
11762         largely reworked this class.
11763         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
11764         the new `Reachability' class instead of having "magic" values here.
11765         (FlowBranching): We're now using an instance of `Reachability'
11766         instead of having separate `Returns', `Breaks' etc. fields.
11767
11768         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
11769         based on flow analysis; ignore the return value of block.Emit ().
11770
11771 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
11772
11773         * driver.cs typemanager.cs: Find the mono extensions to corlib even
11774         if they are private.
11775
11776 2003-12-09  Martin Baulig  <martin@ximian.com>
11777
11778         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
11779         call them directly on the UsageVector.
11780
11781 2003-12-09  Martin Baulig  <martin@ximian.com>
11782
11783         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
11784         Changed return type from `FlowReturns' to `Reachability'.
11785
11786 2003-12-09  Martin Baulig  <martin@ximian.com>
11787
11788         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
11789         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
11790         `Reachable' fields with a single `Reachability' one.
11791
11792 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11793
11794         * class.cs (FindMembers): Remove foreach's.
11795
11796         Bootstrap times:
11797
11798         BEFORE
11799                 Run 1:   8.74 seconds
11800                 Run 2:   8.71 seconds
11801
11802         AFTER
11803                 Run 1:   8.64 seconds
11804                 Run 2:   8.58 seconds
11805
11806
11807 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11808
11809         * cs-parser.jay:
11810         * gen-treedump.cs:
11811         * statement.cs:
11812         This patch does a few things:
11813                 1. EmptyStatement is now a singleton, so it is never reallocated.
11814                 2. All blah is EmptyStatement constructs have been changed to
11815                    blah == EmptyStatement.Value, which is much faster and valid
11816                    now that EmptyStatement is a singleton.
11817                 3. When resolving a block, rather than allocating a new array for
11818                    the non-empty statements, empty statements are replaced with
11819                    EmptyStatement.Value
11820                 4. Some recursive functions have been made non-recursive.
11821         Mainly the performance impact is from (3), however (1) and (2) are needed for
11822         this to work. (4) does not make a big difference in normal situations, however
11823         it makes the profile look saner.
11824
11825         Bootstrap times:
11826
11827         BEFORE
11828         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11829         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11830         Total memory allocated: 56397 KB
11831
11832         AFTER
11833         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
11834         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
11835         Total memory allocated: 55666 KB
11836
11837 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11838
11839         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
11840         than the hashtable in a hashtable version
11841
11842         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
11843         we always end up concating a string. This results in a huge perf
11844         loss, because many strings have to be tracked by the GC. In this
11845         patch, we first use a hashtable that works with two keys, so that
11846         the strings do not need to be concat'ed.
11847
11848         Bootstrap times:
11849         BEFORE
11850                 Run 1:   8.74 seconds
11851                 Run 2:   8.71 seconds
11852
11853         AFTER
11854                 Run 1:   8.65 seconds
11855                 Run 2:   8.56 seconds
11856
11857 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11858
11859         * Makefile: Add a new target `do-time' that does a quick and simple
11860         profile, leaving easy to parse output.
11861
11862 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
11863
11864         * codegen.cs (Init): Create the dynamic assembly with 
11865         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
11866
11867 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11868
11869         * support.cs: Make the PtrHashtable use only one
11870         instance of its comparer.
11871
11872 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
11873
11874         * typemanager.cs: Fix lookup of GetNamespaces.
11875
11876 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
11877
11878         * expression.cs: Removed redundant line.
11879
11880         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
11881         ArrayLists, use for loops with bounds.  
11882
11883         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
11884         arraylist.
11885
11886         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
11887         arraylists, use for loop with bounds.
11888
11889         The above three changes give us a 0.071 second performance
11890         improvement out of 3.294 seconds down to 3.223.  On my machine
11891         the above changes reduced the memory usage by 1,387 KB during
11892         compiler bootstrap.
11893
11894         * cs-parser.jay (QualifiedIdentifier): New class used to represent
11895         QualifiedIdentifiers.  Before we created a new string through
11896         concatenation, and mostly later on, the result would be
11897         manipulated by DecomposeQI through string manipulation.
11898
11899         This reduced the compiler memory usage for bootstrapping from
11900         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
11901         compile times in 0.05 seconds.
11902
11903 2003-11-28  Dick Porter  <dick@ximian.com>
11904
11905         * support.cs: Do string compares with the Invariant culture.
11906
11907         * rootcontext.cs: 
11908         * gen-treedump.cs: 
11909         * expression.cs: 
11910         * driver.cs: 
11911         * decl.cs: 
11912         * codegen.cs: 
11913         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
11914         the comparison is done with the Invariant culture.
11915
11916 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
11917
11918         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
11919         GetEnumerator method.
11920
11921         (ProbeCollectionType): Iterate starting at the most specific type
11922         upwards looking for a GetEnumerator
11923
11924         * expression.cs: Shift count can be up to 31 for int/uint and 63
11925         for long/ulong.
11926
11927 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
11928
11929         * statement.cs (Block.LookupLabel): Also look for the label on the
11930         children blocks.  Use a hash table to keep track of visited
11931         nodes. 
11932
11933         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
11934         we actually did transform the other operand, otherwise fall back
11935         to the common codepath that casts to long.
11936
11937         * cs-tokenizer.cs: Use the same code pattern as the int case.
11938         Maybe I should do the parsing myself, and avoid depending on the
11939         Parse routines to get this done.
11940
11941 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
11942
11943         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
11944         which fixes bug 51347.  This time test it.
11945
11946         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
11947         attributes for example can not tell the difference between these.
11948         The difference was only a syntax feature of the language. 
11949
11950         * attribute.cs: Apply attributes to delegates.
11951
11952         * delegate.cs: Call the apply attributes method.
11953
11954 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
11955
11956         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
11957         comparing 0 vs Byte.MinValue, not the value
11958
11959         (ImplicitConversionRequired): When reporting a conversion error,
11960         use error 31 to print out the constant error instead of the
11961         simpler 29.
11962
11963         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
11964         which fixes bug 51347.
11965
11966 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
11967
11968         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
11969         which fixes the -warnaserror command line option.
11970
11971 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
11972
11973         * cfold.cs (DoNumericPromotions): During constant folding of
11974         additions on UIntConstant, special case intconstants with
11975         IntConstants like we do on the expression binary operator. 
11976
11977 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
11978
11979         * convert.cs (ImplicitReferenceConversion): We were missing a case
11980         (System.Enum are not value types or class types, so we need to
11981         classify them separatedly).
11982
11983         * driver.cs: We do not support error 2007.
11984
11985 2003-11-12 Jackson Harper <jackson@ximian.com>
11986
11987         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
11988         system directory. Also use the full file name so users can
11989         libraries names mscorlib-o-tron.dll in a non system dir.
11990         
11991 2004-01-04  David Sheldon <dave-mono@earth.li>
11992
11993         * expression.cs: Added matching ")" to error message for CS0077.
11994
11995 2003-12-19  Martin Baulig  <martin@ximian.com>
11996
11997         * typemanager.cs (TypeManager.IsEqualGenericType): New public
11998         static method; see documentation in the method.
11999         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
12000
12001         * convert.cs (Convert.ImplicitReferenceConversion,
12002         Convert.ImplicitReferenceConversionExists): Add support for
12003         generic type declarations; see gen-36.cs.
12004
12005 2003-12-19  Martin Baulig  <martin@ximian.com>
12006
12007         * pending.cs (Pending.InterfaceMethod): Use
12008         `Type.IsAssignableFrom()' instead of `=='.
12009
12010 2003-12-18  Martin Baulig  <martin@ximian.com>
12011
12012         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
12013         byref types first.
12014
12015         * convert.cs (Convert.ImplicitStandardConversionExists): Use
12016         `expr_type.Equals (target_type)' instead of `=='.
12017
12018 2003-12-08  Martin Baulig  <martin@ximian.com>
12019
12020         * generics.cs (Constraints.Types): Removed.
12021         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
12022         to Type's.
12023         (Constraints.ResolveTypes): New public method; resolves the
12024         TypeExpr's to Type's.
12025         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
12026         longer takes the constraints.
12027         (TypeParameter.DefineMethod): Likewise.
12028         (TypeParameter.DefineType): New public method.  Calls
12029         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
12030         the constraints.
12031
12032 2003-12-08  Martin Baulig  <martin@ximian.com>
12033
12034         * convert.cs (Convert.ImplicitConversionStandard): Use
12035         `expr_type.Equals (target_type)' instead of `=='.
12036
12037 2003-12-08  Martin Baulig  <martin@ximian.com>
12038
12039         * typemanager.cs (TypeManager.GetReferenceType): Call
12040         `Type.MakeByRefType ()'.
12041
12042 2003-12-08  Martin Baulig  <martin@ximian.com>
12043
12044         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
12045         just has some special meaning in some situations.  For instance,
12046         it is allowed to use `where' as the name of a variable etc.
12047
12048 2003-12-04  Martin Baulig  <martin@ximian.com>
12049
12050         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12051         `Type.MakeArrayType()' for array types.
12052
12053 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
12054
12055         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
12056         debugging message.
12057
12058         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
12059         corlib to compile.
12060
12061 2003-11-16  Martin Baulig  <martin@ximian.com>
12062
12063         * codegen.cs (EmitContext.IsGeneric): Removed.
12064
12065         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
12066         ResolveGeneric() on the DeclSpace.
12067
12068 2003-11-16  Martin Baulig  <martin@ximian.com>
12069
12070         * generic.cs (TypeArguments.Resolve):
12071         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
12072         `ResolveType()' on it to get the Type.
12073
12074 2003-11-15  Martin Baulig  <martin@ximian.com>
12075
12076         * generic.cs (ConstructedType.GetInterfaces): Override this.
12077
12078 2003-11-14  Martin Baulig  <martin@ximian.com>
12079
12080         * interface.cs (Interface.DefineType): Define all type parameters
12081         before adding the interfaces we inherit.
12082
12083 2003-11-11  Martin Baulig  <martin@ximian.com>
12084
12085         * generic.cs (ConstructedType.ResolveType): Always call
12086         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
12087
12088 2003-11-10  Martin Baulig  <martin@ximian.com>
12089
12090         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
12091         (TypeManager.InitCoreTypes): Initialize them here, but instead of
12092         calling `ResolveType()' on them, directly assign their `Type'.
12093
12094 2003-11-08  Martin Baulig  <martin@ximian.com>
12095
12096         * generic.cs (ConstructedType): Override `IsClass' etc.
12097
12098 2003-11-08  Martin Baulig  <martin@ximian.com>
12099
12100         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
12101         return value and the `out parent' parameter.
12102         (TypeContainer.DefineType): Moved the CS0644 check into
12103         GetClassBases().  Don't pass the interface types to the
12104         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
12105         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
12106
12107         * ecore.cs (TypeExpr.IsAttribute): New property.
12108         (TypeExpr.GetInterfaces): New method.
12109
12110         * interface.cs (Interface.GetInterfaceTypeByName): Return a
12111         TypeExpr instead of a Type.
12112         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
12113         (Interface.DefineType): Don't pass the interface types to the
12114         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
12115         them later and then call `TypeBulider.AddInterfaceImplementation()'.
12116
12117         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
12118         instead of a `Type[]'.
12119         (TypeManager.RegisterBuilder): Likewise.
12120         (TypeManager.AddUserInterface): Likewise.
12121         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
12122         `Type[]' and also return a `TypeExpr[]'.
12123         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
12124
12125 2003-11-08  Martin Baulig  <martin@ximian.com>
12126
12127         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12128         Expression.     
12129
12130 2003-11-08  Martin Baulig  <martin@ximian.com>
12131
12132         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12133         TypeManager.ResolveExpressionTypes().
12134
12135         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12136         instead of an Expression.
12137         (TypeExpr): This is now an abstract base class for `TypeExpression'.
12138         (TypeExpression): New public class; formerly known as `TypeExpr'.
12139
12140         * expression.cs (ComposedCast): Derive from TypeExpr.
12141
12142         * typemanager.cs (TypeManager.system_*_expr): These are now
12143         TypExpr's instead of Expression's.
12144         (TypeManager.ResolveExpressionTypes): New public static function;
12145         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12146         of them.        
12147
12148 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
12149
12150         * expression.cs (New.DoResolve): Do not dereference value that
12151         might be a null return.
12152
12153         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12154         sure that the constant value has the right type.  Fixes an
12155         unreported bug, similar to 50425.
12156
12157         * const.cs (Const.LookupConstantValue): Call
12158         ImplicitStandardConversionExists before doing a conversion to
12159         avoid havng the TypeManager.ChangeType do conversions.
12160
12161         Reduced the number of casts used
12162
12163         (Const.ChangeType): New routine to enable reuse of the constant
12164         type changing code from statement.
12165
12166         * typemanager.cs (ChangeType): Move common initialization to
12167         static global variables.
12168
12169         Fixes #50425.
12170
12171         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12172         every value type to go through, even if it was void.  Fix that. 
12173
12174         * cs-tokenizer.cs: Use is_identifier_start_character on the start
12175         character of the define, and the is_identifier_part_character for
12176         the rest of the string.
12177
12178 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
12179
12180         * expression.cs (UnaryMutator.EmitCode): When I updated
12181         LocalVariableReference.DoResolve, I overdid it, and dropped an
12182         optimization done on local variable references.
12183
12184 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
12185
12186         * ecore.cs: Convert the return from Ldlen into an int.
12187
12188 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
12189
12190         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12191         the accessibility, this is a special case for toplevel non-public
12192         classes (internal for instance).
12193
12194 2003-10-20  Nick Drochak <ndrochak@gol.com>
12195
12196         * ecore.cs: Fix typo and build.  Needed another right paren.
12197
12198 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
12199
12200         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
12201         `internal' case regular and protected, but not allowing protected
12202         to be evaluated later.  Bug 49840
12203
12204 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
12205
12206         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12207         to kb.Nlast, and not the kb.nFirst to isolate the switch
12208         statement.
12209
12210         Extract the underlying type, so enumerations of long/ulong are
12211         treated like long/ulong.
12212
12213 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
12214
12215         * expression.cs (New): Overload the meaning of RequestedType to
12216         track the possible creation of the NewDelegate type, since
12217         DoResolve is invoked more than once for new constructors on field
12218         initialization.
12219
12220         See bugs: #48800 and #37014
12221
12222         * cs-parser.jay (declare_local_constants): Take an arraylist
12223         instead of a single constant.
12224
12225         (local_constant_declaration): It should take a
12226         constant_declarators, not a constant_declarator.  Fixes 49487
12227
12228         * convert.cs: Fix error report.
12229
12230 2003-10-13 Jackson Harper <jackson@ximian.com>
12231
12232         * typemanager.cs (TypeToCoreType): Add float and double this fixes
12233         bug #49611
12234         
12235 2003-11-03  Martin Baulig  <martin@ximian.com>
12236
12237         * expression.cs (ArrayAccess.GetStoreOpcode): Added
12238         `out bool has_type_arg'; if set, we need to pass the type to
12239         ig.Emit().
12240         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
12241         Stelem_Any/Ldelem_Any for generic parameters.   
12242
12243 2003-11-02  Martin Baulig  <martin@ximian.com>
12244
12245         * expression.cs (Invocation.EmitCall): Use
12246         `TypeManager.IsValueType()' to check whether it's a value type.
12247         Don't set `struct_call' when calling a method on a type parameter.
12248
12249 2003-11-02  Martin Baulig  <martin@ximian.com>
12250
12251         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
12252         and removed the TypeBuilder argument.
12253
12254         * typemanager.cs (TypeManager.IsValueType): Return
12255         `t.IsGenericParameter || t.IsValueType'.
12256
12257 2003-10-25  Martin Baulig  <martin@ximian.com>
12258
12259         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
12260         call ConstructedType.Resolve() on it.
12261
12262         * generic.cs (ConstructedType.Resolve): Set `type' on success.
12263
12264 2003-10-25  Martin Baulig  <martin@ximian.com>
12265
12266         * class.cs (TypeContainer.GetClassBases): Changed
12267         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
12268         CS8214 reporting here.
12269         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
12270         instead of a `Type' for our parent.  In case of a recursive
12271         declaration (see tests/gen-23.cs for an example), our parent is a
12272         ConstructedType and it doesn't have its type set.  So, first
12273         create our own TypeBuilder, then call constructed.Resolve() to get
12274         the parent's type and finally TypeBuilder.SetParent() it.
12275
12276         * ecore.cs (TypeExpr.Name): New public virtual property.
12277
12278         * generic.cs
12279         (ConstructedType): We're now a TypeExpr and not just an Expression.
12280         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
12281         arguments here; this is done later.
12282         (ConstructedType.Resolve): New public method to resolve the type
12283         arguments and bind them.
12284
12285 2003-10-21  Martin Baulig  <martin@ximian.com>
12286
12287         * convert.cs: Use `TypeManager.IsValueType' instead of
12288         'type.IsValueType' everywhere.
12289
12290         * typemanager.cs (TypeManager.IsValueType): Return true for type
12291         parameters.  The reason for this is that we need to box a type
12292         parameter when converting it to a reference type.
12293
12294         * cs-parser.jay: Added support for default value expressions.
12295
12296         * generics.cs (DefaultValueExpression): New public class.       
12297
12298 2003-10-17  Martin Baulig  <martin@ximian.com>
12299
12300         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
12301         TypeContainer so we can also use this for Interfaces.
12302         (TypeParameter.Resolve): Likewise.
12303
12304         * interface.cs (Interface.DefineType): Added support for generic
12305         interfaces.
12306
12307         * cs-parser.jay: Added support for generic structs and interfaces.
12308
12309 2003-10-17  Martin Baulig  <martin@ximian.com>
12310
12311         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
12312         call generic methods :-)
12313
12314 2003-10-16  Martin Baulig  <martin@ximian.com>
12315
12316         * cs-parser.jay (namespace_or_type_name): Only create a
12317         GenericMemberAccess if we actually have type arguments.
12318
12319 2003-10-13  Martin Baulig  <martin@ximian.com>
12320
12321         * class.cs (Method.Define): If we're a generic method, call
12322         TypeBuilder.DefineGenericMethod () before resolving
12323         the parameters.
12324         (MethodData): Added .ctor which takes an additional MethodBuilder
12325         argument; this is used for generic methods.
12326         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
12327         we already have a MethodBuilder.
12328
12329 2003-10-10  Martin Baulig  <martin@ximian.com>
12330
12331         * class.cs (Method): Added .ctor which takes a `GenericMethod'
12332         instead of a `DeclSpace'.  This is used for generic methods.
12333
12334         * cs-parser.jay (method_header): Added support for generic
12335         methods; create a `GenericMethod' instance and pass it to the
12336         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
12337         parameters and locals.
12338
12339         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
12340         since we already have the location.  Check whether we're a generic
12341         type declaration or a generic method and create the correct type
12342         parameter.
12343
12344         * generic.cs (TypeParameter.DefineMethod): New public method.
12345         (GenericMethod): New public class; derives from DeclSpace and is
12346         used for generic methods.       
12347
12348 2003-10-09  Martin Baulig  <martin@ximian.com>
12349
12350         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12351         to the .ctor.
12352         (MethodCore.DoDefineParameters): Removed the TypeContainer
12353         argument; use the DeclSpace which was passed to the .ctor instead.
12354         (MethodCore.CheckParameter): Take a DeclSpace instead of a
12355         TypeContainer; we only need a DeclSpace here.
12356
12357 2003-10-09  Martin Baulig  <martin@ximian.com>
12358
12359         * class.cs (MethodData): Added additional `DeclSpace ds' argument
12360         to the .ctor.
12361         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12362         EmitContext's .ctor.    
12363
12364 2003-10-09  Martin Baulig  <martin@ximian.com>
12365
12366         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12367         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12368         AsAccessible(), moved them as well.
12369
12370         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12371
12372 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
12373
12374         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12375         generation for >=, as spotted by Paolo, bug 48679.  
12376         Patch from David Waite.
12377
12378         * cs-tokenizer.cs: Add handling for #pragma.
12379
12380         * cs-parser.jay: Allow for both yield and yield return in the
12381         syntax.  The anti-cobolization of C# fight will go on!
12382
12383         * class.cs (TypeBuilder.DefineType): Catch error condition here
12384         (Parent.DefineType erroring out and returning null).
12385
12386         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12387         coping with enumerations variables, we were mistakenly processing
12388         them as a regular value type instead of built-in types.  Fixes the
12389         bug #48063
12390
12391         * typemanager.cs (IsBuiltinOrEnum): New method.
12392
12393 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
12394
12395         * cs-parser.jay: Upgrade: yield now needs the return clause.
12396
12397 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12398
12399         * cs-parser.jay : Renamed yyName to yyNames related to jay.
12400
12401 2003-09-29  Martin Baulig  <martin@ximian.com>
12402
12403         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
12404         inflated generic methods.
12405
12406         * generics.cs (ConstructedType): Distinguish between open and
12407         closed constructed types; correctly resolve the arguments.
12408
12409 2003-09-22  Martin Baulig  <martin@ximian.com>
12410
12411         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
12412         all type arguments meet their constraints.
12413
12414 2003-09-19  Martin Baulig  <martin@ximian.com>
12415
12416         * decl.cs (MemberCache.SetupCacheForInterface): Take a
12417         `MemberCache parent' argument.  Normally, an interface doesn't
12418         have a parent type except System.Object, but we use this in gmcs
12419         for generic type parameters.
12420
12421 2003-09-18  Martin Baulig  <martin@ximian.com>
12422
12423         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12424         on `type.IsInterface'; don't check whether the type has a parent
12425         to determine whether it's an interface.
12426
12427 2003-09-17  Martin Baulig  <martin@ximian.com>
12428
12429         * generic.cs (ConstructedType.ToString): Always use `name' as the
12430         type name.
12431
12432 2003-09-15  Martin Baulig  <martin@ximian.com>
12433
12434         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
12435
12436         * generic.cs (Constraints.Resolve): New public method; this is
12437         called to resolve the constraint types and to check whether all
12438         the constraints are correct.
12439         (Constraints.Types): New public property.
12440         (TypeParameter.Resolve): New public method; resolves all the
12441         type's constraints.
12442
12443         * class.cs (TypeContainer.DefineType): Call
12444         TypeParameter.Resolve() before actually defining the type.
12445
12446 2003-09-15  Martin Baulig  <martin@ximian.com>
12447
12448         * class.cs (TypeContainer.DefineType): Added an error flag to
12449         avoid reporting duplicate CS0146's ("class definition is
12450         circular.").
12451
12452         * driver.cs (Driver.MainDriver): Abort if
12453         RootContext.ResolveTree() reported any errors.
12454
12455 2003-09-07  Martin Baulig  <martin@ximian.com>
12456
12457         * report.cs (Error, Warning): Added overloaded versions which take
12458         a `params object[] args' and call String.Format().
12459
12460 2003-09-07  Martin Baulig  <martin@ximian.com>
12461
12462         * decl.cs (DeclSpace..ctor): Don't call
12463         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12464         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
12465         (DeclSpace.RecordDecl): New method.
12466
12467         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12468
12469 2003-09-02  Ravi Pratap  <ravi@ximian.com>
12470
12471         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12472         value attributes to be applied to ParameterBuilders.
12473
12474         * class.cs (MethodCore.LabelParameters): Make static and more
12475         generic so that it can be used from other places - like interface
12476         methods, for instance.
12477
12478         * interface.cs (Interface.Emit): Call LabelParameters before
12479         emitting attributes on the InterfaceMethod.
12480
12481 2003-09-07  Martin Baulig  <martin@ximian.com>
12482
12483         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
12484         if the number of type parameters doesn't match.
12485
12486 2003-09-04  Martin Baulig  <martin@ximian.com>
12487
12488         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
12489         for arrays of generic type params (ie. `!0[]').
12490
12491 2003-09-04  Martin Baulig  <martin@ximian.com>
12492
12493         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
12494         for the moment.
12495
12496 2003-09-04  Martin Baulig  <martin@ximian.com>
12497
12498         * decl.cs (DeclSpace.LookupGeneric): New method.
12499         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
12500         moment.
12501
12502         * generic.cs (TypeParameterExpr): Take a TypeParameter as
12503         argument, not just a string.
12504         (TypeParameter.Define): New public method; this is called to
12505         actually define the generic parameter; after this, you can use the
12506         new `Type' property to get the type.
12507
12508 2003-09-04  Martin Baulig  <martin@ximian.com>
12509
12510         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
12511         is now an ArrayList; initialize the result of the `TypeParameters'
12512         property here.
12513         (DeclSpace.GetGenericData): Removed.
12514         (DeclSpace.LookupGeneric): Temporarily removed; we need to
12515         implement this in a different way.
12516         (DeclSpace.GetTypeParameters): Removed; there's now a
12517         `TypeParameters' property.
12518         (DeclSpace.TypeParameters): New public property.
12519
12520         * generic.cs (Constraints): Make this class public.
12521         (TypeParameter): New public class.
12522
12523 2003-09-04  Martin Baulig  <martin@ximian.com>
12524
12525         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
12526         generic parameters.
12527
12528         * class.cs (TypeContainer.DefineType): Call
12529         TypeBuilder.DefineGenericParameter () on all generic parameters if
12530         this is a generic type.
12531
12532 2003-08-28  Martin Baulig  <martin@ximian.com>
12533
12534         * sample-stack.il: Compile this with ilasm: "ilasm /dll
12535         sample-stack.il".
12536
12537         * sample-hello.cs: Compile this with gmcs: "gmcs
12538         /r:sample-stack.dll sample-hello.cs".
12539
12540 2003-08-28  Martin Baulig  <martin@ximian.com>
12541
12542         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
12543         the parameters to the generic type.
12544
12545 2003-08-28  Martin Baulig  <martin@ximian.com>
12546
12547         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
12548
12549 2003-08-28  Martin Baulig  <martin@ximian.com>
12550
12551         * cs-parser.jay (opt_type_argument_list): Use
12552         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
12553         (primary_expression): Replace `qualified_identifier' with `type_name'.
12554         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
12555
12556         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
12557         parser to check whether it is syntactically a type parameter list;
12558         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
12559         this case.
12560
12561 2003-08-26  Martin Baulig  <martin@ximian.com>
12562
12563         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12564         resolving aliases; fixes #47927.
12565
12566 2003-08-26  Martin Baulig  <martin@ximian.com>
12567
12568         * statement.cs (Using.DoResolve): This is internally emitting a
12569         try/finally clause, so we need to set ec.NeedExplicitReturn if we
12570         do not always return.  Fixes #47681.
12571
12572 2003-08-26  Martin Baulig  <martin@ximian.com>
12573
12574         * decl.cs (MemberCore): Moved WarningNotHiding(),
12575         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
12576         into MemberBase.
12577         (AdditionResult): Make this nested in DeclSpace.
12578         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
12579         argument; call NamespaceEntry.Define() unless we're nested in a
12580         class or struct.
12581
12582         * namespace.cs (Namespace.DefineName): New public function.  This
12583         is called from DeclSpace's .ctor to add 
12584         (Namespace.Lookup): Include DeclSpaces in the lookup.
12585
12586         * class.cs (Operator): Derive from MemberBase, not MemberCore.
12587
12588         * const.cs (Const): Derive from MemberBase, not MemberCore.     
12589
12590 2003-08-25  Martin Baulig  <martin@ximian.com>
12591
12592         * convert.cs (Convert.ExplicitReferenceConversion): When
12593         converting from an interface type to a class, unbox if the target
12594         type is a struct type.  Fixes #47822.
12595
12596 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12597
12598         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
12599         #47854.
12600
12601 2003-08-22  Martin Baulig  <martin@ximian.com>
12602
12603         * class.cs (TypeManager.DefineType): When defining a nested type,
12604         call DefineType() on our parent; fixes #47801.
12605
12606 2003-08-22  Martin Baulig  <martin@ximian.com>
12607
12608         * class.cs (MethodData.Define): While checking if a method is an
12609         interface implementation, improve the test a bit more to fix #47654.
12610
12611 2003-08-22  Martin Baulig  <martin@ximian.com>
12612
12613         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
12614         correctly; fixes #47722.
12615
12616 2003-08-22  Martin Baulig  <martin@ximian.com>
12617
12618         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
12619         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
12620
12621         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
12622
12623 2003-08-22  Martin Baulig  <martin@ximian.com>
12624
12625         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
12626         can only be assigned in static constructors.  Fixes #47161.
12627
12628 2003-08-22  Martin Baulig  <martin@ximian.com>
12629
12630         Rewrote and improved the flow analysis code.
12631
12632         * flowbranching.cs (FlowBranching): Make this class abstract.
12633         (FlowBranching.CreateBranching): New static function to create a
12634         new flow branching.
12635         (FlowBranchingBlock, FlowBranchingException): New classes.
12636         (FlowBranching.UsageVector.Type): New public readonly field.
12637         (FlowBranching.UsageVector.Breaks): Removed the setter.
12638         (FlowBranching.UsageVector.Returns): Removed the setter.
12639         (FlowBranching.UsageVector): Added Break(), Return(),
12640         NeverReachable() and Throw() methods to modify the reachability.
12641         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
12642         done by FlowBranching.Merge().
12643         (FlowBranching.UsageVector.MergeChild): New method; merges the
12644         merge result into the current vector.
12645         (FlowBranching.Merge): New abstract method to merge a branching.
12646
12647 2003-08-12  Martin Baulig  <martin@ximian.com>
12648
12649         * expression.cs (Indirection.CacheTemporaries): Create the
12650         LocalTemporary with the pointer type, not its element type.
12651
12652 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
12653
12654         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
12655         token was a keyword or not.
12656
12657         Add `error' options where an IDENTIFIER was expected;  Provide
12658         CheckToken and CheckIdentifierToken convenience error reporting
12659         functions. 
12660
12661         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
12662
12663         * decl.cs: Rename `NamespaceEntry Namespace' public field into
12664         NameSpaceEntry NameSpaceEntry.
12665
12666         (LookupInterfaceOrClass): Avoid creating a full qualified name
12667         from namespace and name: avoid doing lookups when we know the
12668         namespace is non-existant.   Use new Tree.LookupByNamespace which
12669         looks up DeclSpaces based on their namespace, name pair.
12670
12671         * driver.cs: Provide a new `parser verbose' to display the
12672         exception thrown during parsing.  This is turned off by default
12673         now, so the output of a failure from mcs is more graceful.
12674
12675         * namespace.cs: Track all the namespaces defined in a hashtable
12676         for quick lookup.
12677
12678         (IsNamespace): New method
12679
12680 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
12681
12682         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
12683         we know that we need to concatenate (full typename can never be
12684         null). 
12685
12686         * class.cs: ditto.
12687
12688         * statement.cs: Use a bitfield;  Do not initialize to null things
12689         which are done by the constructor by default.
12690
12691         * cs-parser.jay: bug fix, parameter was 4, not 3.
12692
12693         * expression.cs: Just use the property;
12694
12695         * statement.cs: No need for GetVariableInfo method.
12696
12697 2003-08-08  Martin Baulig  <martin@ximian.com>
12698
12699         * flowanalysis.cs (FlowReturns): This is now nested in the
12700         `FlowBranching' class.
12701         (MyBitVector): Moved this here from statement.cs.
12702         (FlowBranching.SiblingType): New enum type.
12703         (FlowBranching.CreateSibling): Added `SiblingType' argument.
12704
12705 2003-08-07  Martin Baulig  <martin@ximian.com>
12706
12707         * flowanalysis.cs (FlowBranchingType): This is now nested in the
12708         `FlowBranching' class and called `BranchingType'.
12709
12710 2003-08-07  Martin Baulig  <martin@ximian.com>
12711
12712         * flowanalysis.cs: Moved all the control flow analysis code into
12713         its own file.
12714
12715 2003-08-07  Martin Baulig  <martin@ximian.com>
12716
12717         * assign.cs (Assign.DoResolve): `target' must either be an
12718         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
12719         #37319.
12720
12721 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
12722
12723         * expression.cs (BinaryMethod): This kind of expression is created by the
12724         Binary class if it determines that the operator has to be handled
12725         by a method.
12726
12727         (BinaryDelegate): This kind of expression is created if we are
12728         dealing with a + or - operator on delegates.
12729
12730         (Binary): remove method, argumetns, and DelegateOperator: when
12731         dealing with methods, 
12732
12733         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
12734
12735         * statement.cs (Block): use bitfields for the three extra booleans
12736         we had in use.   Remove unused topblock parameter.
12737
12738         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
12739
12740         * assign.cs: Drop extra unneeded tests.
12741
12742 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
12743
12744         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
12745
12746         * statement.cs (Foreach): Use VariableStorage instead of
12747         LocalBuilders.   
12748
12749         * codegen.cs (VariableStorage): New class used by clients that
12750         require a variable stored: locals or fields for variables that
12751         need to live across yield.
12752
12753         Maybe provide a convenience api for EmitThis+EmitLoad?
12754
12755         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
12756         these bad boys.
12757
12758 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
12759
12760         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
12761         RemapParameterLValue): New methods that are used to turn a
12762         precomputed FieldInfo into an expression like this:
12763
12764                 instance.FieldInfo
12765
12766         The idea is to use this instead of making LocalVariableReference
12767         have more than one meaning.
12768
12769         * cs-parser.jay: Add error production to BASE.
12770
12771         * ecore.cs: Deal with TypeManager.GetField returning null, which
12772         is now a valid return value.
12773
12774         (FieldExprNoAddress): New expression for Fields whose address can
12775         not be taken.
12776
12777         * expression.cs (LocalVariableReference): During the resolve
12778         phases, create new expressions if we are in a remapping context.
12779         Remove code that dealt with remapping here.
12780
12781         (ParameterReference): same.
12782
12783         (ProxyInstance): New expression, like the `This' expression, but
12784         it is born fully resolved.  We know what we are doing, so remove
12785         the errors that are targeted to user-provided uses of `this'.
12786
12787         * statement.cs (Foreach): our variable is now stored as an
12788         Expression;  During resolution, follow the protocol, dont just
12789         assume it will return this.
12790
12791 2003-08-06  Martin Baulig  <martin@ximian.com>
12792
12793         * support.cs (SeekableStreamReader.cs): New public class.
12794
12795         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
12796         SeekableStreamReader instead of the normal StreamReader.
12797
12798 2003-08-04  Martin Baulig  <martin@ximian.com>
12799
12800         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
12801         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
12802         deambiguate casts and delegate invocations.
12803         (parenthesized_expression): Use the new tokens to ensure this is
12804         not a cast of method invocation.
12805
12806         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
12807         when reading a `)' and Deambiguate_CloseParens () was previously
12808         called.
12809
12810         * expression.cs (ParenthesizedExpression): New class.  This is
12811         just used for the CS0075 test.
12812         (Binary.DoResolve): Check for CS0075.   
12813
12814 2003-07-29  Ravi Pratap  <ravi@ximian.com>
12815
12816         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
12817         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
12818         reference comparison.
12819
12820         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
12821         examine the ReturnType for equality - this is necessary in the
12822         cases of implicit and explicit operators whose signature also
12823         includes the return type.
12824
12825 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
12826
12827         * namespace.cs: Cache the result of the namespace computation,
12828         instead of computing it every time.
12829
12830 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
12831
12832         * decl.cs: Use a global arraylist that we reuse over invocations
12833         to avoid excesive memory consumption.  Reduces memory usage on an
12834         mcs compile by one meg (45 average).
12835
12836         * typemanager.cs (LookupTypeReflection): In .NET pointers are
12837         private, work around that.
12838
12839 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
12840
12841         * literal.cs (IntLiteral): Define Zero and One static literals. 
12842
12843         * cs-parser.jay (integer_literal): use static literals to reduce
12844         memory usage for the most used literals (0, 1 and -1).  211kb
12845         reduced in memory usage.
12846
12847         Replace all calls to `new ArrayList' with `new
12848         ArrayList(4)' which is a good average number for most allocations,
12849         and also requires only 16 bytes of memory for its buffer by
12850         default. 
12851
12852         This reduced MCS memory usage in seven megabytes for the RSS after
12853         bootstrapping.
12854
12855 2003-07-28  Ravi Pratap  <ravi@ximian.com>
12856
12857         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
12858         handle params methods the correct way by forming only one
12859         applicable set with params and normal methods in them. Earlier we
12860         were looking at params methods only if we found no normal methods
12861         which was not the correct thing to do.
12862
12863         (Invocation.BetterFunction): Take separate arguments indicating
12864         when candidate and the best method are params methods in their
12865         expanded form.
12866
12867         This fixes bugs #43367 and #46199.
12868
12869         * attribute.cs: Documentation updates.
12870
12871         (CheckAttribute): Rename to CheckAttributeTarget.
12872         (GetValidPlaces): Rename to GetValidTargets.
12873
12874         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
12875         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
12876
12877         Fixes bug #44468.
12878
12879 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
12880
12881         * codegen.cs: Compute IsGeneric correctly.
12882
12883         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
12884         resolution. 
12885
12886         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
12887         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
12888         regressions, and I was chasing more bugs than I required.
12889
12890         * interface.cs: Use expressions for base type names (like classes
12891         and structs have been doing for a while now), and resolve that.
12892         This patch should probably go into head as well.
12893
12894         This makes it one less user of FindType.
12895
12896 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
12897
12898         This compiler can not self host currently.  Need to fix that.
12899         
12900         * Makefile: compile to `gmcs.exe'
12901
12902         * driver.cs: Turn on v2 by default on gmcs.
12903
12904         * generic.cs (ConstructedType): Does no longer take a container
12905         type argument;  That will be taken care of later.
12906
12907         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
12908         Use SimpleName to resolve for now, so we can continue the work on
12909         the parser, until we get Type.GetType that understands generics.
12910
12911         (ConstructedType.ToString): Implement
12912
12913         (TypeArguments.Resolve): Resolve the child expressions as types. 
12914         
12915         * cs-parser.jay: Rename interface_constraints to
12916         type_parameter_constraints
12917
12918         (namespace_or_type_name): Only use constructed types for the basic
12919         construction, we will deal with identifier<...> later.
12920
12921         (type/type_name): No longer call DecomposeQI, as
12922         namespace_or_type_name is always decoded now.
12923         
12924 2003-07-22  Ravi Pratap  <ravi@ximian.com>
12925
12926         * expression.cs (Invocation.OverloadResolve): Follow the spec more
12927         closely: we eliminate methods in base types when we have an
12928         applicable method in a top-level type.
12929
12930         Please see section 14.5.5.1 for an exact description of what goes
12931         on. 
12932
12933         This fixes bug #45127 and a host of other related to corlib compilation.
12934
12935         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
12936         array is the method corresponding to the top-level type (this is
12937         because of the changes made to icall.c) so we change this
12938         accordingly.
12939
12940         (MethodGroupExpr.Name): This too.
12941
12942         * typemanager.cs (GetElementType): New method which does the right
12943         thing when compiling corlib. 
12944
12945         * everywhere: Make use of the above in the relevant places.
12946
12947 2003-07-22  Martin Baulig  <martin@ximian.com>
12948
12949         * cs-parser.jay (invocation_expression): Moved
12950         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
12951         `cast_expression', but create a InvocationOrCast which later
12952         resolves to either an Invocation or a Cast.
12953
12954         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
12955         method; call this before EmitStatement() to make sure that this
12956         expression can be used as a statement.
12957
12958         * expression.cs (InvocationOrCast): New class; resolves to either
12959         an Invocation or a Cast.
12960
12961         * statement.cs (StatementExpression): Call ResolveStatement() on
12962         the ExpressionStatement before emitting it.
12963
12964 2003-07-21  Martin Baulig  <martin@ximian.com>
12965
12966         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
12967         `ref' and `out' attributes match; fixes #46220.
12968         (MemberAccess.ResolveMemberAccess): You can't reference a type
12969         through an expression; fixes #33180.
12970         (Indexers.GetIndexersForType): Don't return the indexers from
12971         interfaces the class implements; fixes #46502.
12972
12973 2003-07-21  Martin Baulig  <martin@ximian.com>
12974
12975         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
12976         CS0661 checks; fixes bug #30442.
12977
12978 2003-07-21  Martin Baulig  <martin@ximian.com>
12979
12980         * decl.cs (AdditionResult): Added `Error'.
12981
12982         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
12983
12984         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
12985         cs0031.cs actually work.
12986
12987  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
12988  
12989         * cs-parser.jay (namespace_name): do not use
12990         namespace_or_type_name, use qualified_identifier, because
12991         namespace_or_type_name will soon return a composed expression
12992         instead of a string.
12993  
12994         (namespace_or_type_name): Instead of returning a string, now this
12995         production returns an expression.
12996  
12997         * codegen.cs (EmitContext): Setup IsGeneric property based on
12998         whether our DeclSpace is generic, our the method is generic.
12999  
13000         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
13001         the method is generic.
13002  
13003         * cs-parser.jay (type_arguments, opt_type_argument_list,
13004         type_parameters, type_parameter_list, opt_type_parameter_list,
13005         type_parameter,, opt_type_parameter_constraints_clauses,
13006         type_parameter_constraints_clauses,
13007         type_parameter_constraint_clause, type_parameter_constraint,
13008         interface_constraints): Add new production
13009  
13010         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
13011         DeclSpace is generic or not.
13012  
13013         (DeclSpace.SetParameterInfo): New routine, used to set the
13014         parameter info for a type.
13015  
13016         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
13017         returns a GenericTypeExpr
13018  
13019         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
13020         generic, lookup the generic argument.
13021  
13022         * attribute.cs: Do not allow TypeParameterExpressions in
13023         Attributes.
13024  
13025         * class.cs: Do not allow the Main method to be defined in a
13026         Generic container.
13027  
13028         * expression.cs (SizeOf): Do not allow generic types to be used as
13029         arguments to sizeof.
13030  
13031         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
13032         it: whether a type is generic or not.  Only works for types we are
13033         currently building for now.
13034         
13035 2003-07-20  Martin Baulig  <martin@ximian.com>
13036
13037         * namespace.cs: Fixed that bug which caused a crash when compiling
13038         the debugger's GUI.
13039
13040 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
13041
13042         * typemanager.cs (LookupTypeReflection): Never expose types which
13043         are NotPublic, NestedPrivate, NestedAssembly, or
13044         NestedFamANDAssem.  We used to return these, and later do a check
13045         that would report a meaningful error, but the problem is that we
13046         would not get the real match, if there was a name override.
13047
13048 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
13049
13050         * namespace.cs (Namespace, Name): Do not compute the namespace
13051         name dynamically, compute it in the constructor.  This reduced
13052         memory usage by 1697 KB.
13053
13054         * driver.cs: Use --pause to pause at the end.
13055
13056 2003-07-17  Peter Williams  <peter@newton.cx>
13057
13058         * Makefile: Change the name of the test target so that it doesn't
13059         conflict with the recursive test target.
13060
13061 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
13062
13063         * expression.cs (LocalVariableReference.Emit, EmitAssign,
13064         AddressOf): Do not use EmitThis, that was wrong, use the actual
13065         this pointer.
13066
13067 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
13068
13069         * class.cs (MethodData.Define): While checking if a method is an
13070         interface implementation, improve the test: If we are not public
13071         (use new test here: use the computed MethodAttributes directly,
13072         instead of the parsed modifier flags) check if the `implementing'
13073         method comes from an interface or not.
13074
13075         * pending.cs (VerifyPendingMethods): Slightly better error
13076         message.
13077
13078         * makefile: add test target that does the mcs bootstrap.
13079
13080 2003-07-16  Ravi Pratap  <ravi@ximian.com>
13081
13082         * interface.cs (Define): Do nothing here since there are no
13083         members to populate etc. Move the attribute emission out of here
13084         since this was just totally the wrong place to put it. Attribute
13085         application happens during the 'Emit' phase, not in the 'Define'
13086         phase.
13087
13088         (Emit): Add this method and move the attribute emission here
13089
13090         * rootcontext.cs (EmitCode): Call the Emit method on interface
13091         types too.
13092
13093 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13094
13095         * expression.cs (OverloadResolve): Report error only if Location
13096         is not 'Null' which means that there was a probe going on.
13097
13098 2003-07-14  Martin Baulig  <martin@ximian.com>
13099
13100         * expression.cs (ConditionalLogicalOperator): New public class to
13101         implement user defined conditional logical operators.
13102         This is section 14.11.2 in the spec and bug #40505.
13103
13104 2003-07-14  Martin Baulig  <martin@ximian.com>
13105
13106         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
13107
13108 2003-07-14  Martin Baulig  <martin@ximian.com>
13109
13110         * codegen.cs (EmitContext.InFixedInitializer): New public field.
13111
13112         * ecore.cs (IVariable.VerifyFixed): New interface method.
13113
13114         * expression.cs (Unary.ResolveOperator): When resolving the `&'
13115         operator, check whether the variable is actually fixed.  Fixes bug
13116         #36055.  Set a variable definitely assigned when taking its
13117         address as required by the spec.
13118
13119         * statement.cs (LocalInfo.IsFixed): New field.
13120         (LocalInfo.MakePinned): Set `IsFixed' to true.
13121
13122 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13123
13124         * attribute.cs (Attribute.Resolve): While doing a Member lookup
13125         for .ctors, ensure that we only ask for members declared in the
13126         attribute type (BindingFlags.DeclaredOnly).
13127
13128         Fixes bug #43632.
13129
13130         * expression.cs (Error_WrongNumArguments): Report error 1501
13131         correctly the way CSC does.
13132
13133 2003-07-13  Martin Baulig  <martin@ximian.com>
13134
13135         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
13136         lookup on the fully qualified name, to make things like "X.X" work
13137         where "X.X" is a fully qualified type name, but we also have a
13138         namespace "X" in the using list.  Fixes #41975.
13139
13140 2003-07-13  Martin Baulig  <martin@ximian.com>
13141
13142         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
13143         function. If we're a CompoundAssign, we need to create an embedded
13144         CompoundAssign, not an embedded Assign.
13145         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
13146         Fixes #45854.
13147
13148 2003-07-13  Martin Baulig  <martin@ximian.com>
13149
13150         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
13151         work to fix bug #46088.
13152
13153 2003-07-13  Ravi Pratap <ravi@ximian.com>
13154
13155         * class.cs (Operator.Emit): Do not emit attributes here - it is
13156         taken care of by the Method class that we delegate too. This takes
13157         care of bug #45876.
13158
13159 2003-07-10  Martin Baulig  <martin@ximian.com>
13160
13161         * expression.cs (TypeOfVoid): New class.
13162         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
13163
13164 2003-07-10  Martin Baulig  <martin@ximian.com>
13165
13166         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
13167         bug #35957.
13168
13169 2003-07-10  Martin Baulig  <martin@ximian.com>
13170
13171         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
13172         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
13173
13174         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
13175
13176         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
13177
13178 2003-07-10  Martin Baulig  <martin@ximian.com>
13179
13180         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
13181         of decimal.  Fixes #42850.
13182
13183         NOTE: I also fixed the created byte blob, but this doesn't work on
13184         the MS runtime and csc never produces any byte blobs for decimal
13185         arrays.
13186
13187 2003-07-10  Martin Baulig  <martin@ximian.com>
13188
13189         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
13190         structs; fixes #32068.
13191         (Block.AddChildVariableNames): Fixed #44302.
13192
13193 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13194
13195         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
13196
13197 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13198
13199         * attribute.cs: And this test is onger needed.
13200
13201 2003-07-08  Martin Baulig  <martin@ximian.com>
13202
13203         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
13204         inaccessible types.  Fixes #36313.
13205
13206         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
13207
13208         * namespace.cs (NamespaceEntry): Create implicit entries for all
13209         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
13210         implicit entries for N1.N2 and N1.
13211
13212 2003-07-08  Martin Baulig  <martin@ximian.com>
13213
13214         Rewrote the handling of namespaces to fix a lot of the issues
13215         wrt. `using' aliases etc.
13216
13217         * namespace.cs (Namespace): Splitted this class into a
13218         per-assembly `Namespace' and a per-file `NamespaceEntry'.
13219
13220         * typemanager.cs (TypeManager.IsNamespace): Removed.
13221         (TypeManager.ComputeNamespaces): Only compute namespaces from
13222         loaded assemblies here, not the namespaces from the assembly we're
13223         currently compiling.
13224
13225 2003-07-08  Martin Baulig  <martin@ximian.com>
13226
13227         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
13228
13229 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13230
13231         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
13232         already fixed it.  
13233
13234         I thought about the memory savings here, but LookupTypeReflection
13235         is used under already very constrained scenarios.  Compiling
13236         corlib or mcs only exposes one hit, so it would not really reduce
13237         any memory consumption.
13238
13239 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13240
13241         * typemanager.cs: fixes bug #45889 by only adding public types from
13242         other assemblies to the list of known types.
13243
13244 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13245
13246         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
13247         on the type we resolved.
13248
13249 2003-07-05  Martin Baulig  <martin@ximian.com>
13250
13251         * pending.cs (PendingImplementation.ParentImplements): Don't
13252         create the proxy if the parent is abstract.
13253
13254         * class.cs (TypeContainer.DefineIndexers): Process explicit
13255         interface implementations first.  Fixes #37714.
13256
13257 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
13258
13259         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
13260         defined recursively;  but since we modify the input parameters
13261         (left is set to `this' temporarily), we reset this value if the
13262         left_is_explicit is false, which gives the original semantics to
13263         the code.  
13264
13265         * literal.cs (NullPointer): new class used to represent a null
13266         literal in a pointer context.
13267
13268         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
13269         type is a pointer, use a NullPointer object instead of a
13270         NullLiteral.   Closes 43687
13271
13272         (ExplicitConversion): Convert pointer values using
13273         the conv opcode to the proper type.
13274
13275         * ecore.cs (New): change ValueTypeVariable property into a method,
13276         that returns whether the valuetype is suitable for being used.
13277
13278         * expression.cs (Binary.DoNumericPromotions): Only return if we
13279         the int constant was a valid uint, and we can return both left and
13280         right as uints.  If not, we continue processing, to trigger the
13281         type conversion.  This fixes 39018.
13282
13283         * statement.cs (Block.EmitMeta): During constant resolution, set
13284         the CurrentBlock property on the emitcontext, so that we resolve
13285         constants propertly.
13286
13287 2003-07-02  Martin Baulig  <martin@ximian.com>
13288
13289         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
13290         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
13291
13292         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13293         than emitting it here.
13294
13295         * statement.cs: Fixed some more flow analysis bugs.
13296
13297 2003-07-02  Martin Baulig  <martin@ximian.com>
13298
13299         * class.cs (MethodData.Define): When implementing interface
13300         methods, set Final unless we're Virtual.
13301
13302         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
13303         check work for interface methods.
13304
13305 2003-07-01  Martin Baulig  <martin@ximian.com>
13306
13307         * ecore.cs (EmitContext.This): Replaced this property with a
13308         GetThis() method which takes a Location argument.  This ensures
13309         that we get the correct error location for a CS0188.
13310
13311 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
13312
13313         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13314         ImplicitStandardConversion.
13315
13316         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13317
13318 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
13319
13320         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13321         optimization.
13322
13323 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
13324
13325         * class.cs (Constructor.Define): Turn off initlocals for unsafe
13326         constructors.
13327
13328         (MethodData.Define): Turn off initlocals for unsafe methods.
13329
13330 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
13331
13332         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13333         complete;  Fixes #37521.
13334
13335         * delegate.cs: Use Modifiers.TypeAttr to compute the
13336         TypeAttributes, instead of rolling our own.  This makes the flags
13337         correct for the delegates.
13338
13339 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
13340
13341         * class.cs (Constructor.Define): Set the private flag for static
13342         constructors as well.
13343
13344         * cs-parser.jay (statement_expression): Set the return value to
13345         null, to avoid a crash when we catch an error.
13346
13347 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
13348
13349         * cs-parser.jay: Applied patch from Jackson that adds support for
13350         extern and unsafe modifiers to destructor declarations.
13351
13352         * expression.cs: Report error 21 if the user is trying to index a
13353         System.Array.
13354
13355         * driver.cs: Add an error message, suggested by the bug report.
13356
13357         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13358         if we do not have a ": this ()" constructor initializer.  Fixes 45149
13359
13360 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
13361
13362         * namespace.cs: Add some information to reduce FAQs.
13363
13364 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
13365
13366         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13367         underlying enumeration types.  Fixes #43915.
13368
13369         * expression.cs: Treat ushort/short as legal values to be used in
13370         bitwise operations.
13371
13372 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13373
13374         * delegate.cs: transfer custom attributes for paramenters from
13375         the delegate declaration to Invoke and BeginInvoke.
13376
13377 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13378
13379         * attribute.cs: handle custom marshalers and emit marshal info
13380         for fields, too.
13381
13382 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
13383
13384         * makefile.gnu: Added anonymous.cs to the compiler sources.
13385
13386 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
13387
13388         * iterators.cs: Change the name of the proxy class to include two
13389         underscores.
13390
13391         * cs-parser.jay: Update grammar to include anonymous methods.
13392
13393         * anonymous.cs: new file.
13394
13395 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
13396
13397         * class.cs (Field.Define): Add missing test for pointers and
13398         safety. 
13399
13400 2003-05-27  Ravi Pratap  <ravi@ximian.com>
13401
13402         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13403         we use the stobj opcode.
13404
13405         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13406         since it wasn't the correct fix. 
13407
13408         It still is puzzling that we are required to use stobj for IntPtr
13409         which seems to be a ValueType.
13410
13411 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
13412
13413         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13414         during regular simple name resolution.   Now, the trick is that
13415         instead of returning for processing the simplename, we do a
13416         TypeManager.LookupType (ie, a rooted lookup as opposed to a
13417         contextual lookup type).   If a match is found, return that, if
13418         not, return for further composition.
13419
13420         This fixes long-standing 30485.
13421
13422         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13423         using the address to initialize an object, do an Stobj instead of
13424         using the regular Stelem.
13425
13426         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13427         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13428         Because if we are a BaseIndexerAccess that value will be true.
13429         Fixes 43643.
13430
13431         * statement.cs (GotoCase.Resolve): Return after reporting an
13432         error, do not attempt to continue. 
13433
13434         * expression.cs (PointerArithmetic.Emit): If our operand is a
13435         long, convert our constants to match the operand before
13436         multiplying.  Convert to I type before adding.   Fixes 43670.
13437
13438 2003-05-14  Ravi Pratap  <ravi@ximian.com>
13439
13440         * enum.cs (ImplicitConversionExists) : Rename to
13441         ImplicitEnumConversionExists to remove ambiguity. 
13442
13443         * ecore.cs (NullCast): New type of cast expression class which
13444         basically is very similar to EmptyCast with the difference being
13445         it still is a constant since it is used only to cast a null to
13446         something else
13447         (eg. (string) null)
13448
13449         * convert.cs (ImplicitReferenceConversion): When casting a null
13450         literal, we return a NullCast.
13451
13452         * literal.cs (NullLiteralTyped): Remove - I don't see why this
13453         should be around anymore.
13454
13455         The renaming (reported was slightly wrong). Corrections:
13456
13457         ConvertImplicitStandard -> ImplicitConversionStandard
13458         ConvertExplicitStandard -> ExplicitConversionStandard
13459
13460         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13461         before passing them in !
13462
13463         * convert.cs (ImplicitConversionStandard): When comparing for
13464         equal expr and target types, ensure that expr is not a
13465         NullLiteral.
13466
13467         In general, we must not be checking (expr_type ==
13468         target_type) in the top level conversion methods
13469         (ImplicitConversion, ExplicitConversion etc). This checking is
13470         done in the methods that they delegate to.
13471
13472 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
13473
13474         * convert.cs: Move Error_CannotConvertType,
13475         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13476         ImplicitNumericConversion, ImplicitConversionExists,
13477         ImplicitUserConversionExists, StandardConversionExists,
13478         FindMostEncompassedType, FindMostSpecificSource,
13479         FindMostSpecificTarget, ImplicitUserConversion,
13480         ExplicitUserConversion, GetConversionOperators,
13481         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13482         TryImplicitIntConversion, Error_CannotConvertImplicit,
13483         ConvertImplicitRequired, ConvertNumericExplicit,
13484         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13485         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13486         its own file.
13487
13488         Perform the following renames:
13489
13490         StandardConversionExists -> ImplicitStandardConversionExists
13491         ConvertImplicit -> ImplicitConversion
13492         ConvertImplicitStandard -> ImplicitStandardConversion
13493         TryImplicitIntConversion -> ImplicitIntConversion
13494         ConvertImplicitRequired -> ImplicitConversionRequired
13495         ConvertNumericExplicit -> ExplicitNumericConversion
13496         ConvertReferenceExplicit -> ExplicitReferenceConversion
13497         ConvertExplicit -> ExplicitConversion
13498         ConvertExplicitStandard -> ExplicitStandardConversion
13499
13500 2003-05-19  Martin Baulig  <martin@ximian.com>
13501
13502         * statement.cs (TypeInfo.StructInfo): Made this type protected.
13503         (TypeInfo): Added support for structs having structs as fields.
13504
13505         * ecore.cs (FieldExpr): Implement IVariable.
13506         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13507         VariableInfo for the field.
13508
13509 2003-05-18  Martin Baulig  <martin@ximian.com>
13510
13511         * expression.cs (This.DoResolve): Report a CS0027 if we're
13512         emitting a field initializer.
13513
13514 2003-05-18  Martin Baulig  <martin@ximian.com>
13515
13516         * expression.cs (This.ResolveBase): New public function.
13517         (This.DoResolve): Check for CS0188.
13518
13519         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13520         This.Resolve().
13521
13522         * ecore.cs (MethodGroupExpr.DoResolve): Set the
13523         `instance_expression' to null if we don't have any non-static
13524         methods.
13525
13526 2003-05-18  Martin Baulig  <martin@ximian.com>
13527
13528         Reworked the way how local variables and parameters are handled by
13529         the flow analysis code.
13530
13531         * statement.cs (TypeInfo, VariableMap): New public classes.
13532         (VariableInfo): New public class.  This is now responsible for
13533         checking whether a variable has been assigned.  It is used for
13534         parameters and local variables.
13535         (Block.EmitMeta): Take the InternalParameters as argument; compute
13536         the layout of the flow vectors here.
13537         (Block.LocalMap, Block.ParameterMap): New public properties.
13538         (FlowBranching): The .ctor doesn't get the InternalParameters
13539         anymore since Block.EmitMeta() now computes the layout of the flow
13540         vector.
13541         (MyStructInfo): This class is now known as `StructInfo' and nested
13542         in `TypeInfo'; we don't access this directly anymore.
13543
13544         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13545         property and removed IsAssigned(), IsFieldAssigned(),
13546         SetAssigned() and SetFieldAssigned(); we now call them on the
13547         VariableInfo so we don't need to duplicate this code everywhere.
13548
13549         * expression.cs (ParameterReference): Added `Block block' argument
13550         to the .ctor.
13551         (LocalVariableReference, ParameterReference, This): The new
13552         VariableInfo class is now responsible for all the definite
13553         assignment stuff.
13554
13555         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13556         IsParameterAssigned, SetParameterAssigned): Removed.
13557
13558 2003-05-18  Martin Baulig  <martin@ximian.com>
13559
13560         * typemanager.cs (InitCoreTypes): Try calling
13561         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13562         the 3-args-version.  Corlib now also needs our `void_type'.
13563         (GetMethod): Added overloaded version which takes an optional
13564         `bool report_errors' to allow lookups of optional methods.
13565
13566 2003-05-12  Martin Baulig  <martin@ximian.com>
13567
13568         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13569         only used for locals and not for parameters.
13570
13571 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
13572
13573         * support.cs (InternalParameters.ParameterType): Return the
13574         ExternalType of the parameter.
13575
13576         * parameter.cs (Parameter.ExternalType): drop the two arguments,
13577         they were unused.
13578
13579 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
13580
13581         * class.cs (MethodData.Define): Do not set the `newslot' on
13582         interface members, if they are also flagged as "override".
13583
13584         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
13585         better code for ++i and i++.  This only works for static fields
13586         and local variables.
13587
13588         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
13589         want to pull the DeclSpace out of the builder_to_declspace instead
13590         of the TypeBuilder (like in TypeContainer.FindMembers).
13591
13592         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
13593         instead of LookupTypeContainer.  Fixes the crash on .NET for
13594         looking up interface members.
13595
13596         * const.cs: Create our own emit context during the Definition
13597         stage, so that constants are evaluated in the proper context, when
13598         a recursive definition happens.
13599
13600 2003-05-11  Martin Baulig  <martin@ximian.com>
13601
13602         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
13603         new block for a switch section.
13604         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
13605         the adding/lookup in the switch block.  Fixes #39828.
13606
13607 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
13608
13609         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
13610         functionality: I needed to convert the data after I had performed
13611         the add/sub operation into the operands type size.
13612
13613         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
13614         pass the type for the box operation, otherwise the resulting
13615         object would have been of type object.
13616
13617         (BoxedCast): Add constructor to specify the type to box as.
13618
13619 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
13620
13621         * iterators.cs: I was reusing the `count' variable inadvertently,
13622         take steps to not allow this to happen.
13623
13624 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
13625
13626         * attribute.cs (Attribute.Resolve): Params attributes are encoded
13627         by creating an array at the point where the params starts and
13628         putting all those arguments there, then adjusting the size of the
13629         array.
13630
13631 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
13632
13633         * expression.cs (New.AddressOf): Implement interface
13634         IMemoryLocation.  This is used when the `new' operator is used in
13635         the context of an invocation to a method on a value type.
13636
13637         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
13638         example. 
13639
13640         * namespace.cs: Also check the using aliases here.
13641
13642         * driver.cs: Move the test for using validity after the types have
13643         been entered, so we do a single pass that also includes the using
13644         aliases. 
13645
13646         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
13647         in the regular case.   CreateSiblingForFinally is doing extra
13648         error checking.
13649
13650         * attribute.cs (GetAttributeArgumentExpression): Store the result
13651         on an out value, and use the return value to indicate failure
13652         instead of using null (which is a valid return for Constant.GetValue).
13653
13654         * statement.cs: Perform the analysis flow for the increment
13655         portion after the statement, because this will be the real flow of
13656         execution.  Fixes #42385
13657
13658         * codegen.cs (EmitContext.EmitArgument,
13659         EmitContext.EmitStoreArgument): New helper functions when the
13660         RemapToProxy flag is set.
13661
13662         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
13663         function.
13664
13665         Add support for remapping parameters. 
13666
13667         * iterators.cs: Propagate parameter values;  Store parameter
13668         values in the proxy classes.
13669
13670 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
13671
13672         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
13673         need a proxy reference;  I do not know what I was thinking
13674
13675         * cs-parser.jay (constructor_initializer): catch another error,
13676         and display nice message.
13677
13678         (field_declaration): catch void field declaration
13679         to flag a better error. 
13680
13681         * class.cs (MemberBase.CheckBase): Report an error instead of a
13682         warning if a new protected member is declared in a struct. 
13683         (Field.Define): catch the error of readonly/volatile.
13684
13685         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
13686
13687         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
13688         volatile variable is taken
13689
13690 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
13691
13692         * statement.cs (Fixed.Resolve): Report an error if we are not in
13693         an unsafe context.
13694
13695 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
13696
13697         * typemanager.cs: reuse the code that handles type clashes for
13698         delegates and enumerations.
13699
13700         * class.cs (Report28): Always report.
13701
13702         * expression.cs (EncodeAsAttribute): Allow nulls here.
13703
13704 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
13705
13706         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
13707         the functionality for testing whether an expression is valid for
13708         an attribute here.  Also handle the case of arrays of elements
13709         being stored. 
13710
13711         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
13712         encoding a linear array into an array of objects that are suitable
13713         to be passed to an CustomAttributeBuilder.
13714
13715         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
13716
13717         * ecore.cs: (FieldExpr): Handle field remapping here.
13718
13719         * iteratators.cs: Pass the instance variable (if the method is an
13720         instance method) to the constructors, so we can access the field
13721         variables on the class.
13722
13723         TODO: Test this with structs.  I think the THIS variable on
13724         structs might have to be a pointer, and not a refenrece
13725
13726 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
13727
13728         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
13729         local variables to fields in a proxy class.
13730
13731         * iterators.cs (PopulateProxy): Rename our internal fields to
13732         <XXX>.  
13733         Create a <THIS> field if we are an instance method, so we can
13734         reference our parent container variables.
13735         (MapVariable): Called back from the EmitContext code to enter a
13736         new variable to field mapping into the proxy class (we just create
13737         a FieldBuilder).
13738
13739         * expression.cs
13740         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
13741         for using the remapped locals to fields.
13742
13743         I placed the code here, because that gives the same semantics to
13744         local variables, and only changes the Emit code.
13745
13746         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
13747         statements inside iterators.
13748         (VariableInfo): Add a FieldBuilder for the cases when we are
13749         remapping local variables to fields in a proxy class
13750
13751         * ecore.cs (SimpleNameResolve): Avoid testing two times for
13752         current_block != null.
13753
13754         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
13755         not cope with strings, as it has been moved to the
13756         TableSwitchEmit.  Fixed bug in switch generation.
13757
13758         * expression.cs (New.DoResolve): Provide more context for the user
13759         when reporting an error.
13760
13761         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
13762         pointers. 
13763
13764         * expression.cs (MemberAccess.DoResolve): When we get a type back,
13765         check the permissions for it.  Note than in a type-resolution
13766         context the check was already present in DeclSpace.ResolveType,
13767         but was missing from the MemberAccess.
13768
13769         (ArrayCreation.CheckIndices): warn if the user has
13770         more nested levels of expressions, but there are no more
13771         dimensions specified.  Avoids crash on bug 41906.
13772
13773 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
13774
13775         * statement.cs (Block): replace Implicit bool, for a generic
13776         flags.   
13777         New flag: `Unchecked'.  This is used during the EmitMeta phase
13778         (which is out-of-line with the regular Resolve/Emit process for a
13779         statement, as this is done ahead of time, but still gets a chance
13780         to call constant resolve).
13781
13782         (Block.Flags): new enum for adding a new flag.
13783
13784         (Block.EmitMeta): track the state of unchecked.
13785
13786         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
13787         to enable constant resolution to work there as well.
13788
13789 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
13790
13791         * typemanager.cs (ienumerable_type): Also look up
13792         System.Collections.IEnumerable. 
13793
13794 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
13795
13796         TODO: Test more than one conditional per method.
13797
13798         * class.cs (Indexer.Define): Report the location where the user is
13799         referencing the unsupported feature.
13800
13801         (MethodData): Overload the use of `conditionals' to
13802         minimize the creation of needless ArrayLists.   This saves roughly
13803         212kb on my machine.
13804
13805         (Method): Implement the new IIteratorContainer interface.
13806         (Method.SetYields): Implement the method by setting the ModFlags
13807         to contain METHOD_YIELDS.
13808
13809         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
13810         which just got set to null.
13811
13812         * iterators.cs: New file.
13813
13814         (Yield, YieldBreak): New statements.
13815
13816         * statement.cs (Return.Resolve): Flag an error if we are used in
13817         an iterator method.
13818
13819         * codegen.cs (InIterator): New flag set if the code is being
13820         compiled in an iterator method.
13821
13822         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
13823         internal modifier, and we just use it to avoid adding extra
13824         fields, as this is seldom used.  
13825
13826         * cs-parser.jay: Add yield_statement (yield and yield break).
13827
13828         * driver.cs: New flag -v2 to turn on version 2 features. 
13829
13830         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
13831         hashtable when v2 is enabled.
13832
13833 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
13834
13835         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
13836         there is already a namespace defined with this name.
13837
13838         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
13839         people upgraded their corlibs.
13840
13841         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
13842         always use fully qualified types, no need to use the compiler
13843         front end.
13844
13845         (TypeManager.IsNamespace): Use binarysearch.
13846
13847         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
13848         AddDelegate): I did not quite use the new IsValid API properly: I
13849         have to pass the short-name and the fullname.  I was passing only
13850         the basename instead of the fullname sometimes. 
13851
13852         (TypeContainer.DefineType): call NamespaceClash.
13853
13854         * interface.cs (Interface.DefineType): use NamespaceClash before
13855         defining the type.
13856
13857         * delegate.cs (Delegate.DefineType): use NamespaceClash before
13858         defining the type.
13859
13860         * enum.cs: (Enum.DefineType): use NamespaceClash before
13861         defining the type.
13862
13863         * typemanager.cs (: 3-line patch that gives us some tasty 11%
13864         speed increase.  First, use the negative_hits cache when we get a
13865         negative.  Second, add the type with its full original name
13866         instead of the new . and + encoded name (reflection uses + to
13867         separate type from a nested type).  Use LookupTypeReflection
13868         directly which bypasses the type->name hashtable (that we already
13869         know does not contain the type.
13870
13871         * decl.cs (DeclSpace.ResolveTypeExpr): track the
13872         location/container type. 
13873
13874         * driver.cs: When passing utf8, use directly the UTF8Encoding.
13875
13876 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
13877
13878         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
13879
13880         * delegate.cs (NewDelegate.Resolve): Test whether an instance
13881         method is being referenced in the method group from a static
13882         context, and report error 120 if so.
13883
13884         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
13885         Error118. 
13886
13887         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
13888         is created, we create the A namespace).
13889
13890         * cs-parser.jay: A namespace also introduces a DeclarationFound.
13891         Fixes #41591
13892
13893 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
13894
13895         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
13896         invocation to ModuleBuilder.GetType with the same values will
13897         return a new type instance, so we need to cache its return
13898         values. 
13899
13900         * expression.cs (Binary.ResolveOperator): Only allow the compare
13901         operators on enums if they are of the same type.
13902
13903         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
13904         types of ValueType on their own case.  Before we were giving them
13905         the same treatment as objects.
13906
13907         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
13908         fullname.  Short name is used to compare against container name.
13909         Fullname is used to check against defined namespace names.
13910
13911         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
13912         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
13913
13914         (Method.CheckBase): Call parent.
13915         (MemberBase.CheckBase): Check for protected members on sealed
13916         classes.
13917         (PropertyBase.CheckBase): Call parent.
13918         (Field.Define): Call parent.
13919
13920         * report.cs: Negative error codes are now mapped to 8000 - code,
13921         so that the display is render more nicely.
13922
13923         * typemanager.cs: Do not use try/catch, instead report a regular
13924         error. 
13925
13926         (GetPointerType, GetReferenceType): These methods provide
13927         mechanisms to obtain the T* and T& from a T.  We had the code
13928         previously scattered around the code base, and it also used
13929         TypeManager.LookupType that would go through plenty of caches.
13930         This one goes directly to the type source.
13931
13932         In some places we did the Type.GetType followed by
13933         ModuleBuilder.GetType, but not in others, so this unifies the
13934         processing as well.
13935
13936         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
13937         statements now that we have namespace information.
13938
13939         * typemanager.cs (IsNamespace): New method, returns whether the
13940         string presented is a namespace or not.
13941
13942         (ComputeNamespaces): New public entry point, computes the list of
13943         available namespaces, using the GetNamespaces API call in Mono, or
13944         the slower version in MS.NET.   
13945
13946         Now before we start the semantic analysis phase, we have a
13947         complete list of namespaces including everything that the user has
13948         provided.
13949
13950         Deleted old code to cache namespaces in .nsc files.
13951
13952 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
13953
13954         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
13955         class/struct location definition Location for the implicit
13956         constructor location.
13957
13958         (Operator.Define): Use the location of the operator for the
13959         implicit Method definition.
13960
13961         (Constructor.Emit): use the constructor location for the implicit
13962         base initializer constructor.
13963
13964         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
13965         and the Expression class now contains two new methods:
13966
13967         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
13968         isolate type lookup from the rest of the resolution process.
13969
13970         Since we use Expressions to hold type definitions due to the way
13971         we parse the input we have historically overloaded Resolve to
13972         perform the Type lookups if a special flag is passed.  Now this is
13973         eliminated and two methods take their place. 
13974
13975         The differences in the two methods between xStep and xTerminal is
13976         that xStep is involved in our current lookup system that uses
13977         SimpleNames to compose a name, while xTerminal is used just to
13978         catch the case where the simplename lookup failed.
13979
13980 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
13981
13982         * expression.cs (ResolveMemberAccess): Remove redundant code.
13983         TypeExpr expressions are always born fully resolved.
13984
13985         * interface.cs (PopulateMethod): Do not lookup the types twice.
13986         We were doing it once during SemanticAnalysis and once during
13987         PopulateMethod.
13988
13989         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
13990         in local variable type definitions, were being returned as a
13991         SimpleName (we decomposed everything into a string), that is
13992         because primary_expression was being used instead of a type in the
13993         grammar (reduce/reduce conflicts).
13994
13995         The part that was wrong is that we converted the expression into a
13996         string (an oversimplification in one hand, compounded with primary
13997         expressions doing string concatenation).
13998
13999         So things like:
14000
14001         A.B.C [] x;
14002
14003         Would return "A.B.C[]" as a SimpleName.  This stopped things like
14004         using clauses from working on this particular context.  And a type
14005         was being matched directly against "A.B.C[]".
14006
14007         We now use the correct approach, and allow for ComposedCast to be
14008         part of the unary expression.  So the "A.B.C []" become a composed
14009         cast of "A.B.C" (as a nested group of MemberAccess with a
14010         SimpleName at the end) plus the rank composition "[]". 
14011
14012         Also fixes 35567
14013
14014 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
14015
14016         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
14017         for the access level checking.
14018
14019         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
14020         `TypeContainer container', because I kept getting confused when I
14021         was debugging this code.
14022
14023         * expression.cs (Indexers): Instead of tracking getters/setters,
14024         we now track them in parallel.  We create one arraylist less, but
14025         most importantly it is possible now for the LValue code to find a
14026         matching get for a set.
14027
14028         (IndexerAccess.DoResolveLValue): Update the code.
14029         GetIndexersForType has been modified already to extract all the
14030         indexers from a type.  The code assumed it did not.
14031
14032         Also make the code set the correct return type for the indexer.
14033         This was fixed a long time ago for properties, but was missing for
14034         indexers.  It used to be void_type.
14035
14036         (Binary.Emit): Test first for doubles instead of
14037         floats, as they are more common.
14038
14039         (Binary.EmitBranchable): Use the .un version of the branch opcodes
14040         when dealing with floats and the <=, >= operators.  This fixes bug
14041         #39314 
14042
14043         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14044         to load the array value by emitting a load on the foreach variable
14045         type.  This was incorrect.  
14046
14047         We now emit the code to load an element using the the array
14048         variable type, and then we emit the conversion operator.
14049
14050         Fixed #40176
14051
14052 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
14053
14054         * attribute.cs: Avoid allocation of ArrayLists in the common case.
14055
14056 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
14057
14058         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
14059         test for protection before we test for signatures. 
14060
14061         (MethodSignature.ToString): implement.
14062
14063         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
14064         to the case where we reduced into a LongConstant.
14065
14066         * decl.cs (CheckAccessLevel): If the type is an array, we can not
14067         depend on whether the information is acurrate, because the
14068         Microsoft runtime will always claim that the array type is public,
14069         regardless of the real state.
14070
14071         If the type is a pointer, another problem happens: the type is
14072         reported as non-public in Microsoft.  
14073
14074         In both cases we have to call CheckAccessLevel recursively with
14075         the underlying type as the argument to be tested.
14076
14077 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
14078
14079         * assign.cs (Assign.Emit): If we are dealing with a compound
14080         assignment expression, we should use the code path that stores the
14081         intermediate result in a temporary value.  This fixes #40903.
14082
14083         *expression.cs (Indirection.ToString): Provide ToString method for
14084         debugging. 
14085
14086 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
14087
14088         * class.cs: Null out fields holding references to Block objects so
14089         they can be garbage collected.
14090
14091         * expression.cs (OverloadResolve): Remove unused local.
14092
14093 2003-04-07  Martin Baulig  <martin@ximian.com>
14094
14095         * codegen.cs (EmitContext.CurrentFile): New public field.
14096         (EmitContext.Mark): Use the CurrentFile to check whether the
14097         location is in the correct file.
14098         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
14099
14100 2003-04-07  Martin Baulig  <martin@ximian.com>
14101
14102         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
14103
14104         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
14105         location.  [FIXME: The location argument which gets passed to this
14106         method is sometimes wrong!]
14107
14108 2003-04-07  Nick Drochak <ndrochak@gol.com>
14109
14110         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
14111
14112 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
14113
14114         * expression.cs (Indirection.EmitAssign): We were using the
14115         temporary, but returning immediately instead of continuing the
14116         EmitAssing flow.
14117
14118 2003-04-06  Martin Baulig  <martin@ximian.com>
14119
14120         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
14121         if it's a nested child, but also deriving from the outer class.
14122         See test 190.cs.
14123
14124         * typemanager.cs (IsNestedChildOf): Make this work if it's a
14125         nested child, but also deriving from the outer class.  See
14126         test-190.cs.
14127         (FilterWithClosure): We may access private members of the outer
14128         class if we're a nested child and deriving from the outer class.
14129         (RealMemberLookup): Only set `closure_private_ok' if the
14130         `original_bf' contained BindingFlags.NonPublic.
14131
14132 2003-04-05  Martin Baulig  <martin@ximian.com>
14133
14134         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
14135         probe if its a type parameter, and if so, flag an error.
14136
14137         * decl.cs: Move here the SetParameterInfo code from class.cs.
14138         Handle IsGeneric here.
14139
14140         Handle a variety of errors in the parameter info definition.
14141
14142         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
14143         type parameters here.
14144
14145         * cs-parser.jay (class_declaration): report errors for parameters
14146         here as well.
14147
14148 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
14149
14150         * generic.cs: New file, contains support code for generics.
14151
14152         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
14153         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
14154
14155         Update parser for the above removals.
14156
14157         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
14158         now taken care of in the parser.
14159
14160 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
14161
14162         * class.cs (Event.Define): Do not allow abstract events to have
14163         initializers. 
14164
14165 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
14166
14167         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
14168         block in event declarations.
14169
14170         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
14171         value type, get its address.
14172
14173         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
14174         leaving a class on the stack instead of a boolean value (int
14175         0/1).  Change the code so we compare against null, and then the
14176         result against zero.
14177
14178         * class.cs (TypeContainer.GetClassBases): We were checking for the
14179         parent class being sealed too late.
14180
14181         * expression.cs (Binary.Emit): For <= and >= when dealing with
14182         floating point values, use cgt.un and clt.un instead of cgt and
14183         clt alone.
14184
14185 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
14186
14187         * statement.cs: Apply the same optimization as MS: skip the 
14188         GetEnumerator returning an IEnumerator, and use the one returning a 
14189         CharEnumerator instead. This allows us to avoid the try-finally block 
14190         and the boxing.
14191
14192 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
14193
14194         * cs-parser.jay: Attributes cannot be applied to
14195                          namespaces. Fixes #40473
14196
14197 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14198
14199         * class.cs:
14200         (Add*): check if the name is valid using the full name for constants,
14201         fields, properties and events.
14202
14203 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
14204
14205         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
14206         char constants to be part of the enumeration.
14207
14208         * expression.cs (Conditional.DoResolve): Add support for operator
14209         true. Implements the missing functionality from 14.12
14210
14211         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
14212         operator true/false as required by the spec.
14213
14214         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
14215         implicit conversion to boolean.
14216
14217         * statement.cs (Statement.ResolveBoolean): A boolean expression is
14218         also one where the type implements `operator true'. 
14219
14220         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
14221         get an expression that will invoke operator true based on an
14222         expression.  
14223
14224         (GetConversionOperators): Removed the hack that called op_True
14225         here.  
14226
14227         (Expression.ResolveBoolean): Move this from Statement.
14228
14229 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
14230
14231         * ecore.cs (FieldExpr): do not allow initialization of initonly
14232         fields on derived classes
14233
14234 2003-03-13  Martin Baulig  <martin@ximian.com>
14235
14236         * statement.cs (Block.Emit): Call ig.BeginScope() and
14237         ig.EndScope() when compiling with debugging info; call
14238         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
14239
14240 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
14241
14242         * expression.cs (Indexers): Do not construct immediately, allow
14243         for new members to be appended as we go.  Fixes 38143
14244
14245 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14246
14247         * expression.cs: save/restore context when resolving an unchecked
14248         expression.
14249
14250 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
14251
14252         * cfold.cs: Catch division by zero in modulus operator during
14253         constant folding.
14254
14255 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
14256
14257         * interface.cs (Interface.DefineMembers): Avoid defining members
14258         twice. 
14259
14260 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
14261
14262         * driver.cs: handle the +/- options for -noconfig
14263
14264         * statement.cs (Unckeched.Resolve): Also track the state of
14265         unchecked in the Resolve phase.
14266
14267 2003-02-27  Martin Baulig  <martin@ximian.com>
14268
14269         * ecore.cs (Expression.MemberLookup): Don't create a
14270         MethodGroupExpr for something which is not a method.  Fixes #38291.
14271
14272 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
14273
14274         * class.cs (MemberBase.CheckParameters): Also check that the type
14275         is unmanaged if it is a pointer.
14276
14277         * expression.cs (SizeOf.Resolve): Add location information.
14278
14279         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
14280         a managed type is declared.
14281
14282         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
14283         parameter modifiers as well.  Fixes bug 38606
14284
14285         * class.cs: Very sad.  Am backing out the speed up changes
14286         introduced by the ArrayList -> Array in the TypeContainer, as they
14287         were not actually that much faster, and introduced a bug (no error
14288         reports on duplicated methods).
14289
14290         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
14291         source first, this will guarantee that we have a valid expression
14292         before calling in lower levels functions that will require a
14293         resolved object.  Then use this original_source in the
14294         target.ResolveLValue instead of the original source that was
14295         passed to us.
14296
14297         Another change.  Use target.Resolve instead of LValueResolve.
14298         Although we are resolving for LValues, we will let the Assign code
14299         take care of that (it will be called again from Resolve).  This
14300         basically allows code like this:
14301
14302         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
14303         class Y { void A (X x) { x [0] += o; }
14304
14305         The problem was that the indexer was trying to resolve for
14306         set_Item (idx, object o) and never finding one.  The real set_Item
14307         was set_Item (idx, X).  By delaying the process we get the right
14308         semantics. 
14309
14310         Fixes bug 36505
14311
14312 2003-02-23  Martin Baulig  <martin@ximian.com>
14313
14314         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14315         while calling DoEmit ().
14316
14317         * codegen.cs (EmitContext.Mark): Don't mark locations in other
14318         source files; if you use the #line directive inside a method, the
14319         compiler stops emitting line numbers for the debugger until it
14320         reaches the end of the method or another #line directive which
14321         restores the original file.
14322
14323 2003-02-23  Martin Baulig  <martin@ximian.com>
14324
14325         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14326
14327 2003-02-23  Martin Baulig  <martin@ximian.com>
14328
14329         * statement.cs (Block.AddChildVariableNames): We need to call this
14330         recursively, not just for our immediate children.
14331
14332 2003-02-23  Martin Baulig  <martin@ximian.com>
14333
14334         * class.cs (Event.Define): Always make the field private, like csc does.
14335
14336         * typemanager.cs (TypeManager.RealMemberLookup): Make events
14337         actually work, fixes bug #37521.
14338
14339 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
14340
14341         * delegate.cs: When creating the various temporary "Parameters"
14342         classes, make sure that we call the ComputeAndDefineParameterTypes
14343         on those new parameters (just like we do with the formal ones), to
14344         allow them to be resolved in the context of the DeclSpace.
14345
14346         This fixes the bug that Dick observed in Bugzilla #38530.
14347
14348 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
14349
14350         * expression.cs (ResolveMemberAccess): When resolving a constant,
14351         do not attempt to pull a constant if the value was not able to
14352         generate a valid constant.
14353
14354         * const.cs (LookupConstantValue): Do not report more errors than required.
14355
14356 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14357
14358         * expression.cs: fixes bug #38328.
14359
14360 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14361
14362         * class.cs: Changed all the various members that can be part of a
14363         class from being an ArrayList to be an Array of the right type.
14364         During the DefineType type_list, interface_list, delegate_list and
14365         enum_list are turned into types, interfaces, delegates and enums
14366         arrays.  
14367
14368         And during the member population, indexer_list, event_list,
14369         constant_list, field_list, instance_constructor_list, method_list,
14370         operator_list and property_list are turned into their real arrays.
14371
14372         Although we could probably perform this operation earlier, for
14373         good error reporting we need to keep the lists and remove the
14374         lists for longer than required.
14375
14376         This optimization was triggered by Paolo profiling the compiler
14377         speed on the output of `gen-sample-program.pl' perl script. 
14378
14379         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
14380         not crash in methods like MemberLookupFailed that use this field.  
14381
14382         This problem arises when the compiler fails to resolve a type
14383         during interface type definition for example.
14384
14385 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14386
14387         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14388         inherit from System.Object, so we have to stop at null, not only
14389         when reaching System.Object.
14390
14391 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
14392
14393         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14394         DeclaredOnly because the parent indexer might have had a different
14395         name, but did not loop until the top of the hierarchy was reached.
14396
14397         The problem this one fixes is 35492: when a class implemented an
14398         indexer from an interface, we were getting the interface method
14399         (which was abstract) and we were flagging an error (can not invoke
14400         abstract method).
14401
14402         This also keeps bug 33089 functioning, and test-148 functioning.
14403
14404         * typemanager.cs (IsSpecialMethod): The correct way of figuring
14405         out if a method is special is to see if it is declared in a
14406         property or event, or whether it is one of the predefined operator
14407         names.   This should fix correctly #36804.
14408
14409 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
14410
14411         The goal here is to remove the dependency on EmptyCast.Peel ().
14412         Killing it completely.
14413
14414         The problem is that currently in a number of places where
14415         constants are expected, we have to "probe" for an EmptyCast, and
14416         Peel, which is not the correct thing to do, as this will be
14417         repetitive and will likely lead to errors. 
14418
14419         The idea is to remove any EmptyCasts that are used in casts that
14420         can be reduced to constants, so we only have to cope with
14421         constants. 
14422
14423         This bug hunt was triggered by Bug 37363 and the desire to remove
14424         the duplicate pattern where we were "peeling" emptycasts to check
14425         whether they were constants.  Now constants will always be
14426         constants.
14427
14428         * ecore.cs: Use an enumconstant here instead of wrapping with
14429         EmptyCast.  
14430
14431         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14432         throwing me off.  By handling this we can get rid of a few hacks.
14433
14434         * statement.cs (Switch): Removed Peel() code.
14435
14436 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
14437
14438         * class.cs: Location information for error 508
14439
14440         * expression.cs (New.DoResolve): Add a guard against double
14441         resolution of an expression.  
14442
14443         The New DoResolve might be called twice when initializing field
14444         expressions (see EmitFieldInitializers, the call to
14445         GetInitializerExpression will perform a resolve on the expression,
14446         and later the assign will trigger another resolution
14447
14448         This leads to bugs (#37014)
14449
14450         * delegate.cs: The signature for EndInvoke should contain any ref
14451         or out parameters as well.  We were not doing this in the past. 
14452
14453         * class.cs (Field.Define): Do not overwrite the type definition
14454         inside the `volatile' group.  Turns out that volatile enumerations
14455         were changing the type here to perform a validity test, which
14456         broke conversions. 
14457
14458 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
14459
14460         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14461         and structs, we do not want to load the instance variable
14462
14463         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14464         enum_type has to be handled like an object reference (implicit
14465         conversions exists from this to object), but the regular IsClass
14466         and IsValueType tests will never return true for this one.
14467
14468         Also we use TypeManager.IsValueType instead of type.IsValueType,
14469         just for consistency with the rest of the code (this is only
14470         needed if we ever use the construct exposed by test-180.cs inside
14471         corlib, which we dont today).
14472
14473 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
14474
14475         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14476         just InternalCall.
14477
14478 2003-02-09  Martin Baulig  <martin@ximian.com>
14479
14480         * namespace.cs (Namespace..ctor): Added SourceFile argument.
14481         (Namespace.DefineNamespaces): New static public method; this is
14482         called when we're compiling with debugging to add all namespaces
14483         to the symbol file.
14484
14485         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14486         pass it to the Namespace's .ctor.
14487
14488         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14489         and MethodBase arguments; pass the namespace ID to the symwriter;
14490         pass the MethodBase instead of the token to the symwriter.
14491         (SymbolWriter.DefineNamespace): New method to add a namespace to
14492         the symbol file.
14493
14494 2003-02-09  Martin Baulig  <martin@ximian.com>
14495
14496         * symbolwriter.cs: New file.  This is a wrapper around
14497         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
14498         methods here in near future.
14499
14500 2003-02-09  Martin Baulig  <martin@ximian.com>
14501
14502         * codegen.cs (EmitContext.Mark): Just pass the arguments to
14503         ILGenerator.MarkSequencePoint() which are actually used by the
14504         symbol writer.
14505
14506 2003-02-09  Martin Baulig  <martin@ximian.com>
14507
14508         * location.cs (SourceFile): New public sealed class.  This
14509         contains the name and an index which is used in the location's token.
14510         (Location): Reserve an appropriate number of bits in the token for
14511         the source file instead of walking over that list, this gives us a
14512         really huge performance improvement when compiling with debugging.
14513
14514         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14515         `SourceFile' argument instead of a string.
14516         (Driver.ProcessFile): Add all the files via Location.AddFile(),
14517         but don't parse/tokenize here, we need to generate the list of all
14518         source files before we do that.
14519         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
14520         the files.
14521
14522         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14523         instead of a string.
14524
14525         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14526         of a string.
14527
14528 2003-02-09  Martin Baulig  <martin@ximian.com>
14529
14530         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14531         filename on `#line default'.
14532
14533 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14534
14535         * statement.cs: don't clear the pinned var when the fixed statement
14536         returns from the method (fixes bug#37752).
14537
14538 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14539
14540         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
14541         to IsValueType.
14542
14543 2003-02-07  Martin Baulig  <martin@ximian.com>
14544
14545         * driver.cs: Removed the `--debug-args' command line argument.
14546
14547         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14548         automatically by the AsssemblyBuilder.
14549         (CodeGen.InitializeSymbolWriter): We don't need to call any
14550         initialization function on the symbol writer anymore.  This method
14551         doesn't take any arguments.
14552
14553 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
14554
14555         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14556         from referenced assemblies as well.
14557
14558 2003-02-02  Martin Baulig  <martin@ximian.com>
14559
14560         * class.cs (MethodData.Emit): Generate debugging info for external methods.
14561
14562 2003-02-02  Martin Baulig  <martin@ximian.com>
14563
14564         * class.cs (Constructor.Emit): Open the symbol writer before
14565         emitting the constructor initializer.
14566         (ConstructorInitializer.Emit): Call ec.Mark() to allow
14567         single-stepping through constructor initializers.
14568
14569 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
14570
14571         * class.cs: Handle error 549: do not allow virtual methods in
14572         sealed classes. 
14573
14574 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14575
14576         * decl.cs: Check access levels when resolving types
14577
14578 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14579
14580         * statement.cs: Add parameters and locals set in catch blocks that might 
14581         return to set vector
14582
14583 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
14584
14585         * class.cs (Operator): Set the SpecialName flags for operators.
14586
14587         * expression.cs (Invocation.DoResolve): Only block calls to
14588         accessors and operators on SpecialName methods.
14589
14590         (Cast.TryReduce): Handle conversions from char constants.
14591
14592
14593 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14594
14595         * statement.cs: small memory and time optimization in FlowBranching.
14596
14597 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
14598
14599         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14600         problem that the last fix but in the other sid (Set).
14601
14602         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14603         access when there is no indexer in the hierarchy.
14604
14605 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14606
14607         * class.cs: Combine some if statements.
14608
14609 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14610
14611         * driver.cs: fixed bug #37187.
14612
14613 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
14614
14615         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
14616         any indexer, it's needed to build a list with all the indexers in the
14617         hierarchy (AllGetters), else we have problems. Fixes #35653.
14618
14619 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
14620
14621         * class.cs (MethodData.Define): It is wrong for an interface
14622         implementation to be static in both cases: explicit and implicit.
14623         We were only handling this in one case.
14624
14625         Improve the if situation there to not have negations.
14626
14627         * class.cs (Field.Define): Turns out that we do not need to check
14628         the unsafe bit on field definition, only on usage.  Remove the test.
14629
14630 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14631
14632         * driver.cs: use assembly.Location instead of Codebase (the latest
14633         patch made mcs fail when using MS assemblies).
14634
14635 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
14636
14637         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
14638         get the path to *corlib.dll.
14639
14640 2003-01-21  Nick Drochak <ndrochak@gol.com>
14641
14642         * cs-tokenizer.cs:
14643         * pending.cs:
14644         * typemanager.cs: Remove compiler warnings
14645
14646 2003-01-20  Duncan Mak  <duncan@ximian.com>
14647
14648         * AssemblyInfo.cs: Bump the version number to 0.19.
14649
14650 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14651
14652         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
14653
14654 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
14655
14656         * class.cs (Constructor::Emit): Emit debugging info for constructors.
14657
14658 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
14659
14660         * cs-parser.jay: Small fix: we were not comparing the constructor
14661         name correctly.   Thanks to Zoltan for the initial pointer.
14662
14663 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
14664
14665         * cs-tokenizer.cs: Set file name when specified with #line
14666
14667 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
14668
14669         * cs-parser.jay: Only perform the constructor checks here if we
14670         are named like the class;  This will help provider a better
14671         error.  The constructor path is taken when a type definition is
14672         not found, but most likely the user forgot to add the type, so
14673         report that rather than the constructor error.
14674
14675 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
14676
14677         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
14678         allocations.
14679
14680 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14681
14682         * cs-parser.jay: Add cleanup call.
14683
14684 2003-01-13  Duncan Mak  <duncan@ximian.com>
14685
14686         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
14687         consistent with other methods.
14688
14689 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14690
14691         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
14692
14693 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
14694
14695         * attribute.cs: only set GuidAttr to true when we have a
14696         GuidAttribute.
14697
14698 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14699
14700         * ecore.cs:
14701         * expression.cs:
14702         * typemanager.cs: fixes to allow mcs compile corlib with the new
14703         Type.IsSubclassOf fix.
14704
14705 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
14706
14707         * expression.cs (LocalVariableReference.DoResolve): Classify a
14708         constant as a value, not as a variable.   Also, set the type for
14709         the variable.
14710
14711         * cs-parser.jay (fixed_statement): take a type instead of a
14712         pointer_type, so we can produce a better error message later.
14713
14714         * statement.cs (Fixed.Resolve): Flag types that are not pointers
14715         as an error.  
14716
14717         (For.DoEmit): Make inifinite loops have a
14718         non-conditional branch back.
14719
14720         (Fixed.DoEmit): First populate the pinned variables, then emit the
14721         statement, then clear the variables.  Before I was emitting the
14722         code once for each fixed piece.
14723
14724
14725 2003-01-08  Martin Baulig  <martin@ximian.com>
14726
14727         * statement.cs (FlowBranching.MergeChild): A break in a
14728         SWITCH_SECTION does not leave a loop.  Fixes #36155.
14729
14730 2003-01-08  Martin Baulig  <martin@ximian.com>
14731
14732         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
14733         lives in the same number space than `param_map'.  Fixes #36154.
14734
14735 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
14736
14737         * cs-parser.jay (constructor_declaration): Set the
14738         Constructor.ModFlags before probing for it.  This makes the
14739         compiler report 514, 515 and 132 (the code was there, but got
14740         broken). 
14741
14742         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
14743         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
14744         (GotoCase.Resolve): Set `Returns' to ALWAYS.
14745
14746 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
14747
14748         * enum.cs: create the enum static fields using the enum type.
14749
14750 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
14751
14752         * class.cs: don't try to create the ParamBuilder for the return
14753         type if it's not needed (and handle it breaking for the ms runtime
14754         anyway).
14755
14756 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
14757
14758         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
14759
14760 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
14761
14762         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
14763         the command.   This showed up while compiling the JANET source
14764         code, which used \r as its only newline separator.
14765
14766 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
14767
14768         * class.cs (Method.Define): If we are an operator (because it
14769         reuses our code), then set the SpecialName and HideBySig.  #36128
14770
14771 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
14772
14773         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
14774         exception, report error 120 `object reference required'.
14775
14776         * driver.cs: Add --pause option, used during to measure the size
14777         of the process as it goes with --timestamp.
14778
14779         * expression.cs (Invocation.DoResolve): Do not allow methods with
14780         SpecialName to be invoked.
14781
14782 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
14783
14784         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
14785         number before adding it.
14786
14787 2002-12-21  Ravi Pratap  <ravi@ximian.com>
14788
14789         * ecore.cs (StandardImplicitConversion): When in an unsafe
14790         context, we allow conversion between void * to any other pointer
14791         type. This fixes bug #35973.
14792
14793 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
14794
14795         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
14796         is not thrown when extensionless outputs are used 
14797
14798 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14799
14800         * rootcontext.cs: fixed compilation of corlib.
14801
14802 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
14803
14804         * attribute.cs (Attributes.Contains): Add new method.
14805
14806         * class.cs (MethodCore.LabelParameters): if the parameter is an
14807         `out' parameter, check that no attribute `[In]' has been passed.
14808
14809         * enum.cs: Handle the `value__' name in an enumeration.
14810
14811 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
14812
14813         * decl.cs: Added special case to allow overrides on "protected
14814         internal" methods
14815
14816 2002-12-18  Ravi Pratap  <ravi@ximian.com>
14817
14818         * attribute.cs (Attributes.AddAttributeSection): Rename to this
14819         since it makes much more sense.
14820
14821         (Attributes.ctor): Don't require a Location parameter.
14822
14823         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
14824
14825         * attribute.cs (ApplyAttributes): Remove extra Location parameters
14826         since we already have that information per attribute.
14827
14828         * everywhere : make appropriate changes.
14829
14830         * class.cs (LabelParameters): Write the code which actually
14831         applies attributes to the return type. We can't do this on the MS
14832         .NET runtime so we flag a warning in the case an exception is
14833         thrown.
14834
14835 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
14836
14837         * const.cs: Handle implicit null conversions here too.
14838
14839 2002-12-17  Ravi Pratap  <ravi@ximian.com>
14840
14841         * class.cs (MethodCore.LabelParameters): Remove the extra
14842         Type [] parameter since it is completely unnecessary. Instead
14843         pass in the method's attributes so that we can extract
14844         the "return" attribute.
14845
14846 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
14847
14848         * cs-parser.jay (parse): Use Report.Error to flag errors instead
14849         of ignoring it and letting the compile continue.
14850
14851         * typemanager.cs (ChangeType): use an extra argument to return an
14852         error condition instead of throwing an exception.
14853
14854 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
14855
14856         * expression.cs (Unary.TryReduce): mimic the code for the regular
14857         code path.  Perform an implicit cast in the cases where we can
14858         implicitly convert to one of the integral types, and then reduce
14859         based on that constant.   This fixes bug #35483.
14860
14861 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14862
14863         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
14864
14865 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14866
14867         * namespace.cs: fixed bug #35489.
14868
14869 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
14870
14871         * class.cs: Remove some dead code.
14872
14873         * cs-parser.jay: Estimate the number of methods needed
14874         (RootContext.MethodCount);
14875
14876         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
14877         numbers instead of StringBuilders.
14878
14879         * support.cs (PtrHashtable): Add constructor with initial size;
14880         We can now reduce reallocations of the method table.
14881
14882 2002-12-10  Ravi Pratap  <ravi@ximian.com>
14883
14884         * attribute.cs (ApplyAttributes): Keep track of the emitted
14885         attributes on a per-target basis. This fixes bug #35413.
14886
14887 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
14888
14889         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
14890         default to the Windows 1252 encoding.
14891
14892         (UnixParseOption): Support version, thanks to Alp for the missing
14893         pointer. 
14894
14895         * AssemblyInfo.cs: Add nice assembly information.
14896
14897         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
14898         (bug 35169).
14899
14900         * cs-parser.jay: Allow a trailing comma before the close bracked
14901         in the attribute_section production.
14902
14903         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
14904         address of the instance was being taken, I will take this out,
14905         because we take the address of the object immediately here.
14906
14907 2002-12-09  Ravi Pratap  <ravi@ximian.com>
14908
14909         * typemanager.cs (AreMultipleAllowed): Take care of the most
14910         obvious case where attribute type is not in the current assembly -
14911         stupid me ;-)
14912
14913 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
14914
14915         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
14916         definitions, instead of doing that afterwards.  
14917
14918         Also we use a nice little hack, depending on the constructor, we
14919         know if we are a "composed" name or a simple name.  Hence, we
14920         avoid the IndexOf test, and we avoid 
14921
14922         * codegen.cs: Add code to assist in a bug reporter to track down
14923         the source of a compiler crash. 
14924
14925 2002-12-07  Ravi Pratap  <ravi@ximian.com>
14926
14927         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
14928         types have been emitted for a given element and flag an error
14929         if something which does not have AllowMultiple set is used more
14930         than once.
14931
14932         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
14933         attribute types and their corresponding AllowMultiple properties
14934
14935         (AreMultipleAllowed): Check the property for a given type.
14936
14937         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
14938         property in the case we have a TypeContainer.
14939
14940         (Attributes.AddAttribute): Detect duplicates and just skip on
14941         adding them. This trivial fix catches a pretty gross error in our
14942         attribute emission - global attributes were being emitted twice!
14943
14944         Bugzilla bug #33187 is now fixed.
14945
14946 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
14947
14948         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
14949         instead of pp_and).
14950
14951         * expression.cs (Binary.ResolveOperator): I can only use the
14952         Concat (string, string, string) and Concat (string, string,
14953         string, string) if the child is actually a concatenation of
14954         strings. 
14955
14956 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
14957
14958         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
14959         context where we need a 2-character lookahead.
14960
14961         * pending.cs (PendingImplementation): Rework so we can keep track
14962         of interface types all the time, and flag those which were
14963         implemented by parents as optional.
14964
14965 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
14966
14967         * expression.cs (Binary.ResolveOperator): Use
14968         String.Concat(string,string,string) or
14969         String.Concat(string,string,string,string) when possible. 
14970
14971         * typemanager: More helper methods.
14972
14973
14974 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
14975
14976         * pending.cs: remove the bogus return from GetMissingInterfaces()
14977         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
14978
14979 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14980
14981         * namespace.cs: avoid duplicated 'using xxx' being added to
14982         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
14983         when we get more than one 'using' statement for the same namespace.
14984         Report a CS0105 warning for it.
14985
14986 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
14987
14988         * cs-tokenizer.cs (consume_identifier): use read directly, instead
14989         of calling getChar/putback, uses internal knowledge of it.    
14990
14991         (xtoken): Reorder tokenizer so most common patterns are checked
14992         first.  This reduces the compilation time in another 5% (from 8.11s
14993         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
14994
14995         The parsing time is 22% of the compilation in mcs, and from that
14996         64% is spent on the tokenization process.  
14997
14998         I tried using a binary search for keywords, but this is slower
14999         than the hashtable.  Another option would be to do a couple of
15000         things:
15001
15002                 * Not use a StringBuilder, instead use an array of chars,
15003                   with a set value.  Notice that this way we could catch
15004                   the 645 error without having to do it *afterwards*.
15005
15006                 * We could write a hand-parser to avoid the hashtable
15007                   compares altogether.
15008
15009         The identifier consumption process takes 37% of the tokenization
15010         time.  Another 15% is spent on is_number.  56% of the time spent
15011         on is_number is spent on Int64.Parse:
15012
15013                 * We could probably choose based on the string length to
15014                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
15015                   computations. 
15016
15017         Another 3% is spend on wrapping `xtoken' in the `token' function.
15018
15019         Handle 0xa0 as whitespace (#34752)
15020
15021 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
15022
15023         * typemanager.cs (IsCLRType): New routine to tell whether a type
15024         is one of the builtin types.  
15025
15026         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
15027         typecode in more places instead of doing pointer comparissions.
15028         We could leverage some knowledge about the way the typecodes are
15029         laid out.
15030
15031         New code to cache namespaces in assemblies, it is currently not
15032         invoked, to be used soon.
15033
15034         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
15035
15036         * expression.cs (Binary.ResolveOperator): specially handle
15037         strings, and do not perform user-defined operator overloading for
15038         built-in types.
15039
15040 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
15041
15042         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
15043         internalcall as it is a pretty simple operation;  Avoid whenever
15044         possible to call Char.IsLetter.
15045
15046         (consume_identifier): Cut by half the number of
15047         hashtable calls by merging the is_keyword and GetKeyword behavior.
15048
15049         Do not short-circuit, because if we do, we
15050         report errors (ie, #if false && true would produce an invalid
15051         directive error);
15052
15053
15054 2002-11-24  Martin Baulig  <martin@ximian.com>
15055
15056         * expression.cs (Cast.TryReduce): If we're in checked syntax,
15057         check constant ranges and report a CS0221.  Fixes #33186.
15058
15059 2002-11-24  Martin Baulig  <martin@ximian.com>
15060
15061         * cs-parser.jay: Make this work for uninitialized variable
15062         declarations in the `for' initializer.  Fixes #32416.
15063
15064 2002-11-24  Martin Baulig  <martin@ximian.com>
15065
15066         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
15067         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
15068
15069 2002-11-24  Martin Baulig  <martin@ximian.com>
15070
15071         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
15072         argument; if true, we also check for user-defined conversions.
15073         This is only needed if both arguments are of a user-defined type.
15074         Fixes #30443, added test-175.cs.
15075         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
15076
15077         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
15078
15079 2002-11-24  Martin Baulig  <martin@ximian.com>
15080
15081         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
15082         function to get the store opcode.
15083         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
15084         only emit the Ldelema if the store opcode is Stobj.  You must run
15085         both test-34 and test-167 to test this.  Fixes #34529.
15086
15087 2002-11-23  Martin Baulig  <martin@ximian.com>
15088
15089         * ecore.cs (Expression.MemberLookup): Added additional
15090         `qualifier_type' argument which is used when we're being called
15091         from MemberAccess.DoResolve() and null if we're called from a
15092         SimpleName lookup.
15093         (Expression.MemberLookupFailed): New method to report errors; this
15094         does the CS1540 check and reports the correct error message.
15095
15096         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
15097         argument for the CS1540 check and redone the way how we're dealing
15098         with private members.  See the comment in the source code for details.
15099         (FilterWithClosure): Reverted this back to revision 1.197; renamed
15100         `closure_start_type' to `closure_qualifier_type' and check whether
15101         it's not null.  It was not this filter being broken, it was just
15102         being called with the wrong arguments.
15103
15104         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
15105         and pass it the correct `qualifier_type'; this also does the error
15106         handling for us.
15107
15108 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
15109
15110         * expression.cs (Invocation.EmitParams): If the we are dealing
15111         with a non-built-in value type, load its address as well.
15112
15113         (ArrayCreation): Use a a pretty constant instead
15114         of the hardcoded value 2.   Use 6 instead of 2 for the number of
15115         static initializers.  
15116
15117         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
15118         because they are not really value types, just glorified integers. 
15119
15120         * driver.cs: Do not append .exe, the CSC compiler does not do it.
15121
15122         * ecore.cs: Remove redundant code for enumerations, make them use
15123         the same code path as everything else, fixes the casting issue
15124         with enumerations in Windows.Forms.
15125
15126         * attribute.cs: Do only cast to string if it is a string, the
15127         validation happens later.
15128
15129         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
15130         people upgrade their corlibs.
15131
15132         * ecore.cs: Oops, enumerations were not following the entire code path
15133
15134 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
15135
15136         * typemanager.cs (FilterWithClosure): Commented out the test for
15137         1540 in typemanager.cs, as it has problems when accessing
15138         protected methods from a parent class (see test-174.cs). 
15139
15140         * attribute.cs (Attribute.ValidateGuid): new method.
15141         (Attribute.Resolve): Use above.
15142
15143 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
15144
15145         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
15146
15147         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
15148         handling for enumerations, as we only needed the TypeContainer
15149         functionality to begin with (this is required for the fix below to
15150         work for enums that reference constants in a container class for
15151         example). 
15152
15153         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
15154
15155         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
15156         a valid TypeBuilder to perform lookups on.o
15157
15158         * class.cs (InheritableMemberSignatureCompare): Use true in the
15159         call to GetGetMethod and GetSetMethod, because we are comparing
15160         the signature, and we need to get the methods *even* if they are
15161         private. 
15162
15163         (PropertyBase.CheckBase): ditto.
15164
15165         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
15166         GotoCase.Resolve): Use Peel on EmpytCasts.
15167
15168         * ecore.cs (EmptyCast): drop child, add Peel method.
15169
15170 2002-11-17  Martin Baulig  <martin@ximian.com>
15171
15172         * ecore.cs (EmptyCast.Child): New public property.
15173
15174         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
15175         label resolved to an EmptyCast.  Fixes #34162.
15176         (GotoCase.Resolve): Likewise.
15177         (Block.EmitMeta): Likewise.
15178
15179 2002-11-17  Martin Baulig  <martin@ximian.com>
15180
15181         * expression.cs (Invocation.BetterConversion): Prefer int over
15182         uint; short over ushort; long over ulong for integer literals.
15183         Use ImplicitConversionExists instead of StandardConversionExists
15184         since we also need to check for user-defined implicit conversions.
15185         Fixes #34165.  Added test-173.cs.
15186
15187 2002-11-16  Martin Baulig  <martin@ximian.com>
15188
15189         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
15190         with the `true' and `false' literals.  Fixes #33151.
15191
15192 2002-11-16  Martin Baulig  <martin@ximian.com>
15193
15194         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
15195         October 22nd; don't do the cs1540 check for static members.
15196
15197         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
15198         now using our own filter here and doing the cs1540 check again.
15199
15200 2002-11-16  Martin Baulig  <martin@ximian.com>
15201
15202         * support.cs (InternalParameters): Don't crash if we don't have
15203         any fixed parameters.  Fixes #33532.
15204
15205 2002-11-16  Martin Baulig  <martin@ximian.com>
15206
15207         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
15208         when looking up static methods to make this work on Windows.
15209         Fixes #33773.
15210
15211 2002-11-16  Martin Baulig  <martin@ximian.com>
15212
15213         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
15214         a setter rather than using PropertyInfo.CanWrite.
15215
15216 2002-11-15  Nick Drochak  <ndrochak@gol.com>
15217
15218         * class.cs: Allow acces to block member by subclasses. Fixes build
15219         breaker.
15220
15221 2002-11-14  Martin Baulig  <martin@ximian.com>
15222
15223         * class.cs (Constructor.Emit): Added the extern/block check.
15224         Fixes bug #33678.
15225
15226 2002-11-14  Martin Baulig  <martin@ximian.com>
15227
15228         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
15229         iteration while looking for indexers, this is needed because the
15230         indexer may have a different name in our base classes.  Fixed the
15231         error reporting (no indexers at all, not get accessor, no
15232         overloaded match).  Fixes bug #33089.
15233         (IndexerAccess.DoResolveLValue): Likewise.
15234
15235 2002-11-14  Martin Baulig  <martin@ximian.com>
15236
15237         * class.cs (PropertyBase.CheckBase): Make this work for multiple
15238         indexers.  Fixes the first part of bug #33089.
15239         (MethodSignature.InheritableMemberSignatureCompare): Added support
15240         for properties.
15241
15242 2002-11-13  Ravi Pratap  <ravi@ximian.com>
15243
15244         * attribute.cs (Attribute.Resolve): Catch the
15245         NullReferenceException and report it since it isn't supposed to
15246         happen. 
15247
15248 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
15249
15250         * expression.cs (Binary.EmitBranchable): Also handle the cases for
15251         LogicalOr and LogicalAnd that can benefit from recursively
15252         handling EmitBranchable.  The code now should be nice for Paolo.
15253
15254 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
15255
15256         * typemanager.cs (LookupType): Added a negative-hit hashtable for
15257         the Type lookups, as we perform quite a number of lookups on
15258         non-Types.  This can be removed once we can deterministically tell
15259         whether we have a type or a namespace in advance.
15260
15261         But this might require special hacks from our corlib.
15262
15263         * TODO: updated.
15264
15265         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
15266         and double which avoids a conversion from an integer to a double.
15267
15268         * expression.cs: tiny optimization, avoid calling IsConstant,
15269         because it effectively performs the lookup twice.
15270
15271 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
15272
15273         But a bogus return here to keep the semantics of the old code
15274         until the Mono runtime is fixed.
15275
15276         * pending.cs (GetMissingInterfaces): New method used to remove all
15277         the interfaces that are already implemented by our parent
15278         classes from the list of pending methods. 
15279
15280         * interface.cs: Add checks for calls after ResolveTypeExpr.
15281
15282 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
15283
15284         * class.cs (Class.Emit): Report warning 67: event not used if the
15285         warning level is beyond 3.
15286
15287         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
15288         being a NullLiteral.
15289
15290         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
15291         specifiers. 
15292
15293         * class.cs (TypeContainer.GetClassBases): Cover a missing code
15294         path that might fail if a type can not be resolved.
15295
15296         * expression.cs (Binary.Emit): Emit unsigned versions of the
15297         operators. 
15298
15299         * driver.cs: use error 5.
15300
15301 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
15302
15303         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
15304
15305 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
15306
15307         * cs-parser.jay (switch_section): A beautiful patch from Martin
15308         Baulig that fixed 33094.
15309
15310 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
15311
15312         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15313         Check whether the base is abstract and report an error if so.
15314
15315         * expression.cs (IndexerAccess.DoResolveLValue,
15316         IndexerAccess.DoResolve): ditto. 
15317
15318         (Invocation.DoResolve): ditto.
15319
15320         (Invocation.FullMethodDesc): Improve the report string.
15321
15322         * statement.cs (Block): Eliminate IsVariableDefined as it is
15323         basically just a wrapper for GetVariableInfo.
15324
15325         * ecore.cs (SimpleName): Use new 
15326
15327         * support.cs (ReflectionParamter.ParameterType): We unwrap the
15328         type, as we return the actual parameter ref/unref state on a
15329         different call.
15330
15331 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
15332
15333         * support.cs: Return proper flags REF/OUT fixing the previous
15334         commit.  
15335
15336         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
15337         not used to mean `ref' but `ref or out' in ParameterReference
15338
15339         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15340         full type signature instead of calling TypeManger.CSharpName
15341         ourselves. 
15342
15343         * support.cs (InternalParameters.ParameterDesc): Do not compare
15344         directly to the modflags, because REF/OUT will actually be bitsets
15345         if set. 
15346
15347         * delegate.cs (VerifyMethod): Check also the modifiers.
15348
15349         * cs-tokenizer.cs: Fix bug where floating point values with an
15350         exponent where a sign was missing was ignored.
15351
15352         * driver.cs: Allow multiple assemblies to be specified in a single
15353         /r: argument
15354
15355 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
15356
15357         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
15358         because identifiers after a parenthesis would end up in this kind
15359         of production, and we needed to desamiguate it for having casts
15360         like:
15361
15362                 (UserDefinedType *) xxx
15363
15364 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
15365
15366         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
15367         we should set on the Bindingflags.NonPublic, but not turn on
15368         private_ok.  private_ok controls whether a Private member is
15369         returned (this is chekced on the filter routine), while the
15370         BindingFlags.NonPublic just controls whether private/protected
15371         will be allowed.   This fixes the problem part of the problem of
15372         private properties being allowed to be used in derived classes.
15373
15374         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
15375         so we can call the children DoResolveLValue method (this will
15376         properly signal errors on lvalue assignments to base properties)
15377
15378         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
15379         getter are null, and we have a property info, we know that this
15380         happened because the lookup failed, so we report an error 122 for
15381         protection level violation.
15382
15383         We also silently return if setter and getter are null in the
15384         resolve functions, this condition only happens if we have flagged
15385         the error before.  This is the other half of the problem. 
15386
15387         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15388         not have accessibility information, that is why we were returning
15389         true in the filter function in typemanager.cs.
15390
15391         To properly report 122 (property is inaccessible because of its
15392         protection level) correctly, we report this error in ResolveAccess
15393         by failing if both the setter and the getter are lacking (ie, the
15394         lookup failed). 
15395
15396         DoResolve and DoLResolve have been modified to check for both
15397         setter/getter being null and returning silently, the reason being
15398         that I did not want to put the knowledge about this error in upper
15399         layers, like:
15400
15401         int old = Report.Errors;
15402         x = new PropertyExpr (...);
15403         if (old != Report.Errors)
15404                 return null;
15405         else
15406                 return x;
15407
15408         So the property expr is returned, but it is invalid, so the error
15409         will be flagged during the resolve process. 
15410
15411         * class.cs: Remove InheritablePropertySignatureCompare from the
15412         class, as we no longer depend on the property signature to compute
15413         whether it is possible to implement a method or not.
15414
15415         The reason is that calling PropertyInfo.GetGetMethod will return
15416         null (in .NET, in Mono it works, and we should change this), in
15417         cases where the Get Method does not exist in that particular
15418         class.
15419
15420         So this code:
15421
15422         class X { public virtual int A { get { return 1; } } }
15423         class Y : X { }
15424         class Z : Y { public override int A { get { return 2; } } }
15425
15426         Would fail in Z because the parent (Y) would not have the property
15427         defined.  So we avoid this completely now (because the alternative
15428         fix was ugly and slow), and we now depend exclusively on the
15429         method names.
15430
15431         (PropertyBase.CheckBase): Use a method-base mechanism to find our
15432         reference method, instead of using the property.
15433
15434         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15435         routines are gone now.
15436
15437         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15438         names, they were incorrectly named.
15439
15440         * cs-tokenizer.cs: Return are more gentle token on failure. 
15441
15442         * pending.cs (PendingImplementation.InterfaceMethod): This routine
15443         had an out-of-sync index variable, which caused it to remove from
15444         the list of pending methods the wrong method sometimes.
15445
15446 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
15447
15448         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15449         CanWrite, because those refer to this particular instance of the
15450         property, and do not take into account the fact that we can
15451         override single members of a property.
15452
15453         Constructor requires an EmitContext.  The resolution process does
15454         not happen here, but we need to compute the accessors before,
15455         because the resolution does not always happen for properties.
15456
15457         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15458         subclass, before we did not update this flag, but we did update
15459         bindingflags. 
15460
15461         (GetAccessors): Drop this routine, as it did not work in the
15462         presence of partially overwritten set/get methods. 
15463
15464         Notice that this broke the cs1540 detection, but that will require
15465         more thinking. 
15466
15467 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15468
15469         * class.cs:
15470         * codegen.cs:
15471         * driver.cs: issue a warning instead of an error if we don't support
15472         debugging for the platform. Also ignore a couple of errors that may
15473         arise when trying to write the symbols. Undo my previous patch.
15474
15475 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15476
15477         * driver.cs: ignore /debug switch except for Unix platforms.
15478
15479 2002-10-23  Nick Drochak  <ndrochak@gol.com>
15480
15481         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15482
15483 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
15484
15485         * driver.cs: Do not make mcs-debug conditional, so we do not break
15486         builds that use it.
15487
15488         * statement.cs (UsageVector.MergeChildren): I would like Martin to
15489         review this patch.  But basically after all the children variables
15490         have been merged, the value of "Breaks" was not being set to
15491         new_breaks for Switch blocks.  I think that it should be set after
15492         it has executed.  Currently I set this to the value of new_breaks,
15493         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15494         conservative, but I do not understand this code very well.
15495
15496         I did not break anything in the build, so that is good ;-)
15497
15498         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15499
15500 2002-10-20  Mark Crichton  <crichton@gimp.org>
15501
15502         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
15503
15504 2002-10-20  Nick Drochak  <ndrochak@gol.com>
15505
15506         * cfold.cs: Fixed compile blocker.
15507
15508 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
15509
15510         * driver.cs: I was chekcing the key, not the file.
15511
15512 2002-10-19  Ravi Pratap  <ravi@ximian.com>
15513
15514         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15515         message that we were generating - we just need to silently return
15516         a null.
15517
15518 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
15519
15520         * class.cs (Event.Define): Change my previous commit, as this
15521         breaks the debugger.  This is a temporary hack, as it seems like
15522         the compiler is generating events incorrectly to begin with.
15523
15524         * expression.cs (Binary.ResolveOperator): Added support for 
15525         "U operator - (E x, E y)"
15526
15527         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15528         y)".
15529
15530         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15531         init-only variables, but this path did not take into account that
15532         there might be also instance readonly variables.  Correct this
15533         problem. 
15534
15535         This fixes bug 32253
15536
15537         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15538         delegates as well.
15539
15540         * driver.cs: Change the extension for modules to `netmodule'
15541
15542         * cs-parser.jay: Improved slightly the location tracking for
15543         the debugger symbols.
15544
15545         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15546         modifiers that were specified instead of the hardcoded value
15547         (FamAndAssem).  This was basically ignoring the static modifier,
15548         and others.  Fixes 32429.
15549
15550         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15551         fixed a bug in the process (32476)
15552
15553         * expression.cs (ArrayAccess.EmitAssign): Patch from
15554         hwang_rob@yahoo.ca that fixes bug 31834.3
15555
15556 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
15557
15558         * driver.cs: Make the module extension .netmodule.
15559
15560 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
15561
15562         * driver.cs: Report an error if the resource file is not found
15563         instead of crashing.
15564
15565         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15566         false, like Emit does.
15567
15568 2002-10-16  Nick Drochak  <ndrochak@gol.com>
15569
15570         * typemanager.cs: Remove unused private member.  Also reported mcs
15571         bug to report this as a warning like csc.
15572
15573 2002-10-15  Martin Baulig  <martin@gnome.org>
15574
15575         * statement.cs (Statement.Emit): Made this a virtual method; emits
15576         the line number info and calls DoEmit().
15577         (Statement.DoEmit): New protected abstract method, formerly knows
15578         as Statement.Emit().
15579
15580         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15581
15582 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
15583
15584         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15585         have fixed a remaining problem: not every AddXXXX was adding a
15586         fully qualified name.  
15587
15588         Now everyone registers a fully qualified name in the DeclSpace as
15589         being defined instead of the partial name.  
15590
15591         Downsides: we are slower than we need to be due to the excess
15592         copies and the names being registered this way.  
15593
15594         The reason for this is that we currently depend (on the corlib
15595         bootstrap for instance) that types are fully qualified, because
15596         we dump all the types in the namespace, and we should really have
15597         types inserted into the proper namespace, so we can only store the
15598         basenames in the defined_names array.
15599
15600 2002-10-10  Martin Baulig  <martin@gnome.org>
15601
15602         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15603         from bug #31834, see the bug report for a testcase which is
15604         miscompiled.
15605
15606 2002-10-10  Martin Baulig  <martin@gnome.org>
15607
15608         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
15609         flow analysis code for this.
15610
15611         * statement.cs (Do, While, For): Tell the flow analysis code about
15612         infinite loops.
15613         (FlowBranching.UsageVector): Added support for infinite loops.
15614         (Block.Resolve): Moved the dead code elimination here and use flow
15615         analysis to do it.
15616
15617 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
15618
15619         * class.cs (Field.Define): Catch cycles on struct type
15620         definitions. 
15621
15622         * typemanager.cs (IsUnmanagedtype): Do not recursively check
15623         fields if the fields are static.  We only need to check instance
15624         fields. 
15625
15626         * expression.cs (As.DoResolve): Test for reference type.
15627
15628         * statement.cs (Using.ResolveExpression): Use
15629         ConvertImplicitRequired, not ConvertImplicit which reports an
15630         error on failture
15631         (Using.ResolveLocalVariableDecls): ditto.
15632
15633         * expression.cs (Binary.ResolveOperator): Report errors in a few
15634         places where we had to.
15635
15636         * typemanager.cs (IsUnmanagedtype): Finish implementation.
15637
15638 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
15639
15640         * expression.cs: Use StoreFromPtr instead of extracting the type
15641         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
15642
15643         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
15644         an enumeration value to a System.Enum, but System.Enum is not a
15645         value type, but an class type, so we need to box.
15646
15647         (Expression.ConvertExplicit): One codepath could return
15648         errors but not flag them.  Fix this.  Fixes #31853
15649
15650         * parameter.cs (Resolve): Do not allow void as a parameter type.
15651
15652 2002-10-06  Martin Baulig  <martin@gnome.org>
15653
15654         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
15655         if it's a class type and not a struct.  Fixes #31815.
15656
15657 2002-10-06  Martin Baulig  <martin@gnome.org>
15658
15659         * statement.cs: Reworked the flow analysis code a bit to make it
15660         usable for dead code elimination.
15661
15662 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15663
15664         * cs-parser.jay: allow empty source files. Fixes bug #31781.
15665
15666 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15667
15668         * expression.cs (ComposedCast.DoResolveType): A quick workaround
15669         to fix the test 165, will investigate deeper.
15670
15671 2002-10-04  Martin Baulig  <martin@gnome.org>
15672
15673         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
15674         finally blocks actually work.
15675         (Try.Resolve): We don't need to create a sibling for `finally' if
15676         there is no finally block.
15677
15678 2002-10-04  Martin Baulig  <martin@gnome.org>
15679
15680         * class.cs (Constructor.Define): The default accessibility for a
15681         non-default constructor is private, not public.
15682
15683 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15684
15685         * class.cs (Constructor): Make AllowedModifiers public, add
15686         EXTERN.
15687
15688         * cs-parser.jay: Perform the modifiers test here, as the
15689         constructor for the Constructor class usually receives a zero
15690         because of the way we create it (first we create, later we
15691         customize, and we were never checking the modifiers).
15692
15693         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
15694         is a version of LookupTypeReflection that includes the type-name
15695         cache.  This can be used as a fast path for functions that know
15696         the fully qualified name and are only calling into *.GetType() to
15697         obtain a composed type.
15698
15699         This is also used by TypeManager.LookupType during its type
15700         composition.
15701
15702         (LookupType): We now also track the real type name, as sometimes
15703         we can get a quey for the real type name from things like
15704         ComposedCast.  This fixes bug 31422.
15705
15706         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
15707         complete type fullname, it does not have to go through the type
15708         resolution system to obtain the composed version of the type (for
15709         obtaining arrays or pointers).
15710
15711         (Conditional.Emit): Use the EmitBoolExpression to
15712         generate nicer code, as requested by Paolo.
15713
15714         (ArrayCreation.CheckIndices): Use the patch from
15715         hwang_rob@yahoo.ca to validate the array initializers. 
15716
15717 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
15718
15719         * class.cs (ConstructorInitializer.Emit): simplify code by using
15720         Invocation.EmitCall, and at the same time, fix the bugs in calling
15721         parent constructors that took variable arguments. 
15722
15723         * ecore.cs (Expression.ConvertNumericExplicit,
15724         Expression.ImplicitNumericConversion): Remove the code that
15725         manually wrapped decimal (InternalTypeConstructor call is now gone
15726         as well).
15727
15728         * expression.cs (Cast.TryReduce): Also handle decimal types when
15729         trying to perform a constant fold on the type.
15730
15731         * typemanager.cs (IsUnmanagedtype): Partially implemented.
15732
15733         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
15734         that only turned off an error report, and did nothing else. 
15735
15736 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
15737
15738         * driver.cs: Handle and ignore /fullpaths
15739
15740 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
15741
15742         * expression.cs (Binary.ResolveOperator): Catch the case where
15743         DoNumericPromotions returns true, 
15744
15745         (Binary.DoNumericPromotions): Simplify the code, and the tests.
15746
15747 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
15748
15749         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
15750         report error 70.
15751
15752 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
15753
15754         * ecore.cs (ConvertNumericExplicit): It is not enough that the
15755         conversion exists, but it is also required that the conversion be
15756         performed.  This manifested in "(Type64Enum) 2".  
15757
15758         * class.cs (TypeManager.AddMethod): The fix is not to change
15759         AddEnum, because that one was using a fully qualified name (every
15760         DeclSpace derivative does), but to change the AddMethod routine
15761         that was using an un-namespaced name.  This now correctly reports
15762         the duplicated name.
15763
15764         Revert patch until I can properly fix it.  The issue
15765         is that we have a shared Type space across all namespaces
15766         currently, which is wrong.
15767
15768         Options include making the Namespace a DeclSpace, and merge
15769         current_namespace/current_container in the parser.
15770
15771 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
15772
15773         * cs-parser.jay: Improve error reporting when we get a different
15774         kind of expression in local_variable_type and
15775         local_variable_pointer_type. 
15776
15777         Propagate this to avoid missleading errors being reported.
15778
15779         * ecore.cs (ImplicitReferenceConversion): treat
15780         TypeManager.value_type as a target just like object_type.   As
15781         code like this:
15782
15783         ValueType v = 1;
15784
15785         Is valid, and needs to result in the int 1 being boxed before it
15786         is assigned to the value type v.
15787
15788         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
15789         to validate the enumeration name.
15790
15791         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
15792         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
15793         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
15794
15795         * ecore.cs (TryImplicitIntConversion): When doing an
15796         implicit-enumeration-conversion, check if the type is 64-bits and
15797         perform a conversion before passing to EnumConstant.
15798
15799 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
15800
15801         * decl.cs (Error_AmbiguousTypeReference); New routine used to
15802         report ambiguous type references.  Unlike the MS version, we
15803         report what the ambiguity is.   Innovation at work ;-)
15804
15805         (DeclSpace.FindType): Require a location argument to
15806         display when we display an ambiguous error.
15807
15808         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
15809
15810         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
15811
15812         * expression.cs (EmitDynamicInitializers): Apply patch from
15813         hwang_rob@yahoo.ca that fixes the order in which we emit our
15814         initializers. 
15815
15816 2002-09-21  Martin Baulig  <martin@gnome.org>
15817
15818         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
15819         delegate takes no arguments.
15820
15821 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
15822
15823         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
15824         from integers.
15825
15826         * expression.cs: Extract the underlying type.
15827
15828         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
15829
15830         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
15831
15832 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
15833
15834         * class.cs (TypeContainer.DefineType): We can not use the nice
15835         PackingSize with the size set to 1 DefineType method, because it
15836         will not allow us to define the interfaces that the struct
15837         implements.
15838
15839         This completes the fixing of bug 27287
15840
15841         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
15842         means also structs.  This fixes part of the problem. 
15843         (Expresion.ImplicitReferenceConversionExists): ditto.
15844
15845         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
15846         error if there were no errors reported during the type lookup
15847         process, to avoid duplicates or redundant errors.  Without this
15848         you would get an ambiguous errors plus a type not found.  We have
15849         beaten the user enough with the first error.  
15850
15851         (DeclSparce.FindType): Emit a warning if we have an ambiguous
15852         reference. 
15853
15854         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
15855         during the resolution process, stop the lookup, this avoids
15856         repeated error reports (same error twice).
15857
15858         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
15859
15860         * typemanager.cs (LookupType): Redo the type lookup code to match
15861         the needs of System.Reflection.  
15862
15863         The issue is that System.Reflection requires references to nested
15864         types to begin with a "+" sign instead of a dot.  So toplevel
15865         types look like: "NameSpace.TopLevelClass", and nested ones look
15866         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
15867         levels. 
15868
15869 2002-09-19  Martin Baulig  <martin@gnome.org>
15870
15871         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
15872         says that a method always returns or always throws an exception,
15873         don't report the CS0161.
15874
15875         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
15876         set `Returns = new_returns'.
15877
15878 2002-09-19  Martin Baulig  <martin@gnome.org>
15879
15880         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
15881         to an enum constant, check for a CS0176.
15882
15883 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
15884
15885         * class.cs (TypeContainer.CheckPairedOperators): Now we check
15886         for operators that must be in pairs and report errors.
15887
15888         * ecore.cs (SimpleName.DoResolveType): During the initial type
15889         resolution process, when we define types recursively, we must
15890         check first for types in our current scope before we perform
15891         lookups in the enclosing scopes.
15892
15893         * expression.cs (MakeByteBlob): Handle Decimal blobs.
15894
15895         (Invocation.VerifyArgumentsCompat): Call
15896         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
15897         I thought we were supposed to always call this, but there are a
15898         few places in the code where we dont do it.
15899
15900 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
15901
15902         * driver.cs: Add support in -linkres and -resource to specify the
15903         name of the identifier.
15904
15905 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
15906
15907         * ecore.cs (StandardConversionExists): Sync with the conversion
15908         code: allow anything-* to void* conversions.
15909
15910         (FindMostSpecificSource): Use an Expression argument
15911         instead of a Type, because we might be handed over a Literal which
15912         gets a few more implicit conversions that plain types do not.  So
15913         this information was being lost.
15914
15915         Also, we drop the temporary type-holder expression when not
15916         required.
15917
15918 2002-09-17  Martin Baulig  <martin@gnome.org>
15919
15920         * class.cs (PropertyBase.CheckBase): Don't check the base class if
15921         this is an explicit interface implementation.
15922
15923 2002-09-17  Martin Baulig  <martin@gnome.org>
15924
15925         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
15926         different `IndexerName' attributes.
15927
15928         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
15929         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
15930         virtual CommonResolve().
15931
15932 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
15933
15934         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
15935         and convert that to the UnderlyingType.
15936
15937         * statement.cs (Foreach.Resolve): Indexers are just like variables
15938         or PropertyAccesses.
15939
15940         * cs-tokenizer.cs (consume_string): Track line numbers and columns
15941         inside quoted strings, we were not doing this before.
15942
15943 2002-09-16  Martin Baulig  <martin@gnome.org>
15944
15945         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
15946         resolve it.  This is needed for the definite assignment check of the
15947         instance expression, fixes bug #29846.
15948         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
15949
15950 2002-09-16  Nick Drochak  <ndrochak@gol.com>
15951
15952         * parameter.cs: Fix compile error.  Cannot reference static member
15953         from an instance object.  Is this an mcs bug?
15954
15955 2002-09-14  Martin Baulig  <martin@gnome.org>
15956
15957         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
15958         multiple times.  Fixes bug #30295, added test-166.cs.
15959
15960 2002-09-14  Martin Baulig  <martin@gnome.org>
15961
15962         * statement.cs (Block.Emit): Don't emit unreachable code.
15963         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
15964         `break' statements.
15965         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
15966
15967 2002-09-14  Martin Baulig  <martin@gnome.org>
15968
15969         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
15970         is set.
15971
15972 2002-09-14  Martin Baulig  <martin@gnome.org>
15973
15974         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
15975         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
15976         be false on the ms runtime.
15977
15978 2002-09-13  Martin Baulig  <martin@gnome.org>
15979
15980         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
15981         the CS0038 error message.
15982
15983 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
15984
15985         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
15986         constant inside, return it.
15987
15988 2002-09-12  Martin Baulig  <martin@gnome.org>
15989
15990         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
15991         implicit conversion can be done between enum types.
15992
15993         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
15994         check whether an implicit conversion to the current enum's UnderlyingType
15995         exists and report an error if not.
15996
15997         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
15998         without debugging support.
15999
16000         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
16001         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
16002
16003 2002-09-12  Martin Baulig  <martin@gnome.org>
16004
16005         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
16006
16007         * ecore.cs (IMemberExpr.DeclaringType): New property.
16008         (SimpleName.SimpleNameResolve): Check whether we're accessing a
16009         nonstatic member of an outer type (CS0038).
16010
16011 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
16012
16013         * driver.cs: Activate the using-error detector at warning level
16014         4 (at least for MS-compatible APIs).
16015
16016         * namespace.cs (VerifyUsing): Small buglett fix.
16017
16018         * pending.cs (PendingImplementation): pass the container pointer. 
16019
16020         * interface.cs (GetMethods): Allow for recursive definition.  Long
16021         term, I would like to move every type to support recursive
16022         definitions, not the current ordering mechanism that we have right
16023         now.
16024
16025         The situation is this: Attributes are handled before interfaces,
16026         so we can apply attributes to interfaces.  But some attributes
16027         implement interfaces, we will now handle the simple cases
16028         (recursive definitions will just get an error).  
16029
16030         * parameter.cs: Only invalidate types at the end if we fail to
16031         lookup all types.  
16032
16033 2002-09-09  Martin Baulig  <martin@gnome.org>
16034
16035         * ecore.cs (PropertyExpr.Emit): Also check for
16036         TypeManager.system_int_array_get_length so this'll also work when
16037         compiling corlib.  Fixes #30003.
16038
16039 2002-09-09  Martin Baulig  <martin@gnome.org>
16040
16041         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
16042         and throw an exception if we can't get the type's size.  Fixed #30040,
16043         added test-165.cs.
16044
16045 2002-09-09  Martin Baulig  <martin@gnome.org>
16046
16047         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
16048
16049         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
16050         context.  Fixes bug #30027.
16051
16052         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
16053         virtual functions.  Fixes bug #30043, added test-164.cs.
16054
16055 2002-09-08  Ravi Pratap  <ravi@ximian.com>
16056
16057         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
16058
16059 2002-09-08  Nick Drochak  <ndrochak@gol.com>
16060
16061         * driver.cs: Use an object to get the windows codepage since it's not a
16062         static property.
16063
16064 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
16065
16066         * statement.cs (For.Emit): for infinite loops (test == null)
16067         return whether there is a break inside, not always "true".
16068
16069         * namespace.cs (UsingEntry): New struct to hold the name of the
16070         using definition, the location where it is defined, and whether it
16071         has been used in a successful type lookup.
16072
16073         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
16074         strings.
16075
16076         * decl.cs: ditto.
16077
16078 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16079
16080         * attribute.cs : Fix incorrect code which relied on catching
16081         a NullReferenceException to detect a null being passed in
16082         where an object was expected.
16083
16084 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
16085
16086         * statement.cs (Try): flag the catch variable as assigned
16087
16088         * expression.cs (Cast): Simplified by using ResolveType instead of
16089         manually resolving.
16090
16091         * statement.cs (Catch): Fix bug by using ResolveType.
16092
16093 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16094
16095         * expression.cs (BetterConversion): Special case for when we have
16096         a NullLiteral as the argument and we have to choose between string
16097         and object types - we choose string the way csc does.
16098
16099         * attribute.cs (Attribute.Resolve): Catch the
16100         NullReferenceException and report error #182 since the Mono
16101         runtime no more has the bug and having this exception raised means
16102         we tried to select a constructor which takes an object and is
16103         passed a null.
16104
16105 2002-09-05  Ravi Pratap  <ravi@ximian.com>
16106
16107         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
16108         message (1502, 1503) when we can't locate a method after overload
16109         resolution. This is much more informative and closes the bug
16110         Miguel reported.
16111
16112         * interface.cs (PopulateMethod): Return if there are no argument
16113         types. Fixes a NullReferenceException bug.
16114
16115         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
16116         expressions too. Previously we were checking only in one place for
16117         positional arguments leaving out named arguments.
16118
16119         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
16120         type to the enum type is not allowed. Remove code corresponding to
16121         that.
16122
16123         (ConvertNumericExplicit): Allow explicit conversions from
16124         the underlying type to enum type. This precisely follows the spec
16125         and closes a bug filed by Gonzalo.
16126
16127 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16128
16129         * compiler.csproj:
16130         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
16131
16132 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
16133
16134         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
16135         it was important that we stored the right value after the
16136         reduction in `converted'.
16137
16138 2002-09-04  Martin Baulig  <martin@gnome.org>
16139
16140         * location.cs (Location.SymbolDocument): Use full pathnames for the
16141         source files.
16142
16143 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
16144
16145         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
16146         of the expression resolve mechanism, because that will catch the
16147         SimpleName error failures.
16148
16149         (Conditional): If we can not resolve the
16150         expression, return, do not crash.
16151
16152 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16153
16154         * cs-tokenizer.cs:
16155         (location): display token name instead of its number.
16156
16157 2002-08-28  Martin Baulig  <martin@gnome.org>
16158
16159         * expression.cs (Binary.ResolveOperator): Don't silently return
16160         but return an error if an operator cannot be applied between two
16161         enum types.
16162
16163 2002-08-28  Martin Baulig  <martin@gnome.org>
16164
16165         * class.cs (Constructor.Define): Set the permission attributes
16166         correctly instead of making all constructors public.
16167
16168 2002-08-28  Martin Baulig  <martin@gnome.org>
16169
16170         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
16171         for private members before reporting a CS0103; if we find anything,
16172         it's a CS0122.
16173
16174 2002-08-28  Martin Baulig  <martin@gnome.org>
16175
16176         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
16177         to check whether `closure_start_type == closure_invocation_type',
16178         we also need to check whether `m.DeclaringType == closure_invocation_type'
16179         before bypassing the permission checks.  We might be accessing
16180         protected/private members from the base class.
16181         (TypeManager.RealMemberLookup): Only set private_ok if private
16182         members were requested via BindingFlags.NonPublic.
16183
16184         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
16185
16186         * expression.cs (MemberAccess.ResolveMemberAccess): Set
16187         MethodGroupExpr.IsExplicitImpl if appropriate.
16188         (Invocation.DoResolve): Don't report the CS0120 for explicit
16189         interface implementations.
16190
16191 2002-08-27  Martin Baulig  <martin@gnome.org>
16192
16193         * expression.cs (Invocation.DoResolve): If this is a static
16194         method and we don't have an InstanceExpression, we must report
16195         a CS0120.
16196
16197 2002-08-25  Martin Baulig  <martin@gnome.org>
16198
16199         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
16200         `==' between a valuetype and an object.
16201
16202 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
16203
16204         * ecore.cs (TypeExpr): Provide a ToString method.
16205
16206 2002-08-24  Martin Baulig  <martin@gnome.org>
16207
16208         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
16209         now called proggie.dbg and it's a binary file.
16210
16211 2002-08-23  Martin Baulig  <martin@gnome.org>
16212
16213         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
16214
16215 2002-08-23  Martin Baulig  <martin@gnome.org>
16216
16217         * struct.cs (MyStructInfo.ctor): Make this work with empty
16218         structs; it's not allowed to use foreach() on null.
16219
16220 2002-08-23  Martin Baulig  <martin@gnome.org>
16221
16222         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
16223         writer the full pathname of the generated assembly.
16224
16225 2002-08-23  Martin Baulig  <martin@gnome.org>
16226
16227         * statements.cs (FlowBranching.UsageVector.MergeChildren):
16228         A `finally' block never returns or breaks; improved handling of
16229         unreachable code.
16230
16231 2002-08-23  Martin Baulig  <martin@gnome.org>
16232
16233         * statement.cs (Throw.Resolve): Allow `throw null'.
16234
16235 2002-08-23  Martin Baulig  <martin@gnome.org>
16236
16237         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
16238         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
16239         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
16240         MemberLookup would return a wrong event if this is an explicit
16241         interface implementation and the class has an event with the same
16242         name.
16243
16244 2002-08-23  Martin Baulig  <martin@gnome.org>
16245
16246         * statement.cs (Block.AddChildVariableNames): New public method.
16247         (Block.AddChildVariableName): Likewise.
16248         (Block.IsVariableNameUsedInChildBlock): Likewise.
16249         (Block.AddVariable): Check whether a variable name has already
16250         been used in a child block.
16251
16252         * cs-parser.jay (declare_local_variables): Mark all variable names
16253         from the current block as being used in a child block in the
16254         implicit block.
16255
16256 2002-08-23  Martin Baulig  <martin@gnome.org>
16257
16258         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
16259         find the symbol writer.
16260
16261         * driver.cs: csc also allows the arguments to /define being
16262         separated by commas, not only by semicolons.
16263
16264 2002-08-23  Martin Baulig  <martin@gnome.org>
16265
16266         * interface.cs (Interface.GetMembers): Added static check for events.
16267
16268 2002-08-15  Martin Baulig  <martin@gnome.org>
16269
16270         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
16271         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
16272
16273         * ecore.cs (Expression.MemberLookup): Added documentation and explained
16274         why the MethodData.EmitDestructor() change was necessary.
16275
16276 2002-08-20  Martin Baulig  <martin@gnome.org>
16277
16278         * class.cs (TypeContainer.FindMembers): Added static check for events.
16279
16280         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
16281
16282         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
16283         use Type.GetEvents(), not Type.FindMembers().
16284
16285 2002-08-20  Martin Baulig  <martin@gnome.org>
16286
16287         * decl.cs (MemberCache): Added a special method cache which will
16288         be used for method-only searched.  This ensures that a method
16289         search will return a MethodInfo with the correct ReflectedType for
16290         inherited methods.      
16291
16292 2002-08-20  Martin Baulig  <martin@gnome.org>
16293
16294         * decl.cs (DeclSpace.FindMembers): Made this public.
16295
16296 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16297
16298         * delegate.cs: fixed build on windows.
16299         [FIXME:  Filed as bug #29150: MCS must report these errors.]
16300
16301 2002-08-19  Ravi Pratap  <ravi@ximian.com>
16302
16303         * ecore.cs (StandardConversionExists): Return a false
16304         if we are trying to convert the void type to anything else
16305         since that is not allowed.
16306
16307         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16308         we flag error 70 in the event an event is trying to be accessed
16309         directly from outside the declaring type.
16310
16311 2002-08-20  Martin Baulig  <martin@gnome.org>
16312
16313         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16314         MemberCache from typemanager.cs to decl.cs.
16315
16316 2002-08-19  Martin Baulig  <martin@gnome.org>
16317
16318         * class.cs (TypeContainer): Implement IMemberContainer.
16319         (TypeContainer.DefineMembers): Create the MemberCache.
16320         (TypeContainer.FindMembers): Do better BindingFlags checking; only
16321         return public members if BindingFlags.Public was given, check
16322         whether members are static.
16323
16324 2002-08-16  Martin Baulig  <martin@gnome.org>
16325
16326         * decl.cs (DeclSpace.Define): Splitted this in Define and
16327         DefineMembers.  DefineMembers is called first and initializes the
16328         MemberCache.
16329
16330         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
16331         DefineMembers() on all our DeclSpaces.
16332
16333         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16334         but call DefineMembers() on all nested interfaces.  We call their
16335         Define() in our new Define() function.
16336
16337         * interface.cs (Interface): Implement IMemberContainer.
16338         (Interface.Define): Moved all code except the attribute stuf to
16339         DefineMembers().
16340         (Interface.DefineMembers): Initialize the member cache.
16341
16342         * typemanager.cs (IMemberFinder): Removed this interface, we don't
16343         need this anymore since we can use MemberCache.FindMembers directly.
16344
16345 2002-08-19  Martin Baulig  <martin@gnome.org>
16346
16347         * typemanager.cs (MemberCache): When creating the cache for an
16348         interface type, add all inherited members.
16349         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16350         to `out bool used_cache' and documented it.
16351         (TypeManager.MemberLookup): If we already used the cache in the first
16352         iteration, we don't need to do the interfaces check.
16353
16354 2002-08-19  Martin Baulig  <martin@gnome.org>
16355
16356         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
16357         here from IMemberFinder and don't implement this interface anymore.
16358         (DeclSpace.MemberCache): Moved here from IMemberFinder.
16359
16360         * typemanager.cs (IMemberFinder): This interface is now only used by
16361         classes which actually support the member cache.
16362         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16363         since we only put DeclSpaces into this Hashtable.
16364         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
16365         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
16366
16367 2002-08-16  Martin Baulig  <martin@gnome.org>
16368
16369         * typemanager.cs (ICachingMemberFinder): Removed.
16370         (IMemberFinder.MemberCache): New property.
16371         (TypeManager.FindMembers): Merged this with RealFindMembers().
16372         This function will never be called from TypeManager.MemberLookup()
16373         so we can't use the cache here, just the IMemberFinder.
16374         (TypeManager.MemberLookup_FindMembers): Check whether the
16375         IMemberFinder has a MemberCache and call the cache's FindMembers
16376         function.
16377         (MemberCache): Rewrote larger parts of this yet another time and
16378         cleaned it up a bit.
16379
16380 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
16381
16382         * driver.cs (LoadArgs): Support quoting.
16383
16384         (Usage): Show the CSC-like command line arguments.
16385
16386         Improved a few error messages.
16387
16388 2002-08-15  Martin Baulig  <martin@gnome.org>
16389
16390         * typemanager.cs (IMemberContainer.Type): New property.
16391         (IMemberContainer.IsInterface): New property.
16392
16393         The following changes are conditional to BROKEN_RUNTIME, which is
16394         defined at the top of the file.
16395
16396         * typemanager.cs (MemberCache.MemberCache): Don't add the base
16397         class'es members, but add all members from TypeHandle.ObjectType
16398         if we're an interface.
16399         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16400         is the current type.
16401         (MemberCache.CacheEntry.Container): Removed this field.
16402         (TypeHandle.GetMembers): Include inherited members.
16403
16404 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16405
16406         * typemanager.cs: fixed compilation and added a comment on a field that
16407         is never used.
16408
16409 2002-08-15  Martin Baulig  <martin@gnome.org>
16410
16411         * class.cs (ConstructorInitializer.Resolve): In the
16412         Expression.MemberLookup call, use the queried_type as
16413         invocation_type.
16414
16415         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16416         declared' attribute, it's always true.
16417         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16418         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16419         temporary wrapper for FindMembers which tells MemberLookup whether
16420         members from the base classes are included in the return value.
16421         This will go away soon.
16422         (TypeManager.MemberLookup): Use this temporary hack here; once the
16423         new MemberCache is completed, we don't need to do the DeclaredOnly
16424         looping here anymore since the MemberCache will take care of this.
16425         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16426         (MemberCache): When creating the MemberCache for a class, get
16427         members from the current class and all its base classes.
16428         (MemberCache.CacheEntry.Container): New field.  This is a
16429         temporary hack until the Mono runtime is fixed to distinguish
16430         between ReflectedType and DeclaringType.  It allows us to use MCS
16431         with both the MS runtime and the unfixed Mono runtime without
16432         problems and without accecting performance.
16433         (MemberCache.SearchMembers): The DeclaredOnly looping from
16434         TypeManager.MemberLookup is now done here.      
16435
16436 2002-08-14  Martin Baulig  <martin@gnome.org>
16437
16438         * statement.cs (MyStructInfo.MyStructInfo): Don't call
16439         Type.GetFields on dynamic types but get the fields from the
16440         corresponding TypeContainer.
16441         (MyStructInfo.GetStructInfo): Added check for enum types.
16442
16443         * typemanager.cs (MemberList.IsSynchronized): Implemented.
16444         (MemberList.SyncRoot): Implemented.
16445         (TypeManager.FilterWithClosure): No need to check permissions if
16446         closure_start_type == closure_invocation_type, don't crash if
16447         closure_invocation_type is null.
16448
16449 2002-08-13  Martin Baulig  <martin@gnome.org>
16450
16451         Rewrote TypeContainer.FindMembers to use a member cache.  This
16452         gives us a speed increase of about 35% for the self-hosting MCS
16453         build and of about 15-20% for the class libs (both on GNU/Linux).
16454
16455         * report.cs (Timer): New class to get enhanced profiling.  This
16456         whole class is "TIMER" conditional since it remarkably slows down
16457         compilation speed.
16458
16459         * class.cs (MemberList): New class.  This is an IList wrapper
16460         which we're now using instead of passing MemberInfo[]'s around to
16461         avoid copying this array unnecessarily.
16462         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16463         (ICachingMemberFinder, IMemberContainer): New interface.
16464         (TypeManager.FilterWithClosure): If `criteria' is null, the name
16465         has already been checked, otherwise use it for the name comparision.
16466         (TypeManager.FindMembers): Renamed to RealMemberFinder and
16467         provided wrapper which tries to use ICachingMemberFinder.FindMembers
16468         if possible.  Returns a MemberList, not a MemberInfo [].
16469         (TypeHandle): New class, implements IMemberContainer.  We create
16470         one instance of this class per type, it contains a MemberCache
16471         which is used to do the member lookups.
16472         (MemberCache): New class.  Each instance of this class contains
16473         all members of a type and a name-based hash table.
16474         (MemberCache.FindMembers): This is our new member lookup
16475         function.  First, it looks up all members of the requested name in
16476         the hash table.  Then, it walks this list and sorts out all
16477         applicable members and returns them.
16478
16479 2002-08-13  Martin Baulig  <martin@gnome.org>
16480
16481         In addition to a nice code cleanup, this gives us a performance
16482         increase of about 1.4% on GNU/Linux - not much, but it's already
16483         half a second for the self-hosting MCS compilation.
16484
16485         * typemanager.cs (IMemberFinder): New interface.  It is used by
16486         TypeManager.FindMembers to call FindMembers on a TypeContainer,
16487         Enum, Delegate or Interface.
16488         (TypeManager.finder_to_member_finder): New PtrHashtable.
16489         (TypeManager.finder_to_container): Removed.
16490         (TypeManager.finder_to_delegate): Removed.
16491         (TypeManager.finder_to_interface): Removed.
16492         (TypeManager.finder_to_enum): Removed.
16493
16494         * interface.cs (Interface): Implement IMemberFinder.
16495
16496         * delegate.cs (Delegate): Implement IMemberFinder.
16497
16498         * enum.cs (Enum): Implement IMemberFinder.
16499
16500         * class.cs (TypeContainer): Implement IMemberFinder.
16501
16502 2002-08-12  Martin Baulig  <martin@gnome.org>
16503
16504         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16505
16506 2002-08-12  Martin Baulig  <martin@gnome.org>
16507
16508         * ecore.cs (ITypeExpression): New interface for expressions which
16509         resolve to a type.
16510         (TypeExpression): Renamed to TypeLookupExpression.
16511         (Expression.DoResolve): If we're doing a types-only lookup, the
16512         expression must implement the ITypeExpression interface and we
16513         call DoResolveType() on it.
16514         (SimpleName): Implement the new ITypeExpression interface.
16515         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16516         hack, the situation that we're only looking up types can't happen
16517         anymore when this method is called.  Moved the type lookup code to
16518         DoResolveType() and call it.
16519         (SimpleName.DoResolveType): This ITypeExpression interface method
16520         is now doing the types-only lookup.
16521         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16522         (ResolveFlags): Added MaskExprClass.
16523
16524         * expression.cs (MemberAccess): Implement the ITypeExpression
16525         interface.
16526         (MemberAccess.DoResolve): Added support for a types-only lookup
16527         when we're called via ITypeExpression.DoResolveType().
16528         (ComposedCast): Implement the ITypeExpression interface.
16529
16530         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
16531         Expression.Resolve() with ResolveFlags.Type instead.
16532
16533 2002-08-12  Martin Baulig  <martin@gnome.org>
16534
16535         * interface.cs (Interface.Define): Apply attributes.
16536
16537         * attribute.cs (Attribute.ApplyAttributes): Added support for
16538         interface attributes.
16539
16540 2002-08-11  Martin Baulig  <martin@gnome.org>
16541
16542         * statement.cs (Block.Emit): Only check the "this" variable if we
16543         do not always throw an exception.
16544
16545         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16546         whether the property has a set accessor.
16547
16548 2002-08-11  Martin Baulig  <martin@gnome.org>
16549
16550         Added control flow analysis support for structs.
16551
16552         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16553         with control flow analysis turned off.
16554         (IVariable): New interface.
16555         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16556         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16557         (FieldExpr.DoResolve): Resolve the instance expression with flow
16558         analysis turned off and do the definite assignment check after the
16559         resolving when we know what the expression will resolve to.
16560
16561         * expression.cs (LocalVariableReference, ParameterReference):
16562         Implement the new IVariable interface, only call the flow analysis
16563         code if ec.DoFlowAnalysis is true.
16564         (This): Added constructor which takes a Block argument.  Implement
16565         the new IVariable interface.
16566         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16567         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16568         This does the definite assignment checks for struct members.
16569
16570         * class.cs (Constructor.Emit): If this is a non-static `struct'
16571         constructor which doesn't have any initializer, call
16572         Block.AddThisVariable() to tell the flow analysis code that all
16573         struct elements must be initialized before control returns from
16574         the constructor.
16575
16576         * statement.cs (MyStructInfo): New public class.
16577         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16578         argument to this indexer.  If non-zero, check an individual struct
16579         member, not the whole struct.
16580         (FlowBranching.CheckOutParameters): Check struct members.
16581         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16582         overloaded versions of these methods which take an additional
16583         `int field_idx' argument to check struct members.
16584         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16585         overloaded versions of these methods which take an additional
16586         `string field_name' argument to check struct member.s
16587         (VariableInfo): Implement the IVariable interface.
16588         (VariableInfo.StructInfo): New public property.  Returns the
16589         MyStructInfo instance of the variable if it's a struct or null.
16590         (Block.AddThisVariable): New public method.  This is called from
16591         Constructor.Emit() for non-static `struct' constructor which do
16592         not have any initializer.  It creates a special variable for the
16593         "this" instance variable which will be checked by the flow
16594         analysis code to ensure that all of the struct's fields are
16595         initialized before control returns from the constructor.
16596         (UsageVector): Added support for struct members.  If a
16597         variable/parameter is a struct with N members, we reserve a slot
16598         in the usage vector for each member.  A struct is considered fully
16599         initialized if either the struct itself (slot 0) or all its
16600         members are initialized.
16601
16602 2002-08-08  Martin Baulig  <martin@gnome.org>
16603
16604         * driver.cs (Driver.MainDriver): Only report an error CS5001
16605         if there were no compilation errors.
16606
16607         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
16608         `UnsafeContext' property to determine whether the parent is in
16609         unsafe context rather than checking the parent's ModFlags:
16610         classes nested in an unsafe class are unsafe as well.
16611
16612 2002-08-08  Martin Baulig  <martin@gnome.org>
16613
16614         * statement.cs (UsageVector.MergeChildren): Distinguish between
16615         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
16616         we return.  Added test17() and test18() to test-154.cs.
16617
16618 2002-08-08  Martin Baulig  <martin@gnome.org>
16619
16620         * typemanager.cs (TypeManager.FilterWithClosure): If we have
16621         Family access, make sure the invoking type isn't a subclass of the
16622         queried type (that'd be a CS1540).
16623
16624         * ecore.cs (Expression.MemberLookup): Added overloaded version of
16625         this method which takes an additional `Type invocation_type'.
16626
16627         * expression.cs (BaseAccess.DoResolve): Use the base type as
16628         invocation and query type.
16629         (MemberAccess.DoResolve): If the lookup failed and we're about to
16630         report a CS0122, try a lookup with the ec.ContainerType - if this
16631         succeeds, we must report a CS1540.
16632
16633 2002-08-08  Martin Baulig  <martin@gnome.org>
16634
16635         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
16636         (MethodGroupExpr): Implement the IMemberExpr interface.
16637
16638         * expression (MemberAccess.ResolveMemberAccess): No need to have
16639         any special code for MethodGroupExprs anymore, they're now
16640         IMemberExprs.   
16641
16642 2002-08-08  Martin Baulig  <martin@gnome.org>
16643
16644         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
16645         Family, FamANDAssem and FamORAssem permissions.
16646         (TypeManager.IsSubclassOrNestedChildOf): New public method.
16647
16648 2002-08-08  Martin Baulig  <martin@gnome.org>
16649
16650         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
16651         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
16652         or loop block.
16653
16654 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
16655
16656         * driver.cs: implemented /resource option to embed managed resources.
16657
16658 2002-08-07  Martin Baulig  <martin@gnome.org>
16659
16660         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
16661         (FieldBase.HasFieldInitializer): New public property.
16662         (FieldBase.GetInitializerExpression): New public method.  Resolves and
16663         returns the field initializer and makes sure it is only resolved once.
16664         (TypeContainer.EmitFieldInitializers): Call
16665         FieldBase.GetInitializerExpression to get the initializer, this ensures
16666         that it isn't resolved multiple times.
16667
16668         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
16669         the resolving process (SimpleName/MemberLookup) that we're currently
16670         emitting a field initializer (which must not access any instance members,
16671         this is an error CS0236).
16672
16673         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
16674         argument, if the `IsFieldInitializer' flag is set, we must report and
16675         error CS0236 and not an error CS0120.   
16676
16677 2002-08-07  Martin Baulig  <martin@gnome.org>
16678
16679         * ecore.cs (IMemberExpr): New public interface.
16680         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
16681         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
16682         if the expression is an IMemberExpr.
16683
16684         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
16685         to be null, implicitly default to `this' if we're non-static in
16686         this case.  Simplified the code a lot by using the new IMemberExpr
16687         interface.  Also fixed bug #28176 here.
16688
16689 2002-08-06  Martin Baulig  <martin@gnome.org>
16690
16691         * cs-parser.jay (SimpleLookup): Removed.  We need to create
16692         ParameterReferences during semantic analysis so that we can do a
16693         type-only search when resolving Cast, TypeOf and SizeOf.
16694         (block): Pass the `current_local_parameters' to the Block's
16695         constructor.
16696
16697         * class.cs (ConstructorInitializer): Added `Parameters parameters'
16698         argument to the constructor.
16699         (ConstructorInitializer.Resolve): Create a temporary implicit
16700         block with the parameters.
16701
16702         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
16703         references here if we aren't doing a type-only search.
16704
16705         * statement.cs (Block): Added constructor which takes a
16706         `Parameters parameters' argument.
16707         (Block.Parameters): New public property.
16708
16709         * support.cs (InternalParameters.Parameters): Renamed `parameters'
16710         to `Parameters' and made it public readonly.
16711
16712 2002-08-06  Martin Baulig  <martin@gnome.org>
16713
16714         * ecore.cs (Expression.Warning): Made this public as well.
16715
16716         * report.cs (Report.Debug): Print the contents of collections.
16717
16718 2002-08-06  Martin Baulig  <martin@gnome.org>
16719
16720         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
16721         used to tell Resolve() which kinds of expressions it may return.
16722         (Expression.Resolve): Added overloaded version of this method which
16723         takes a `ResolveFlags flags' argument.  This can be used to tell
16724         Resolve() which kinds of expressions it may return.  Reports a
16725         CS0118 on error.
16726         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
16727         ResolveFlags.SimpleName.
16728         (Expression.Error118): Added overloaded version of this method which
16729         takes a `ResolveFlags flags' argument.  It uses the flags to determine
16730         which kinds of expressions are allowed.
16731
16732         * expression.cs (Argument.ResolveMethodGroup): New public method.
16733         Resolves an argument, but allows a MethodGroup to be returned.
16734         This is used when invoking a delegate.
16735
16736         * TODO: Updated a bit.
16737
16738 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16739
16740         Fixed compilation with csc.
16741
16742         * ecore.cs: Expression.Error made public. Is this correct? Should
16743         Warning be made public too?
16744
16745         * expression.cs: use ea.Location instead of ea.loc.
16746         [FIXME:  Filed as bug #28607: MCS must report these errors.]
16747
16748 2002-08-06  Martin Baulig  <martin@gnome.org>
16749
16750         * ecore.cs (Expression.loc): Moved the location here instead of
16751         duplicating it in all derived classes.
16752         (Expression.Location): New public property.
16753         (Expression.Error, Expression.Warning): Made them non-static and
16754         removed the location argument.
16755         (Expression.Warning): Added overloaded version which takes an
16756         `int level' argument.
16757         (Expression.Error118): Make this non-static and removed the
16758         expression and location arguments.
16759         (TypeExpr): Added location argument to the constructor.
16760
16761         * expression.cs (StaticCallExpr): Added location argument to
16762         the constructor.
16763         (Indirection, PointerArithmetic): Likewise.
16764         (CheckedExpr, UnCheckedExpr): Likewise.
16765         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
16766         (StringPtr): Likewise.
16767
16768
16769 2002-08-05  Martin Baulig  <martin@gnome.org>
16770
16771         * expression.cs (BaseAccess.DoResolve): Actually report errors.
16772
16773         * assign.cs (Assign.DoResolve): Check whether the source
16774         expression is a value or variable.
16775
16776         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
16777         while resolving the corresponding blocks.
16778
16779         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
16780         an error, don't silently return null.
16781
16782         * statement.cs (Block.AddVariable): Do the error reporting here
16783         and distinguish between CS0128 and CS0136.
16784         (Block.DoResolve): Report all unused labels (warning CS0164).
16785         (LabeledStatement): Pass the location to the constructor.
16786         (LabeledStatement.HasBeenReferenced): New property.
16787         (LabeledStatement.Resolve): Set it to true here.
16788
16789         * statement.cs (Return.Emit): Return success even after reporting
16790         a type mismatch error (CS0126 or CS0127), this is what csc does and
16791         it avoids confusing the users with any consecutive errors.
16792
16793 2002-08-05  Martin Baulig  <martin@gnome.org>
16794
16795         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
16796
16797         * const.cs (Const.LookupConstantValue): Catch circular definitions.
16798
16799         * expression.cs (MemberAccess.DoResolve): Silently return if an
16800         error has already been reported.
16801
16802         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
16803         error has already been reported.
16804
16805 2002-08-05  Martin Baulig  <martin@gnome.org>
16806
16807         * statement.cs (UsageVector): Only initialize the `parameters'
16808         vector if we actually have any "out" parameters.
16809
16810 2002-08-05  Martin Baulig  <martin@gnome.org>
16811
16812         * expression.cs (Binary.ResolveOperator): When combining delegates,
16813         they must have the same type.
16814
16815 2002-08-05  Martin Baulig  <martin@gnome.org>
16816
16817         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
16818         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
16819         work with the ms runtime and we also don't need it: if we're a
16820         PropertyBuilder and not in the `indexer_arguments' hash, then we
16821         are a property and not an indexer.
16822
16823         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
16824         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
16825         since the latter one doesn't work with the ms runtime.
16826
16827 2002-08-03  Martin Baulig  <martin@gnome.org>
16828
16829         Fixed bugs #27998 and #22735.
16830
16831         * class.cs (Method.IsOperator): New public field.
16832         (Method.CheckBase): Report CS0111 if there's already a method
16833         with the same parameters in the current class.  Report CS0508 when
16834         attempting to change the return type of an inherited method.
16835         (MethodData.Emit): Report CS0179 if a method doesn't have a body
16836         and it's not marked abstract or extern.
16837         (PropertyBase): New abstract base class for Property and Indexer.
16838         (PropertyBase.CheckBase): Moved here from Property and made it work
16839         for indexers.
16840         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
16841         the same so we can reuse it there.
16842         (Property, Indexer): Derive from PropertyBase.
16843         (MethodSignature.inheritable_property_signature_filter): New delegate
16844         to find properties and indexers.
16845
16846         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
16847         argument and improved error reporting.
16848
16849         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
16850         EmptyReadOnlyParameters and made it a property.
16851
16852         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
16853         version of this method which takes a `PropertyInfo indexer'.
16854         (TypeManager.RegisterIndexer): New method.
16855
16856         * class.cs: Added myself as author of this file :-)
16857
16858 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16859
16860         * class.cs: fixed compilation on windoze.
16861
16862 2002-08-03  Martin Baulig  <martin@gnome.org>
16863
16864         * interface.cs (Interface.GetInterfaceBases): Check whether all
16865         base interfaces are at least as accessible than the current one.
16866
16867         * class.cs (TypeContainer.GetClassBases): Check whether base types
16868         are at least as accessible than the current type.
16869         (TypeContainer.AsAccessible): Implemented and made non-static.
16870         (MemberBase.CheckParameters): Report errors if the accessibility
16871         checks fail.
16872
16873         * delegate.cs (Delegate.Delegate): The default visibility is
16874         internal for top-level types and private for nested types.
16875         (Delegate.Define): Report errors if the accessibility checks fail.
16876
16877         * enum.cs (Enum.Enum): The default visibility is internal for
16878         top-level types and private for nested types.
16879         (Enum.DefineType): Compute the correct visibility.
16880
16881         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
16882         function which takes a `bool is_toplevel' instead of a TypeContainer.
16883
16884         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
16885         builtin type.
16886
16887 2002-08-02  Martin Baulig  <martin@gnome.org>
16888
16889         * expression.cs (LocalVariableReferenc): Added constructor which
16890         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
16891         (LocalVariableReference.IsReadOnly): New property.
16892         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
16893         variable is readonly, use our own readonly flag to do this; you can
16894         use the new constructor to get a writable reference to a read-only
16895         variable.
16896
16897         * cs-parser.jay (foreach_statement, using_statement): Get a writable
16898         reference to the local variable.
16899
16900 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
16901
16902         * rootcontext.cs (ResolveCore): Also include System.Exception
16903
16904         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
16905         we reach an EmptyStatement.
16906
16907         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
16908         is also fine.
16909
16910         * expression.cs (Binary.ResolveOperator): Check error result in
16911         two places.
16912
16913         use brtrue/brfalse directly and avoid compares to null.
16914
16915 2002-08-02  Martin Baulig  <martin@gnome.org>
16916
16917         * class.cs (TypeContainer.Define): Define all nested interfaces here.
16918         Fixes bug #28407, added test-155.cs.
16919
16920 2002-08-01  Martin Baulig  <martin@gnome.org>
16921
16922         * class.cs (Event.EmitDefaultMethod): Make this work with static
16923         events.  Fixes #28311, added verify-3.cs.
16924
16925 2002-08-01  Martin Baulig  <martin@gnome.org>
16926
16927         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
16928         `is_disposable' fields.
16929         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
16930         `hm.is_disposable' if we're using the collection pattern.
16931         (Foreach.EmitCollectionForeach): Use the correct type for the
16932         enumerator's local variable, only emit the try/finally block if
16933         necessary (fixes #27713).
16934
16935 2002-08-01  Martin Baulig  <martin@gnome.org>
16936
16937         * ecore.cs (Expression.report118): Renamed to Error118 and made
16938         it public static.
16939
16940         * statement.cs (Throw.Resolve): Check whether the expression is of
16941         the correct type (CS0118) and whether the type derives from
16942         System.Exception (CS0155).
16943         (Catch.Resolve): New method.  Do the type lookup here and check
16944         whether it derives from System.Exception (CS0155).
16945         (Catch.CatchType, Catch.IsGeneral): New public properties.
16946
16947         * typemanager.cs (TypeManager.exception_type): Added.
16948
16949 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
16950
16951         * driver.cs: Updated About function.
16952
16953 2002-07-31  Martin Baulig  <martin@gnome.org>
16954
16955         Implemented Control Flow Analysis.
16956
16957         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
16958         (EmitContext.CurrentBranching): Added.
16959         (EmitContext.StartFlowBranching): Added.
16960         (EmitContext.EndFlowBranching): Added.
16961         (EmitContext.KillFlowBranching): Added.
16962         (EmitContext.IsVariableAssigned): Added.
16963         (EmitContext.SetVariableAssigned): Added.
16964         (EmitContext.IsParameterAssigned): Added.
16965         (EmitContext.SetParameterAssigned): Added.
16966         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
16967         Added control flow analysis stuff here.
16968
16969         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
16970         resolve the expression as lvalue.
16971         (LocalVariableReference.DoResolve): Check whether the variable has
16972         already been assigned.
16973         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
16974         the parameter as assigned here.
16975         (ParameterReference.DoResolve): Check whether the parameter has already
16976         been assigned.
16977         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
16978         expression as lvalue.
16979
16980         * statement.cs (FlowBranching): New class for the flow analysis code.
16981         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
16982         (LabeledStatement.IsDefined): New public property.
16983         (LabeledStatement.AddUsageVector): New public method to tell flow
16984         analyis that the label may be reached via a forward jump.
16985         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
16986         flow analysis.
16987         (VariableInfo.Number): New public field.  This is used by flow analysis
16988         to number all locals of a block.
16989         (Block.CountVariables): New public property.  This is the number of
16990         local variables in this block (including the locals from all parent
16991         blocks).
16992         (Block.EmitMeta): Number all the variables.
16993
16994         * statement.cs: Added flow analysis support to all classes.
16995
16996 2002-07-31  Martin Baulig  <martin@gnome.org>
16997
16998         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
16999         To get debugging messages, compile mcs with /define:MCS_DEBUG and
17000         then use this argument.
17001
17002         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
17003
17004         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
17005         use this to specify /define options.
17006
17007 2002-07-29  Martin Baulig  <martin@gnome.org>
17008
17009         * statement.cs (Fixed): Moved all code that does variable lookups
17010         and resolvings from Emit to Resolve.
17011
17012         * statement.cs (For): Moved all code that does variable lookups
17013         and resolvings from Emit to Resolve.
17014
17015         * statement.cs (Using): Moved all code that does variable lookups
17016         and resolvings from Emit to Resolve.
17017
17018 2002-07-29  Martin Baulig  <martin@gnome.org>
17019
17020         * attribute.cs (Attribute.Resolve): Explicitly catch a
17021         System.NullReferenceException when creating the
17022         CustromAttributeBuilder and report a different warning message.
17023
17024 2002-07-29  Martin Baulig  <martin@gnome.org>
17025
17026         * support.cs (ParameterData.ParameterName): Added method to
17027         get the name of a parameter.
17028
17029         * typemanager.cs (TypeManager.IsValueType): New public method.
17030
17031 2002-07-29  Martin Baulig  <martin@gnome.org>
17032
17033         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
17034         is a flag which specifies that it's either ref or out.
17035         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
17036         the out parameter to `out Parameter.Modifier mod', also set the
17037         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
17038
17039         * support.cs (InternalParameters.ParameterModifier): Distinguish
17040         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17041         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17042
17043         * expression.cs (Argument.GetParameterModifier): Distinguish
17044         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17045         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17046
17047 2002-07-29  Martin Baulig  <martin@gnome.org>
17048
17049         * expression.cs (ParameterReference.ParameterReference): Added
17050         `Location loc' argument to the constructor.
17051
17052         * cs-parser.jay: Pass location to ParameterReference.
17053
17054 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
17055
17056         * statement.cs (Try): Initialize the location.
17057
17058         * cs-parser.jay: pass location to Try.
17059
17060         * expression.cs (Unary.Reduce): Change the prototype to return
17061         whether a constant fold could be performed or not.  The result is
17062         returned in an out parameters.  In the case of Indirection and
17063         AddressOf, we want to perform the full tests.
17064
17065 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
17066
17067         * statement.cs (Statement.Emit): Flag dead code.
17068
17069 2002-07-27  Andrew Birkett  <andy@nobugs.org>
17070
17071         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
17072
17073 2002-07-27  Martin Baulig  <martin@gnome.org>
17074
17075         * class.cs (MethodData.Define): Put back call to
17076         TypeManager.AddMethod(), accidentally commented this out.
17077
17078         * report.cs (Debug): New public method to print debugging information,
17079         this is `[Conditional ("DEBUG")]'.
17080
17081 2002-07-26  Martin Baulig  <martin@gnome.org>
17082
17083         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
17084         (switch_statement): Push the current_block to the switch_stack and
17085         pop it again when we're done with the switch.
17086         (switch_section): The new block is a child of the current_block.
17087         Fixes bug #24007, added test-152.cs.
17088
17089 2002-07-27  Martin Baulig  <martin@gnome.org>
17090
17091         * expression.cs (Invocation.EmitArguments): When calling a varargs
17092         function with only its fixed arguments, we need to pass an empty
17093         array.
17094
17095 2002-07-27  Martin Baulig  <martin@gnome.org>
17096
17097         Mono 0.13 has been released.
17098
17099 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
17100
17101         * driver.cs: Rename --resource to --linkres, because that is what
17102         we do currently, we dont support --resource yet.
17103
17104         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
17105
17106 2002-07-25  Martin Baulig  <martin@gnome.org>
17107
17108         * class.cs (MethodData): New public class.  This is a `method builder'
17109         class for a method or one accessor of a Property/Indexer/Event.
17110         (MethodData.GetMethodFlags): Moved here from MemberBase.
17111         (MethodData.ApplyAttributes): Likewise.
17112         (MethodData.ApplyObsoleteAttribute): Likewise.
17113         (MethodData.ApplyConditionalAttribute): Likewise.
17114         (MethodData.ApplyDllImportAttribute): Likewise.
17115         (MethodData.CheckAbstractAndExternal): Likewise.
17116         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
17117         (MethodData.Emit): Formerly known as Method.Emit().
17118         (MemberBase): Moved everything which was specific to a single
17119         accessor/method to MethodData.
17120         (Method): Create a new MethodData and call Define() and Emit() on it.
17121         (Property, Indexer, Event): Create a new MethodData objects for each
17122         accessor and call Define() and Emit() on them.
17123
17124 2002-07-25  Martin Baulig  <martin@gnome.org>
17125
17126         Made MethodCore derive from MemberBase to reuse the code from there.
17127         MemberBase now also checks for attributes.
17128
17129         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
17130         (MemberBase.GetMethodFlags): Moved here from class Method and marked
17131         as virtual.
17132         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
17133         `CallingConventions cc' and `Attributes opt_attrs' arguments.
17134         (MemberBase.ApplyAttributes): New virtual method; applies the
17135         attributes to a method or accessor.
17136         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
17137         (MemberBase.ApplyConditionalAttribute): Likewise.
17138         (MemberBase.ApplyDllImportAttribute): Likewise.
17139         (MemberBase.CheckAbstractAndExternal): Likewise.
17140         (MethodCore.ParameterTypes): This is now a property instead of a
17141         method, it's initialized from DoDefineParameters().
17142         (MethodCore.ParameterInfo): Removed the set accessor.
17143         (MethodCore.DoDefineParameters): New protected virtual method to
17144         initialize ParameterTypes and ParameterInfo.
17145         (Method.GetReturnType): We can now simply return the MemberType.
17146         (Method.GetMethodFlags): Override the MemberBase version and add
17147         the conditional flags.
17148         (Method.CheckBase): Moved some code from Define() here, call
17149         DoDefineParameters() here.
17150         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
17151         here to avoid some larger code duplication.
17152         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
17153         ensure that abstract and external accessors don't declare a body.
17154
17155         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
17156         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
17157         lookup in the attribute's parent classes, so we need to abort as soon
17158         as we found the first match.
17159         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
17160         the attribute has no arguments.
17161
17162         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
17163         of a Method.
17164
17165 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17166
17167         * cs-parser.jay: reverted previous patch.
17168
17169 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17170
17171         * cs-parser.jay: fixed bug #22119.
17172
17173 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17174
17175         * attribute.cs: fixed compilation. The error was:
17176         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
17177         be assigned to before control leaves the current method."
17178         [FIXME:  Filed as bug #28186: MCS must report this error.]
17179
17180 2002-07-25  Martin Baulig  <martin@gnome.org>
17181
17182         * attribute.cs (Attribute.Conditional_GetConditionName): New static
17183         method to pull the condition name ouf of a Conditional attribute.
17184         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
17185         the obsolete message and error flag out of an Obsolete attribute.
17186
17187         * class.cs (Method.GetMethodFlags): New public method to get the
17188         TypeManager.MethodFlags for this method.
17189         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
17190         private methods.
17191         (Method.Define): Get and apply the Obsolete and Conditional attributes;
17192         if we're overriding a virtual function, set the new private variable
17193         `parent_method'; call the new TypeManager.AddMethod().
17194
17195         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
17196         the MethodBuilder and the Method in a PtrHashtable.
17197         (TypeManager.builder_to_method): Added for this purpose.
17198         (TypeManager.MethodFlags): Added IsObsoleteError.
17199         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
17200         Obsolete and Conditional arguments in MethodBuilders.  If we discover
17201         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
17202         the message from the attribute.
17203
17204 2002-07-24  Martin Baulig  <martin@gnome.org>
17205
17206         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
17207         preprocessor directives, ensure that the argument to #define/#undef is
17208         exactly one identifier and that it's actually an identifier.
17209
17210         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
17211         did not work ....
17212
17213 2002-07-24  Martin Baulig  <martin@gnome.org>
17214
17215         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
17216         initialize it to TypeManager.object_type in the constructor.
17217         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
17218         of the `hm.get_current' method if we're using the collection pattern.
17219         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
17220         for the explicit conversion to make it work when we're using the collection
17221         pattern and the `Current' property has a different return type than `object'.
17222         Fixes #27713.
17223
17224 2002-07-24  Martin Baulig  <martin@gnome.org>
17225
17226         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
17227         does not match, but don't report any errors.  This method is called in
17228         order for all methods in a MethodGroupExpr until a matching method is
17229         found, so we don't want to bail out if the first method doesn't match.
17230         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
17231         matches, report the 123.  Fixes #28070.
17232
17233 2002-07-24  Martin Baulig  <martin@gnome.org>
17234
17235         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
17236         TypeManager.TypeToCoreType() to the top of the method so the
17237         following equality checks will work.  Fixes #28107.
17238
17239 2002-07-24  Martin Baulig  <martin@gnome.org>
17240
17241         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
17242         operand is of type uint, and the other operand is of type sbyte,
17243         short or int, the operands are converted to type long." -
17244         Actually do what this comment already told us.  Fixes bug #28106,
17245         added test-150.cs.
17246
17247 2002-07-24  Martin Baulig  <martin@gnome.org>
17248
17249         * class.cs (MethodBase): New abstract class.  This is now a base
17250         class for Property, Indexer and Event to avoid some code duplication
17251         in their Define() and DefineMethods() methods.
17252         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
17253         generic methods for Define() and DefineMethods().
17254         (FieldBase): Derive from MemberBase, not MemberCore.
17255         (Property): Derive from MemberBase, not MemberCore.
17256         (Property.DefineMethod): Moved all the code from this method to the
17257         new MethodBase.DefineAccessor(), just call it with appropriate
17258         argumetnts.
17259         (Property.Define): Call the new Property.DoDefine(), this does some
17260         sanity checks and we don't need to duplicate the code everywhere.
17261         (Event): Derive from MemberBase, not MemberCore.
17262         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
17263         accessors, this will also make them work with interface events.
17264         (Indexer): Derive from MemberBase, not MemberCore.
17265         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
17266         (Indexer.Define): Use the new MethodBase functions.
17267
17268         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
17269         argument to the constructor.
17270         (Interface.FindMembers): Added support for interface events.
17271         (Interface.PopluateEvent): Implemented.
17272
17273         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
17274
17275 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
17276
17277         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
17278         but this is required to check for a method name being the same as
17279         the containing class.  
17280
17281         Handle this now.
17282
17283 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17284
17285         * interface.cs: initialize variable.
17286
17287 2002-07-23  Martin Baulig  <martin@gnome.org>
17288
17289         Implemented the IndexerName attribute in interfaces.
17290
17291         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17292         name if this is an explicit interface implementation.
17293         (Indexer.InterfaceIndexerName): New public variable.  If we're
17294         implementing an interface indexer, this is the IndexerName in that
17295         interface.  Otherwise, it's the IndexerName.
17296         (Indexer.DefineMethod): If we're implementing interface indexer,
17297         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
17298         and Pending.ImplementIndexer methods.
17299         (Indexer.Define): Also define the PropertyBuilder if we're
17300         implementing an interface indexer and this is neither an explicit
17301         interface implementation nor do the IndexerName match the one in
17302         the interface.
17303
17304         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17305         If a method is defined here, then we always need to create a proxy
17306         for it.  This is used when implementing interface indexers.
17307         (Pending.IsInterfaceIndexer): New public method.
17308         (Pending.ImplementIndexer): New public method.
17309         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17310         This is used when implementing interface indexers to define a proxy
17311         if necessary.
17312         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17313         define a proxy if necessary.
17314
17315         * interface.cs (Interface.IndexerName): New public variable.
17316         (Interface.PopulateIndexer): Set the IndexerName.
17317         (Interface.DefineIndexers): New private method.  Populate all the
17318         indexers and make sure their IndexerNames match.
17319
17320         * typemanager.cs (IndexerPropertyName): Added support for interface
17321         indexers.
17322
17323 2002-07-22  Martin Baulig  <martin@gnome.org>
17324
17325         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17326         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17327         ret if HasReturnLabel.
17328         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17329         variables.
17330
17331         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17332         and set the ec.LoopBeginTryCatchLevel.
17333         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17334         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17335         the current ec.TryCatchLevel, the branch goes out of an exception
17336         block.  In this case, we need to use Leave and not Br.
17337
17338 2002-07-22  Martin Baulig  <martin@gnome.org>
17339
17340         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17341         block unless the block does not always return or it is contained in
17342         another try { ... } catch { ... } block.  Fixes bug #26506.
17343         Added verify-1.cs to the test suite.
17344
17345 2002-07-22  Martin Baulig  <martin@gnome.org>
17346
17347         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17348         then we do not always return.  Fixes bug #24985.
17349
17350 2002-07-22  Martin Baulig  <martin@gnome.org>
17351
17352         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17353         lookup on a per-class level; ie. walk up the class hierarchy until we
17354         found at least one applicable method, then choose the best among them.
17355         Fixes bug #24463 and test-29.cs.
17356
17357 2002-07-22  Martin Baulig  <martin@gnome.org>
17358
17359         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17360         return types of the methods.  The return type is not part of the
17361         signature and we must not check it to make the `new' modifier work.
17362         Fixes bug #27999, also added test-147.cs.
17363         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
17364
17365         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
17366         on the method's return type.
17367
17368 2002-07-21  Martin Baulig  <martin@gnome.org>
17369
17370         * assign.cs: Make this work if the rightmost source is a constant and
17371         we need to do an implicit type conversion.  Also adding a few more tests
17372         to test-38.cs which should have caught this.
17373
17374         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
17375         target in the makefile for this.  The makefile.gnu is primarily intended
17376         for end-users who don't want to debug the compiler.
17377
17378 2002-07-21  Martin Baulig  <martin@gnome.org>
17379
17380         * assign.cs: Improved the Assign class so it can now handle embedded
17381         assignments (X = Y = Z = something).  As a side-effect this'll now also
17382         consume less local variables.  test-38.cs now passes with MCS, added
17383         a few new test cases to that test.
17384
17385 2002-07-20  Martin Baulig  <martin@gnome.org>
17386
17387         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17388         instructions.  Fixes bug #27977, also added test-146.cs.
17389
17390 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17391
17392         * cs-tokenizer.cs: fixed getHex ().
17393
17394 2002-07-19  Martin Baulig  <martin@gnome.org>
17395
17396         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17397         not Type.GetType() to lookup the array type.  This is needed when
17398         we're constructing an array of a user-defined type.
17399         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17400         single-dimensional arrays, but also for single-dimensial arrays of
17401         type decimal.
17402
17403 2002-07-19  Martin Baulig  <martin@gnome.org>
17404
17405         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17406         this function is called, it's not allowed to share LocalBuilders
17407         among ILGenerators.
17408
17409 2002-07-19  Martin Baulig  <martin@gnome.org>
17410
17411         * expression.cs (Argument.Resolve): Report an error 118 when trying
17412         to pass a type as argument.
17413
17414 2002-07-18  Martin Baulig  <martin@gnome.org>
17415
17416         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17417         Conv_R_Un for the signed `long' type.
17418
17419 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
17420
17421         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17422         `expr' for the temporary result, as that will fail if we do
17423         multiple resolves on the same expression.
17424
17425 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
17426
17427         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17428         ec.TypeContainer for looking up aliases. 
17429
17430         * class.cs (TypeContainer): Remove LookupAlias from here.
17431
17432         * decl.cs (DeclSpace); Move here.
17433
17434 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
17435
17436         * class.cs (FindMembers): Only call filter if the constructor
17437         bulider is not null.
17438
17439         Also handle delegates in `NestedTypes' now.  Now we will perform
17440         type lookups using the standard resolution process.  This also
17441         fixes a bug.
17442
17443         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17444         This uses Expressions (the limited kind that can be parsed by the
17445         tree) instead of strings.
17446
17447         * expression.cs (ComposedCast.ToString): Implement, used to flag
17448         errors since now we have to render expressions.
17449
17450         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
17451         FormArrayType. 
17452
17453         * ecore.cs (SimpleName.ToString): ditto.
17454
17455         * cs-parser.jay: Instead of using strings to assemble types, use
17456         Expressions to assemble the type (using SimpleName, ComposedCast,
17457         MemberAccess).  This should fix the type lookups in declarations,
17458         because we were using a different code path for this.
17459
17460         * statement.cs (Block.Resolve): Continue processing statements
17461         even when there is an error.
17462
17463 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
17464
17465         * class.cs (Event.Define): Also remove the `remove' method from
17466         the list of pending items.
17467
17468         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17469         generate more compact code. 
17470
17471 2002-07-17  Martin Baulig  <martin@gnome.org>
17472
17473         * const.cs (Const.LookupConstantValue): Add support for constant
17474         `unchecked' and `checked' expressions.
17475         Also adding test case test-140.cs for this.
17476
17477 2002-07-17  Martin Baulig  <martin@gnome.org>
17478
17479         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17480         check whether mi.ReturnType implements the IEnumerator interface; the
17481         `==' and the IsAssignableFrom() will fail in this situation.
17482
17483 2002-07-16  Ravi Pratap  <ravi@ximian.com>
17484
17485         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
17486         here too.
17487
17488 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17489
17490         * expression.cs: fixed bug #27811.
17491
17492 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
17493
17494         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17495         Molaro: when we are a ref, the value already contains a pointer
17496         value, do not take the address of it.
17497
17498 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17499         * removed mb-parser.jay and mb-tokenizer.cs
17500
17501 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17502
17503         * expression.cs: check against the building corlib void type.
17504
17505 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17506
17507         * ecore.cs: fix for valuetype static readonly fields: when 
17508         initializing them, we need their address, not the address of a copy.
17509
17510 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17511
17512         * typemanager.cs: register also enum_type in corlib.
17513
17514 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17515
17516         * class.cs: allow calling this (but not base) initializers in structs.
17517
17518 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17519
17520         * ecore.cs: make sure we compare against the building base types
17521         in GetTypeSize ().
17522
17523 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
17524
17525         * typemanager.cs: fix TypeToCoreType() to handle void and object
17526         (corlib gets no more typerefs after this change).
17527
17528 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
17529
17530         * expression.cs (ArrayCreation.EmitArrayArguments): use
17531         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17532
17533         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17534         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
17535         array indexes, the runtime actually forbids them.
17536
17537         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17538         for array arguments here.
17539
17540         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17541         instead of the default for ValueTypes.
17542
17543         (New.DoEmit): Use IsValueType instead of
17544         IsSubclassOf (value_type)
17545         (New.DoResolve): ditto.
17546         (Invocation.EmitCall): ditto.
17547
17548         * assign.cs (Assign): ditto.
17549
17550         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17551         Statements *are* currently doing part of their resolution during
17552         Emit.  
17553
17554         Expressions do always resolve during resolve, but statements are
17555         only required to propagate resolution to their children.
17556
17557 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
17558
17559         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17560
17561         (LoadAssembly): Do not add the dll if it is already specified
17562
17563         (MainDriver): Add the System directory to the link path at the end,
17564         after all the other -L arguments. 
17565
17566         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17567         wrong opcode for loading bytes and bools (ldelem.i1 instead of
17568         ldelem.u1) and using the opposite for sbytes.
17569
17570         This fixes Digger, and we can finally run it.
17571
17572         * driver.cs (UnixParseOption): Move the option parsing here.  
17573         (CSCParseOption): Implement CSC-like parsing of options.
17574
17575         We now support both modes of operation, the old Unix way, and the
17576         new CSC-like way.  This should help those who wanted to make cross
17577         platform makefiles.
17578
17579         The only thing broken is that /r:, /reference: and /lib: are not
17580         implemented, because I want to make those have the same semantics
17581         as the CSC compiler has, and kill once and for all the confussion
17582         around this.   Will be doing this tomorrow.
17583
17584         * statement.cs (Unsafe.Resolve): The state is checked during
17585         resolve, not emit, so we have to set the flags for IsUnsfe here.
17586
17587 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17588
17589         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17590         not catch the Error_ObjectRefRequired in SimpleName (as it is
17591         possible to have a class/instance variable name that later gets
17592         deambiguated), we have to check this here.      
17593
17594 2002-07-10  Ravi Pratap  <ravi@ximian.com>
17595
17596         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17597         make static and put into Expression.
17598
17599         (Event.Define): Register the private field of the event with the 
17600         TypeManager so that GetFieldFromEvent can get at it.
17601
17602         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17603         keep track of the private field associated with an event which
17604         has no accessors.
17605
17606         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
17607         private field.
17608
17609         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
17610
17611 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17612
17613         * expression.cs (Binary.EmitBranchable): this routine emits the
17614         Binary expression in a branchable context.  This basically means:
17615         we need to branch somewhere, not just get the value on the stack.
17616
17617         This works together with Statement.EmitBoolExpression.
17618
17619         * statement.cs (Statement.EmitBoolExpression): Use
17620         EmitBranchable. 
17621
17622 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
17623
17624         * statement.cs (For): Reduce the number of jumps in loops.
17625
17626         (For): Implement loop inversion for the For statement.
17627
17628         (Break): We can be breaking out of a Try/Catch controlled section
17629         (foreach might have an implicit try/catch clause), so we need to
17630         use Leave instead of Br.
17631
17632         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
17633         now).  If the instace expression supports IMemoryLocation, we use
17634         the AddressOf method from the IMemoryLocation to extract the
17635         address instead of emitting the instance.
17636
17637         This showed up with `This', as we were emitting the instance
17638         always (Emit) instead of the Address of This.  Particularly
17639         interesting when This is a value type, as we dont want the Emit
17640         effect (which was to load the object).
17641
17642 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
17643
17644         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
17645
17646         * statement.cs (Checked): Set the CheckedState during the resolve
17647         process too, as the ConvCast operations track the checked state on
17648         the resolve process, and not emit.
17649
17650         * cs-parser.jay (namespace_member_declaration): Flag that we have
17651         found a declaration when we do.  This is used to flag error 1529
17652
17653         * driver.cs: Report ok when we display the help only.
17654
17655 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
17656
17657         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
17658
17659 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
17660
17661         * cs-tokenizer.cs (define): We also have to track locally the
17662         defines.  AllDefines is just used for the Conditional Attribute,
17663         but we also need the local defines for the current source code. 
17664
17665 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
17666
17667         * statement.cs (While, For, Do): These loops can exit through a
17668         Break statement, use this information to tell whether the
17669         statement is the last piece of code.
17670
17671         (Break): Flag that we break.
17672
17673         * codegen.cs (EmitContexts): New `Breaks' state variable.
17674
17675 2002-07-03  Martin Baulig  <martin@gnome.org>
17676
17677         * class.cs (TypeContainer.MethodModifiersValid): Allow override
17678         modifiers in method declarations in structs.  Otherwise, you won't
17679         be able to override things like Object.Equals().
17680
17681 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17682
17683         * class.cs (Method, Property, Indexer): Do not allow the public
17684         modifier to be used in explicit interface implementations.
17685
17686         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
17687         override modifiers in method declarations in structs
17688
17689 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
17690
17691         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
17692         integer or real overflow, report an error
17693
17694 2002-07-02  Martin Baulig  <martin@gnome.org>
17695
17696         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
17697         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
17698         to tell the runtime about our newly created System.Object and
17699         System.ValueType types.
17700
17701 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17702
17703         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
17704         struct instead of Ldarg/Starg.
17705
17706 2002-07-02  Martin Baulig  <martin@gnome.org>
17707
17708         * expression.cs (Indirection.Indirection): Call
17709         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
17710
17711 2002-07-02  Martin Baulig  <martin@gnome.org>
17712
17713         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
17714         ValueType, call TypeManager.TypeToCoreType() on it.
17715         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
17716         the OpCodes.Newarr argument.
17717
17718 2002-07-02  Martin Baulig  <martin@gnome.org>
17719
17720         * expression.cs (Invocation.EmitCall): When compiling corlib,
17721         replace all calls to the system's System.Array type to calls to
17722         the newly created one.
17723
17724         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
17725         System.Array methods.
17726         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
17727         from the system's System.Array type which must be replaced.
17728
17729 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
17730
17731         * typemanager.cs: load unverifiable_code_ctor so we can build
17732         corlib using the correct type. Avoid using GetTypeCode() with
17733         TypeBuilders.
17734         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
17735         TypeManager.object_type to allow building corlib.
17736
17737 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
17738
17739         * ecore.cs: handle System.Enum separately in LoadFromPtr().
17740
17741 2002-07-01  Martin Baulig  <martin@gnome.org>
17742
17743         * class.cs: Make the last change actually work, we need to check
17744         whether `ifaces != null' to avoid a crash.
17745
17746 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17747
17748         * class.cs: when we build structs without fields that implement
17749         interfaces, we need to add the interfaces separately, since there is
17750         no API to both set the size and add the interfaces at type creation
17751         time.
17752
17753 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17754
17755         * expression.cs: the dimension arguments to the array constructors
17756         need to be converted if they are a long.
17757
17758 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
17759
17760         * class.cs: don't emit ldarg.0 if there is no parent constructor
17761         (fixes showstopper for corlib).
17762
17763 2002-06-29  Martin Baulig  <martin@gnome.org>
17764
17765         MCS now compiles corlib on GNU/Linux :-)
17766
17767         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
17768         ie. check for MethodImplOptions.InternalCall.
17769
17770         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
17771         and TypeManager.attribute_type are null, so we must explicitly check
17772         whether parent is not null to find out whether it's an attribute type.
17773         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
17774         and SetBuilder, not only if the property is neither abstract nor external.
17775         This is necessary to set the MethodImplOptions on the accessor methods.
17776         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
17777         SetBuilder, see Property.Emit().
17778
17779         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
17780         populate "System.Object", "System.ValueType" and "System.Attribute" since
17781         they've already been populated from BootCorlib_PopulateCoreTypes().
17782
17783 2002-06-29  Martin Baulig  <martin@gnome.org>
17784
17785         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
17786         is the NullLiteral, we also need to make sure that target_type is not
17787         an enum type.   
17788
17789 2002-06-29  Martin Baulig  <martin@gnome.org>
17790
17791         * rootcontext.cs (RootContext.ResolveCore): We must initialize
17792         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
17793         before calling BootstrapCorlib_ResolveDelegate ().
17794
17795 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17796
17797         * statement.cs: fixed build-breaker. All tests passed ok.
17798
17799 2002-06-27  Martin Baulig  <martin@gnome.org>
17800
17801         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
17802         for System.Decimal when compiling corlib.
17803
17804 2002-06-27  Martin Baulig  <martin@gnome.org>
17805
17806         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
17807         switch blocks which contain nothing but a default clause.
17808
17809 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
17810
17811        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
17812
17813 2002-06-27  Martin Baulig  <martin@gnome.org>
17814
17815         * ecore.cs (PropertyExpr.PropertyExpr): Call
17816         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
17817
17818         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
17819         is already a TypeBuilder.
17820
17821 2002-06-27  Martin Baulig  <martin@gnome.org>
17822
17823         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
17824         `target_type == TypeManager.array_type', not IsAssignableFrom() in
17825         the "from an array-type to System.Array" case.  This makes it work
17826         when compiling corlib.
17827
17828 2002-06-27  Martin Baulig  <martin@gnome.org>
17829
17830         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
17831         non-static PropertyExpr, set its InstanceExpression.  This makes
17832         the `ICollection.Count' property work in System/Array.cs.
17833
17834 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
17835
17836         * driver.cs: Made error handling more consistent.  Errors now
17837         tracked by Report class, so many methods which used to return int
17838         now return void.  Main() now prints success/failure and 
17839         errors/warnings message.
17840
17841         Renamed '--probe' compiler argument to '--expect-error'.  Removed
17842         the magic number return values (123 and 124).  Now, if the
17843         expected error occurs, the compiler exits with success (exit value
17844         0).  If the compilation completes without seeing that particular
17845         error, the compiler exits with failure (exit value 1).  The
17846         makefile in mcs/errors has been changed to handle the new behaviour.
17847
17848         * report.cs: Made 'expected error' number a property and renamed
17849         it from 'Probe' to 'ExpectedError'.
17850
17851         * genericparser.cs: Removed error handling support, since it is
17852         now all done by Report class.
17853
17854         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
17855         class, so parse() no longer returns an int.
17856
17857         * namespace.cs: Use Report.Error instead of GenericParser.error
17858
17859 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
17860
17861         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
17862         TypeContainer.AddOperator): At the front of the list put the
17863         explicit implementations, so they get resolved/defined first. 
17864
17865 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
17866
17867         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
17868         interface type is implemented by this TypeContainer.  Used during
17869         explicit interface implementation.
17870
17871         (Property.Define, Indexer.Define, Method.Define): Validate that
17872         the given interface in the explicit implementation is one of the
17873         base classes for the containing type.
17874
17875         Also if we are explicitly implementing an interface, but there is
17876         no match in the pending implementation table, report an error.
17877
17878         (Property.Define): Only define the property if we are
17879         not explicitly implementing a property from an interface.  Use the
17880         correct name also for those properties (the same CSC uses,
17881         although that is really not needed).
17882
17883         (Property.Emit): Do not emit attributes for explicitly implemented
17884         properties, as there is no TypeBuilder.
17885
17886         (Indexer.Emit): ditto.
17887
17888         Hiding then means that we do not really *implement* a pending
17889         implementation, which makes code fail.
17890
17891 2002-06-22  Martin Baulig  <martin@gnome.org>
17892
17893         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
17894         the return value of Object.GetType().  [FIXME: we need to do this whenever
17895         we get a type back from the reflection library].
17896
17897 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
17898
17899         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
17900
17901 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
17902
17903         * attribute.cs: Return null if we can not look up the type.
17904
17905         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
17906         the interface types found.
17907
17908         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
17909         interface types found.
17910
17911         * typemanager.cs (GetInterfaces): Make this routine returns alll
17912         the interfaces and work around the lame differences between
17913         System.Type and System.Reflection.Emit.TypeBuilder in the results
17914         result for GetInterfaces.
17915
17916         (ExpandInterfaces): Given an array of interface types, expand and
17917         eliminate repeated ocurrences of an interface.  This expands in
17918         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
17919         be IA, IB, IC.
17920
17921 2002-06-21  Martin Baulig  <martin@gnome.org>
17922
17923         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
17924         on System.Enum.
17925
17926 2002-06-21  Martin Baulig  <martin@gnome.org>
17927
17928         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
17929         and called with one of the core types, return the corresponding typebuilder for
17930         that type.
17931
17932         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
17933         element type.
17934
17935 2002-06-21  Martin Baulig  <martin@gnome.org>
17936
17937         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
17938         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
17939         (Expression.ConvertReferenceExplicit): Likewise.
17940
17941         * expression.cs (ElementAccess.DoResolve): Likewise.
17942         (ElementAccess.DoResolveLValue): Likewise.
17943
17944 2002-06-10  Martin Baulig  <martin@gnome.org>
17945
17946         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
17947         add the "value" parameter to the parameter list.
17948
17949         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
17950         to our caller.
17951
17952 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
17953
17954         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
17955         the argument to an int, uint, long or ulong, per the spec.  Also
17956         catch negative constants in array creation.
17957
17958 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
17959
17960         * class.cs: do not allow the same interface to appear twice in
17961         the definition list.
17962
17963 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
17964
17965         * ecore.cs: don't use ldlen with System.Array.
17966
17967 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
17968
17969         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
17970
17971 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
17972
17973         * modifiers.cs: produce correct field attributes for protected
17974         internal. Easy fix so miguel can work on ther harder stuff:-)
17975
17976 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
17977
17978         * pending.cs: New file.  Move the code from class.cs here.
17979         Support clearning the pending flag for all methods (when not doing
17980         explicit interface implementation).
17981
17982 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
17983
17984         * rootcontext.cs: added a couple more types needed to bootstrap.
17985
17986 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
17987
17988         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
17989         constructor in the type, instead of any constructor in the type
17990         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
17991         a bug in the Mono runtime when applying the params attribute). 
17992
17993 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
17994         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
17995
17996 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
17997
17998         * expression.cs (Unary.ResolveOperator): Use TypeManager
17999         to resolve the type.
18000
18001 2002-06-13  Ravi Pratap  <ravi@ximian.com>
18002
18003         * cs-parser.jay (enum_member_declaration): Pass in the attributes
18004         attached.
18005
18006         * enum.cs (AddEnumMember): Add support to store the attributes associated 
18007         with each member too.
18008
18009         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
18010         field builders too - this takes care of the enum member case.
18011
18012 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
18013
18014         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
18015         address-of operator on both value types and pointers.
18016
18017 2002-06-10  Martin Baulig  <martin@gnome.org>
18018
18019         * interface.cs (Interface.PopulateIndexer): Add the indexer's
18020         PropertyBuilder to the `property_builders' list.
18021
18022         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
18023         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
18024         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
18025         find any indexers which are inherited from an interface.
18026
18027 2002-06-09  Martin Baulig  <martin@gnome.org>
18028
18029         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
18030         the same type as the constant if necessary.  There's also a test-130.cs
18031         for this.
18032
18033         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
18034
18035         * typemanager.cs (TypeManager.ChangeType): Previously known as
18036         Enum.ChangeEnumType().
18037
18038 2002-06-09  Martin Baulig  <martin@gnome.org>
18039
18040         * expression.cs (Cast.TryReduce): Added support for consts.
18041
18042 2002-06-08  Ravi Pratap  <ravi@ximian.com>
18043
18044         * class.cs (Accessor): Hold attributes information so we can pass
18045         it along.
18046
18047         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
18048         Modify to pass in attributes attached to the methods.
18049
18050         (add_accessor_declaration, remove_accessor_declaration): Ditto.
18051
18052         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
18053         to handle the Accessor kind :-)
18054
18055         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
18056
18057 2002-06-08  Martin Baulig  <martin@gnome.org>
18058
18059         * expression.cs (Unary.TryReduceNegative): Added support for
18060         ULongConstants.
18061
18062 2002-06-08  Martin Baulig  <martin@gnome.org>
18063
18064         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
18065         name can't be found in the `defined_names' - the caller will do a
18066         MemberLookup in this case and thus find methods in System.Enum
18067         such as Enum.IsDefined().
18068
18069 2002-06-08  Martin Baulig  <martin@gnome.org>
18070
18071         * enum.cs (Enum.ChangeEnumType): This is a custom version of
18072         Convert.ChangeType() which works with TypeBuilder created types.
18073         (Enum.LookupEnumValue, Enum.Define): Use it here.
18074
18075         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
18076         `TypeBuilder.BaseType != null' check.
18077         (TypeContainer.FindMembers): Only lookup parent members if we
18078         actually have a parent.
18079         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
18080         (ConstructorInitializer.Resolve): Likewise.
18081
18082         * interface.cs (Interface.FindMembers): Added
18083         `TypeBuilder.BaseType != null' check.
18084
18085         * rootcontext.cs (RootContext.ResolveCore): Added
18086         "System.Runtime.CompilerServices.IndexerNameAttribute" to
18087         classes_second_stage.
18088
18089         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
18090         debug_type and trace_type when compiling with --nostdlib.       
18091
18092 2002-06-07  Martin Baulig  <martin@gnome.org>
18093
18094         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
18095         (AddField): Set it to true when adding a non-static field.
18096         (DefineType): Use `have_nonstatic_fields' to find out whether we
18097         have non-static fields, not `Fields != null'.
18098
18099 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
18100
18101         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
18102         dereferencing a null on the static-field code path)
18103
18104 2002-05-30  Martin Baulig  <martin@gnome.org>
18105
18106         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
18107         to take command line arguments.  Use reflection to call the new
18108         custom `Initialize' function on the symbol writer and pass it the
18109         command line arguments.
18110
18111         * driver.cs (--debug-args): New command line argument to pass command
18112         line arguments to the symbol writer.
18113
18114 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
18115
18116         * assign.cs (DoResolve): Forgot to do the implicit conversion to
18117         the target type for indexers and properties.  Thanks to Joe for
18118         catching this.
18119
18120 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
18121
18122         * typemanager.cs (MethodFlags): returns the method flags
18123         (Obsolete/ShouldIgnore) that control warning emission and whether
18124         the invocation should be made, or ignored. 
18125
18126         * expression.cs (Invocation.Emit): Remove previous hack, we should
18127         not do this on matching a base type, we should do this based on an attribute
18128
18129         Only emit calls to System.Diagnostics.Debug and
18130         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
18131         on the command line.
18132
18133         * rootcontext.cs: Global settings for tracing and debugging.
18134
18135         * cs-tokenizer.cs (define): New utility function to track
18136         defines.   Set the global settings for TRACE and DEBUG if found.
18137
18138 2002-05-25  Ravi Pratap  <ravi@ximian.com>
18139
18140         * interface.cs (Populate*): Pass in the TypeContainer as well as
18141         the DeclSpace as parameters so that we can create EmitContexts and
18142         then use that to apply attributes etc.
18143
18144         (PopulateMethod, PopulateEvent, PopulateProperty)
18145         (PopulateIndexer): Apply attributes everywhere.
18146
18147         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
18148         etc.
18149
18150         (ApplyAttributes): Update accordingly.
18151
18152         We now apply interface attributes for all members too.
18153
18154 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
18155
18156         * class.cs (Indexer.Define); Correctly check if we are explicit
18157         implementation (instead of checking the Name for a ".", we
18158         directly look up if the InterfaceType was specified).
18159
18160         Delay the creation of the PropertyBuilder.
18161
18162         Only create the PropertyBuilder if we are not an explicit
18163         interface implementation.   This means that explicit interface
18164         implementation members do not participate in regular function
18165         lookups, and hence fixes another major ambiguity problem in
18166         overload resolution (that was the visible effect).
18167
18168         (DefineMethod): Return whether we are doing an interface
18169         implementation. 
18170
18171         * typemanager.cs: Temporary hack until we get attributes in
18172         interfaces (Ravi is working on that) and we get IndexerName
18173         support in interfaces.
18174
18175         * interface.cs: Register the indexers as properties.
18176
18177         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
18178         warning, I have verified that this is a bug in the .NET runtime
18179         (JavaScript suffers of the same problem).
18180
18181         * typemanager.cs (MemberLookup): When looking up members for
18182         interfaces, the parent of an interface is the implicit
18183         System.Object (so we succeed in searches of Object methods in an
18184         interface method invocation.  Example:  IEnumerable x;  x.ToString
18185         ()) 
18186
18187 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
18188
18189         * class.cs (Event): Events should also register if they do
18190         implement the methods that an interface requires.
18191
18192         * typemanager.cs (MemberLookup); use the new GetInterfaces
18193         method. 
18194
18195         (GetInterfaces): The code used to lookup interfaces for a type is
18196         used in more than one place, factor it here. 
18197
18198         * driver.cs: Track the errors at the bottom of the file, we kept
18199         on going.
18200
18201         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
18202         instance if the method we are calling is static!
18203
18204 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
18205
18206         * attribute.cs (ApplyAttributes): Make this function filter out
18207         the IndexerName attribute (as that attribute in reality is never
18208         applied) and return the string constant for the IndexerName
18209         attribute. 
18210
18211         * class.cs (TypeContainer.Emit): Validate that all the indexers
18212         have the same IndexerName attribute, and if so, set the
18213         DefaultName attribute on the class. 
18214
18215         * typemanager.cs: The return value might contain other stuff (not
18216         only methods).  For instance, consider a method with an "Item"
18217         property and an Item method.
18218
18219         * class.cs: If there is a problem with the parameter types,
18220         return. 
18221
18222 2002-05-24  Ravi Pratap  <ravi@ximian.com>
18223
18224         * ecore.cs (ImplicitConversionExists): Wrapper function which also
18225         looks at user defined conversion after making a call to 
18226         StandardConversionExists - we need this for overload resolution.
18227
18228         * expression.cs : Update accordingly the various method calls.
18229
18230         This fixes 2 bugs filed against implicit user defined conversions 
18231
18232 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
18233
18234         * statement.cs: Track the result of the assignment.
18235
18236 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
18237
18238         * expression.cs (MemberAccess): Improved error reporting for
18239         inaccessible members.
18240
18241 2002-05-22  Martin Baulig  <martin@gnome.org>
18242
18243         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
18244         itself with debugging support.
18245
18246 2002-05-22  Martin Baulig  <martin@gnome.org>
18247
18248         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
18249         Removed, this isn't needed anymore.
18250
18251 2002-05-20  Martin Baulig  <martin@gnome.org>
18252
18253         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
18254         be underlying type for an enum.
18255
18256 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
18257
18258         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
18259         that splits out the loading of just the core types.
18260
18261         * rootcontext.cs (ResolveCore): Split the struct resolution in
18262         two, so we can load the enumeration underlying types before any
18263         enums are used.
18264
18265         * expression.cs (Is): Bandaid until we fix properly Switch (see
18266         bug #24985 for details).
18267
18268         * typemanager.cs (ImplementsInterface): The hashtable will contain
18269         a null if there are no interfaces implemented.
18270
18271 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
18272
18273         * cs-parser.jay (indexer_declarator): It is fine to have array
18274         parameters
18275
18276 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18277
18278         * typemanager.cs: (RegisterBuilder): New function used to register
18279         TypeBuilders that implement interfaces.  Since
18280         TypeBuilder.GetInterfaces (as usual) does not work with lame
18281         Reflection.Emit. 
18282         (AddUserType): register interfaces.
18283
18284         (ImplementsInterface): Use the builder_to_ifaces hash if we are
18285         dealing with TypeBuilder.  Also, arrays are showing up as
18286         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
18287         methods can not be invoked on them!
18288
18289         * ecore.cs (ExplicitReferenceConversionExists): Made public.
18290         (ImplicitReferenceConversionExists): Split out from
18291         StandardConversionExists. 
18292
18293         * expression.cs (As): We were only implementing one of the three
18294         cases for the as operator.  We now implement them all.
18295         (Is): Implement the various other cases for Is as well.
18296
18297         * typemanager.cs (CACHE): New define used to control if we want or
18298         not the FindMembers cache.  Seems to have a negative impact on
18299         performance currently
18300
18301         (MemberLookup): Nested types have full acess to
18302         enclosing type members
18303
18304         Remove code that coped with instance/static returns for events, we
18305         now catch this in RealFindMembers.
18306
18307         (RealFindMembers): only perform static lookup if the instance
18308         lookup did not return a type or an event.  
18309
18310 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18311
18312         * assign.cs (CompoundAssign): We pass more semantic information
18313         now to Compound Assignments than we did before: now we have all
18314         the information at hand, and now we resolve the target *before* we
18315         do the expression expansion, which allows the "CacheValue" method
18316         to have the effect we intended (before, a [x] += 1 would generate
18317         two differen ArrayAccess expressions from the ElementAccess,
18318         during the resolution process).
18319
18320         (CompoundAssign.DoResolve): Resolve target and original_source here.
18321
18322 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
18323
18324         * expression.cs (ArrayAccess): dropped debugging information. 
18325
18326         * typemanager.cs: Small bug fix: I was always returning i_members,
18327         instead of one of i_members or s_members (depending on which had
18328         the content).
18329
18330         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
18331         method is invoked before any code generation takes place, and it
18332         is a mechanism to inform that the expression will be invoked more
18333         than once, and that the method should use temporary values to
18334         avoid having side effects
18335
18336         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18337
18338         * ecore.cs (Expression.CacheTemporaries): Provide empty default
18339         implementation.
18340
18341         * expression.cs (Indirection, ArrayAccess): Add support for
18342         CacheTemporaries in these two bad boys. 
18343
18344         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18345         ldobj or ldind_ref.  
18346         (StoreFromPtr): Handle stobj as well.
18347
18348         * expression.cs (UnaryMutator): Share more code.
18349
18350         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18351         down: I was not tracking the Filter function as well, which
18352         was affecting the results of the cache.
18353
18354 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
18355
18356         * attribute.cs: Remove the hack to handle the CharSet property on
18357         StructLayouts. 
18358
18359 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
18360
18361         * attribute.cs (DoResolve): More uglyness, we now only try to
18362         resolve the attribute partially, to extract the CharSet
18363         information (only if we are a StructLayout attribute).  Otherwise 
18364
18365         (GetExtraTypeInfo): Add some code to conditionally kill in the
18366         future this.   I am more and more convinced that the .NET
18367         framework has special code to handle the attribute setting on
18368         certain elements.
18369
18370         * expression.cs (IsParamsMethodApplicable): Revert my previous
18371         foreach change here, it was wrong.
18372
18373 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
18374
18375         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
18376         (pp_expr): do not abort on unknown input, just return.
18377         (eval): abort if there are pending chars.
18378
18379         * attribute.cs (Attribute.Resolve): Positional parameters are
18380         optional.  Deal with that case.
18381
18382         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
18383         the Ansi/Unicode/Auto information for the type.
18384
18385         (TypeContainer.DefineType): instantiate the EmitContext here, as
18386         we will be using it during the type definition (to resolve
18387         attributes) and during the emit phase.
18388
18389         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18390         to pull type information out of the attributes
18391
18392         (Attribute.Resolve): track the constructor builder, and allow for
18393         multiple invocations (structs and classes will use this).
18394
18395         * ecore.cs (MemberLookupFinal): new version with all the
18396         parameters customizable.
18397
18398         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18399         constructors.  Return if the result value is null (as the error
18400         would have been flagged already by MemberLookupFinal)
18401
18402         Do not allow instances of abstract classes or interfaces to be
18403         created.
18404
18405         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18406         We have to compare the assembly property here when dealing with
18407         FamANDAssem and Assembly access modifiers, because we might be
18408         creating an assembly from *modules* (that means that we are not
18409         getting TypeBuilders for types defined in other modules that are
18410         part of this assembly).
18411
18412         (Method.Emit): If the method is marked abstract and has a body,
18413         emit an error. 
18414
18415         (TypeContainer.DefineMembers): If both the defined member and the
18416         parent name match are methods, then do not emit any warnings: let
18417         the Method.Define routine take care of flagging warnings.  But if
18418         there is a mismatch (method overrides something else, or method is
18419         overriwritten by something, then emit warning).
18420
18421         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18422         set to null, this means `do not check for the return type on the
18423         signature'. 
18424
18425         (Method.Define): set the return type for the method signature to
18426         null, so that we get methods with the same name and parameters and
18427         different return types.  This is used to flag warning 114 (you are
18428         hiding a method, and you probably want to use the new/override
18429         keywords instead).
18430
18431         * typemanager.cs (MemberLookup): Implemented proper access
18432         control, closing a long standing set of bug reports.  The problem
18433         was that the Framework only has two bits: Public and NonPublic,
18434         and NonPublic includes private and protected methods, but we need
18435         to enforce the FamANDAssem, FamOrAssem and Family. 
18436
18437 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
18438
18439         * statement.cs (GotoCase): Return true: Ammounts to giving up
18440         knowledge on whether we return or not, and letting the other case
18441         be responsible for it.
18442
18443 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
18444
18445         * driver.cs: Do not load directories for each file processed, only
18446         do it if there is a pattern.
18447
18448         * ecore.cs: Report readonly assigns here as well, as we might have
18449         been resolved only by MemberAccess.
18450
18451         (SimpleName.SimpleNameResolve): Also be useful for LValue
18452         resolution.   We need this to propagate assign to local readonly variables
18453
18454         * typemanager.cs: Use a ptrhashtable for the criteria, because we
18455         do not want to reuse potential criteria memory.
18456
18457         * class.cs (MyEventBuilder): Set reflected_type;
18458
18459         * ecore.cs (Constantify): Added support for constifying bools.
18460
18461         (RootContext.LookupType): Added a cache for values looked up in
18462         the declaration space.
18463
18464         * typemanager.cs (FindMembers): Now is a front-end to
18465         RealFindMembers, and provides a two-level hashtable-based cache to
18466         the request.  
18467
18468         15% performance improvement: from 22.5 to 19.2 seconds.
18469
18470         * expression.cs (IsParamsMethodApplicable): use foreach.
18471         (Invocation.DoResolve): ditto.
18472         (New.DoResolve): ditto.
18473         (ArrayCreation.DoResolve): ditto.
18474
18475         * ecore.cs (FindMostEncompassingType): use foreach.
18476
18477         * delegate.cs (NewDelegate.DoResolve): Use foreach
18478
18479         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18480         (RemoveMethods): use foreach.
18481
18482         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18483         nested foreach statements instead of for, and also break out of
18484         the inner loop once a match is found.
18485
18486         (Invocation.OverloadResolve): Use foreach, simplify the code. 
18487
18488 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
18489
18490         * cfold.cs (BinaryFold): During an enumeration evaluation context,
18491         we actually unwrap the expression to allow for extra information
18492         to be extracted. 
18493
18494         * expression.cs: Use Shr_Un on unsigned operations. 
18495
18496 2002-05-08  Ravi Pratap  <ravi@ximian.com>
18497
18498         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
18499         applicable operators was not being considered correctly. This closes
18500         the bug Miguel reported.
18501
18502 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18503
18504         * attribute.cs: check that the type derives from System.Attribute
18505         and report the correct error in that case (moved the duplicate code to
18506         its own method, too).
18507
18508 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18509
18510         * attribute.cs: lookup attribute type name as the spec says: first the
18511         bare attribute name and then name + "Attribute" (nant compiles with
18512         mcs after this fix).
18513
18514 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
18515
18516         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
18517         Because of the way we parse things, we should try to see if a
18518         UIntConstant can fit in an integer.
18519
18520 2002-05-07  Ravi Pratap  <ravi@ximian.com>
18521
18522         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18523         when we are in an explicit context.
18524
18525         (ConvertReferenceExplicit): When converting from Iface type S to Class
18526         T make sure the rules are implemented as an OR.
18527
18528         * parameter.cs (ParameterType): Make it a property for now although the
18529         purpose really isn't anything immediate.
18530
18531         * expression.cs (Is*Applicable): Do better checking on the parameter type
18532         of a ref/out parameter. The ones from the system assemblies are already 
18533         marked with the correct type so we don't need to do any correction.
18534
18535         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
18536         the object type is standard too so include that.
18537
18538 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18539
18540         * ecore.cs (StandardConversionExists): Augment with missing code:
18541         deal with IntConstant, LongConstants and Enumerations.
18542
18543         * assign.cs: Report the error, instead of failing silently
18544
18545         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18546         typecontainer that they are declared, because the
18547         typecontainer/namespace will have the list of using clauses that
18548         need to be applied.
18549
18550         Assembly Attributes were escaping the normal registration
18551         mechanism. 
18552
18553         (EmitCode): Apply attributes within an EmitContext that represents
18554         the container they were declared on.
18555
18556         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
18557
18558 2002-05-06  Ravi Pratap  <ravi@ximian.com>
18559
18560         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18561         Revamp completely - make much cleaner as we now operate only
18562         on a set of Types.
18563
18564         (FindMostSpecificSource, FindMostSpecificTarget): New methods
18565         to implement the logic detailed in the spec more correctly.
18566
18567         (UserDefinedConversion): Update accordingly.
18568
18569 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18570
18571         * statement.cs: Return flow analysis information up.
18572
18573         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18574         and the default.
18575
18576         (token): Do not consume an extra character before calling
18577         decimal_digits.
18578
18579 2002-05-06  Piers Haken <piersh@friskit.com>
18580
18581         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18582
18583 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18584
18585         * class.cs (Constructor.Emit): Set the IsStatic flag in the
18586         EmitContext during the instance constructor initializer
18587         resolution, to stop access to instance variables.
18588
18589         This is mandated by the spec, last paragraph of the `constructor
18590         initializers' section. 
18591
18592 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
18593
18594         * cs-parser.jay, class.cs (Accessor): new class used to represent
18595         an accessor (get or set).  In the past we used `null' to represent
18596         a missing accessor.  But this is ambiguous because there was no
18597         way to tell in abstract indexers/properties if one of them was
18598         specified.
18599
18600         Now there is a way of addressing that.
18601
18602         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18603         instead of FindMembers.
18604
18605         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18606         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
18607
18608         * attribute.cs: Treat indexers and properties as the same in terms
18609         of applying attributes
18610
18611         * ecore.cs (FindMostEncompassedType): Use statically initialized
18612         EmptyExpressions()s like we do elsewhere to avoid creating useless
18613         objects (and we take this out of the tight loop).
18614
18615         (GetConversionOperators): Move the code to extract the actual
18616         operators to a separate routine to clean things up.
18617
18618 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
18619
18620         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
18621         events are always registered FieldBuilders.
18622
18623         * class.cs (FieldBase): New class shared by Fields 
18624
18625         * delegate.cs: If we are a toplevel delegate, use our full name.
18626         If we are a nested delegate, then only use our tail name.
18627
18628 2002-05-02  Ravi Pratap  <ravi@ximian.com>
18629
18630         * expression.cs (IsApplicable): Ensure that we add the "&" to
18631         ref/out types before comparing it with the type of the argument.
18632
18633         (IsParamsMethodApplicable): Ditto.
18634
18635         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
18636         silly me ;-)
18637
18638         * delegate.cs : Handle the case when we have more than one applicable
18639         method. Flag an error only when we finish checking all.
18640
18641 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
18642
18643         * expression.cs: Add support for boolean static initializers.
18644
18645 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
18646
18647         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
18648
18649         * parameter.cs (ComputeParameterTypes,
18650         ComputeAndDefineParameterTypes): Better error handling: now we
18651         clear the `types' cache if we fail during any of the type lookups.
18652         We also return the status code correctly to our caller
18653
18654         * delegate.cs: If we fail to define a delegate, abort the extra
18655         steps. 
18656
18657         * expression.cs (Binary.ResolveOperator): for
18658         operator==(object,object) and operator !=(object, object) we also
18659         have to verify that there is an implicit conversion from one to
18660         the other.
18661
18662         (ArrayAccess.DoResolve): Array Access can operate on
18663         non-variables. 
18664
18665 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
18666
18667         * assign.cs (CompoundAssign): A new class used as a "flag" that
18668         the assignment actually is happening as part of a compound
18669         assignment operator.
18670
18671         During compound assignment, a few new rules exist to enable things
18672         like:
18673
18674         byte b |= 1 + 2
18675
18676         From the spec:
18677
18678         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
18679         to the type of x) if y is implicitly convertible to the type of x,
18680         and the operator is a builtin operator and the return type of the
18681         operator is explicitly convertible to the type of x. 
18682
18683         * rootcontext.cs: Reset warning level to 2.  4 catches various
18684         "interesting" features in mcs, we must clean this up at some
18685         point, but currently am trying to kill other bugs ;-)
18686
18687         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
18688         in container classes as well.  
18689
18690         * expression.cs (Binary.ResolveOperator): Handle string case
18691         before anything else (as operator overloading does emit an error
18692         before doing anything else).
18693
18694         This code could go away when we move to a table driven model, but
18695         i could not come up with a good plan last night.
18696
18697 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
18698
18699         * typemanager.cs (CSharpName): reimplementation using regex.
18700         * class.cs: added null check for fields in Emit
18701         * rootcontext.cs: set warninglevel to 4
18702
18703 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
18704
18705         * typemanager.cs (CSharpName): reimplemented with Lupus
18706         suggestion.
18707
18708 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
18709
18710         * statement.cs (If): correclty implement Resolve, because we were
18711         not catching sem errors in there.  The same process is needed
18712         everywhere else. 
18713         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
18714
18715
18716         (Statement.Warning_DeadCodeFound): Factorize code.
18717         (While): Report dead code here too.
18718
18719         (Statement): Added Resolve virtual method to allow
18720         for resolution split from the emit code.
18721
18722 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
18723
18724         * statement.cs (EmitBoolExpression): No longer try to resolve the
18725         expression here.    
18726         (MakeBoolean): New utility function that resolve, implicitly
18727         converts to boolean and tags the expression. 
18728
18729
18730         (If, Do): Implement dead code elimination.
18731         (While): Implement loop inversion
18732
18733         (Do, While, For, If): Resolve the expression prior to calling our
18734         code generation.
18735
18736 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
18737
18738         * class.cs:
18739           - added method Report28 (warning: program has more than one entry point)
18740           - added method IsEntryPoint, implements paragraph 10.1 of the spec
18741           - modified method Method.Define, the part at the end of the method
18742
18743         * rootcontext.cs: added static public Location EntryPointLocation;
18744           
18745         * ../errors/cs0028.cs : Add test case for the above warning.              
18746
18747         * typemanager.cs:
18748           - modified method CSharpName to allow arrays of primitive type to
18749             be printed nicely (e.g. instead of System.Int32[][] it now prints
18750             int[][])
18751           - added method CSharpSignature: returns the signature of a method
18752             in string format to be used in reporting errors, warnings, etc.
18753
18754         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
18755         with String.Empty.
18756
18757 2002-04-26  Ravi Pratap  <ravi@ximian.com>
18758
18759         * delegate.cs (Define): Fix extremely silly bug where I was
18760         setting the type of the 'object' parameter of the BeginInvoke
18761         method to System.IAsyncResult instead of System.Object ;-)
18762
18763 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
18764
18765         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
18766         here. 
18767
18768         (Constructor.Emit): return if we fail to initialize the
18769         constructor.  Another door closed!  
18770
18771         * expression.cs (New.DoResolve): Improve error message (from -6 to
18772         1501).  Use DeclaredOnly lookup to find the exact constructor.
18773
18774         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
18775         loop.  This is useful.
18776
18777         * cs-parser.jay: Adjust the default parameters so that destructors
18778         have the proper signature.
18779
18780 2002-04-26  Martin Baulig  <martin@gnome.org>
18781
18782         * driver.cs (LoadAssembly): If `assembly' contains any characters
18783         which are only valid in path names and not in assembly names
18784         (currently slash, backslash and point), use Assembly.LoadFrom ()
18785         instead of Assembly.Load () on the `assembly' (before iteration
18786         over the link_paths).
18787
18788 2002-04-26  Martin Baulig  <martin@gnome.org>
18789
18790         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
18791
18792 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
18793
18794         * class.cs (Property): use the new typemanager.MemberLookup
18795
18796         (TypeContainer.MemberLookup): Implement using the
18797         TypeManager.MemberLookup now. 
18798
18799         * typemanager.cs: Make MemberLookup a function of the TypeManager,
18800         and return MemberInfos, so that these can be used without an
18801         EmitContext (what we had before).
18802
18803 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
18804
18805         * expression.cs: Fix the case where the argument to params if the
18806         type of the params.  I omitted handling this before.   Fixed
18807
18808 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
18809
18810         * driver.cs: Call BootCorlib_PopulateCoreType
18811
18812         * class.cs (Property.CheckBase): Check for properties only, not
18813         for all members. 
18814
18815         * interface.cs: Temporary hack: try/catch around the
18816         CustomAttributeBuilder, because I am getting an exception that I
18817         do not understand.
18818
18819         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
18820         types whose definitions are required to be there (attributes are
18821         defined before standard types).
18822
18823         Compute definitions as we boot the various types, as they are used
18824         immediately (value_type class will need object_type, but if we do
18825         not initialize object_type, we will pass a null, which will let
18826         the runtime pick the System.Object from the existing corlib, which
18827         is not what we want).
18828
18829 2002-04-22  Patrik Torstensson <totte@labs2.com>
18830
18831         * cs-tokenizer.cs: fixed a number of trim() issues.
18832
18833 2002-04-22  Ravi Pratap  <ravi@ximian.com>
18834
18835         * expression.cs (Argument.Type): Ensure that we return the correct
18836         type when we have out or ref parameters [in which case we 
18837         append a "&"].
18838
18839 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
18840
18841         * class.cs (Property, Indexer): Allow extern modifier in there. 
18842
18843         * typemanager.cs (InitBaseTypes): Initializes object_type and
18844         value_type, since those will be used early on during the bootstrap
18845         process to compile corlib.
18846
18847         (InitCoreTypes): Move code from here to InitBaseTypes.
18848
18849 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
18850
18851         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
18852         single-dimension arrays as using the ldlen opcode.  
18853
18854         Daniel Lewis discovered this optimization.  
18855
18856         * typemanager.cs: Add signature for System.Array::get_Length
18857
18858 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18859
18860         * statement.cs: report the error when the foreach does not apply to an
18861         array nor a collection.
18862
18863 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
18864
18865         * expression.cs: Add implicit conversions to the operator ~.
18866
18867         * constant.cs (DecimalConstant.Emit): Emit decimal value.
18868
18869         * typemanager.cs: Locate the decimal constructor.
18870
18871 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18872
18873         * attribute.cs: use the new property of TypeOf.
18874         * expression.cs: added 'get' property around typearg.
18875
18876         These changes fix a build breaker reported by NickD. Is this the
18877         correct way to fix?  If not, please, revert my changes and make it
18878         work :-).
18879
18880 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
18881
18882         * attribute.cs: Add support for typeof in attribute invocations.
18883         I am not sure that this is right though.
18884
18885 2002-04-14  Duncan Mak  <duncan@ximian.com>
18886
18887         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
18888         Binary.Operator.Division case.
18889
18890 2002-04-13  Ravi Pratap  <ravi@ximian.com>
18891
18892         * class.cs (DefineType): Ensure that we do a proper check on
18893         attribute types and also register it with the TypeManager.
18894
18895         (TypeContainer.Targets): The default for attribute types is
18896         AttributeTargets.All.
18897
18898         * attribute.cs (ApplyAttributes): Registering the attribute type
18899         is done elsewhere, not when we discover we have a Usage attribute.
18900
18901 2002-04-12  Ravi Pratap  <ravi@ximian.com>
18902
18903         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
18904         and get rid of is_delegate parameter.
18905
18906         * everywhere : update.
18907
18908 2002-04-12  Ravi Pratap  <ravi@ximian.com>
18909
18910         * cs-parser.jay (compilation_unit): Revamp completely to use
18911         some new ideas that I got from Rhys' grammar to solve the problems
18912         with assembly level attributes.
18913
18914         (outer_declaration): New grammar production.
18915
18916         (attribute_sections): Add.
18917
18918         (opt_attributes): Base on attribute_sections
18919
18920         (namespace_declaration): Allow opt_attributes to tackle the case
18921         when we have assembly level attributes - we are clever in this
18922         regard now ;-)
18923
18924         * attribute.cs (ApplyAttributes): Do not worry about assembly 
18925         attributes in the non-global context.
18926
18927         * rootcontext.cs (AddGlobalAttributes): Go back to using this
18928         instead of SetGlobalAttributes.
18929
18930         * class.cs, rootcontext.cs : Ensure we define and generate 
18931         attribute types before anything else.
18932
18933         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
18934         and flag the new error -20 for the case when the attribute type
18935         does not have valid targets specified. csc does not catch this.
18936
18937         * ../errors/errors.txt : update for error # -20
18938
18939 2002-04-11  Ravi Pratap  <ravi@ximian.com>
18940
18941         * support.cs (InternalParameters.ParameterModifier): Do some null
18942         checking and return sane values.
18943
18944         * class.cs (Method.Define): If we are a PInvoke method, ensure
18945         that we are static and extern. Report error # 601
18946
18947         * ../errors/cs0601.cs : Add test case for the above error.
18948
18949 2002-04-07  Ravi Pratap  <ravi@ximian.com>
18950
18951         * rootcontext.cs (attribute_types): We need to keep type of
18952         all attribute types separately and emit code for them first.
18953
18954         (RegisterAttribute) : Implement.
18955
18956         * class.cs (DefineType): Check if the current Type is a custom
18957         attribute type and register it accordingly.
18958
18959         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
18960         adding the first attribute twice and rename to
18961
18962         (SetGlobalAttributes): this.
18963
18964         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
18965         lookups.
18966
18967         * attribute.cs (ApplyAttributes): Take an additional argument telling us
18968         if we are processing global arguments. Hmm, I am unsure of this.
18969
18970 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18971
18972         * expression.cs: added static array of strings to avoid calling
18973         Enum.ToString () for Operator in Binary. Significant recover of
18974         performance.
18975
18976 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
18977
18978         * class.cs (FindMembers): Allow the Builders of the various
18979         members to be null.  If they are skip them.  This only happens
18980         during the PInvoke declaration.
18981
18982 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
18983
18984         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
18985         failure, so we do not keep going afterwards.
18986
18987         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
18988         wanted to pass `false' as the `is_delegate' argument.  If this is
18989         the case, why not use delegate_type == null to mean `is_delegate =
18990         false' and anything else as is_delegate = true.
18991
18992 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
18993
18994         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
18995         code for the section, not the beginning of the tests.
18996
18997 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
18998
18999         * cfold.cs: Handle operator + (Enum x, Underlying x) 
19000
19001         * expression.cs (Binary): same.  Warn about errors where we have
19002         Enum/Enum in operator + as well.
19003
19004 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
19005
19006         * statement.cs:
19007                 - added support for switch(bool)
19008                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
19009                 - add TableSwitchEmit() to handle table-based switch statements
19010
19011 2002-04-05  Ravi Pratap  <ravi@ximian.com>
19012
19013         * expression.cs (Invocation.OverloadResolve): Factor out code which
19014         does parameter compatibility checking with arguments so that we can 
19015         re-use the code even from Delegate.VerifyApplicability
19016
19017         (VerifyArgumentsCompat): Move above code here.
19018
19019         * delegate.cs (VerifyApplicability): Get rid of duplicate code
19020         and instead make a call to the above method.
19021
19022 2002-03-31  Ravi Pratap  <ravi@ximian.com>
19023
19024         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
19025         We use it to keep track of classes which are attribute types.
19026
19027 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
19028
19029         * delegate.cs (Delegate.Define): Correctly define the types in the
19030         presence of fixed and array parameters.
19031
19032         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
19033         doing FindMembers.
19034
19035         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
19036         include NonPublic after the first iteration.
19037
19038         * class.cs (Indexer.CheckBase): Only check if both parents are
19039         non-null. 
19040
19041         * cs-parser.jay (accessor_body): If empty, set to null.
19042
19043         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
19044         same code path here to resolve constants names that we did have in
19045         MemberAccess.DoResolve.  There is too much code duplicated here.
19046
19047 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
19048
19049         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
19050
19051         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
19052         to MakeUnionSet.
19053
19054         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
19055         tokens, numbers and strings.
19056
19057         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
19058         parenthesis.
19059
19060         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
19061         asyncronous parameters and the regular parameters.  
19062
19063         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
19064         specify the target directory.
19065
19066         * expression.cs: (This.DoResolve): Simplify
19067         (As.Emit): Optimize, do not generate IsInst if the expression is
19068         always of the given type.
19069
19070         (Is.DoResolve): Bug fix, we were reporting both always/never for
19071         the is expression.
19072
19073         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
19074         creating too many unnecessary arrays.
19075
19076 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
19077
19078         * class.cs (EmitFieldInitializer): Use Assign expression to assign
19079         fields instead of rolling our own initializer.   Takes care of all
19080         implicit conversions, and drops unnecessary static checks/argument.
19081
19082 2002-03-31  Dick Porter  <dick@ximian.com>
19083
19084         * driver.cs: use the GetDirectories() return values properly, and
19085         use "/" as path separator.
19086
19087 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
19088
19089         * expression.cs (Unary): Optimize - - expr into expr.
19090         (Binary): Optimize a + (-b) into a -b.
19091
19092         * codegen.cs (CodeGen): Made all methods static.
19093
19094 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
19095
19096         * rootcontext.cs: 
19097
19098         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
19099         TypeBuilder property.
19100
19101         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
19102         instead. 
19103
19104         * tree.cs: Removed the various RecordXXXX, and replaced with a
19105         single RecordDecl.  Removed all the accessor methods, and just
19106         left a single access point Type 
19107
19108         * enum.cs: Rename DefineEnum to DefineType.
19109
19110         * decl.cs: New abstract method `DefineType' used to unify the
19111         Defines for Enumerations, Interfaces, TypeContainers and
19112         Delegates.
19113
19114         (FindType): Moved LookupInterfaceOrClass here.  Moved the
19115         LookupBaseClasses method that used to live in class.cs and
19116         interface.cs here, and renamed to FindType.
19117
19118         * delegate.cs: Implement DefineType.  Take advantage of the
19119         refactored pattern for locating the parent builder without taking
19120         the parent_builder argument (which we know does not work if we are
19121         nested, and triggering a toplevel definition).
19122
19123 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19124
19125         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
19126         accessibility of a member has changed during override and report
19127         an error if so.
19128
19129         * class.cs (Method.Define, Property.Define): Only complain on
19130         overrides if the method is private, any other accessibility is
19131         fine (and since we just checked the permission is the same, we are
19132         good to go).
19133
19134         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
19135         and elif are processed always.  The other pre-processing
19136         directives are only processed if we are "taking" the path
19137
19138 2002-03-29  Martin Baulig  <martin@gnome.org>
19139
19140         * class.cs (Method.Emit): Only emit symbolic debugging info if the
19141         current location is not Null.
19142
19143         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
19144         a separate method so we can profile it.
19145
19146         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
19147         `span.Seconds' are just seconds, but no minutes or hours.
19148         (MainDriver): Profile the CodeGen.SaveSymbols calls.
19149
19150 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19151
19152         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
19153         Remove the gratuitous set of Final:
19154
19155                                 // If an interface implementation, then we can set Final.
19156                                 if (((flags & MethodAttributes.Abstract) == 0) &&
19157                                     implementing.DeclaringType.IsInterface)
19158                                         flags |= MethodAttributes.Final;
19159
19160         I do not know what I was smoking when I used that.
19161
19162
19163         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
19164         step into fixing the name resolution issues for delegates and
19165         unifying the toplevel name resolution.
19166
19167 2002-03-28  Martin Baulig  <martin@gnome.org>
19168
19169         * class.cs (Method.Emit): If we have a symbol writer, call its
19170         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
19171         tell it about the current method.
19172
19173         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
19174         writer that we're going to emit the first byte of IL code for a new
19175         statement (a new source line).
19176         (EmitContext.EmitTopBlock): If we have a symbol writer, call
19177         EmitContext.Mark() before emitting any code.
19178
19179         * location.cs (SymbolDocument): Return null when we're Null.
19180
19181         * statement.cs (Statement): Moved the `Location loc' variable here.
19182         (Statement.EmitBoolExpression): If we have a symbol writer, call
19183         ec.Mark() before emitting any code to tell it that we're at the
19184         beginning of a new statement.
19185         (StatementExpression): Added `Location' argument to the constructor.
19186         (Block): Added public readonly variable `StartLocation' and public
19187         variable `EndLocation'.  The latter is to be set using SetEndLocation().
19188         (Block): Added constructor which takes a start and end location.
19189         (Block.SetEndLocation): New method. This sets the end location.
19190         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
19191         local variables we create.
19192         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
19193         each statement and do also mark the begin and end of the block.
19194
19195         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
19196         tell it the current lexer.Location, use Location.Null for the end of the
19197         block.
19198         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
19199         current block, set its end location using SetEndLocation().
19200         (statement_expression): StatementExpression constructor now takes the
19201         lexer.Location as additional argument.
19202         (for_statement, declare_local_variables): Likewise.
19203         (declare_local_variables): When creating a new implicit block, use the
19204         new Block constructor and pass it the lexer.Location.
19205
19206 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19207
19208         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
19209         members also on the parent interfaces recursively.
19210
19211 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
19212
19213         * report.cs: Use new formats, since Gonzalo finished the missing
19214         bits. 
19215
19216         * expression.cs (Binary.ResolveOperator): added missing operator|
19217         operator& and operator^ for bool/bool.
19218
19219         * cs-parser.jay: CheckDef now takes a Location argument that is
19220         used to report errors more precisly (instead of reporting the end
19221         of a definition, we try to track something which is a lot closer
19222         to the source of the problem).
19223
19224         * cs-tokenizer.cs: Track global token use, so we can properly flag
19225         the use of #define/#undef after the first token has been seen.
19226
19227         Also, rename the reportXXXX to Error_DescriptiveName
19228
19229         * decl.cs (DeclSpace.IsTopLevel): Move property here from
19230         TypeContainer, so that Enum and Interface can use this too.
19231
19232         * class.cs (TypeContainer.LookupInterfaceOrClass,
19233         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
19234         `builder' argument.  Typically this was used to pass the parent
19235         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
19236         the definition).  
19237
19238         The problem is that a nested class could trigger the definition of
19239         a toplevel class, and the builder would be obviously wrong in that
19240         case. 
19241
19242         So we drop this argument, and we compute dynamically the
19243         TypeBuilder/ModuleBuilder (the correct information was available
19244         to us anyways from DeclSpace.Parent)
19245
19246         * interface.cs (Interface.DefineInterface): Drop builder
19247         parameter cleanup like class.cs
19248
19249         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
19250         like class.cs
19251
19252         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
19253         values. 
19254
19255         (Try.Emit): Propagate the returns value from the statement.
19256
19257         (Return.Emit): Even if we are leavning 
19258
19259         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
19260
19261         * modifiers.cs: Fix the computation of MethodAttributes flags.
19262
19263 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
19264
19265         * driver.cs: allow compilation of files that start with '/'.
19266         Add a default case when checking the argument of --target.
19267
19268 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
19269
19270         * interface.cs: Implement the same search algorithm for types in
19271         the interface code.
19272
19273         * delegate.cs: Do not allow multiple definition.
19274
19275         * Recovered ChangeLog that got accidentally amputated
19276
19277         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
19278
19279         * rootcontext.cs: Load manually enum to allow core classes to
19280         contain enumerations.
19281
19282         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
19283         Update to new static methods in TypeManager.
19284
19285         * typemanager.cs (GetMethod, GetConstructor): Use our
19286         implementation of FindMembers to find the members, since during
19287         corlib compilation, the types are TypeBuilders and GetMethod and
19288         GetConstructor do not work.
19289
19290         Make all methods in TypeManager static.
19291
19292         (InitCodeHelpers): Split the functionality from
19293         the InitCodeTypes function.
19294
19295         * driver.cs: Call InitCodeHelpers after we have populated the
19296         types. 
19297
19298         * cs-parser.jay (delegate_declaration): we did not used to compute
19299         the delegate name correctly for void delegates.
19300
19301 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
19302
19303         * rootcontext.cs (RootContext): Init the interface_resolve_order
19304         and type_container_resolve_order always.
19305
19306         (ResolveCore, BootstrapCorlib_ResolveClass,
19307         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19308         compiler when compiling with --nostdlib
19309
19310         * class.cs (TypeContainer.DefineType): Check that our parent is
19311         not null.  This test is most important when we are bootstraping
19312         the core types.
19313
19314         * codegen.cs: Split out the symbol writing code.
19315
19316 2002-03-25  Martin Baulig  <martin@gnome.org>
19317
19318         * driver.cs (-g): Made -g an alias for --debug.
19319
19320 2002-03-24  Martin Baulig  <martin@gnome.org>
19321
19322         * codegen.cs (SymbolWriter): New public variable. Returns the
19323         current symbol writer.
19324         (CodeGen): Added `bool want_debugging_support' argument to the
19325          constructor. If true, tell the ModuleBuild that we want debugging
19326         support and ask it for the ISymbolWriter.
19327         (Save): If we have a symbol writer, call it's Close() method after
19328         saving the assembly.
19329
19330         * driver.c (--debug): New command line argument to create a
19331         debugger information file.
19332
19333         * location.cs (SymbolDocument): New public property. Returns an
19334         ISymbolDocumentWriter object for the current source file or null
19335         if we don't have a symbol writer.
19336
19337 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
19338
19339         * driver.cs (LoadAssembly): Correctly return when all the paths
19340         have been tried and not before.
19341
19342         * statement.cs (Switch.Emit): return the actual coverage for this
19343         statement (returns/not-returns)
19344
19345         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19346         switch of the statement if we are the last switch section.  That
19347         kills two problems: try/catch problems (we used to emit an empty
19348         nop at the end) and switch statements where all branches would
19349         return. 
19350
19351 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
19352
19353         * driver.cs: Add default assemblies (the equivalent to the
19354         Microsoft CSC.RSP file)
19355
19356         * cs-tokenizer.cs: When updating `cols and setting it to zero,
19357         also update tokens_seen and set it to false.
19358
19359         * driver.cs: Implement --recurse for Mike.
19360
19361         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19362         correctly splitting out the paths.
19363
19364 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
19365
19366         * interface.cs (Interface.PopulateProperty): Instead of using
19367         `parent' as the declaration space for the set parameters, use
19368         `this' 
19369
19370         * support.cs (InternalParameters): InternalParameters constructor
19371         takes a DeclSpace instead of a TypeContainer.
19372
19373         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
19374         types are being initialized, load the address of it before calling
19375         the function.  
19376
19377         (New): Provide a mechanism to disable the generation of local
19378         value type temporaries when the caller will be providing us with
19379         an address to store it.
19380
19381         (ArrayCreation.EmitDynamicInitializers): Use it.
19382
19383 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
19384
19385         * expression.cs (Invocation.EmitArguments): Only probe for array
19386         property if there is more than one argument.  Sorry about that.
19387
19388         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19389         empty param arrays.
19390
19391         * class.cs (Method.LabelParameters): Fix incorrect code path that
19392         prevented the `ParamArrayAttribute' from being applied to the
19393         params attribute.
19394
19395 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
19396
19397         * support.cs (ReflectionParameters): Correctly compute whether the
19398         last argument is a params array.  Fixes the problem with
19399         string.Split ('a')
19400
19401         * typemanager.cs: Make the assemblies array always be non-null
19402         (empty, but non-null)
19403
19404         * tree.cs (RecordDecl): New function that abstracts the recording
19405         of names.  This reports error 101, and provides a pointer to the
19406         previous declaration.  Fixes a crash in the compiler.
19407
19408         * cs-parser.jay (constructor_declaration): Update to new grammar,
19409         and provide a constructor_body that can be empty.
19410
19411 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
19412
19413         * driver.cs: Add support for --resources.
19414
19415         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19416         Make all types for the various array helper methods be integer.
19417
19418         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19419         CheckState to ConvCast.
19420
19421         (ConvCast): Now it takes a `checked' state argument, to avoid
19422         depending on the emit context for the conversion, and just using
19423         the resolve time setting.
19424
19425         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19426         instead of Invocation.EmitArguments.  We do not emit the original
19427         arguments, instead we emit those which have been converted to
19428         unsigned int expressions.
19429
19430         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19431
19432         * codegen.cs: ditto.
19433
19434         * expression.cs (LocalVariableReference): Drop the use of the
19435         Store function that depended on the variable index.
19436
19437         * statement.cs (VariableInfo): Drop the `Idx' property from this
19438         class, as this is not taking into account the indexes for
19439         temporaries tat we generate during the execution, getting the
19440         indexes wrong.
19441
19442         * class.cs: First emit class initializers, then call the parent
19443         constructor. 
19444
19445         * expression.cs (Binary): Fix opcode emision.
19446         (UnaryMutator.EmitCode): Support checked code generation
19447
19448         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19449         matches for events for both the Static and Instance scans,
19450         pointing to the same element.   Fix that.
19451
19452 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
19453
19454         * rootcontext.cs (ResolveTree): Always set the
19455         interface_resolve_order, because nested interfaces will be calling
19456         into us.
19457
19458         * class.cs (GetInterfaceOrClass): Track the same resolution
19459         process used by TypeManager.LookupType.  This fixes the nested
19460         type lookups in class declarations (separate path from
19461         LookupType). 
19462
19463         (TypeContainer.DefineType): Also define nested interfaces.
19464         (TypeContainer.RegisterOrder): New public function used to
19465         register the order in which child interfaces need to be closed.
19466
19467         Nested interfaces need to be closed after their parents have been
19468         created. 
19469
19470         * interface.cs (InterfaceAttr): Put all the logic for computing
19471         the interface attribute here. 
19472
19473         (DefineInterface): Register our interface order with the
19474         RootContext or with the TypeContainer depending on the case.
19475
19476 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19477
19478         * cs-parser.jay: rework foreach statement to work with the new
19479         changes to the policy on SimpleNames.
19480
19481         * report.cs: support Stacktrace on warnings as well.
19482
19483         * makefile: drop --unsafe and /unsafe from the compile.
19484
19485 2002-03-13  Ravi Pratap  <ravi@ximian.com>
19486
19487         * ecore.cs (StandardConversionExists): Modify to take an Expression
19488         as the first parameter. Ensure we do null -> reference type conversion
19489         checking.
19490
19491         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19492         temporary Expression objects.
19493
19494 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19495
19496         * interface.cs: workaround bug in method overloading resolution
19497         (there is already a bugzilla bug for it).
19498
19499 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19500
19501         We could also solve this problem by having a separate path for
19502         performing type lookups, instead of DoResolve, we could have a
19503         ResolveType entry point, and only participating pieces of the
19504         production (simplename, deref, array) would implement this. 
19505
19506         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19507         signal SimpleName to only resolve type names and not attempt to
19508         resolve anything else.
19509
19510         * expression.cs (Cast): Set the flag.
19511
19512         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19513
19514         * class.cs: Only report 108 if there is no `new' modifier.
19515
19516         * cs-parser.jay: rework foreach statement to work with the new
19517         changes to the policy on SimpleNames.
19518         
19519         * report.cs: support Stacktrace on warnings as well.
19520
19521         * makefile: drop --unsafe and /unsafe from the compile.
19522
19523 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
19524
19525         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19526         lookups here, instead of doing that at parse time.  This means
19527         that our grammar will not introduce `LocalVariableReferences' as
19528         expressions at this point.  That solves the problem of code like
19529         this:
19530
19531         class X {
19532            static void Main ()
19533            { int X = 1;
19534             { X x = null }}}
19535
19536         This is only half the fix.  The full fix requires parameters to
19537         also be handled in this way.
19538
19539         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19540         makes the use more obvious of the DeclSpace.  The
19541         ec.TypeContainer.TypeBuilder is now only used to pull the
19542         TypeBuilder for it.
19543
19544         My theory is that I can get rid of the TypeBuilder completely from
19545         the EmitContext, and have typecasts where it is used (from
19546         DeclSpace to where it matters).  
19547
19548         The only pending problem is that the code that implements Aliases
19549         is on TypeContainer, and probably should go in DeclSpace.
19550
19551         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19552         lookups here, instead of doing that at parse time.  This means
19553         that our grammar will not introduce `LocalVariableReferences' as
19554         expressions at this point.  That solves the problem of code like
19555         this:
19556
19557         class X {
19558            static void Main ()
19559            { int X = 1;
19560             { X x = null }}}
19561
19562         This is only half the fix.  The full fix requires parameters to
19563         also be handled in this way.
19564
19565         * class.cs (Property.DefineMethod): When implementing an interface
19566         method, set newslot, when implementing an abstract method, do not
19567         set the flag (before we tried never setting it, or always setting
19568         it, which is the difference).
19569         (Indexer.DefineMethod): same.
19570         (Method.DefineMethod): same.
19571
19572         * ecore.cs: Only set the status used flag if we get back a Field.
19573
19574         * attribute.cs: Temporary hack, so Paolo can keep working.
19575
19576 2002-03-08  Ravi Pratap  <ravi@ximian.com>
19577
19578         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19579         the unmanaged type in the case we have a MarshalAs attribute.
19580
19581         (Resolve): Handle the case when we are parsing the special MarshalAs
19582         attribute [we need to store the unmanaged type to use later]
19583
19584         * typemanager.cs (marshal_as_attr_type): Built in type for the 
19585         MarshalAs Attribute.
19586
19587         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
19588         on parameters and accordingly set the marshalling info.
19589
19590 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
19591
19592         * class.cs: Optimizing slightly by removing redundant code after
19593         we switched to the `NoTypes' return value.
19594         (Property.DefineMethod): use NoTypes here too.
19595
19596         This fixes the bug I introduced in my last batch of changes.
19597
19598 2002-03-05  Ravi Pratap  <ravi@ximian.com>
19599
19600         * tree.cs (RecordEnum): Add. We now keep track of enums too.
19601
19602         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19603         Enums since those are types too. 
19604
19605         * cs-parser.jay (enum_declaration): Record enums as we parse them.
19606
19607         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
19608         thanks to a call during the lookup process.
19609
19610 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
19611
19612         * statement.cs (Foreach): Lots of work to accomodate a particular
19613         kind of foreach statement that I had not kept in mind.  It is
19614         possible to have foreachs on classes that provide a GetEnumerator
19615         method that return objects that implement the "pattern" for using
19616         a foreach, there is no need to support GetEnumerator
19617         specifically. 
19618
19619         This is needed to compile nant.
19620
19621         * decl.cs: Only report 114 if the member is not `Finalize' and if
19622         the warning level is at least 2.
19623
19624         * class.cs: Moved the compare function from Method to
19625         MethodSignature. 
19626
19627         (MethodSignature.InheritableMemberSignatureCompare): Add new
19628         filter function that is used to extract inheritable methods from a
19629         class. 
19630
19631         (Method.Define): Use the new `inheritable_method_signature_filter'
19632         delegate
19633
19634         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
19635         command. 
19636
19637 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
19638
19639         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
19640
19641         * cs-parser.jay: Add opt_semicolon to the interface declaration.
19642
19643         * expression.cs: Pass location information to
19644         ConvertImplicitStandard. 
19645
19646         * class.cs: Added debugging code to track return values from
19647         interfaces. 
19648
19649 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
19650
19651         * expression.cs (Is.DoResolve): If either side of the `is' is an
19652         interface, do not flag the warning.
19653
19654         * ecore.cs (ImplicitReferenceConversion): We need a separate test
19655         for interfaces
19656
19657         * report.cs: Allow for --fatal to be used with --probe.
19658
19659         * typemanager.cs (NoTypes): Move the definition for the empty Type
19660         array here. 
19661
19662         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
19663         properties. 
19664         (TypeContainer.DefineProxy): New function used to proxy to parent
19665         implementations when implementing interfaces.
19666         (TypeContainer.ParentImplements): used to lookup if our parent
19667         implements a public function that is required by an interface.
19668         (TypeContainer.VerifyPendingMethods): Hook this up.
19669
19670         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
19671         `modules' and `assemblies' arraylists into arrays.  We only grow
19672         these are the very early start up of the program, so this improves
19673         the speedof LookupType (nicely measured).
19674
19675         * expression.cs (MakeByteBlob): Replaced unsafe code with
19676         BitConverter, as suggested by Paolo.
19677
19678         * cfold.cs (ConstantFold.Binary): Special case: perform constant
19679         folding of string concatenation, but if either side is a string,
19680         and the other is not, then return null, and let the runtime use
19681         the concatenation on the string plus the object (using
19682         `Object.ToString'). 
19683
19684 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
19685
19686         Constant Folding has been implemented now.
19687
19688         * expression.cs (Unary.Reduce): Do not throw an exception, catch
19689         the error instead on types that are not supported in one's
19690         complement. 
19691
19692         * constant.cs (Constant and all children): New set of functions to
19693         perform implict and explicit conversions.
19694
19695         * ecore.cs (EnumConstant): Implement the new functions to perform
19696         conversion by proxying to the child expression.
19697
19698         * codegen.cs: (ConstantCheckState): Constant evaluation has its
19699         own separate setting that can not be turned off from the command
19700         line using --unchecked or --checked and is only controlled using
19701         the checked/unchecked statements and expressions.  This setting is
19702         used by the constant folder to flag errors.
19703
19704         * expression.cs (CheckedExpr, UncheckedExpr): Set the
19705         ConstantCheckState as well.   
19706
19707         During Resolve, they also have to flag the state, because the
19708         constant folder runs completely in the Resolve phase.
19709
19710         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
19711         well.
19712
19713 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
19714
19715         * cfold.cs: New file, this file contains the constant folder.
19716
19717         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
19718         argument to track whether we are using the resulting address to
19719         load or store a value and provide better error messages. 
19720
19721         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
19722         new AddressOf arguments.
19723
19724         * statement.cs (Foreach.EmitCollectionForeach): Update
19725
19726         * expression.cs (Argument.Emit): Call AddressOf with proper
19727         arguments to track usage.
19728
19729         (New.DoEmit): Call AddressOf with new arguments.
19730
19731         (Unary.Emit): Adjust AddressOf call.
19732
19733 2002-03-01  Ravi Pratap  <ravi@ximian.com>
19734
19735         * cs-parser.jay (member_access): Change the case for pre-defined types
19736         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
19737         this suggestion.
19738
19739         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
19740         a method body.
19741
19742         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
19743         essentially like methods and apply attributes like MethodImplOptions to them too.
19744
19745         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
19746         not being null.
19747
19748         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
19749         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
19750         is the DeclSpace.
19751
19752         * Update code everywhere accordingly.
19753
19754         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
19755
19756         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
19757
19758 2002-02-28  Ravi Pratap  <ravi@ximian.com>
19759
19760         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
19761         try performing lookups against those instead of jumping straight into using
19762         the 'using' clauses.
19763
19764         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
19765
19766         (LookupType): Perform lookups in implicit parents too.
19767
19768         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
19769         sequence as RootContext.LookupType. 
19770
19771         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
19772         the various cases of namespace lookups into this method.
19773
19774 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
19775
19776         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
19777         in positional arguments)
19778
19779         * class.cs (Operator): Update the AllowedModifiers to contain
19780         extern. 
19781
19782         * cs-parser.jay: Update operator declaration to allow for the
19783         operator body to be empty.
19784
19785         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
19786         values. 
19787
19788 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
19789
19790         * class.cs (Method.Emit): Label parameters.
19791
19792         * driver.cs: Return 1 or 0 as the program exit code.
19793
19794 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
19795
19796         * expression.cs: Special case the `null' object when trying to
19797         auto-compute the type, as anything can be explicitly converted to
19798         that. 
19799
19800         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
19801         spotting this Paolo.
19802
19803         (Expression.ImplicitNumericConversion): Perform comparissions of
19804         the type using the underlying type in the case of an enumeration
19805         rather than using the enumeration type for the compare.
19806
19807         Cope with the underlying == type case, which is not possible to
19808         catch before. 
19809
19810         (Expression.ConvertNumericExplicit): Perform comparissions of
19811         the type using the underlying type in the case of an enumeration
19812         rather than using the enumeration type for the compare.
19813
19814         * driver.cs: If the user does not supply an extension, assume .exe
19815
19816         * cs-parser.jay (if_statement): Rewrote so that we can track the
19817         location for the if statement.
19818
19819         * expression.cs (Binary.ConstantFold): Only concat strings when
19820         the operation is "+", not everything ;-)
19821
19822         * statement.cs (Statement.EmitBoolExpression): Take a location
19823         argument. 
19824         (If, While, Do): Track location.
19825
19826         * expression.cs (Binary.ResolveOperator): In the object + string
19827         case, I was missing a call to ConvertImplicit
19828
19829 2002-02-25  Ravi Pratap  <ravi@ximian.com>
19830
19831         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
19832         Location arguments. Ensure we use RootContext.LookupType to do our work
19833         and not try to do a direct Type.GetType and ModuleBuilder.GetType
19834
19835         * interface.cs (PopulateMethod): Handle the type of the parameter being
19836         null gracefully.
19837
19838         * expression.cs (Invocation.BetterFunction): Handle the case when we 
19839         have a params method with no fixed arguments and a call is made with no
19840         arguments.
19841
19842 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
19843
19844         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
19845         the verbatim-string-literal
19846
19847         * support.cs (InternalParameters.ParameterModifier): handle null
19848         fixed parameters.
19849         (InternalParameters.ParameterType): ditto.
19850
19851         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
19852         duplicating the name of the variable parameter.
19853         (GetParameterByName): Fix bug where we were not looking up array
19854         paramters if they were the only present (thanks Paolo!).
19855         (GetParameterInfo): We only have an empty set of types if both
19856         fixed and array are set to null.
19857         (GetParameterInfo-idx): Handle FixedParameter == null
19858
19859         * cs-parser.jay: Handle the case where there is no catch
19860         statements (missing null test).
19861
19862 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
19863
19864         * driver.cs (MainDriver): Be conservative on our command line
19865         handling.
19866
19867         Catch DirectoryNotFoundException when calling GetFiles.
19868
19869         (SplitPathAndPattern): Used to split the input specification into
19870         a path and a pattern that we can feed to Directory.GetFiles.
19871
19872 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
19873
19874         * statement.cs (Fixed): Implement the last case of the Fixed
19875         statement (string handling).
19876
19877         * expression.cs (StringPtr): New class used to return a char * to
19878         a string;  Used by the Fixed statement.
19879
19880         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
19881
19882         * expression.cs (Binary.ResolveOperator): Remove redundant
19883         MemberLookup pn parent type.
19884         Optimize union call, we do not need a union if the types are the same.
19885         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
19886         type.
19887
19888         Specialize the use of MemberLookup everywhere, instead of using
19889         the default settings. 
19890
19891         (StackAlloc): Implement stackalloc keyword.
19892
19893         * cs-parser.jay: Add rule to parse stackalloc.
19894
19895         * driver.cs: Handle /h, /help, /?
19896
19897         * expression.cs (MakeByteBlob): Removed the hacks we had in place
19898         before we supported unsafe code.
19899
19900         * makefile: add --unsafe to the self compilation of mcs.
19901
19902 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
19903
19904         * expression.cs (PointerArithmetic): New class that is used to
19905         perform pointer arithmetic.
19906         (Binary.Resolve): Handle pointer arithmetic
19907         Handle pointer comparission.
19908         (ArrayPtr): Utility expression class that is used to take the
19909         address of an array.
19910
19911         (ElementAccess): Implement array access for pointers
19912
19913         * statement.cs (Fixed): Implement fixed statement for arrays, we
19914         are missing one more case before we are done.
19915
19916         * expression.cs (Indirection): Implement EmitAssign and set the
19917         ExprClass to Variable.  This allows pointer dereferences to be
19918         treated as variables, and to have values assigned to them.
19919
19920         * ecore.cs (Expression.StoreFromPtr): New utility function to
19921         store values dereferencing.
19922
19923 2002-02-20  Ravi Pratap  <ravi@ximian.com>
19924
19925         * expression.cs (Binary.ResolveOperator): Ensure that we are
19926         not trying to operate on a void type - this fixes the reported
19927         bug.
19928
19929         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
19930         the parent implementation is sealed.
19931
19932         * ../errors/cs0239.cs : Add.
19933
19934         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
19935
19936         * typemanager.cs (unverifiable_code_type): Corresponds to 
19937         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
19938         which have unsafe code in them.
19939
19940         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
19941         unsafe context.
19942
19943 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
19944
19945         * cs-tokenizer.cs: Add support for @"litreal strings"
19946
19947         Make tokenizer accept pre-processor directives
19948         on any column (remove the old C-like limitation). 
19949
19950         * rootcontext.cs (EmitCode): Emit any global attributes.
19951         (AddGlobalAttributes): Used to keep track of assembly attributes. 
19952
19953         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
19954
19955         * cs-parser.jay: Add support for global attributes.  
19956
19957 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
19958
19959         * expression.cs (Indirection): New helper class.  Unary will
19960         create Indirection classes to be able to implement the
19961         IMemoryLocation interface on it.
19962
19963 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
19964
19965         * cs-parser.jay (fixed_statement): reference the right statement.
19966
19967         * statement.cs (Fixed.Emit): Finish implementing the fixed
19968         statement for the &x case.
19969
19970 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
19971
19972         * class.cs (Property.Define, Method.Define): Remove newslot when
19973         `implementing'.  
19974
19975         * modifiers.cs: My use of NewSlot when `Abstract' was set was
19976         wrong.  NewSlot should only be used if the `new' keyword is present.
19977
19978         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
19979         locating our system dir.  Sorry about this.
19980
19981 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
19982
19983         * driver.cs (GetSystemDir): Compute correctly the location of our
19984         system assemblies.  I was using the compiler directory instead of
19985         the library directory.
19986
19987 2002-02-13  Ravi Pratap  <ravi@ximian.com>
19988
19989         * expression.cs (BetterFunction): Put back in what Miguel commented out
19990         since it is the correct fix. The problem is elsewhere ;-)
19991
19992         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
19993         parameters of the parms method are themselves compatible or not !
19994
19995         (StandardConversionExists): Fix very dangerous bug where we were forgetting
19996         to check that a class implements an interface before saying that an implicit
19997         conversion was allowed. Use ImplementsInterface to do the checking.
19998
19999 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20000
20001         * class.cs (Method.Define): Track whether we are an explicit
20002         implementation or not.  And only call DefineMethodOverride if we
20003         are an explicit implementation.
20004
20005         (Property.DefineMethod): Ditto.
20006
20007 2002-02-11  Ravi Pratap  <ravi@ximian.com>
20008
20009         * expression.cs (BetterFunction): Catch hideous bug which was
20010          preventing us from detecting ambiguous calls due to implicit casts i.e
20011         cs0121.
20012
20013 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
20014
20015         * support.cs (Pair): Remove un-needed method.  I figured why I was
20016         getting the error in cs-parser.jay, the variable in a foreach loop
20017         is readonly, and the compiler does not really treat this as a variable.
20018
20019         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
20020         instead of EQUALS in grammar.  
20021
20022         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
20023
20024         * expression.cs (Unary.DoResolve): Check whether the argument is
20025         managed or not.
20026
20027 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
20028
20029         * support.cs: Api for Pair to set a value.  Despite the fact that
20030         the variables are public the MS C# compiler refuses to compile
20031         code that accesses the field if the variable is part of a foreach
20032         statement. 
20033
20034         * statement.cs (Fixed): Begin implementation of the fixed
20035         statement.
20036
20037         (Block.AddVariable): Return the VariableInfo on success and null
20038         on failure instead of true/false. 
20039
20040         * cs-parser.jay (foreach): Catch errors on variables already
20041         defined (we were ignoring this value before) and properly unwind
20042         the block hierarchy
20043
20044         (fixed_statement): grammar for the fixed statement.
20045
20046 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
20047
20048         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
20049         pointer types to be incretemented.
20050
20051         (SizeOf): Implement.
20052
20053         * cs-parser.jay (pointer_member_access): Implement
20054         expr->IDENTIFIER production.
20055
20056         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
20057         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
20058         on safe contexts.
20059
20060         (Unary): Implement indirection.
20061
20062         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
20063         use in non-unsafe context).
20064
20065         (SimpleName.DoResolve): Check for pointers in field access on safe
20066         contexts. 
20067
20068         (Expression.LoadFromPtr): Factor the load-indirect code in this
20069         function.  This was duplicated in UnboxCast and ParameterReference
20070
20071 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
20072
20073         * expression.cs (ComposedCast): report an error if a pointer cast
20074         is used in a safe region.
20075
20076         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
20077         pointer type casts in unsafe context.
20078
20079         * codegen.cs (EmitContext): Set up IsUnsafe.
20080
20081         * cs-parser.jay (non_expression_type): Add productions for pointer
20082         casts. 
20083
20084         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
20085         code.  We should not use force into static mode if the method is
20086         not virtual.  Fixes bug in MIS
20087
20088         * statement.cs (Do.Emit, While.Emit, For.Emit,
20089         Statement.EmitBoolExpression): Add support to Do and While to
20090         propagate infinite loop as `I do return' semantics.
20091
20092         Improve the For case to also test for boolean constants.
20093
20094         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
20095         to the list of attributes we can add.
20096
20097         Remove `EmitContext' argument.
20098
20099         * class.cs (Method.Define): Apply parameter attributes.
20100         (Constructor.Define): Apply parameter attributes.
20101         (MethodCore.LabelParameters): Move here the core of labeling
20102         parameters. 
20103
20104         * support.cs (ReflectionParameters.ParameterModifier,
20105         InternalParameters.ParameterModifier): Use IsByRef on the type and
20106         only return the OUT bit for these parameters instead of in/out/ref
20107         flags.
20108
20109         This is because I miss-understood things.  The ParameterInfo.IsIn
20110         and IsOut represent whether the parameter has the [In] and [Out]
20111         attributes set.  
20112
20113 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
20114
20115         * ecore.cs (FieldExpr.Emit): Release temporaries.
20116
20117         * assign.cs (LocalTemporary.Release): new function.
20118
20119         * codegen.cs (EmitContext.GetTemporaryStorage,
20120         EmitContext.FreeTemporaryStorage): Rework the way we deal with
20121         temporary storage.  Now we can "put back" localbuilders when we
20122         are done with them
20123
20124 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
20125
20126         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
20127         need to make a copy of the variable to generate verifiable code.
20128
20129 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
20130
20131         * driver.cs: Compute dynamically the system directory.
20132
20133         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
20134         Slower, but more generally useful.  Used by the abstract
20135         registering implementation. 
20136
20137         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
20138         the rules for the special rule on Type/instances.  First check if
20139         we have the same name, and if so, try that special static path
20140         rather than the instance path.
20141
20142 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
20143
20144         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
20145         for, while and if.
20146
20147         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
20148         Enum, ValueType, Delegate or Array for non-corlib compiles.
20149
20150         * cs-tokenizer.cs: Catch long identifiers (645)
20151
20152         * typemanager.cs (IndexerPropetyName): Ravi never tested this
20153         piece of code.
20154
20155         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
20156         fix, we were returning too early, so we were not registering
20157         pending methods from abstract classes.
20158
20159         Do not register pending methods if the class is abstract.
20160
20161         * expression.cs (Conditional.DoResolve): Report circular implicit
20162         conversions when we neecd to compute it for conditional
20163         expressions. 
20164
20165         (Is.DoResolve): If the expression is always of the provided type,
20166         flag warning 183.  If the expression can not ever be of the
20167         provided type flag warning 184.
20168
20169         * class.cs: Catch 169 as well.
20170
20171         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
20172         read. 
20173
20174 2002-01-18  Nick Drochak  <ndrochak@gol.com>
20175
20176         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
20177
20178 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
20179
20180         * interface.cs: (PopulateMethod): Check for pointers being defined
20181         only if the unsafe context is active.
20182         (PopulateProperty): ditto.
20183         (PopulateIndexer): ditto.
20184
20185         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
20186         specified.  If pointers are present, make sure that they are
20187         present in an unsafe context.
20188         (Constructor, Constructor.Define): ditto.
20189         (Field, Field.Define): ditto.
20190         (Property, Property.Define): ditto.
20191         (Event, Event.Define): ditto.
20192
20193         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
20194         hashtable if there are classes or structs defined.
20195
20196         * expression.cs (LocalVariableReference.DoResolve): Simplify this
20197         code, as the constant resolution moved.
20198
20199         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
20200         the metadata, so we can flag error 133. 
20201
20202         * decl.cs (MemberCore.UnsafeOK): New function to test that a
20203         pointer is being declared in an unsafe context.
20204
20205 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
20206
20207         * modifiers.cs (Modifiers.Check): Require a Location argument.
20208         Report error 227 for Unsafe use.
20209
20210         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
20211
20212         * statement.cs (For.Emit): If the test is null, then report that
20213         we do `return', as we wont reach anything afterwards.
20214
20215         (Switch.SwitchGoverningType): Track the expression that matched
20216         the conversion.
20217
20218         * driver.cs: Allow negative numbers as an error code to flag.
20219
20220         * cs-parser.jay: Handle 1551.
20221
20222         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
20223
20224 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20225
20226         * cs-parser.jay: Report 1518 (type declaration can only contain
20227         class, struct, interface, enum or delegate)
20228
20229         (switch_label): Report 1523 (keywords `case' or `default' must
20230         preced code)
20231
20232         (opt_switch_sections): Report 1522 (empty switch)
20233
20234         * driver.cs: Report 1515 (response file specified multiple times)
20235         Report 1516 (Source file specified multiple times).
20236
20237         * expression.cs (Argument.Resolve): Signal 1510
20238
20239         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
20240         access not allowed in static code)
20241
20242 2002-01-11  Ravi Pratap  <ravi@ximian.com>
20243
20244         * typemanager.cs (IsPointerType): Utility method which we are going
20245         to need a lot.
20246
20247         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
20248         the object type, so we take care of that.
20249
20250         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
20251
20252         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
20253         added to non-params parameters :-)
20254
20255         * typemanager.cs (CSharpName): Include 'void' type too. 
20256
20257         (void_ptr_type): Include in the set of core types.
20258
20259         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
20260         duplicating code.
20261
20262         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
20263         an unsafe context.
20264
20265         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
20266         completely forgotten about it.
20267
20268 2002-01-10  Ravi Pratap  <ravi@ximian.com>
20269
20270         * cs-parser.jay (pointer_type): Add. This begins our implementation
20271         of parsing rules for unsafe code.
20272
20273         (unsafe_statement): Implement.
20274
20275         (embedded_statement): Modify to include the above.
20276
20277         * statement.cs (Unsafe): Implement new class for unsafe blocks.
20278
20279         * codegen.cs (EmitContext.InUnsafe): Add. This determines
20280         if the current context is an unsafe one.
20281
20282         * cs-parser.jay (local_variable_pointer_type): Since local variable types
20283         are handled differently, we need separate rules for them.
20284
20285         (local_variable_declaration): Update to use local_variable_pointer_type
20286         to allow variable declarations of unmanaged pointer types.
20287
20288         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
20289         in unsafe contexts.
20290
20291         * ../errors/cs0214.cs : Add.
20292
20293 2002-01-16  Nick Drochak  <ndrochak@gol.com>
20294
20295         * makefile: remove 'response' file when cleaning.
20296
20297 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20298
20299         * cs-parser.jay: Report 1524.
20300
20301 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
20302
20303         * typemanager.cs (RegisterMethod): drop checking if we have
20304         registered this from here
20305
20306 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
20307
20308         * class.cs (Method.EmitDestructor): Implement calling our base
20309         destructor. 
20310
20311         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20312         value of InFinally.
20313
20314         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20315         this routine and will wrap the call in a try/catch block.  Deal
20316         with the case.
20317
20318 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
20319
20320         * ecore.cs (Expression.MemberLookup): instead of taking a
20321         parameter `same_type' that was used to tell whether we could
20322         access private members we compute our containing type from the
20323         EmitContext.
20324
20325         (FieldExpr): Added partial support for volatile fields.  This does
20326         not work for volatile fields exposed from assemblies, as I can not
20327         figure out how to extract the modreq from it.
20328
20329         Updated all the source files to use this.
20330
20331         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20332         because it is referenced by MemberLookup very often. 
20333
20334 2002-01-09  Ravi Pratap  <ravi@ximian.com>
20335
20336         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20337         TypeBuilder.GetCustomAttributes to retrieve what we need.
20338
20339         Get rid of redundant default_member_attr_type as this is the same as
20340         default_member_type which already exists.
20341
20342         * interface.cs, attribute.cs : Update accordingly.
20343
20344 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
20345
20346         * typemanager.cs: Enable IndexerPropertyName again.  It does not
20347         work for TYpeBuilders though.  Ravi, can you please fix this?
20348
20349         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20350
20351         * expression.cs (Argument.Emit): Handle the case of ref objects
20352         being passed to ref functions;  
20353
20354         (ParameterReference.EmitLoad): Loads the content of the pointer
20355         without dereferencing.
20356
20357 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20358
20359         * cs-tokenizer.cs: Implemented the pre-processing expressions.
20360
20361 2002-01-08  Ravi Pratap  <ravi@ximian.com>
20362
20363         * class.cs (Indexer.DefineMethod): Incorporate the interface
20364         type in the name of the method if we are doing explicit interface
20365         implementation.
20366
20367         * expression.cs (ConversionExists): Remove as it is completely obsolete.
20368
20369         (BetterConversion): Fix extremely trivial bug where we were referring to
20370         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
20371         again !
20372
20373         * ../errors/bug16.cs : Add although we have fixed it.
20374
20375 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20376
20377         * expression.cs (BaseIndexer): Begin implementation.
20378
20379         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
20380
20381         * cs-parser.jay (indexer_declarator): Use qualified_identifier
20382         production directly to remove a shift/reduce, and implement
20383         explicit interface implementation.
20384
20385         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
20386         after a floating point suffix.
20387
20388         * expression.cs (DoNumericPromotions): Improved the conversion for
20389         uint/uint.  If we have a constant, we avoid doing a typecast to a
20390         larger type.
20391
20392         * class.cs (Indexer): Implement explicit interface implementation
20393         for indexers.
20394
20395 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20396
20397         * class.cs: make the default instance constructor public and hidebysig.
20398
20399 2001-01-03  Ravi Pratap  <ravi@ximian.com>
20400
20401         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20402         so we can call it from elsewhere.
20403
20404         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20405         we emit it internally if the class has a defined indexer; otherwise the user
20406         emits it by decorating the class definition with the DefaultMemberAttribute.
20407
20408         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20409         attribute is not used on a type which defines an indexer.
20410
20411         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20412         character when we skip whitespace.
20413
20414         * ../errors/cs0646.cs : Add.
20415
20416 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
20417
20418         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20419         again. 
20420
20421         * makefile: Add practical target `mcs3.exe' which builds the third
20422         generation compiler. 
20423
20424         * expression.cs (New): Fix structures constructor calling.
20425
20426         * class.cs (Property, Method, Indexer): Emit Final flag on the
20427         method if we are an interface implementation and we are not
20428         abstract. 
20429
20430         * ecore.cs (PropertyExpr): New public field `IsBase', tells
20431         whether this property is referencing a `base' method.
20432
20433         * expression.cs (Invocation.EmitCall): take an extra argument:
20434         is_base, this is used to determine whether the `call' or
20435         `callvirt' opcode should be used.
20436
20437
20438         * delegate.cs: update EmitCall.
20439
20440         * class.cs (Method.Define): Set NewSlot for the cases where we are
20441         not implementing an interface method.
20442
20443         (Property.Define): ditto.
20444
20445 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
20446
20447         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20448         'r'.  Allows mcs to parse itself fully.
20449
20450 2002-01-02  Ravi Pratap  <ravi@ximian.com>
20451
20452         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20453         of the number of initializers that require the InitializeArray method.
20454
20455         (CheckIndices): Store the Expression in all cases - not the plain value. Also
20456         update the above field where necessary.
20457
20458         (MakeByteBlob): Update accordingly.
20459
20460         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
20461         greater than 2.
20462
20463         (EmitDynamicInitializers): Update in accordance with the new optimization.
20464
20465         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20466         same OpCode applies.
20467
20468         * cs-parser.jay : Fix some glaring errors I introduced.
20469
20470 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
20471
20472         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20473         so that we can check for name clashes there too.
20474
20475         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20476         for interface indexers.
20477
20478         * interfaces.cs (Define): Emit the default member attribute.
20479
20480         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20481         variable was being referred to while setting the value ;-)
20482
20483 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
20484
20485         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20486         byte-by-byte information when we know the data is zero.
20487
20488         Make the block always a multiple of 4, because
20489         DefineInitializedData has a bug.
20490
20491         * assign.cs: Fix, we should assign from the temporary, not from
20492         the source. 
20493
20494         * expression.cs (MakeByteBlob): Fix my incorrect code.
20495
20496 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
20497
20498         * typemanager.cs (EnumToUnderlying): This function is used to get
20499         the underlying type from an enumeration, because it does not
20500         always work. 
20501
20502         * constant.cs: Use the I4_S form for values between -128 and 127.
20503
20504         * statement.cs (Block.LookupLabel): Looks up a label.
20505         (Block): Drop support for labeled blocks.
20506
20507         (LabeledStatement): New kind of statement that represents a label
20508         only.
20509
20510         (Goto): Finally implement this bad boy.
20511
20512         * cs-parser.jay: Update to reflect new mechanism to implement
20513         labels.
20514
20515 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
20516
20517         * codegen.cs (EmitContext.This): a codegen property that keeps the
20518         a single instance of this instead of creating many different this
20519         instances. 
20520
20521         * delegate.cs (Delegate.DoResolve): Update to use the property;
20522
20523         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
20524
20525         * expression.cs (BaseAccess.DoResolve): Ditto.
20526
20527 2001-12-29  Ravi Pratap  <ravi@ximian.com>
20528
20529         * typemanager.cs (methodimpl_attr_type): Add to hold the type
20530         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20531
20532         (InitCoreTypes): Update accordingly.
20533
20534         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20535         so we can quickly store the state.
20536
20537         (ApplyAttributes): Set the correct implementation flags
20538         for InternalCall methods.
20539
20540 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
20541
20542         * expression.cs (EmitCall): if a method is not virtual, then do
20543         not use callvirt on it.
20544
20545         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20546         user defined stuff) requires the use of stobj, which takes an
20547         address on the stack instead of an array and an index.  So emit
20548         the Ldelema operation for it.
20549
20550         (EmitStoreOpcode): Use stobj for valuetypes.
20551
20552         (UnaryMutator.EmitCode): Use the right 1 value depending on
20553         whether we are dealing with int64/uint64, float or doubles.
20554
20555         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20556         constructors that I implemented last night.
20557
20558         (Constructor.IsDefault): Fix to work properly for static
20559         constructors.
20560
20561         * cs-parser.jay (CheckDef): report method signature errors.
20562         Update error number 103 to be 132.
20563
20564         * decl.cs: New AdditionResult enumeration value: MethodExists.
20565         Although we do this check for methods later on in the semantic
20566         analysis, catching repeated default constructors is so easy that
20567         we catch these here. 
20568
20569         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20570         promotions code.
20571
20572         (ParameterReference.EmitAssign, Emit): handle
20573         bools as bytes.
20574
20575         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20576         (ArrayAccess.EmitStoreOpcode): ditto.
20577
20578         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20579
20580         * expression.cs (MakeByteBlob): Complete all the missing types
20581         (uint, short, ushort, byte, sbyte)
20582
20583         * class.cs: Only init instance field initializers on instance
20584         constructors. 
20585
20586         Rename `constructors' to instance_constructors. 
20587
20588         (TypeContainer.AddConstructor): Only add constructors to the list
20589         if it is not static.
20590
20591         Make sure that we handle default_static_constructor independently
20592         everywhere where we handle instance_constructors
20593
20594 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
20595
20596         * class.cs: Do not lookup or create a base initializer for a
20597         static constructor.
20598
20599         (ConstructorInitializer.Resolve): use the proper type to lookup
20600         for constructors.
20601
20602         * cs-parser.jay: Report error 1585 (modifiers between type and name).
20603
20604         * enum.cs, interface.cs: Remove CloseType, this is taken care by
20605         in DeclSpace. 
20606
20607         * decl.cs: CloseType is now an virtual method, the default
20608         implementation just closes this type.
20609
20610 2001-12-28  Ravi Pratap  <ravi@ximian.com>
20611
20612         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
20613         to PreserveSig by default. Also emit HideBySig on such methods.
20614
20615         Basically, set the defaults to standard values.
20616
20617         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
20618         argument, if candidate is better, it can't be worse than the best !
20619
20620         (Invocation): Re-write bits to differentiate between methods being
20621         applicable in their expanded form and their normal form - for params
20622         methods of course.
20623
20624         Get rid of use_standard everywhere as only standard conversions are allowed
20625         in overload resolution. 
20626
20627         More spec conformance.
20628
20629 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20630
20631         * driver.cs: Add --timestamp, to see where the compiler spends
20632         most of its time.
20633
20634         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
20635         `this' in static code.
20636
20637         (SimpleName.DoResolve): Implement in terms of a helper function
20638         that allows static-references to be passed upstream to
20639         MemberAccess.
20640
20641         (Expression.ResolveWithSimpleName): Resolve specially simple
20642         names when called by MemberAccess to implement the special
20643         semantics. 
20644
20645         (Expression.ImplicitReferenceConversion): Handle conversions from
20646         Null to reference types before others, as Null's type is
20647         System.Object. 
20648
20649         * expression.cs (Invocation.EmitCall): Handle the special case of
20650         calling methods declared on a reference type from a ValueType
20651         (Base classes System.Object and System.Enum)
20652
20653         (MemberAccess.Resolve): Only perform lookups on Enumerations if
20654         the left hand side is a TypeExpr, not on every enumeration. 
20655
20656         (Binary.Resolve): If types are reference types, then do a cast to
20657         object on operators != and == of both arguments.
20658
20659         * typemanager.cs (FindMembers): Extract instance and static
20660         members if requested.
20661
20662         * interface.cs (PopulateProperty): Use void_type instead of null
20663         as the return type for the setter method.
20664
20665         (PopulateIndexer): ditto.
20666
20667 2001-12-27  Ravi Pratap  <ravi@ximian.com>
20668
20669         * support.cs (ReflectionParameters): Fix minor bug where we
20670         were examining the wrong parameter for the ParamArray attribute.
20671
20672         Cope with requests for the type of the parameter at position
20673         greater than the params parameter's. We now return the element
20674         type of the params array as that makes more sense.
20675
20676         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
20677         accordingly as we no longer have to extract the element type
20678         ourselves.
20679
20680         (Invocation.OverloadResolve): Update.
20681
20682 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20683
20684         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
20685         against IEnumerator, test whether the return value is a descendant
20686         of the IEnumerator interface.
20687
20688         * class.cs (Indexer.Define): Use an auxiliary method to implement
20689         the other bits of the method definition.  Begin support for
20690         explicit interface implementation.
20691
20692         (Property.DefineMethod): Use TypeManager.void_type instead of null
20693         for an empty return value.
20694
20695 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
20696
20697         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
20698         dealing with a FieldExpr which is composed of a FieldBuilder, in
20699         the code path we did extract the constant, but we should have
20700         obtained the underlying value to be able to cast it (otherwise we
20701         end up in an infinite loop, this is what Ravi was running into).
20702
20703         (ArrayCreation.UpdateIndices): Arrays might be empty.
20704
20705         (MemberAccess.ResolveMemberAccess): Add support for section
20706         14.5.4.1 that deals with the special case of E.I when E is a type
20707         and something else, that I can be a reference to a static member.
20708
20709         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
20710         handle a particular array type to create byte blobs, it is just
20711         something we dont generate byteblobs for.
20712
20713         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
20714         arguments. 
20715
20716         * location.cs (Push): remove the key from the hashtable that we
20717         are about to add.   This happens for empty files.
20718
20719         * driver.cs: Dispose files after we have parsed them.
20720
20721         (tokenize): new function that only runs the tokenizer on its
20722         input, for speed testing.
20723
20724 2001-12-26  Ravi Pratap  <ravi@ximian.com>
20725
20726         * class.cs (Event.Define): Define the private field only if there
20727         are no accessors defined.
20728
20729         * expression.cs (ResolveMemberAccess): If there is no associated
20730         field with the event, that means we have an event defined with its
20731         own accessors and we should flag error cs0070 since transforming
20732         ourselves into a field is not valid in that case.
20733
20734         * ecore.cs (SimpleName.DoResolve): Same as above.
20735
20736         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
20737         and charset to sane values.
20738
20739 2001-12-25  Ravi Pratap  <ravi@ximian.com>
20740
20741         * assign.cs (DoResolve): Perform check on events only if they 
20742         are being accessed outside the declaring type.
20743
20744         * cs-parser.jay (event_declarations): Update rules to correctly
20745         set the type of the implicit parameter etc.
20746
20747         (add_accessor, remove_accessor): Set current local parameters.
20748
20749         * expression.cs (Binary): For delegate addition and subtraction,
20750         cast the return value from the method into the appropriate delegate
20751         type.
20752
20753 2001-12-24  Ravi Pratap  <ravi@ximian.com>
20754
20755         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
20756         of these as the workaround is unnecessary.
20757
20758         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
20759         delegate data - none of that is needed at all.
20760
20761         Re-write bits to extract the instance expression and the delegate method
20762         correctly.
20763
20764         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
20765         on delegates too.
20766
20767         * attribute.cs (ApplyAttributes): New method to take care of common tasks
20768         of attaching attributes instead of duplicating code everywhere.
20769
20770         * everywhere : Update code to do attribute emission using the above method.
20771
20772 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
20773
20774         * expression.cs (IsParamsMethodApplicable): if there are not
20775         parameters, return immediately.
20776
20777         * ecore.cs: The 0 literal can be implicity converted to an enum
20778         type. 
20779
20780         (SimpleName.DoResolve): First lookup the type, then lookup the
20781         members. 
20782
20783         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
20784         want to get its address.  If the InstanceExpression is not
20785         addressable, store the result in a temporary variable, then get
20786         the address of it.
20787
20788         * codegen.cs: Only display 219 errors on warning level or above. 
20789
20790         * expression.cs (ArrayAccess): Make it implement the
20791         IMemoryLocation interface.
20792
20793         (Binary.DoResolve): handle the operator == (object a, object b)
20794         and operator != (object a, object b) without incurring into a
20795         BoxedCast (because 5 != o should never be performed).
20796
20797         Handle binary enumerator operators.
20798
20799         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
20800         value type, otherwise use Ldelem_ref.
20801
20802         Use precomputed names;
20803
20804         (AddressOf): Implement address of
20805
20806         * cs-parser.jay (labeled_statement): Fix recursive block
20807         addition by reworking the production.
20808
20809         * expression.cs (New.DoEmit): New has a special case:
20810                 
20811                  If we are dealing with a ValueType, we have a few
20812                  situations to deal with:
20813                 
20814                     * The target of New is a ValueType variable, that is
20815                       easy, we just pass this as the variable reference
20816                 
20817                     * The target of New is being passed as an argument,
20818                       to a boxing operation or a function that takes a
20819                       ValueType.
20820                 
20821                       In this case, we need to create a temporary variable
20822                       that is the argument of New.
20823
20824
20825 2001-12-23  Ravi Pratap  <ravi@ximian.com>
20826
20827         * rootcontext.cs (LookupType): Check that current_type is not null before
20828         going about looking at nested types.
20829
20830         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
20831         not implement the IAssignMethod interface any more.
20832
20833         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
20834         where we tranform them into FieldExprs if they are being resolved from within
20835         the declaring type.
20836
20837         * ecore.cs (SimpleName.DoResolve): Do the same here.
20838
20839         * assign.cs (DoResolve, Emit): Clean up code considerably. 
20840
20841         * ../errors/bug10.cs : Add.
20842
20843         * ../errors/cs0070.cs : Add.
20844
20845         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
20846
20847         * assign.cs : Get rid of EventIsLocal everywhere.
20848
20849 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
20850
20851         * ecore.cs (ConvertIntLiteral): finished the implementation.
20852
20853         * statement.cs (SwitchLabel): Convert the value we are using as a
20854         key before looking up the table.
20855
20856 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
20857
20858         * codegen.cs (EmitTopBlock): Require a Location argument now.
20859
20860         * cs-parser.jay (constructor_declarator): We need to setup
20861         current_local_parameters before we parse the
20862         opt_constructor_initializer, to allow the variables to be bound
20863         to the constructor arguments.
20864
20865         * rootcontext.cs (LookupType): First lookup nested classes in our
20866         class and our parents before we go looking outside our class.
20867
20868         * expression.cs (ConstantFold): Extract/debox the values at the
20869         beginnning. 
20870
20871         * rootcontext.cs (EmitCode): Resolve the constants first before we
20872         resolve the types.  This is not really needed, but it helps debugging.
20873
20874         * statement.cs: report location.
20875
20876         * cs-parser.jay: pass location to throw statement.
20877
20878         * driver.cs: Small bug fix.
20879
20880         * report.cs: Updated format to be 4-zero filled digits.
20881
20882 2001-12-22  Ravi Pratap  <ravi@ximian.com>
20883
20884         * expression.cs (CheckIndices): Fix minor bug where the wrong
20885         variable was being referred to ;-)
20886
20887         (DoEmit): Do not call EmitStaticInitializers when the 
20888         underlying type is System.Object.
20889
20890 2001-12-21  Ravi Pratap  <ravi@ximian.com>
20891
20892         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
20893         and do the usual workaround for SRE.
20894
20895         * class.cs (MyEventBuilder.EventType): New member to get at the type
20896         of the event, quickly.
20897
20898         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
20899
20900         * assign.cs (Assign.DoResolve): Handle the case when the target
20901         is an EventExpr and perform the necessary checks.
20902
20903         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
20904         interface.
20905
20906         (SimpleName.MemberStaticCheck): Include check for EventExpr.
20907
20908         (EventExpr): Set the type in the constructor itself since we 
20909         are meant to be born fully resolved.
20910
20911         (EventExpr.Define): Revert code I wrote earlier.
20912                 
20913         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
20914         instance expression is null. The instance expression is a This in that case
20915         or a null, depending on whether it is a static method or not.
20916
20917         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
20918         refers to more than one method.
20919
20920         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
20921         and accordingly flag errors.
20922
20923 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
20924
20925         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
20926
20927 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
20928
20929         * location.cs (ToString): Provide useful rutine.
20930
20931 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
20932
20933         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
20934         objects, return the actual integral boxed.
20935
20936         * statement.cs (SwitchLabel): define an ILLabel for each
20937         SwitchLabel. 
20938
20939         (Switch.CheckSwitch): If the value is a Literal, extract
20940         the underlying literal.
20941
20942         Also in the unused hashtable we had, add the SwitchLabel so we can
20943         quickly look this value up.
20944
20945         * constant.cs: Implement a bunch of new constants.  Rewrite
20946         Literal based on this.  Made changes everywhere to adapt to this.
20947
20948         * expression.cs (Expression.MakeByteBlob): Optimize routine by
20949         dereferencing array only once, and also copes with enumrations.
20950
20951         bytes are two bytes wide, not one.
20952
20953         (Cast): Perform constant conversions.
20954
20955         * ecore.cs (TryImplicitIntConversion): Return literals instead of
20956         wrappers to the literals here.
20957
20958         * expression.cs (DoNumericPromotions): long literals can converted
20959         to ulong implicity (this is taken care of elsewhere, but I was
20960         missing this spot).
20961
20962         * ecore.cs (Expression.Literalize): Make the return type Literal,
20963         to improve type checking.
20964
20965         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
20966
20967 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
20968
20969         * literal.cs: Revert code from ravi that checked the bounds.  The
20970         bounds are sane by the definition of the type itself. 
20971
20972         * typemanager.cs: Fix implementation of ImplementsInterface.  We
20973         need to actually look up in our parent hierarchy for interfaces
20974         implemented. 
20975
20976         * const.cs: Use the underlying type for enumerations
20977
20978         * delegate.cs: Compute the basename for the delegate creation,
20979         that should fix the delegate test case, and restore the correct
20980         Type Lookup semantics in rootcontext
20981
20982         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
20983         referencing a nested type with the Reflection API is using the "+"
20984         sign. 
20985
20986         * cs-parser.jay: Do not require EOF token at the end.
20987
20988 2001-12-20  Ravi Pratap  <ravi@ximian.com>
20989
20990         * rootcontext.cs (LookupType): Concatenate type names with
20991         a '.' instead of a '+' The test suite passes again.
20992
20993         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
20994         field of the enumeration.
20995
20996         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
20997         the case when the member is an EventExpr.
20998
20999         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
21000         static has an associated instance expression.
21001
21002         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
21003
21004         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
21005
21006         * class.cs (Event.Define): Register event and perform appropriate checks
21007         for error #111.
21008
21009         We define the Add and Remove methods even if the use provides none because
21010         in that case, we provide default implementations ourselves.
21011
21012         Define a private field of the type of the event. This is done by the CSC compiler
21013         and we should be doing it too ;-)
21014
21015         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
21016         More methods we use in code we generate.
21017
21018         (multicast_delegate_type, delegate_type): Two separate types since the distinction
21019         is important.
21020
21021         (InitCoreTypes): Update accordingly for the above.
21022
21023         * class.cs (Event.Emit): Generate code for default accessors that we provide
21024
21025         (EmitDefaultMethod): Do the job in the above.
21026
21027         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
21028         appropriate place.
21029
21030 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21031
21032         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
21033         builders even if we were missing one.
21034
21035         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
21036         pass the Basename as our class name instead of the Name.  The
21037         basename will be correctly composed for us.
21038
21039         * parameter.cs (Paramters): Now takes a Location argument.
21040
21041         * decl.cs (DeclSpace.LookupType): Removed convenience function and
21042         make all the code call directly LookupType in RootContext and take
21043         this chance to pass the Location information everywhere.
21044
21045         * Everywhere: pass Location information.
21046
21047 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
21048
21049         * class.cs (Constructor.Define): Updated way of detecting the
21050         length of the parameters.
21051
21052         (TypeContainer.DefineType): Use basename as the type name for
21053         nested types.
21054
21055         (TypeContainer.Define): Do not recursively define types here, as
21056         definition is taken care in order by the RootContext.
21057
21058         * tree.cs: Keep track of namespaces in a per-file basis.
21059
21060         * parameter.cs (Parameter.ComputeSignature): Update to use
21061         DeclSpace. 
21062
21063         (Parameters.GetSignature): ditto.
21064
21065         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
21066         instead of a TypeContainer.
21067
21068         (Interface.SemanticAnalysis): Use `this' instead of our parent to
21069         resolve names.  Because we need to be resolve in our context, not
21070         our parents.
21071
21072         * driver.cs: Implement response files.
21073
21074         * class.cs (TypeContainer.DefineType): If we are defined, do not
21075         redefine ourselves.
21076
21077         (Event.Emit): Emit the code for add/remove handlers.
21078         (Event.Define): Save the MethodBuilders for add/remove.
21079
21080         * typemanager.cs: Use pair here too.
21081
21082         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
21083         DictionaryEntry requires the first argument to be non-null.  
21084
21085         (enum_declaration): Compute full name for registering the
21086         enumeration.
21087
21088         (delegate_declaration): Instead of using
21089         formal_parameter_list, use opt_formal_parameter_list as the list
21090         can be empty.
21091
21092         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
21093         (EventParsing): New property that controls whether `add' and
21094         `remove' are returned as tokens or identifiers (for events);
21095
21096 2001-12-19  Ravi Pratap  <ravi@ximian.com>
21097
21098         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
21099         use MyEventBuilder only and let it wrap the real builder for us.
21100
21101         (MyEventBuilder): Revamp constructor etc.
21102
21103         Implement all operations that we perform on EventBuilder in precisely the same
21104         way here too.
21105
21106         (FindMembers): Update to use the EventBuilder member.
21107
21108         (Event.Emit): Update accordingly.
21109
21110 2001-12-18  Ravi Pratap  <ravi@ximian.com>
21111
21112         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
21113         by calling the appropriate methods.
21114
21115         (GetCustomAttributes): Make stubs as they cannot possibly do anything
21116         useful.
21117
21118         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
21119
21120 2001-12-17  Ravi Pratap  <ravi@ximian.com>
21121
21122         * delegate.cs (Delegate.Populate): Check that the return type
21123         and various parameters types are indeed accessible.
21124
21125         * class.cs (Constructor.Define): Same here.
21126
21127         (Field.Define): Ditto.
21128
21129         (Event.Define): Ditto.
21130
21131         (Operator.Define): Check that the underlying Method defined itself
21132         correctly - so it's MethodBuilder should not be null.
21133
21134         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
21135         expression happens to be null.
21136
21137         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
21138         members but as of now we don't seem to be able to do anything really useful with it.
21139
21140         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
21141         not the EventBuilder.
21142
21143 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
21144
21145         * cs-tokenizer.cs: Add support for defines.
21146         Add support for #if, #elif, #else, #endif
21147
21148         (eval_var): evaluates a variable.
21149         (eval): stubbed for evaluating functions.
21150
21151         * cs-parser.jay: Pass the defines information
21152
21153         * driver.cs: Add --define command line option.
21154
21155         * decl.cs: Move MemberCore here.
21156
21157         Make it the base class for DeclSpace.  This allows us to catch and
21158         report 108 and 109 for everything now.
21159
21160         * class.cs (TypeContainer.Define): Extract all the members
21161         before populating and emit the warning 108 (new keyword required
21162         to override) instead of having each member implement this.
21163
21164         (MemberCore.Define): New abstract method, we will be using this in
21165         the warning reporting engine in Populate.
21166
21167         (Operator.Define): Adjust to new MemberCore protocol. 
21168
21169         * const.cs (Const): This does not derive from Expression, it is a
21170         temporary object we use to create fields, it is a MemberCore. 
21171
21172         * class.cs (Method.Define): Allow the entry point to be in a
21173         specific class.
21174
21175         * driver.cs: Rewrite the argument handler to clean it up a bit.
21176
21177         * rootcontext.cs: Made it just an auxiliary namespace feature by
21178         making everything static.
21179
21180         * driver.cs: Adapt code to use RootContext type name instead of
21181         instance variable.
21182
21183         * delegate.cs: Remove RootContext argument.
21184
21185         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
21186         argument. 
21187
21188         * class.cs (Event.Define): The lookup can fail.
21189
21190         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
21191
21192         * expression.cs: Resolve the this instance before invoking the code.
21193
21194 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
21195
21196         * cs-parser.jay: Add a production in element_access that allows
21197         the thing to become a "type" reference.  This way we can parse
21198         things like "(string [])" as a type.
21199
21200         Note that this still does not handle the more complex rules of
21201         casts. 
21202
21203
21204         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
21205
21206         * ecore.cs: (CopyNewMethods): new utility function used to
21207         assemble the list of methods from running FindMembers.
21208
21209         (MemberLookup): Rework FindMembers so that 
21210
21211 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
21212
21213         * class.cs (TypeContainer): Remove Delegates who fail to be
21214         defined.
21215
21216         * delegate.cs (Populate): Verify that we dont get null return
21217         values.   TODO: Check for AsAccessible.
21218
21219         * cs-parser.jay: Use basename to emit error 574 (destructor should
21220         have the same name as container class), not the full name.
21221
21222         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
21223         possible representation.  
21224
21225         Also implements integer type suffixes U and L.
21226
21227 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
21228
21229         * expression.cs (ArrayCreation.DoResolve): We need to do the
21230         argument resolution *always*.
21231
21232         * decl.cs: Make this hold the namespace.  Hold the root context as
21233         well.
21234         (LookupType): Move here.
21235
21236         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
21237
21238         * location.cs (Row, Name): Fixed the code, it was always returning
21239         references to the first file.
21240
21241         * interface.cs: Register properties defined through interfaces.
21242
21243         * driver.cs: Add support for globbing on the command line
21244
21245         * class.cs (Field): Make it derive from MemberCore as well.
21246         (Event): ditto.
21247
21248 2001-12-15  Ravi Pratap  <ravi@ximian.com>
21249
21250         * class.cs (Event::Define): Check that the type of the event is a delegate
21251         type else flag error #66.
21252
21253         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
21254         same.
21255
21256         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
21257         values of EntryPoint, CharSet etc etc.
21258
21259         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
21260
21261         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
21262         be null and we should ignore this. I am not sure if this is really clean. Apparently,
21263         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
21264         which needs this to do its work.
21265
21266         * ../errors/cs0066.cs : Add.
21267
21268 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
21269
21270         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
21271         helper functions.
21272
21273         * class.cs: (MethodSignature.MethodSignature): Removed hack that
21274         clears out the parameters field.
21275         (MemberSignatureCompare): Cleanup
21276
21277         (MemberCore): New base class used to share code between MethodCore
21278         and Property.
21279
21280         (RegisterRequiredImplementations) BindingFlags.Public requires
21281         either BindingFlags.Instace or Static.  Use instance here.
21282
21283         (Property): Refactored code to cope better with the full spec.
21284
21285         * parameter.cs (GetParameterInfo): Return an empty array instead
21286         of null on error.
21287
21288         * class.cs (Property): Abstract or extern properties have no bodies.
21289
21290         * parameter.cs (GetParameterInfo): return a zero-sized array.
21291
21292         * class.cs (TypeContainer.MethodModifiersValid): Move all the
21293         method modifier validation to the typecontainer so we can reuse
21294         this on properties.
21295
21296         (MethodCore.ParameterTypes): return an empty sized array of types.
21297
21298         (Property.Define): Test property modifier validity.
21299
21300         Add tests for sealed/override too.
21301
21302         (Method.Emit): abstract or extern methods have no bodies.
21303
21304 2001-12-14  Ravi Pratap  <ravi@ximian.com>
21305
21306         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21307         thing.
21308
21309         (Method::Define, ::Emit): Modify accordingly.
21310
21311         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21312
21313         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21314
21315         * makefile: Pass in /unsafe.
21316
21317 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
21318
21319         * class.cs (MakeKey): Kill routine.
21320
21321         * class.cs (TypeContainer.Define): Correctly define explicit
21322         method implementations (they require the full interface name plus
21323         the method name).
21324
21325         * typemanager.cs: Deply the PtrHashtable here and stop using the
21326         lame keys.  Things work so much better.
21327
21328         This of course broke everyone who depended on `RegisterMethod' to
21329         do the `test for existance' test.  This has to be done elsewhere.
21330
21331         * support.cs (PtrHashtable): A hashtable that avoid comparing with
21332         the object stupid Equals method (because, that like fails all over
21333         the place).  We still do not use it.
21334
21335         * class.cs (TypeContainer.SetRequiredInterface,
21336         TypeContainer.RequireMethods): Killed these two routines and moved
21337         all the functionality to RegisterRequiredImplementations.
21338
21339         (TypeContainer.RegisterRequiredImplementations): This routine now
21340         registers all the implementations required in an array for the
21341         interfaces and abstract methods.  We use an array of structures
21342         which can be computed ahead of time to reduce memory usage and we
21343         also assume that lookups are cheap as most classes will not
21344         implement too many interfaces.
21345
21346         We also avoid creating too many MethodSignatures.
21347
21348         (TypeContainer.IsInterfaceMethod): Update and optionally does not
21349         clear the "pending" bit if we find that there are problems with
21350         the declaration.
21351
21352         (TypeContainer.VerifyPendingMethods): Update to report errors of
21353         methods that look like implementations but are not.
21354
21355         (TypeContainer.Define): Add support for explicit interface method
21356         implementation. 
21357
21358 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
21359
21360         * typemanager.cs: Keep track of the parameters here instead of
21361         being a feature of the TypeContainer.
21362
21363         * class.cs: Drop the registration of parameters here, as
21364         InterfaceMethods are also interface declarations.
21365
21366         * delegate.cs: Register methods with the TypeManager not only with
21367         the TypeContainer.  This code was buggy.
21368
21369         * interface.cs: Full registation here.
21370
21371 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
21372
21373         * expression.cs: Remove reducer for binary expressions, it can not
21374         be done this way.
21375
21376         * const.cs: Put here the code that used to go into constant.cs
21377
21378         * constant.cs: Put here the code for constants, this is a new base
21379         class for Literals.
21380
21381         * literal.cs: Make Literal derive from Constant.
21382
21383 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
21384
21385         * statement.cs (Return.Emit): Report error 157 if the user
21386         attempts to return from a finally block.
21387
21388         (Return.Emit): Instead of emitting a return, jump to the end of
21389         the function.
21390
21391         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21392         LocalBuilder to store the result of the function.  ReturnLabel is
21393         the target where we jump.
21394
21395
21396 2001-12-09  Radek Doulik  <rodo@ximian.com>
21397
21398         * cs-parser.jay: remember alias in current namespace
21399
21400         * ecore.cs (SimpleName::DoResolve): use aliases for types or
21401         namespaces
21402
21403         * class.cs (LookupAlias): lookup alias in my_namespace
21404
21405         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21406         aliases hashtable
21407         (LookupAlias): lookup alias in this and if needed in parent
21408         namespaces
21409
21410 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
21411
21412         * support.cs: 
21413
21414         * rootcontext.cs: (ModuleBuilder) Made static, first step into
21415         making things static.  I need this to avoid passing the
21416         TypeContainer when calling ParameterType.
21417
21418         * support.cs (InternalParameters.ParameterType): Remove ugly hack
21419         that did string manipulation to compute the type and then call
21420         GetType.  Use Parameter.ParameterType instead.
21421
21422         * cs-tokenizer.cs: Consume the suffix for floating values.
21423
21424         * expression.cs (ParameterReference): figure out whether this is a
21425         reference parameter or not.  Kill an extra variable by computing
21426         the arg_idx during emission.
21427
21428         * parameter.cs (Parameters.GetParameterInfo): New overloaded
21429         function that returns whether a parameter is an out/ref value or not.
21430
21431         (Parameter.ParameterType): The type of the parameter (base,
21432         without ref/out applied).
21433
21434         (Parameter.Resolve): Perform resolution here.
21435         (Parameter.ExternalType): The full type (with ref/out applied).
21436
21437         * statement.cs (Using.Emit, Using.EmitExpression): Implement
21438         support for expressions on the using statement.
21439
21440 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
21441
21442         * statement.cs (Using.EmitLocalVariableDecls): Split the
21443         localvariable handling of the using statement.
21444
21445         (Block.EmitMeta): Keep track of variable count across blocks.  We
21446         were reusing slots on separate branches of blocks.
21447
21448         (Try.Emit): Emit the general code block, we were not emitting it. 
21449
21450         Check the type of the declaration to be an IDisposable or
21451         something that can be implicity converted to it. 
21452
21453         Emit conversions if required.
21454
21455         * ecore.cs (EmptyExpression): New utility class.
21456         (Expression.ImplicitConversionExists): New utility function.
21457
21458 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
21459
21460         * statement.cs (Using): Implement.
21461
21462         * expression.cs (LocalVariableReference): Support read only variables.
21463
21464         * statement.cs: Remove the explicit emit for the Leave opcode.
21465         (VariableInfo): Add a readonly field.
21466
21467 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
21468
21469         * ecore.cs (ConvCast): new class used to encapsulate the various
21470         explicit integer conversions that works in both checked and
21471         unchecked contexts.
21472
21473         (Expression.ConvertNumericExplicit): Use new ConvCast class to
21474         properly generate the overflow opcodes.
21475
21476 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21477
21478         * statement.cs: The correct type for the EmptyExpression is the
21479         element_type, not the variable type.  Ravi pointed this out.
21480
21481 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21482
21483         * class.cs (Method::Define): Handle PInvoke methods specially
21484         by using DefinePInvokeMethod instead of the usual one.
21485
21486         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21487         above to do the task of extracting information and defining the method.
21488
21489 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21490
21491         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21492         of the condition for string type.
21493
21494         (Emit): Move that here. 
21495
21496         (ArrayCreation::CheckIndices): Keep string literals in their expression
21497         form.
21498
21499         (EmitDynamicInitializers): Handle strings appropriately.
21500
21501 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21502
21503         * codegen.cs (EmitContext): Replace multiple variables with a
21504         single pointer to the current Switch statement.
21505
21506         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21507         EmitContext.
21508
21509 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21510
21511         * statement.cs 
21512
21513         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21514         default'.
21515
21516         (Foreach.Emit): Foreach on arrays was not setting
21517         up the loop variables (for break/continue).
21518
21519         (GotoCase): Semi-implented.
21520
21521 2001-12-03  Ravi Pratap  <ravi@ximian.com>
21522
21523         * attribute.cs (CheckAttribute): Handle system attributes by using
21524         Attribute.GetAttributes to examine information we need.
21525
21526         (GetValidPlaces): Same here.
21527
21528         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21529
21530         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21531
21532         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21533
21534         (Method::Define): Set appropriate flags if we have a DllImport attribute.
21535
21536         (Method::Emit): Handle the case when we are a PInvoke method.
21537
21538 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21539
21540         * expression.cs: Use ResolveWithSimpleName on compound names.
21541
21542 2001-12-02  Ravi Pratap  <ravi@ximian.com>
21543
21544         * constant.cs (EmitConstant): Make sure we resolve the associated expression
21545         before trying to reduce it.
21546
21547         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21548
21549         * constant.cs (LookupConstantValue): Implement.
21550
21551         (EmitConstant): Use the above in emitting the constant.
21552
21553         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21554         that are user-defined by doing a LookupConstantValue on them.
21555
21556         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21557         too, like above.
21558
21559 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
21560
21561         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21562
21563         (BaseAccess.DoResolve): Implement.
21564
21565         (MemberAccess.DoResolve): Split this routine into a
21566         ResolveMemberAccess routine that can be used independently
21567
21568 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
21569
21570         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21571         As that share bits of the implementation.  Is returns a boolean,
21572         while As returns the Type that is being probed.
21573
21574 2001-12-01  Ravi Pratap  <ravi@ximian.com>
21575
21576         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21577         instead of a Literal - much easier.
21578
21579         (EnumInTransit): Remove - utterly useless :-)
21580
21581         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21582
21583         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21584
21585         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21586         chain when we have no associated expression.
21587
21588 2001-11-30  Ravi Pratap  <ravi@ximian.com>
21589
21590         * constant.cs (Define): Use Location while reporting the errror.
21591
21592         Also emit a warning when 'new' is used and there is no inherited
21593         member to hide.
21594
21595         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
21596         populated.
21597
21598         (LookupEnumValue): Implement to lookup an enum member's value and define it
21599         if necessary.
21600
21601         (Populate): Re-write accordingly to use the above routine.
21602
21603 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
21604
21605         * expression.cs (This): Fix prototype for DoResolveLValue to
21606         override the base class DoResolveLValue.
21607
21608         * cs-parser.cs: Report errors cs574 and cs575 (destructor
21609         declarations) 
21610
21611         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
21612         (we need to load the address of the field here).  This fixes
21613         test-22. 
21614
21615         (FieldExpr.DoResolveLValue): Call the DoResolve
21616         function to initialize the Instance expression.
21617
21618         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
21619         correctly the GetEnumerator operation on a value type.
21620
21621         * cs-parser.jay: Add more simple parsing error catches.
21622
21623         * statement.cs (Switch): Add support for string switches.
21624         Handle null specially.
21625
21626         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
21627
21628 2001-11-28  Ravi Pratap  <ravi@ximian.com>
21629
21630         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
21631
21632         (declare_local_constant): New helper function.
21633
21634         * statement.cs (AddConstant): Keep a separate record of constants
21635
21636         (IsConstant): Implement to determine if a variable is a constant.
21637
21638         (GetConstantExpression): Implement.
21639
21640         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
21641
21642         * statement.cs (IsVariableDefined): Re-write.
21643
21644 2001-11-27  Ravi Pratap  <ravi@ximian.com>
21645
21646         * class.cs (TypeContainer::FindMembers): Look for constants
21647         in the case when we are looking for MemberTypes.Field
21648
21649         * expression.cs (MemberAccess::DoResolve): Check that in the
21650         case we are a FieldExpr and a Literal, we are not being accessed
21651         by an instance reference.
21652
21653         * cs-parser.jay (local_constant_declaration): Implement.
21654
21655         (declaration_statement): Implement for constant declarations.
21656
21657 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
21658
21659         * statement.cs (Switch): Catch double defaults.
21660
21661         (Switch): More work on the switch() statement
21662         implementation.  It works for integral values now, need to finish
21663         string support.
21664
21665
21666 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21667
21668         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
21669         integer literals into other integer literals.  To be used by
21670         switch. 
21671
21672 2001-11-24  Ravi Pratap  <ravi@ximian.com>
21673
21674         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
21675         some memory.
21676
21677         (EmitDynamicInitializers): Cope with the above since we extract data
21678         directly from ArrayData now.
21679
21680         (ExpectInitializers): Keep track of whether initializers are mandatory
21681         or not.
21682
21683         (Bounds): Make it a hashtable to prevent the same dimension being 
21684         recorded for every element in that dimension.
21685
21686         (EmitDynamicInitializers): Fix bug which prevented the Set array method
21687         from being found.
21688
21689         Also fix bug which was causing the indices to be emitted in the reverse
21690         order.
21691
21692 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21693
21694         * expression.cs (ArrayCreation): Implement the bits that Ravi left
21695         unfinished.  They do not work, because the underlying code is
21696         sloppy.
21697
21698 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21699
21700         * cs-parser.jay: Remove bogus fixme.
21701
21702         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
21703         on Switch statement.
21704
21705 2001-11-23  Ravi Pratap  <ravi@ximian.com>
21706
21707         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
21708         the same. 
21709
21710         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
21711         parameter. Apparently, any expression is allowed. 
21712
21713         (ValidateInitializers): Update accordingly.
21714
21715         (CheckIndices): Fix some tricky bugs thanks to recursion.
21716
21717         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
21718         I was being completely brain-dead.
21719
21720         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
21721         and re-write acordingly.
21722
21723         (DelegateInvocation): Re-write accordingly.
21724
21725         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
21726
21727         (MakeByteBlob): Handle types more correctly.
21728
21729         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
21730         initialization from expressions but it is incomplete because I am a complete
21731         Dodo :-|
21732
21733 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21734
21735         * statement.cs (If.Emit): Fix a bug that generated incorrect code
21736         on If.  Basically, we have to return `true' (ie, we do return to
21737         our caller) only if both branches of the if return.
21738
21739         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
21740         short-circuit operators, handle them as short circuit operators. 
21741
21742         (Cast.DoResolve): Resolve type.
21743         (Cast.Cast): Take an expression as the target type.
21744
21745         * cs-parser.jay (cast_expression): Remove old hack that only
21746         allowed a limited set of types to be handled.  Now we take a
21747         unary_expression and we resolve to a type during semantic
21748         analysis.
21749
21750         Use the grammar productions from Rhys to handle casts (this is
21751         not complete like Rhys syntax yet, we fail to handle that corner
21752         case that C# has regarding (-x), but we will get there.
21753
21754 2001-11-22  Ravi Pratap  <ravi@ximian.com>
21755
21756         * class.cs (EmitFieldInitializer): Take care of the case when we have a
21757         field which is an array type.
21758
21759         * cs-parser.jay (declare_local_variables): Support array initialization too.
21760
21761         * typemanager.cs (MakeKey): Implement.
21762
21763         (everywhere): Use the above appropriately.
21764
21765         * cs-parser.jay (for_statement): Update for array initialization while
21766         declaring variables.
21767
21768         * ecore.cs : The error message was correct, it's the variable's names that
21769         were misleading ;-) Make the code more readable.
21770
21771         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
21772         the correct type etc.
21773
21774         (ConvertExplicit): Handle Enum types by examining the underlying type.
21775
21776 2001-11-21  Ravi Pratap  <ravi@ximian.com>
21777
21778         * parameter.cs (GetCallingConvention): Always return
21779         CallingConventions.Standard for now.
21780
21781 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21782
21783         * expression.cs (Binary.ResolveOperator): Update the values of `l'
21784         and `r' after calling DoNumericPromotions.
21785
21786         * ecore.cs: Fix error message (the types were in the wrong order).
21787
21788         * statement.cs (Foreach.ProbeCollectionType): Need to pass
21789         BindingFlags.Instance as well 
21790
21791         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
21792         implicit int literal conversion in an empty cast so that we
21793         propagate the right type upstream.
21794
21795         (UnboxCast): new class used to unbox value types.
21796         (Expression.ConvertExplicit): Add explicit type conversions done
21797         by unboxing.
21798
21799         (Expression.ImplicitNumericConversion): Oops, forgot to test for
21800         the target type before applying the implicit LongLiterals to ULong
21801         literal cast.
21802
21803 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
21804
21805         * cs-parser.jay (for_statement): Reworked the way For works: now
21806         we declare manually any variables that are introduced in
21807         for_initializer to solve the problem of having out-of-band code
21808         emition (that is what got for broken).
21809
21810         (declaration_statement): Perform the actual variable declaration
21811         that used to be done in local_variable_declaration here.
21812
21813         (local_variable_declaration): Do not declare anything, just pass
21814         the information on a DictionaryEntry
21815
21816 2001-11-20  Ravi Pratap  <ravi@ximian.com>
21817
21818         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
21819         re-write of the logic to now make it recursive.
21820
21821         (UpdateIndices): Re-write accordingly.
21822
21823         Store element data in a separate ArrayData list in the above methods.
21824
21825         (MakeByteBlob): Implement to dump the array data into a byte array.
21826
21827 2001-11-19  Ravi Pratap  <ravi@ximian.com>
21828
21829         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
21830         into CheckIndices.
21831
21832         * constant.cs (Define): Implement.
21833
21834         (EmitConstant): Re-write fully.
21835
21836         Pass in location info.
21837
21838         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
21839         respectively.
21840
21841         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
21842         DictionaryEntry since we need location info too.
21843
21844         (constant_declaration): Update accordingly.
21845
21846         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
21847         code into another method : UpdateIndices.
21848
21849 2001-11-18  Ravi Pratap  <ravi@ximian.com>
21850
21851         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
21852         some type checking etc.
21853
21854 2001-11-17  Ravi Pratap  <ravi@ximian.com>
21855
21856         * expression.cs (ArrayCreation::ValidateInitializers): Implement
21857         bits to provide dimension info if the user skips doing that.
21858
21859         Update second constructor to store the rank correctly.
21860
21861 2001-11-16  Ravi Pratap  <ravi@ximian.com>
21862
21863         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
21864         and try to implement.
21865
21866         * ../errors/cs0150.cs : Add.
21867
21868         * ../errors/cs0178.cs : Add.
21869
21870 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
21871
21872         * statement.cs: Implement foreach on multi-dimensional arrays. 
21873
21874         * parameter.cs (Parameters.GetParameterByName): Also lookup the
21875         name of the params argument.
21876
21877         * expression.cs: Use EmitStoreOpcode to get the right opcode while
21878         initializing the array.
21879
21880         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
21881         we can use this elsewhere.
21882
21883         * statement.cs: Finish implementation of foreach for single
21884         dimension arrays.
21885
21886         * cs-parser.jay: Use an out-of-band stack to pass information
21887         around, I wonder why I need this.
21888
21889         foreach_block: Make the new foreach_block the current_block.
21890
21891         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
21892         function used to return a static Parameters structure.  Used for
21893         empty parameters, as those are created very frequently.
21894
21895         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
21896
21897 2001-11-15  Ravi Pratap  <ravi@ximian.com>
21898
21899         * interface.cs : Default modifier is private, not public. The
21900         make verify test passes again.
21901
21902 2001-11-15  Ravi Pratap  <ravi@ximian.com>
21903
21904         * support.cs (ReflectionParameters): Fix logic to determine
21905         whether the last parameter is a params one. Test 9 passes again.
21906
21907         * delegate.cs (Populate): Register the builders we define with
21908         RegisterParameterForBuilder. Test 19 passes again.
21909
21910         * cs-parser.jay (property_declaration): Reference $6 instead
21911         of $$ to get at the location.
21912
21913         (indexer_declaration): Similar stuff.
21914
21915         (attribute): Ditto.
21916
21917         * class.cs (Property): Register parameters for the Get and Set methods
21918         if they exist. Test 23 passes again.
21919
21920         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
21921         call to EmitArguments as we are sure there aren't any params arguments. 
21922         Test 32 passes again.
21923
21924         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
21925         IndexOutOfRangeException. 
21926
21927         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
21928         Test 33 now passes again.
21929
21930 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
21931
21932         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
21933         broke a bunch of things.  Will have to come up with a better way
21934         of tracking locations.
21935
21936         * statement.cs: Implemented foreach for single dimension arrays.
21937
21938 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
21939
21940         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
21941         an error.  This removes the lookup from the critical path.
21942
21943         * cs-parser.jay: Removed use of temporary_loc, which is completely
21944         broken. 
21945
21946 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
21947
21948         * support.cs (ReflectionParameters.ParameterModifier): Report
21949         whether the argument is a PARAMS argument or not.
21950
21951         * class.cs: Set the attribute `ParamArrayAttribute' on the
21952         parameter argument.
21953
21954         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
21955         and cons_param_array_attribute (ConstructorInfo for
21956         ParamArrayAttribute)., 
21957
21958         * codegen.cs: Emit the return using the `Return' statement, that
21959         way we can report the error correctly for missing return values. 
21960
21961         * class.cs (Method.Emit): Clean up.
21962
21963         * expression.cs (Argument.Resolve): Take another argument: the
21964         location where this argument is used.  Notice that this is not
21965         part of the "Argument" class as to reduce the size of the
21966         structure (we know the approximate location anyways).
21967
21968         Test if the argument is a variable-reference, if not, then
21969         complain with a 206.
21970
21971         (Argument.Emit): Emit addresses of variables.
21972
21973         (Argument.FullDesc): Simplify.
21974
21975         (Invocation.DoResolve): Update for Argument.Resolve.
21976
21977         (ElementAccess.DoResolve): ditto.
21978
21979         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
21980         method should be virtual, as this method is always virtual.
21981
21982         (NewDelegate.DoResolve): Update for Argument.Resolve.
21983
21984         * class.cs (ConstructorInitializer.DoResolve): ditto.
21985
21986         * attribute.cs (Attribute.Resolve): ditto.
21987
21988 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
21989
21990         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
21991
21992         * expression.cs (ParameterReference): Drop IStackStorage and implement
21993         IAssignMethod instead. 
21994
21995         (LocalVariableReference): ditto.
21996
21997         * ecore.cs (FieldExpr): Drop IStackStorage and implement
21998         IAssignMethod instead. 
21999
22000 2001-11-13  Miguel de Icaza <miguel@ximian.com>
22001
22002         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
22003         enumerations that are used in heavily used structures derive from
22004         byte in a laughable and pathetic attempt to reduce memory usage.
22005         This is the kind of pre-optimzations that you should not do at
22006         home without adult supervision.
22007
22008         * expression.cs (UnaryMutator): New class, used to handle ++ and
22009         -- separatedly from the other unary operators.  Cleans up the
22010         code, and kills the ExpressionStatement dependency in Unary.
22011
22012         (Unary): Removed `method' and `Arguments' from this class, making
22013         it smaller, and moving it all to SimpleCall, so I can reuse this
22014         code in other locations and avoid creating a lot of transient data
22015         strucutres when not required.
22016
22017         * cs-parser.jay: Adjust for new changes.
22018
22019 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
22020
22021         * enum.cs (Enum.Populate): If there is a failure during
22022         definition, return
22023
22024         * cs-parser.jay (opt_enum_base): we used to catch type errors
22025         here, but this is really incorrect.  The type error should be
22026         catched during semantic analysis.
22027
22028 2001-12-11  Ravi Pratap  <ravi@ximian.com>
22029
22030         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
22031         current_local_parameters as expected since I, in my stupidity, had forgotten
22032         to do this :-)
22033
22034         * attribute.cs (GetValidPlaces): Fix stupid bug.
22035
22036         * class.cs (Method::Emit): Perform check on applicability of attributes.
22037
22038         (Constructor::Emit): Ditto.
22039
22040         (Field::Emit): Ditto.
22041
22042         (Field.Location): Store location information.
22043
22044         (Property, Event, Indexer, Operator): Ditto.
22045
22046         * cs-parser.jay (field_declaration): Pass in location for each field.
22047
22048         * ../errors/cs0592.cs : Add.
22049
22050 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22051
22052         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
22053
22054         (InitCoreTypes): Update accordingly.
22055
22056         (RegisterAttrType, LookupAttr): Implement.
22057
22058         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
22059         info about the same.
22060
22061         (Resolve): Update to populate the above as necessary.
22062
22063         (Error592): Helper.
22064
22065         (GetValidPlaces): Helper to the above.
22066
22067         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
22068
22069         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
22070
22071 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22072
22073         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
22074
22075         * ../errors/cs0617.cs : Add.
22076
22077 2001-11-11  Ravi Pratap  <ravi@ximian.com>
22078
22079         * enum.cs (Emit): Rename to Populate to be more consistent with what
22080         we expect it to do and when exactly it is called.
22081
22082         * class.cs, rootcontext.cs : Update accordingly.
22083
22084         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
22085         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
22086
22087         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
22088
22089         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
22090         of a fieldinfo using the above, when dealing with a FieldBuilder.
22091
22092 2001-11-10  Ravi Pratap  <ravi@ximian.com>
22093
22094         * ../errors/cs0031.cs : Add.
22095
22096         * ../errors/cs1008.cs : Add.
22097
22098         * ../errrors/cs0543.cs : Add.
22099
22100         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
22101         enum type.
22102
22103         (FindMembers): Implement.
22104
22105         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
22106         enums and delegates too.
22107
22108         (enum_types): Rename to builder_to_enum.
22109
22110         (delegate_types): Rename to builder_to_delegate.
22111
22112         * delegate.cs (FindMembers): Implement.
22113
22114 2001-11-09  Ravi Pratap  <ravi@ximian.com>
22115
22116         * typemanager.cs (IsEnumType): Implement.
22117
22118         * enum.cs (Emit): Re-write parts to account for the underlying type
22119         better and perform checking etc.
22120
22121         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
22122         of the underlying type.
22123
22124         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
22125         value
22126
22127         * enum.cs (error31): Helper to report error #31.
22128
22129         * cs-parser.jay (enum_declaration): Store location of each member too.
22130
22131         * enum.cs (member_to_location): New hashtable. 
22132
22133         (AddEnumMember): Update location hashtable.
22134
22135         (Emit): Use the location of each member while reporting errors.
22136
22137 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22138
22139         * cs-parser.jay: A for_initializer if is a
22140         local_variable_declaration really ammount to have an implicit
22141         block with the variable declaration and no initializer for for.
22142
22143         * statement.cs (For.Emit): Cope with null initializers.
22144
22145         This fixes the infinite loop on for initializers.
22146
22147 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
22148
22149         * enum.cs: More cleanup.
22150
22151         * ecore.cs: Remove dead code.
22152
22153         * class.cs (Property.Emit): More simplification.
22154         (Event.Emit): ditto.
22155
22156         Reworked to have less levels of indentation.
22157
22158 2001-11-08  Ravi Pratap  <ravi@ximian.com>
22159
22160         * class.cs (Property): Emit attributes.
22161
22162         (Field): Ditto.
22163
22164         (Event): Ditto.
22165
22166         (Indexer): Ditto.
22167
22168         (Operator): Ditto.
22169
22170         * enum.cs (Emit): Ditto.
22171
22172         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
22173         Enums too.
22174
22175         * class.cs (Field, Event, etc.): Move attribute generation into the
22176         Emit method everywhere.
22177
22178         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
22179         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
22180         as we had no way of defining nested enums !
22181
22182         * rootcontext.cs : Adjust code accordingly.
22183
22184         * typemanager.cs (AddEnumType): To keep track of enum types separately.
22185
22186 2001-11-07  Ravi Pratap  <ravi@ximian.com>
22187
22188         * expression.cs (EvalConstantExpression): Move into ecore.cs
22189
22190         * enum.cs (Enum): Rename some members and make them public and readonly
22191         according to our convention.
22192
22193         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
22194         nothing else.
22195
22196         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
22197
22198         (Enum::Emit): Write a simple version for now which doesn't try to compute
22199         expressions. I shall modify this to be more robust in just a while.
22200
22201         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
22202
22203         (TypeContainer::CloseType): Create the Enum types too.
22204
22205         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
22206
22207         * expression.cs (EvalConstantExpression): Get rid of completely.
22208
22209         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
22210         user-defined values and other cases.
22211
22212         (IsValidEnumLiteral): Helper function.
22213
22214         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
22215         out there in the case we had a literal FieldExpr.
22216
22217         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
22218
22219         (Literalize): Revamp a bit to take two arguments.
22220
22221         (EnumLiteral): New class which derives from Literal to wrap enum literals.
22222
22223 2001-11-06  Ravi Pratap  <ravi@ximian.com>
22224
22225         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
22226
22227         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
22228
22229         (Resolve): Use the above to ensure we have proper initializers.
22230
22231 2001-11-05  Ravi Pratap  <ravi@ximian.com>
22232
22233         * expression.cs (Expression::EvalConstantExpression): New method to 
22234         evaluate constant expressions.
22235
22236         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
22237
22238 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
22239
22240         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
22241         in an array.
22242
22243         (Binary.ResolveOperator): Handle operator != (object a, object b)
22244         and operator == (object a, object b);
22245
22246         (Binary.DoNumericPromotions): Indicate whether the numeric
22247         promotion was possible.
22248
22249         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
22250         Implement.  
22251
22252         Made the ArrayAccess implement interface IAssignMethod instead of
22253         IStackStore as the order in which arguments are passed reflects
22254         this.
22255
22256         * assign.cs: Instead of using expr.ExprClass to select the way of
22257         assinging, probe for the IStackStore/IAssignMethod interfaces.
22258
22259         * typemanager.cs: Load InitializeArray definition.
22260
22261         * rootcontext.cs (RootContext.MakeStaticData): Used to define
22262         static data that can be used to initialize arrays. 
22263
22264 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
22265
22266         * expression.cs: Handle operator== and operator!= for booleans.
22267
22268         (Conditioal.Reduce): Implement reducer for the ?: operator.
22269
22270         (Conditional.Resolve): Implement dead code elimination.
22271
22272         (Binary.Resolve): Catch string literals and return a new
22273         concatenated string.
22274
22275         (Unary.Reduce): Implement reduction of unary expressions.
22276
22277         * ecore.cs: Split out the expression core handling here.
22278
22279         (Expression.Reduce): New method used to perform constant folding
22280         and CSE.  This is needed to support constant-expressions. 
22281
22282         * statement.cs (Statement.EmitBoolExpression): Pass true and false
22283         targets, and optimize for !x.
22284
22285 2001-11-04  Ravi Pratap  <ravi@ximian.com>
22286
22287         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
22288         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
22289         set custom atttributes.
22290
22291         * literal.cs (Literal::GetValue): New abstract method to return the actual
22292         value of the literal, cast as an object.
22293
22294         (*Literal): Implement GetValue method.
22295
22296         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22297         expressions to the arraylist but objects of type Argument.
22298
22299         * class.cs (TypeContainer::Emit): Emit our attributes too.
22300
22301         (Method::Emit, Constructor::Emit): Ditto.
22302
22303         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
22304         to be ignoring earlier.
22305
22306 2001-11-03  Ravi Pratap  <ravi@ximian.com>
22307
22308         * attribute.cs (AttributeSection::Define): Implement to do the business
22309         of constructing a CustomAttributeBuilder.
22310
22311         (Attribute): New trivial class. Increases readability of code.  
22312
22313         * cs-parser.jay : Update accordingly.
22314
22315         (positional_argument_list, named_argument_list, named_argument): New rules
22316
22317         (attribute_arguments): Use the above so that we are more correct.
22318
22319 2001-11-02  Ravi Pratap  <ravi@ximian.com>
22320
22321         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22322         to perform all checks for a method with a params parameter.
22323
22324         (Invocation::OverloadResolve): Update to use the above method and therefore
22325         cope correctly with params method invocations.
22326
22327         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
22328         params too.
22329
22330         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22331         constructors in our parent too because we can't afford to miss out on 
22332         protected ones ;-)
22333
22334         * attribute.cs (AttributeSection): New name for the class Attribute
22335
22336         Other trivial changes to improve readability.
22337
22338         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22339         use the new class names.
22340
22341 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22342
22343         * class.cs (Method::Define): Complete definition for params types too
22344
22345         (Indexer::Define): Ditto.
22346
22347         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22348         Cope everywhere with a request for info about the array parameter.
22349
22350 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22351
22352         * tree.cs (RecordNamespace): Fix up to check for the correct key.
22353
22354         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
22355         local_variable_type to extract the string corresponding to the type.
22356
22357         (local_variable_type): Fixup the action to use the new helper method.
22358
22359         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
22360         go.
22361
22362         * expression.cs : Clean out code which uses the above.
22363
22364 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22365
22366         * typemanager.cs (RegisterMethod): Check if we already have an existing key
22367         and bale out if necessary by returning a false.
22368
22369         (RegisterProperty): Ditto.
22370
22371         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
22372         and print out appropriate error messages.
22373
22374         * interface.cs (everywhere): Ditto.
22375
22376         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
22377         location to constructor.
22378
22379         * class.cs (Property, Event, Indexer): Update accordingly.
22380
22381         * ../errors/cs111.cs : Added.
22382
22383         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
22384         of a method, as laid down by the spec.
22385
22386         (Invocation::OverloadResolve): Use the above method.
22387
22388 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22389
22390         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22391         now take a TypeContainer and a Parameters object.
22392
22393         (ParameterData): Modify return type of ParameterModifier method to be 
22394         Parameter.Modifier and not a string.
22395
22396         (ReflectionParameters, InternalParameters): Update accordingly.
22397
22398         * expression.cs (Argument::GetParameterModifier): Same here.
22399
22400         * support.cs (InternalParameters::ParameterType): Find a better way of determining
22401         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22402         symbol in it at all so maybe this is only for now.
22403
22404 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22405
22406         * support.cs (InternalParameters): Constructor now takes an extra argument 
22407         which is the actual Parameters class.
22408
22409         (ParameterDesc): Update to provide info on ref/out modifiers.
22410
22411         * class.cs (everywhere): Update call to InternalParameters to pass in
22412         the second argument too.
22413
22414         * support.cs (ParameterData): Add ParameterModifier, which is a method 
22415         to return the modifier info [ref/out etc]
22416
22417         (InternalParameters, ReflectionParameters): Implement the above.
22418
22419         * expression.cs (Argument::ParameterModifier): Similar function to return
22420         info about the argument's modifiers.
22421
22422         (Invocation::OverloadResolve): Update to take into account matching modifiers 
22423         too.
22424
22425         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22426         a new SetFormalParameters object which we pass to InternalParameters.
22427
22428 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22429
22430         * expression.cs (NewArray): Merge into the ArrayCreation class.
22431
22432 2001-10-29  Ravi Pratap  <ravi@ximian.com>
22433
22434         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
22435         NewUserdefinedArray into one as there wasn't much of a use in having
22436         two separate ones.
22437
22438         * expression.cs (Argument): Change field's name to ArgType from Type.
22439
22440         (Type): New readonly property which returns the proper type, taking into 
22441         account ref/out modifiers.
22442
22443         (everywhere): Adjust code accordingly for the above.
22444
22445         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22446         whether we are emitting for a ref or out parameter.
22447
22448         * expression.cs (Argument::Emit): Use the above field to set the state.
22449
22450         (LocalVariableReference::Emit): Update to honour the flag and emit the
22451         right stuff.
22452
22453         * parameter.cs (Attributes): Set the correct flags for ref parameters.
22454
22455         * expression.cs (Argument::FullDesc): New function to provide a full desc.
22456
22457         * support.cs (ParameterData): Add method ParameterDesc to the interface.
22458
22459         (ReflectionParameters, InternalParameters): Implement the above method.
22460
22461         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22462         reporting errors.
22463
22464         (Invocation::FullMethodDesc): Ditto. 
22465
22466 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
22467
22468         * cs-parser.jay: Add extra production for the second form of array
22469         creation. 
22470
22471         * expression.cs (ArrayCreation): Update to reflect the above
22472         change. 
22473
22474         * Small changes to prepare for Array initialization.
22475
22476 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
22477
22478         * typemanager.cs (ImplementsInterface): interface might be null;
22479         Deal with this problem;
22480
22481         Also, we do store negative hits on the cache (null values), so use
22482         this instead of calling t.GetInterfaces on the type everytime.
22483
22484 2001-10-28  Ravi Pratap  <ravi@ximian.com>
22485
22486         * typemanager.cs (IsBuiltinType): New method to help determine the same.
22487
22488         * expression.cs (New::DoResolve): Get rid of array creation code and instead
22489         split functionality out into different classes.
22490
22491         (New::FormArrayType): Move into NewBuiltinArray.
22492
22493         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22494         quite useless.
22495
22496         (NewBuiltinArray): New class to handle creation of built-in arrays.
22497
22498         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22499         account creation of one-dimensional arrays.
22500
22501         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22502
22503         (NewUserdefinedArray::DoResolve): Implement.
22504
22505         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22506
22507         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22508         we maintain inside the TypeManager. This is necessary to perform lookups on the
22509         module builder.
22510
22511         (LookupType): Update to perform GetType on the module builders too.     
22512
22513         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22514
22515         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22516
22517 2001-10-23  Ravi Pratap  <ravi@ximian.com>
22518
22519         * expression.cs (New::DoResolve): Implement guts of array creation.
22520
22521         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22522
22523 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
22524
22525         * expression.cs: Fix bug I introduced lsat night that broke
22526         Delegates. 
22527
22528         (Expression.Resolve): Report a 246 error (can not resolve name)
22529         if we find a SimpleName in the stream.
22530
22531         (Expression.ResolveLValue): Ditto.
22532
22533         (Expression.ResolveWithSimpleName): This function is a variant of
22534         ResolveName, this one allows SimpleNames to be returned without a
22535         warning.  The only consumer of SimpleNames is MemberAccess
22536
22537 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
22538
22539         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22540         might arrive here.  I have my doubts that this is correct.
22541
22542         * statement.cs (Lock): Implement lock statement.
22543
22544         * cs-parser.jay: Small fixes to support `lock' and `using'
22545
22546         * cs-tokenizer.cs: Remove extra space
22547
22548         * driver.cs: New flag --checked, allows to turn on integer math
22549         checking. 
22550
22551         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22552         Threading.Monitor.Exit 
22553
22554 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
22555
22556         * expression.cs (IndexerAccess::DoResolveLValue): Set the
22557         Expression Class to be IndexerAccess.
22558
22559         Notice that Indexer::DoResolve sets the eclass to Value.
22560
22561 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
22562
22563         * class.cs (TypeContainer::Emit): Emit code for indexers.
22564
22565         * assign.cs (IAssignMethod): New interface implemented by Indexers
22566         and Properties for handling assignment.
22567
22568         (Assign::Emit): Simplify and reuse code. 
22569
22570         * expression.cs (IndexerAccess, PropertyExpr): Implement
22571         IAssignMethod, clean up old code. 
22572
22573 2001-10-22  Ravi Pratap  <ravi@ximian.com>
22574
22575         * typemanager.cs (ImplementsInterface): New method to determine if a type
22576         implements a given interface. Provides a nice cache too.
22577
22578         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22579         method.
22580
22581         (ConvertReferenceExplicit): Ditto.
22582
22583         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
22584         various methods, with correct names etc.
22585
22586         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
22587         Operator.UnaryNegation.
22588
22589         * cs-parser.jay (operator_declarator): Be a little clever in the case where
22590         we have a unary plus or minus operator.
22591
22592         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
22593         UnaryMinus.
22594
22595         * everywhere : update accordingly.
22596
22597         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22598         respectively.
22599
22600         * class.cs (Method::Define): For the case where we are implementing a method
22601         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
22602         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22603
22604 2001-10-21  Ravi Pratap  <ravi@ximian.com>
22605
22606         * interface.cs (FindMembers): Implement to work around S.R.E
22607         lameness.
22608
22609         * typemanager.cs (IsInterfaceType): Implement.
22610
22611         (FindMembers): Update to handle interface types too.
22612
22613         * expression.cs (ImplicitReferenceConversion): Re-write bits which
22614         use IsAssignableFrom as that is not correct - it doesn't work.
22615
22616         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
22617         and accordingly override EmitStatement.
22618
22619         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
22620         using the correct logic :-)
22621
22622 2001-10-19  Ravi Pratap  <ravi@ximian.com>
22623
22624         * ../errors/cs-11.cs : Add to demonstrate error -11 
22625
22626 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
22627
22628         * assign.cs (Assign::Resolve): Resolve right hand side first, and
22629         then pass this as a hint to ResolveLValue.
22630
22631         * expression.cs (FieldExpr): Add Location information
22632
22633         (FieldExpr::LValueResolve): Report assignment to readonly
22634         variable. 
22635
22636         (Expression::ExprClassFromMemberInfo): Pass location information.
22637
22638         (Expression::ResolveLValue): Add new method that resolves an
22639         LValue. 
22640
22641         (Expression::DoResolveLValue): Default invocation calls
22642         DoResolve. 
22643
22644         (Indexers): New class used to keep track of indexers in a given
22645         Type. 
22646
22647         (IStackStore): Renamed from LValue, as it did not really describe
22648         what this did.  Also ResolveLValue is gone from this interface and
22649         now is part of Expression.
22650
22651         (ElementAccess): Depending on the element access type
22652
22653         * typemanager.cs: Add `indexer_name_type' as a Core type
22654         (System.Runtime.CompilerServices.IndexerNameAttribute)
22655
22656         * statement.cs (Goto): Take a location.
22657
22658 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22659
22660         * delegate.cs (Delegate::VerifyDelegate): New method to verify
22661         if two delegates are compatible.
22662
22663         (NewDelegate::DoResolve): Update to take care of the case when
22664         we instantiate a delegate from another delegate.
22665
22666         * typemanager.cs (FindMembers): Don't even try to look up members
22667         of Delegate types for now.
22668
22669 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22670
22671         * delegate.cs (NewDelegate): New class to take care of delegate
22672         instantiation.
22673
22674         * expression.cs (New): Split the delegate related code out into 
22675         the NewDelegate class.
22676
22677         * delegate.cs (DelegateInvocation): New class to handle delegate 
22678         invocation.
22679
22680         * expression.cs (Invocation): Split out delegate related code into
22681         the DelegateInvocation class.
22682
22683 2001-10-17  Ravi Pratap  <ravi@ximian.com>
22684
22685         * expression.cs (New::DoResolve): Implement delegate creation fully
22686         and according to the spec.
22687
22688         (New::DoEmit): Update to handle delegates differently.
22689
22690         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
22691         because of which we were printing out arguments in reverse order !
22692
22693         * delegate.cs (VerifyMethod): Implement to check if the given method
22694         matches the delegate.
22695
22696         (FullDelegateDesc): Implement.
22697
22698         (VerifyApplicability): Implement.
22699
22700         * expression.cs (Invocation::DoResolve): Update to accordingly handle
22701         delegate invocations too.
22702
22703         (Invocation::Emit): Ditto.
22704
22705         * ../errors/cs1593.cs : Added.
22706
22707         * ../errors/cs1594.cs : Added.
22708
22709         * delegate.cs (InstanceExpression, TargetMethod): New properties.
22710
22711 2001-10-16  Ravi Pratap  <ravi@ximian.com>
22712
22713         * typemanager.cs (intptr_type): Core type for System.IntPtr
22714
22715         (InitCoreTypes): Update for the same.
22716
22717         (iasyncresult_type, asynccallback_type): Ditto.
22718
22719         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
22720         correct.
22721
22722         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
22723         too.
22724
22725         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
22726         the builders for the 4 members of a delegate type :-)
22727
22728         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
22729         type.
22730
22731         * expression.cs (New::DoResolve): Implement guts for delegate creation.
22732
22733         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
22734
22735 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
22736
22737         * statement.cs (Break::Emit): Implement.   
22738         (Continue::Emit): Implement.
22739
22740         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22741         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22742         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22743         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
22744         end loop
22745
22746         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
22747         properties that track the label for the current loop (begin of the
22748         loop and end of the loop).
22749
22750 2001-10-15  Ravi Pratap  <ravi@ximian.com>
22751
22752         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
22753         use of emitting anything at all.
22754
22755         * class.cs, rootcontext.cs : Get rid of calls to the same.
22756
22757         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
22758
22759         (Populate): Define the constructor correctly and set the implementation
22760         attributes.
22761
22762         * typemanager.cs (delegate_types): New hashtable to hold delegates that
22763         have been defined.
22764
22765         (AddDelegateType): Implement.
22766
22767         (IsDelegateType): Implement helper method.
22768
22769         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
22770
22771         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
22772         and accordingly handle it.
22773
22774         * delegate.cs (Populate): Take TypeContainer argument.
22775         Implement bits to define the Invoke method. However, I still haven't figured out
22776         how to take care of the native int bit :-(
22777
22778         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
22779         Qualify the name of the delegate, not its return type !
22780
22781         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
22782         conversion.
22783
22784         (StandardConversionExists): Checking for array types turns out to be recursive.
22785
22786         (ConvertReferenceExplicit): Implement array conversion.
22787
22788         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
22789
22790 2001-10-12  Ravi Pratap  <ravi@ximian.com>
22791
22792         * cs-parser.jay (delegate_declaration): Store the fully qualified
22793         name as it is a type declaration.
22794
22795         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
22796         readonly.
22797
22798         (DefineDelegate): Renamed from Define. Does the same thing essentially,
22799         as TypeContainer::DefineType.
22800
22801         (Populate): Method in which all the definition of the various methods (Invoke)
22802         etc is done.
22803
22804         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
22805         see.
22806
22807         (CloseDelegate): Finally creates the delegate.
22808
22809         * class.cs (TypeContainer::DefineType): Update to define delegates.
22810         (Populate, Emit and CloseType): Do the same thing here too.
22811
22812         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
22813         delegates in all these operations.
22814
22815 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
22816
22817         * expression.cs: LocalTemporary: a new expression used to
22818         reference a temporary that has been created.
22819
22820         * assign.cs: Handle PropertyAccess back here, so that we can
22821         provide the proper semantic access to properties.
22822
22823         * expression.cs (Expression::ConvertReferenceExplicit): Implement
22824         a few more explicit conversions. 
22825
22826         * modifiers.cs: `NEW' modifier maps to HideBySig.
22827
22828         * expression.cs (PropertyExpr): Make this into an
22829         ExpressionStatement, and support the EmitStatement code path. 
22830
22831         Perform get/set error checking, clean up the interface.
22832
22833         * assign.cs: recognize PropertyExprs as targets, and if so, turn
22834         them into toplevel access objects.
22835
22836 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
22837
22838         * expression.cs: PropertyExpr::PropertyExpr: use work around the
22839         SRE.
22840
22841         * typemanager.cs: Keep track here of our PropertyBuilders again to
22842         work around lameness in SRE.
22843
22844 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
22845
22846         * expression.cs (LValue::LValueResolve): New method in the
22847         interface, used to perform a second resolution pass for LValues. 
22848
22849         (This::DoResolve): Catch the use of this in static methods.
22850
22851         (This::LValueResolve): Implement.
22852
22853         (This::Store): Remove warning, assigning to `this' in structures
22854         is 
22855
22856         (Invocation::Emit): Deal with invocation of
22857         methods on value types.  We need to pass the address to structure
22858         methods rather than the object itself.  (The equivalent code to
22859         emit "this" for structures leaves the entire structure on the
22860         stack instead of a pointer to it). 
22861
22862         (ParameterReference::DoResolve): Compute the real index for the
22863         argument based on whether the method takes or not a `this' pointer
22864         (ie, the method is static).
22865
22866         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
22867         value types returned from functions when we need to invoke a
22868         method on the sturcture.
22869
22870
22871 2001-10-11  Ravi Pratap  <ravi@ximian.com>
22872
22873         * class.cs (TypeContainer::DefineType): Method to actually do the business of
22874         defining the type in the Modulebuilder or Typebuilder. This is to take
22875         care of nested types which need to be defined on the TypeBuilder using
22876         DefineNestedMethod.
22877
22878         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
22879         methods in RootContext, only ported to be part of TypeContainer.
22880
22881         (TypeContainer::GetInterfaceOrClass): Ditto.
22882
22883         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
22884
22885         * interface.cs (Interface::DefineInterface): New method. Does exactly
22886         what RootContext.CreateInterface did earlier, only it takes care of nested types 
22887         too.
22888
22889         (Interface::GetInterfaces): Move from RootContext here and port.
22890
22891         (Interface::GetInterfaceByName): Same here.
22892
22893         * rootcontext.cs (ResolveTree): Re-write.
22894
22895         (PopulateTypes): Re-write.
22896
22897         * class.cs (TypeContainer::Populate): Populate nested types too.
22898         (TypeContainer::Emit): Emit nested members too.
22899
22900         * typemanager.cs (AddUserType): Do not make use of the FullName property,
22901         instead just use the name argument passed in as it is already fully
22902         qualified.
22903
22904         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
22905         to TypeContainer mapping to see if a type is user-defined.
22906
22907         * class.cs (TypeContainer::CloseType): Implement. 
22908
22909         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
22910         the default constructor.
22911
22912         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
22913         twice.
22914
22915         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
22916
22917         * interface.cs (CloseType): Create the type here.
22918
22919         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
22920         the hierarchy.
22921
22922         Remove all the methods which are now in TypeContainer.
22923
22924 2001-10-10  Ravi Pratap  <ravi@ximian.com>
22925
22926         * delegate.cs (Define): Re-write bits to define the delegate
22927         correctly.
22928
22929 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
22930
22931         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
22932
22933         * expression.cs (ImplicitReferenceConversion): handle null as well
22934         as a source to convert to any reference type.
22935
22936         * statement.cs (Return): Perform any implicit conversions to
22937         expected return type.  
22938
22939         Validate use of return statement.  
22940
22941         * codegen.cs (EmitContext): Pass the expected return type here.
22942
22943         * class.cs (Method, Constructor, Property): Pass expected return
22944         type to EmitContext.
22945
22946 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
22947
22948         * expression.cs: Make DoResolve take an EmitContext instead of a
22949         TypeContainer.
22950
22951         Replaced `l' and `location' for `loc', for consistency.
22952
22953         (Error, Warning): Remove unneeded Tc argument.
22954
22955         * assign.cs, literal.cs, constant.cs: Update to new calling
22956         convention. 
22957
22958         * codegen.cs: EmitContext now contains a flag indicating whether
22959         code is being generated in a static method or not.
22960
22961         * cs-parser.jay: DecomposeQI, new function that replaces the old
22962         QualifiedIdentifier.  Now we always decompose the assembled
22963         strings from qualified_identifier productions into a group of
22964         memberaccesses.
22965
22966 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
22967
22968         * rootcontext.cs: Deal with field-less struct types correctly now
22969         by passing the size option to Define Type.
22970
22971         * class.cs: Removed hack that created one static field. 
22972
22973 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
22974
22975         * statement.cs: Moved most of the code generation here. 
22976
22977 2001-10-09  Ravi Pratap  <ravi@ximian.com>
22978
22979         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
22980         seem very right.
22981
22982         (ElementAccess): Remove useless bits for now - keep checks as the spec
22983         says.
22984
22985 2001-10-08  Ravi Pratap  <ravi@ximian.com>
22986
22987         * expression.cs (ElementAccess::DoResolve): Remove my crap code
22988         and start performing checks according to the spec.
22989
22990 2001-10-07  Ravi Pratap  <ravi@ximian.com>
22991
22992         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
22993         rank_specifiers instead.
22994
22995         (rank_specifiers): Change the order in which the rank specifiers are stored
22996
22997         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
22998
22999         * expression.cs (ElementAccess): Implement the LValue interface too.
23000
23001 2001-10-06  Ravi Pratap  <ravi@ximian.com>
23002
23003         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
23004         except that user defined conversions are not included.
23005
23006         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
23007         perform the conversion of the return type, if necessary.
23008
23009         (New::DoResolve): Check whether we are creating an array or an object
23010         and accordingly do the needful.
23011
23012         (New::Emit): Same here.
23013
23014         (New::DoResolve): Implement guts of array creation.
23015
23016         (New::FormLookupType): Helper function.
23017
23018 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23019
23020         * codegen.cs: Removed most of the code generation here, and move the
23021         corresponding code generation bits to the statement classes. 
23022
23023         Added support for try/catch/finalize and throw.
23024
23025         * cs-parser.jay: Added support for try/catch/finalize.
23026
23027         * class.cs: Catch static methods having the flags override,
23028         virtual or abstract.
23029
23030         * expression.cs (UserCast): This user cast was not really doing
23031         what it was supposed to do.  Which is to be born in fully resolved
23032         state.  Parts of the resolution were being performed at Emit time! 
23033
23034         Fixed this code.
23035
23036 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23037
23038         * expression.cs: Implicity convert the result from UserCast.
23039
23040 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23041
23042         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
23043         prevented it from working correctly. 
23044
23045         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
23046         merely ConvertImplicit.
23047
23048 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23049
23050         * typemanager.cs: Make the LookupTypeContainer function static,
23051         and not per-instance.  
23052
23053         * class.cs: Make static FindMembers (the one that takes a Type
23054         argument). 
23055
23056         * codegen.cs: Add EmitForeach here.
23057
23058         * cs-parser.jay: Make foreach a toplevel object instead of the
23059         inline expansion, as we need to perform semantic analysis on it. 
23060
23061 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23062
23063         * expression.cs (Expression::ImplicitUserConversion): Rename to
23064         UserDefinedConversion.
23065
23066         (Expression::UserDefinedConversion): Take an extra argument specifying 
23067         whether we look for explicit user conversions too.
23068
23069         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
23070
23071         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
23072
23073         (ExplicitUserConversion): Make it a call to UserDefinedConversion
23074         with the appropriate arguments.
23075
23076         * cs-parser.jay (cast_expression): Record location too.
23077
23078         * expression.cs (Cast): Record location info.
23079
23080         (Expression::ConvertExplicit): Take location argument.
23081
23082         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
23083         to determine if we are doing explicit conversions.
23084
23085         (UserCast::Emit): Update accordingly.
23086
23087         (Expression::ConvertExplicit): Report an error if everything fails.
23088
23089         * ../errors/cs0030.cs : Add.
23090
23091 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
23092
23093         * modifiers.cs: If the ABSTRACT keyword is present, also set the
23094         virtual and newslot bits. 
23095
23096         * class.cs (TypeContainer::RegisterRequiredImplementations):
23097         Record methods we need.
23098
23099         (TypeContainer::MakeKey): Helper function to make keys for
23100         MethodBases, since the Methodbase key is useless.
23101
23102         (TypeContainer::Populate): Call RegisterRequiredImplementations
23103         before defining the methods.   
23104
23105         Create a mapping for method_builders_to_methods ahead of time
23106         instead of inside a tight loop.
23107
23108         (::RequireMethods):  Accept an object as the data to set into the
23109         hashtable so we can report interface vs abstract method mismatch.
23110
23111 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23112
23113         * report.cs: Make all of it static.
23114
23115         * rootcontext.cs: Drop object_type and value_type computations, as
23116         we have those in the TypeManager anyways.
23117
23118         Drop report instance variable too, now it is a global.
23119
23120         * driver.cs: Use try/catch on command line handling.
23121
23122         Add --probe option to debug the error reporting system with a test
23123         suite. 
23124
23125         * report.cs: Add support for exiting program when a probe
23126         condition is reached.
23127
23128 2001-10-03  Ravi Pratap  <ravi@ximian.com>
23129
23130         * expression.cs (Binary::DoNumericPromotions): Fix the case when
23131         we do a forcible conversion regardless of type, to check if 
23132         ForceConversion returns a null.
23133
23134         (Binary::error19): Use location to report error.
23135
23136         (Unary::error23): Use location here too.
23137
23138         * ../errors/cs0019.cs : Check in.
23139
23140         * ../errors/cs0023.cs : Check in.
23141
23142         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
23143         case of a non-null MethodInfo object with a length of 0 !
23144
23145         (Binary::ResolveOperator): Flag error if overload resolution fails to find
23146         an applicable member - according to the spec :-)
23147         Also fix logic to find members in base types.
23148
23149         (Unary::ResolveOperator): Same here.
23150
23151         (Unary::report23): Change name to error23 and make first argument a TypeContainer
23152         as I was getting thoroughly confused between this and error19 :-)
23153
23154         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
23155         (::FindMostEncompassedType): Implement.
23156         (::FindMostEncompassingType): Implement.
23157         (::StandardConversionExists): Implement.
23158
23159         (UserImplicitCast): Re-vamp. We now need info about most specific
23160         source and target types so that we can do the necessary conversions.
23161
23162         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
23163         mathematical union with no duplicates.
23164
23165 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23166
23167         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
23168         in order from base classes to child classes, so that we can in
23169         child classes look up in our parent for method names and
23170         attributes (required for handling abstract, virtual, new, override
23171         constructs: we need to instrospect our base class, and if we dont
23172         populate the classes in order, the introspection might be
23173         incorrect.  For example, a method could query its parent before
23174         the parent has any methods and would determine that the parent has
23175         no abstract methods (while it could have had them)).
23176
23177         (RootContext::CreateType): Record the order in which we define the
23178         classes.
23179
23180 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
23181
23182         * class.cs (TypeContainer::Populate): Also method definitions can
23183         fail now, keep track of this.
23184
23185         (TypeContainer::FindMembers): Implement support for
23186         DeclaredOnly/noDeclaredOnly flag.
23187
23188         (Constructor::Emit) Return the ConstructorBuilder.
23189
23190         (Method::Emit) Return the MethodBuilder. 
23191         Check for abstract or virtual methods to be public.
23192
23193         * rootcontext.cs (RootContext::CreateType): Register all the
23194         abstract methods required for the class to be complete and the
23195         interface methods that must be implemented. 
23196
23197         * cs-parser.jay: Report error 501 (method requires body if it is
23198         not marked abstract or extern).
23199
23200         * expression.cs (TypeOf::Emit): Implement.
23201
23202         * typemanager.cs: runtime_handle_type, new global type.
23203
23204         * class.cs (Property::Emit): Generate code for properties.
23205
23206 2001-10-02  Ravi Pratap  <ravi@ximian.com>
23207
23208         * expression.cs (Unary::ResolveOperator): Find operators on base type
23209         too - we now conform exactly to the spec.
23210
23211         (Binary::ResolveOperator): Same here.
23212
23213         * class.cs (Operator::Define): Fix minor quirk in the tests.
23214
23215         * ../errors/cs0215.cs : Added.
23216
23217         * ../errors/cs0556.cs : Added.
23218
23219         * ../errors/cs0555.cs : Added.
23220
23221 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23222
23223         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
23224         single integer which is really efficient
23225
23226 2001-10-01  Ravi Pratap  <ravi@ximian.com>
23227
23228         *  expression.cs (Expression::ImplicitUserConversion): Use location
23229         even in the case when we are examining True operators.
23230  
23231         * class.cs (Operator::Define): Perform extensive checks to conform
23232         with the rules for operator overloading in the spec.
23233
23234         * expression.cs (Expression::ImplicitReferenceConversion): Implement
23235         some of the other conversions mentioned in the spec.
23236
23237         * typemanager.cs (array_type): New static member for the System.Array built-in
23238         type.
23239
23240         (cloneable_interface): For System.ICloneable interface.
23241
23242         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
23243         we start resolving the tree and populating types.
23244
23245         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
23246  
23247 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23248
23249         * expression.cs (Expression::ExprClassFromMemberInfo,
23250         Expression::Literalize): Create literal expressions from
23251         FieldInfos which are literals.
23252
23253         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
23254         type casts, because they were wrong.  The test suite in tests
23255         caught these ones.
23256
23257         (ImplicitNumericConversion): ushort to ulong requires a widening
23258         cast. 
23259
23260         Int32 constant to long requires widening cast as well.
23261
23262         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
23263         for integers because the type on the stack is not i4.
23264
23265 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
23266
23267         * expression.cs (report118): require location argument. 
23268
23269         * parameter.cs: Do not dereference potential null value.
23270
23271         * class.cs: Catch methods that lack the `new' keyword when
23272         overriding a name.  Report warnings when `new' is used without
23273         anything being there to override.
23274
23275         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
23276
23277         * class.cs: Only add constructor to hashtable if it is non-null
23278         (as now constructors can fail on define).
23279
23280         (TypeManager, Class, Struct): Take location arguments.
23281
23282         Catch field instance initialization in structs as errors.
23283
23284         accepting_filter: a new filter for FindMembers that is static so
23285         that we dont create an instance per invocation.
23286
23287         (Constructor::Define): Catch errors where a struct constructor is
23288         parameterless 
23289
23290         * cs-parser.jay: Pass location information for various new
23291         constructs. 
23292
23293         * delegate.cs (Delegate): take a location argument.
23294
23295         * driver.cs: Do not call EmitCode if there were problesm in the
23296         Definition of the types, as many Builders wont be there. 
23297
23298         * decl.cs (Decl::Decl): Require a location argument.
23299
23300         * cs-tokenizer.cs: Handle properly hex constants that can not fit
23301         into integers, and find the most appropiate integer for it.
23302
23303         * literal.cs: Implement ULongLiteral.
23304
23305         * rootcontext.cs: Provide better information about the location of
23306         failure when CreateType fails.
23307
23308 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
23309
23310         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23311         as well.
23312
23313         * expression.cs (Binary::CheckShiftArguments): Add missing type
23314         computation.
23315         (Binary::ResolveOperator): Add type to the logical and and logical
23316         or, Bitwise And/Or and Exclusive Or code paths, it was missing
23317         before.
23318
23319         (Binary::DoNumericPromotions): In the case where either argument
23320         is ulong (and most signed types combined with ulong cause an
23321         error) perform implicit integer constant conversions as well.
23322
23323 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23324
23325         * expression.cs (UserImplicitCast): Method should always be
23326         non-null. 
23327         (Invocation::BetterConversion): Simplified test for IntLiteral.
23328
23329         (Expression::ImplicitNumericConversion): Split this routine out.
23330         Put the code that performs implicit constant integer conversions
23331         here. 
23332
23333         (Expression::Resolve): Become a wrapper around DoResolve so we can
23334         check eclass and type being set after resolve.
23335
23336         (Invocation::Badness): Remove this dead function
23337
23338         (Binary::ResolveOperator): Do not compute the expensive argumnets
23339         unless we have a union for it.
23340
23341         (Probe::Emit): Is needs to do an isinst and then
23342         compare against null.
23343
23344         (::CanConvert): Added Location argument.  If the Location argument
23345         is null (Location.Null), then we do not report errors.  This is
23346         used by the `probe' mechanism of the Explicit conversion.  We do
23347         not want to generate an error for something that the user
23348         explicitly requested to be casted.  But the pipeline for an
23349         explicit cast first tests for potential implicit casts.
23350
23351         So for now, if the Location is null, it means `Probe only' to
23352         avoid adding another argument.   Might have to revise this
23353         strategy later.
23354
23355         (ClassCast): New class used to type cast objects into arbitrary
23356         classes (used in Explicit Reference Conversions).
23357
23358         Implement `as' as well.
23359
23360         Reverted all the patches from Ravi below: they were broken:
23361
23362                 * The use of `level' as a mechanism to stop recursive
23363                   invocations is wrong.  That was there just to catch the
23364                   bug with a strack trace but not as a way of addressing
23365                   the problem.
23366
23367                   To fix the problem we have to *understand* what is going
23368                   on and the interactions and come up with a plan, not
23369                   just get things going.
23370
23371                 * The use of the type conversion cache that I proposed
23372                   last night had an open topic: How does this work across
23373                   protection domains.  A user defined conversion might not
23374                   be public in the location where we are applying the
23375                   conversion, a different conversion might be selected
23376                   (ie, private A->B (better) but public B->A (worse),
23377                   inside A, A->B applies, but outside it, B->A will
23378                   apply).
23379
23380                 * On top of that (ie, even if the above is solved),
23381                   conversions in a cache need to be abstract.  Ie, `To
23382                   convert from an Int to a Short use an OpcodeCast', not
23383                   `To convert from an Int to a Short use the OpcodeCast on
23384                   the variable 5' (which is what this patch was doing).
23385
23386 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23387
23388         * expression.cs (Invocation::ConversionExists): Re-write to use
23389         the conversion cache
23390
23391         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23392         cache all conversions done, not just user-defined ones.
23393
23394         (Invocation::BetterConversion): The real culprit. Use ConversionExists
23395         to determine if a conversion exists instead of acutually trying to 
23396         perform the conversion. It's faster too.
23397
23398         (Expression::ConvertExplicit): Modify to use ConversionExists to check
23399         and only then attempt the implicit conversion.
23400
23401 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23402
23403         * expression.cs (ConvertImplicit): Use a cache for conversions
23404         already found. Check level of recursion and bail out if necessary.
23405
23406 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23407
23408         * typemanager.cs (string_concat_string_string, string_concat_object_object):
23409         Export standard methods that we expect for string operations.
23410
23411         * statement.cs (Block::UsageWarning): Track usage of variables and
23412         report the errors for not used variables.
23413
23414         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23415         operator. 
23416
23417 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23418
23419         * codegen.cs: remove unnneded code 
23420
23421         * expression.cs: Removed BuiltinTypeAccess class
23422
23423         Fix the order in which implicit conversions are
23424         done.  
23425
23426         The previous fixed dropped support for boxed conversions (adding a
23427         test to the test suite now)
23428
23429         (UserImplicitCast::CanConvert): Remove test for source being null,
23430         that code is broken.  We should not feed a null to begin with, if
23431         we do, then we should track the bug where the problem originates
23432         and not try to cover it up here.
23433
23434         Return a resolved expression of type UserImplicitCast on success
23435         rather than true/false.  Ravi: this is what I was talking about,
23436         the pattern is to use a static method as a "constructor" for
23437         objects. 
23438
23439         Also, do not create arguments until the very last minute,
23440         otherwise we always create the arguments even for lookups that
23441         will never be performed. 
23442
23443         (UserImplicitCast::Resolve): Eliminate, objects of type
23444         UserImplicitCast are born in a fully resolved state. 
23445
23446         * typemanager.cs (InitCoreTypes): Init also value_type
23447         (System.ValueType). 
23448
23449         * expression.cs (Cast::Resolve): First resolve the child expression.
23450
23451         (LValue): Add new method AddressOf to be used by
23452         the `&' operator.  
23453
23454         Change the argument of Store to take an EmitContext instead of an
23455         ILGenerator, because things like FieldExpr need to be able to call
23456         their children expression to generate the instance code. 
23457
23458         (Expression::Error, Expression::Warning): Sugar functions for
23459         reporting errors.
23460
23461         (Expression::MemberLookup): Accept a TypeContainer instead of a
23462         Report as the first argument.
23463
23464         (Expression::ResolvePrimary): Killed.  I still want to improve
23465         this as currently the code is just not right.
23466
23467         (Expression::ResolveMemberAccess): Simplify, but it is still
23468         wrong. 
23469
23470         (Unary::Resolve): Catch errors in AddressOf operators.
23471
23472         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23473         index to a byte for the short-version, or the compiler will choose
23474         the wrong Emit call, which generates the wrong data.
23475
23476         (ParameterReference::Emit, ::Store): same.
23477
23478         (FieldExpr::AddressOf): Implement.
23479
23480         * typemanager.cs: TypeManager: made public variable instead of
23481         property.
23482
23483         * driver.cs: document --fatal.
23484
23485         * report.cs (ErrorMessage, WarningMessage): new names for the old
23486         Error and Warning classes.
23487
23488         * cs-parser.jay (member_access): Turn built-in access to types
23489         into a normal simplename
23490
23491 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23492
23493         * expression.cs (Invocation::BetterConversion): Fix to cope
23494         with q being null, since this was introducing a bug.
23495
23496         * expression.cs (ConvertImplicit): Do built-in conversions first.
23497
23498 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23499
23500         * expression.cs (UserImplicitCast::Resolve): Fix bug.
23501
23502 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23503
23504         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23505         I had introduced long ago (what's new ?).
23506
23507         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
23508         the work of all the checking. 
23509         (ConvertImplicit): Call CanConvert and only then create object if necessary.
23510         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23511
23512         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23513         that is the right way. 
23514
23515         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
23516         overloading resolution. Use everywhere instead of cutting and pasting code.
23517
23518         (Binary::ResolveOperator): Use MakeUnionSet.
23519
23520         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
23521         we have to convert to bool types. Not complete yet.
23522
23523 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23524
23525         * typemanager.cs (TypeManager::CSharpName): support ushort.
23526
23527         * expression.cs (Expression::TryImplicitIntConversion): Attempts
23528         to provide an expression that performsn an implicit constant int
23529         conversion (section 6.1.6).
23530         (Expression::ConvertImplicitRequired): Reworked to include
23531         implicit constant expression conversions.
23532
23533         (Expression::ConvertNumericExplicit): Finished.
23534
23535         (Invocation::Emit): If InstanceExpression is null, then it means
23536         that we perform a call on this.
23537
23538 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23539
23540         * expression.cs (Unary::Emit): Remove some dead code.
23541         (Probe): Implement Resolve and Emit for `is'.
23542         (Expression::ConvertImplicitRequired): Attempt to do constant
23543         expression conversions here.  Maybe should be moved to
23544         ConvertImplicit, but I am not sure.
23545         (Expression::ImplicitLongConstantConversionPossible,
23546         Expression::ImplicitIntConstantConversionPossible): New functions
23547         that tell whether is it possible to apply an implicit constant
23548         expression conversion.
23549
23550         (ConvertNumericExplicit): Started work on explicit numeric
23551         conversions.
23552
23553         * cs-parser.jay: Update operator constants.
23554
23555         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23556         (Parameters::GetSignature): Hook up VerifyArgs here.
23557         (Parameters::VerifyArgs): Verifies that no two arguments have the
23558         same name. 
23559
23560         * class.cs (Operator): Update the operator names to reflect the
23561         ones that the spec expects (as we are just stringizing the
23562         operator names).
23563
23564         * expression.cs (Unary::ResolveOperator): Fix bug: Use
23565         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23566         previous usage did only work for our methods.
23567         (Expression::ConvertImplicit): Handle decimal implicit numeric
23568         conversions as well.
23569         (Expression::InternalTypeConstructor): Used to invoke constructors
23570         on internal types for default promotions.
23571
23572         (Unary::Emit): Implement special handling for the pre/post
23573         increment/decrement for overloaded operators, as they need to have
23574         the same semantics as the other operators.
23575
23576         (Binary::ResolveOperator): ditto.
23577         (Invocation::ConversionExists): ditto.
23578         (UserImplicitCast::Resolve): ditto.
23579
23580 2001-09-26  Ravi Pratap  <ravi@ximian.com>
23581
23582         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23583         operator, return after emitting body. Regression tests pass again !
23584
23585         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23586         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23587         (Invocation::OverloadResolve): Ditto.
23588         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23589
23590         * everywhere : update calls to the above methods accordingly.
23591
23592 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23593
23594         * assign.cs (Assign): Make it inherit from ExpressionStatement.
23595
23596         * expression.cs (ExpressionStatement): New base class used for
23597         expressions that can appear in statements, so that we can provide
23598         an alternate path to generate expression that do not leave a value
23599         on the stack.
23600
23601         (Expression::Emit, and all the derivatives): We no longer return
23602         whether a value is left on the stack or not.  Every expression
23603         after being emitted leaves a single value on the stack.
23604
23605         * codegen.cs (EmitContext::EmitStatementExpression): Use the
23606         facilties of ExpressionStatement if possible.
23607
23608         * cs-parser.jay: Update statement_expression.
23609
23610 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
23611
23612         * driver.cs: Change the wording of message
23613
23614 2001-09-25  Ravi Pratap  <ravi@ximian.com>
23615
23616         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
23617         the type of the expression to the return type of the method if
23618         we have an overloaded operator match ! The regression tests pass again !
23619         (Unary::ResolveOperator): Ditto.
23620
23621         * expression.cs (Invocation::ConversionExists): Correct the member lookup
23622         to find "op_Implicit", not "implicit" ;-)
23623         (UserImplicitCast): New class to take care of user-defined implicit conversions.
23624         (ConvertImplicit, ForceConversion): Take TypeContainer argument
23625
23626         * everywhere : Correct calls to the above accordingly.
23627
23628         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
23629         (ConvertImplicit): Do user-defined conversion if it exists.
23630
23631 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
23632
23633         * assign.cs: track location.
23634         (Resolve): Use implicit conversions on assignment.
23635
23636         * literal.cs: Oops.  Not good, Emit of short access values should
23637         pass (Bytes) or the wrong argument will be selected.
23638
23639         * expression.cs (Unary::Emit): Emit code for -expr.
23640
23641         (Unary::ResolveOperator): Handle `Substract' for non-constants
23642         (substract from zero from the non-constants).
23643         Deal with Doubles as well. 
23644
23645         (Expression::ConvertImplicitRequired): New routine that reports an
23646         error if no implicit conversion exists. 
23647
23648         (Invocation::OverloadResolve): Store the converted implicit
23649         expressions if we make them
23650
23651 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23652
23653         * class.cs (ConstructorInitializer): Take a Location argument.
23654         (ConstructorBaseInitializer): Same here.
23655         (ConstructorThisInitializer): Same here.
23656
23657         * cs-parser.jay : Update all calls accordingly.
23658
23659         * expression.cs (Unary, Binary, New): Take location argument.
23660         Update accordingly everywhere.
23661
23662         * cs-parser.jay : Update all calls to the above to take a location
23663         argument.
23664
23665         * class.cs : Ditto.
23666
23667 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23668
23669         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
23670         (Invocation::BetterConversion): Same here
23671         (Invocation::ConversionExists): Ditto.
23672
23673         (Invocation::ConversionExists): Implement.
23674
23675 2001-09-22  Ravi Pratap  <ravi@ximian.com>
23676
23677         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
23678         Also take an additional TypeContainer argument.
23679
23680         * All over : Pass in TypeContainer as argument to OverloadResolve.
23681
23682         * typemanager.cs (CSharpName): Update to check for the string type and return
23683         that too.
23684
23685         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
23686         a given method.
23687
23688 2001-09-21  Ravi Pratap  <ravi@ximian.com>
23689
23690         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
23691         (Invocation::BetterFunction): Implement.
23692         (Invocation::BetterConversion): Implement.
23693         (Invocation::ConversionExists): Skeleton, no implementation yet.
23694
23695         Okay, things work fine !
23696
23697 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
23698
23699         * typemanager.cs: declare and load enum_type, delegate_type and
23700         void_type. 
23701
23702         * expression.cs (Expression::Emit): Now emit returns a value that
23703         tells whether a value is left on the stack or not.  This strategy
23704         might be reveted tomorrow with a mechanism that would address
23705         multiple assignments.
23706         (Expression::report118): Utility routine to report mismatches on
23707         the ExprClass.
23708
23709         (Unary::Report23): Report impossible type/operator combination
23710         utility function.
23711
23712         (Unary::IsIncrementableNumber): Whether the type can be
23713         incremented or decremented with add.
23714         (Unary::ResolveOperator): Also allow enumerations to be bitwise
23715         complemented. 
23716         (Unary::ResolveOperator): Implement ++, !, ~,
23717
23718         (Invocation::Emit): Deal with new Emit convetion.
23719
23720         * All Expression derivatives: Updated their Emit method to return
23721         whether they leave values on the stack or not.
23722
23723         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
23724         stack for expressions that are statements. 
23725
23726 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
23727
23728         * expression.cs (LValue): New interface.  Must be implemented by
23729         LValue objects.
23730         (LocalVariableReference, ParameterReference, FieldExpr): Implement
23731         LValue interface.
23732
23733         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
23734         interface for generating code, simplifies the code.
23735
23736 2001-09-20  Ravi Pratap  <ravi@ximian.com>
23737
23738         * expression.cs (everywhere): Comment out return statements in ::Resolve
23739         methods to avoid the warnings.
23740
23741 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
23742
23743         * driver.cs (parse): Report error 2001 if we can not open the
23744         source file.
23745
23746         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
23747         not resolve it.
23748
23749         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
23750         object. 
23751
23752         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
23753         otherwise nested blocks end up with the same index.
23754
23755         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
23756
23757         * expression.cs:  Instead of having FIXMEs in the Resolve
23758         functions, throw exceptions so it is obvious that we are facing a
23759         bug. 
23760
23761         * cs-parser.jay (invocation_expression): Pass Location information.
23762
23763         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
23764         Use a basename for those routines because .NET does not like paths
23765         on them. 
23766
23767         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
23768         already defined.
23769
23770 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
23771
23772         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
23773         are loading the correct data types (throws an exception if not).
23774         (TypeManager::InitCoreTypes): Use CoreLookupType
23775
23776         * expression.cs (Unary::ResolveOperator): return the child
23777         expression for expressions which are just +expr.
23778         (Unary::ResolveOperator): Return negative literals for -LITERAL
23779         expressions (otherwise they are Unary {Literal}).
23780         (Invocation::Badness): Take into account `Implicit constant
23781         expression conversions'.
23782
23783         * literal.cs (LongLiteral): Implement long literal class.
23784         (IntLiteral): export the `Value' of the intliteral. 
23785
23786 2001-09-19  Ravi Pratap  <ravi@ximian.com>
23787
23788         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
23789
23790         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
23791         instead of 'Operator'
23792
23793         * expression.cs (Binary::ResolveOperator): Update accordingly.
23794         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
23795         and 'Minus'
23796
23797         * cs-parser.jay (unary_expression): Update to use the new names.
23798
23799         * gen-treedump.cs (GetUnary): Same here.
23800
23801         * expression.cs (Unary::Resolve): Implement.
23802         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
23803         operators are found instead of making noise ;-)
23804         (Unary::ResolveOperator): New method to do precisely the same thing which
23805         Binary::ResolveOperator does for Binary expressions.
23806         (Unary.method, .Arguments): Add.
23807         (Unary::OperName): Implement.   
23808         (Unary::ForceConversion): Copy and Paste !
23809
23810         * class.cs (Operator::Define): Fix a small bug for the case when we have 
23811         a unary operator.
23812
23813         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
23814         for the inbuilt operators. Only overloading works for now ;-)
23815
23816 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
23817
23818         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
23819         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
23820
23821         * expression.cs (This::Emit): Implement. 
23822         (This::Resolve): Implement.
23823         (TypeOf:Resolve): Implement.
23824         (Expression::ResolveSimpleName): Add an implicit this to instance
23825         field references. 
23826         (MemberAccess::Resolve): Deal with Parameters and Fields. 
23827         Bind instance variable to Field expressions.
23828         (FieldExpr::Instance): New field used to track the expression that
23829         represents the object instance.
23830         (FieldExpr::Resolve): Track potential errors from MemberLookup not
23831         binding 
23832         (FieldExpr::Emit): Implement.
23833
23834         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
23835         the last instruction contains a return opcode to avoid generating
23836         the last `ret' instruction (this generates correct code, and it is
23837         nice to pass the peverify output).
23838
23839         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
23840         initializer for static and instance variables.
23841         (Constructor::Emit): Allow initializer to be null in the case of
23842         static constructors.  Only emit initializer for instance
23843         constructors. 
23844
23845         (TypeContainer::FindMembers): Return a null array if there are no
23846         matches.
23847
23848         Also fix the code for the MemberTypes.Method branch, as it was not
23849         scanning that for operators (or tried to access null variables before).
23850
23851         * assign.cs (Assign::Emit): Handle instance and static fields. 
23852
23853         * TODO: Updated.
23854
23855         * driver.cs: Stop compilation if there are parse errors.
23856
23857         * cs-parser.jay (constructor_declaration): Provide default base
23858         initializer for non-static constructors.
23859         (constructor_declarator): Do not provide a default base
23860         initializers if none was specified.
23861         Catch the fact that constructors should not have parameters.
23862
23863         * class.cs: Do not emit parent class initializers for static
23864         constructors, that should be flagged as an error.
23865
23866 2001-09-18  Ravi Pratap  <ravi@ximian.com>
23867
23868         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
23869         Move back code into TypeContainer::Populate.
23870
23871 2001-09-18  Ravi Pratap  <ravi@ximian.com>
23872
23873         * class.cs (TypeContainer::AddConstructor): Fix the check to
23874         compare against Name, not Basename. 
23875         (Operator::OpType): Change Plus and Minus to Add and Subtract.
23876
23877         * cs-parser.jay : Update accordingly.
23878
23879         * class.cs (TypeContainer::FindMembers): For the case where we are searching
23880         for methods, don't forget to look into the operators too.
23881         (RegisterMethodBuilder): Helper method to take care of this for
23882         methods, constructors and operators.
23883         (Operator::Define): Completely revamp.
23884         (Operator.OperatorMethod, MethodName): New fields.
23885         (TypeContainer::Populate): Move the registering of builders into
23886         RegisterMethodBuilder.
23887         (Operator::Emit): Re-write.
23888
23889         * expression.cs (Binary::Emit): Comment out code path to emit method
23890         invocation stuff for the case when we have a user defined operator. I am
23891         just not able to get it right !
23892
23893 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
23894
23895         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
23896         argument. 
23897
23898         (Expression::MemberLookup): Provide a version that allows to
23899         specify the MemberTypes and BindingFlags. 
23900
23901         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
23902         so it was not fetching variable information from outer blocks.
23903
23904         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
23905         Beforefieldinit as it was buggy.
23906
23907         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
23908         that Ravi put here.  
23909
23910         * class.cs (Constructor::Emit): Only emit if block is not null.
23911         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
23912         deal with this by semantically definining it as if the user had
23913         done it.
23914
23915         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
23916         constructors as we now "emit" them at a higher level.
23917
23918         (TypeContainer::DefineDefaultConstructor): Used to define the
23919         default constructors if none was provided.
23920
23921         (ConstructorInitializer): Add methods Resolve and Emit. 
23922
23923         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
23924
23925 2001-09-17  Ravi Pratap  <ravi@ximian.com>
23926
23927         * class.cs (TypeContainer::EmitDefaultConstructor): Register
23928         the default constructor builder with our hashtable for methodbuilders
23929         to methodcores.
23930
23931         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
23932         and argument_count is 0 in which case we have a match.
23933         (Binary::ResolveOperator): More null checking and miscellaneous coding
23934         style cleanup.
23935
23936 2001-09-17  Ravi Pratap  <ravi@ximian.com>
23937
23938         * rootcontext.cs (IsNameSpace): Compare against null.
23939
23940         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
23941
23942         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
23943         and Unary::Operator.
23944
23945         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
23946         accordingly.
23947
23948         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
23949         we have overloaded operators.
23950         (Binary::ResolveOperator): Implement the part which does the operator overload
23951         resolution.
23952
23953         * class.cs (Operator::Emit): Implement.
23954         (TypeContainer::Emit): Emit the operators we have too.
23955
23956         * expression.cs (Binary::Emit): Update to emit the appropriate code for
23957         the case when we have a user-defined operator.
23958
23959 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
23960
23961         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
23962
23963 2001-09-16  Ravi Pratap  <ravi@ximian.com>
23964
23965         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
23966         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
23967         (Constructor::Emit): Implement.
23968         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
23969         if we have no work to do. 
23970         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
23971         Emit method.
23972
23973         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
23974         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
23975
23976         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
23977         of parent.parent.
23978
23979 2001-09-15  Ravi Pratap  <ravi@ximian.com>
23980
23981         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
23982         in the source.
23983         (Tree::RecordNamespace): Method to do what the name says ;-)
23984         (Tree::Namespaces): Property to get at the namespaces hashtable.
23985
23986         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
23987         keep track.
23988
23989         * rootcontext.cs (IsNamespace): Fixed it :-)
23990
23991 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
23992
23993         * class.cs (TypeContainer::FindMembers): Add support for
23994         constructors. 
23995         (MethodCore): New class that encapsulates both the shared aspects
23996         of a Constructor and a Method.  
23997         (Method, Constructor): Factored pieces into MethodCore.
23998
23999         * driver.cs: Added --fatal which makes errors throw exceptions.
24000         Load System assembly as well as part of the standard library.
24001
24002         * report.cs: Allow throwing exceptions on errors for debugging.
24003
24004         * modifiers.cs: Do not use `parent', instead use the real type
24005         container to evaluate permission settings.
24006
24007         * class.cs: Put Ravi's patch back in.  He is right, and we will
24008         have to cope with the
24009
24010 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24011
24012         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
24013         FamORAssem, not FamANDAssem.
24014
24015 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24016
24017         * driver.cs: Added --parse option that only parses its input files
24018         and terminates.
24019
24020         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
24021         incorrect.  IsTopLevel is not used to tell whether an object is
24022         root_types or not (that can be achieved by testing this ==
24023         root_types).  But to see if this is a top-level *class* (not
24024         necessarly our "toplevel" container). 
24025
24026 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24027
24028         * enum.cs (Enum::Define): Modify to call the Lookup method on the
24029         parent instead of a direct call to GetType.
24030
24031 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24032
24033         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
24034         Modifiers.TypeAttr. This should just be a call to that method.
24035
24036         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
24037         object so that we can determine if we are top-level or not.
24038
24039         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
24040         TypeContainer too.
24041
24042         * enum.cs (Enum::Define): Ditto.
24043
24044         * modifiers.cs (FieldAttr): Re-write.
24045
24046         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
24047         (TypeContainer::HaveStaticConstructor): New property to provide access
24048         to precisely that info.
24049
24050         * modifiers.cs (MethodAttr): Re-write.
24051         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
24052
24053         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
24054         of top-level types as claimed.
24055
24056 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24057
24058         * expression.cs (MemberLookup): Fruitless attempt to lookup
24059         constructors.  Maybe I need to emit default constructors?  That
24060         might be it (currently .NET emits this for me automatically).
24061         (Invocation::OverloadResolve): Cope with Arguments == null.
24062         (Invocation::EmitArguments): new function, shared by the new
24063         constructor and us.
24064         (Invocation::Emit): Handle static and instance methods.  Emit
24065         proper call instruction for virtual or non-virtual invocations.
24066         (New::Emit): Implement.
24067         (New::Resolve): Implement.
24068         (MemberAccess:Resolve): Implement.
24069         (MethodGroupExpr::InstanceExpression): used conforming to the spec
24070         to track instances.
24071         (FieldExpr::Resolve): Set type.
24072
24073         * support.cs: Handle empty arguments.
24074                 
24075         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
24076         SimpleLookup): Auxiliary routines to help parse a qualifier
24077         identifier.  
24078
24079         Update qualifier_identifier rule.
24080
24081         * codegen.cs: Removed debugging messages.
24082
24083         * class.cs: Make this a global thing, this acts just as a "key" to
24084         objects that we might have around.
24085
24086         (Populate): Only initialize method_builders_to_methods once.
24087
24088         * expression.cs (PropertyExpr): Initialize type from the
24089         PropertyType. 
24090
24091         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
24092         Resolve pattern.  Attempt to implicitly convert value to boolean.
24093         Emit code.
24094
24095         * expression.cs: Set the type for the int32/int32 argument case.
24096         (Binary::ResolveOperator): Set the return type to boolean for
24097         comparission operators
24098
24099         * typemanager.cs: Remove debugging print code.
24100
24101         (Invocation::Resolve): resolve type.
24102
24103         * class.cs: Allocate a MemberInfo of the correct size, as the code
24104         elsewhere depends on the test to reflect the correct contents.
24105
24106         (Method::) Keep track of parameters, due to System.Reflection holes
24107
24108         (TypeContainer::Populate): Keep track of MethodBuilders to Method
24109         mapping here.
24110
24111         (TypeContainer::FindMembers): Use ArrayList and then copy an array
24112         of the exact size and return that.
24113
24114         (Class::LookupMethodByBuilder): New function that maps
24115         MethodBuilders to its methods.  Required to locate the information
24116         on methods because System.Reflection bit us again.
24117
24118         * support.cs: New file, contains an interface ParameterData and
24119         two implementations: ReflectionParameters and InternalParameters
24120         used to access Parameter information.  We will need to grow this
24121         as required.
24122
24123         * expression.cs (Invocation::GetParameterData): implement a cache
24124         and a wrapper around the ParameterData creation for methods. 
24125         (Invocation::OverloadResolve): Use new code.
24126
24127 2001-09-13  Ravi Pratap  <ravi@ximian.com>
24128
24129         * class.cs (TypeContainer::EmitField): Remove and move into 
24130         (Field::Define): here and modify accordingly.
24131         (Field.FieldBuilder): New member.
24132         (TypeContainer::Populate): Update accordingly.
24133         (TypeContainer::FindMembers): Implement.
24134
24135 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24136
24137         * statement.cs: (VariableInfo::VariableType): New field to be
24138         initialized with the full type once it is resolved. 
24139
24140 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
24141
24142         * parameter.cs (GetParameterInfo): Use a type cache to compute
24143         things only once, and to reuse this information
24144
24145         * expression.cs (LocalVariableReference::Emit): Implement.
24146         (OpcodeCast::Emit): fix.
24147
24148         (ParameterReference::Resolve): Implement.
24149         (ParameterReference::Emit): Implement.
24150
24151         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
24152         that are expressions need to stay as Expressions.
24153
24154         * typemanager.cs (CSharpName): Returns the C# name of a type if
24155         possible. 
24156
24157         * expression.cs (Expression::ConvertImplicit): New function that
24158         implements implicit type conversions.
24159
24160         (Expression::ImplicitReferenceConversion): Implements implicit
24161         reference conversions.
24162
24163         (EmptyCast): New type for transparent casts.
24164
24165         (OpcodeCast): New type for casts of types that are performed with
24166         a sequence of bytecodes.
24167
24168         (BoxedCast): New type used for casting value types into reference
24169         types.  Emits a box opcode.
24170
24171         (Binary::DoNumericPromotions): Implements numeric promotions of
24172         and computation of the Binary::Type.
24173
24174         (Binary::EmitBranchable): Optimization.
24175
24176         (Binary::Emit): Implement code emission for expressions.
24177
24178         * typemanager.cs (TypeManager): Added two new core types: sbyte
24179         and byte.
24180
24181 2001-09-12  Ravi Pratap  <ravi@ximian.com>
24182
24183         * class.cs (TypeContainer::FindMembers): Method which does exactly
24184         what Type.FindMembers does, only we don't have to use reflection. No
24185         implementation yet.
24186
24187         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
24188         typecontainer objects as we need to get at them.
24189         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
24190
24191         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
24192         typecontainer object.
24193
24194         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
24195         of just a Report object.
24196
24197 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24198
24199         * class.cs (Event::Define): Go back to using the prefixes "add_" and
24200         "remove_"
24201         (TypeContainer::Populate): Now define the delegates of the type too.
24202         (TypeContainer.Delegates): Property to access the list of delegates defined
24203         in the type.
24204
24205         * delegates.cs (Delegate::Define): Implement partially.
24206
24207         * modifiers.cs (TypeAttr): Handle more flags.
24208
24209 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24210
24211         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
24212         and not <=
24213         (Operator::Define): Re-write logic to get types by using the LookupType method
24214         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
24215         (Indexer::Define): Ditto.
24216         (Event::Define): Ditto.
24217         (Property::Define): Ditto.
24218
24219 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24220
24221         * class.cs (TypeContainer::Populate): Now define operators too. 
24222         (TypeContainer.Operators): New property to access the list of operators
24223         in a type.
24224         (Operator.OperatorMethodBuilder): New member to hold the method builder
24225         for the operator we are defining.
24226         (Operator::Define): Implement.
24227
24228 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24229
24230         * class.cs (Event::Define): Make the prefixes of the accessor methods
24231         addOn_ and removeOn_ 
24232
24233         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
24234         of the location being passed in too. Ideally, this should go later since all
24235         error reporting should be done through the Report object.
24236
24237         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
24238         (Populate): Iterate thru the indexers we have and define them too.
24239         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
24240         for the get and set accessors.
24241         (Indexer::Define): Implement.
24242
24243 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
24244
24245         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
24246         my previous implementation, did not work.
24247
24248         * typemanager.cs: Add a couple of missing types (the longs).
24249
24250         * literal.cs: Use TypeManager.bool_type instead of getting it.
24251
24252         * expression.cs (EventExpr): New kind of expressions.
24253         (Expressio::ExprClassFromMemberInfo): finish
24254
24255 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
24256
24257         * assign.cs: Emit stores to static fields differently.
24258
24259 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24260
24261         * Merge in changes and adjust code to tackle conflicts. Backed out my
24262         code in Assign::Resolve ;-) 
24263
24264 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24265
24266         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
24267         instead Report.Error and also pass in the location.
24268         (CSharpParser::Lexer): New readonly property to return the reference
24269         to the Tokenizer object.
24270         (declare_local_variables): Use Report.Error with location instead of plain 
24271         old error.
24272         (CheckDef): Ditto.
24273
24274         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
24275         (Operator.CheckBinaryOperator): Ditto.
24276
24277         * cs-parser.jay (operator_declarator): Update accordingly.
24278
24279         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
24280         (CheckBinaryOperator): Same here.
24281
24282         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
24283         on the name without any prefixes of namespace names etc. This is because we
24284         already might have something already fully qualified like 
24285         'System.Console.WriteLine'
24286
24287         * assign.cs (Resolve): Begin implementation. Stuck ;-)
24288
24289 2001-09-07  Ravi Pratap  <ravi@ximian.com>
24290
24291         * cs-tokenizer.cs (location): Return a string which also contains
24292         the file name.
24293
24294         * expression.cs (ElementAccess): New class for expressions of the
24295         type 'element access.'
24296         (BaseAccess): New class for expressions of the type 'base access.'
24297         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
24298         respectively.
24299
24300         * cs-parser.jay (element_access): Implement action.
24301         (base_access): Implement actions.
24302         (checked_expression, unchecked_expression): Implement.
24303
24304         * cs-parser.jay (local_variable_type): Correct and implement.
24305         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24306
24307         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24308
24309         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24310         name and the specifiers.
24311
24312         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24313
24314         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
24315         making them all public ;-)
24316
24317         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24318         class anyways.
24319
24320 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
24321
24322         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24323         PropertyExprs.
24324         (FieldExpr, PropertyExprs): New resolved expressions.
24325         (SimpleName::MemberStaticCheck): Perform static checks for access
24326         to non-static fields on static methods. Maybe this should be
24327         generalized for MemberAccesses. 
24328         (SimpleName::ResolveSimpleName): More work on simple name
24329         resolution. 
24330
24331         * cs-parser.jay (primary_expression/qualified_identifier): track
24332         the parameter index.
24333
24334         * codegen.cs (CodeGen::Save): Catch save exception, report error.
24335         (EmitContext::EmitBoolExpression): Chain to expression generation
24336         instead of temporary hack.
24337         (::EmitStatementExpression): Put generic expression code generation.
24338
24339         * assign.cs (Assign::Emit): Implement variable assignments to
24340         local variables, parameters and fields.
24341
24342 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
24343
24344         * statement.cs (Block::GetVariableInfo): New method, returns the
24345         VariableInfo for a variable name in a block.
24346         (Block::GetVariableType): Implement in terms of GetVariableInfo
24347
24348         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24349         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24350
24351 2001-09-06  Ravi Pratap  <ravi@ximian.com>
24352
24353         * cs-parser.jay (operator_declaration): Continue on my quest : update
24354         to take attributes argument.
24355         (event_declaration): Ditto.
24356         (enum_declaration): Ditto.
24357         (indexer_declaration): Ditto.
24358
24359         * class.cs (Operator::Operator): Update constructor accordingly.
24360         (Event::Event): Ditto.
24361
24362         * delegate.cs (Delegate::Delegate): Same here.
24363
24364         * enum.cs (Enum::Enum): Same here.
24365
24366 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24367
24368         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
24369
24370         * ../tests/cs0658.cs : New file to demonstrate error 0658.
24371
24372         * attribute.cs (Attributes): New class to encapsulate all attributes which were
24373         being passed around as an arraylist.
24374         (Attributes::AddAttribute): Method to add attribute sections.
24375
24376         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
24377         (struct_declaration): Update accordingly.
24378         (constant_declaration): Update.
24379         (field_declaration): Update.
24380         (method_header): Update.
24381         (fixed_parameter): Update.
24382         (parameter_array): Ditto.
24383         (property_declaration): Ditto.
24384         (destructor_declaration): Ditto.
24385
24386         * class.cs (Struct::Struct): Update constructors accordingly.
24387         (Class::Class): Ditto.
24388         (Field::Field): Ditto.
24389         (Method::Method): Ditto.
24390         (Property::Property): Ditto.
24391         (TypeContainer::OptAttribute): update property's return type.
24392
24393         * interface.cs (Interface.opt_attributes): New member.
24394         (Interface::Interface): Update to take the extra Attributes argument.
24395
24396         * parameter.cs (Parameter::Parameter): Ditto.
24397
24398         * constant.cs (Constant::Constant): Ditto.
24399
24400         * interface.cs (InterfaceMemberBase): New OptAttributes field.
24401         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
24402         the attributes as a parameter.
24403         (InterfaceProperty): Update constructor call.
24404         (InterfaceEvent): Ditto.
24405         (InterfaceMethod): Ditto.
24406         (InterfaceIndexer): Ditto.
24407
24408         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
24409         pass the attributes too.
24410         (interface_event_declaration): Ditto.
24411         (interface_property_declaration): Ditto.
24412         (interface_method_declaration): Ditto.
24413         (interface_declaration): Ditto.
24414
24415 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
24416
24417         * class.cs (Method::Define): Track the "static Main" definition to
24418         create an entry point. 
24419
24420         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24421         EntryPoint if we find it. 
24422
24423         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24424         (EmitContext::ig): Make this variable public.
24425
24426         * driver.cs: Make the default output file be the first file name
24427         with the .exe extension.  
24428
24429         Detect empty compilations
24430
24431         Handle various kinds of output targets.  Handle --target and
24432         rename -t to --dumper.
24433
24434         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24435         methods inherited from Expression return now an Expression.  This
24436         will is used during the tree rewriting as we resolve them during
24437         semantic analysis.
24438
24439         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24440         the spec.  Missing entirely is the information about
24441         accessability of elements of it.
24442
24443         (Expression::ExprClassFromMemberInfo): New constructor for
24444         Expressions that creates a fully initialized Expression based on
24445         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24446         a Type.
24447
24448         (Invocation::Resolve): Begin implementing resolution of invocations.
24449
24450         * literal.cs (StringLiteral):  Implement Emit.
24451
24452 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24453
24454         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24455         member.
24456
24457 2001-09-04  Ravi Pratap  <ravi@ximian.com>
24458
24459         * cs-parser.jay (attribute_arguments): Implement actions.
24460         (attribute): Fix bug in production. Implement action.
24461         (attribute_list): Implement.
24462         (attribute_target): Implement.
24463         (attribute_target_specifier, opt_target_specifier): Implement
24464         (CheckAttributeTarget): New method to check if the attribute target
24465         is valid.
24466         (attribute_section): Implement.
24467         (opt_attributes): Implement.
24468
24469         * attribute.cs : New file to handle attributes.
24470         (Attribute): Class to hold attribute info.
24471
24472         * cs-parser.jay (opt_attribute_target_specifier): Remove production
24473         (attribute_section): Modify production to use 2 different rules to 
24474         achieve the same thing. 1 s/r conflict down !
24475         Clean out commented, useless, non-reducing dimension_separator rules.
24476
24477         * class.cs (TypeContainer.attributes): New member to hold list
24478         of attributes for a type.
24479         (Struct::Struct): Modify to take one more argument, the attribute list.
24480         (Class::Class): Ditto.
24481         (Field::Field): Ditto.
24482         (Method::Method): Ditto.
24483         (Property::Property): Ditto.
24484
24485         * cs-parser.jay (struct_declaration): Update constructor call to
24486         pass in the attributes too.
24487         (class_declaration): Ditto.
24488         (constant_declaration): Ditto.
24489         (field_declaration): Ditto.
24490         (method_header): Ditto.
24491         (fixed_parameter): Ditto.
24492         (parameter_array): Ditto.
24493         (property_declaration): Ditto.
24494
24495         * constant.cs (Constant::Constant): Update constructor similarly.
24496         Use System.Collections.
24497
24498         * parameter.cs (Parameter::Parameter): Update as above.
24499
24500 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24501
24502         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24503         (TypeContainer.delegates): New member to hold list of delegates.
24504
24505         * cs-parser.jay (delegate_declaration): Implement the action correctly 
24506         this time as I seem to be on crack ;-)
24507
24508 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
24509
24510         * rootcontext.cs (RootContext::IsNamespace): new function, used to
24511         tell whether an identifier represents a namespace.
24512
24513         * expression.cs (NamespaceExpr): A namespace expression, used only
24514         temporarly during expression resolution.
24515         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24516         utility functions to resolve names on expressions.
24517
24518 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
24519
24520         * codegen.cs: Add hook for StatementExpressions. 
24521
24522         * class.cs: Fix inverted test for static flag in methods.
24523
24524 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24525
24526         * class.cs (Operator::CheckUnaryOperator): Correct error number used
24527         to make it coincide with MS' number.
24528         (Operator::CheckBinaryOperator): Ditto.
24529
24530         * ../errors/errors.txt : Remove error numbers added earlier.
24531
24532         * ../errors/cs1019.cs : Test case for error # 1019
24533
24534         * ../errros/cs1020.cs : Test case for error # 1020
24535
24536         * cs-parser.jay : Clean out commented cruft.
24537         (dimension_separators, dimension_separator): Comment out. Ostensibly not
24538         used anywhere - non-reducing rule.
24539         (namespace_declarations): Non-reducing rule - comment out.
24540
24541         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24542         with TypeContainer::AddEnum.
24543
24544         * delegate.cs : New file for delegate handling classes.
24545         (Delegate): Class for declaring delegates.
24546
24547         * makefile : Update.
24548
24549         * cs-parser.jay (delegate_declaration): Implement.
24550
24551 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
24552
24553         * class.cs (Event::Define): Implement.
24554         (Event.EventBuilder): New member.
24555
24556         * class.cs (TypeContainer::Populate): Update to define all enums and events
24557         we have.
24558         (Events): New property for the events arraylist we hold. Shouldn't we move to using
24559         readonly fields for all these cases ?
24560
24561 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24562
24563         * class.cs (Property): Revamp to use the convention of making fields readonly.
24564         Accordingly modify code elsewhere.
24565
24566         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24567         the Define method of the Property class.
24568
24569         * class.cs : Clean up applied patch and update references to variables etc. Fix 
24570         trivial bug.
24571         (TypeContainer::Populate): Update to define all the properties we have. Also
24572         define all enumerations.
24573
24574         * enum.cs (Define): Implement.
24575
24576 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24577
24578         * cs-parser.jay (overloadable_operator): The semantic value is an
24579         enum of the Operator class.
24580         (operator_declarator): Implement actions.
24581         (operator_declaration): Implement.
24582
24583         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24584         validity of definitions.
24585         (Operator::CheckBinaryOperator): Static method to check for binary operators
24586         (TypeContainer::AddOperator): New method to add an operator to a type.
24587
24588         * cs-parser.jay (indexer_declaration): Added line to actually call the
24589         AddIndexer method so it gets added ;-)
24590
24591         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
24592         already taken care of by the MS compiler ?  
24593
24594 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24595
24596         * class.cs (Operator): New class for operator declarations.
24597         (Operator::OpType): Enum for the various operators.
24598
24599 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24600
24601         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24602         ostensibly handle this in semantic analysis.
24603
24604         * cs-parser.jay (general_catch_clause): Comment out
24605         (specific_catch_clauses, specific_catch_clause): Ditto.
24606         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24607         (catch_args, opt_catch_args): New productions.
24608         (catch_clause): Rewrite to use the new productions above
24609         (catch_clauses): Modify accordingly.
24610         (opt_catch_clauses): New production to use in try_statement
24611         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
24612         and re-write the code in the actions to extract the specific and
24613         general catch clauses by being a little smart ;-)
24614
24615         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
24616         Hooray, try and catch statements parse fine !
24617
24618 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24619
24620         * statement.cs (Block::GetVariableType): Fix logic to extract the type
24621         string from the hashtable of variables.
24622
24623         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
24624         I end up making that mistake ;-)
24625         (catch_clauses): Fixed gross error which made Key and Value of the 
24626         DictionaryEntry the same : $1 !!
24627
24628 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24629
24630         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
24631
24632         * cs-parser.jay (event_declaration): Correct to remove the semicolon
24633         when the add and remove accessors are specified. 
24634
24635 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24636
24637         * cs-parser.jay (IndexerDeclaration): New helper class to hold
24638         information about indexer_declarator.
24639         (indexer_declarator): Implement actions.
24640         (parsing_indexer): New local boolean used to keep track of whether
24641         we are parsing indexers or properties. This is necessary because 
24642         implicit_parameters come into picture even for the get accessor in the 
24643         case of an indexer.
24644         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
24645
24646         * class.cs (Indexer): New class for indexer declarations.
24647         (TypeContainer::AddIndexer): New method to add an indexer to a type.
24648         (TypeContainer::indexers): New member to hold list of indexers for the
24649         type.
24650
24651 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24652
24653         * cs-parser.jay (add_accessor_declaration): Implement action.
24654         (remove_accessor_declaration): Implement action.
24655         (event_accessors_declaration): Implement
24656         (variable_declarators): swap statements for first rule - trivial.
24657
24658         * class.cs (Event): New class to hold information about event
24659         declarations.
24660         (TypeContainer::AddEvent): New method to add an event to a type
24661         (TypeContainer::events): New member to hold list of events.
24662
24663         * cs-parser.jay (event_declaration): Implement actions.
24664
24665 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24666
24667         * cs-parser.jay (dim_separators): Implement. Make it a string
24668         concatenating all the commas together, just as they appear.
24669         (opt_dim_separators): Modify accordingly
24670         (rank_specifiers): Update accordingly. Basically do the same
24671         thing - instead, collect the brackets here.
24672         (opt_rank_sepcifiers): Modify accordingly.
24673         (array_type): Modify to actually return the complete type string
24674         instead of ignoring the rank_specifiers.
24675         (expression_list): Implement to collect the expressions
24676         (variable_initializer): Implement. We make it a list of expressions
24677         essentially so that we can handle the array_initializer case neatly too.
24678         (variable_initializer_list): Implement.
24679         (array_initializer): Make it a list of variable_initializers
24680         (opt_array_initializer): Modify accordingly.
24681
24682         * expression.cs (New::NType): Add enumeration to help us
24683         keep track of whether we have an object/delegate creation
24684         or an array creation.
24685         (New:NewType, New::Rank, New::Indices, New::Initializers): New
24686         members to hold data about array creation.
24687         (New:New): Modify to update NewType
24688         (New:New): New Overloaded contructor for the array creation
24689         case.
24690
24691         * cs-parser.jay (array_creation_expression): Implement to call
24692         the overloaded New constructor.
24693
24694 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
24695
24696         * class.cs (TypeContainer::Constructors): Return member
24697         constructors instead of returning null.
24698
24699 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
24700
24701         * typemanager.cs (InitCoreTypes): Initialize the various core
24702         types after we have populated the type manager with the user
24703         defined types (this distinction will be important later while
24704         compiling corlib.dll)
24705
24706         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
24707         on Expression Classification.  Now all expressions have a method
24708         `Resolve' and a method `Emit'.
24709
24710         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
24711         generation from working.     Also add some temporary debugging
24712         code. 
24713
24714 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
24715
24716         * codegen.cs: Lots of code generation pieces.  This is only the
24717         beginning, will continue tomorrow with more touches of polish.  We
24718         handle the fundamentals of if, while, do, for, return.  Others are
24719         trickier and I need to start working on invocations soon.
24720
24721         * gen-treedump.cs: Bug fix, use s.Increment here instead of
24722         s.InitStatement. 
24723
24724         * codegen.cs (EmitContext): New struct, used during code
24725         emission to keep a context.   Most of the code generation will be
24726         here. 
24727
24728         * cs-parser.jay: Add embedded blocks to the list of statements of
24729         this block.  So code generation proceeds in a top down fashion.
24730
24731 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
24732
24733         * statement.cs: Add support for multiple child blocks.
24734
24735 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
24736
24737         * codegen.cs (EmitCode): New function, will emit the code for a
24738         Block of code given a TypeContainer and its ILGenerator. 
24739
24740         * statement.cs (Block): Standard public readonly optimization.
24741         (Block::Block constructors): Link children. 
24742         (Block::Child): Child Linker.
24743         (Block::EmitVariables): Emits IL variable declarations.
24744
24745         * class.cs: Drop support for MethodGroups here, delay until
24746         Semantic Analysis.
24747         (Method::): Applied the same simplification that I did before, and
24748         move from Properties to public readonly fields.
24749         (Method::ParameterTypes): Returns the parameter types for the
24750         function, and implements a cache that will be useful later when I
24751         do error checking and the semantic analysis on the methods is
24752         performed.
24753         (Constructor::GetCallingConvention): Renamed from CallingConvetion
24754         and made a method, optional argument tells whether this is a class
24755         or a structure to apply the `has-this' bit.
24756         (Method::GetCallingConvention): Implement, returns the calling
24757         convention. 
24758         (Method::Define): Defines the type, a second pass is performed
24759         later to populate the methods.
24760
24761         (Constructor::ParameterTypes): implement a cache similar to the
24762         one on Method::ParameterTypes, useful later when we do semantic
24763         analysis. 
24764
24765         (TypeContainer::EmitMethod):  New method.  Emits methods.
24766
24767         * expression.cs: Removed MethodGroup class from here.
24768
24769         * parameter.cs (Parameters::GetCallingConvention): new method.
24770
24771 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
24772
24773         * class.cs (TypeContainer::Populate): Drop RootContext from the
24774         argument. 
24775
24776         (Constructor::CallingConvention): Returns the calling convention.
24777         (Constructor::ParameterTypes): Returns the constructor parameter
24778         types. 
24779
24780         (TypeContainer::AddConstructor): Keep track of default constructor
24781         and the default static constructor.
24782
24783         (Constructor::) Another class that starts using `public readonly'
24784         instead of properties. 
24785
24786         (Constructor::IsDefault): Whether this is a default constructor. 
24787
24788         (Field::) use readonly public fields instead of properties also.
24789
24790         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
24791         track of static constructors;  If none is used, turn on
24792         BeforeFieldInit in the TypeAttributes. 
24793
24794         * cs-parser.jay (opt_argument_list): now the return can be null
24795         for the cases where there are no arguments. 
24796
24797         (constructor_declarator): If there is no implicit `base' or
24798         `this', then invoke the default parent constructor. 
24799
24800         * modifiers.cs (MethodAttr): New static function maps a set of
24801         modifiers flags into a MethodAttributes enum
24802         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
24803         MethodAttr, TypeAttr to represent the various mappings where the
24804         modifiers are used.
24805         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
24806
24807 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
24808
24809         * parameter.cs (GetParameterInfo): Fix bug where there would be no
24810         method arguments.
24811
24812         * interface.cs (PopulateIndexer): Implemented the code generator
24813         for interface indexers.
24814
24815 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
24816
24817         * interface.cs (InterfaceMemberBase): Now we track the new status
24818         here.  
24819
24820         (PopulateProperty): Implement property population.  Woohoo!  Got
24821         Methods and Properties going today. 
24822
24823         Removed all the properties for interfaces, and replaced them with
24824         `public readonly' fields. 
24825
24826 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
24827
24828         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
24829         initialize their hashtables/arraylists only when they are needed
24830         instead of doing this always.
24831
24832         * parameter.cs: Handle refs and out parameters.
24833
24834         * cs-parser.jay: Use an ArrayList to construct the arguments
24835         instead of the ParameterCollection, and then cast that to a
24836         Parameter[] array.
24837
24838         * parameter.cs: Drop the use of ParameterCollection and use
24839         instead arrays of Parameters.
24840
24841         (GetParameterInfo): Use the Type, not the Name when resolving
24842         types. 
24843
24844 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
24845
24846         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
24847         and instead use public readonly fields.
24848
24849         * class.cs: Put back walking code for type containers.
24850
24851 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
24852
24853         * class.cs (MakeConstant): Code to define constants.
24854
24855         * rootcontext.cs (LookupType): New function.  Used to locate types 
24856
24857
24858 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
24859
24860         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
24861         this System.Reflection code is.  Kudos to Microsoft
24862
24863         * typemanager.cs: Implement a type cache and avoid loading all
24864         types at boot time.  Wrap in LookupType the internals.  This made
24865         the compiler so much faster.  Wow.  I rule!
24866
24867         * driver.cs: Make sure we always load mscorlib first (for
24868         debugging purposes, nothing really important).
24869
24870         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
24871         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
24872
24873         * rootcontext.cs: Lookup types on their namespace;  Lookup types
24874         on namespaces that have been imported using the `using' keyword.
24875
24876         * class.cs (TypeContainer::TypeAttr): Virtualize.
24877         (Class::TypeAttr): Return attributes suitable for this bad boy.
24878         (Struct::TypeAttr): ditto.
24879         Handle nested classes.
24880         (TypeContainer::) Remove all the type visiting code, it is now
24881         replaced with the rootcontext.cs code
24882
24883         * rootcontext.cs (GetClassBases): Added support for structs. 
24884
24885 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
24886
24887         * interface.cs, statement.cs, class.cs, parameter.cs,
24888         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
24889         Drop use of TypeRefs, and use strings instead.
24890
24891 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
24892
24893         * rootcontext.cs: 
24894
24895         * class.cs (Struct::Struct): set the SEALED flags after
24896         checking the modifiers.
24897         (TypeContainer::TypeAttr): new property, returns the
24898         TypeAttributes for a class.  
24899
24900         * cs-parser.jay (type_list): Oops, list production was creating a
24901         new list of base types.
24902
24903         * rootcontext.cs (StdLib): New property.
24904         (GetInterfaceTypeByName): returns an interface by type name, and
24905         encapsulates error handling here.
24906         (GetInterfaces): simplified.
24907         (ResolveTree): Encapsulated all the tree resolution here.
24908         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
24909         types. 
24910
24911         * driver.cs: Add support for --nostdlib, to avoid loading the
24912         default assemblies.
24913         (Main): Do not put tree resolution here. 
24914
24915         * rootcontext.cs: Beginning of the class resolution.
24916
24917 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
24918
24919         * rootcontext.cs: Provide better error reporting. 
24920
24921         * cs-parser.jay (interface_base): set our $$ to be interfaces.
24922
24923         * rootcontext.cs (CreateInterface): Handle the case where there
24924         are no parent interfaces.
24925
24926         (CloseTypes): Routine to flush types at the end.
24927         (CreateInterface): Track types.
24928         (GetInterfaces): Returns an array of Types from the list of
24929         defined interfaces.
24930
24931         * typemanager.c (AddUserType): Mechanism to track user types (puts
24932         the type on the global type hash, and allows us to close it at the
24933         end). 
24934
24935 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
24936
24937         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
24938         RecordInterface instead.
24939
24940         * cs-parser.jay: Updated to reflect changes above.
24941
24942         * decl.cs (Definition): Keep track of the TypeBuilder type that
24943         represents this type here.  Not sure we will use it in the long
24944         run, but wont hurt for now.
24945
24946         * driver.cs: Smaller changes to accomodate the new code.
24947
24948         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
24949         when done. 
24950
24951         * rootcontext.cs (CreateInterface):  New method, used to create
24952         the System.TypeBuilder type for interfaces.
24953         (ResolveInterfaces): new entry point to resolve the interface
24954         hierarchy. 
24955         (CodeGen): Property, used to keep track of the code generator.
24956
24957 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
24958
24959         * cs-parser.jay: Add a second production for delegate_declaration
24960         with `VOID'.
24961
24962         (enum_body): Put an opt_comma here instead of putting it on
24963         enum_body or enum_member_declarations so we can handle trailing
24964         commas on enumeration members.  Gets rid of a shift/reduce.
24965
24966         (type_list): Need a COMMA in the middle.
24967
24968         (indexer_declaration): Tell tokenizer to recognize get/set
24969
24970         * Remove old targets.
24971
24972         * Re-add the parser target.
24973
24974 2001-07-13  Simon Cozens <simon@simon-cozens.org>
24975
24976         * cs-parser.jay: Add precendence rules for a number of operators
24977         ot reduce the number of shift/reduce conflicts in the grammar.
24978
24979 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
24980
24981         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
24982         and put it here.
24983
24984         Get rid of old crufty code.
24985
24986         * rootcontext.cs: Use this to keep track of the parsed
24987         representation and the defined types available to the program. 
24988
24989         * gen-treedump.cs: adjust for new convention.
24990
24991         * type.cs: Split out the type manager, and the assembly builder
24992         from here. 
24993
24994         * typemanager.cs: the type manager will live here now.
24995
24996         * cil-codegen.cs: And the code generator here. 
24997
24998 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
24999
25000         * makefile: Fixed up for easy making.
25001
25002 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25003
25004         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
25005         the 
25006
25007         (unary_expression): Expand pre_increment_expression and
25008         post_decrement_expression to reduce a shift/reduce.
25009
25010 2001-07-11  Simon Cozens
25011
25012         * cs-tokenizer.cs: Hex numbers should begin with a 0.
25013
25014         Improve allow_keyword_as_indent name.
25015
25016 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
25017
25018         * Adjustments for Beta2. 
25019
25020 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
25021
25022         * decl.cs: Added `Define' abstract method.
25023         (InTransit): new property, used to catch recursive definitions. 
25024
25025         * interface.cs: Implement `Define'. 
25026
25027         * modifiers.cs: Map Modifiers.constants to
25028         System.Reflection.TypeAttribute flags.
25029
25030         * class.cs: Keep track of types and user-defined types.
25031         (BuilderInit): New method for creating an assembly
25032         (ResolveType): New function to launch the resolution process, only
25033         used by interfaces for now.
25034
25035         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
25036         that are inserted into the name space. 
25037
25038 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
25039
25040         * ARGH.  I have screwed up my tree so many times due to the use of
25041         rsync rather than using CVS.  Going to fix this at once. 
25042
25043         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
25044         load types.
25045
25046 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
25047
25048         * Experiment successful: Use System.Type rather that our own
25049         version of Type.  
25050
25051 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
25052
25053         * cs-parser.jay: Removed nsAliases from here.
25054
25055         Use new namespaces, handle `using XXX;' 
25056
25057         * namespace.cs: Reimplemented namespace handling, use a recursive
25058         definition of the class.  Now we can keep track of using clauses
25059         and catch invalid using clauses.
25060
25061 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
25062
25063         * gen-treedump.cs: Adapted for all the renaming.
25064
25065         * expression.cs (Expression): this class now has a Type property
25066         which returns an expression Type.
25067
25068         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
25069         `Type', as this has a different meaning now in the base
25070
25071 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
25072
25073         * interface.cs, class.cs: Removed from all the sources the
25074         references to signature computation, as we can not do method
25075         signature computation during the parsing time, as we are not
25076         trying to solve at that point distinguishing:
25077
25078         class X {
25079                 void a (Blah x) {}
25080                 void a (NS.Blah x) {}
25081         }
25082
25083         Which depending on the context might be valid or not, as we do not
25084         know if Blah is the same thing as NS.Blah at that point.
25085
25086         * Redid everything so the code uses TypeRefs now instead of
25087         Types.  TypeRefs are just temporary type placeholders, that need
25088         to be resolved.  They initially have a pointer to a string and the
25089         current scope in which they are used.  This is used later by the
25090         compiler to resolve the reference to an actual Type. 
25091
25092         * DeclSpace is no longer a CIR.Type, and neither are
25093         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
25094         are all DeclSpaces, but no Types. 
25095
25096         * type.cs (TypeRefManager): This implements the TypeRef manager,
25097         which keeps track of all the types that need to be resolved after
25098         the parsing has finished. 
25099
25100 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
25101
25102         * ARGH.  We are going to have to store `foreach' as a class rather
25103         than resolving it, as we need to verify error 1579 after name
25104         resolution.   *OR* we could keep a flag that says `This request to
25105         IEnumerator comes from a foreach statement' which we can then use
25106         to generate the error.
25107
25108 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
25109
25110         * class.cs (TypeContainer.AddMethod): we now add methods to the
25111         MethodGroup instead of the method hashtable.  
25112
25113         * expression.cs: Add MethodGroup abstraction, which gets us one
25114         step closer to the specification in the way we handle method
25115         declarations.  
25116
25117         * cs-parser.jay (primary_expression): qualified_identifier now
25118         tried to match up an identifier to a local variable reference or
25119         to a parameter reference.
25120
25121         current_local_parameters is now a parser global variable that
25122         points to the current parameters for the block, used during name
25123         lookup.
25124
25125         (property_declaration): Now creates an implicit `value' argument to
25126         the set accessor.
25127
25128 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
25129
25130         * parameter.cs: Do not use `param' arguments as part of the
25131         signature, per the spec.
25132
25133 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
25134
25135         * decl.cs: Base class for classes, structs and interfaces.  This
25136         is the "Declaration Space" 
25137
25138         * cs-parser.jay: Use CheckDef for checking declaration errors
25139         instead of having one on each function.
25140
25141         * class.cs: Factor out some code for handling error handling in
25142         accordance to the "Declarations" section in the "Basic Concepts"
25143         chapter in the ECMA C# spec.
25144
25145         * interface.cs: Make all interface member classes derive from
25146         InterfaceMemberBase.
25147
25148 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
25149
25150         * Many things: all interfaces are parsed and generated in
25151         gen-treedump.  Support for member variables, constructors,
25152         destructors, properties, constants is there.
25153
25154         Beginning of the IL backend, but very little done, just there for
25155         testing purposes. 
25156
25157 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
25158
25159         * cs-parser.jay: Fix labeled statement.
25160
25161         * cs-tokenizer.cs (escape): Escape " and ' always.
25162         ref_line, ref_name: keep track of the line/filename as instructed
25163         by #line by the compiler.
25164         Parse #line.
25165
25166 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
25167
25168         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
25169         to match the values in System.CodeDOM.
25170
25171         Divid renamed to Divide.
25172
25173         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
25174         statements. 
25175         (Statements.set): remove.
25176
25177         * System.CodeDOM/CodeCatchClause.cs: always have a valid
25178         statements. 
25179
25180         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
25181         falseStatements always have valid values. 
25182
25183         * cs-parser.jay: Use System.CodeDOM now.
25184