*** merged revisions from mcs: 57750, 58144
[mono.git] / mcs / gmcs / ChangeLog
1 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
2
3         A fix for #77822.
4
5         * expression.cs (VerifyArgumentsCompat): Reverted to double error
6         reporting, it's more tricky than I thought.
7
8 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
9
10         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
11         were not resolved
12
13         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
14         (DelegateCreation.ImplicitStandardConversionExists): New method for just
15         conversion test.
16         
17         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
18         not needed.
19
20         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
21         Updated after another emitcontext usage was clean up. It should help us to
22         synchronize with gmcs easier.
23
24 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
25
26         A fix for #77353.
27
28         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
29         (Event.Define): ditto
30         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
31
32         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
33         Removed redundant code and set NewSlot for Invoke method too.
34
35         * parameter.cs (Parameters.ctor): Add custom, type ctor.
36         (Parameters.MergeGenerated): New method. Use this method when you merge
37         compiler generated argument with user arguments.
38
39 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
40
41         * attribute.cs (ResolveAsTypeTerminal): Removed.
42
43         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
44         specialization for predefined types; 30% speed up.
45         Finally placed obsolete check to right place.
46         (Expression.ResolveType): Removed.
47
48         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
49         Updated after ResolveType was removed.
50
51         * expression.cs (Cast.ctor): Check void cast.
52         (Binary.ResolveAsTypeTerminal): Is never type.
53         (Conditional.ResolveAsTypeTerminal): Is never type.
54
55         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
56
57 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
58
59         * rootcontext.cs (ResolveCore): Removed System.INullableValue.
60
61 2006-03-23  Martin Baulig  <martin@ximian.com>
62
63         * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
64         type check if either of the types is an open generic type.
65
66 2006-03-23  Martin Baulig  <martin@ximian.com>
67
68         * convert.cs
69         (Convert.ExplicitTypeParameterConversion): New method; implement
70         explicit type parameter conversions.
71
72 2006-03-23  Martin Baulig  <martin@ximian.com>
73
74         * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
75         blindly allow all conversions if we do not have any constraints.
76
77 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
78
79         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
80         these two separated members to simplify the code.
81         (Attribute.Resolve): Refactored to use new fields and methods.
82         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
83         implemented obsolete attribute checking.
84         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
85         implemented obsolete checking again. It look line never ending quest ;-)
86         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
87
88         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
89
90         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
91
92         *class.cs (Property.Define): Add RegisterProperty call.
93
94         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
95         argument groups (only 2).
96
97         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
98         encoding expression to arguments.
99         (Expression.ExprClassToResolveFlags): Just turned to property.
100
101         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
102         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
103         optimized as well as implemented support for zero-length attributes.
104
105         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
106         Add caching of PropertyInfo's.
107
108 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
109
110         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
111         error multiple times.
112
113 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
114
115         New partial class implementation.
116         A fix for #77027, #77029, #77403
117
118         * attribute.cs (Attributable): Made attributes protected.
119
120         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
121         the replacements of ClassPart and PartialContainer.
122         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
123         (TypeContainer.AddInterface): Ditto.
124         (TypeContainer.AddPartial): The main method for partial classes. It checks
125         for errors and merges ModFlags and attributes. At the end class is added to
126         partial_parts list.
127         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
128         required here.
129         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
130         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
131         from the rest of partial classes.
132         (TypeContainer.GetClassBases): Simplified.
133         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
134         DefineType.
135         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
136         (TypeContainer.HasExplicitLayout): Uses Flags now.
137         (PartialContainer): Removed.
138         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
139         (StaticClass): Was merged with Class.
140         (Class.GetClassBases): class and static class bases are verified here.
141         (Class.TypeAttr): Added static attributes when class is static.
142         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
143         (MemberBase): In some cases we need to call parent container for partial
144         class. It should be eliminated but it's not easy now.
145
146         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
147
148         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
149         partial classed to accumulate class comments.
150         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
151
152         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
153
154         * driver.cs (MainDriver): Tree.GetDecl was removed.
155
156         * modifiers.cs (Modifiers): Add partial modifier.
157
158         * tree.cs (Tree.decl): Removed.
159         (RootTypes): Started to use this class more often for root types
160         specializations.
161
162 2006-03-23  Raja R Harinath  <rharinath@novell.com>
163
164         * generic.cs (TypeParameter.UpdateConstraints): Update
165         'constraints' if null.
166
167 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
168
169         A fix for #77615
170
171         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
172         external interface does not have an attribute.
173
174 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
175
176         Another prerequisites for new partial classs implementation.
177         
178         * attribute.cs (Attribute.Equal): Implemented.
179         (Attribute.Emit): Changed as attributes can be applied more than twice.
180         (Attributes.Emit): Check for duplicate attributes here.
181
182         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
183         as a parameter, clean-up.
184
185 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
186
187         A fix for #77485
188
189         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
190         contains obsolete attribute check which can in some cases look for base
191         type of current class which is not initialized yet.
192         (TypeContainer.BaseType): Replacement of ptype.
193
194         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
195
196 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
197
198         First of prerequisites for new partial classs implemention.
199         
200         * attribute.cs (Attributable): Extended by ResolveContext;
201         Attributes finally have correct context for resolving in all cases.
202         (AttachTo): Attribute owner is assigned here.
203
204         * codegen.cs (IResolveContext): Introduce new interface to hold
205         all information needed in resolving phase.
206         (EmitContext): Implements IResolveContext; more clean-up needed here.
207         
208         * decl.cs (MemberCore): Implemented IResolveContext.
209
210         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
211         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
212         parameter.cs, statement.cs, tree.cs, typemanager.cs:
213         Refactored to use new IResolveContext instead of EmitContext; cleanup
214
215 2006-03-22  Raja R Harinath  <rharinath@novell.com>
216
217         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
218         mcs to keep code differences small.
219         * attribute.cs (Attribute.GetParameterDefaultValue): New.
220         * typemanager.cs (parameter_default_value_attribute_type): New.
221         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
222         CS1908 check.
223
224 2006-03-22  Martin Baulig  <martin@ximian.com>
225
226         * generic.cs
227         (Nullable.NullableLiteral): Derive from `NullLiteral'.
228
229         * convert.cs
230         (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
231         instead of the normal `NullLiteral'.
232
233 2006-03-21  Martin Baulig  <martin@ximian.com>
234
235         Fix #77583.
236         * generic.cs (TypeManager.InferType): If `pt' is a generic
237         parameter, don't check whether `pt == at'.
238
239 2006-03-20  Raja R Harinath  <rharinath@novell.com>
240
241         Fix #77852
242         * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
243         (TypeParameter.Resolve): Update to change.
244         (ConstraintChecker.CheckConstraints): Resolve type-argument
245         constraints before use.
246
247 2006-03-16  Martin Baulig  <martin@ximian.com>
248
249         * generic.cs
250         (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
251         and don't have any instance constructors, also lookup in the base class.
252         (TypeManager.IsNullableValueType): New public method.
253
254         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
255         `BindingFlags.DeclaredOnly' flag and set `used_cache'.
256         (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
257
258         * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
259         instead of just TypeManager.IsNullableType() to determine whether
260         a lifted operator exists.
261         (UnaryMutator.DoResolve): Likewise.
262         (Conditional.DoResolve): Likewise.
263         (Binary.DoResolve): A lifted operator only exists if both operands
264         are valuetypes and at least one of them is a nullable type.
265
266 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
267
268         * iterator.cs : yield break is allowed in try statement which has
269           catch clauses. Fixed bug #77767.
270
271 2006-03-12  Martin Baulig  <martin@ximian.com>
272
273         * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
274         private IsSignatureEqual() to compare types; see the comment in
275         that method; fixes #77674.
276
277 2006-03-10  Raja R Harinath  <rharinath@novell.com>
278
279         * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
280         (Expression.ResolveAsTypeTerminal): Likewise.
281         * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
282         * expression.cs, generic.cs, iterators.cs: Likewise.
283         * parameter.cs, statement.cs, typemanager.cs: Likewise.
284
285 2006-03-09  Martin Baulig  <martin@ximian.com>
286
287         * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
288         TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
289
290 2006-03-09  Martin Baulig  <martin@ximian.com>
291
292         * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
293         `prepared' flag is set.
294
295         * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
296         (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
297         issues; see gtest-254.cs.
298
299 2006-03-07  Martin Baulig  <martin@ximian.com>
300
301         * generic.cs (TypeManager.InferType): Allow infering
302         `IEnumerable<T>' with an array of T; see gtest-251.cs.
303
304 2006-03-06  Martin Baulig  <martin@ximian.com>
305
306         * generic.cs
307         (TypeManager.InferType): Fix gtest-250.cs.
308
309         * typemanager.cs
310         (TypeManager.IsSubclassOf): Also check the base class.
311
312         * expression.cs
313         (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
314         fixes gtest-249.cs.
315
316 2006-03-01  Raja R Harinath  <rharinath@novell.com>
317
318         Fix #77679.
319         * expression.cs (ParameterReference.DoResolveBase): Change return
320         type to bool.
321         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
322         Update.
323
324         Fix #77628.
325         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
326
327         Fix #77642.
328         * typemanager.cs (GetFullNameSignature): Don't nullref on
329         protected accessors.
330
331 2006-02-16  Martin Baulig  <martin@ximian.com>
332
333         * generic.cs
334         (TypeManager.GetGenericFieldDefinition): New public method; use it
335         instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
336
337 2006-02-14  Martin Baulig  <martin@ximian.com>
338
339         * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
340
341 2006-02-14  Martin Baulig  <martin@ximian.com>
342
343         * generic.cs
344         (TypeManager.DropGenericMethodArguments): New public method; don't
345         use GetGenericMethodDefinition() on something which is not a
346         generic method.
347
348 2006-02-14  Martin Baulig  <martin@ximian.com>
349
350         * generic.cs
351         (ConstraintChecker.CheckConstraints): If a type parameter has the
352         `struct' constraint, the type must be a non-nullable valuetype.
353
354 2006-02-10  Martin Baulig  <martin@ximian.com>
355
356         * typemanager.cs
357         (TypeManager.IsOverride): Make this work for instantiated methods
358         in a generic class; fixes #77509.
359         (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
360         rather than calling it directly; fixes #77488.  
361
362 2006-02-08  Martin Baulig  <martin@ximian.com>
363
364         * generic.cs (ConstraintChecker.CheckConstraints): Move the error
365         reporting into CheckConstraint() so we can use the correctly
366         instantiated type.
367
368 2006-02-08  Martin Baulig  <martin@ximian.com>
369
370         * expression.cs (BaseAccess): Add support for generic methods.
371
372         * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
373         the new MethodGroupExpr.
374
375 2006-02-07  Martin Baulig  <martin@ximian.com>
376
377         * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
378         also reference types; fixes #77483.
379
380 2006-02-07  Martin Baulig  <martin@ximian.com>
381
382         * generic.cs
383         (TypeManager.IsGenericMethod): We now return whether something is
384         an instantiated generic method (and not a generic method def).
385         (TypeManager.IsGenericMethodDefinition): New public method.
386
387         * typemanager.cs
388         (TypeManager.CSharpSignature): Only include type arguments for
389         "real" generic methods, not for any instantiated method.
390         (TypeManager.GetMethodName): Likewise, but also allow generic
391         method definitions here.
392
393 2006-02-06  Miguel de Icaza  <miguel@novell.com>
394
395         * codegen.cs (EmitScopeInitFromBlock): check here the
396         capture_context, there is no need to make two calls to the
397         EmitContext. 
398
399         * anonymous.cs: Add some debugging messages that might help me
400         track other instances of this problem in the future (the
401         regression of test 467).
402
403         * cs-parser.jay: track the variable block, as we need to initalize
404         any captured variables declared in this block for the "catch"
405         portion of the "Try" statement.
406
407         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
408         scope initialization for captured variables. 
409
410         Also, move the emit for the variables after the block location has
411         been marked.
412
413 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
414
415        * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
416         
417 2006-02-06  Martin Baulig  <martin@ximian.com>
418
419         * class.cs (TypeContainer.DefineType): If we're a struct, pass
420         `TypeManager.value_type' as parent type to
421         ModuleBuilder.DefineType().  Fixes #77358.      
422
423 2006-02-02  Miguel de Icaza  <miguel@novell.com>
424
425         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
426         commit yesterday, the initialization for the roots is necessary.
427         What is not necessary is the scope activation.
428
429 2006-02-02  Raja R Harinath  <rharinath@novell.com>
430
431         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
432         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
433         CS0206 checks.
434         (Argument.Resolve): Remove CS0206 checks.
435
436 2006-02-01  Miguel de Icaza  <miguel@novell.com>
437
438         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
439         scopes for all the roots, the scopes will now be emitted when the
440         Blocks are entered. [This change was wrong, fixed on 2006-02-02]
441
442         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
443         code.  This reduces a lot of existing cruft.
444         
445         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
446         that the ScopeInfo is generated as we enter the scope, not at the
447         time of use, which is what we used to do before.
448
449         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
450         every time a Block is about to be emitted if we have a
451         CaptureContext. 
452
453 2006-02-01  Raja R Harinath  <rharinath@novell.com>
454
455         * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
456         attribute for mscorlib too.
457
458         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
459         (Reset): Update.
460         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
461
462         * typemanager.cs (cons_param_array_attribute): Make private.
463         (Reset): Set it to null.
464         (InitCoreHelpers): Don't initialize it.
465         (ConsParamArrayAttribute): New.  Initialize it as needed.
466         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
467
468 2006-01-31  Miguel de Icaza  <miguel@novell.com>
469
470         * expression.cs: There might be errors reported during the
471         selection of applicable methods.  If there are errors, do not
472         continue execution as it will lead the compiler to crash.
473
474 2006-01-30  Miguel de Icaza  <miguel@novell.com>
475
476         * expression.cs: Member access is not allowed on anonymous
477         methods.  Fixes #77402.
478
479 2006-01-30  Raja R Harinath  <rharinath@novell.com>
480
481         Fix #77401
482         * cs-parser.jay (VariableDeclaration): Don't set
483         current_array_type to null.
484         (field_declaration, event_declaration, declaration_statement):
485         Set it to null here.
486
487 2006-01-29  Raja R Harinath  <harinath@gmail.com>
488
489         Fix part of #77397
490         * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
491
492 2006-01-28  Raja R Harinath  <harinath@gmail.com>
493
494         * typemanager.cs (GenericParameterPosition): New.
495         * doc.cs: Use it.
496
497 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
498
499         * doc.cs : To process "include" elements, first we should create
500           another list than XmlNodeList, because it could result in node
501           removal, which could result in that the XmlNodeList gives up
502           yielding next node.
503
504 2006-01-25  Miguel de Icaza  <miguel@novell.com>
505
506         * expression.cs: Introduce an error report that we were not
507         catching before.   Gonzalo ran into it.
508
509 2006-01-23  Miguel de Icaza  <miguel@novell.com>
510
511         A fix for bug: #76957
512         
513         * iterators.cs (MoveNextMethod.CreateMethodHost): call
514         ComputeMethodHost before creating the method, this is a new
515         requirement. 
516
517         * anonymous.cs (AnonymousContainer): Now we track all the scopes
518         that this method references (RegisterScope).  The actual scope
519         where the method is hosted is computed with the ComputeMethodHost
520         before we create the method.
521
522         Moved the Deepest routine here.
523
524         (AnonymousContainer.ComputeMethodHost): New routine used to
525         compute the proper ScopeInfo that will host the anonymous method.
526
527         (ScopeInfo): Deal with multiple roots.  The problem was that we
528         did not have a unique root where all ScopeInfos could be hanged
529         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
530         of roots.  
531
532         Remove AdjustMethodScope which is now computed at the end.  Remove
533         LinkScope which did a partial link, instead link all ScopeInfos
534         before code generation from the new "LinkScopes" routine. 
535
536         Simplify all the Add* routines as they no longer need to maintain
537         the tree, they just need to record that they are using variables
538         from a ScopeInfo.
539
540         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
541         routines to produce the forest of ScopeInfo trees.
542
543         * class.cs (TypeContainer.AppendMethod): This is just like
544         AddMethod, but ensures that an interface implementation method
545         (IEnumerable.XXX) is not inserted at the beginning of the queue of
546         methods, but at the end.
547
548         We use this functionality to ensure that the generated MoveNext
549         method in the iterator class is resolved/emitted before the
550         enumerator methods created.   
551
552         This is required because the MoveNext method computes the right
553         ScopeInfo for the method.  And the other methods will eventually
554         need to resolve and fetch information computed from the anonymous
555         method. 
556
557         
558 2006-01-23  Raja R Harinath  <rharinath@novell.com>
559
560         Improve implementation of section 14.4.2.2 (Better function member).
561         * expression.cs (Invocation.MoreSpecific): Compare all type
562         arguments before deciding if one type is more specific than
563         another.  Handle array types too.  Return the more specific type.
564         (Invocation.BetterFunction): Add more tie-breaking rules from
565         section 14.4.2.2.  Perform "more specific" check after
566         other tie-breaking rules.  Compare all parameter types before
567         choosing the "more specific" method.
568
569 2006-01-21  Raja R Harinath  <harinath@gmail.com>
570             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
571
572         Fix rest of #76995.
573         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
574         the 'aliases' hash.
575         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
576         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
577
578 2006-01-18  Martin Baulig  <martin@ximian.com>
579
580         * class.cs (TypeContainer.AddToMemberContainer): Use
581         `symbol.MemberName.MethodName' instead of just `symbol.Name';
582         fixes #77124.
583
584 2006-01-18  Martin Baulig  <martin@ximian.com>
585
586         Fix #76417: a generic class may now have methods which may unify
587         for some type parameter substitutions.
588
589         * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
590         for methods which may unify anymore.
591
592         * expression.cs (Invocation.MoreSpecific): New private static
593         method; checks whether one method is more specific than another
594         according to 14.4.2.2 of the spec.
595         (Invocation.BetterFunction): Implement the tie-breaking rules from
596         14.4.2.2 of the spec: if two methods unify for some type parameter
597         substitution, we need to pick the more specific one.
598
599 2006-01-18  Raja R Harinath  <rharinath@novell.com>
600
601         Fix #76656, cs0231-2.cs.
602         * cs-parser.jay (formal_parameter_list): Make error case catch
603         more issues.
604         (parenthesized_expression_0): Add CS1026 check.
605         (invocation_expression): Remove unused { $$ = lexer.Location }.
606
607 2006-01-17  Raja R Harinath  <rharinath@novell.com>
608
609         Fix #76824.
610         * cs-parser.jay (statement_expression): Don't list out the
611         individual statement-expressions.  Convert syntax error into
612         CS0201 check.
613
614 2006-01-16  Raja R Harinath  <rharinath@novell.com>
615
616         Fix #76874.
617         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
618         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
619         CheckIntermediateModification.
620         (FieldExpr.DoResolve): Add new two-argument version that
621         allows us to resolve the InstanceExpression as an lvalue.
622         The one-argument variant is now just a wrapper.
623         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
624         Resolve the lhs as an lvalue if the it has a value type.
625         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
626         from Assign.DoResolve.
627         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
628         resolved as an lvalue.
629         (PropertyExpr.DoResolve): Update.
630         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
631         has a value type.  Move CS1612 check here from
632         CheckIntermediateModification.
633         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
634         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
635         'right_side' of a ResolveLValue on an 'out' argument.
636         (EmptyExpression.LValueMemberAccess): New.  Used as the
637         'right_side' of a propagated ResolveLValue on a value type.
638         (LocalVariableReference.DoResolveBase): Recognize
639         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
640         Add CS1654 check.
641         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
642         EmptyExpression.Null.
643
644 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
645
646         * typemanager.cs : added IsGenericParameter(). In gmcs it returns
647           Type.IsGenericParameter(). Fixed bug #77183.
648         * doc.cs : it is now identical to doc.cs in mcs.
649
650 2006-01-16  Martin Baulig  <martin@ximian.com>
651
652         * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
653
654 2006-01-16  Martin Baulig  <martin@ximian.com>
655
656         * typemanager.cs (TypeManager.CSharpSignature): Make this work for
657         ctors; fixes #77250.
658
659 2006-01-12  Miguel de Icaza  <miguel@novell.com>
660
661         This fixes the problem where we used ldfld instead of ldflda to
662         load the "THIS" pointer on captured parameters, when THIS is a
663         value type.  See bug #77205.
664         
665         * iterators.cs (CapturedThisReference.Emit): Pass false to
666         EmitThis (we do not need the address).
667
668         * codegen.cs (EmitThis): it needs to know whether we need the
669         address of `this' or not.  This is used by value types.  
670
671         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
672         every other call passes false.
673
674 2006-01-12  Raja R Harinath  <rharinath@novell.com>
675
676         Fix #77221.
677         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
678         GetOverride.
679         * expression.cs (Invocation.OverloadResolve): Update.
680         (Invocation.DoResolve): Avoid double resolution of invocation.
681
682 2006-01-11  Raja R Harinath  <rharinath@novell.com>
683
684         Fix #77180.
685         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
686         unary negation of floating point types as 0-expr; negation cannot
687         overflow in floating point types.
688
689         Fix #77204.
690         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
691         on operands of 'void' type.
692
693         Fix #77200.
694         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
695         and ExclusiveOr for boolean constants too.
696
697 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
698
699         * expression.cs: Fix Console.WriteLine ((this = x).foo);
700
701 2006-01-12  Miguel de Icaza  <miguel@novell.com>
702
703         * cs-tokenizer.cs (Position): New class used to save and restore
704         the position state in the tokenizer.  Before this patch the save
705         and restore was not complete enough so the line and columns would
706         start to drift and the debugger and stack traces will get the
707         wrong data.
708
709 2006-01-10  Martin Baulig  <martin@ximian.com>
710
711         * generic.cs
712         (TypeParameter.InflateConstraints): New public method.
713
714         * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
715         constraints; fixes #77042.
716
717 2006-01-10  Martin Baulig  <martin@ximian.com>
718
719         * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
720         instead of the `TypeBuilder' for this "<>THIS" variable; fixes
721         #77061. 
722
723 2006-01-09  Raja R Harinath  <rharinath@novell.com>
724
725         Fix #75636.
726         * expression.cs (Invocation.OverloadResolve): Replace reflected
727         override methods with their base virtual methods, rather than
728         skipping over them.
729         * typemanager.cs (TypeManager.GetOverride): New.
730
731 2005-12-21  Miguel de Icaza  <miguel@novell.com>
732
733         * driver.cs: Report the case of no source files and no -out:
734         argument provided.
735
736 2005-12-20  Raja R Harinath  <rharinath@novell.com>
737
738         Fix #77035.
739         * expression.cs (ComposedCast.GetSignatureForError): Define.
740
741 2006-01-05  Jb Evain  <jbevain@gmail.com>
742
743         * class.cs (Property.Define, Indexer.Define): do not tag the
744         properties as SpecialName | RTSpecialName.
745
746 2006-01-04  Miguel de Icaza  <miguel@novell.com>
747
748         * class.cs (MethodCore.IsDuplicateImplementation): This method was
749         doing a low-level comparission of parameter types.  It was lacking
750         a check for __argslist. 
751
752 2005-12-30  Miguel de Icaza  <miguel@novell.com>
753
754         * expression.cs (ParameterReference.DoResolveBase): Allow
755         reference parameters if they are local to this block. 
756
757         This allows the ref and out parameters of a delegate to be used in
758         an anonymous method, for example:
759
760         delegate void set (out int x);
761
762         set s = delegate (out int x){
763                 x = 0;
764         };
765
766         This is used by functionality introduced late in the C# language.
767         
768         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
769         method that take ref and out parameters. 
770
771         Fixes #77119 which was a late change in the spec.
772
773 2005-12-23  Miguel de Icaza  <miguel@novell.com>
774
775         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
776         parent if its the same scope.  Fixes #77060.
777
778 2005-12-22  Marek Safar  <marek.safar@seznam.cz>
779
780         * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
781
782 2005-12-21  Carlos Alberto Cortez <calberto.cortez@gmail.com>
783
784         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
785         errors 1726 for strong named assemblies with InternalsVisibleToAttribute 
786         that doesn't contain the full public key. This is a update of the
787         friend assemblies in .Net 2.0 release.
788         
789 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
790
791         Fix #76995
792
793         * namespace.cs (NamespaceEntry): Add extern_aliases as a
794         ListDictionary, to contain the ExternAliasEntry entries (in
795         addition to the NamespaceEntry.aliases hashtable). This field is
796         shared between the original entry and its doppelganger (bodyless 
797         copy of it).
798         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
799         extern_aliases field.
800         (NamespaceEntry.Lookup): Move the IsImplicit check after the
801         lookup in extern_aliases.
802
803 2005-12-16  Raja R Harinath  <rharinath@novell.com>
804
805         Fix #77006.
806         * class.cs (TypeContainer.Mark_HasEquals): New.
807         (TypeContainer.Mark_HasGetHashCode): New.
808         (ClassPart): Override them.
809         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
810
811         * generic.cs (GenericMethod.DefineMembers): Update to changes.
812         (TypeParameter.TypeParameter): Change type of 'parent' argument to
813         DeclSpace.
814
815         Fix #77008.
816         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
817         'parent' argument to the base constructor.
818
819         Remove all mention of TypeContainer from decl.cs.
820         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
821         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
822         (DeclSpace.DeclSpace): Likewise.
823         (DeclSpace.DefineMembers): Remove unused argument.
824         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
825         debugging check -- we don't care if the debug code throws an
826         InvalidCastException instead of an InternalErrorException.
827         * class.cs (TypeContainer.DefineMembers): Update to changes.
828         (TypeContainer.DoDefineMembers): Likewise.
829         (TypeContainer.GetMethods): Likewise.
830         (PropertyMember.Define): Likewise.
831         (MemberBase.Parent): New property that forwards to
832         MemberCore.Parent, but ensures that we get a TypeContainer.
833         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
834         (RootContext.PopulateTypes): Likewise.  Remove special case code
835         for !RootContext.StdLib: DefineMembers is idempotent.
836
837 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
838
839         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
840
841 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
842
843         * doc.cs : The search for referenced namespace was insufficient to
844           get global one as it used to do. Fixed bug #76965.
845
846 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
847
848         * doc.cs : check name in cref in the last phase that whether it is
849           namespace or not.
850
851 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
852
853         * cs-tokenizer.cs : reverted the latest change: it somehow broke
854           Mono.C5.
855
856 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
857
858         * doc.cs : so it turned out that we cannot skip override check for 
859           interface members. Fixed bug #76954.
860
861 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
862
863         * cs-tokenizer.cs : fixed bug #75984:
864           - #warning and #error should not be handled when the source line
865             is disabled.
866           - #line is not checked strictly when the source line is disabled.
867           - #define and #undef is on the other hand checked strictly at any
868             state.
869
870 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
871
872         * cs-tokenizer.cs : missing Location (actually, filename) in one of
873           CS1027 report.
874
875 2005-12-15  Raja R Harinath  <rharinath@novell.com>
876
877         * generic.cs (TypeManager.IsGeneric): Remove unused method.
878
879         * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
880         nested types.
881
882 2005-12-14  Martin Baulig  <martin@ximian.com>
883
884         * typemanager.cs (TypeManager.GetFullName): Make this public;
885         `Type.Fullname' now never returns null.
886
887         * class.cs (Method.Define): Use TypeManager.GetFullName() for
888         explicit interface implementations; we're now using the same
889         naming convention than csc does.
890
891 2005-12-14  Miguel de Icaza  <miguel@novell.com>
892
893         * convert.cs (ExplicitConversionCore): Check the return value from
894         ExplicitConversionCore which can return null on failure.  Fixes #76914
895
896 2005-12-09  Raja R Harinath  <rharinath@novell.com>
897
898         * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
899         instead of IsGenericInstance.
900         * generic.cs (TypeManager.IsEqual): Likewise.  Delete redundant
901         code that's now covered by the more general test.
902         * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
903
904         * generic.cs (DropGenericTypeArguments): New.  Captures the common
905         pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
906         * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
907         * generic.cs, report.cs, typemanager.cs: Likewise.
908
909 2005-12-08  Martin Baulig  <martin@ximian.com>
910
911         * generic.cs (TypeArguments.Resolve): Added CS1547 check.
912
913         * typemanager.cs (TypeManager.CSharpSignature): Include type
914         arguments in the signature of a generic method.
915
916 2005-12-07  Martin Baulig  <martin@ximian.com>
917
918         Add support for custom attributes on type parameters.
919
920         * cs-parser.jay (type_arguments): Added `opt_attributes'.
921
922         * generic.cs (TypeParameterName): New public class; we use this
923         instead of a `string' to store the name of a type parameter, so we
924         can also have `Attributes'.
925         (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
926         array instead of a `string[]' array.
927         (TypeParameter.ctor): We now also take an `Attributes' argument.
928         (TypeParameter.EmitAttributes): New public method; emit our
929         `OptAttributes' here.
930         (GenericMethod.EmitAttributes): New public method; emit the custom
931         attributes on all our type parameters.
932
933         * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
934         our type parameters.
935         (MethodData.Define): If we're a generic method, call
936         EmitAttributes() on it.
937
938 2005-12-07  Martin Baulig  <martin@ximian.com>
939
940         * generic.cs
941         (ConstraintChecker): New public abstract class; move the
942         constraint checking here from `ConstructedType' and also do
943         constraint checking for generic methods here.
944
945         * expression.cs (Invocation.OverloadResolve): Use
946         ConstraintChecker.CheckConstraints() if we resolved to a generic
947         method.  Fix #76806.
948
949 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
950
951         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
952
953         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
954         event initializers.
955         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
956         (FieldBase.Initializer): Initializer is now optional.
957         (EventField.Define): Only event field can have initializer.
958
959         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
960
961         * const.cs (Const): Reuse initializer.
962
963         * cs-parser.jay: Updated after FieldBase changes.
964         Added current_array_type to simplify array initializers.
965
966         * ecore.cs (NullCast.IsDefaultValue): Implemented.
967
968         * expression.cs, iterators.cs: Updated.
969
970         * namespace.cs (NamespaceEntry): Made UsingFound private.
971
972 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
973
974         * parameterCollection.cs: Obsolete, removed.
975         * parser.cs: Obsolete, removed.
976
977 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
978
979         Fix #76849.
980         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
981
982         * enum.cs (Enum.Define): Set obsolete context here.
983
984 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
985
986         * doc.cs :
987           - FindDocumentedMember() now expects 1) paramList as null
988             when "we don't have to check the number of parameters" and
989             2) Type.EmptyTypes when "there is no arguments".
990           - Introduced FoundMember struct to hold the exact type which was
991             used to find the documented member (the above change broke
992             test-xml-044; it might be better just to use DeclaringType than
993             what MS does, like this change does, but it depends on usage.)
994
995 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
996
997         * doc.cs : documented member might be from DeclaringType for nested
998           types. Fixed bug #76782.
999
1000 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
1001
1002         * anonymous.cs: Have the param code handle leaving copies on the
1003         stack etc. Allows anonymous params to take part in the assignment
1004         code (++, +=, etc). Fixes bug #76550
1005
1006         * expression.cs: Handle the prepare_for_load/leave_copy by passing
1007         it down to the anon code.
1008
1009         * iterators.cs: Use dummy var here
1010
1011         * codegen.cs: Handle new vars
1012
1013 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1014
1015         Fix #76849.
1016         * class.cs (MethodData.Define): Set proper Obsolete context.
1017
1018         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1019         obsolete context.
1020         (FieldExpr.DoResolve): Ditto.
1021
1022 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1023
1024         Fix #76849.
1025         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1026         parent is not obsolete.
1027
1028 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
1029
1030         * doc.cs : (FindDocumentedMember) find parameterless members first
1031           and get CS0419 in the early stage. Fixed first case of bug #76727.
1032
1033 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
1034
1035         Fix #76859.
1036         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1037         no error was reported.
1038
1039         *expression.cs (Binary.DoResolve): left can be null.
1040
1041 2005-12-06  Raja R Harinath  <rharinath@novell.com>
1042
1043         * class.cs (MethodCore.CheckGenericOverride): Delete unused
1044         abstract method and all overrides.
1045         * support.cs (ParameterData.GenericConstraints): Delete.
1046         (ReflectionParameters.type_params): Delete.
1047         (ReflectionParameters.ReflectionParameters): Make private.
1048         (ReflectionParameters.GetConstaints): New factory method.
1049         * generic.cs (TypeParameterDefineType): Use it.
1050         (TypeManager.GetTypeParameterConstraints): Likewise.
1051
1052 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
1053
1054         Fix #76783.
1055         * class.cs (MethodData.Emit): Parameters should be labeled first.
1056
1057 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
1058
1059         Fix #76761.
1060         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1061
1062 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
1063
1064         * attribute.cs (AreParametersCompliant): Moved to Parameter.
1065
1066         * class.cs (MethodCore): Parameter clean up.
1067         (IMethodData): Added ParameterInfo.
1068         (MethodData): Parameter clean up.
1069         (Indexer.Define): Parameter clean up.
1070
1071         * anonymous.cs,
1072         * codegen.cs,
1073         * cs-parser.jay,
1074         * decl.cs,
1075         * doc.cs,
1076         * ecore.cs,
1077         * flowanalysis.cs,
1078         * iterators.cs,
1079         * pending.cs,
1080         * statement.cs,
1081         * typemanager.cs: Parameter clean up.
1082
1083         * delegate.cs (Define): Get rid of duplicated code.
1084
1085         * expression.cs (ParameterReference): Removed useless parameters
1086         and simplified.
1087         (Invocation): Ditto.
1088
1089         * parameter.cs (ParamsParameter): New class, params specialization.
1090         (ArglistParameter): Attemp to separate arglist.
1091         (Parameter): Refactored to be reusable and faster.
1092         (Parameter.Modifier): Made understandable.
1093         (Parameters): Changed to be used as a class for `this' assembly
1094         parameters. Refactored to use new specialized classes.
1095
1096         * support.cs (ParameterData): Added Types property.
1097         (InternalParameters): Deleted.
1098
1099 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1100
1101         * doc.cs : the previous patch does not actually fix the bug.
1102           PropertyInfo override check is now implemented and really fixed it.
1103         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
1104
1105 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1106
1107         * doc.cs : apply "override filter" also to properties.
1108           Fixed bug #76730.
1109
1110 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1111
1112         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
1113           no need to check overrides. For classes, omit those results from 
1114           interfaces since they must exist in the class. Fixed bug #76726.
1115
1116 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1117
1118         * typemanager.cs : (GetFullNameSignature) differentiate indexers
1119           with different parameters. Fixed the second problem in #76685.
1120
1121 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1122
1123         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
1124           get expected 'protected' access in CheckValidFamilyAccess()).
1125           Fixed bug #76692.
1126
1127 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1128
1129         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
1130           Fixed bug #76705.  CS1569 was incorrectly commented out.
1131
1132 2005-11-23  Martin Baulig  <martin@ximian.com>
1133
1134         * generic.cs (Constraints.Define): Removed.
1135         (TypeParameter.DefineConstraints): Removed.
1136         (TypeParameter.DefineType): Call SetGenericParameterAttributes()
1137         on the GenericTypeParameterBuilder here.
1138
1139 2005-11-23  Martin Baulig  <martin@ximian.com>
1140
1141         * typemanager.cs (TypeManager.GetProperty): Make this public.
1142
1143         * generic.cs (Nullable.NullableInfo.ctor): Use
1144         TypeManager.GetProperty() rather than using reflection directly.
1145
1146 2005-11-17  Martin Baulig  <martin@ximian.com>
1147
1148         * expression.cs (Indexers.GetIndexersForType): Added support for
1149         generic parameters; fixes #76587.
1150
1151 2005-11-17  Martin Baulig  <martin@ximian.com>
1152
1153         * anonymous.cs
1154         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
1155         inherit the scope from our parent.  Fixes #76653.
1156
1157 2005-11-15  Martin Baulig  <martin@ximian.com>
1158
1159         * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
1160         instead of `ScopeTypeBuilder' to refer to the "current" type.
1161         (AnonymousMethod.CreateScopeType): Correctly create the helper
1162         class if we're inside a generic type definition.
1163
1164 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1165
1166         * doc.cs : use Invocation.IsOverride() to do real override check.
1167         * expression.cs : made Invocation.IsOverride() internal.
1168
1169 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1170
1171         * doc.cs : use TypeManager.FindMembers() instead of (possible)
1172           TypeBuilder.FindMembers() and filter overriden base members out.
1173           Fixed bug #76990.
1174
1175 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1176
1177         * doc.cs : ref/out parameters are represented as '@' (instead of
1178           '&' in type FullName). Fixed bug #76630 (additionally crefs).
1179
1180 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1181
1182         * doc.cs : when there was no '.' in cref to methods in doc comment,
1183           then parameters were missing in the output. Fixed bug #76691.
1184
1185 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1186
1187         * driver.cs : don't output docs when there is an error.
1188           Fixed bug #76693.
1189
1190 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1191
1192         * doc.cs :
1193           Now it should detect indexers. Fixed primary concern in bug #76685.
1194           Fixed CS0419 message to not show the identical member signature in
1195           the message.
1196
1197 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1198
1199         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
1200           instead of Type.FindMembers() since it does not handle events.
1201           Fixed bug #71604.
1202
1203 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
1204
1205         * codegen.cs: Fixed typo (speficied -> specified).
1206
1207 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1208
1209         Fix #76369.
1210         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
1211
1212 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1213
1214         * attribute.cs: Changed error message.
1215
1216         * cs-tokenizer.cs: One more check.
1217
1218 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1219
1220         * statement.cs (Block.Resolve): Ignore empty statement.
1221
1222 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1223
1224         * report.cs: Made error/warning methods more strict to avoid
1225         their misuse.
1226
1227         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
1228         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
1229         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
1230         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
1231
1232 2005-11-11  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1233
1234         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): 
1235         Use the more explicit AssemblyName.FullName instead of 
1236         AssemblyName.Name to report errors.
1237         
1238 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1239
1240         * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
1241         with mcs.
1242
1243 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1244
1245         * class.cs,
1246         * convert.cs,
1247         * cs-parser.jay,
1248         * decl.cs,
1249         * enum.cs,
1250         * expression.cs,
1251         * generic.cs,
1252         * pending.cs,
1253         * report.cs: Fixed error reporting and typos.
1254
1255         * generic.cs (TypeParameter.GetSignatureForError): New method.
1256         (ConstructedType.GetSignatureForError): Instead of DeclarationName.
1257
1258         * typemanager.cs (GetFullName): Refactored.
1259
1260 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
1261
1262         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
1263         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
1264
1265         * class.cs (TypeContainer.IsComImport): New property.
1266         (Constructor.Define): Create proper ctor for ComImport types.
1267
1268         * expression.cs (New.CheckComImport): Fixed.
1269
1270 2005-11-07  Miguel de Icaza  <miguel@novell.com>
1271
1272         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
1273         that a parameter has been captured does not mean that we do not
1274         have to do the rest of the processing.  This fixes the second part
1275         of #76592.  If there was another anonymous method capturing
1276         values in the past, the Scope would never be set for the second
1277         method that captured the same parameter.
1278
1279         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
1280         properly manipulate the stack.   Second part of fix for #76592.
1281
1282         * expression.cs (New): Add support for invoking "new" on
1283         interfaces that have been flagged with the ComImport attribute and
1284         the CoClass.  Fixes #76637 
1285
1286         * statement.cs (Try.DoEmit): When a variable is captured, do not
1287         try to emit the vi.LocalBuilder variable as it has been captured.
1288         Create a temporary variable and store the results on the
1289         FieldBuilder.  Fixes #76642
1290
1291 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1292
1293         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
1294
1295         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
1296
1297         * expression.cs (Binary.DoResolve): Added && optimalization.
1298     
1299         * typemanager.cs (AddUserType): Removed useless argument.
1300
1301 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
1302
1303         * statement.cs (Block.variables): Uses ListDictionary.
1304
1305 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1306
1307         Fix #75969.
1308         * class.cs (PartialContainer.EmitType): Customized to emit
1309         security attributes.
1310         (ClassPart.ApplyAttributeBuilder): Transform security attribute
1311         for partial classes.
1312
1313 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1314
1315         Fix #76599.
1316         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
1317         access has to be fixed.
1318         
1319         * typemanager.cs (IsUnmanagedType): Wrong common field type.
1320
1321 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
1322
1323         Fix #76590.
1324         * ecore.cs (NullCast.Reduce): Implemented.
1325
1326         * expression.cs (ArrayCreation.CheckIndices): Correcly check
1327         constant type.
1328         
1329         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
1330         properly.
1331         (Foreach.Resolve): Catch null properly.
1332
1333 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1334  
1335         * cs-tokenizer.cs: Warning text fix.
1336
1337         * driver.cs: AllWarningNumbers exposed on public interface.
1338
1339         * report.cs (): Reviewed warning numbers.
1340         (IsValidWarning): Use binary search.
1341
1342 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1343  
1344         * driver.cs: Implemeted resource visibility.
1345         (Resources): New class for code sharing between /res: and
1346         /linkres:
1347  
1348 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1349
1350         decl.cs (CurrentTypeParameters): Fixed to be public.
1351
1352 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1353
1354         generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
1355
1356 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1357
1358         gmcs.exe.sources: Use CryptoConvert.cs from corlib.
1359
1360 2005-11-05  Kornél Pál  <kornelpal@hotmail.com>
1361
1362         * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
1363
1364 2005-11-04  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1365
1366         Add friend assembly access support.
1367         * typemanager.cs: assembly_internals_vis_attrs
1368         cache for friend assembly access. 
1369         (TypeManager.IsFriendAssembly): New method for
1370         checking friend assembly access.
1371         (TypeManager.Error_FriendAccessNameNotMatching): New
1372         helper method.
1373         (TypeManager.CompareKeyTokens): Likewise.
1374         (TypeManager.Filter): Handle friend accessible
1375         members.
1376
1377         * namespace.cs (RootNamespace.GetTypeInAssembly): Return
1378         friend accessible types.
1379
1380         * ecore.cs (Expression.IsAccessorAccessible): Handle
1381         friend accessible properties.
1382
1383         * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
1384         accessible types.
1385         
1386 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
1387
1388         Fix #76568.
1389         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
1390         folding.
1391         
1392         * convert (Convert.ImplicitReferenceConversion): NullCast holds
1393         contants only.
1394         
1395         * ecore.cs (NullCast): Child is contant only.
1396         
1397         * literal.cs (NullLiteral.Reduce): null can be converted to any
1398         reference type.
1399
1400 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
1401
1402         * driver.cs: Use Encoding.Default as default code page instead
1403           of ISO-28591.
1404
1405 2005-10-27  Raja R Harinath  <rharinath@novell.com>
1406
1407         Fix #76085.
1408         * expression.cs (Invocation.Error_InvalidArguments): Handle
1409         __arglist parameters.
1410         (Invocation.VerifyArgumentsCompat): Likewise.
1411         * support.cs (ReflectionParameters.GetSignatureForError): Print
1412         __arglist parameters.
1413         (InternalParamters.GetSignatureForError): Likewise.
1414         * parameter.cs (Parameters.GetSignatureForError): Likewise.
1415
1416 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
1417
1418         * attribute.cs (GetPropertyValue): Made public.
1419
1420         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
1421         Resolve.
1422         Add new property WrapNonExceptionThrows to handle 2.0 assembly
1423         attribute.
1424         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
1425         is not defined.
1426         
1427         * driver.cs: Reflect method name change.
1428         
1429         * statement.cs (Try.Resolve): Warn when try has both general
1430         exception handlers.
1431         
1432         * typemanager.cs: runtime_compatibility_attr_type new predefined
1433         type.
1434
1435 2005-10-26  Raja R Harinath  <harinath@gmail.com>
1436
1437         Fix #76419.
1438         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
1439         treat it as an empty parameter list.
1440
1441 2005-10-26  Raja R Harinath  <rharinath@novell.com>
1442
1443         Fix #76271.     
1444         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
1445         ResolveAsTypeStep silent.
1446         * statement.cs (Block.AddConstant): Mark block as used.
1447         (Block.ResolveMeta): Avoid piling on error messages
1448         if a constant initializer resolution fails.
1449
1450 2005-10-25  Raja R Harinath  <rharinath@novell.com>
1451
1452         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
1453         Remove.
1454         (NamespaceEntry.VerifyAllUsing): New.
1455         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
1456         behaviour.  Delegates actual resolution of alias to ...
1457         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
1458         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
1459         Update.
1460         * driver.cs (Driver.MainDriver): Update.
1461         
1462         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
1463         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
1464         property.
1465         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
1466         Remove.
1467         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
1468         RootNamespace.DefineNamespacesForAll.
1469
1470 2005-10-24  Raja R Harinath  <harinath@gmail.com>
1471
1472         * typemanager.cs (assemblies, external_aliases, modules)
1473         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
1474         (ComputeNamespaces, GetRootNamespace): Remove extra staging
1475         overhead.  Move resposibility ...
1476         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
1477         * driver.cs, attribute.cs, codegen.cs: Update to changes.
1478
1479 2005-10-23  Raja R Harinath  <harinath@gmail.com>
1480
1481         * namespace.cs (RootNamespace.all_namespaces): Renamed from
1482         cached_namespaces.  Improve usage.
1483         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
1484         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
1485         Move from GlobalRootNamespace and simplify.
1486         (RootNamespace.Global): Make instance variable.
1487         (RootNamespace.RootNamespace): Add "alias name" parameter.
1488         (GlobalRootNamespace): Simplify drastically.
1489         (Namespace.Lookup): Don't use GetNamespace.
1490         * typemanager.cs (GetRootNamespace): Rename from
1491         ComputeNamespaceForAlias.
1492         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
1493
1494 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1495
1496         * anonymous.cs (AnonymousContainer): Don't crash when container
1497         doesn't exist.
1498
1499 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1500
1501         * expression.cs (Binary.DoResolve): Warn when comparing same
1502         values.
1503
1504 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1505
1506         Fix #76486.
1507         * expression.cs (Binary.DoResolve): It looks like there are no
1508         convetsion rules in enum context.
1509
1510 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1511
1512         Add support for extern alias qualifiers.
1513         * typemanager.cs: Move some LookupTypeReflection code
1514         to namespace.cs, to have cleaner code. Added some methods
1515         to help us keep track of the extern aliased references.
1516         * driver.cs: Add suport for extern alias assemblies on command
1517         line and check for their warnings/errors. Also keep track of the
1518         extern aliased assemblies.
1519         * namespace.cs: Move the global functionality of Namespace
1520         to GlobalRootNamespace/RootNamespace. Now the global namespace
1521         is GlobalRootNamespace.Globa. Also the code moved from 
1522         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
1523         Finally added LocalAliasEntry (AliasEntry before) and
1524         ExternAliasEntry, to handle alias statements.
1525         * cs-parser.jay: Add support in the grammar for extern alias
1526         statement.
1527         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
1528         Update callings to Namespace (now in GlobalRootNamespace).
1529
1530 2005-10-25  Martin Baulig  <martin@ximian.com>
1531
1532         * convert.cs (ImplicitTypeParameterConversion): Make base
1533         interfaces actually work; fixes #76557.
1534
1535 2005-10-25  Martin Baulig  <martin@ximian.com>
1536
1537         * generic.cs
1538         (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
1539         all the type parameters; fixes #76551.
1540
1541 2005-10-25  Martin Baulig  <martin@ximian.com>
1542
1543         Fix #76472.
1544
1545         * generic.cs
1546         (GenericMethod.ctor): Added `Expression return_type' and
1547         `Parameters parameters' arguments.
1548         (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
1549         parameter and return types to check their constraints if they're
1550         generic types.
1551
1552         * codegen.cs (EmitContext.ResolvingGenericMethod): New public
1553         boolean field.
1554
1555         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
1556         constraints of a generic type if `ec.ResolvingGenericMethod'.
1557
1558         * class.cs (MethodCore.DoDefineParameters): Set
1559         `ec.ResolvingGenericMethod' if we're a generic method.
1560         (MemberBase.MemberType): Likewise.
1561
1562 2005-10-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1563
1564         * typemanager.cs (TypeManager): Added 
1565         TypeManager.internals_visible_attr_type to cache
1566         S.R.CompilerServices.InternalsVisibleToAttribute.
1567
1568         * codegen.cs (AssemblyClass): Added checks for 
1569         InternalsVisibleToAttribute in new method 
1570         CheckInternalsVisibleAttribute () and also cache the
1571         AssemblyName in AssemblyClass.Name.
1572         
1573 2005-10-24  Martin Baulig  <martin@ximian.com>
1574
1575         * typemanager.cs
1576         (TypeManager.ExpandInterfaces): Added overloaded version which
1577         just takes a `Type[]' array.
1578
1579         * generic.cs
1580         (Constraints.Resolve): Don't expand the interfaces here; ie. we
1581         just use the interfaces which were explicitly specified and not
1582         the interfaces they inherit.  Fixes #76482.
1583         (TypeParameter.FindMembers): Expand the interfaces here.
1584
1585 2005-10-21  Martin Baulig  <martin@ximian.com>
1586
1587         * generic.cs
1588         (Constraints.Resolve): Also resolve the actual types here.
1589         (Constraints.ResolveTypes): Just check the constraints here.
1590         Fixes #76363; see gtest-218.cs.
1591
1592 2005-10-21  Martin Baulig  <martin@ximian.com>
1593
1594         * convert.cs
1595         (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
1596         instead of a `BoxedCast'; fixes gtest-217.cs.
1597
1598 2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
1599
1600         * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
1601           1) "new()" is specified as generic parameter constraint and 2) the
1602           type is TypeBuilder and 3) the type is abstract even if it has a
1603           default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
1604
1605 2005-10-20  Martin Baulig  <martin@ximian.com>
1606
1607         * generic.cs
1608         (GenericConstraints.TypeParameter): New public property.
1609         (TypeParameter.ctor): Also take a `DeclSpace' argument.
1610         (TypeParameter.DeclSpace): New public property.
1611         (TypeParameter.DefineType): Inflate the constraints if our
1612         `DeclSpace' is an `Iterator'.   
1613
1614 2005-10-19  Atsushi Enomoto  <atsushi@ximian.com>
1615
1616         * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added 
1617           GenericMethod argument to compare methods' generic type arguments.
1618           Fixed bug #76382.
1619
1620 2005-10-19  Martin Baulig  <martin@ximian.com>
1621
1622         * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
1623         not ResolveType() when resolving the base type, so we're not
1624         checking the constraints here.
1625         (TypeContainer.ResolveType): Call ResolveType() on our base_type
1626         if we have any.
1627
1628 2005-10-19  Martin Baulig  <martin@ximian.com>
1629
1630         * generic.cs (ConstructedType.CheckConstraints): Committing
1631         untested fix for #76441.
1632
1633 2005-10-18  Raja R Harinath  <rharinath@novell.com>
1634
1635         Fix #76371.
1636         * class.cs (TypeContainer.DefineType): Move updating of
1637         topological sort earlier in the code.
1638         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
1639
1640 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
1641
1642         Fix #76273.
1643         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
1644         
1645         * constant.cs (Constant.TryReduce): Moved from Cast class.
1646         (Reduce): Made little bit more OO and fixed missing conversions.
1647         
1648         * ecore.cs (Reduce): Implemented.
1649         (Binary.EnumLiftUp): New method to upgrade values to enum values.
1650         
1651         * literal.cs (Reduce): Implemented.
1652         
1653         * class.cs: Reverted Miguel's wrong commit.
1654
1655 2005-10-14  Miguel de Icaza  <miguel@novell.com>
1656
1657         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
1658
1659 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
1660
1661         * cs-parser.jay, expression.cs : CS0214 was missing error location
1662           for constants. Fixed bug #76404.
1663
1664 2005-10-10  Raja R Harinath  <rharinath@novell.com>
1665
1666         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
1667         InstanceExpression.
1668         (PropertyExpr.EmitCall): Likewise.
1669         * expression.cs (Invocation.EmitArguments): Handle case where
1670         arguments == null.
1671         (Invocation.EmitCall): Avoid allocating temporary variable if
1672         there are no arguments.
1673
1674 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
1675
1676         Fix #76370.
1677         * convert.cs (ExplicitConversionCore): Fixed object->enum
1678         conversion.
1679
1680 2005-10-07  Raja R Harinath  <rharinath@novell.com>
1681
1682         Fix #76323.
1683         * convert.cs (ImplicitConversionStandard): Move conversion of
1684         void* to arbitrary pointer types ...
1685         (ExplicitConversionStandard): .. here.
1686         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
1687         error to always print typenames.
1688
1689 2005-10-07  Raja R Harinath  <rharinath@novell.com>
1690
1691         * convert.cs (GetConversionOperator): Rename from
1692         GetConversionOperators.  Move operator selection code from ...
1693         (UserDefinedConversion): ... here.
1694
1695 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
1696
1697         * convert.cs (ExplicitConversionCore): Removed duplicate enum
1698         conversion.
1699
1700 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
1701
1702         * assign.cs (Assign.DoResolve): Error method changed.
1703
1704         * cfold.cs (DoConstantNumericPromotions): Error method changed.
1705         
1706         * const.cs (ResolveValue): Reset in_transit immediately.
1707         
1708         * constant.cs: Error method changed.
1709         
1710         * convert.cs: Removed useless location parameter.
1711         (ExplicitNumericConversion): Don't do double enum check.
1712         (ExplicitConversionCore): Renamed from ExplicitConversion.
1713         (ExplicitUnsafe): Extracted from ExplicitConversion.
1714         (ExplicitConversion): Uses for error reporting.
1715         
1716         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
1717         error messages.
1718         (ResolveBoolean): Uses common error method.
1719         (CastToDecimal): Get rid of ec.
1720         (CastFromDecimal): Optimized.
1721         (ConvCast): Get rid of ec.
1722         
1723         * enum.cs (ResolveValue): Reset in_transit immediately.
1724         (Emit): Return after first error.
1725         
1726         * expression.cs: Convert changes.
1727         
1728         * literal.cs: Error method changed.
1729         
1730         * statement.cs: Error method changed.
1731
1732 2005-10-06  Raja R Harinath  <rharinath@novell.com>
1733
1734         Fix gtest-131.cs and gtest-211.cs.
1735         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
1736         Only emit code for a label if it is used.  Unreachable code can
1737         violate ECMA evaluation stack invariants.
1738
1739 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
1740
1741         * anonymous.cs: Implemented ExprClassName.
1742         
1743         * assign.cs (Assign.DoResolve): Don't chrash when type is not
1744         delegate.
1745         
1746         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
1747         check.
1748         
1749         * class.cs (StaticClass.DefineContainerMembers): Report protected
1750         members as error.
1751         
1752         * codegen.cs: if(ed) PRODUCTION.
1753         
1754         * convert.cs (Error_CannotImplicitConversion): Better error
1755         distinction.
1756         
1757         * cs-parser.jay: More error checks.
1758         
1759         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
1760         
1761         * driver.cs (CSCParseOption): Enabled wrong option check.
1762         
1763         * ecore.cs (Expression.ExprClassName): Turned to property.
1764         (MemberExpr.CheckIntermediateModification): For checking boxed
1765         value types     modification.
1766         
1767         * statement.cs (Fixed.Resolve): Expression type must be
1768         convertible to fixed type.
1769         (CollectionForeach.GetEnumeratorFilter,TryType):
1770         Small refactoring for easier error checking.
1771
1772 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
1773
1774         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
1775         attributes.
1776         
1777         * class.cs (GeneratedBaseInitializer): New class for customization
1778         compiler generated initializers.
1779         (MemberBase.DoDefine): Check Obsolete attribute here.
1780         (FieldMember.DoDefine): Ditto.
1781         
1782         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
1783         constants.
1784         
1785         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
1786         (MemberCore.GetObsoleteAttribute): Removed argument.
1787         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
1788         (MemberCore.CheckObsoleteType): New helper.
1789         
1790         * delegate.cs,
1791         * enum.cs,
1792         * statement.cs: Updates after MemberCore changes.
1793         
1794         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
1795         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
1796         
1797         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
1798         obsolete attribute for compiler construct.
1799         (As.DoResolve): Cache result.
1800         
1801         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
1802
1803 2005-10-01  Miguel de Icaza  <miguel@novell.com>
1804
1805         * expression.cs (Probe): instead of having a "Type probe_type"
1806         keep the extra information as a TypeExpr probe_type_expr since the
1807         "As" operator needs to perform some type checks.
1808
1809         * (As.DoResolve): If the type is a type parameter, ensure that it
1810         is constrained by a class.
1811
1812 2005-09-22  Miguel de Icaza  <miguel@novell.com>
1813
1814         * statement.cs (Lock): Use the TemporaryVariable class instead of
1815         manually using local variables as those do not work when variables
1816         are captured.
1817
1818         * ecore.cs: Moved the TemporaryVariable class from being a nested
1819         class inside Foreach to be a public class that can be employed in
1820         other places. 
1821
1822 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
1823
1824         * cs-parser.jay: interface_accessors replaced by
1825         accessor_declarations.
1826
1827         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
1828         location.
1829         
1830         * statement.cs (GotoCase.Resolve): Convert null constant to
1831         null case.
1832         (SwitchLabel.ResolveAndReduce): Ditto.
1833         (SwitchLabel.NullStringCase): Custom null stamp.
1834         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
1835         
1836         typemanager.cs (CSharpSignature): Don't skip first argument
1837         for full names.
1838
1839 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
1840
1841         * cfold.cs, constant.cs, convert.cs, ecore.cs,
1842         expression.cs, iterators.cs, literal.cs: Store constants and
1843         literals location.
1844         
1845         * class.cs (MemberBase.ShortName): Pass location.
1846         
1847         * cs-parser.jay: Some location fixes.
1848         
1849         * ecore.cs (Expression.Location): Made virtual.
1850
1851 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
1852
1853         Fix #72930.
1854         * const.cs (Const.ResolveValue): Check for assigning non-null
1855         value to reference type.
1856
1857 2005-09-26  Raja R Harinath  <rharinath@novell.com>
1858
1859         Fix #76133.
1860         * expression.cs (This.VerifyFixed): In a value type T, the type of
1861         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
1862         value type R, 'this' is treated as a value parameter.
1863
1864 2005-09-05  Miguel de Icaza  <miguel@novell.com>
1865
1866         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
1867         if the underlying types are the same, otherwise we need to produce
1868         code that will do the proper cast.
1869
1870         This was exposed by Marek's constant rewrite which produced
1871         invalid code for the call site:
1872
1873         enum X : long { a }
1874         void Method (X v) {}
1875
1876         Method ((X) 5)
1877
1878         This fixes test-49.cs
1879
1880 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
1881
1882         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
1883           Type/Object should be allowed as well. Fixed bug #75968.
1884
1885 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
1886
1887         * expression.cs : (Binary.DoResolve): when one is enum constant and
1888           another is constant 0, then return enum one *as enum type*.
1889           Fixed bug 74846.
1890
1891 2005-10-04  Martin Baulig  <martin@ximian.com>
1892
1893         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
1894         `SetMemberIsUsed()' work for generics, too.
1895
1896 2005-10-04  Martin Baulig  <martin@ximian.com>
1897
1898         * expression.cs (DelegateInvocation.EmitStatement): Make this work
1899         for corlib.  Fixes #75691.
1900
1901 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
1902
1903         Fix #76255.
1904         * driver.cs: Fix compilation files with full root path.
1905
1906 2005-09-25  Miguel de Icaza  <miguel@novell.com>
1907
1908         * report.cs (SymbolRelatedToPreviousError): Format the output so
1909         it does not use an open parenthesis that is never closed. 
1910
1911         * driver.cs: Follow coding guidelines
1912
1913 2005-09-18  Miguel de Icaza  <miguel@novell.com>
1914
1915         * driver.cs: Set InEmacs based on the environment variable EMACS. 
1916
1917         * location.cs (InEmacs): in this mode, do not report column
1918         location as it confuses Emacs.
1919
1920 2005-10-03  Raja R Harinath  <rharinath@novell.com>
1921
1922         * support.cs (SeekableStreamReader.Position): Don't error out when
1923         the requested position is just beyond the end of the current
1924         buffered data.
1925
1926 2005-09-28  Raja R Harinath  <rharinath@novell.com>
1927
1928         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
1929         try to keep in sync with the byte count of the underlying Stream.
1930         However, this limits us to a window size of 2048 characters: i.e.,
1931         the maximum lookahead of our lexer/parser can be 2048 characters.
1932
1933 2005-09-22  Martin Baulig  <martin@ximian.com>
1934
1935         * driver.cs: Removed a debugging FIXME.
1936
1937 2005-09-21  Raja R Harinath  <rharinath@novell.com>
1938
1939         * cs-parser.jay (type_arguments): Add CS1644 check.
1940         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
1941
1942 2005-09-15  Raja R Harinath  <rharinath@novell.com>
1943
1944         * Makefile (PROGRAM): Make profile specific.
1945         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
1946         the current directory.
1947
1948         Fix test-455.cs.
1949         * expression.cs (Invocation.EmitCall): Remove optimization on
1950         this_call since it doesn't handle 'this' being a value type.
1951
1952 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
1953
1954         * driver.cs: Ensure file handles are closed after parsing
1955
1956 2005-09-05  Miguel de Icaza  <miguel@novell.com>
1957
1958         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
1959         if the underlying types are the same, otherwise we need to produce
1960         code that will do the proper cast.
1961
1962         This was exposed by Marek's constant rewrite which produced
1963         invalid code for the call site:
1964
1965         enum X : long { a }
1966         void Method (X v) {}
1967
1968         Method ((X) 5)
1969
1970         This fixes test-49.cs
1971
1972 2005-09-05  Martin Baulig  <martin@ximian.com>
1973
1974         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
1975         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
1976
1977         * cs-parser.jay (delegate_declaration): Small fix for #75852.
1978
1979 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
1980
1981         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
1982           to be a pointer type due to the spec 25.2, so check if declaring
1983           type is generic type definition. Fixed bug #75772.
1984
1985 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
1986
1987         Fixed bug #75957.
1988         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
1989           both types are not defined by methods.
1990         * expression.cs : (Invocation.IsApplicable): it should work when
1991           the argument type is equal to the parameter type, not only when
1992           ImplicitConversionExists() returns true.
1993
1994 2005-09-02  Raja R Harinath  <rharinath@novell.com>
1995
1996         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
1997         internal.
1998
1999         Fix #75941.
2000         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2001         flow-branching for LocalVariableReferences in case we were invoked
2002         from a MemberAccess.
2003         * expression.cs (LocalVariableReference.VerifyAssigned): New.
2004         Carved out of ...
2005         (LocalVariableReference.DoResolveBase): ... this.
2006         (MemberAccess.Resolve): Do the check that was disabled during
2007         SimpleNameResolve.
2008
2009 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2010
2011         * class.cs :
2012           (PartialContainer.Create): check abstract/sealed/static strictly
2013           but abstract/sealed can exist only at one side. Fixed bug #75883.
2014
2015 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
2016
2017         Fix #75945.
2018         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2019         specified, don't default to UnmanagedType.I4.
2020
2021 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2022
2023         * expression.cs : conditional operator should check possibly
2024           incorrect assign expression. Fixed bug #75946.
2025
2026 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2027
2028         Fix #75934.
2029         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2030         (ScopeInfo.EmitScopeType): Use it to construct field names from
2031         names of captured locals.
2032
2033         Fix #75929.
2034         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2035         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2036         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
2037         (ExplicitConversion): Remove enum cases already handled by
2038         implicit conversion.  Move implicit conversion check to the beginning.
2039         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2040         * expression.cs (ArrayCreation.EmitDynamicInitializers):
2041         Don't treat System.Enum as a struct.
2042
2043 2005-08-30  Jb Evain  <jbevain@gmail.com>
2044
2045         * attribute.cs: handles as expression in parameters.
2046
2047 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2048
2049         Fix #75802.
2050         * class.cs (TypeContainer.VerifyClsName): Don't use a
2051         PartialContainer when verifying CLS compliance.
2052         (AbstractPropertyEventMethod): Set Parent here, ...
2053         (PropertyMethod): ... not here.
2054
2055 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
2056
2057         * attribute.cs : escaped attribute name should not be allowed to be
2058           resolved (e.g. @class as classAttribute). Fixed bug #75930.
2059
2060 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2061
2062         Fix #75927.
2063         * convert.cs (ImplicitStandardConversionExists): Allow zero also
2064         when converting a long constant to unsigned long.
2065         * expression.cs (Invocation.OverloadResolve): Add sanity check to
2066         detect where IsApplicable and VerifyArgumentsCompat disagree.
2067
2068 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2069         and Carlos Alberto Cortez  <carlos@unixmexico.org>
2070
2071         Fix #75848.
2072         * class.cs (TypeContainer.CanElideInitializer): New helper.
2073         (TypeContainer.EmitFieldInitializers): Use it to determine if we
2074         can safely emitting the initializer of a field.
2075
2076 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2077
2078         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2079           allowed inside a switch (without loop). Fixed bug #75433.
2080
2081 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
2082
2083         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2084         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2085
2086 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2087
2088         * driver.cs : kinda reverting the default encoding changes (not exact 
2089           revert since I noticed that "codepage:reset" might not work fine).
2090
2091 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2092
2093         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2094           Location. Now getter and setter store location correctly.
2095           (errors/cs0111-12.cs now reports the expected location.)
2096
2097 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2098
2099         * driver.cs : Use default encoding on the environment.
2100           Removed (now that) extra parameter for SeekableStreamReader.
2101         * support.cs : (SeekableStreamReader) third .ctor() argument for
2102           StreamReader is not required (always true). preamble size could
2103           be acquired in simpler and safe way.
2104
2105 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
2106
2107         * cs-parser.jay: report CS0642 at warning level 3
2108           and report CS0642 for an if else statement also
2109           fixes bug #74745. Patch by John Luke (and a bit
2110           modified by me).
2111           Removed extra CS0642 warning check for "while",
2112           "for" and "fixed".
2113         * statement.cs: In Block.Resolve(), CS0642 check
2114           is reimplemented to check a sequence of an empty
2115           statement and a block.
2116
2117           Both fix bug #66777.
2118
2119 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
2120
2121         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2122         detection until I fix it.
2123         
2124         * cs-tokenizer.cs: Changed error message.
2125         
2126         * cs-parser.jay: Fixed 2 error locations.
2127         
2128         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2129         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2130         properties.
2131         
2132         * enum.cs (GetSignatureForError): Fixed.
2133         
2134         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2135         method detection.
2136         
2137         * class.cs,
2138         * typemanager.cs (RegisterProperty): Removed.
2139         
2140         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2141
2142 2005-08-24  Raja R Harinath  <rharinath@novell.com>
2143
2144         Fix #75874.
2145         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2146         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2147
2148 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2149
2150         * expression.cs : tiny fix is required for not warning positive ulong.
2151           See test-441.cs.
2152
2153 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2154
2155         * expression.cs : add CS0652 check for constant and integral
2156           expression. Fixed bug #53974.
2157
2158 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2159
2160         * expression.cs : in DoNumericPromotions(), check if there is implicit
2161           conversion overload for string (to check CS0034). Fixed bug #52492.
2162
2163 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2164
2165         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2166
2167 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2168
2169         * ecore.cs : report location when it is *not* Null.
2170
2171 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2172
2173         * codegen.cs,
2174           ecore.cs,
2175           flowanalysis.cs,
2176           expression.cs:
2177           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2178           correctly. Fixed bug #75721.
2179
2180 2005-08-23  Raja R Harinath  <rharinath@novell.com>
2181
2182         * support.cs (SeekableStreamReader.Position): Avoid an expensive
2183         loop that performs 'min (pos, char_count)'.
2184
2185         Fix #75862.
2186         * expression.cs (Unary.ResolveOperator): Don't discard implicit
2187         converted value in Operator.OnesComplement.
2188
2189 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
2190
2191         * anonymous.cs: If the anon method is pulled into a helper class,
2192         it needs to be `internal' not `private'. Fixes runtime behavior on
2193         msft. bug #75704
2194
2195 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
2196
2197         Fix #75803
2198         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2199         is a partial class.
2200
2201 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
2202
2203         The big constants rewrite
2204         Fix #75746, #75685 and more
2205         As a side effect saved 1MB for MWF ;-)
2206         
2207         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
2208         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
2209         enum based for corlib compilation.
2210         
2211         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
2212         subtractions.
2213         
2214         * class.cs (FixedField.Define): Use ResolveAsConstant.
2215         
2216         * const.cs (IConstant): Interface constants and enums.
2217         (Const.ResolveValue): New method for constant resolvning.
2218         (ExternalConstant): Constants from imported assemblies.
2219         
2220         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
2221         conversion; like enums.
2222         (Constant.ToType): Converts this constant to different type.
2223         (Constant.Increment): Adds 1.
2224         
2225         * convert.cs (ImplicitConversionRequired): Simplified.
2226         
2227         * cs-parser.jay: Create EnumMember directly.
2228         
2229         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
2230         
2231         * doc.cs (GenerateEnumDocComment): Removed.
2232         
2233         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
2234         (ConvertIntLiteral): Removed.
2235         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
2236         
2237         * enum.cs (EnumMember): Implement IConstant.
2238         (Enum.IsValidEnumConstant): Removed.
2239         (Enum.GetNextDefaultValue): Removed.
2240         (Enum.FindMembers): Updated.
2241         (Enum.GenerateDocComment): Iterate enum members.
2242         
2243         * expression.cs (Cast.TryReduce): Handle enums correctly.
2244         (New.Constantify): Made public.
2245         (MemberAccess.DoResolve): Removed contant specific if(s).
2246         
2247         * literal.cs (NullLiteral): Implement new abstract methods.
2248         
2249         * statement.cs (GotoCase.Resolve): Use new constant methods.
2250         (SwitchLabel.ResolveAndReduce): Use new constant methods.
2251         
2252         * typemanager.cs (LookupEnum): Removed.
2253         (IsEnumType): Fixed to work with corlib.
2254         (RegisterConstant): Removed.
2255         (LookupConstant): Removed.
2256         (GetConstant): Changed to work with IConstant.
2257
2258 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
2259
2260         * location.cs : Fixed overflown (>255) column number.
2261
2262 2005-08-03  Raja R Harinath  <rharinath@novell.com>
2263
2264         First cut of the qualified-alias-member feature.
2265         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
2266         token.
2267         * cs-parser.jay (DOUBLE_COLON): New token.
2268         (namespace_or_type_name): Add rule for recognizing
2269         qualified-alias-members.
2270         (primary_expression): Likewise.
2271         (element_access): Allow QualifiedAliasMember as a possible
2272         type-bearing expression.
2273         (local_variable_type, local_variable_pointer_type): Likewise.
2274         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
2275         aliases in the current and enclosing namespace declarations.
2276         (NamespaceEntry.UsingAlias): Add CS0440 warning.
2277         * decl.cs (MemberName.is_double_colon): New.
2278         (MemberName.MemberName): Add new constructor for alias-member.
2279         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
2280         * expression.cs (QualifiedAliasMember): New expression type.
2281
2282 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2283
2284         * location.cs : it borked when no argument was specified.
2285
2286 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2287
2288         * location.cs : tiny ToString() format fix.
2289
2290 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2291
2292         * statement.cs : oops, it was missing.
2293
2294 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2295
2296         A set of fixes for precise line/column location.
2297
2298         * location.cs :
2299           "token" field now holds a file/line "delta", a line number offset 
2300           from the segment, and a column number. See also:
2301           http://lists.ximian.com/pipermail/mono-devel-list/2004-
2302           December/009508.html
2303           Removed static IsNull. Use instance IsNull property instead.
2304         * cs-tokenizer.cs :
2305           For some tokens it stores Location. For Identifier it stores
2306           LocatedToken which is a pair of string name and location.
2307           Column numbers are adjusted only at getChar().
2308         * report.cs :
2309           Use Location.ToString() for reporting (it now contains column).
2310         * cs-parser.jay :
2311           Largely modified to use LocatedToken instead of
2312           string (IDENTIFIER), and to acquire Location from some tokens.
2313         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2314           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2315           codegen.cs :
2316           Now MemberName holds Location. DeclSpace.ctor() receives Location
2317           as a parameter. Removed extra parameters to all derived classes.
2318           Replaced Location.IsNull() with instance property.
2319         * assign.cs, expression.cs :
2320           Added .ctor() overload that omits Location.
2321         * attribute.cs :
2322           Added "nameEscaped" flag that indicates the identifier was escaped
2323           in the source file. This fixes bug #57047.
2324
2325 2005-09-02  Martin Baulig  <martin@ximian.com>
2326
2327         * class.cs: Make CS3005 a warning, not an error.
2328
2329 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
2330
2331         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2332         New method, looking for lo-case imported cls type.
2333
2334         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2335         here.
2336
2337         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2338
2339         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2340
2341         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2342         all_imported_types.
2343         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2344
2345         Optimized to save 3.5 MB for SWF compilation.
2346
2347 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2348
2349         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
2350         (PartialContainer.Create): Moved logic AddToContainer.
2351         (PartialContainer.MarkForDuplicationCheck): Shares name.
2352         
2353         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
2354         place.
2355         
2356         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
2357         initialization.
2358         (Namespace.GetSignatureForError): New method.
2359         
2360         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
2361         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
2362
2363 2005-08-01  Raja R Harinath  <rharinath@novell.com>
2364
2365         Fix #75669.
2366         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
2367         member lookup rather than qualifier_type, since qualifier_type can
2368         be null.
2369
2370 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2371
2372         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
2373         enum member.
2374
2375 2005-07-31  Miguel de Icaza  <miguel@novell.com>
2376
2377         * statement.cs: Copy the local exception into the exception
2378         captured local.  Fixes 75674
2379
2380 2005-07-31  Raja R Harinath  <harinath@gmail.com>
2381
2382         Fix #75658.
2383         * expression.cs (Invocation.OverloadResolve): Don't report error
2384         CS1501 if error CS1502 has been reported.
2385         (New.DoResolve): Delegate CS1501 reporting to
2386         Invocation.OverloadResolve.
2387
2388         Fix #75656.
2389         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
2390         invariant-meaning-in-block property in an enclosing block if
2391         necessary.
2392
2393 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
2394
2395         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
2396         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
2397         (Switch.CheckSwitch): Just save 50kb for SWF.
2398
2399 2005-07-27  Martin Baulig  <martin@ximian.com>
2400
2401         * anonymous.cs (CaptureContext.AddField): Added
2402         `AnonymousContainer am' argument; compute its toplevel scope if
2403         it's not already computed.  Fixes #75649.
2404
2405 2005-07-26  Raja R Harinath  <rharinath@novell.com>
2406
2407         Fix #75628.
2408         * class.cs (Constructor.Emit): Reset block to null if the block
2409         resolve fails.
2410
2411 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
2412
2413         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
2414
2415 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
2416
2417         * class.cs (MethodData.Define): Check whether accessor implementing
2418         interface is public.
2419
2420         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
2421
2422 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
2423
2424         Fix #57245
2425         * namespace.cs (LookupType): Moved same type check to...
2426         
2427         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
2428         with the same name.
2429
2430 2005-07-21  Raja R Harinath  <rharinath@novell.com>
2431
2432         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
2433         already found a typebuilder.
2434         * class.cs (MethodCore.IsDuplicateImplementation): Compare
2435         MemberNames, not strings.
2436
2437         * const.cs (Error_ExpressionMustBeConst): 
2438         Rename from Error_EpressionMustBeConst.
2439         * const.cs, class.cs, statement.cd: Update.
2440
2441 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
2442
2443         Fix #65573
2444
2445         * const.cs (Const.LookupConstantValue): Report missing contant expression
2446         everytime.
2447         (Error_EpressionMustBeConstant): Only one error method.
2448
2449         * class.cs, statement.c: Updated.
2450
2451 2005-07-20  Raja R Harinath  <rharinath@novell.com>
2452
2453         * statement.cs (Block.Flags): Add back HasVarargs.
2454         (Block.flags): Make protected.
2455         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
2456
2457         * typemanager.cs (types, typecontainers, user_types): Remove.
2458         (UserTypes, TypeContainers): Likewise.
2459         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
2460         (CleanUp, Reset): Update.
2461         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
2462         (GetNestedType): Use Type.GetNestedType.
2463         (CoreLookupType): Take two arguments, the namespace and the
2464         basename of the type.  Update to use the Namespace.Lookup
2465         mechanism.
2466         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
2467         (RealMemberLookup): Use IsNestedChildOf instead of playing with
2468         string concatenation and substring matches.
2469         * class.cs, enum.cs, delegate.cs: Update to changes.
2470
2471 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
2472
2473         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
2474         Expression and made virtual.
2475
2476         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
2477         (ImplicitStandardConversionExists): Fixed `byte' typo ?
2478
2479         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
2480
2481         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
2482         error message.
2483
2484         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
2485         change.
2486
2487 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
2488
2489         Fix #57707
2490         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
2491         AssemblyCultureAttribute is not used on executable.
2492
2493         * rootcontext.cs,
2494         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
2495
2496 2005-07-16  Raja R Harinath  <rharinath@novell.com>
2497
2498         Fix #60638.
2499         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
2500         New.  Reports CS0252/CS0253.
2501         Mostly taken from preliminary patch by Duncak Mak.
2502         (Binary.DoResolveOperator): Store results of operator lookup.
2503         Use them to detect if we need to warn about unintended reference
2504         comparisons.
2505
2506 2005-07-15  Raja R Harinath  <rharinath@novell.com>
2507
2508         Fix #72969.
2509         * namespace.cs (Namespace.Lookup): Add back location parameter.
2510         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
2511         * delegate.cs, ecore.cs, expression.cs: Update to changes.
2512
2513         * codegen.cs (EmitContext.DeclSpace): Make readonly.
2514         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
2515         (Namespace.LookupType): ... this.
2516         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
2517         of namespaces.
2518         * typemanager.cs (LookupTypeReflection): Remove buggy code that
2519         purported to handle pointers.
2520         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
2521         CoreLookupType.
2522
2523 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
2524
2525         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2526         type as namespace.
2527
2528 2005-07-15  Raja R Harinath  <rharinath@novell.com>
2529
2530         * namespace.cs (Namespace.Lookup): Drop location parameter.
2531         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
2532         (NamespaceEntry.Lookup): ... this.
2533         (NamespaceEntry.Error_AmbiguousTypeReference):
2534         Move here from DeclSpace.
2535         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
2536         names ...
2537         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
2538         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
2539         Move to NamespaceEntry.
2540         * delegate.cs, expression.cs: Update to changes.
2541
2542 2005-08-31  Martin Baulig  <martin@ximian.com>
2543
2544         Committing a patch from Atsushi Enomoto for #75850.
2545
2546         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
2547         Prefer a generic enumerator over a non-generic one.
2548
2549 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
2550
2551         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2552         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2553
2554 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2555
2556         * driver.cs : reverting default encoding change as well as mcs.
2557
2558 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2559
2560         * driver.cs, support.cs : merged r48826.
2561           Marek Safer wrote:
2562           > could you integrate your mcs changes to gmcs otherwise
2563           > gmcs cannot compile some files.
2564
2565 2005-08-20  Martin Baulig  <martin@ximian.com>
2566
2567         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2568         scope if we don't already have it.
2569
2570         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2571         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2572         fixes #75867.
2573
2574 2005-07-31  Miguel de Icaza  <miguel@novell.com>
2575
2576         * statement.cs: Copy the local exception into the exception
2577         captured local.  Fixes 75674
2578
2579 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
2580
2581         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2582         type as namespace.
2583
2584 2005-08-12  Martin Baulig  <martin@ximian.com>
2585
2586         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
2587         for nested types here to avoid hitting the cache too early.
2588
2589 2005-08-09  Miguel de Icaza  <miguel@novell.com>
2590
2591         * enum.cs: On the new compiler CLS error 3005 is now a warning not
2592         an error. 
2593
2594 2005-08-03  Martin Baulig  <martin@ximian.com>
2595
2596         Make iterators in generic methods work; see gtest-191.cs.
2597
2598         * generic.cs
2599         (Constraints.Resolve): Protect against being called twice.
2600
2601         * class.cs
2602         (TypeContainer.GetClassBases): Make this `protected virtual'.
2603
2604         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
2605         (Iterator.GetClassBases): Override this and compute the base
2606         classes here.
2607         (Iterator.DefineNestedTypes): If we're a generic method, all our
2608         method type parameters become class type parameters on the proxy
2609         class.
2610
2611         * statement.cs
2612         (ToplevelBlock.Parameters): Make this a property, not a field.
2613         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
2614
2615 2005-08-03  Martin Baulig  <martin@ximian.com>
2616
2617         * typemanager.cs (TypeManager.IsSubclassOf): Use
2618         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
2619         (TypeManager.GetFullName_recursed): Improved.
2620
2621 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2622
2623         Fix #75417
2624         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
2625         Private accessor case, using TypeManager.IsPrivateAccessible instead of
2626         invocation_type == mi.DeclaringType, since the first one also checks
2627         other condition used by generic instances.
2628         
2629 2005-07-27  Martin Baulig  <martin@ximian.com>
2630
2631         * anonymous.cs (CaptureContext.AddField): Added
2632         `AnonymousContainer am' argument; compute its toplevel scope if
2633         it's not already computed.  Fixes #75649.
2634
2635 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
2636
2637         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
2638         CheckAttributeType and refactored.
2639         (Attribute.ResolvePossibleAttributeType): Changed to reuse
2640         ResolveAsTypeTerminal error handling.
2641         (ResolveAsTypeTerminal): Introduced because of global attributes extra
2642         handling.
2643         (GetSignatureForError): Print errors in same way.
2644
2645         * class.cs,
2646         * codegen.cs: Reflect attribute GetSignatureForError change.
2647
2648         * ecore.cs,
2649         * expression.cs: Add silent parameter to ResolveAsTypeStep.
2650
2651         * namespace.cs (UsingEntry): Refactored to make fields private.
2652
2653         * assign.cs,
2654         statement.cs: Error_UnexpectedKind has extra parameter.
2655
2656 2005-07-14  Raja R Harinath  <rharinath@novell.com>
2657
2658         * ecore.cs (IAlias): Remove.
2659         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
2660         that implement the interface.
2661         * namespace.cs (Namespace): Likewise.
2662         (Namespace.declspaces): Renamed from 'defined_names'.
2663         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
2664         DeclSpace instead of an IAlias.
2665         * tree.cs (Tree.AddDecl): Update.
2666
2667 2005-07-12  Raja R Harinath  <rharinath@novell.com>
2668
2669         * statement.cs (Block.Flags); Remove HasVarargs.
2670         (Block.HasVarargs): Move to ToplevelBlock.
2671         (Block.ThisVariable, Block.AddThisVariable): Likewise.
2672         (Block.Variables): Make protected.  Initialize variable hashtable
2673         if necessary.
2674         (Block.AddVariable): Update.
2675         (Block.Resolve): Update to changes.
2676         (ToplevelBlock.HasVarargs): New boolean.
2677         (ToplevelBlock.ThisVariable): Move here from Block.
2678         (ToplevelBlock.AddThisVariable): Likewise.
2679         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
2680         * expression.cs (This.ResolveBase): Update to changes.
2681         (ArglistAccess.DoResolve): Likewise.
2682
2683 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
2684
2685         Fix #75321
2686         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
2687
2688         * class.cs (TypeContainer.VerifyMembers): Distinguish between
2689         not used and not used & assigned.
2690         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
2691
2692 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
2693
2694         Fix #75053
2695         * expression.cs (Is.DoResolve): null is never provided type.
2696
2697 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
2698
2699         Fix #52496
2700         * cs-parser.jay: Less strict event error rule to catch more errors.
2701
2702 2005-07-11  Martin Baulig  <martin@ximian.com>
2703
2704         * generic.cs (ConstructedType.CheckConstraints): Improve the check
2705         for the constructor constraint: we do not only have to check
2706         whether the class has a public constructor, but also ensure that
2707         it's parameterless.  Fixes #75492.
2708
2709 2005-07-11  Martin Baulig  <martin@ximian.com>
2710
2711         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
2712         between type parameters if they either have the reference type
2713         constraint or the class constraint.
2714
2715 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
2716
2717         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
2718
2719 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
2720
2721         Fix #74975
2722         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
2723         (ExtractSecurityPermissionSet): Cope with self referencing security
2724         attributes properly.
2725
2726         * driver.cs (SetOutputFile): Made public property OutputFile.
2727
2728 2005-07-07  Raja R Harinath  <rharinath@novell.com>
2729
2730         Fix #75486.
2731         * class.cs (TypeContainer.first_nonstatic_field): Rename from
2732         has_nonstatic_fields.  Make into a FieldBase pointer.
2733         (TypeContainer.AddField): Add CS0282 check.
2734         (TypeContainer.EmitType): Update.
2735
2736 2005-07-06  Miguel de Icaza  <miguel@novell.com>
2737
2738         * cs-tokenizer.cs (consume_identifier): Do not create strings to
2739         compare if they start with __.
2740
2741 2005-07-06  Raja R Harinath  <rharinath@novell.com>
2742
2743         * statement.cs (Switch.SwitchGoverningType): Only look at
2744         UserCasts that don't need implicit standard conversions to one of
2745         the allowed switch types (Fixes test-322.cs).
2746         (LocalInfo.Resolve): Re-enable sanity-test.
2747
2748 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
2749
2750         * cs-tokenizer.cs (consume_identifier): Detect double undescores
2751         
2752         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
2753         
2754         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
2755
2756 2005-07-06  Raja R Harinath  <rharinath@novell.com>
2757
2758         Fix #75472.
2759         * ecore.cs (SimpleName.GetSignatureForError): Add.
2760         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
2761         (MemberAccess.GetSignatureForError): Add.
2762
2763 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
2764  
2765         The big error and warning messages review.
2766         
2767         * anonymous.cs,
2768         * assign.cs,
2769         * attribute.cs,
2770         * class.cs,
2771         * codegen.cs,
2772         * convert.cs,
2773         * cs-parser.jay,
2774         * cs-tokenizer.cs,
2775         * decl.cs,
2776         * delegate.cs,
2777         * doc.cs,
2778         * driver.cs,
2779         * ecore.cs,
2780         * enum.cs,
2781         * expression.cs,
2782         * flowanalysis.cs,
2783         * iterators.cs,
2784         * literal.cs,
2785         * location.cs,
2786         * modifiers.cs,
2787         * namespace.cs,
2788         * parameter.cs,
2789         * pending.cs,
2790         * report.cs,
2791         * rootcontext.cs,
2792         * statement.cs,
2793         * support.cs,
2794         * tree.cs,
2795         * typemanager.cs: Updated.
2796         
2797         * class.cs: (MethodCore.SetYields): Moved here to share.
2798         (PropertyMethod.Define): Moved iterator setup here.
2799         
2800         * iterators.cs: Add orig_method to have full access to parent
2801         container.
2802
2803 2005-07-05  Raja R Harinath  <rharinath@novell.com>
2804
2805         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
2806         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
2807         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
2808         variable of struct type.
2809         * expression.cs (Unary.ResolveOperator): Update to change.
2810         (Indirection.VerifyFixed): Likewise.
2811         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
2812         (ParameterReference.VerifyFixed): Value parameters are fixed.
2813         (This.VerifyFixed): Treat 'this' as a value parameter.
2814         * statement.cs (LocalInfo.IsFixed): Remove.
2815
2816 2005-07-01  Martin Baulig  <martin@ximian.com>
2817
2818         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
2819         `ec.EmitThis ()' to get the correct scope.
2820
2821 2005-07-01  Martin Baulig  <martin@ximian.com>
2822
2823         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
2824         instance is a ParameterReference; fixes #75299.
2825
2826 2005-06-30  Raja R Harinath  <rharinath@novell.com>
2827
2828         Fix #75412.
2829         * expression.cs (Indexers.map): Remove.
2830         (Indexers.Append): Filter out inaccessible setters and getters.
2831         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
2832
2833         Fix #75283.
2834         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
2835         Refactored from ...
2836         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
2837         (FieldExpr.Emit, PropertyExpr.Emit): Update.
2838         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
2839         * expression.cs (Invocation.EmitCall): Add CS0120 check.
2840
2841 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
2842
2843         Fix #75322
2844         * class.cs (FieldBase.GetInitializerExpression): One more field
2845         for backup.
2846
2847 2005-06-28  Miguel de Icaza  <miguel@novell.com>
2848
2849         * pending.cs: Do not define a proxy if the base method is virtual,
2850         it will be picked up by the runtime (bug 75270).
2851
2852 2005-07-08  Martin Baulig  <martin@ximian.com>
2853
2854         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
2855         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
2856
2857 2005-07-07  Martin Baulig  <martin@ximian.com>
2858
2859         * generic.cs (ConstructedType.CheckConstraint): Use
2860         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
2861         called recursively; fixes #75329.
2862
2863 2005-07-06  Martin Baulig  <martin@ximian.com>
2864
2865         * generic.cs (TypeManager.InferTypeArguments): Added support for
2866         anonymous methods; fixes #75461.
2867
2868 2005-07-01  Martin Baulig  <martin@ximian.com>
2869
2870         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
2871         `ec.EmitThis ()' to get the correct scope.
2872
2873 2005-07-01  Martin Baulig  <martin@ximian.com>
2874
2875         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
2876         instance is `This'; fixes #75299.
2877
2878 2005-06-30  Martin Baulig  <martin@ximian.com>
2879
2880         * class.cs (Indexer): Implement IIteratorContainer; added support
2881         for iterators in indexers.
2882
2883         * codegen.cs
2884         (EmitContext.CurrentIterator): Make this a property, not a field.
2885
2886         * anonymous.cs (AnonymousContainer.Iterator): New public property.
2887
2888 2005-06-28  Miguel de Icaza  <miguel@novell.com>
2889
2890         * pending.cs: Do not define a proxy if the base method is virtual,
2891         it will be picked up by the runtime (bug 75270).
2892
2893 2005-06-28  Martin Baulig  <martin@ximian.com>
2894
2895         * cs-parser.jay (interface_method_declaration): Avoid a
2896         reduce/reduce conflict by moving some of the code into a separate
2897         `interface_method_declaration_body' rule; fixes #75368.
2898
2899 2005-06-28  Martin Baulig  <martin@ximian.com>
2900
2901         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
2902         array check after the check for TypeBuilder's.
2903
2904 2005-06-21  Raja R Harinath  <rharinath@novell.com>
2905
2906         * convert.cs (FindMostEncompassedType): Add two trivial special
2907         cases (number_of_types == 0 || number_of_types == 1).
2908         (FindMostEncompasingType): Likewise.
2909
2910 2005-06-17  Raja R Harinath  <rharinath@novell.com>
2911
2912         Some cleanups preparing for the fix of #75283.
2913         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
2914         error testing.
2915         (EventExpr.InstanceResolve): Likewise.
2916         (EventExpr.DoResolve): Remove redundant checks.
2917
2918 2005-06-08  Miguel de Icaza  <miguel@novell.com>
2919
2920         * class.cs: Small fix.
2921
2922 2005-06-08  Raja R Harinath  <rharinath@novell.com>
2923
2924         Fix #75160.
2925         * class.cs (GetPartialBases): Fix return value check of
2926         part.GetClassBases.
2927
2928 2005-06-07  Raja R Harinath  <rharinath@novell.com>
2929
2930         Ensure that partial classes are registered in their enclosing
2931         namespace.  Initial part of fix of #75160.
2932         * tree.cs (Tree.RecordDecl): Add new namespace argument.
2933         Register declspace with namespace here, not in
2934         DeclSpace.RecordDecl.
2935         * cs-parser.jay: Pass namespace to RecordDecl.
2936         * class.cs (PartialContainer.Create): Likewise.
2937         (ClassPart.DefineType): New sanity-check.  Throws an exception if
2938         called.
2939         * decl.cs (Declspace.RecordDecl): Remove.
2940         * namespace.cs (NamespaceEntry.DefineName): Remove.
2941
2942 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
2943
2944         * rootcontext.cs: Reset TargetExt as well.
2945
2946 2005-06-03  Raja R Harinath  <rharinath@novell.com>
2947
2948         * ecore.cs (Expression.Resolve): Emit CS0654 error when
2949         -langversion:ISO-1.
2950
2951 2005-06-02  Raja R Harinath  <rharinath@novell.com>
2952
2953         Fix #75080, cs0119.cs.
2954         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
2955         of ...
2956         (Expression.Resolve): ... this.  Use it.  Remove bogus code
2957         allowing ExprClass.Type and ExprClass.Namespace for
2958         ResolveFlags.VariableOrValue.
2959         (Expression.Resolve) [1-argument variant]: Change default resolve
2960         flags based on language version.
2961         (Expression.Error_UnexpectedKind): Use a simple string array
2962         rather than an ArrayList.
2963         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
2964         not ExprClass.Type.
2965         (TypeOfVoid.DoResolve): Likewise.
2966         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
2967         flags argument -- it always has the same value.
2968
2969 2005-05-31  Raja R Harinath  <rharinath@novell.com>
2970
2971         Fix #75081.
2972         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
2973         Use it in the error message.
2974         * assign.cs, expression.cs, statement.cs: Update.
2975
2976 2005-05-30  Raja R Harinath  <rharinath@novell.com>
2977
2978         Fix #75088.
2979         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
2980         the "almostMatchedMember" case too.
2981         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
2982         that failed the accessibility checks to 'almost_match'.
2983
2984 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
2985
2986         * attribute.cs: Use internal MethodBuilder methods to set
2987         ExactSpelling and SetLastError on PInvoke methods, instead
2988         of passing them via charset.  Fixes #75060.
2989
2990 2005-05-27  Raja R Harinath  <rharinath@novell.com>
2991
2992         * parameter.cs (Parameter): Remove TODO comment.
2993         (Parameter.DefineParameter): Remove Location parameter.
2994         (Parameters.LabelParameters): Likewise.
2995         * class.cs (Constructor.Emit): Update to change.
2996         (MethodData.Emit): Likewise.
2997         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
2998         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
2999
3000 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
3001
3002         * parameter.cs,
3003           Removed Parameters.Location and added Parameter.Location instead.
3004           Removed Location parameter from Emit() and GetSignature().
3005         * anonymous.cs,
3006           class.cs,
3007           cs-parser.jay,
3008           delegate.cs,
3009           iterators.cs,
3010           statement.cs :
3011           Modified all related calls.
3012
3013 2005-06-21  Martin Baulig  <martin@ximian.com>
3014
3015         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
3016         left-hand side is not a nullable type; fixes #75328.
3017
3018 2005-06-21  Martin Baulig  <martin@ximian.com>
3019
3020         * typemanager.cs
3021         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
3022         (TypeManager.GetFullNameSignature): Likewise.
3023
3024         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
3025         `source.FullName' and `target.FullName' to check whether there are
3026         two conflicting definitions.
3027
3028 2005-06-21  Martin Baulig  <martin@ximian.com>
3029
3030         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
3031         a BoxedCast - also for reference types - to be compatible with csc.
3032
3033 2005-06-21  Martin Baulig  <martin@ximian.com>
3034
3035         * expression.cs (MemberAccess.DoResolve): Add support for nested
3036         types in a generic instance; fixes #75320.
3037
3038 2005-06-20  Martin Baulig  <martin@ximian.com>
3039
3040         * generic.cs (TypeManager.InferType): Also walk the class
3041         hierarchy for generic instances; fixes #75261.
3042
3043 2005-06-17  Martin Baulig  <martin@ximian.com>
3044
3045         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
3046         to make things work for corlib.
3047
3048 2005-06-15  Martin Baulig  <martin@ximian.com>
3049
3050         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
3051         obsolete `SecurityAction' values.
3052
3053 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3054
3055         * rootcontext.cs: Reset TargetExt as well.
3056         
3057 2005-06-09  Martin Baulig  <martin@ximian.com>
3058
3059         * delegate.cs (Delegate.VerifyMethod): Added
3060         `MethodGroupExpr old_mg' argument; inherit its
3061         `HasTypeParameters'; fix #75085.
3062
3063 2005-06-09  Martin Baulig  <martin@ximian.com>
3064
3065         * expression.cs (Invocation.OverloadResolve): Correctly handle
3066         generic methods for the SetMemberIsUsed(); fix #75064.
3067
3068 2005-06-09  Martin Baulig  <martin@ximian.com>
3069
3070         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
3071         fixes #75062.
3072
3073 2005-06-08  Martin Baulig  <martin@ximian.com>
3074
3075         * cs-parser.jay (nullable_type_or_conditional): If we put the
3076         nullable back and our `type' is a `ComposedCast', remove the
3077         nullable from it.  Fixes #75156.
3078
3079         * expression.cs (ComposedCast.RemoveNullable): New public method.
3080
3081 2005-06-08  Martin Baulig  <martin@ximian.com>
3082
3083         The big Iterators rewrite :-)
3084
3085         * iterators.cs: Rewrite this to use the anonymous methods framework.
3086
3087         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3088         before the TypeContainers; see 2test-21.cs.
3089
3090         * class.cs
3091         (TypeContainer.DefineType): Don't create a new EmitContext if we
3092         already have one (this only happens if we're an Iterator).
3093         (TypeContainer.Define): Also call Define() on all our iterators.
3094         (Method.CreateEmitContext): Added support for iterators.
3095
3096         * anonymous.cs
3097         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3098         (AnonymousContainer.CreateMethodHost): Moved here from
3099         AnonymousMethod and made abstract.
3100         (AnonymousContainer.CreateScopeType): New abstract method.
3101         (AnonymousContainer.IsIterator): New public property.
3102         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3103         get the ScopeTypeBuilder rather than manually defining it here. 
3104         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3105         iterators here.
3106
3107         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3108         before RootContext.DefineTypes().
3109
3110         * codegen.cs (EmitContext.RemapToProxy): Removed.
3111         (EmitContext.CurrentAnonymousMethod): Changed type from
3112         AnonymousMethod -> AnonymousContainer.
3113         (EmitContext.ResolveTopBlock): Protect from being called twice.
3114         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3115         (EmitContext.EmitThis): Removed the iterators hacks; use the
3116         anonymous methods framework for that.
3117
3118         * statement.cs
3119         (ToplevelBlock.Container): Make this a property, not a field.
3120         (ToplevelBlock.ReParent): New public method; move the
3121         ToplevelBlock into a new container.
3122         (Foreach.TemporaryVariable): Simplify.
3123
3124 2005-06-05  Martin Baulig  <martin@ximian.com>
3125
3126         * statement.cs (LocalInfo.CompilerGenerated): New flag.
3127         (Block.AddTemporaryVariable): New public method; creates a new
3128         `LocalInfo' for a temporary variable.
3129         (Block.EmitMeta): Create the LocalBuilders for all the temporary
3130         variables here.
3131         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3132         non-iterator variables.
3133
3134 2005-06-05  Martin Baulig  <martin@ximian.com>
3135
3136         * statement.cs (Foreach.TemporaryVariable): Create the
3137         LocalBuilder in the Emit phase and not in Resolve since in some
3138         situations, we don't have an ILGenerator during Resolve; see
3139         2test-19.cs for an example.
3140
3141 2005-06-04  Martin Baulig  <martin@ximian.com>
3142
3143         The big Foreach rewrite - Part II.
3144
3145         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3146         with `PropertyInfo ienumerator_getcurrent'.
3147
3148         * codegen.cs (VariableStorage): Removed.
3149
3150         * statement.cs
3151         (Foreach): Derive from Statement, not ExceptionStatement.
3152         (Foreach.CollectionForeach): New nested class.  Moved all the code
3153         dealing with collection foreach here.
3154         (Foreach.ForeachHelperMethods): Removed.
3155         (Foreach.TemporaryVariable): Implement IMemoryLocation.
3156
3157 2005-05-23  Martin Baulig  <martin@ximian.com>
3158
3159         * statement.cs (Try.DoResolve): Don't create a `finally' if we
3160         don't need to.  Fix #75014.
3161
3162 2005-05-26  Raja R Harinath  <rharinath@novell.com>
3163
3164         Improve user-defined conversion handling.
3165         * convert.cs (GetConversionOperators): Rewrite.  Return only the
3166         applicable operators.
3167         (AddConversionOperators): New.  Helper for GetConversionOperators.
3168         (FindMostEncompassedType, FindMostEncompassingType): Verify that
3169         there is only one most encompassed/encompassing type.
3170         (FindMostSpecificSource, FindMostSpecificTarget): Remove
3171         "applicable operator" handling.
3172         (UserConversion): Move cache here from GetConversionOperators.
3173         Directly cache the chosen operator, rather than the whole
3174         MethodGroup.
3175         (ExplicitNumericConversion): Fix buggy implementation of Decimal
3176         case.  Allow conversion of decimal to sbyte and byte too.
3177         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3178         New static methods.  Used to avoid allocating EmptyExpressions in
3179         convert.cs.
3180
3181 2005-05-24  Duncan Mak  <duncan@novell.com>
3182
3183         * ecore.cs (CastFromDecimal): New class for casting a decimal to
3184         another class, used in Convert.ExplicitNumericConversion.
3185         (CastToDecimal): New class, similar to above, but casts to
3186         System.Decimal, used in Convert.ImplicitNumericConversion and also
3187         in explicit convesion from double/float to decimal.
3188
3189         * convert.cs (ImplicitNumericConversion): Handle implicit
3190         conversions to System.Decimal.
3191         (ExplicitNumericConversion): handle explicit conversions to
3192         System.Decimal.
3193
3194         This fixes #68711.
3195         
3196 2005-05-20  Miguel de Icaza  <miguel@novell.com>
3197
3198         * typemanager.cs: Do not throw an exception in the TypeBuilder
3199         case, we take care of it on the TypeCode.
3200
3201 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
3202         
3203         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
3204         is back.
3205         
3206         * cs-parser.jay: Catch more lexical errors.
3207         
3208         * report.cs: Add one more Error method.
3209         
3210         * rootcontext.cs,
3211         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
3212
3213 2005-05-20  Martin Baulig  <martin@ximian.com>
3214
3215         * class.cs (TypeContainer.CircularDepException): Removed.
3216         (TypeContainer.DefineType): Removed the `InTransit' stuff.
3217         (TypeContainer.CheckRecursiveDefinition): Check for circular class
3218         (CS0146) and interface (CS0529) dependencies here.
3219
3220 2005-05-20  Martin Baulig  <martin@ximian.com>
3221
3222         * expression.cs (New.DoResolve): Move the CS0712 check above the
3223         CS0144 check; otherwise it can never be reached.
3224
3225 2005-05-20  Martin Baulig  <martin@ximian.com>
3226
3227         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
3228
3229 2005-05-20  Martin Baulig  <martin@ximian.com>
3230
3231         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
3232
3233         * typemanager.cs (TypeManager.IsAttributeType): New public method.
3234
3235 2005-05-19  Martin Baulig  <martin@ximian.com>
3236
3237         * delegate.cs
3238         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
3239         to disable error reporting.
3240
3241         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
3242         here since we don't want to report an error; see the new test-336.cs.
3243
3244 2005-05-19  Raja R Harinath  <rharinath@novell.com>
3245
3246         * statement.cs (ToplevelBlock.GetParameterReference)
3247         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
3248         Move here from class Block.
3249         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
3250         * expression.cs (ParameterReference.DoResolveBase): Likewise.
3251
3252 2005-05-18  Martin Baulig  <martin@ximian.com>
3253
3254         Fix #74978.
3255
3256         * flowanalysis.cs
3257         (FlowBranching.Reachability): Add non-static public And() and Or()
3258         methods.
3259         (FlowBranchingSwitch): New class; do the `break_origins' thing
3260         like in FlowBranchingLoop.
3261         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
3262         reachability, not just locals and parameters.
3263         (FlowBranching.MergeChild): Remove some of the hacks for loop and
3264         switch; MergeBreakOrigins() now takes care of that.
3265
3266 2005-05-18  Martin Baulig  <martin@ximian.com>
3267
3268         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3269         a loop and may leave it, reset the barrier; fixes #74974.
3270
3271 2005-05-16  Raja R Harinath  <rharinath@novell.com>
3272
3273         Fix test-382.cs.  Emit values of decimal constants.
3274         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3275         Carved out of ...
3276         (TypeContainer.AddField): ... this.
3277         (TypeContainer.EmitFieldInitializers): Allow the list of fields
3278         with initializers to include 'Const's.
3279         (ClassPart.RegisterFieldForInitialization): Forward to
3280         PartialContainer.
3281         * const.cs (Const.Const): Pass initializer to base class.
3282         (Const.Define): In case of decimal constants, register them for
3283         initialization in a static constructor.
3284
3285 2005-05-14  Martin Baulig  <martin@ximian.com>
3286
3287         * statement.cs (Block.Resolve): Correctly handle unreachable code;
3288         do not call ResolveUnreachable() on unreachable statements in
3289         here, see the comment in the source code.
3290
3291 2005-05-13  Raja R Harinath  <rharinath@novell.com>
3292
3293         Fix #74934.
3294         * expression.cs (BinaryResolveOperator): If one of the operands of
3295         an equality comparison is 'null' and the other is a pointer type,
3296         convert the null to a NullPointer.
3297         * convert.cs (ImplicitReferenceConversion): If the expression is a
3298         NullLiteral and the target type is a pointer type, return a
3299         NullPointer instead.
3300         (ImplicitConversionStandard): Likewise.
3301
3302 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
3303         
3304         * cs-parser.jay: Set readonly context based on special constructs.
3305         
3306         * expression.cs (LocalVariableReference.DoResolveBase): Improved
3307         readonly variable error handling.
3308         
3309         * rootcontext.cs (EmitCode): Don't verify members when error
3310         occurred.
3311         
3312         * statement.cs (LocalInfo): Add reaodnly context information.
3313         (SetReadOnlyContext, GetReadOnlyContext): New methods.
3314
3315 2005-05-17  Martin Baulig  <martin@ximian.com>
3316
3317         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3318         #70970. 
3319
3320 2005-05-13  Martin Baulig  <martin@ximian.com>
3321
3322         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
3323         handle unreachable blocks.
3324
3325 2005-05-13  Martin Baulig  <martin@ximian.com>
3326
3327         * class.cs
3328         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
3329         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
3330         #74905. 
3331
3332 2005-05-13  Martin Baulig  <martin@ximian.com>
3333
3334         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3335         instance variable, not a local.  Fix #74873.
3336         (Block.ResolveUnreachable): Set it to true here.
3337
3338 2005-05-12  Martin Baulig  <martin@ximian.com>
3339
3340         * cs-parser.jay (property_declaration): Pass the `current_class',
3341         not the `current_container' to Property's .ctor.  Fixes #74912.
3342
3343 2005-05-11  Martin Baulig  <martin@ximian.com>
3344
3345         * typemanager.cs (Closure): Copy this from MCS and merge all the
3346         GMCS-specific changes into it.
3347
3348 2005-05-12  Raja R Harinath  <harinath@gmail.com>
3349
3350         Fix #74920.
3351         * typemanager.cs (unmanaged_enclosing_types): New.
3352         (IsUnmanagedType): Avoid infloops by using
3353         'unmanaged_enclosing_types' to talk with recursive invocations.
3354
3355 2005-05-11  Duncan Mak  <duncan@novell.com>
3356
3357         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3358         continuing to process for 'arg'.
3359         (handle_preprocessing_directive): Check the argument of the #endif
3360         directive and report error CS1025 if there are any trailing
3361         characters.
3362
3363         According to the C# spec, having even whitespace after the #endif
3364         directive is illegal; however, because we call arg.TrimEnd ()
3365         beforehand, we have the same behavior as csc, allowing whitespace
3366         after the directive.
3367
3368         Fixes #74892.
3369
3370 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
3371
3372         Fix #74863.
3373         
3374         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3375         (Constructor.GetObsoleteAttribute): Implemented correctly.
3376
3377 2005-05-10  Martin Baulig  <martin@ximian.com>
3378
3379         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
3380         resolve the type; fixes #74864.
3381         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
3382         in DoResolve(); fixes #74862.
3383
3384 2005-05-10  Martin Baulig  <martin@ximian.com>
3385
3386         * support.cs (ReflectionParameters.ParameterModifier): Use
3387         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3388         and `ParameterAttributes.In'.  Fixes #74884.
3389
3390 2005-05-10  Martin Baulig  <martin@ximian.com>
3391
3392         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
3393         the cache if we're just looking for `MemberTypes.NestedType' in a
3394         generic instance.
3395
3396         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3397         constraints if we're still resolving the type tree.
3398         (Expression.MemberLookup): If we're resolving the type tree, only
3399         look for `MemberTypes.NestedType' since we're only interested in
3400         getting types.
3401
3402         * class.cs (TypeContainer.DefineType): Don't resolve the type
3403         parameters here; do this later in ResolveType() after the type
3404         tree has been resolved.
3405         (TypeContainer.ResolveType): New public method; this is called
3406         after the type tree is resolved and before the types are being
3407         populated.  We resolve the generic constraints here.
3408         (TypeContainer.DoDefineMember): Check the constraints on our base
3409         class and interfaces.
3410
3411         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
3412         set the `ResolvingTypeTree' flag on the EmitContext.
3413
3414         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
3415
3416 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
3417
3418         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3419         
3420         * expression.cs (Argument.GetParameterModifier): Turned to property.
3421         (Invocation.Error_InvalidArguments): Add more descriptive errors.
3422         
3423         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3424         its C# equivalent.
3425         
3426 2005-05-09  Raja R Harinath  <rharinath@novell.com>
3427
3428         Fix #74852.
3429         * decl.cs (MemberCache.AddMethods): Register override methods,
3430         rather than non-override methods.
3431         * typemanager.cs (RegisterOverride): New.
3432         (IsOverride): Update.
3433
3434 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3435
3436         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
3437
3438 2005-05-06  Martin Baulig  <martin@ximian.com>
3439
3440         * attribute.cs
3441         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
3442         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
3443
3444 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3445
3446         Fix #73105.
3447         
3448         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3449         recursive declaration.
3450         
3451         * statement.cs (Block.ResolveMeta): Report any error in resolving.
3452         
3453 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
3454
3455         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
3456         
3457         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
3458
3459 2005-05-05  Raja R Harinath  <rharinath@novell.com>
3460
3461         Fix #74797.
3462         * decl.cs (DeclSpace.FamilyAccessible): 
3463         Use TypeManager.IsNestedFamilyAccessible.
3464
3465         Fix reopened #64812.
3466         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
3467         internal'.
3468
3469 2005-05-04  Raja R Harinath  <rharinath@novell.com>
3470             Abin Thomas  <projectmonokochi@rediffmail.com>
3471             Anoob V E  <projectmonokochi@rediffmail.com>
3472             Harilal P R  <projectmonokochi@rediffmail.com>
3473
3474         Fix #64812.
3475         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
3476         allow access to all static members.
3477
3478 2005-05-04  Martin Baulig  <martin@ximian.com>
3479
3480         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
3481
3482 2005-05-04  Martin Baulig  <martin@ximian.com>
3483
3484         Fix #74655.
3485
3486         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
3487         section at the end; make things work if `default' is not the last
3488         section.        
3489
3490 2005-05-04  Martin Baulig  <martin@ximian.com>
3491
3492         Fix #70400.
3493
3494         * statement.cs (Switch): Replaced the `got_default' field with a
3495         `default_section' one.
3496         (Switch.CheckSwitch): Set `default_section' here.
3497         (Switch.Resolve): If we're a constant switch and the constant is
3498         not found, use the default section.
3499
3500 2005-05-03  Martin Baulig  <martin@ximian.com>
3501
3502         * expression.cs (ArrayAccess.EmitGetLength): New public method.
3503
3504         * statement.cs (Foreach.ArrayForeach): New nested class.
3505         (Foreach.TemporaryVariable): New nested class.
3506         (Foreach.EmitArrayForeach): Removed; this is now in the new
3507         ArrayForeach class.
3508
3509 2005-05-03  Raja R Harinath  <rharinath@novell.com>
3510
3511         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
3512         more conservative.
3513         (VerifyPendingMethods): Revert change below.
3514
3515         * typemanager.cs (IsOverride, RegisterNonOverride): New.
3516         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
3517         that used to trigger warning -28.  Remove warning -28.
3518         * expression.cs (Invocation.OverloadResolve): Use
3519         TypeManager.IsOverride to distinguish override methods.
3520
3521         Fix #74773.
3522         * pending.cs (VerifyPendingMethods): If a base type implements the
3523         requested interface, don't bother checking individual methods of
3524         the base type.  As a side-effect, this prevents the creation of
3525         unnecessary proxies.
3526
3527 2005-05-02  Martin Baulig  <martin@ximian.com>
3528
3529         Fix #70182.
3530
3531         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3532         Also `And' the locals if the old vector is null.
3533         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
3534         null; in this case we basically reset all the variables.        
3535
3536 2005-05-02  Martin Baulig  <martin@ximian.com>
3537
3538         Fix #74529.
3539
3540         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
3541         Added `FlowBranching branching' argument; always `and' the
3542         variables instead of `or'ing them unless we're an infinite loop.
3543
3544         * statement.cs (While.Resolve): Create a new sibling unless we're
3545         infinite.       
3546
3547 2005-05-02  Martin Baulig  <martin@ximian.com>
3548
3549         Fix #70140.
3550
3551         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
3552         arguments; use it instead of creating a new TopLevelBlock.
3553         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
3554         our ConstructorInitializer.
3555
3556         * statement.cs
3557         (TopLevelBlock.TopLevelBranching): New public property.
3558         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
3559         and create our `TopLevelBranching'.
3560
3561         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
3562         anonymous method host, use `block.TopLevelBranching' rather than
3563         creating a new branching.
3564
3565 2005-04-20  Miguel de Icaza  <miguel@novell.com>
3566
3567         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
3568         a ScopeInfo, if any of the current children is a child of the new
3569         entry, move those children there.
3570
3571 2005-04-30  Martin Baulig  <martin@ximian.com>
3572
3573         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
3574         at the beginning of a SwitchSection.  Fix #73335.
3575
3576 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
3577
3578         Fix #74378
3579         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
3580         
3581         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
3582         (FieldExpr.DoResolve): Obsolete members are ignored for field
3583         initializers.
3584         
3585 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
3586
3587         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
3588         of arrays detection.
3589
3590         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
3591         verification.
3592         (Field.VerifyClsCompliance): Volatile fields are not compliant.
3593
3594         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
3595         arrays report.
3596
3597 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
3598
3599         * cs-parser.jay: Use the prefered version of -unsafe in error
3600         message.
3601
3602 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
3603
3604         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
3605         circumstances.
3606
3607 2005-04-20  John Luke  <john.luke@gmail.com>
3608
3609         * driver.cs: fix typo in error message, --outout to --output
3610
3611 2005-04-30  Martin Baulig  <martin@ximian.com>
3612
3613         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
3614         handle the .NET 2.x security attributes.
3615
3616 2005-04-30  Martin Baulig  <martin@ximian.com>
3617
3618         * typemanager.cs
3619         (TypeManager.ExpandInterfaces): Don't add things twice.
3620
3621         * class.cs
3622         (TypeContainer.VerifyClsCompliance): Allow generic instances.
3623
3624 2005-04-29  Martin Baulig  <martin@ximian.com>
3625
3626         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
3627
3628         * anonymous.cs: Added support for anonymous generic methods.
3629
3630 2005-04-29  Martin Baulig  <martin@ximian.com>
3631
3632         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
3633         generic instances.
3634
3635 2005-04-29  Martin Baulig  <martin@ximian.com>
3636
3637         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
3638
3639         * expression.cs (New.DoResolve): Fix the CS0304 check.
3640
3641 2005-04-29  Martin Baulig  <martin@ximian.com>
3642
3643         * typemanager.cs (TypeManager.GetFullName): Updated to the new
3644         naming schema.
3645
3646         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
3647         explicit interface implementation, compare the interface types.
3648         (MethodData.Define): Use the new naming scheme from the latest
3649         .NET 2.x beta2.
3650         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
3651
3652         * decl.cs (MemberName.GetMemberName): Removed.
3653         (MemberName.MethodName, FullName): New properties.
3654
3655 2005-04-25  Raja R Harinath  <rharinath@novell.com>
3656
3657         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
3658
3659 2005-04-22  Martin Baulig  <martin@ximian.com>
3660
3661         * generic.cs (GenericMethod): Create the EmitContext in the
3662         `Define()'; in `Define(MethodBuilder)', create the type parameters
3663         before calling `Define()'.  Fixes #73933.
3664
3665 2005-04-22  Martin Baulig  <martin@ximian.com>
3666
3667         * generic.cs
3668         (Constraints.Resolve): Make things work wrt. the new type lookup system.
3669         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
3670
3671         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
3672         ConstructedType, check its constraints.
3673
3674 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
3675
3676         * codegen.cs (InRefOutArgumentResolving): New field.
3677         
3678         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
3679         fields outside contructor.
3680         
3681         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
3682         
3683 2005-04-19  Miguel de Icaza  <miguel@novell.com>
3684
3685         * anonymous.cs (CaptureContext.EmitParameterInstance): The
3686         parameter code was not completed ever, so it was not as up-to-date
3687         as local variables.  Must finish it.
3688
3689         The bug fix was to compare the Toplevel of the block, not the
3690         current block.  Thanks for Ben for pointing this out. 
3691
3692 2005-04-19  Raja R Harinath  <rharinath@novell.com>
3693
3694         * decl.cs (AddMethods): Use the declaring type of the problem
3695         method to determine if we want to squash a warning.
3696
3697 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
3698
3699         * attribute.cs: Removed debug output.
3700
3701         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
3702         
3703         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
3704         Report.Stderr.
3705         
3706 2005-04-18  Raja R Harinath  <rharinath@novell.com>
3707
3708         Fix #74481.
3709         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
3710         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
3711         all null comparisons against reference types.
3712
3713 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
3714
3715         Fix# 74565
3716         * class.cs (TypeContainer.CircularDepException) New nested
3717         exception class.
3718         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
3719         (TypeContainer.DefineType): Removed error, reset InTransit before
3720         exit.
3721         (Class.DefineType): Throw exception when is in Transit.
3722         Catch exception and report error.
3723         (Struct.DefineType): Throw exception when is in Transit.
3724         Catch exception and report error.
3725         (Interface.DefineType): Throw exception when is in Transit.
3726         Catch exception and report error.
3727
3728         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
3729         handle nested exception handlers.
3730
3731         * flowanalysis.cs (InTryWithCatch): New method, search for try with
3732         a catch.
3733
3734         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
3735         InFinally and InCatch storage.
3736
3737         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
3738         (Catch.Resolve): Set and Restore ec.InCatch.
3739         (Try.Resolve): Set and Restore ec.InFinally.
3740         (Try.HasCatch): True when try has catch.
3741
3742 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
3743
3744         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
3745           for the same event member, so exclude such cases from warning 419.
3746           Fixed bug #74633.
3747
3748 2005-04-16  Miguel de Icaza  <miguel@novell.com>
3749
3750         * expression.cs (Binary.ResolveOperator): Apply patch from John
3751         Luke to fix bug 59864: operators &, | and ^ on enumerations
3752         require that the same enum type on both sides.
3753
3754         * driver.cs: Add warnings to old flag usage, this is to assist
3755         people who produce Makefiles and hope that the Makefiles will be
3756         used on Windows.
3757
3758         * class.cs (TypeContainer.EmitType): Moved the definition of the
3759         special $PRIVATE$ field from the resolve phase to the Emit phase.
3760         During resolve we do not know if we are a struct with
3761         HasExplicitLayout, we know this only after the attributes for the
3762         type are emitted.
3763
3764         Set the FieldOffset to zero on the dummy field that we create for
3765         the class.   Fixes 74590.
3766
3767 2005-04-16  Raja R Harinath  <rharinath@novell.com>
3768
3769         Fix #73834.
3770         * ecore.cs (PropertyExpr.resolved): New.
3771         (DoResolve): Use it to handle a case of double resolution here.
3772         Handle a case of identical-name-and-type-name.
3773         * expression.cs (ArrayCreation.CheckIndices): Avoid double
3774         resolution by storing the results of expression resolution back
3775         into the "probes" array.
3776
3777 2005-04-15  Raja R Harinath  <rharinath@novell.com>
3778
3779         Fix cs0208-7.cs and cs0208-8.cs.
3780         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
3781         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
3782         error reporting to point out the reason a struct is not unmanaged.
3783
3784 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
3785
3786         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
3787           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
3788
3789 2005-04-13  Raja R Harinath  <rharinath@novell.com>
3790
3791         Fix #74528.
3792         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
3793         IdenticalNameAndTypeName here.
3794         (EventExpr.InstanceResolve): Likewise.
3795
3796 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
3797
3798         C# 2.0 DefaultCharSetAttribute implementation
3799         
3800         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
3801         which allows us to set GlobalNamespace for every resolve.
3802         (Attribute.ResolveArguments): Cut from Resolve.
3803         (Attribute.GetCharSetValue): Returns CharSet named argument.
3804         (Attribute.DefinePInvokeMethod): Gets default charset from
3805         module settings.
3806         (GlobalAttribute.ResolveAsTypeStep): Override.
3807         (GlobalAttribute.ResolveArguments): Override.
3808         
3809         * class.cs (TypeAttr): Is protected.
3810         
3811         * codegen.cs (ModuleClass.DefaultCharSet): New member.
3812         (ModuleClass.DefaultCharSetType): New memeber.
3813         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
3814         
3815         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
3816         charset from module.
3817         
3818         * delegate.cs (TypeAttr): Override.
3819         (Delegate.DefineType): Use this TypeAttr.
3820         
3821         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
3822         at very early stage (before types are defined) to resolve model
3823         module attributes. It will probably not work with corlib but it
3824         should be ok.
3825         
3826         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
3827         charset from module.
3828         
3829         * typemanager.cs (default_charset_type): New type.
3830
3831 2005-04-13  Raja R Harinath  <rharinath@novell.com>
3832
3833         * decl.cs (MemberCache.AddMethods): Don't warn if
3834         System.Object.Finalize has buggy MethodAttributes.
3835
3836         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
3837         removed below.
3838
3839 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
3840
3841         * doc.cs : detect ambiguous reference to overloaded members.
3842           Fixed bug #71603. MS 1.1 csc does not detect it.
3843
3844 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
3845
3846         * doc.cs : delegates must not be referenced with parameters.
3847           Fixed bug #71605.
3848
3849 2005-04-12  Miguel de Icaza  <miguel@novell.com>
3850
3851         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
3852
3853 2005-04-10  Miguel de Icaza  <miguel@novell.com>
3854
3855         * driver.cs (MainDriver): Stop processing if the CLS stage found
3856         errors. 
3857
3858         (CompilerCallableEntryPoint.InvokeCompiler): Always
3859         reset after execution;   Take a TextWriter argument for the
3860         output.
3861
3862         * report.cs: Use the error stream instead of hardcoding stderr. 
3863
3864 2005-04-09  Miguel de Icaza  <miguel@novell.com>
3865
3866         * class.cs: Reduce code paths to test, too small of an
3867         optimization to make it worth the extra testing.  Always perform
3868         it. 
3869
3870 2005-04-08  Raja R Harinath  <rharinath@novell.com>
3871
3872         Fix #74510.
3873         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
3874         operators that had errors reported on them.
3875
3876 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
3877
3878         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
3879         argument types.
3880         (Attribute.Resolve): Add named argument type checking.
3881         
3882         * class.cs (FixedField.Define): Use IsPrimitiveType
3883         
3884         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
3885         
3886         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
3887         unsafe parameter types.
3888         
3889         * statement.cs (Using.ResolveExpression): Add better error description.
3890         
3891         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
3892         
3893 2005-04-08  Raja R Harinath  <rharinath@novell.com>
3894
3895         Fix #74484.
3896         * attribute.cs (Attribute.GetAttributeUsage): Resolve
3897         AttributeUsageAttribute in the emitcontext of the attribute class,
3898         not in the emitcontext of the attributable entity it was attached to.
3899         * cs-parser.jay: Use 'current_class', not 'current_container',
3900         when creating a GlobalAttribute.
3901
3902 2005-04-08  Alp Toker  <alp@atoker.com>
3903
3904         * pending.cs: The fix to #58413 failed to compile methods implementing
3905         interfaces with/without params modifiers and vice versa, even though
3906         params modifiers aren't part of the signature. Make the modifier check
3907         less strict as in csc.
3908
3909 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
3910             Anoob V E  <projectmonokochi@rediffmail.com>
3911             Harilal P R  <projectmonokochi@rediffmail.com>
3912
3913         Fix #58413.
3914         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
3915         modifiers of pending methods.
3916         (PendingImplementation.PendingImplementation): Initialize it.
3917         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
3918         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
3919         with ParameterData.  Add check for modifiers.
3920         * class.cs (MethodData.Define): Update to changes.
3921
3922 2005-04-07  Raja R Harinath  <rharinath@novell.com>
3923
3924         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
3925
3926 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
3927
3928         * class.cs (PropertyMethod.Define): Check private accessor in abstract
3929         property.
3930         
3931         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
3932         
3933         * rootcontext.cs,
3934         * typemanager.cs: Registered RequiredAttributeAttribute.
3935         
3936 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
3937
3938         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
3939         Warning CS0169 is back at level 3.
3940         (IMethodData.SetMemberIsUsed): New method.
3941         
3942         * decl.cs (IsUsed): New value; moved from FieldBase.Status
3943         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
3944         
3945         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
3946
3947         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
3948         contants.
3949         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
3950         is used.
3951         
3952         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
3953         is used.
3954         
3955         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
3956         to avoid the problems with nested types.
3957
3958 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
3959             Anoob V.E  <projectmonokochi@rediffmail.com>
3960             Harilal P.R  <projectmonokochi@rediffmail.com>
3961             Raja R Harinath  <rharinath@novell.com>
3962
3963         Fix #73820.
3964         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
3965         attribute.
3966         * typemanager (GetConstructor): Make public.
3967
3968 2005-04-05  John Luke  <john.luke@gmail.com>
3969             Raja R Harinath  <rharinath@novell.com>
3970
3971         Fix #62232.
3972         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
3973         struct too.  Return false quicker in a few cases.
3974         (VerifyUnManaged): Use it.
3975
3976 2005-04-05  Raja R Harinath  <rharinath@novell.com>
3977
3978         Fix #74041.
3979         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
3980         not 'unreachable_seen'.
3981
3982 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
3983
3984         * attribute.cs (Attribute.GetValue): Removed unused.
3985         
3986         * codegen.cs (CodeGen.TrimExt): Removed unused.
3987         
3988         * cs-parser.jay (output): Removed unused.
3989         
3990         * cs-tokenizer.cs (hex_digits): Removed unused.
3991         
3992         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
3993         
3994         * expression.cs (Indirection.LoadExprValue): Removed unused.
3995         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
3996         
3997         * iterators.cs (Iterator.param_types): Removed unused.
3998         
3999         * statement.cs (Goto.block): Removed unused.
4000         (ToplevelBlock.did): Removed unused.
4001         (Switch.ResolveConstantSwitch): Removed unused.
4002
4003 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
4004
4005         * rootcontext.cs: Allow mcs to bootstrap with the compilation
4006         resetting thingy.
4007
4008 2005-04-19  Martin Baulig  <martin@ximian.com>
4009
4010         Merged r42462 from MCS and made it work for GMCS.
4011
4012         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
4013
4014         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
4015
4016 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4017
4018         Fix #74232 and cs0208-3.cs.
4019         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4020         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4021         unmanaged type.  Don't use FieldBuilders when 't' is a
4022         TypeBuilder.  Use ModFlags and MemberType fields.
4023         * class.cs (MemberBase.member_type): Rename from MemberType.
4024         (MemberBase.MemberType): New property.  Determines member_type on
4025         demand.
4026         (MemberBase.DoDefine): Don't initialize MemberType here.
4027         (FieldMember.Define): Likewise.
4028
4029 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
4030
4031         Fix #74241
4032         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4033         Attributes are emitted there.
4034         
4035 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4036
4037         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4038         keyword in 'partial enum' too.
4039         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4040         is not allowed).
4041         Report from Kamil Skalski <nazgul@omega.pl>.
4042
4043         Fix #74309.
4044         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4045         have partial containers too.
4046
4047         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4048         in block' checks to Block.CheckInvariantMeaningInBlock.
4049         * statement.cs (Block.GetKnownVariableInfo): Make private.
4050         (Block.IsVariableUsedInChildBlock): Remove.
4051         (Block.IsVariableUsedInBlock): Likewise.
4052         (Block.CheckInvariantMeaningInBlock): New.  Show location of
4053         conflicting declaration.
4054         (Block.AddVariable): Make error messages less long-winded and more
4055         specific.  Show location of conflicting declaration.
4056         * parameter.cs (Parameters.Location): New readonly property.
4057
4058 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4059
4060         Clean up semantics of invoking ResolveMemberAccess.
4061         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4062         can have an instance, ensure that we pass in a non-TypeExpression
4063         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
4064         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4065         argument.  Update to changes and simplify.
4066         (FieldExpr.Emitinstance): Remove CS0120 check.
4067         (PropertyExpr.EmitInstance): Likewise.
4068         * expression.cs (Argument.Resolve): Likewise.
4069         (Invocation.DoResolve): Update to changes in semantics of
4070         InstanceExpression.
4071
4072 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
4073
4074         Fix #74241
4075         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4076         customization.
4077         
4078         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4079
4080 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4081
4082         Fix difference in behaviour with commandline invocation.
4083         * driver.cs (Driver.Reset): New.
4084         (CompilerCallableEntryPoint): Call it.
4085
4086         * statement.cs (If.Resolve): Avoid spurious "uninitialized
4087         variable" warnings if the boolean expression failed to resolve.
4088
4089 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
4090
4091         * attribute.cs: Fix the union of several permissions when some of them
4092         are unrestricted (so the result isn't an unrestricted permission set).
4093         Fix #74036.
4094
4095 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4096
4097         * ecore.cs (MemberExpr): New class.  Convert from interface
4098         IMemberExpr.
4099         (MemberExpr.ResolveMemberAccess): Refactor and move here from
4100         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
4101         error checks.
4102         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4103         (MethodGroupExpr.IsExplicitImpl): Remove.
4104         (Expression.GetFieldFromEvent): Remove.
4105         (SimpleName.MemberStaticCheck): Remove.
4106         (SimpleName.DoSimpleNameResolve): Update to changes.
4107         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4108         (MemberAccess.IdenticalNameAndTypeName): Remove.
4109         (MemberAccess.error176): Move to MemberExpr.
4110         (MemberAccess.DoResolve): Update to changes.
4111         (BaseAccess.DoResolve): Likewise.
4112
4113 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
4114
4115         C# 2.0 Conditional attribute class implementation
4116         
4117         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4118         Analyzes class whether it has attribute which has ConditionalAttribute
4119         and its condition is not defined.
4120         
4121         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4122         (Class.IsExcluded): New method. Search for at least one defined
4123         condition in ConditionalAttribute of attribute class.
4124
4125 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4126
4127         * ecore.cs (PropertyExpr): Derive from Expression, not
4128         ExpressionStatement.
4129         (PropertyExpr.EmitStatement): Remove.
4130
4131 2005-03-29  Raja R Harinath  <rharinath@novell.com>
4132
4133         Fix #74060.
4134         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4135         internal field "value__" of an enum be private.  The examples for
4136         "value__" that I found on MSDN all used FieldAttributes.Private.
4137
4138         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4139         Don't mention IL method attribute names.
4140
4141         Fix #47991.  Remove a TODO.
4142         * statement.cs (Block.Toplevel): Make into a field.
4143         (Block.Parameters): Move into ToplevelBlock.
4144         (Block.known_variables): Rename from child_variable_names.
4145         (Block.Block): Remove variants that take Parameters.  Initialize
4146         'Toplevel' with the immediately surrounding toplevel block.
4147         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
4148         LocalInfo parameter.
4149         (Block.GetKnownVariableInfo): New.
4150         (Block.IsVariableNameUsedInChildBlock): Update.
4151         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
4152         the block, even though it may not be in scope.
4153         (Block.AddVariable): Remove Parameters parameter.  Use
4154         Toplevel.Parameters instead.
4155         (Block.AddConstant): Remove Parameters parameter.
4156         (Block.GetParameterReference): Update to use Toplevel.Parameters.
4157         (Block.IsParamaterReference): Likewise.
4158         (Block.IsLocalParameter): Likewise.  Simplify a lot.
4159         (ToplevelBlock.Parameters): New.  Moved from Block.
4160         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
4161         initialize Parameters to a non-null value.
4162         * cs-parser.jay: Update to changes.
4163         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4164         simple names that mean different things in the same block.  Use
4165         Block.IsVariableNameUsedInBlock.
4166
4167 2005-03-28  Raja R Harinath  <rharinath@novell.com>
4168
4169         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4170
4171 2005-03-26  Raja R Harinath  <harinath@acm.org>
4172
4173         Fix #73038.
4174         * assign.cs (Assign.DoResolve): When the RHS of an assignment
4175         fails to resolve, ensure that the LHS is still resolved as an
4176         lvalue.
4177
4178 2005-03-25  Raja R Harinath  <harinath@acm.org>
4179
4180         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4181         ec.ContainerType.
4182         (Enum.current_ec): Remove.
4183         (Enum.LookupEnumValue): Remove EmitContext argument.
4184         Just uses the one created during DefineType.
4185         (Enum.FindMembers): Update.
4186         * expression.cs (MemberAccess.DoResolve): Update.
4187
4188 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
4189
4190         * assign.cs (Assign.DoResolve): Check for CS1717 when
4191         source and target are same (uses Equals).
4192
4193         * expression.cs (LocalVariableReference, ParameterReference,
4194         This): Implemented Equals, GetHashCode.
4195
4196         * statement.cs (Block.GetParameterReference): Removed useless
4197         local variable.
4198
4199 2005-03-22  Raja R Harinath  <rharinath@novell.com>
4200
4201         Fix cs0128.cs
4202         * statement.cs (Block.AddVariable): Ensure that we skip implicit
4203         blocks before deciding whether the error is cs0136 or cs0128.
4204
4205         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4206         (using_alias_directive, using_namespace_directive): Pass
4207         MemberName, not an expression to Namespace.UsingAlias and
4208         Namespace.Using.
4209         (MakeName): Use the MemberName of the namespace.
4210         * namespace.cs (Namespace.MemberName): New.
4211         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4212         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4213         Likewise.
4214         * decl.cs (MemberName.Name): Make readonly.
4215         (MemberName.FromDotted): New "constructor".
4216         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4217         (MemberCore.Name): Compute from MemberName on demand.
4218         (MemberCore.SetMemberName): Provide a way to change the
4219         MemberName.
4220         (MemberCore.AddToContainer): Don't take a fullname parameter.
4221         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4222         fully qualified name of the container to the member name.
4223         (TypeContainer.AddToTypeContainer): Use a fully qualified name
4224         only if the type is a member of the root container.
4225         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4226         MemberName.Left rather than searching for an embedded ".".
4227         (PartialContainer.CreatePart): Update to changes in RootContext.
4228         (MemberBase.ShortName): Turn into a property.  Use
4229         MemberCore.SetMemberName.
4230         (MemberBase.ExplicitInterfaceName): Remove.
4231         (MemberBase.UpdateMemberName): Remove.
4232         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4233         (PropertyBase.SetMemberName): New override.
4234         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4235         (Tree.GetDecl): New.
4236         (Tree.AllDecls): Rename from Decls.
4237         * attribute.cs, enum.cs, report.cs: Update to changes.
4238         * driver.cs (MainDriver): Use MemberName.FromDotted on
4239         RootContext.MainClass.
4240
4241 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
4242
4243         * class.cs (FixedField.Define): Check for CS1664 and more sanity
4244         checks.
4245
4246         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4247
4248 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
4249
4250         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4251         property accessor modifiers.
4252
4253         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4254         fixed buffer attribute (CS1716).
4255         (PropertyMethod.HasCustomAccessModifier): When property accessor
4256         has custom modifier.
4257
4258         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4259         modifiers.
4260         (PropertyExpr.DoResolveLValue): Add CS0272.
4261
4262 2005-03-17  Miguel de Icaza  <miguel@novell.com>
4263
4264         * convert.cs: When converting to a pointer, use the proper Conv.U
4265         or Conv.I depending on the source data type.
4266
4267         * cs-tokenizer.cs: Make the size for large decimal constants,
4268         fixes #72957.
4269
4270 2005-03-17  Martin Baulig  <martin@ximian.com>
4271
4272         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4273         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
4274
4275 2005-03-17  Martin Baulig  <martin@ximian.com>
4276
4277         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4278         to bool so we can return an error condition.
4279         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4280         returned an error.
4281
4282 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
4283
4284         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4285         attributes.
4286
4287 2005-03-16  Raja R Harinath  <rharinath@novell.com>
4288
4289         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4290         Refactor to avoid traversing the list of assemblies, and to avoid
4291         string concatenation.
4292         * typemanager.cs (guid_attr_type): Remove.
4293         (negative_hits, pointers, references): Remove hashes.
4294         (type_hash): New.
4295         (GetConstructedType): New.  Uses type_hash to handle constructed
4296         types (arrays, references, pointers).
4297         (GetReferenceType, GetPointerType): Use it.
4298         (GetNestedType): New.  Uses type_hash to handle nested types of
4299         reflected types.
4300         (LookupType, LookupTypeDirect): Remove.
4301         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
4302         'types' hash and LookupTypeReflection directly.
4303         (params_string, params_object): Use GetConstructedType.
4304         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
4305         top-level types.
4306         (Namespace.Lookup): Use cached_types.
4307         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4308         provided by old TypeManager.LookupType.
4309         * rootcontext.cs (MakeFQN): Remove.
4310         * decl.cs (DeclSpace.MakeFQN): Likewise.
4311         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4312         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4313         TypeManager.GetConstructedType.
4314         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4315
4316 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
4317
4318         * cs-parser.jay: Fix build.
4319
4320 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
4321
4322         * class.cs (TypeContainer.CircularDepException) New nested
4323         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
4324
4325         * cs-parser.jay: Reports CS1527 for any namespace element.
4326
4327         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4328         Added CS0407.
4329
4330         * expression.cs (ParameterReference.IsAssigned): Changed error to
4331         CS0269.
4332         (Error_WrongNumArguments): Moved CS0245 detection here.
4333
4334         * statement.cs (Return.Resolve): Add CS1622 report.
4335
4336 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
4337
4338         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4339
4340 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
4341
4342         * attribute.cs expression.cs: Get rid of some allocations.
4343
4344 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
4345
4346         * doc.cs : just eliminate the latest change.
4347
4348 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4349
4350         * doc.cs : commented out the latest change. It breaks xml-030.cs
4351
4352 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4353
4354         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4355           fail. So invoke CreateType() in FindDocumentedType().
4356
4357 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4358
4359         * cs-tokenizer.cs : added IsKeyword().
4360         * doc.cs : Detect keyword incorrectly used as identifier.
4361           Allow identifiers prefixed by @.
4362
4363 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
4364
4365         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4366         It caused exception in namespace resolving (again!).
4367         
4368         * class.cs (Class.ctor): Removed exit.
4369         (PropertyMethod.ctor): ditto.
4370         
4371         * codegen.cs (Codegen.Reset): Reset static data.
4372         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4373         
4374         * cs-tokenizer.cs (Cleanup): Removed.
4375         
4376         * driver.cs (GetSystemDir): Rewrote to one line command.
4377         It caused problem with unloaded dynamic modules.
4378         (UnixParseOption): Removed Exit.
4379         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4380         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4381         Now can be mcs used as library.
4382         
4383         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4384         empty location.
4385         
4386         * location.cs (Reset): Reset static data.
4387         
4388         * namespace.cs (Reset): Reset static data.
4389         
4390         * report.cs (Report.Reset): Reset static data.
4391         
4392         * rootcontext.cs (RootContext.Reset): Reset static data.
4393         
4394         * tree.cs (RootTypes.ctor): Use Location.Null
4395         
4396         * typemanager.cs (TypeManager.Reset): Reset static data.
4397         (CoreLookupType): Removed Exit.
4398         (TypeHandle.Reset): Reset static data.
4399         
4400 2005-03-10  Raja R Harinath  <rharinath@novell.com>
4401
4402         Fix #73516.
4403         * typemanager.cs (ComputeNamespaces): Import namespaces from
4404         referenced modules too.
4405
4406 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4407
4408         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4409         than '.'.
4410
4411 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4412
4413         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4414         enclosing DeclSpace.  This ensures that a name-lookup populates
4415         more caches and there are fewer 'TypeExpression's.  Carve out
4416         nested type lookup into ...
4417         (LookupNestedTypeInHierarchy): ... this.
4418
4419 2005-04-15  Martin Baulig  <martin@ximian.com>
4420
4421         Merged r41590 from MCS and make it work in the generics land.
4422
4423         * generic.cs (TypeParameter.UpdateConstraints): Removed the
4424         `check' argument.
4425
4426         * class.cs (PartialContainer.UpdateConstraints): Removed.
4427         (PartialContainer.CheckConstraints): Removed.
4428         (PartialContainer.SetParameterInfo): Store the constraints here.
4429         (PartialContainer.DefineTypeParameters): New public method;
4430         resolve the type parameter's constraints here.  Note that the
4431         PartialContainer doesn't have an EmitContext anymore, so we must
4432         do this in the ClassPart.
4433
4434 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4435
4436         Clean up a few partial-class semantics.  
4437         Fixes test-357.cs and cs1618-2.cs.
4438         * cs-parser.jay (struct_declaration): Use 'current_class' as
4439         parent of newly-created struct.  Remove call to Register ().
4440         Use 'pop_current_class' to complete handing the current struct.
4441         (interface_declaration): Likewise.
4442         (class_declaration): Likewise.
4443         (enum_declaration): Use 'current_class' as parent of newly created
4444         enum.
4445         (delegate_declaration): Likewise.
4446         (pop_current_class): New function.  This is used to handle closing
4447         up the 'current_class' and 'current_container', and pointing them
4448         to the enclosing class/container.
4449         (CSharpParser): Initialize 'current_class' too.
4450         * decl.cs (MemberCore): Add check for invariant: a partial
4451         container is not a parsed entity, and thus does not enclose any
4452         parsed members.
4453         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4454         (DeclSpace.BaseTypeExpr): Use it.
4455         (DeclSpace.LookupType): Add check for invariant.
4456         * class.cs (TypeContainer): Add check for invariant: a nested
4457         class should have the same NamespaceEntry as its enclosing class.
4458         (TypeContainer.EmitFieldInitializers): Make virtual.
4459         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4460         MemberCore.
4461         (TypeContainer.Register): Remove.
4462         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4463         null.  Use TypeResolveEmitContext for resolving base types and
4464         interfaces.  Move initialization of Parts.TypeBuilder here from
4465         ...
4466         (TypeContainer.DefineNestedTypes): ... here.
4467         (PartialContainer): Take a Namespace not a NamespaceEntry.
4468         (PartialContainer.Create): Don't use Register.  Call the
4469         appropriate Add... function directly.
4470         (ClassPart): Take both the PartialContainer and the enclosing
4471         class as constructor arguments.
4472         (ClassPart.EmitFieldInitializers): Override.
4473         (ClassPart.PartFindNestedTypes): Remove.
4474         (FieldBase.GetInitializerExpression): Resolve the initializer
4475         expression in the emit context of the enclosing class.
4476         * tree.cs (RootTypes): Remove Register ().
4477         
4478 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
4479
4480         * cs-parser.jay: Removed CS0134.
4481         
4482         * driver.cs: Removed CS1901.
4483         
4484         * expression.cs (SizeOf.DoResolve): Don't report CS0233
4485         for predefined types.
4486
4487 2005-03-07  Duncan Mak  <duncan@novell.com>
4488
4489         * codegen.cs (Save):  Catch UnauthorizedAccessException as
4490         well. Fixes bug #73454.
4491
4492 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
4493
4494         * cs-tokenizer.cs (xtoken): Add CS1035.
4495         
4496         * class.cs (MethodData.Define): Add CS0683.
4497         (FieldMember.ctor): Add CS0681.
4498
4499 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4500
4501         * ecore.cs (SimpleName.DoResolve): Rename from
4502         SimpleName.DoResolveAllowStatic.
4503         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4504         Pass 'intermediate' flag to MemberStaticCheck.
4505         (SimpleName.MemberStaticCheck): Skip "static check" only in case
4506         of "intermediate" lookups via MemberAccess.
4507         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
4508         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4509
4510 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4511
4512         Fix #73394.
4513         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4514         slipped in because of variable names that are identical to a
4515         builtin type's BCL equivalent ('string String;', 'int Int32;').
4516         (PropertyExpr.EmitInstance): Likewise.
4517
4518 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
4519
4520         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4521         
4522         * report.cs (warning_ignore_table): Made public.
4523
4524 2005-03-04  Raja R Harinath  <rharinath@novell.com>
4525
4526         Fix #73282.
4527         * class.cs (MethodData.Emit): Pass 'container' to
4528         container.GetObsoleteAttribute instead of 'container.Parent'.
4529
4530 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
4531
4532         * cs-parser.jay: Add 1534 error test.
4533
4534         * iterators.cs (Yield.CheckContext): Add error 1629.
4535         (Iterator.ctor): Save unsafe modifier.
4536         (MoveNextMethod.DoEmit): Restore unsafe context.
4537
4538         * namespace.cs (UsingAlias): Better error message.
4539
4540 2005-03-03  Dan Winship  <danw@novell.com>
4541
4542         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
4543         the warning message [#73219]
4544
4545 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4546
4547         Fix compile with MCS 1.0.0.0.
4548         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
4549         w_restore to not depend on string constant folding.
4550
4551 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4552
4553         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
4554         CS0246 check to users who passed 'silent = false'.
4555         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
4556         check.
4557         (SimpleName.SimpleNameResolve): Update.
4558         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
4559         (MemberAccess.IdenticalNameAndTypeName): Update.
4560         * doc.cs (FindDocumentedTypeNonArray): Update.
4561
4562 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
4563
4564         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
4565         * parameters.cs (ComputeAndDefineParameters): Remove.
4566         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
4567         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
4568         Use GetParameterInfo.
4569
4570 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
4571
4572         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
4573
4574 2005-03-02  Raja R Harinath  <rharinath@novell.com>
4575
4576         Unify DeclSpace.LookupType and DeclSpace.FindType.
4577         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
4578         is in charge of defining nested types on demand.
4579         (DeclSpace.LookupType): Use it when the current_type is a
4580         TypeBuilder.  Use LookupTypeDirect for reflected types.
4581         (DeclSpace.FindType): Remove.
4582         (DeclSpace.LookupInterfaceOrClass): Likewise.
4583         (DeclSpace.DefineTypeAndParents): Likewise.
4584         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
4585         DeclSpace.LookupType.
4586         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
4587         * typemanager.cs (LookupType): Simplify.
4588         (AddUserType): Remove type from negative_hits.
4589         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
4590         * class.cs (TypeContainer.FindMembers): Move handling of nested
4591         types ...
4592         (TypeContainer.FindMembers_NestedTypes): ... here.
4593         (TypeContainer.FindNestedType): Implement override.
4594         (ClassPart.FindNestedType): Delegate to PartialContainer.
4595         (ClassPart.PartFindNestedType): Looks up the nested types of the
4596         part alone.
4597
4598 2005-04-14  Martin Baulig  <martin@ximian.com>
4599
4600         * generic.cs (ConstructedType): Moved all the type lookup and
4601         nested class logic into SimpleName.
4602         (ConstructedType.ResolveConstructedType): Our underlying type is
4603         already fully resolved; all the type lookup stuff is in
4604         SimpleName.
4605
4606         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
4607         constructed types here instead of in ConstructedType.
4608
4609         * decl.cs (MemberName.GetTypeExpression): Always create a
4610         SimpleName, not a ConstructedType.
4611         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
4612
4613 2005-03-02  Martin Baulig  <martin@ximian.com>
4614
4615         * class.cs (TypeContainer.DoDefineMembers): We also need a default
4616         static constructor in static classes.
4617
4618 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
4619
4620         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
4621         sizeParamIndex is not specified.
4622
4623 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
4624
4625         Fix #73117
4626         * report.cs (WarningMessage.IsEnabled): Missing null check.
4627
4628 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4629
4630         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
4631         in the fields and not in the properties.
4632
4633 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
4634
4635         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
4636         fields as well.
4637
4638 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4639
4640         * attribute.cs: Small refactoring (improved robustness).
4641         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
4642         (ValidateGuid): Removed.
4643         (Resolve): Removed referenced to above mentioned.
4644         (GetAttributeUsage): Made private and changed to work without
4645         class assistance.
4646         (GetIndexerAttributeValue): Don't crash.
4647         (GetConditionalAttributeValue): Ditto.
4648         (GetClsCompliantAttributeValue): Ditto.
4649         (ExtractSecurityPermissionSet): All attributes exceptions are
4650         error 648.
4651         (GetPropertyValue): New helper.
4652         (GetMethodImplOptions): New method.
4653         (DefinePInvokeMethod): Reuse common code. Implemented handling of
4654         some missing properties.
4655         
4656         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
4657         (Method.ApplyAttributeBuilder): Updated.
4658         
4659         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
4660         exception.
4661
4662 2005-02-28  Raja R Harinath  <rharinath@novell.com>
4663
4664         Fix #73052.
4665         * report.cs (Report.SymbolRelatedToPreviousError): Handle
4666         non-simple types (array, pointer, reference).
4667
4668 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4669
4670         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
4671
4672         * class.cs (MethodCore.IsDuplicateImplementation): Special error
4673         for operators.
4674         (Method.CheckBase): Catch wrong destructor here.
4675         (MethodData.Define): Add errors 550, 668.
4676
4677         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
4678
4679         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
4680
4681         * pending.cs (VerifyPendingMethods): Add error 551.
4682
4683         * typemanager.cs (CSharpName): Next error report helper.
4684
4685 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
4686
4687         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
4688         attributes. Removed useless attribute double check.
4689         It saves almost 2MBs for corlib.
4690
4691 2005-02-25  Raja R Harinath  <rharinath@novell.com>
4692
4693         Fix #72924.
4694         * statement.cs (ExpressionStatement.Resolve): Make robust to being
4695         called twice in case of error.
4696
4697 2005-02-23  Chris Toshok  <toshok@ximian.com>
4698
4699         Fix compiler portions of #72827.
4700         * statement.cs (Block.Emit): call Begin/EndScope on the
4701         EmitContext instead of the ILGenerator.
4702
4703         * codegen.cs (EmitContext.BeginScope): new method, call
4704         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
4705         we have one.)
4706         (EmitContext.BeginScope): same, but EndScope and CloseScope
4707
4708         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
4709         offset and call the superclass's OpenScope(int) with it.
4710         (SymbolWriter.CloseScope): get the current il
4711         offset and call superclass's CloseScope(int) with it.
4712
4713 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
4714
4715         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
4716         CS1677 for out and ref as well.
4717
4718         * class.cs (Method.Define): Add error CS1599 detection.
4719         
4720         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
4721         
4722         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
4723         
4724         * delegate.cs (Delegate.Define): Add error CS1599 detection.
4725         
4726         * support.cs.cs (ModifierDesc): New helper method.
4727
4728 2005-02-23  Raja R Harinath  <rharinath@novell.com>
4729             Abin Thomas  <projectmonokochi@rediffmail.com>
4730             Anoob V E  <projectmonokochi@rediffmail.com>
4731             Harilal P R  <projectmonokochi@rediffmail.com>
4732
4733         Fix #57851, #72718.
4734         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
4735         MemberLookup (used for error reporting) actually returns a result.
4736         Fix error report number (122, not 112).
4737
4738 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
4739             Anoob V E  <projectmonokochi@rediffmail.com>
4740             Harilal P R  <projectmonokochi@rediffmail.com>
4741
4742         Fix #71134.
4743         * pending.cs (PendingImplementation.GetAbstractMethods):
4744         Find NonPublic members too.
4745
4746 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
4747
4748         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
4749         Fixed error 217.
4750         
4751         * class.cs (MethodCore.CheckMethodAgainstBase):
4752         Add error 239 report.
4753
4754 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
4755
4756         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
4757         
4758         * class.cs (Operator.Define): Add error 217 report.
4759         
4760 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4761
4762         Fix #68955.
4763         * expression.cs (Invocation.IsApplicable): Make public.
4764         (Invocation.IsParamsMethodApplicable): Likewise.
4765         * delegate.cs (Delegate.VerifyApplicability): Don't use
4766         Invocation.VerifyArgumentCompat for parameter applicability
4767         testing.  Use Invocation.IsApplicable and
4768         Invocation.IsParamsMethodApplicable.
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         * namespace.cs (UsingEntry.Resolve): Undo change below.
4779
4780 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4781
4782         Fix #72756.
4783         * ecore.cs (Expression.MemberLookupFailed): Add argument to
4784         disable the error message when the extended MemberLookup also
4785         fails.
4786         (Expression.MemberLookupFinal): Update.
4787         (SimpleName.DoSimpleNameResolve): Update.
4788         * expression.cs (MemberAccess.ResolveNamespaceOrType):
4789         Don't use MemberLookupFinal.
4790         (New.DoResolve): Update.
4791         (BaseAccess.CommonResolve): Update.
4792
4793 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4794
4795         Fix #72732.
4796         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
4797         occured previously, don't resolve again.
4798
4799 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
4800
4801         Fix #69949
4802         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
4803         argument. Call ResolveAttributeUsage for unresolved.
4804         when types doesn't match ctor arguments.
4805         
4806         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
4807         for nested attribute classes.
4808         (Class.attribute_usage): Removed.
4809         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
4810         for attribute class.
4811         
4812         * ecore.cs (IsAttribute): Removed.
4813         
4814         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
4815         
4816         * rootcontext.cs (RegisterAttribute): Removed, attributes are
4817         now normal types.
4818         (attribute_types): Removed.
4819         (EmitCode): Global attributes are emited as the latest.
4820
4821 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
4822
4823         * class.cs (EmitFieldInitializers): Don't emit field initializer
4824         for default values when optimilization is on.
4825         
4826         * constant.cs (Constant.IsDefaultValue): New property.
4827         
4828         * driver.cs: Add /optimize handling.
4829         
4830         * constant.cs,
4831         * ecore.cs,
4832         * literal.cs: Implement new IsDefaultValue property.
4833         
4834         * rootcontext.cs (Optimize): New field, holds /optimize option.
4835
4836 2005-02-18  Raja R Harinath  <rharinath@novell.com>
4837
4838         Fix crasher in re-opened #72347.
4839         * namespace.cs (Namespace.Lookup): Return null if
4840         DeclSpace.DefineType returns null.
4841
4842         Fix #72678.
4843         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
4844
4845 2005-02-18  Raja R Harinath  <rharinath@novell.com>
4846
4847         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
4848         now returns null if it cannot resolve to an lvalue.
4849         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
4850         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
4851         returned null.  Remove check for SimpleName.
4852         (EventExpr.DoResolveLValue): New.
4853         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
4854         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
4855         error from ...
4856         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
4857         avoid CS0131 error.
4858         (Unary.ResolveOperator): Move CS0211 check ...
4859         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
4860         CS0131 error.
4861         (Unary.DoResolveLValue): Simplify.
4862         (AddressOf.DoResolveLValue): New.
4863         (ArrayAccess.DoResolveLValue): New.
4864
4865 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
4866
4867         * attribute.cs (Attribute.Resolve): Add arguments casting for
4868         when types doesn't match ctor arguments.
4869
4870 2005-02-16  Raja R Harinath  <rharinath@novell.com>
4871
4872         Fix parts of #63202.
4873         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
4874         lookup of operator in base type.  Ensure that all checks happen
4875         when the operator resolves to an "op_..." method.
4876
4877 2005-02-15  Raja R Harinath  <rharinath@novell.com>
4878
4879         Fix #71992.
4880         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
4881         'ignore_cs0104' parameter.  Pass it to ...
4882         (NamespaceEntry.Lookup): ... this.
4883         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
4884         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
4885         (TypeLookupExpression.DoResolveAsTypeStep): Update.
4886         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
4887         Update.  Request that cs0104 errors be ignored.
4888         (ComposedCast.ResolveAsTypeStep): Update.
4889
4890 2005-02-14  Raja R Harinath  <rharinath@novell.com>
4891
4892         Fix #59209.
4893         * expression.cs (Invocation.BetterFunction): Remove support for
4894         comparing virtual functions and their overrides.
4895         (Invocation.IsOverride): New.
4896         (Invocation.OverloadResolve): Don't consider 'override' functions
4897         during candidate selection.  Store them in a lookaside list.
4898         If the selected method is a 'virtual' function, use the list to
4899         find any overrides that are closer to the LHS type.
4900
4901 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
4902
4903         * expression.cs (New.DoResolve): Add complex core type reduction.
4904         (New.Constantify): Converts complex core type syntax like 'new int ()'
4905         to simple constant.
4906         
4907 2005-02-14  Raja R Harinath  <rharinath@novell.com>
4908
4909         * decl.cs (EntryType.EntryType): New constructor to create an
4910         updated copy of a cache entry.
4911         (MemberCache.AddMethods): Use it.
4912         (MemberCache.ClearDeclaredOnly): Remove.
4913         (MemberCache.MemberCache): Update.
4914
4915 2005-02-11  Miguel de Icaza  <miguel@novell.com>
4916
4917         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
4918         variable.  This one is represents the actual low-level declaration
4919         of the method, as opposed to the semantic level `IsStatic'.   
4920
4921         An anonymous method which is hosted into a static method might be
4922         actually an instance method.  IsStatic would reflect the
4923         container, while MethodIsStatic represents the actual code
4924         generated.
4925
4926         * expression.cs (ParameterReference): Use the new MethodIsStatic
4927         instead of IsStatic.
4928
4929         * anonymous.cs (AnonymousMethod.Compatible): Pass the
4930         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
4931         set on the current EmitContext. 
4932
4933         * expression.cs (Cast): Overload DoResolveLValue so we can pass
4934         resolve our casted expression as an LValue.  This triggers the
4935         proper LValue processing that is later required by Assign.
4936
4937         This fixes 72347.
4938
4939         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
4940
4941 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
4942
4943         C# 2.0 Fixed buffer implementation
4944
4945         * anonymous.cs: Update after RegisterHelperClass renaming.
4946
4947         * attribute.cs (AttributeTester.fixed_buffer_cache):
4948         Cache of external fixed buffers.
4949         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
4950         implementation if field is fixed buffer else null.
4951
4952         * class.cs
4953         (TypeContainer.AddField): Accept FieldMember instead of Field.
4954         (FieldBase.IsFieldClsCompliant): Extracted code from
4955         VerifyClsCompliance descendant customization.
4956         (FixedField): New class handles fixed buffer fields.
4957         (FixedFieldExternal): Keeps information about imported fixed
4958         buffer.
4959         (IFixedField): Make access to internal or external fixed buffer
4960         same.
4961
4962         * cs-parser.jay: Add fixed buffer parsing.
4963
4964         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
4965         buffer.
4966
4967         * expression.cs (Indirection): Extended implementation to accept
4968         fixed buffer field.
4969         (PointerArithmetic.Emit): Get element from fixed buffer as well.
4970         (ElementAccess.MakePointerAccess): Get type as parameter.
4971         (DoResolve): Add fixed buffer field expression conversion.
4972         (DoResolveLValue): Ditto.
4973         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
4974         (ArrayPtr): Derives from FixedBufferPtr.
4975         (ArrayPtr.Emit): Add extra emit for array elements.
4976
4977         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
4978
4979         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
4980         for compiler generated types.
4981         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
4982
4983         * statement.cs (Fixed): Refactored to be easier add fixed buffer
4984         and consume less memory.
4985         (Fixed.Resolve): Add fixed buffer case.
4986
4987         * typemanager.cs (compiler_generated_attr_ctor,
4988         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
4989         (HasElementType): Add our own implementation to work on every
4990         runtime.
4991
4992 2005-02-11  Miguel de Icaza  <miguel@novell.com>
4993
4994         * anonymous.cs (CaptureContext): Track whether `this' has been
4995         referenced.   
4996
4997         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
4998         only captured `this' if it was implicitly done (instance
4999         methods/variables were used). 
5000
5001         * codegen.cs (EmitContext.CaptureThis): New method to flag that
5002         `this' must be captured.
5003
5004 2005-01-30  Miguel de Icaza  <miguel@novell.com>
5005  
5006         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5007         is null it means that there has been no need to capture anything,
5008         so we just create a sibling.
5009
5010         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5011
5012         Just a partial fix.  The other half is fairly elusive.
5013         
5014 2005-02-10  Raja R Harinath  <rharinath@novell.com>
5015
5016         Fix #52586, cs0121-4.cs.
5017         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
5018         and return a hashtable.
5019         (MemberCache.ClearDeclaredOnly): New.
5020         (MemberCache.MemberCache): Update to change.  Make a deep copy of
5021         the method_hash of a base type too.
5022         (MemberCache.AddMethods): Adapt to having a deep copy of the base
5023         type methods.  Overwrite entries with the same MethodHandle so
5024         that the ReflectedType is correct.  The process leaves in base
5025         virtual functions and their overrides as distinct entries.
5026         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
5027         matters since it was boxed in a ArrayList before.
5028         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5029         modifier.
5030         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
5031         case of a virtual function and its override (choose the overload
5032         as better).
5033         (Invocation.OverloadResolve): Avoid 'override' members during
5034         'applicable_type' calculation.
5035
5036 2005-03-28  Raja R Harinath  <rharinath@novell.com>
5037
5038         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5039         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5040         GetTypeHandle.  It is possible for a reflected type to derive from
5041         a TypeBuilder (e.g., int[] derives from the TypeBuilder
5042         System.Array during mscorlib compilation).
5043         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5044         contain a method_hash, don't create one either.  Don't create a
5045         deep copy of the base cache's method_hash.
5046         (MemberCache.SetupCache): Rename back from DeepCopy.
5047         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5048         already initialized.  If we see an override function, add its
5049         underlying base virtual function to the member_hash too.
5050
5051 2005-02-09  Raja R Harinath  <rharinath@novell.com>
5052
5053         Combine two near-redundant caches.
5054         * typemanager.cs (method_params): Rename from method_internal_params.
5055         (TypeManager.GetParameterData): New.  Replace
5056         Invocation.GetParameterData.
5057         (TypeManager.LookupParametersByBuilder): Remove.
5058         * expression.cs (Invocation.method_parameter_cache): Remove.
5059         (Invocation.GetParameterData): Remove.
5060         Update to changes.
5061         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5062         Update to changes.
5063
5064 2005-02-08  Raja R Harinath  <rharinath@novell.com>
5065
5066         Fix #72015.
5067         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5068         TypeManager.multicast_delegate_type is null, resolve it by looking
5069         up "System.MulticastDelegate".
5070         * rootcontext.cs (RootContext.ResolveCore): Simplify.
5071
5072 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
5073             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
5074             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
5075
5076         Fix cs0164.cs.
5077         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5078         (LabeledStatement.AddReference): New.  Set 'referenced'.
5079         (Goto.Resolve): Use it.
5080
5081 2005-02-05  John Luke  <john.luke@gmail.com>
5082
5083         * driver.cs: remove duplicate -doc line in Usage ()
5084
5085 2005-02-04  Raja R Harinath  <rharinath@novell.com>
5086
5087         * location.cs (Location.AddFile): Fix CS2002 error report.
5088
5089 2005-02-02  Martin Baulig  <martin@ximian.com>
5090
5091         * delegate.cs (Delegate.DefineType): Report an internal error if
5092         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5093         details.        
5094
5095 2005-02-02  Raja R Harinath  <rharinath@novell.com>
5096
5097         Fix a crasher in a variant of #31984.
5098         * const.cs (Constant.CheckBase): New override that defers the
5099         new-or-override check in case the base type hasn't been populated
5100         yet.
5101         (Constant.Define): Ensure the new-or-override check is performed.
5102
5103 2005-02-01  Duncan Mak  <duncan@ximian.com>
5104
5105         * const.cs (LookupConstantValue): Check that `ce' is not null
5106         before calling GetValue ().
5107
5108 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5109
5110         Fix test-334.cs (#69519).
5111         * cs-parser.jay (using_alias_directive): Pass in an expression to
5112         NamespaceEntry.UsingAlias.
5113         (using_namespace_directive): Pass in an expression to
5114         NamespaceEntry.Using.
5115         (namespace_name): Don't flatten to a string.
5116         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5117         (NamespaceEntry.AliasEntry.Resolve): Lookup using
5118         ResolveAsTypeStep.
5119         (NamespaceEntry.UsingEntry): Likewise.
5120         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5121         changes.
5122         (NamespaceEntry.LookupForUsing): Remove.
5123         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5124         names.
5125         (NamespaceEntry.Lookup): Remove support for dotted names.
5126
5127 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5128
5129         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5130         split into two.
5131         (NamespaceEntry.ImplicitParent): Compute on demand.
5132         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5133         parallels the current.
5134         (NamespaceEntry.LookupForUsing): Use it.
5135         (NamespaceEntry.Lookup): If the current namespace-entry is
5136         implicit, don't search aliases and using tables.
5137
5138 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5139
5140         Fix #31984.
5141         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5142         BaseCache here.
5143         (TypeContainer.BaseCache): Compute on demand.
5144         (TypeContainer.FindMembers): Define constants and types if they're
5145         not already created.
5146         (FieldMember.Define): Move resetting of ec.InUnsafe before error
5147         check.
5148         * const.cs (Constant.Define): Make idempotent.
5149
5150 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5151
5152         * pending.cs: Produce better code (no nops produced by using Ldarg
5153         + value).
5154         
5155         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5156         i - 1' it should be arg + 1.
5157
5158         Fixes bug #71819.
5159
5160 2005-01-28  Raja R Harinath  <rharinath@novell.com>
5161
5162         * attribute.cs (Attribute.CheckAttributeType): Make private
5163         non-virtual.
5164         (Attribute.ResolveType): Make virtual.
5165         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5166         handling of RootContext.Tree.Types.
5167
5168 2005-01-27  Raja R Harinath  <rharinath@novell.com>
5169
5170         Update attribute-handling to use the SimpleName/MemberAccess
5171         mechanisms.
5172         * cs-parser.jay (attribute): Pass in an expression to the
5173         constructors of Attribute and GlobalAttribute.
5174         * attribute.cs (Attribute): Take an expression for the name.
5175         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
5176         passed in attribute name expression.
5177         (Attribute.CheckAttributeType): Use it.
5178         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5179         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5180         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
5181         argument to prevent error messages if the lookup fails.
5182
5183 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
5184
5185         * expression.cs (Indirection): Implemented IVariable interface
5186         to support indirection in AddressOf operator.
5187         (PointerArithmetic.Emit): Add optimalization for case where
5188         result can be precomputed.
5189
5190 2005-01-26  Martin Baulig  <martin@ximian.com>
5191
5192         * class.cs (TypeContainer.AttributeTargets): Return the correct
5193         AttributeTargets depending on our `Kind' instead of throwing an
5194         exception; fixes #71632.
5195
5196 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
5197
5198         Fix #71257
5199         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5200         constant members.
5201
5202 2005-03-17  Martin Baulig  <martin@ximian.com>
5203
5204         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5205         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
5206
5207 2005-03-17  Martin Baulig  <martin@ximian.com>
5208
5209         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5210         to bool so we can return an error condition.
5211         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5212         returned an error.
5213
5214 2005-03-17  Martin Baulig  <martin@ximian.com>
5215
5216         * generic.cs (TypeMananager.IsIEnumerable): New public method.
5217
5218         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
5219         converting from an array-type of T to `IEnumerable<T>'.
5220
5221 2005-03-16  Martin Baulig  <martin@ximian.com>
5222
5223         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
5224         (Nullable.LiftedUnaryMutator): New public class.
5225
5226         * expression.cs (UnaryMutator.DoResolve): Added support for
5227         Nullable Types.
5228
5229 2005-03-14  Martin Baulig  <martin@ximian.com>
5230
5231         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
5232
5233 2005-03-14  Martin Baulig  <martin@ximian.com>
5234
5235         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
5236         the comparision operators `<', `>', `<=' and `>='.
5237
5238 2005-03-13  Martin Baulig  <martin@ximian.com>
5239
5240         * generic.cs
5241         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
5242         avoid confusion with the `NullLiteral'.
5243         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
5244
5245 2005-03-13  Martin Baulig  <martin@ximian.com>
5246
5247         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
5248         comparing arbitrary types with the null literal.
5249
5250 2005-03-13  Martin Baulig  <martin@ximian.com>
5251
5252         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
5253         boolean operators '&&', '||', '&' and '|'.
5254         (Nullable.OperatorTrueOrFalse): New public class.
5255
5256         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
5257         instead of a `StaticCallExpr'; added support for nullables.
5258
5259 2005-03-10  Martin Baulig  <martin@ximian.com>
5260
5261         * expression.cs
5262         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
5263         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
5264
5265 2005-03-07  Martin Baulig  <martin@ximian.com>
5266
5267         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
5268         it work if `expr' is not an IMemoryLocation.
5269         (Nullable.Lifted): Implement IMemoryLocation.
5270         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
5271         target type.
5272
5273 2005-03-05  Martin Baulig  <martin@ximian.com>
5274
5275         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
5276         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
5277         (Nullable): Added support for lifted unary and binary operators.
5278
5279         * expression.cs (Unary.DoResolve): Added support for nullable types.
5280         (Binary.DoResolve): Likewise.
5281         (Conditional.DoResolve): Likewise.
5282
5283 2005-03-02  Martin Baulig  <martin@ximian.com>
5284
5285         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
5286
5287         * class.cs (ClassPart.SetParameterInfo): Override this.
5288         (PartialContainer.SetParameterInfo): Override this.
5289         (TypeContainer.CheckConstraints): New protected method.
5290         (PartialContainer.CheckConstraints): Override this and check
5291         whether the same contraints were specified in all parts of a
5292         partial generic type definition.
5293         (PartialContainer.UpdateConstraints): New public method.
5294
5295         * generic.cs (TypeParameter.UpdateConstraints): New public method.
5296
5297 2005-03-02  Martin Baulig  <martin@ximian.com>
5298
5299         Committing a patch from Carlos Alberto Cortez to fix #72887.
5300
5301         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
5302         casts from `T []' to `int []'.
5303
5304 2005-03-02  Martin Baulig  <martin@ximian.com>
5305
5306         * generic.cs (TypeManager.IsEqual): Make this symmetric.
5307
5308         * expression.cs (Binary.ResolveOperator): When resolving a
5309         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
5310         `=='.  Fixes #71866.  See gen-127.cs.
5311
5312 2005-03-02  Martin Baulig  <martin@ximian.com>
5313
5314         * class.cs (TypeContainer.DoDefineMembers): We also need a default
5315         static constructor in static classes.
5316
5317 2005-03-02  Martin Baulig  <martin@ximian.com>
5318
5319         * generic.cs
5320         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
5321         (Nullable.LiftedConversion): Added support for user-defined
5322         conversions.
5323
5324         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
5325
5326         * cs-parser.jay: Use ComposedCast everywhere instead of
5327         NullableType, so we don't need to check for NullableType
5328         everywhere.
5329         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
5330         case where we'll be resolved into a `parenthesized_expression_0'
5331         afterwards.
5332
5333         * convert.cs
5334         (Convert.UserDefinedConversion): Added nullable conversions.
5335
5336 2005-02-28  Martin Baulig  <martin@ximian.com>
5337
5338         * generic.cs (TypeManager.IsNullableType): New static method.
5339         (Nullable): New abstract class.
5340         (Nullable.NullLiteral): New public class.
5341         (Nullable.LiftedConversion): New public class.
5342
5343         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
5344         `builtin_types opt_nullable'.
5345
5346         * convert.cs
5347         (Convert.ImplicitConversionStandard): Added nullable conversions.
5348         (Convert.ExplicitConversionStandard): Likewise.
5349         (Convert.ExplicitConversion): Likewise.
5350
5351 2005-02-26  Martin Baulig  <martin@ximian.com>
5352
5353         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
5354         begin with a "?", for instance "?[]".  Don't do a type lookup if
5355         `dim' is empty.
5356
5357 2005-02-25  Martin Baulig  <martin@ximian.com>
5358
5359         The first part of Nullable Types :-)
5360
5361         * generic.cs (NullableType): New public class.
5362         (NullCoalescingOperator): New public class.
5363         (TypeArguments.Resolve): Add a CS0306 check.
5364
5365         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
5366         (opt_nullable): New rule.
5367         (type): Added `opt_nullable' to `namespace_or_type_name',
5368         `builtin_types' and `pointer_type'.
5369         (array_type): Added `opt_nullable'.
5370         (opt_rank_specifier_or_nullable): New rule; this is the
5371         combination of `opt_rank_specifier' and `opt_nullable'.
5372         (opt_error): New rule; catch errors here.
5373         (nullable_type_or_conditional): New rule; we use this to check for
5374         nullable and still detect the conditional operator.
5375         (local_variable_type): Use `opt_rank_specifier_or_nullable'
5376         instead `opt_rank_specifier'.
5377
5378         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
5379         for nullables.
5380
5381 2005-02-24  Martin Baulig  <martin@ximian.com>
5382
5383         * README, README.Changes: Removed; they're old and obsolete.
5384
5385 2005-02-22  Martin Baulig  <martin@ximian.com>
5386
5387         * generic.cs (TypeParameter.Resolve): If resolving the constraints
5388         returned an error, set `constraints' to null to avoid a crash
5389         later on.
5390         (TypeParameter.ResolveType): Likewise.
5391
5392 2005-02-22  Martin Baulig  <martin@ximian.com>
5393
5394         * generic.cs
5395         (Constraints.ResolveTypes): Protect against being called twice.
5396         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
5397         (TypeParameter.ResolveType): New public method; calls
5398         constraints.ResolveTypes().
5399         (TypeParameter.DefineType): Moved constraints.ResolveType() out
5400         into the new ResolveType().
5401         (GenericMethod.Define): Call ResolveType() on all our
5402         TypeParameter's.        
5403
5404 2005-02-21  Martin Baulig  <martin@ximian.com>
5405
5406         * generic.cs
5407         (TypeManager.generic_nullable_type): New static public field.
5408         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
5409
5410         * rootcontext.cs
5411         (RootContext.ResolveCore): Resolve "System.Nullable`1".
5412
5413 2005-02-15  Martin Baulig  <martin@ximian.com>
5414
5415         * generic.cs (ConstructedType.Constraints): Correctly check
5416         constraints if the argument type is a type parameter; fixes
5417         #72326. 
5418
5419 2005-02-02  Martin Baulig  <martin@ximian.com>
5420
5421         * delegate.cs (Delegate.DefineType): Report an internal error if
5422         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5423         details.        
5424
5425 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5426
5427         * pending.cs: Produce better code (no nops produced by using Ldarg
5428         + value).
5429         
5430         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5431         i - 1' it should be arg + 1.
5432
5433         Fixes bug #71819.
5434         
5435 2005-01-26  Martin Baulig  <martin@ximian.com>
5436
5437         * cs-parser.jay (indexer_declarator): Don't report an error if we
5438         have type parameters since we can be an explicit interface
5439         implementation; fixes #71449.
5440
5441 2005-01-26  Martin Baulig  <martin@ximian.com>
5442
5443         * class.cs (TypeContainer.AttributeTargets): Return the correct
5444         AttributeTargets depending on our `Kind' instead of throwing an
5445         exception; fixes #71632.
5446
5447 2005-01-26  Martin Baulig  <martin@ximian.com>
5448
5449         * delegate.cs (Delegate.DefineType): Correctly define our type
5450         parameters.  Fixes #71483.
5451
5452 2005-01-25  Raja R Harinath  <rharinath@novell.com>
5453
5454         Fix #71602.
5455         * expression.cs (MemberAccess.DoResolve): Don't complain with
5456         cs0572 when the LHS of a member access has identical name and type
5457         name.
5458
5459 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
5460
5461         Fix #71651, #71675
5462         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5463         CreatePermission.
5464         Create custom PermissionSet only for PermissionSetAttribute.
5465
5466 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
5467
5468         Fix #71649
5469         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5470         delegates in static class.
5471
5472 2005-01-24  Martin Baulig  <martin@ximian.com>
5473
5474         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5475         merging an implicit block, just use its reachability.
5476
5477         * statement.cs (Block.Resolve): Make the unreachable code check
5478         work wrt. implicit blocks; see test-337 from #63842.
5479
5480 2005-01-21  Alp Toker  <alp@atoker.com>
5481  
5482         * cs-parser.jay: destructor_declaration's container is PartialContainer
5483         not Class when partial types are used, so use Kind prop instead of
5484         'is'.
5485         
5486 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
5487
5488         * cs-parser.jay: Improve error reporting when an interface
5489         declares new types.
5490
5491 2005-01-20  Dick Porter  <dick@ximian.com>
5492
5493         * support.cs: SeekableStreamReader fix from Sandor Dobos
5494         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5495         chars are read.  Fixes bug 70369.
5496
5497 2005-01-20  Raja R Harinath  <rharinath@novell.com>
5498
5499         * cs-parser.jay (catch_clause): Simplify current_block handling
5500         somewhat.
5501
5502 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
5503
5504         * convert.cs (ImplicitStandardConversionExists): Synchronize the
5505         code with ImplicitStandardConversion to handle the implicit
5506         conversion of method groups into valid delegate invocations. 
5507
5508         The problem is that in parameter handling we were using this code
5509         path.  Fixes bug #64698
5510
5511 2005-01-19  Raja R Harinath  <rharinath@novell.com>
5512
5513         * cs-parser.jay: Fix several infelicities.
5514         - Avoid assigning to the parser value stack.  Code like 
5515           '$3 = null' is unclean.  Synthesize a value for the code block
5516           instead. 
5517         - Avoid using oob_stack for storing location information.  Use ...
5518         (_mark_): ... this.  New (empty) rule.  Saves the current location
5519         in $$.
5520         (foreach_statement): Avoid using oob_stack for current_block
5521         handling.  Use technique used in for_statement and
5522         using_statement.  Synthesize a value for the code block to store
5523         additional intermediate information.
5524
5525 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
5526
5527         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5528         of a different type is only allowed to private fields of a
5529         containing type, not on fields of a base class.
5530
5531         See test-174.cs and error cs0122-9.cs
5532
5533 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5534
5535         Fix test-335.cs (bug #58126).
5536         * cs-parser.jay (argument): Split out non-expression parts of the
5537         rule into 'non_simple_argument'.
5538         (invocation_expression): Support parenthesized invocations with
5539         multiple arguments, and with single non-simple arguments.
5540
5541 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5542
5543         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5544         places.
5545
5546 2005-01-12  Raja R Harinath  <rharinath@novell.com>
5547
5548         Fix cs0038-1.cs, cs1640-6.cs.
5549         * ecore.cs (Expression.Resolve): Remove special-case for
5550         SimpleName in error-handling.
5551         (Expression.almostMatchedMembers): Relax access permission to
5552         protected.
5553         (Expression.MemberLookupFailed): Handle duplicates in
5554         almostMatchedMembers list.
5555         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5556         * expression.cs (New.DoResolve): Report CS1540 for more cases.
5557         * typemanager.cs (GetFullNameSignature): Use the MethodBase
5558         overload if the passed in MemberInfo is a MethodBase.
5559
5560 2005-01-25  Martin Baulig  <martin@ximian.com>
5561
5562         * doc.cs
5563         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
5564
5565 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
5566
5567         Fix #70749
5568         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5569         for non-CAS & merge permission sets properly.
5570
5571 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5572
5573         Improve standard-compliance of simple name and member access 
5574         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
5575         * ecore.cs (FullNamedExpression): New abstract base class 
5576         for Namespaces and TypeExpressions.
5577         (ResolveFlags.SimpleName): Remove.
5578         (SimpleName): Remove support for dotted names.
5579         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
5580         DeclSpace.FindType and DeclSpace.LookupType.
5581         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5582         (Expression.ExprClassName): Make member function.
5583         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5584         a namespace.  Remove creation of dotted "SimpleName"s.
5585         (MemberAccess.DoResolve): Likewise.
5586         * decl.cs (DeclSpace.Cache): Make private.
5587         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5588         (DeclSpace.FindType): Update.
5589         (DeclSpace.LookupType): Move here from RootContext.  Return a 
5590         FullNamedExpression.
5591         * namespace.cs (Namespace): Derive from FullNamedExpression
5592         so that it can be part of expression resolution.
5593         (Namespace.Lookup): Return an FullNamedExpression.
5594         (NamespaceEntry.LookupAlias): Lookup aliases only in current
5595         namespace.
5596         * rootcontext.cs (NamespaceLookup): Remove.
5597         (LookupType): Move to DeclSpace.
5598         * attribute.cs (CheckAttributeType): Update.
5599         * doc.cs (FindDocumentedType): Remove allowAlias argument.
5600         (FindDocumentedTypeNonArray): Likewise.
5601
5602 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5603
5604         Fix cs0509.cs, cs1632.cs.
5605         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5606         is the same as IsInterface.
5607         (TypeContainer.GetClassBases): Likewise.
5608         * statement.cs (LabeledStatement.ig): New field.
5609         (LabeledStatement.LabelTarget): Save ILGenerator which created the
5610         label.
5611         (LabeledStatement.DoEmit): Check that the label was created with
5612         the same ILGenerator.
5613
5614 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5615
5616         Fix #71058
5617         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
5618         accessors to its properties.
5619
5620         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
5621         from accessors to property.
5622         
5623 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5624
5625         Fix #70722
5626         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
5627         only for overrides.
5628         
5629 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
5630
5631         * attribute.cs: Check for null and empty strings.  
5632
5633         I have lost another battle to Paolo.
5634
5635 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
5636
5637         Fix #70942
5638         * class.cs (PropertyMethod): Set Parent field in ctors.
5639         (SetMethod.InternalParameters): Add unsafe switch hack.
5640         Override MarkForDuplicationCheck where it is appropriate.
5641
5642         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
5643         It says whether container allows members with the same name.
5644         Base default is no.
5645         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
5646         Removed is_method parameter.
5647
5648 2005-01-06  Duncan Mak  <duncan@ximian.com>
5649
5650         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
5651         because the previous change led to incorrect reporting of CS1032
5652         ("Cannot define/undefine preprocessor symbols after first token in
5653         file"). Instead of using `tokens_seen' as the only flag that
5654         triggers CS1040, introduce `comments_seen'. This new flag is used
5655         to signify having seen comments on the current line, so it is
5656         unset after a newline.
5657
5658 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5659
5660         * doc.cs : When searching for a type, find nested type too.
5661           This fixes bug #71040.
5662
5663 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5664
5665         * doc.cs :
5666           - Warn missing member comment on those classes which also does not
5667             have doc comments. Fixed bug #71041.
5668           - Don't warn missing doc comment on default constructor.
5669             Fixed bug #71042.
5670
5671 2005-01-06  Duncan Mak  <duncan@ximian.com>
5672
5673         * cs-tokenizer.cs (xtoken): After handling traditional C-style
5674         comments, set `tokens_seen' to true. This allows us to detect
5675         misplaced preprocessor directives (i.e. not at the beginning of
5676         the a line, nor after whitespaces). In that case, report error
5677         CS1040. This fixes bug #56460.
5678
5679         * cs-parser.jay (interface_member_declaration): Add checks for
5680         IsExplicitImpl, and report CS0541 error if an interface member is
5681         defined as an explicit interface declaration.
5682
5683 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
5684
5685         Fix #70817
5686         * class.cs (PropertyMethod): Set Parent field in ctors.
5687         (SetMethod.InternalParameters): Add unsafe switch hack.
5688         
5689         * decl.cs (MemberCore.Parent): Cannot be readonly.
5690
5691 2005-01-06  Raja R Harinath  <rharinath@novell.com>
5692
5693         * decl.cs (DeclSpace.ResolveType): Remove.
5694         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
5695         Merge in code from ...
5696         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
5697         * class.cs, enum.cs: Update to changes.
5698
5699 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
5700
5701         * anonymous.cs: Ensure that we init the scope of our parent if it
5702         has not been initialized yet.
5703
5704 2004-12-30  Duncan Mak  <duncan@ximian.com>
5705
5706         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
5707         if field.FieldBuilder is null. Fixes #70758.
5708
5709         * convert.cs: Fixed some typos and updated some of the comments.
5710         (ImplicitStandardConversionExists):
5711         (TryImplicitIntConversion): If `target_type' is an interface and
5712         the type of `ic' implements this interface, return true or a new
5713         BoxedCast instead of null. This fixes #70468.
5714
5715 2004-12-29  Duncan Mak  <duncan@ximian.com>
5716
5717         * expression.cs (Argument.Emit): Check that Expr is
5718         IMemoryLocation before casting to it, and report CS1510 otherwise.
5719
5720         This fixes #70402.
5721
5722 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
5723
5724         * statement.cs (Block.ThisVariable): remove the recursion here, to
5725         make the --profile more sane.
5726
5727 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
5728
5729         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
5730         assembly, by JB Evain.
5731
5732 2004-12-17  Raja R Harinath  <rharinath@novell.com>
5733
5734         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
5735           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
5736         "parent" refers to enclosing type/class.  "base" refers to superclass.
5737
5738 2004-12-17  Raja R Harinath  <rharinath@novell.com>
5739
5740         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5741         Ensure that we only have GlobalAttributes.
5742         * attribute.cs (Attribute.Emit): Make non-virtual.
5743         (GlobalAttribute.Emit): Remove.
5744         (Attribute.Resolve): Make virtual.
5745         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
5746         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
5747         the argument. Don't create one.
5748         (Attribute.GetObsoleteAttribute): Likewise.
5749         (Attribute.GetClsCompliantAttributeValue): Likewise.
5750         * class.cs, decl.cs: Update to changes.
5751
5752 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
5753
5754         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
5755         
5756         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
5757         
5758         * statement.cs (Foreach.Resolve): Add error 186 report.
5759
5760 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
5761
5762         * expression.cs (Conditional.DoResolve): Add warning 429.
5763         
5764         * statement.cs (If.Resolve): Add warning 665.
5765
5766 2004-12-16  Raja R Harinath  <rharinath@novell.com>
5767
5768         New invariant: RootContext.Tree.Types.NamespaceEntry == null
5769         except when in the parser, and in GlobalAttribute.
5770         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
5771         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
5772         RootContext.Tree.Types.NamespaceEntry once work is done.
5773         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
5774         and resets RootContext.Tree.Types.NamespaceEntry.
5775
5776 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
5777
5778         * cs-parser.jay: Don't create a block for every variable.
5779
5780 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
5781
5782         * location.cs: Provide extra information.
5783
5784         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
5785         variables from the captured environment, it is the ldarg_0.
5786
5787 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
5788
5789         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
5790         find a conclusion.
5791         
5792         * class.cs: Changed warning level for 169 to avoid developer
5793         displeasure from warning flooding. It will be changed back when they
5794         fix most of current BCL warnings.
5795         
5796         * RootContext.cs: Pushed default WarningLevel to 3.
5797         
5798         * statement.cs: Removed unused variable.
5799
5800 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
5801
5802         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
5803         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
5804         Add error 502 report.
5805         (StaticClass.DefineType): Add error 441 report.
5806         (Class.AllowedModifiersProp): New virtual property as temporary
5807         extension to AllowedModifiers.
5808         (Class.DefineType): Add error 418 report. Moved ModFlags check here
5809         to share implementation with StaticClass and don't call virtual
5810         methods from ctor.
5811         
5812         * driver.cs (MainDriver): Add error 1558 test.
5813
5814         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
5815         report. Moved error 36 test here.
5816
5817         * statement.cs (Throw.Resolve): Add error 724 report.
5818
5819         * typemanager.cs: Add out_attribute_type core type.
5820         
5821 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
5822
5823         * class.cs (TypeContainer.VerifyClsCompliance): Add error
5824         3018 report.
5825         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
5826
5827         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
5828         3017 report.
5829         
5830         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
5831
5832         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
5833         Add error 3023 report.
5834         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
5835
5836         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
5837         implementation.
5838
5839 2004-12-12  John Luke  <john.luke@gmail.com>
5840
5841         * driver.cs (AddArgs): take -- into account when
5842         adding arguments, fixes bug 65710 
5843
5844 2004-12-12  Martin Baulig  <martin@ximian.com>
5845
5846         * expression.cs (Unary.TryReduceNegative): Added support for
5847         SByteConstant and ByteConstant.
5848         (Unary.Reduce): Check error values from TryReduceNegative().
5849
5850 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
5851
5852         * attributes.cs (Attribute.Resolve): Avoid multiple error report
5853         and report exception as error 182.
5854
5855 2004-12-10  Raja R Harinath  <rharinath@novell.com>
5856
5857         * driver.cs (Main): Fix message when there are warnings.
5858
5859 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
5860
5861         * delegate.cs: Fixed my fix from yesterday, sorry about that.
5862
5863 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
5864
5865         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
5866         Reduced number of warnings.
5867         
5868         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
5869
5870 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
5871
5872         * driver.cs: Removed message.
5873
5874         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
5875
5876 2004-12-08    <vargaz@freemail.hu>
5877
5878         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
5879
5880 2004-12-08  Martin Baulig  <martin@ximian.com>
5881
5882         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5883         instead of a CS3002 for properties and indexer.
5884
5885 2004-12-08  Martin Baulig  <martin@ximian.com>
5886
5887         * decl.cs (MemberName.ToString): Make this work again.
5888
5889 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
5890
5891         * attribute.cs (Resolve): Add error 591 detection.
5892
5893         * class.cs (FieldMember.Define): Add error 1547 detection.
5894         (Indexer.Define): Add error 620 detection.
5895         (Operator.Define): Add error 590 detection.
5896
5897         * ecore.cs: Missing argument for error 79.
5898
5899         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
5900         detection.
5901
5902 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
5903
5904         Fix #70106
5905         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
5906         only.
5907
5908 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
5909
5910         * cs-parser.jay : handle doc comments on implicit/explicit operators.
5911           Some operator comments were suppressed.
5912         * doc.cs : Implicit/explicit operator name in doc comments are like
5913           "op_Explicit(type)~returnType", so added suffix handling.
5914
5915 2005-01-21  Alp Toker  <alp@atoker.com>
5916
5917         * cs-parser.jay: destructor_declaration's container is PartialContainer
5918         not Class when partial types are used, so use Kind prop instead of 'is'.
5919
5920 2004-12-12  Martin Baulig  <martin@ximian.com>
5921
5922         * expression.cs (Unary.TryReduceNegative): Added support for
5923         SByteConstant and ByteConstant.
5924         (Unary.Reduce): Check error values from TryReduceNegative().
5925
5926 2004-12-11  Martin Baulig  <martin@ximian.com>
5927
5928         * support.cs (ReflectionParameters.ParameterName): If we have a
5929         `gpd', call `ParameterName' on it.
5930
5931         * parameter.cs (Parameter.GetParameterAttributes): New static method.
5932
5933         * pending.cs (PendingImplementation.DefineProxy): Call
5934         DefineParameter() for all of the MethodBuilder's arguments.
5935
5936 2004-12-09  Martin Baulig  <martin@ximian.com>
5937
5938         * doc.cs (DocUtil): Make this a static class.
5939
5940 2004-12-09  Martin Baulig  <martin@ximian.com>
5941
5942         * expression.cs (Invocation.InferType): Moved the type inference
5943         implementation into TypeManager.
5944
5945         * generics.cs (TypeManager): Moved the type inference
5946         implementation here.
5947
5948 2004-12-09  Martin Baulig  <martin@ximian.com>
5949
5950         * typemanager.cs (TypeManager): Make this a partial class.
5951
5952         * generics.cs
5953         (TypeManager): Move the generics part of `TypeManager' here.
5954
5955 2004-12-08  Martin Baulig  <martin@ximian.com>
5956
5957         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5958         instead of a CS3002 for properties and indexer.  Added CS3024
5959         check for generic interfaces.
5960
5961         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
5962         instances are not CLS-compliant.
5963
5964 2004-12-08  Martin Baulig  <martin@ximian.com>
5965
5966         * cs-parser.jay
5967         (void_pointer_expression): New rule for `void*', `void**' etc.
5968         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
5969
5970 2004-12-08  Martin Baulig  <martin@ximian.com>
5971
5972         * expression.cs (Invocation.InferType): Removed the hack for
5973         MethodCore.MayUnify().  
5974
5975         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
5976         this actually work.
5977
5978         * class.cs (MethodCore.MayUnify): Use
5979         TypeManager.MayBecomeEqualGenericTypes().       
5980
5981 2004-12-08  Martin Baulig  <martin@ximian.com>
5982
5983         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
5984         parameter, box it.  Fixes #69233.
5985
5986 2004-12-08  Martin Baulig  <martin@ximian.com>
5987
5988         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
5989         have the ctor constraint.  Fixes #68326.
5990
5991 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
5992
5993         * cs-parser.jay : interface comment was not consumed because of
5994           extra opt_semicolon before doc handling.
5995
5996 2004-12-03  Raja R Harinath  <rharinath@novell.com>
5997
5998         Fix test-327.cs, test-328.cs, and put in early infrastructure
5999         for eventually fixing #52697.
6000         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6001         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6002         from other methods.
6003         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6004         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6005         (VerifyUsing, error246): Update.
6006         * rootcontext.cs (RootContext.NamespaceLookup): Just use
6007         'NamespaceEntry.LookupNamespaceOrType'.
6008
6009 2004-12-07  Martin Baulig  <martin@ximian.com>
6010
6011         * driver.cs: Call it "BETA SOFTWARE" :-)
6012
6013 2004-12-06  Raja R Harinath  <rharinath@novell.com>
6014
6015         Fix crash on cs0657-17.cs.
6016         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6017         Use RootContext.Tree.Types, not 'new RootTypes ()'.
6018         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6019         the case where the NamespaceEntry gets overwritten.
6020
6021 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
6022
6023         Fixed #69195, #56821
6024         * ecore.cs (ResolveBoolean): Tiny refactoring.
6025
6026         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6027         of right expression resolving when left is false constant and
6028         operator is LogicalAnd OR true constant and operator is LogicalOr.
6029
6030         * statement.cs (ResolveUnreachable): Always reports warning.
6031
6032 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
6033
6034         * class.cs: Distinguish between 1721 and 1722 (just a little help
6035         for the programmer).
6036
6037 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
6038
6039         * delegate.cs: Only allow this on new versions of the language. 
6040
6041 2004-12-02  Duncan Mak  <duncan@ximian.com>
6042
6043         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6044         Expression class.
6045         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6046         here as a static method. Take an additional bool out parameter
6047         `must_do_cs1540_check' for signaling to InstanceResolve.
6048         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6049         member field from PropertyExpr class and made it an argument of
6050         the method instead.
6051         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6052         check for MarshalByRefObject, and report CS0122 instead of CS1540.
6053         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6054         and `remove_accessor' as well as InstanceResolve: report CS0122
6055         where applicable.
6056
6057         Fixes #70129.
6058
6059 2004-12-07  Martin Baulig  <martin@ximian.com>
6060
6061         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
6062         and CS0692 where appropriate.
6063
6064 2004-12-06  Martin Baulig  <martin@ximian.com>
6065
6066         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
6067         IsDuplicateImplementation() and improved it.
6068
6069         * expression.cs (Invocation.InferTypeArguments): Added
6070         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
6071         and removed the "ref" modifier from `infered_types'.
6072
6073         * decl.cs (MemberName.ToString): Removed the exception.
6074
6075 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
6076
6077         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6078           comments are allowed.
6079
6080 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6081
6082         * delegate.cs: Add checks for subtypes in paramaters and return values
6083         in VerifyMethod () to add support for Covariance/Contravariance
6084         in delegates.
6085         
6086 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6087
6088         * report.cs: Remove extra closing parenthesis.
6089
6090         * convert.cs (Error_CannotImplicitConversion): If the name of the
6091         types are the same, provide some extra information.
6092
6093 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
6094
6095         Fix bug #70102
6096         * attribute.cs (Resolve): Improved implementation of params
6097         attribute arguments.
6098
6099         * support.cs (ParameterData): Add HasParams to be faster.
6100
6101 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
6102
6103         all things are for /doc support:
6104
6105         * doc.cs: new file that supports XML documentation generation.
6106         * mcs.exe.sources: added doc.cs.
6107         * driver.cs:
6108           Handle /doc command line option.
6109           Report error 2006 instead of 5 for missing file name for /doc.
6110           Generate XML documentation when required, after type resolution.
6111         * cs-tokenizer.cs:
6112           Added support for picking up documentation (/// and /** ... */),
6113           including a new XmlCommentState enumeration.
6114         * cs-parser.jay:
6115           Added lines to fill Documentation element for field, constant,
6116           property, indexer, method, constructor, destructor, operator, event
6117           and class, struct, interface, delegate, enum.
6118           Added lines to warn incorrect comment.
6119         * rootcontext.cs :
6120           Added Documentation field (passed only when /doc was specified).
6121         * decl.cs:
6122           Added DocComment, DocCommentHeader, GenerateDocComment() and
6123           OnGenerateDocComment() and some supporting private members for
6124           /doc feature to MemberCore.
6125         * class.cs:
6126           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6127         * delegate.cs:
6128           Added overriden DocCommentHeader.
6129         * enum.cs:
6130           Added overriden DocCommentHeader and GenerateDocComment().
6131
6132 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
6133
6134         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6135         unwrapping the enumeration values, chain to
6136         DoConstantNumericPromotions again, so we can promote things to the
6137         fundamental types (takes care of enums that are bytes, sbytes).
6138
6139         Fixes bug #62054.
6140
6141 2004-12-01  Raja R Harinath  <rharinath@novell.com>
6142
6143         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6144         Fix long-standing bug in type-lookup.  Use FindType instead of
6145         LookupType when ec.ResolvingTypeTree.
6146         (Attribute.ResolveType, Attribute.Resolve)
6147         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6148         Update to changes.
6149         (Attributes.Search): Remove internal version.  Update.
6150         (Attributes.SearchMulti): Update.
6151         (Attributes.GetClsCompliantAttribute): Remove.
6152         (Attributes.GetIndexerNameAttribute): Remove.
6153         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6154         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6155         * class.cs (Indexer.Define): Likewise.
6156
6157 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
6158
6159         Fix bug #68790
6160         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6161         MarshallByReference members access.
6162
6163         * expression.cs: Use CheckMarshallByRefAccess;
6164         Better error CS0197 message.
6165
6166         * report.cs: Print whole related error message.
6167
6168 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6169
6170         * class (GetClassBases): Better error 60 report.
6171         (EventProperty): Disabled warning 67 detection.
6172
6173 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6174
6175         Fix bug #60324
6176         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6177
6178         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6179         precise values.
6180
6181 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6182
6183         Fix bug #49488
6184         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6185
6186         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6187
6188 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
6189
6190         * attribute.cs (Attribute.Resolve): Refine error reporting and
6191         report a cs0117 if the identifier does not exist, to distinguish
6192         from 0617 which is a miss-use of the actual identifier.
6193
6194         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6195         between cs0070 and cs0079.
6196
6197         * class.cs (MemberBase.DoDefine): When reporting a wrong
6198         accessibility level, we use MethodCore to compare instead of
6199         Method (this was a regression in some refactoring effort).
6200
6201         So now we correctly report cs0056 again.
6202
6203         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6204         testing the target_type (which was known to be object_type) and
6205         not the source type (which is anonymous_method).
6206
6207         Fixed reporting of error cs1660.
6208
6209         * expression.cs (UserCast.Source): Expose the underlying cast.
6210
6211         * statement.cs (Switch.SwitchGoverningType): Sort the list of
6212         allowed types to find a match to int32 first (most common).
6213
6214         In addition, it ignores any ImplicitUserConversions that did an
6215         internal implicit conversion (as the switch statement allows only
6216         one integral conversion to exist).
6217
6218         * class.cs (PartialContainer.Create): rename `name' to
6219         `member_name' for clarity.  Then replace the string calls with a
6220         call to MemberName.GetPartialName, as now using
6221         MemberName.ToString is an error (this is due to the side effects
6222         it had, that were fixed in the past).
6223
6224         This will restore the error reporting on a number of partial class
6225         errors that were missusing this (and getting an exception as a
6226         results, which is now just a plain textual warning, because
6227         yyparse debug output would crash otherwise).
6228
6229 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6230
6231         * Makefile (PROGRAM_INSTALL_DIR): Remove.
6232
6233 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6234
6235         * rootcontext.cs (LookupType): Make sure to cache lookups that
6236         don't give us a negative result. This saves about 5% of corlib
6237         compilation time.
6238
6239 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6240
6241         * report.cs (AbstractMessage.Print): messages are sent to stderr
6242
6243         * class.cs (TypeContainer.GetClassBases): It is an error to have a
6244         non-interface in the list of interfaces (at this point, either
6245         parent was properly set, or a base class is being listed in the
6246         interfaces section).
6247
6248         This flags error 1722, and resolves the crash from bug 69259.
6249
6250 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6251
6252         * statement.cs (Using.EmitExpressionFinally): make this work right
6253         for valuetypes. Fixes 69926.
6254
6255 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6256
6257         * const.cs (Const.ChangeType): Cope with the "0 literal can be
6258         converted to an enum" here, before we try to change the underlying
6259         type.  This code exists, but it is a different code path than the
6260         one used while encoding constants.
6261
6262         (ImplicitReferenceConversionExists): In addition, resynchronized
6263         the code here, so it matches the same code in
6264         ImplicitReferenceConversionExists for the `from any class-type S
6265         to any interface-type T'.       
6266
6267 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
6268
6269         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6270
6271 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
6272
6273         * cs-parser.jay: Use verbosity accordingly. 
6274
6275 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6276
6277         * expression.cs (Unary.ResolveOperator): Do not report warning;
6278         AddressOf reads from variable.
6279         
6280         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6281
6282 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6283
6284         Fix bug #69462
6285
6286         * attribute.cs (Attributable): Removed CheckTargets.
6287         (Attributes.Emit): Explicit attribute targets are tested here.
6288
6289         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6290         not enabled for interfaces.
6291
6292         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6293         (GetAssemblyName): Ouch next bug there.
6294
6295 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6296
6297         * expression.cs: Error 275 added.
6298         
6299 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
6300
6301         Fix bug #69177 (Implemented decimal constant support)
6302
6303         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6304         (BinaryFold): Add DecimalConstant.
6305
6306         * const.cs (Define): Decimal constant 
6307         (is not constant.
6308         (ChangeType): Add decimal type handling.
6309         (LookupConstantValue): Don't set value for decimal type but
6310         emit DecimalConstantAttribute. Needed for constant optimization.
6311
6312         * constant.cs (ToDecimal): New method.
6313         (ConvertToDecimal): New method.
6314         (IntConstant): Implemented ConvertToDecimal.
6315         (DecimalConstant.Emit): Emit optimized version for decimals in
6316         int range.
6317
6318         * expression.cs (ResolveOperator): Changed order of constant
6319         reduction to work correctly with native types which have
6320         overloaded operators.
6321         (ResolveMemberAccess): Extract constant value from attribute
6322         for decimal type.
6323
6324         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6325
6326         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6327         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6328         (ChangeType): Decimal is special.
6329         (TypeToCoreType): Add decimal type.
6330
6331 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6332
6333         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6334         decimal types.
6335
6336 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6337
6338         * class.cs (EventField.ApplyAttributeBuilder): Fix error
6339         test cs1667-5.cs.
6340
6341 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6342
6343         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6344
6345         * pending.cs (PendingImplementation): Grab only interfaces.
6346
6347 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6348
6349         * statement.cs (ForeachHelperMethods): Add location member and
6350         error 202 detection.
6351
6352 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
6353
6354         * expression.cs (DoResolveBase): Fixed wrong warning for out
6355         variables.
6356
6357 2004-12-04  Martin Baulig  <martin@ximian.com>
6358
6359         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
6360         to check whether the conversion is ok.
6361
6362         * typemanager.cs (TypeManager.GetTypeArguments): Just return
6363         `Type.EmptyTypes' if we're not a generic TypeContainer.
6364
6365 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6366
6367         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6368         old bug: when converting from the null literal to a pointer,
6369         return an EmptyCast, not the NullLiteral.
6370
6371         This fixes #69921, the recent null_type changes probably made this
6372         bug more prominent.
6373
6374 2004-12-03  Martin Baulig  <martin@ximian.com>
6375
6376         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6377         method as our child, call AnonymousMethod.Compatible() on it.
6378
6379 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6380
6381         * class.cs (FieldBase): Use an unused bit field from the field to
6382         encode the `has_offset' property from the FieldMember.  This saves
6383         a couple of Ks on bootstrap compilation.
6384
6385         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6386         method as our child, return the AnonymousMethod resolved
6387         expression.
6388
6389         * expression.cs (New.DoResolve): Allow return values from
6390         NewDelegate to also include AnonymousMethods.
6391
6392         Fixes #70150.
6393
6394 2004-11-29  Raja R Harinath  <rharinath@novell.com>
6395
6396         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
6397         cs1648 report.
6398         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
6399         System.Runtime.InteropServices._Exception, since it's a base
6400         interface of the core type System.Exception in the net_2_0 profile.
6401
6402 2004-11-27  Martin Baulig  <martin@ximian.com>
6403
6404         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
6405
6406 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6407
6408         * Makefile: Convert to use executable.make.
6409         * gmcs.exe.sources: New.
6410
6411 2004-11-25  Martin Baulig  <martin@ximian.com>
6412
6413         * expression.cs (Invocation.InferType): Added support for byref types.
6414
6415 2004-11-25  Martin Baulig  <martin@ximian.com>
6416
6417         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
6418         in TypeManager.TypeToCoreType().
6419
6420 2004-11-25  Martin Baulig  <martin@ximian.com>
6421
6422         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
6423         "Dispose" method from the `current_type'.
6424         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
6425         DoDefineMembers() instead of using the MethodBuilder; this is
6426         required for generic iterators.
6427
6428         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
6429
6430 2004-11-24  Martin Baulig  <martin@ximian.com>
6431
6432         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
6433
6434 2004-11-20  Martin Baulig  <martin@ximian.com>
6435
6436         * expression.cs (Invocation.InferType): Correctly infer generic
6437         instances; see gen-103.cs.
6438         (Invocation.InferTypeArguments): If a generic method doesn't have
6439         any unbound type parameters, we don't need to infer anything.
6440
6441 2004-11-19  Raja R Harinath  <rharinath@novell.com>
6442
6443         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
6444
6445 2004-11-17  Raja R Harinath  <rharinath@novell.com>
6446
6447         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6448         (TypeHandle.GetMemberCache): New.
6449         (TypeHandle.TypeHandle): Update.
6450         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6451         (TypeManager.LookupParentInterfacesCache):
6452         Rename from LookupInterfaceCache.  Optimize slightly.
6453         (TypeManager.MemberLookup_FindMembers): Update.
6454         * decl.cs (MemberCache.MemberCache): Set Container to null in the
6455         multi-type variant.
6456         (AddCacheContents): Rename from AddHashtable.
6457         * class.cs (TypeContainer.parent_container): Remove.
6458         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6459         (TypeContainer.DoDefineMembers): Don't initialize it.
6460         Update to name changes.
6461         
6462 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
6463
6464         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6465         that factors the code to check access modifiers on override.  
6466
6467         (PropertyBase): Use the code here.
6468
6469         Patch from Lluis S'anchez, fixes bug #69361.
6470
6471 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
6472
6473         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6474         routine that is used to report the use of a captured variable
6475         whose address has been taken.
6476
6477         There are two checks: one when variables are being captured and
6478         the other check is when the address of a variable is taken. 
6479         
6480         (because an anonymous methods might be resolved before *or* after
6481         the address has been taken) and 
6482
6483         * expression.cs (Conditional.DoResolve): Remove the special
6484         casing that Martin added to trueExpr and falseExpr being both
6485         NullLiteral.  We get the right behavior now just by introducing
6486         the null_type into the compiler. 
6487
6488         * convert.cs (ExplicitConversion): Change the code to use
6489         null_type instead of testing `expr is NullLiteral'.
6490         (ImplicitConversionStandard): use null_type too.
6491         (ImplicitReferenceConversionExists): use null_type too.
6492         (ImplicitReferenceConversion): use null_type too.
6493
6494         * literal.cs: The type of `NullLiteral' is now null_type instead
6495         of object_type. 
6496         (Resolve): Set the type here.
6497
6498         * typemanager.cs: Introduce null_type.
6499
6500 2004-11-18  Martin Baulig  <martin@ximian.com>
6501
6502         * rootcontext.cs
6503         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
6504
6505 2004-11-18  Martin Baulig  <martin@ximian.com>
6506
6507         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
6508
6509 2004-11-18  Martin Baulig  <martin@ximian.com>
6510
6511         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
6512         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
6513         call ResolveConstructedType() on it to resolve it without checking
6514         constraints.
6515         (Constraints.ResolveTypes): Check them here.
6516         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
6517         but don't check constraints.
6518         (ConstructedType.ResolveAsTypeTerminal): Override this and also
6519         check constraints here.
6520         (ConstructedType.ResolveConstructedType): New public method.  This
6521         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
6522         resolve ourselves without checking constraints.
6523
6524         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
6525
6526 2004-11-18  Martin Baulig  <martin@ximian.com>
6527
6528         * decl.cs
6529         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
6530
6531         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
6532
6533 2004-11-18  Martin Baulig  <martin@ximian.com>
6534
6535         * ecore.cs (TypeExpr.ResolveType): Removed.
6536         (Expression.ResolveAsTypeTerminal): We always return a fully
6537         resolved `TypeExpr', so we can just access its `Type'.
6538
6539         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
6540
6541 2004-11-17  Martin Baulig  <martin@ximian.com>
6542
6543         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
6544         sure we don't return any unresolved TypeExpr's.
6545         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
6546         a `TypeExpr'.
6547         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
6548
6549         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
6550         unresolved `ConstructedType's.
6551
6552 2004-11-17  Martin Baulig  <martin@ximian.com>
6553
6554         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
6555
6556 2004-11-17  Martin Baulig  <martin@ximian.com>
6557
6558         * ecore.cs
6559         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
6560
6561         * decl.cs (DeclSpace.ResolveType): Removed.
6562         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
6563
6564 2004-11-17  Martin Baulig  <martin@ximian.com>
6565
6566         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6567         direction, like FindMembers() does.  Fixes #69546, testcase is in
6568         test-315.cs.    
6569
6570 2004-11-16  Martin Baulig  <martin@ximian.com>
6571
6572         This is based on a patch from Marek Safar, see bug #69082.
6573         Fixes bugs #63705 and #67130.
6574
6575         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6576         method; create a MemberCache for an interface type and cache the
6577         result.
6578
6579         * decl.cs (IMemberContainer.ParentContainer): Removed.
6580         (IMemberContainer.ParentCache): New property.
6581         (MemberCache.SetupCacheForInterface): Removed.
6582         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6583         to create a cache for an interface's "parent".
6584
6585         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6586         interfaces too.
6587
6588 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
6589
6590         * statement.cs: Avoid adding bools to a hashtable.
6591
6592 2004-11-15  Martin Baulig  <martin@ximian.com>
6593
6594         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
6595
6596 2004-11-11  Martin Baulig  <martin@ximian.com>
6597
6598         * typemanager.cs (TypeManager.GetMethodName): New method.
6599
6600         * class.cs (MethodData.Define): Include the generic arity in the
6601         name of an explicit interface; also add it to the method name.
6602
6603         * pending.cs (PendingImplementation.InterfaceMethod): The method
6604         name now includes the generic arity.
6605
6606 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
6607
6608         * expression.cs (Invocation.OverloadResolve): Flag error if we are
6609         calling an unsafe method from a safe location.
6610
6611 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
6612
6613         Fix #69167
6614         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6615
6616 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
6617
6618         * namespace.cs (VerifyUsing): use GetPartialName instead of
6619         ToString. 
6620
6621 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
6622
6623         * statement.cs (Return.Resolve): Fix regression in typo: if
6624         `in_exc', we have to request a NeedReturnLabel, this was a typo
6625         introduced in the anonymous method check-in.  Fixes #69131.
6626
6627         * Indexers were using the ShortName when defining themselves,
6628         causing a regression in the compiler bootstrap when applying the
6629         patch from 2004-11-02 (first part), now they use their full name
6630         and the bug is gone.
6631
6632 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
6633
6634         * driver.cs: Strip the path from the names of embedded resources. Fixes
6635         #68519.
6636
6637 2004-11-04  Raja R Harinath  <rharinath@novell.com>
6638
6639         Fix error message regression: cs0104-2.cs.
6640         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6641         (AliasEntry.Resolve): Update.
6642         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
6643         'silent' flag.
6644         (RootContext.LookupType): Update.
6645
6646 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
6647
6648         * cs-parser.jay: Add support for handling accessor modifiers
6649         * class: Add support port accessor modifiers and error checking,
6650         define PropertyMethod.Define as virtual (not abstract anymore)
6651         * ecore.cs: Add checking for proeprties access with access modifiers
6652         * iterators.cs: Modify Accessor constructor call based in the modified
6653         constructor
6654 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
6655
6656         * expression.cs (StringConcat): Handle being called twice,
6657         as when we have a concat in a field init with more than two
6658         ctors in the class
6659
6660 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
6661
6662         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6663         special case explicit implementations, we should always produce
6664         the .property or .event declaration.
6665         
6666         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6667         since it will not return correct data if people use this
6668         unresolved in the presence of using statements (see test-313).
6669
6670         * class.cs (MethodData.Define): If we are an explicit interface
6671         implementation, set the method name to the full name of the
6672         interface plus the name of the method.  
6673
6674         Notice that using the method.MethodName.GetFullName() does not
6675         work, as it will only contain the name as declared on the source
6676         file (it can be a shorthand in the presence of using statements)
6677         and not the fully qualifed type name, for example:
6678
6679         using System;
6680
6681         class D : ICloneable {
6682                 object ICloneable.Clone ()  {
6683                 }
6684         }
6685
6686         Would produce a method called `ICloneable.Clone' instead of
6687         `System.ICloneable.Clone'.
6688
6689         * namespace.cs (Alias.Resolve): Use GetPartialName.
6690         
6691 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6692
6693         * cs-parser.jay: Add error 1055 report.
6694
6695 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
6696
6697         * assign.cs (Assign.DoResolve): Only do the transform of
6698         assignment into a New if the types are compatible, if not, fall
6699         through and let the implicit code deal with the errors and with
6700         the necessary conversions. 
6701
6702 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6703
6704         * cs-parser.jay: Add error 1031 report.
6705
6706         * cs-tokenizer.cs: Add location for error 1038.
6707
6708 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6709
6710         * cs-parser.jay: Add error 1016 report.
6711
6712 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6713
6714         * cs-parser.jay: Add errors 1575,1611 report.
6715
6716 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6717
6718         * cs-parser.jay: Add error 1001 report.
6719
6720 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6721
6722         Fix #68850
6723         * attribute.cs (GetMarshal): Add method argument for
6724         caller identification.
6725
6726         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
6727         agument for GetMarshal and RuntimeMissingSupport.
6728
6729 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6730
6731         * attribute.cs (ExtractSecurityPermissionSet): Removed
6732         TypeManager.code_access_permission_type.
6733
6734         * typemanager.cs: Removed TypeManager.code_access_permission_type.
6735
6736 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
6737
6738         * expression.cs (LocalVariableReference.DoResolveLValue): Check
6739         for obsolete use of a variable here.   Fixes regression on errors
6740         cs0619-25 and cs0619-26.
6741
6742 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
6743
6744         Fix #62358, implemented security attribute encoding.
6745
6746         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
6747         Tests permitted SecurityAction for assembly or other types.
6748         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
6749         data from SecurityPermissionAttribute to PermisionSet class.
6750
6751         * class.cs (ApplyAttributeBuilder): Added special handling
6752         for System.Security.Permissions.SecurityAttribute based types.
6753
6754         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
6755         special handling for System.Security.Permissions.SecurityAttribute
6756         based types.
6757
6758         * enum.cs (ApplyAttributeBuilder): Added special handling
6759         for System.Security.Permissions.SecurityAttribute based types.
6760
6761         * parameter.cs (ApplyAttributeBuilder): Added special handling
6762         for System.Security.Permissions.SecurityAttribute based types.
6763
6764         * rootcontext.cs: Next 2 core types.
6765
6766         * typemanager.cs (TypeManager.security_permission_attr_type):
6767         Built in type for the SecurityPermission Attribute.
6768         (code_access_permission_type): Build in type.
6769
6770 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
6771
6772         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
6773         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
6774         all of this information into
6775         EmitContext.EmitCapturedVariableInstance.
6776         
6777         * codegen.cs (EmitCapturedVariableInstance): move here the
6778         funcionality of emitting an ldarg.0 in the presence of a
6779         remapping.   This centralizes the instance emit code.
6780
6781         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
6782         then emit a load of this: it means that we have reached the
6783         topmost ScopeInfo: the one that contains the pointer to the
6784         instance of the class hosting the anonymous method.
6785
6786         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
6787         captures to the topmost CaptureContext.
6788
6789 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
6790
6791         * expression.cs (LocalVariableReference): Move the knowledge about
6792         the iterators into codegen's EmitCapturedVariableInstance.
6793
6794 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
6795
6796         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
6797         all code paths return a value from an anonymous method (it is the
6798         same as the 161 error, but for anonymous methods).
6799
6800 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
6801
6802         The introduction of anonymous methods in the compiler changed
6803         various ways of doing things in the compiler.  The most
6804         significant one is the hard split between the resolution phase
6805         and the emission phases of the compiler.
6806
6807         For instance, routines that referenced local variables no
6808         longer can safely create temporary variables during the
6809         resolution phase: they must do so from the emission phase,
6810         since the variable might have been "captured", hence access to
6811         it can not be done with the local-variable operations from the runtime.
6812         
6813         * statement.cs 
6814
6815         (Block.Flags): New flag `IsTopLevel' to indicate that this block
6816         is a toplevel block.
6817
6818         (ToplevelBlock): A new kind of Block, these are the blocks that
6819         are created by the parser for all toplevel method bodies.  These
6820         include methods, accessors and anonymous methods.
6821
6822         These contain some extra information not found in regular blocks:
6823         A pointer to an optional CaptureContext (for tracking captured
6824         local variables and parameters).  A pointer to the parent
6825         ToplevelBlock.
6826         
6827         (Return.Resolve): Catch missmatches when returning a value from an
6828         anonymous method (error 1662).
6829         Invoke NeedReturnLabel from the Resolve phase instead of the emit
6830         phase.
6831
6832         (Break.Resolve): ditto.
6833
6834         (SwitchLabel): instead of defining the labels during the
6835         resolution phase, we now turned the public ILLabel and ILLabelCode
6836         labels into methods called GetILLabelCode() and GetILLabel() that
6837         only define the label during the Emit phase.
6838
6839         (GotoCase): Track the SwitchLabel instead of the computed label
6840         (its contained therein).  Emit the code by using
6841         SwitchLabel.GetILLabelCode ().
6842
6843         (LocalInfo.Flags.Captured): A new flag has been introduce to track
6844         whether the Local has been captured or not.
6845
6846         (LocalInfo.IsCaptured): New property, used to tell whether the
6847         local has been captured.
6848         
6849         * anonymous.cs: Vastly updated to contain the anonymous method
6850         support.
6851
6852         The main classes here are: CaptureContext which tracks any
6853         captured information for a toplevel block and ScopeInfo used to
6854         track the activation frames for various local variables.   
6855
6856         Each toplevel block has an optional capture context associated
6857         with it.  When a method contains an anonymous method both the
6858         toplevel method and the anonymous method will create a capture
6859         context.   When variables or parameters are captured, they are
6860         recorded on the CaptureContext that owns them, for example:
6861
6862         void Demo () {
6863              int a;
6864              MyDelegate d = delegate {
6865                  a = 1;
6866              }
6867         }
6868
6869         Here `a' will be recorded as captured on the toplevel
6870         CapturedContext, the inner captured context will not have anything
6871         (it will only have data if local variables or parameters from it
6872         are captured in a nested anonymous method.
6873
6874         The ScopeInfo is used to track the activation frames for local
6875         variables, for example:
6876
6877         for (int i = 0; i < 10; i++)
6878                 for (int j = 0; j < 10; j++){
6879                    MyDelegate d = delegate {
6880                         call (i, j);
6881                    }
6882                 }
6883
6884         At runtime this captures a single captured variable `i', but it
6885         captures 10 different versions of the variable `j'.  The variable
6886         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
6887         recorded on a child.  
6888
6889         The toplevel ScopeInfo will also track information like the `this'
6890         pointer if instance variables were referenced (this is necessary
6891         as the anonymous method lives inside a nested class in the host
6892         type of the method). 
6893
6894         (AnonymousMethod): Expanded to track the Toplevel, implement
6895         `AnonymousMethod.Compatible' to tell whether an anonymous method
6896         can be converted to a target delegate type. 
6897
6898         The routine now also produces the anonymous method content
6899
6900         (AnonymousDelegate): A helper class that derives from
6901         DelegateCreation, this is used to generate the code necessary to
6902         produce the delegate for the anonymous method that was created. 
6903
6904         * assign.cs: API adjustments for new changes in
6905         Convert.ImplicitStandardConversionExists.
6906
6907         * class.cs: Adjustments to cope with the fact that now toplevel
6908         blocks are of type `ToplevelBlock'. 
6909
6910         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
6911         insteda of standard blocks.
6912
6913         Flag errors if params arguments are passed to anonymous methods.
6914
6915         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
6916         `CurrentAnonymousMethod' which points to the current Anonymous
6917         Method.  The variable points to the AnonymousMethod class that
6918         holds the code being compiled.  It is set in the new EmitContext
6919         created for the anonymous method.
6920
6921         (EmitContext.Phase): Introduce a variable and an enumeration to
6922         assist in enforcing some rules about when and where we are allowed
6923         to invoke certain methods (EmitContext.NeedsReturnLabel is the
6924         only one that enfonces this right now).
6925
6926         (EmitContext.HaveCaptureInfo): new helper method that returns
6927         whether we have a CapturedContext initialized.
6928
6929         (EmitContext.CaptureVariable): New method used to register that a
6930         LocalInfo must be flagged for capturing. 
6931
6932         (EmitContext.CapturedParameter): New method used to register that a
6933         parameters must be flagged for capturing. 
6934         
6935         (EmitContext.CapturedField): New method used to register that a
6936         field must be flagged for capturing. 
6937
6938         (EmitContext.HaveCapturedVariables,
6939         EmitContext.HaveCapturedFields): Return whether there are captured
6940         variables or fields. 
6941
6942         (EmitContext.EmitMethodHostInstance): This is used to emit the
6943         instance for the anonymous method.  The instance might be null
6944         (static methods), this (for anonymous methods that capture nothing
6945         and happen to live side-by-side with the current method body) or a
6946         more complicated expression if the method has a CaptureContext.
6947
6948         (EmitContext.EmitTopBlock): Routine that drives the emission of
6949         code: it will first resolve the top block, then emit any metadata
6950         and then emit the code.  The split is done so that we can extract
6951         any anonymous methods and flag any captured variables/parameters.
6952         
6953         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
6954         during this phase, the ILGenerator should not be used as labels
6955         and local variables declared here might not be accessible to any
6956         code that is part of an anonymous method.  
6957
6958         Exceptions to this include the temporary variables that are
6959         created by some statements internally for holding temporary
6960         variables. 
6961         
6962         (EmitContext.EmitMeta): New routine, in charge of emitting all the
6963         metadata for a cb
6964
6965         (EmitContext.TemporaryReturn): This method is typically called
6966         from the Emit phase, and its the only place where we allow the
6967         ReturnLabel to be defined other than the EmitMeta.  The reason is
6968         that otherwise we would have to duplicate a lot of logic in the
6969         Resolve phases of various methods that today is on the Emit
6970         phase. 
6971
6972         (EmitContext.NeedReturnLabel): This no longer creates the label,
6973         as the ILGenerator is not valid during the resolve phase.
6974
6975         (EmitContext.EmitThis): Extended the knowledge in this class to
6976         work in anonymous methods in addition to iterators. 
6977
6978         (EmitContext.EmitCapturedVariableInstance): This emits whatever
6979         code is necessary on the stack to access the instance to a local
6980         variable (the variable will be accessed as a field).
6981
6982         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
6983         EmitContext.EmitAddressOfParameter): Routines to support
6984         parameters (not completed at this point). 
6985         
6986         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
6987         will also remove the parameters.
6988
6989         * convert.cs (Convert): Define a `ConstantEC' which points to a
6990         null.  This is just to prefity some code that uses
6991         ImplicitStandardConversion code and do not have an EmitContext
6992         handy.
6993
6994         The idea is to flag explicitly that at that point in time, it is
6995         known that the conversion will not trigger the delegate checking
6996         code in implicit conversions (which requires a valid
6997         EmitContext). 
6998
6999         Everywhere: pass new EmitContext parameter since
7000         ImplicitStandardConversionExists now requires it to check for
7001         anonymous method conversions. 
7002
7003         (Convert.ImplicitStandardConversionExists): If the type of an
7004         expression is the anonymous_method_type, and the type is a
7005         delegate, we invoke the AnonymousMethod.Compatible method to check
7006         whether an implicit conversion is possible. 
7007
7008         (Convert.ImplicitConversionStandard): Only do implicit method
7009         group conversions if the language level is not ISO_1.
7010
7011         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7012         MethodInfo for the Invoke method.  used by Delegate and
7013         AnonymousDelegate.
7014
7015         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7016         method conversions if the target type is a delegate.
7017
7018         Removed extra debugging nops.
7019
7020         (LocalVariableReference): Turn the `local_info' into a public
7021         field. 
7022
7023         Add `prepared' field, the same hack used for FieldExprs to cope
7024         with composed assignments, as Local variables do not necessarily
7025         operate purely on the stack as they used to: they can be captured
7026         fields. 
7027
7028         Add `temp' for a temporary result, like fields.
7029
7030         Refactor DoResolve and DoResolveLValue into DoResolveBase.
7031
7032         It now copes with Local variables that are captured and emits the
7033         proper instance variable to load it from a field in the captured
7034         case. 
7035
7036         (ParameterReference.DoResolveBase): During the resolve phase,
7037         capture parameters if we are in an anonymous method.
7038
7039         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7040         anonymous method, use the EmitContext helper routines to emit the
7041         parameter reference.
7042
7043         * iterators.cs: Set RemapToProxy to true/false during the
7044         EmitDispose class.
7045
7046         * parameters.cs (GetParameterByName): New helper method. 
7047
7048         * typemanager.cs (anonymous_method_type) a new type that
7049         represents an anonyous method.  This is always an internal type,
7050         used as a fencepost to test against the anonymous-methodness of an
7051         expression. 
7052         
7053 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
7054
7055         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7056         561 report.
7057         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7058
7059 2004-11-10  Martin Baulig  <martin@ximian.com>
7060
7061         * expression.cs (Invocation.BetterFunction): If two methods have
7062         equal parameter types, but only one of them is generic, the
7063         non-generic one wins.
7064         (New.DoResolve): Don't set `is_struct' to false if we're a generic
7065         instance; just use `Type.IsValueType' to determine whether
7066         something is a struct or not.
7067         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
7068         so we can be called multiple times.
7069
7070 2004-11-10  Martin Baulig  <martin@ximian.com>
7071
7072         * generic.cs (TypeParameter.DefineConstraints): New public method.
7073         (TypeParameter.CheckAccessLevel): Override this and return true.
7074         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
7075         override ResolveType() anymore.
7076         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
7077
7078 2004-11-10  Martin Baulig  <martin@ximian.com>
7079
7080         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
7081         call DeclSpace.ResolveNestedType() on it.
7082
7083 2004-11-10  Martin Baulig  <martin@ximian.com>
7084
7085         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
7086         non-null, call ParameterModifier() on it.
7087
7088 2004-11-10  Martin Baulig  <martin@ximian.com>
7089
7090         * iterators.cs
7091         (Iterators): Added `current_type' and `this_type' fields.
7092         (Iterators.DefineIterator): Create a new EmitContext and store it
7093         in `ec'; compute `this_type'.
7094
7095 2004-11-10  Martin Baulig  <martin@ximian.com>
7096
7097         * typemanager.cs
7098         (TypeManager.IsPrivateAccessible): New public method.
7099         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
7100
7101 2004-11-10  Martin Baulig  <martin@ximian.com>
7102
7103         * class.cs (TypeContainer.DefineType): Call
7104         TypeBuilder.DefineGenericParameters() before resolving the type
7105         parameters.
7106         (MethodData.parent_method): New protected field.
7107         (MethodData..ctor): Added `MethodInfo parent_method' argument.
7108         (MethodData.Define): Compute `parent_method'.
7109
7110         * decl.cs
7111         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7112         (MemberCore.GetClsCompliantAttributeValue): Likewise.
7113         (DeclSpace.ec): New protected field; store the EmitContext here.
7114         (DeclSpace.EmitContext): New public property.
7115         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
7116         (DeclSpace.ResolveNestedType): New public method.
7117         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
7118         (DeclSpace.NestedAccessible): Added `Type tb' argument.
7119         (DeclSpace.FamilyAccessible): Likewise.
7120         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
7121         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7122         EmitContext.
7123
7124         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
7125         field.
7126
7127         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7128         (Enum.Emit): Don't create a new EmitContext.
7129
7130 2004-10-18  Martin Baulig  <martin@ximian.com>
7131
7132         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7133         `Type' directly, but call ResolveType() on it.
7134         (Catch.Resolve): Likewise.
7135         (Foreach.Resolve): Likewise.
7136
7137 2004-10-18  Martin Baulig  <martin@ximian.com>
7138
7139         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7140         `Type' directly, but call ResolveType() on it.
7141         (Probe.DoResolve): Likewise.
7142         (ArrayCreation.LookupType): Likewise.
7143         (TypeOf.DoResolve): Likewise.
7144         (SizeOf.DoResolve): Likewise.
7145
7146 2004-10-18  Raja R Harinath  <rharinath@novell.com>
7147
7148         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7149         the ResolveType.
7150
7151 2004-10-17  John Luke  <john.luke@gmail.com>
7152
7153         * class.cs (Operator.GetSignatureForError): use CSharpName
7154
7155         * parameter.cs (Parameter.GetSignatureForError): Returns
7156         correct name even if was not defined.
7157
7158 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7159
7160         Fix #65816.
7161         * class.cs (TypeContainer.EmitContext): New property.
7162         (DefineNestedTypes): Create an emitcontext for each part.
7163         (MethodCore.DoDefineParameters): Use container's emitcontext.
7164         Pass type array to InternalParameters.
7165         (MemberBase.DoDefine): Use container's emitcontext.
7166         (FieldMember.Define): Likewise.
7167         (Event.Define): Likewise.
7168         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7169         Pass type array to InternalParameters.
7170         (SetIndexerMethod.GetParameterInfo): Likewise.
7171         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7172         * delegate.cs (Define): Pass emitcontext to
7173         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7174         array to InternalParameters.
7175         * expression.cs (ParameterReference.DoResolveBase): Pass
7176         emitcontext to GetParameterInfo.
7177         (ComposedCast.DoResolveAsTypeStep): Remove check on
7178         ec.ResolvingTypeTree.
7179         * parameter.cs (Parameter.Resolve): Change argument to
7180         EmitContext.  Use ResolveAsTypeTerminal.
7181         (Parameter.GetSignature): Change argument to EmitContext.
7182         (Parameters.ComputeSignature): Likewise.
7183         (Parameters.ComputeParameterTypes): Likewise.
7184         (Parameters.GetParameterInfo): Likewise.
7185         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7186         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7187         * support.cs (InternalParameters..ctor): Remove variant that takes
7188         a DeclSpace.
7189         * typemanager.cs (system_intptr_expr): New.
7190         (InitExpressionTypes): Initialize it.
7191
7192 2004-10-12  Chris Toshok  <toshok@ximian.com>
7193
7194         * cs-parser.jay: fix location for try_statement and catch_clause.
7195
7196 2004-10-18  Martin Baulig  <martin@ximian.com>
7197
7198         * class.cs (FieldMember.Define): Don't access the TypeExpr's
7199         `Type' directly, but call ResolveType() on it.
7200         (MemberBase.DoDefine): Likewise.
7201
7202         * expression.cs (New.DoResolve): Don't access the TypeExpr's
7203         `Type' directly, but call ResolveType() on it.
7204         (ComposedCast.DoResolveAsTypeStep): Likewise.
7205
7206         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7207         `Type' directly, but call ResolveType() on it.
7208
7209 2004-10-17  John Luke  <john.luke@gmail.com>
7210
7211         * class.cs (Operator.GetSignatureForError): use CSharpName
7212
7213         * parameter.cs (Parameter.GetSignatureForError): Returns
7214         correct name even if was not defined.
7215
7216 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7217
7218         Fix #65816.
7219         * class.cs (TypeContainer.EmitContext): New property.
7220         (DefineNestedTypes): Create an emitcontext for each part.
7221         (MethodCore.DoDefineParameters): Use container's emitcontext.
7222         Pass type array to InternalParameters.
7223         (MemberBase.DoDefine): Use container's emitcontext.
7224         (FieldMember.Define): Likewise.
7225         (Event.Define): Likewise.
7226         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7227         Pass type array to InternalParameters.
7228         (SetIndexerMethod.GetParameterInfo): Likewise.
7229         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7230         * delegate.cs (Define): Pass emitcontext to
7231         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7232         array to InternalParameters.
7233         * expression.cs (ParameterReference.DoResolveBase): Pass
7234         emitcontext to GetParameterInfo.
7235         (ComposedCast.DoResolveAsTypeStep): Remove check on
7236         ec.ResolvingTypeTree.
7237         * parameter.cs (Parameter.Resolve): Change argument to
7238         EmitContext.  Use ResolveAsTypeTerminal.
7239         (Parameter.GetSignature): Change argument to EmitContext.
7240         (Parameters.ComputeSignature): Likewise.
7241         (Parameters.ComputeParameterTypes): Likewise.
7242         (Parameters.GetParameterInfo): Likewise.
7243         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7244         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7245         * support.cs (InternalParameters..ctor): Remove variant that takes
7246         a DeclSpace.
7247         * typemanager.cs (system_intptr_expr): New.
7248         (InitExpressionTypes): Initialize it.
7249
7250 2004-10-12  Chris Toshok  <toshok@ximian.com>
7251
7252         * cs-parser.jay: fix location for try_statement and catch_clause.
7253
7254 2004-10-07  Raja R Harinath  <rharinath@novell.com>
7255
7256         More DeclSpace.ResolveType avoidance.
7257         * decl.cs (MemberCore.InUnsafe): New property.
7258         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
7259         with newly created EmitContext.
7260         (FieldMember.Define): Likewise.
7261         * delegate.cs (Delegate.Define): Likewise.
7262         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7263         only if normal name-lookup fails.
7264         (TypeExpr.DoResolve): Enable error-checking.
7265         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7266         (SizeOf.DoResolve): Likewise.
7267         (ComposedCast.DoResolveAsTypeStep): Likewise.
7268         (StackAlloc.DoResolve): Likewise.
7269         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7270         (Block.Unsafe): New property.
7271         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7272         (Unsafe): Set 'unsafe' flag of contained block.
7273         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7274         (Fixed.Resolve): Likewise.
7275         (Catch.Resolve): Likewise.
7276         (Using.ResolveLocalVariableDecls): Likewise.
7277         (Foreach.Resolve): Likewise.
7278
7279 2004-10-05  John Luke <john.luke@gmail.com>
7280
7281         * cs-parser.jay: add location to error CS0175
7282
7283 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
7284
7285         * ecore.cs (Expression.Constantity): Add support for turning null
7286         into a constant.
7287
7288         * const.cs (Const.Define): Allow constants to be reference types
7289         as long as the value is Null.
7290
7291 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
7292
7293         * namespace.cs (NamespaceEntry.Using): No matter which warning
7294         level is set, check if this namespace name has already been added.
7295
7296 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
7297
7298         * expression.cs: reftype [!=]= null should always use br[true,false].
7299         # 67410
7300
7301 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
7302
7303         Fix #67108
7304         * attribute.cs: Enum conversion moved to 
7305         GetAttributeArgumentExpression to be applied to the all
7306         expressions.
7307
7308 2004-10-01  Raja R Harinath  <rharinath@novell.com>
7309
7310         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7311         * class.c (TypeContainer.DefineType): Flag error if
7312         base types aren't accessible due to access permissions.
7313         * decl.cs (DeclSpace.ResolveType): Move logic to
7314         Expression.ResolveAsTypeTerminal.
7315         (DeclSpace.ResolveTypeExpr): Thin layer over
7316         Expression.ResolveAsTypeTerminal.
7317         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7318         Refactor code into NestedAccess.  Use it.
7319         (DeclSpace.NestedAccess): New.
7320         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7321         argument to silence errors.  Check access permissions.
7322         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7323         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7324         (Cast.DoResolve): Likewise.
7325         (New.DoResolve): Likewise.
7326         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7327         (TypeOf.DoResolve): Likewise.
7328
7329         * expression.cs (Invocation.BetterConversion): Return the Type of
7330         the better conversion.  Implement section 14.4.2.3 more faithfully.
7331         (Invocation.BetterFunction): Make boolean.  Make correspondence to
7332         section 14.4.2.2 explicit.
7333         (Invocation.OverloadResolve): Update.
7334         (Invocation): Remove is_base field.
7335         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
7336         (Invocation.Emit): Likewise.
7337
7338 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
7339
7340         * cs-parser.jay: Reverted 642 warning fix.
7341
7342 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7343
7344         Fix bug #66615
7345         * decl.cs (FindMemberWithSameName): Indexer can have more than
7346         1 argument.
7347
7348 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7349
7350         * expression.cs (LocalVariableReference.DoResolveLValue):
7351         Do not report warning 219 for out values.
7352         (EmptyExpression.Null): New member to avoid extra allocations.
7353
7354 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7355
7356         * cs-parser.jay: Fix wrong warning 642 report.
7357
7358         * cs-tokenizer.cs (CheckNextToken): New helper;
7359         Inspect next character if is same as expected.
7360
7361 2004-09-23  Martin Baulig  <martin@ximian.com>
7362
7363         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7364         (Convert.ImplicitReferenceConversionExists): Likewise.
7365
7366 2004-11-09  Raja R Harinath  <rharinath@novell.com>
7367
7368         * Makefile (DISTFILES): Comment out a few missing files.
7369
7370 2004-10-29  Raja R Harinath  <rharinath@novell.com>
7371
7372         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
7373         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
7374         (gmcs.exe): Invoke bootstrap-libs.
7375         (clean-local): Clean the net_2_0_bootstrap profile too.
7376         (PROGRAM_INSTALL_DIR): New.
7377         (install-local): Use it.
7378
7379 2004-10-13  Martin Baulig  <martin@ximian.com>
7380
7381         * generic.cs (TypeManager.InflatedConstraints): New nested class.
7382         (TypeParameter.DefineType): If we're a method type parameter and
7383         that method is overriding something, "inflate" its constraints.
7384
7385 2004-10-12  Martin Baulig  <martin@ximian.com>
7386
7387         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
7388         and have type arguments, create and resolve a ConstructedType.
7389
7390 2004-10-12  Martin Baulig  <martin@ximian.com>
7391
7392         * decl.cs (MemberCache.FindMemberToOverride): Use
7393         TypeManager.IsEqual() to compare the parameters and Type.Equals()
7394         to compare the invocationType.
7395
7396         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
7397         When comparing two type parameters, only do the signature-only
7398         comparision for method type parameters.
7399
7400 2004-10-11  Martin Baulig  <martin@ximian.com>
7401
7402         * report.cs: Don't make --fatal abort on warnings, we have
7403         -warnaserror for that.
7404
7405 2004-10-11  Martin Baulig  <martin@ximian.com>
7406
7407         * typemanager.cs
7408         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
7409         (TypeManager.IsEqual): Call ourself recursively instead of using
7410         Type.IsEqual(). 
7411
7412 2004-10-11  Martin Baulig  <martin@ximian.com>
7413
7414         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
7415         on our own type parameters, not on the ones we inherit from a containing
7416         class.
7417
7418         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
7419         the comparision.
7420
7421         * generic.cs (TypeParameter.Define): We may only be called once.
7422
7423         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
7424         instead of TypeManager.IsEqual().
7425
7426 2004-09-28  Martin Baulig  <martin@ximian.com>
7427
7428         * generic.cs
7429         (GenericConstraints.EffectiveBaseClass): New public property.
7430         (TypeParameter.GenericConstraints): New public property.
7431         (ConstructedType.CheckConstraints): Improved.
7432
7433         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
7434         (Convert.TypeParameterConversion): New private method; use this in
7435         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
7436         for all conversions related to type parameters.
7437
7438 2004-09-24  Martin Baulig  <martin@ximian.com>
7439
7440         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
7441         type parameter conversions for type parameters which are known to
7442         be reference types.
7443
7444 2004-09-24  Martin Baulig  <martin@ximian.com>
7445
7446         * generic.cs (GenericConstraints): Added `IsReferenceType' and
7447         `IsValueType' properties.
7448
7449         * support.cs (ReflectionConstraints): Use
7450         Type.GetGenericParameterConstraints() instead of the old hack.
7451
7452 2004-09-24  Martin Baulig  <martin@ximian.com>
7453
7454         * generic.cs (GenericConstraints): Moved here and made it an
7455         abstract class.
7456
7457         * support.cs (GenericConstraints): Moved to generic.cs.
7458
7459 2004-09-24  Martin Baulig  <martin@ximian.com>
7460
7461         * support.cs
7462         (ReflectionConstraints): Un-nested this class and made it public.
7463
7464         * typemanager.cs
7465         (TypeManager.GetTypeParameterConstraints): New public method.
7466         (TypeManager.HasConstructorConstraint): Use the attributes.
7467
7468 2004-09-24  Martin Baulig  <martin@ximian.com>
7469
7470         * support.cs (GenericConstraints): Replaced `HasConstructor',
7471         `IsReferenceType' and `IsValueType' with `Attributes'.
7472         (ReflectionParameters.ReflectionConstraints): Removed the Create()
7473         method and made the .ctor public.
7474
7475         * generic.cs (Constraints.Attributes): New public property.
7476         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
7477         `IsReferenceType' -> `HasReferenceTypeConstraint' and
7478         `IsValueType' -> `HasValueTypeConstraint'.
7479
7480 2004-09-23  Martin Baulig  <martin@ximian.com>
7481
7482         * generic.cs (Constraints): Reflect latest runtime changes.
7483
7484 2004-09-23  Martin Baulig  <martin@ximian.com>
7485
7486         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7487         (Convert.ImplicitReferenceConversionExists): Likewise.
7488
7489 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7490
7491         * class.cs (Operator.Define): Add error 448 and 559 report.
7492         
7493 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7494
7495         * class.cs (MemberBase.IsTypePermitted): New protected
7496         method for checking error CS0610.
7497
7498 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7499
7500         * class.cs (TypeContainer.HasExplicitLayout): New property
7501         Returns whether container has StructLayout attribute set Explicit.
7502         (FieldMember): New abstract class for consts and fields.
7503         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7504         (Field): Reuse FieldMember.
7505
7506         * const.cs (Const): Reuse FieldMember.
7507
7508         * rootcontext.cs: EmitConstants call moved to class.
7509
7510 2004-09-22  Martin Baulig  <martin@ximian.com>
7511
7512         Marek and me just fixed one of our oldest bugs: #28562 :-)
7513
7514         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7515
7516         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7517         we're an EnumConstant, just return that.
7518         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7519         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
7520         to get the value which'll actually be written into the attribute.
7521         However, we have to use GetValue() to access the attribute's value
7522         in the compiler.        
7523
7524 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7525
7526         * constant.cs (Constant.IsNegative): New abstract property
7527         IsNegative.
7528
7529         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7530         (StackAlloc.DoResolve): Reused IsNegative.
7531
7532 2004-09-22  Martin Baulig  <martin@ximian.com>
7533
7534         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
7535         public method; like LookupTypeContainer, but also works for
7536         generic instances.
7537
7538         * report.cs (Report.SymbolRelatedToPreviousError): Use
7539         TypeManager.LookupGenericTypeContainer().       
7540
7541 2004-09-22  Martin Baulig  <martin@ximian.com>
7542
7543         Thanks to Peter Sestoft for this bug report.
7544
7545         * expression.cs (Conditional): If both the `trueExpr' and the
7546         `falseExpr' is a NullLiteral, return a NullLiteral.
7547
7548 2004-09-22  Martin Baulig  <martin@ximian.com>
7549
7550         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7551         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7552         for the "get_Current" call.
7553
7554 2004-09-21  Martin Baulig  <martin@ximian.com>
7555
7556         * convert.cs (Convert.ImplicitReferenceConversion): When
7557         converting to an interface type, first check whether we're
7558         converting from a reference type.
7559
7560 2004-09-14  Martin Baulig  <martin@ximian.com>
7561
7562         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7563
7564 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7565
7566         Fixed bug #61902
7567         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7568         called and is obsolete then this member suppress message
7569         when call is inside next [Obsolete] method or type.
7570
7571         * expression.cs: Use TestObsoleteMethodUsage member.
7572
7573 2004-09-14  Martin Baulig  <martin@ximian.com>
7574
7575         * genericparser.cs: Removed.
7576
7577 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
7578
7579         * class.cs (MethodCore.CheckBase): Fix bug #65757.
7580
7581 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
7582
7583         * attribute.cs (Attribute.Resolve): Add error 653 report.
7584
7585         * class.cs (Class.ApplyAttributeBuilder): Add error 641
7586         report.
7587         (Method.ApplyAttributeBuilder): Add error 685 report.
7588         (Operator.Define): Add error 564 report.
7589
7590         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7591
7592         * expression.cs (Invocation.DoResolve): Add error
7593         245 and 250 report.
7594
7595         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7596         error 674 report.
7597
7598 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7599
7600         * class.cs (ConstructorInitializer.Resolve):
7601         Wrong error number (515->516).
7602
7603 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7604
7605         * class.cs (Indexer.Define): Add error 631 report.
7606
7607 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7608
7609         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7610
7611 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7612
7613         * expression.cs (Probe.DoResolve): Add error CS0241 report.
7614
7615 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
7616
7617         * cs-parser.jay: Added error CS0241 report.
7618
7619 2004-09-10  Raja R Harinath  <rharinath@novell.com>
7620
7621         * cs-parser.jay (fixed_statement): Introduce a scope for the
7622         declaration in the 'fixed' statement.
7623
7624 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7625
7626         * cs-parser.jay: Added CS0230 error report.
7627
7628 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7629
7630         * cs-parser.jay: Added errors CS0231 and CS0257 report.
7631
7632 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7633
7634         * expression.cs (Argument.Resolve): Added error CS0192 and
7635         CS0199 report.
7636
7637 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7638
7639         C# 2.0 #pragma warning feature
7640
7641         * cs-tokenizer.cs (PreProcessPragma): New method; 
7642         Handles #pragma directive.
7643
7644         * report.cs (WarningRegions): New class; Support
7645         class for #pragma warning directive. It tests whether
7646         warning is enabled for a given line.
7647
7648 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
7649
7650         * const.cs: Add more descriptive error report, tahnks to
7651         Sebastien. 
7652
7653 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
7654
7655         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7656
7657 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
7658
7659         * expression.cs: Apply patch from Ben: Remove dead code from
7660         ArrayCreation, and remove the TurnintoConstant call in const.cs,
7661         as that code just threw an exception anwyays.
7662
7663         * const.cs: Remove the call to the turnintoconstant, for details
7664         see bug: #63144
7665         
7666         * literal.cs: The type of the null-literal is the null type;  So
7667         we use a placeholder type (literal.cs:System.Null, defined here)
7668         for it.
7669
7670         * expression.cs (Conditional.DoResolve): Remove some old code that
7671         is no longer needed, conversions have been fixed.
7672
7673         (ArrayCreationExpression.DoResolve): Return false if we fail to
7674         resolve the inner expression.
7675
7676 2004-09-07  Raja R Harinath  <rharinath@novell.com>
7677
7678         Fix test-290.cs.
7679         * cs-parser.jay (delegate_declaration): Record a delegate
7680         declaration as a type declaration.
7681         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7682
7683 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
7684
7685         * parameter.cs: Do not crash if the type can not be resolved. 
7686
7687         * expression.cs: Report errors with unsafe pointers, fixes #64896
7688
7689 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7690
7691         * expression.cs: Pointer arith always needs to do a conv.i
7692         if the operand is a long. fix 65320
7693
7694 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7695
7696         Fixed cs0619-37.cs, cs0619-38.cs
7697
7698         * enum.cs (GetObsoleteAttribute): Removed.
7699
7700         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7701         on Enum member is double staged. The first is tested member
7702         and then enum.
7703
7704 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7705
7706         Fixed #56986, #63631, #65231
7707
7708         * class.cs: (TypeContainer.AddToMemberContainer): New method,
7709         adds member to name container.
7710         (TypeContainer.AddToTypeContainer): New method, adds type to
7711         name container.
7712         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
7713         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
7714         AddOperator): Simplified by reusing AddToMemberContainer.
7715         (TypeContainer.UserDefinedStaticConstructor): Changed to property
7716         instead of field.
7717         (Method.CheckForDuplications): Fixed implementation to test all
7718         possibilities.
7719         (MemberBase): Detection whether member is explicit interface
7720         implementation is now in constructor.
7721         (MemberBase.UpdateMemberName): Handles IndexerName.
7722         (Accessor): Changed to keep also location information.
7723         (AbstractPropertyEventMethod): Is derived from MemberCore.
7724         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
7725         will be emited or not.
7726         (PropertyBase.AreAccessorsDuplicateImplementation):
7727         Tests whether accessors are not in collision with some method.
7728         (Operator): Is derived from MethodCore to simplify common
7729         operations.
7730
7731         * decl.cs (Flags.TestMethodDuplication): Test for duplication
7732         must be performed.
7733         (DeclSpace.AddToContainer): Adds the member to defined_names
7734         table. It tests for duplications and enclosing name conflicts.
7735
7736         * enum.cs (EnumMember): Clean up to reuse the base structures
7737
7738 2004-09-03  Martin Baulig  <martin@ximian.com>
7739
7740         Merged latest changes into gmcs.  Please keep this comment in
7741         here, it makes it easier for me to see what changed in MCS since
7742         the last time I merged.
7743
7744 2004-09-03  Martin Baulig  <martin@ximian.com>
7745
7746         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7747         into TypeContainer, to make partial classes work again.
7748
7749 2004-09-03  Martin Baulig  <martin@ximian.com>
7750
7751         * rootcontext.cs (RootContext.V2): Removed.
7752
7753 2004-03-23  Martin Baulig  <martin@ximian.com>
7754
7755         * expression.cs (Invocation.OverloadResolve): Added `bool
7756         may_fail' argument and use it instead of the Location.IsNull() hack.
7757
7758 2004-09-09  Martin Baulig  <martin@ximian.com>
7759
7760         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
7761
7762 2004-09-09  Martin Baulig  <martin@ximian.com>
7763
7764         * generic.cs (TypeParameter.DefineType): Added support for
7765         explicit interface methods.
7766
7767 2004-09-09  Martin Baulig  <martin@ximian.com>
7768
7769         * README.Changes: New document.  Started to list important changes
7770         between MCS and GMCS here.
7771
7772 2004-09-08  Martin Baulig  <martin@ximian.com>
7773
7774         * class.cs
7775         (TypeContainer.CheckRecursiveDefinition): New protected method.
7776         (TypeContainer.DefineType): Move the CS0146 check into
7777         CheckRecursiveDefinition().     
7778
7779 2004-09-06  Martin Baulig  <martin@ximian.com>
7780
7781         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
7782         types for the constructor constraint.
7783
7784 2004-09-03  Martin Baulig  <martin@ximian.com>
7785
7786         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7787         into TypeContainer, to make partial classes work again.
7788
7789 2004-09-03  Martin Baulig  <martin@ximian.com>
7790
7791         * rootcontext.cs (RootContext.V2): Removed.
7792
7793 2004-03-23  Martin Baulig  <martin@ximian.com>
7794
7795         * expression.cs (Invocation.OverloadResolve): Added `bool
7796         may_fail' argument and use it instead of the Location.IsNull() hack.
7797
7798 2004-09-03  Martin Baulig  <martin@ximian.com>
7799
7800         Merged latest changes into gmcs.  Please keep this comment in
7801         here, it makes it easier for me to see what changed in MCS since
7802         the last time I merged.
7803
7804 2004-09-03  Raja R Harinath  <rharinath@novell.com>
7805
7806         Fix #61128.
7807         * expression.cs (BetterConversion): Don't allow either conversion 
7808         to be null.  Remove redundant implicit conversion test when 'q ==
7809         null' -- when this function is invoked, we already know that the
7810         implicit conversion exists.
7811         (BetterFunction): Assume that 'best' is non-null.  Remove
7812         redundant reimplementation of IsApplicable when 'best' is null.
7813         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
7814         number of arguments.
7815         (IsAncestralType): Extract from OverloadResolve.
7816         (OverloadResolve): Make robust to the MethodGroupExpr being
7817         unsorted.  Implement all the logic of Section 14.5.5.1, and
7818         support overloading of methods from multiple applicable types.
7819         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
7820
7821         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
7822         (RealError, Warning): Append type of report to related symbol.
7823
7824 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
7825
7826         * enum.cs: Fixed CLS-Compliance checks for enum members.
7827         Error tests cs3008-8.cs, cs3014-8.cs
7828
7829 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
7830
7831         Fixed bug #62342, #63102
7832         * class.cs: ImplementIndexer uses member.IsExplicitImpl
7833         like ImplementMethod.
7834
7835 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
7836
7837         * attribute.cs (Attribute.GetAttributeArgumentExpression):
7838         Fixed bug #65170.
7839
7840 2004-09-02  Martin Baulig  <martin@ximian.com>
7841
7842         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7843         TypeManager.GetArgumentTypes() rather than calling GetParameters()
7844         on the MethodBase.
7845
7846 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
7847
7848         C# 2.0 Static classes implemented
7849
7850         * class.cs (TypeContainer): instance_constructors,
7851         initialized_fields, initialized_static_fields,
7852         default_constructor, base_inteface_types are protected to be
7853         accessible from StaticClass.
7854         (TypeContainer.DefineDefaultConstructor): New virtual method
7855         for custom default constructor generating
7856         (StaticClass): New class to handle "Static classes" feature.
7857
7858         * cs-parser.jay: Handle static keyword on class like instance
7859         of StaticClass.
7860
7861         * driver.cs: Added "/langversion" command line switch with two
7862         options (iso-1, default).
7863
7864 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
7865
7866         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
7867
7868 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
7869
7870         * delegate.cs: Style.
7871
7872 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7873
7874         * delegate.cs: Add seperate instance expr field for miguel.
7875
7876 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7877
7878         * PointerArithmetic (Resolve): make sure we are not doing
7879         pointer arith on void*. Also, make sure we are resolved
7880         by not setting eclass until resolve.
7881
7882         All callers: Make sure that PointerArithmetic gets resolved.
7883
7884 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7885
7886         * ArrayCreation (LookupType): If the type does not resolve 
7887         to an array, give an error.
7888
7889 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
7890
7891         * statement.cs (Try.Resolve): Fixed bug #64222
7892
7893 2004-08-27  Martin Baulig  <martin@ximian.com>
7894
7895         * class.cs
7896         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7897         crash here.     
7898
7899 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
7900
7901         * ecore.cs (Constantify): Get underlying type via
7902         System.Enum.GetUnderlyingType to avoid StackOverflow on the
7903         Windows in special cases.
7904
7905 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
7906
7907         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
7908         for obtaining also private methods.
7909         (GetRemoveMethod): Used GetRemoveMethod (true)
7910         for obtaining also private methods.
7911
7912 2004-09-02  Martin Baulig  <martin@ximian.com>
7913
7914         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7915         TypeManager.GetArgumentTypes() rather than calling GetParameters()
7916         on the MethodBase.
7917
7918 2004-08-27  Martin Baulig  <martin@ximian.com>
7919
7920         * class.cs
7921         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7922         crash here.     
7923
7924 2004-08-25  Martin Baulig  <martin@ximian.com>
7925
7926         * support.cs (ReflectionParameters..ctor): If this is a generic
7927         method, retrieve and store its type parameters.
7928         (InternalParameters..ctor): Added `TypeParameter[]' argument.
7929         (ReflectionParameters.GenericConstraints): The argument specifies
7930         the type parameter, not the method parameter.
7931         (InternalParameters.GenericConstraints): Likewise.
7932
7933         * generic.cs (TypeParameter.DefineType): Correctly handle
7934         constraints wrt. generic methods in interfaces and their
7935         implementations.        
7936
7937 2004-08-24  Martin Baulig  <martin@ximian.com>
7938
7939         * generic.cs (TypeParameter.IsSubclassOf): New public method.
7940         (Constraints.IsSubclassOf): New internal method.
7941
7942         * typemanager.cs (TypeManager.FindMembers): Added special support
7943         for GenericTypeParameterBuilder's.      
7944         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
7945         type parameters.
7946
7947 2004-08-24  Martin Baulig  <martin@ximian.com>
7948
7949         * typemanager.cs
7950         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
7951         this for accessibility checks.
7952         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
7953         IsNestedFamilyAccessible.
7954         (TypeManager.IsSubclassOf): New method, do what the name actually
7955         says.   
7956
7957 2004-08-24  Martin Baulig  <martin@ximian.com>
7958
7959         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
7960         as a SimpleName, include the generic arity.
7961
7962 2004-08-24  Martin Baulig  <martin@ximian.com>
7963
7964         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
7965         MethodAttributes.HideBySig for operators.
7966
7967 2004-08-23  Martin Baulig  <martin@ximian.com>
7968
7969         Back to the old error reporting system :-)
7970
7971         * report.cs (Message): Removed.
7972         (Report.MessageData, ErrorData, WarningData): Removed.
7973         (Report.Error, Warning): Back to the old system.
7974
7975 2004-08-23  Martin Baulig  <martin@ximian.com>
7976
7977         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
7978
7979         * class.cs (TypeContainer.ParentContainer): New public virtual
7980         method; replaces the explicit interface implementation.
7981         (ClassPart.ParentContainer): Override.
7982
7983 2004-08-23  Martin Baulig  <martin@ximian.com>
7984
7985         * statement.cs (Switch): Added support for constant switches; see
7986         #59428 or test-285.cs.
7987
7988 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
7989
7990         Fixed bug #62740.
7991         * statement.cs (GetEnumeratorFilter): Removed useless
7992         logic because C# specs is strict. GetEnumerator must be
7993         public.
7994
7995 2004-08-22  Martin Baulig  <martin@ximian.com>
7996
7997         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7998         a switch and may break, reset the barrier.  Fixes #59867.
7999
8000 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8001
8002         CLS-Compliance speed up (~5% for corlib)
8003
8004         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8005         New method. Tests container for CLS-Compliant names
8006
8007         * class.cs (TypeContainer.VerifyClsName): New method.
8008         Checks whether container name is CLS Compliant.
8009         (Constructor): Implements IMethodData.
8010
8011         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8012         low-case table for CLS Compliance test.
8013         (MemberCache.VerifyClsParameterConflict): New method.
8014         Checks method parameters for CS3006 error.
8015
8016         * enum.cs (EnumMember): Is derived from MemberCore.
8017         (Enum.VerifyClsName): Optimized for better performance.
8018
8019 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8020
8021         * report.cs: Renamed Error_T to Error and changed all
8022         references.
8023
8024 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8025
8026         * class.cs (TypeContainer.IndexerArrayList): New inner class
8027         container for indexers.
8028         (TypeContainer.DefaultIndexerName): New constant for default
8029         indexer name. Replaced all "Item" with this constant.
8030         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8031
8032         * typemanager.cs (TypeManager.default_member_ctor): Cache here
8033         DefaultMemberAttribute constructor.
8034
8035 2004-08-05  Martin Baulig  <martin@ximian.com>
8036
8037         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8038         Fix bug #59429.
8039
8040 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
8041
8042         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8043         multi platforms problem.
8044
8045         * compiler.csproj: Included shared files.
8046
8047 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8048
8049         Fix bug 60333, 55971 in the more general way
8050         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8051         Added arg_type argument for constant conversion.
8052         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8053
8054 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8055
8056         Fix bug #59760
8057         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
8058         OperatorArrayList, MethodCoreArrayList for typecontainer
8059         containers. Changed class member types to these new types.
8060         (MethodArrayList.DefineMembers): Added test for CS0659.
8061
8062 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
8063
8064         * cfold.cs: Synchronize the folding with the code in expression.cs
8065         Binary.DoNumericPromotions for uint operands.
8066
8067         * attribute.cs: Revert patch from Raja, it introduced a regression
8068         while building Blam-1.2.1 (hard to isolate a test case).
8069
8070 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8071
8072         Fix for #55382
8073         * class.cs:
8074         (TypeContainer.Define): Renamed to DefineContainerMembers because of
8075         name collision.
8076         (MethodCore.parent_method): New member. The method we're overriding
8077         if this is an override method.
8078         (MethodCore.CheckBase): Moved from Method class and made common.
8079         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8080         private.
8081         (MethodCore.CheckForDuplications): New abstract method. For custom
8082         member duplication search in a container
8083         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8084         method and its return type.
8085         (Event.conflict_symbol): New member. Symbol with same name in the
8086         parent class.
8087
8088         * decl.cs:
8089         (MemberCache.FindMemberWithSameName): New method. The method
8090         is looking for conflict with inherited symbols.
8091
8092 2004-08-04  Martin Baulig  <martin@ximian.com>
8093
8094         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8095
8096         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8097
8098 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8099
8100         * report.cs (Message): New enum for better error, warning reference in
8101         the code.
8102         (MessageData): New inner abstract class. It generally handles printing of
8103         error and warning messages.
8104         Removed unused Error, Warning, Message methods.
8105
8106 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8107
8108         Fix for cs0592-8.cs test
8109         * attribute.cs
8110         (Attributable.ValidAttributeTargets): Made public.
8111         (Attribute.ExplicitTarget): New member for explicit target value.
8112         (Attribute.CheckTargets): Now we translate explicit attribute
8113         target to Target here.
8114
8115 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
8116
8117         * ecore.cs (MethodGroupExpr): new IsBase property.
8118
8119         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8120
8121         * delegate.cs (DelegateCreation): store a MethodGroupExpr
8122         rather than an instance expr.
8123
8124         (DelegateCreation.Emit): Use the method group rather than
8125         the instance expression. Also, if you have base.Foo as the
8126         method for a delegate, make sure to emit ldftn, not ldftnvirt.
8127
8128         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
8129
8130         (NewDelegate.DoResolve): Only check for the existance of Invoke
8131         if the method is going to be needed. Use MethodGroupExpr.
8132
8133         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
8134
8135         * expression.cs: For pointer arith., make sure to use
8136         the size of the type, not the size of the pointer to
8137         the type.
8138
8139 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8140
8141         Fix for #60722
8142         * class.cs (Class): Added error CS0502 test.
8143
8144 2004-08-03  John Luke  <jluke@cfl.rr.com>
8145             Raja R Harinath  <rharinath@novell.com>
8146
8147         Fix for #60997.
8148         * attribute.cs (Attribute.complained_before): New flag.
8149         (Attribute.ResolveType, Attribute.Resolve),
8150         (Attribute.DefinePInvokeMethod): Set it.
8151         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8152         
8153 2004-08-03  Martin Baulig  <martin@ximian.com>
8154
8155         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8156         use a user-defined operator; we still need to do numeric
8157         promotions in case one argument is a builtin type and the other
8158         one has an implicit conversion to that type.  Fixes #62322.
8159
8160 2004-08-18  Martin Baulig  <martin@ximian.com>
8161
8162         * class.cs (Method.Define): Use the correct method name when
8163         creating the MethodBuilder for a generic method.
8164
8165 2004-08-17  Martin Baulig  <martin@ximian.com>
8166
8167         * generic.cs (Constraints): Support type parameter constraints.
8168
8169 2004-08-16  Martin Baulig  <martin@ximian.com>
8170
8171         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
8172         (Token.GENERIC_DIMENSION): New token; this is returned if we
8173         encounter an unbound generic type in a typeof() expression.
8174
8175         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
8176         this token is only generated while parsing a typeof() expression.
8177         (typeof_expression): Removed the old unbound_type hack.
8178
8179         * generic.cs (TypeArguments.IsUnbound): New public property.
8180
8181         * decl.cs (MemberName): Added support for unbound types.
8182
8183 2004-08-14  Martin Baulig  <martin@ximian.com>
8184
8185         * typemanager.cs
8186         (TypeManager.IsEqualGenericInstance): New static method.
8187         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
8188         just used to check accessibility, so follow the rules of 26.1.6.        
8189
8190         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
8191         ConstructedType instead of a TypeExpression if we have type arguments.
8192
8193         * cs-parser.jay (typeof_expression): Support unbound generic types.
8194
8195         * ecore.cs (UnboundTypeExpression): New public class.
8196
8197 2004-08-12  Martin Baulig  <martin@ximian.com>
8198
8199         * typemanager.cs (TypeManager.IsNestedChildOf): Use
8200         TypeManager.IsEqual() rather than `=='.
8201
8202         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
8203         generic instances as well.
8204
8205 2004-08-12  Martin Baulig  <martin@ximian.com>
8206
8207         * expression.cs (Invocation.InferType): We can only infer method
8208         type parameters.  Fixes #62647.
8209
8210 2004-08-11  Martin Baulig  <martin@ximian.com>
8211
8212         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
8213         before resolving the base classes.
8214
8215 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8216
8217         * Makefile: install .mdb file too.
8218
8219 2004-08-05  Martin Baulig  <martin@ximian.com>
8220
8221         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
8222         initializer, the current type is just the TypeBuilder, not the
8223         instantiated generic type.
8224         (FieldExpr.IsFieldInitializer): New public property.
8225
8226 2004-08-04  Martin Baulig  <martin@ximian.com>
8227
8228         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8229
8230         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8231
8232 2004-08-03  Martin Baulig  <martin@ximian.com>
8233
8234         * class.cs (MethodData.Define): If we're an explicit
8235         implementation, remove the generic arity from the type name.
8236
8237 2004-08-03  Martin Baulig  <martin@ximian.com>
8238
8239         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8240         use a user-defined operator; we still need to do numeric
8241         promotions in case one argument is a builtin type and the other
8242         one has an implicit conversion to that type.  Fixes #62322.
8243
8244 2004-08-02  Martin Baulig  <martin@ximian.com>
8245
8246         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
8247         `TypeExpr[]' array.
8248         (TypeContainer.GetClassBases): Return the unexpanded list of
8249         interfaces; we expand them later.
8250         (TypeContainer.DefineType): After creating the TypeBuilder, call
8251         TypeManager.ExpandInterfaces() to get an expanded and resolved
8252         list of interfaces.
8253
8254         * ecore.cs (TypeExpr.GetInterfaces): Removed
8255
8256         * generics.cs (Constraints.InterfaceConstraints): Remove.
8257         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
8258         register the interface constraints.
8259
8260         * typemanager.cs
8261         (TypeManager.AddUserType): Removed the `ifaces' argument.
8262         (TypeManager.AddTypeParameter): Likewise.
8263         (TypeManager.AddUserInterface): Removed, was unused.
8264         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
8265         `TypeExpr[]' array for the interfaces.
8266         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
8267         has been defined, returns a list of the resolved interfaces types.
8268         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
8269         (TypeManager.GetExplicitInterfaces): Likewise.  
8270
8271 2004-08-02  Martin Baulig  <martin@ximian.com>
8272
8273         * expression.cs (Invocation.EmitCall): If we're invoking a method
8274         on a type parameter, use the new `Constrained' prefix opcode.
8275
8276 2004-08-02  Martin Baulig  <martin@ximian.com>
8277
8278         * statement.cs (LocalInfo.Flags): Added `IsThis'.
8279         (LocalInfo.IsThis): New public property.
8280         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8281
8282 2004-08-01  Martin Baulig  <martin@ximian.com>
8283
8284         * class.cs (TypeContainer.GetClassBases): Don't set the default
8285         here since we may get called from GetPartialBases().
8286         (TypeContainer.DefineType): If GetClassBases() didn't return a
8287         parent, use the default one.
8288
8289 2004-07-30  Martin Baulig  <martin@ximian.com>
8290
8291         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8292
8293         * class.cs (SourceMethod): New public class, derive from the
8294         symbol writer's ISourceMethod.
8295         (Method): Use the new symbol writer API.
8296
8297         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8298         as argument and use the new symbol writer.
8299
8300         * location.cs
8301         (SourceFile): Implement the symbol writer's ISourceFile.
8302         (Location.SymbolDocument): Removed.
8303         (Location.SourceFile): New public property.
8304
8305         * symbolwriter.cs: Use the new symbol writer API.
8306
8307 2004-07-30  Raja R Harinath  <rharinath@novell.com>
8308
8309         * Makefile (install-local): Remove.  Functionality moved to
8310         executable.make.
8311
8312 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
8313
8314         * Makefile: Install mcs.exe.config file together with mcs.exe.
8315         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8316         correct runtime version.
8317         
8318 2004-07-25  Martin Baulig  <martin@ximian.com>
8319
8320         * class.cs
8321         (TypeContainer.RegisterOrder): Removed, this was unused.
8322         (TypeContainer, interface_order): Removed.
8323         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8324         TypeContainer as argument since we can also be called with a
8325         `PartialContainer' for a partial class/struct/interface.
8326         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8327         of checking whether we're an `Interface' - we could be a
8328         `PartialContainer'.
8329         (PartialContainer.Register): Override; call
8330         AddClass()/AddStruct()/AddInterface() on our parent.
8331
8332         * cs-parser.jay (interface_member_declaration): Add things to the
8333         `current_container', not the `current_class'.
8334
8335         * rootcontext.cs (RegisterOrder): The overloaded version which
8336         takes an `Interface' was unused, removed.
8337
8338         * typemanager.cs (TypeManager.LookupInterface): Return a
8339         `TypeContainer', not an `Interface'.
8340         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8341         contain a `PartialContainer' for an interface, so check it's
8342         `Kind' to figure out what it is.
8343
8344 2004-07-25  Martin Baulig  <martin@ximian.com>
8345
8346         * class.cs (Class.DefaultTypeAttributes): New public constant.
8347         (Struct.DefaultTypeAttributes): Likewise.
8348         (Interface.DefaultTypeAttributes): Likewise.
8349         (PartialContainer.TypeAttr): Override this and add the
8350         DefaultTypeAttributes.
8351
8352 2004-07-25  Martin Baulig  <martin@ximian.com>
8353
8354         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8355         we can just use the `Parent' field instead.
8356
8357 2004-07-25  Martin Baulig  <martin@ximian.com>
8358
8359         * class.cs (TypeContainer.Emit): Renamed to EmitType().
8360
8361 2004-07-25  Martin Baulig  <martin@ximian.com>
8362
8363         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8364         our parts before defining any methods.
8365         (TypeContainer.VerifyImplements): Make this virtual.
8366         (ClassPart.VerifyImplements): Override and call VerifyImplements()
8367         on our PartialContainer.
8368
8369 2004-07-25  Martin Baulig  <martin@ximian.com>
8370
8371         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8372
8373         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8374         argument, we can just use the `Parent' field instead.
8375
8376         * class.cs
8377         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
8378         (MemberBase.DoDefine): Likewise.
8379
8380 2004-07-24  Martin Baulig  <martin@ximian.com>
8381
8382         * decl.cs (MemberCore.Parent): New public field.
8383         (DeclSpace.Parent): Moved to MemberCore.
8384
8385         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8386         (MemberBase.ctor): Added TypeContainer argument, pass it to our
8387         parent's .ctor.
8388         (FieldBase, Field, Operator): Likewise.
8389         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8390         (EventField, Event): Likewise.
8391
8392 2004-07-23  Martin Baulig  <martin@ximian.com>
8393
8394         * class.cs (PartialContainer): New public class.
8395         (ClassPart): New public class.
8396         (TypeContainer): Added support for partial classes.
8397         (TypeContainer.GetClassBases): Splitted some of the functionality
8398         out into GetNormalBases() and GetPartialBases().
8399
8400         * cs-tokenizer.cs (Token.PARTIAL): New token.
8401         (Tokenizer.consume_identifier): Added some hacks to recognize
8402         `partial', but only if it's immediately followed by `class',
8403         `struct' or `interface'.
8404
8405         * cs-parser.jay: Added support for partial clases.
8406
8407 2004-07-23  Martin Baulig  <martin@ximian.com>
8408
8409         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8410         a `DeclSpace' and also made it readonly.
8411         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8412         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8413         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8414
8415         * cs-parser.jay: Pass the `current_class', not the
8416         `current_container' (at the moment, this is still the same thing)
8417         to a new Method, Property, Event, Indexer or Constructor.
8418
8419 2004-07-23  Martin Baulig  <martin@ximian.com>
8420
8421         * cs-parser.jay (CSharpParser): Added a new `current_class' field
8422         and removed the `current_interface' one.
8423         (struct_declaration, class_declaration, interface_declaration):
8424         Set `current_class' to the newly created class/struct/interface;
8425         set their `Bases' and call Register() before parsing their body.
8426
8427 2004-07-23  Martin Baulig  <martin@ximian.com>
8428
8429         * class.cs (Kind): New public enum.
8430         (TypeContainer): Made this class abstract.
8431         (TypeContainer.Kind): New public readonly field.
8432         (TypeContainer.CheckDef): New public method; moved here from
8433         cs-parser.jay.
8434         (TypeContainer.Register): New public abstract method.
8435         (TypeContainer.GetPendingImplementations): New public abstract
8436         method.
8437         (TypeContainer.GetClassBases): Removed the `is_class' and
8438         `is_iface' parameters.
8439         (TypeContainer.DefineNestedTypes): Formerly known as
8440         DoDefineType().
8441         (ClassOrStruct): Made this class abstract.
8442
8443         * tree.cs (RootTypes): New public type. 
8444
8445 2004-07-20  Martin Baulig  <martin@ximian.com>
8446
8447         * tree.cs (Tree.RecordNamespace): Removed.
8448         (Tree.Namespaces): Removed.
8449
8450         * rootcontext.cs (RootContext.IsNamespace): Removed.
8451
8452         * cs-parser.jay (namespace_declaration): Just create a new
8453         NamespaceEntry here.
8454
8455 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
8456
8457         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
8458         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
8459         entry to make sure it runs in the correct runtime version.
8460         
8461 2004-07-18  Martin Baulig  <martin@ximian.com>
8462
8463         * generic.cs (ConstructedType.CheckConstraints): Improved
8464         constraints checking.
8465
8466 2004-07-18  Martin Baulig  <martin@ximian.com>
8467
8468         * expression.cs (Invocation.BetterMethod): Call
8469         TypeManager.TypeToCoreType() on all types and removed my previous
8470         hack; we're already doig the right thing here.
8471
8472 2004-07-17  Martin Baulig  <martin@ximian.com>
8473
8474         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
8475
8476 2004-07-16  Martin Baulig  <martin@ximian.com>
8477
8478         * iterators.cs: Added generics support.
8479
8480 2004-07-16  Martin Baulig  <martin@ximian.com>
8481
8482         * iterators.cs: Rewrote this.  We're now using one single Proxy
8483         class for both the IEnumerable and the IEnumerator interface and
8484         `Iterator' derives from Class so we can use the high-level API.
8485
8486         * class.cs (TypeContainer.AddIterator): New method.
8487         (TypeContainer.DoDefineType): New protected virtual method, which
8488         is called from DefineType().
8489         (TypeContainer.DoDefineMembers): Call DefineType() and
8490         DefineMembers() on all our iterators.
8491         (TypeContainer.Emit): Call Emit() on all our iterators.
8492         (TypeContainer.CloseType): Call CloseType() on all our iterators.
8493
8494         * codegen.cs (EmitContext.CurrentIterator): New public field.
8495
8496 2004-07-15  Martin Baulig  <martin@ximian.com>
8497
8498         * typemanager.cs
8499         (TypeManager.not_supported_exception_type): New type.   
8500
8501 2004-07-14  Martin Baulig  <martin@ximian.com>
8502
8503         * typemanager.cs
8504         (TypeManager.generic_ienumerable_type): New type.
8505         (TypeManager.generic_ienumerator_type): New type.
8506
8507         * rootcontext.cs
8508         (RootContext.interfaces_first_stage): Added
8509         "System.Collections.Generic.IEnumerator`1" and
8510         "System.Collections.Generic.IEnumerable`1".     
8511
8512 2004-07-14  Martin Baulig  <martin@ximian.com>
8513
8514         * iterators.cs: Use real error numbers.
8515
8516 2004-07-14  Martin Baulig  <martin@ximian.com>
8517
8518         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8519         requires this to be a System.Collection.IEnumerable and not a
8520         class implementing that interface.
8521         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
8522
8523 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
8524
8525         * class.cs: Fixed previous fix, it broke some error tests.
8526
8527 2004-07-12  Martin Baulig  <martin@ximian.com>
8528
8529         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8530         Fixes #61293.
8531
8532 2004-07-14  Martin Baulig  <martin@ximian.com>
8533
8534         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
8535         an exclamation mark (!) for the generic arity to reflect the
8536         latest spec changes; ie. use "System.Collections.Generic.IList`1".
8537
8538 2004-07-13  Martin Baulig  <martin@ximian.com>
8539
8540         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
8541         specifiers being part of a type argument.
8542
8543 2004-07-13  Martin Baulig  <martin@ximian.com>
8544
8545         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
8546         name for generic types.
8547
8548 2004-07-13  Martin Baulig  <martin@ximian.com>
8549
8550         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
8551         bit to fix #60119.
8552
8553 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
8554
8555         * assign.cs (LocalTemporary): Add new argument: is_address,If
8556         `is_address' is true, then the value that we store is the address
8557         to the real value, and not the value itself.
8558         
8559         * ecore.cs (PropertyExpr): use the new local temporary
8560         stuff to allow us to handle X.Y += z (where X is a struct)
8561
8562 2004-07-08  Martin Baulig  <martin@ximian.com>
8563
8564         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8565         not always return, just like we're doing in Using.Resolve().
8566
8567 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
8568
8569         * cs-parser.jay (fixed_statement): flag this as Pinned.
8570
8571 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
8572
8573         * typemanager.cs (TypeManager): Removed MakePinned method, this
8574         mechanism is replaced with the .NET 2.x compatible mechanism of
8575         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8576
8577         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
8578         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8579         `IsFixed' property which has a different meaning.
8580
8581 2004-07-02  Raja R Harinath  <rharinath@novell.com>
8582
8583         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8584         visible from inside a nested class, not just the names of the
8585         immediately enclosing class.
8586         Fix for bug #60730.
8587
8588 2004-06-24  Raja R Harinath  <rharinath@novell.com>
8589
8590         * expression.cs (BetterConversion): Remove buggy special-case
8591         handling of "implicit constant expression conversions".  At this
8592         point, we already know that the conversion is possible -- we're
8593         only checking to see which is better.
8594
8595 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8596
8597         * cs-parser.jay: Added error CS0210 test.
8598
8599 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8600
8601         * cs-parser.jay: Added error CS0134 test.
8602
8603 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8604
8605         Fix bug #52507
8606         * cs-parser.jay: Added error CS0145 test.
8607
8608 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8609
8610         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8611
8612 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
8613         
8614         * expression.cs (StackAlloc.Resolve): The argument may not
8615         be a constant; deal with this case.
8616         
8617 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
8618
8619         * attribute.cs (IndexerName_GetIndexerName): Renamed to
8620         GetIndexerAttributeValue.
8621         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8622
8623         * class.cs (Indexer.Define): Added error tests for CS0415,
8624         CS0609.
8625
8626 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
8627
8628         * attribute.cs (Attribute.Resolve): Keep field code in sync with
8629         property code.
8630
8631 2004-06-23  Martin Baulig  <martin@ximian.com>
8632
8633         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8634         neither return nor throw, reset the barrier as well.  Fixes #60457.
8635
8636 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
8637
8638         * class.cs : EventAttributes is now set to None by default.
8639           This fixes bug #60459.
8640
8641 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8642
8643         Fix bug #60219
8644         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8645         Don't throw exception but return null (it's sufficient now).
8646
8647 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8648
8649         * typemanager.cs (GetArgumentTypes): Faster implementation.
8650
8651 2004-06-18  Martin Baulig  <martin@ximian.com>
8652
8653         * attribute.cs (Attribute.Resolve): Check whether we're an
8654         EmptyCast which a Constant child.  Fixes #60333.
8655
8656 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
8657
8658         * statement.cs (EmitCollectionForeach): Account for the fact that
8659         not all valuetypes are in areas which we can take the address of.
8660         For these variables, we store to a temporary variable. Also, make
8661         sure that we dont emit a `callvirt' on a valuetype method.
8662
8663 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8664
8665         * expression.cs (StackAlloc.DoReSolve): Added test for
8666         negative parameter (CS0247).
8667
8668 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8669
8670         Fix bug #59792
8671         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8672
8673 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8674
8675         Fix bug #59781
8676         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8677         ulong.
8678
8679 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8680
8681         Fix bug #58254 & cs1555.cs, cs1556.cs
8682         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8683
8684 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8685
8686         * cs-parser.jay: Added error CS1669 test for indexers.
8687
8688 2004-06-18  Martin Baulig  <martin@ximian.com>
8689
8690         * generics.cs (GenericMethod.ctor): Don't take an Attributes
8691         argument.  Fixes #60441.
8692
8693 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
8694         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
8695         The name needs to have the actual name of the method in order
8696         for other tests (such as the one in OverloadResolve for Invoke
8697         on a delegate) to work. As well, it does not really help
8698         error reporting because the method group had multiple methods.
8699         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
8700         Make profiling work.
8701         
8702 2004-06-13  Martin Baulig  <martin@ximian.com>
8703
8704         * cs-parser.jay: Don't allow generic attributes.
8705
8706 2004-06-13  Martin Baulig  <martin@ximian.com>
8707
8708         * class.cs (MemberBase.DoDefineBase): New protected method.
8709         (MemberBase.DoDefine): Compute the `flags' in the new
8710         DoDefineBase() which must be called first.
8711         (Method.Define): Call DoDefineBase() first so we have the flags
8712         when defining the generic method.
8713
8714         * cs-parser.jay (interface_method_declaration): Support generic methods.
8715
8716 2004-06-13  Martin Baulig  <martin@ximian.com>
8717
8718         * decl.cs (TypeName): Removed.
8719         (MemberName): Removed TypeName and MemberNow; now we just have
8720         MemberName.
8721
8722         * cs-parser.jay: Don't distinguish between type arguments and type
8723         parameters in the grammar and simplified the rules a bit.  The
8724         reduce/reduce conflicts are now gone (except the one we inherited
8725         from mcs).
8726
8727 2004-06-11  Martin Baulig  <martin@ximian.com>
8728
8729         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
8730         call this twice: for params and varargs methods.
8731
8732 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8733
8734         * class.cs:
8735         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
8736
8737 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8738
8739         * attribute.cs (Attribute.GetValidTargets): Made public.
8740
8741         * class.cs: 
8742         (AbstractPropertyEventMethod): New class for better code sharing.
8743         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
8744         CS1667 report.
8745         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
8746
8747 2004-06-09  Martin Baulig  <martin@ximian.com>
8748
8749         * cs-parser.jay: Removed a reduce/reduce conflict.
8750
8751 2004-06-03  Martin Baulig  <martin@ximian.com>
8752
8753         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
8754         GetSimpleName() and return a SimpleName.
8755
8756         * ecore.cs (SimpleName.Arguments): New public field.
8757         (SimpleName): Added overloaded ctor which takes an additional
8758         TypeArguments argument.
8759         (SimpleName.SimpleNameResolve): Added support for generic methods.
8760         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
8761         formerly in MemberAccess.DoResolve(), but we also need it in
8762         SimpleNameResolve().
8763
8764         * expression.cs (MemberAccess.DoResolve): Use the new
8765         MethodGroupExpr.ResolveGeneric().       
8766
8767 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8768
8769         * decl.cs: If possible, use lookuptypedirect here. We can only do
8770         this if there is no `.' after the namespace. Avoids using
8771         LookupType, which does lots of slow processing.
8772         (FindNestedType) New method, does what it says :-).
8773         * namespace.cs: use LookupTypeDirect.
8774         * rootcontext.cs: use membercache, if possible.
8775         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8776
8777 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8778
8779         * expression.cs:
8780         According to the spec, 
8781
8782         In a member access of the form E.I, if E is a single identifier,
8783         and if the meaning of E as a simple-name (§7.5.2) is a constant,
8784         field, property, localvariable, or parameter with the same type as
8785         the meaning of E as a type-name (§3.8), then both possible
8786         meanings of E are permitted.
8787
8788         We did not check that E as a simple-name had the same type as E as
8789         a type name.
8790
8791         This trivial check gives us 5-7% on bootstrap time.
8792
8793 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8794
8795         * expression.cs (Invocation.OverloadResolve): Avoid the
8796         use of hashtables and boxing here by allocating on demand.
8797
8798 2004-05-30  Martin Baulig  <martin@ximian.com>
8799
8800         * rootcontext.cs (RootContext.LookupType): Don't cache things if
8801         we're doing a silent lookup.  Don't try to lookup nested types in
8802         TypeManager.object_type (thanks to Ben Maurer).
8803
8804 2004-05-30  Martin Baulig  <martin@ximian.com>
8805
8806         Committing a patch from Ben Maurer.
8807
8808         * rootcontext.cs (RootContext.LookupType): Cache negative results.
8809
8810 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8811
8812         * convert.cs: add a trivial cache for overload operator resolution.
8813
8814 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
8815
8816         * attribute.cs
8817         (AttributeTester.GetObsoleteAttribute): Returns instance of
8818         ObsoleteAttribute when type is obsolete.
8819
8820         * class.cs
8821         (TypeContainer.VerifyObsoleteAttribute): Override.
8822         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
8823         (MethodCode.VerifyObsoleteAttribute): Override.
8824         (MemberBase.VerifyObsoleteAttribute): Override.
8825
8826         * decl.cs
8827         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
8828         and report proper error.
8829
8830         *delegate.cs
8831         (Delegate.VerifyObsoleteAttribute): Override.
8832
8833         * ecore.cs
8834         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
8835         and report proper error.
8836         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
8837
8838         * enum.cs
8839         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
8840         and enum member.
8841
8842         * expression.cs
8843         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
8844         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
8845         Added test for ObsoleteAttribute.
8846
8847         * statement.cs
8848         (Catch): Derived from Statement.
8849
8850 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8851
8852         * decl.cs: If possible, use lookuptypedirect here. We can only do
8853         this if there is no `.' after the namespace. Avoids using
8854         LookupType, which does lots of slow processing.
8855         (FindNestedType) New method, does what it says :-).
8856         * namespace.cs: use LookupTypeDirect.
8857         * rootcontext.cs: use membercache, if possible.
8858         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8859
8860 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8861
8862         * expression.cs:
8863         According to the spec, 
8864
8865         In a member access of the form E.I, if E is a single identifier,
8866         and if the meaning of E as a simple-name (§7.5.2) is a constant,
8867         field, property, localvariable, or parameter with the same type as
8868         the meaning of E as a type-name (§3.8), then both possible
8869         meanings of E are permitted.
8870
8871         We did not check that E as a simple-name had the same type as E as
8872         a type name.
8873
8874         This trivial check gives us 5-7% on bootstrap time.
8875
8876 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
8877
8878         Fixed bug #59071 & cs0160.cs
8879         * statement.cs (Try.Resolve): Check here whether order of catch
8880         clauses matches their dependencies.
8881
8882 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
8883
8884         Fixed bug #58624
8885         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
8886         unsafe type.
8887
8888 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8889
8890         * expression.cs (Invocation.OverloadResolve): Avoid the
8891         use of hashtables and boxing here by allocating on demand.
8892
8893 2004-05-30  Martin Baulig  <martin@ximian.com>
8894
8895         * rootcontext.cs (RootContext.LookupType): Don't cache things if
8896         we're doing a silent lookup.  Don't try to lookup nested types in
8897         TypeManager.object_type (thanks to Ben Maurer).
8898
8899 2004-05-30  Martin Baulig  <martin@ximian.com>
8900
8901         Committing a patch from Ben Maurer.
8902
8903         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
8904
8905 2004-05-29  Martin Baulig  <martin@ximian.com>
8906
8907         * class.cs (IMethodData.ShouldIgnore): New method.
8908
8909         * typemanager.cs (TypeManager.MethodFlags): Don't take a
8910         `Location' argument, we don't need it anywhere.  Use
8911         `IMethodData.ShouldIgnore ()' instead of
8912         `MethodData.GetMethodFlags ()'.
8913         (TypeManager.AddMethod): Removed.
8914         (TypeManager.AddMethod2): Renamed to AddMethod.
8915
8916 2004-05-29  Martin Baulig  <martin@ximian.com>
8917
8918         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
8919
8920         * convert.cs (Convert.ImplicitReferenceConversion): If we're
8921         converting from a class type S to an interface type and we already
8922         have an object on the stack, don't box it again.  Fixes #52578.
8923
8924 2004-05-29  Martin Baulig  <martin@ximian.com>
8925
8926         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8927         Added support for `params' parameters.  Fixes #59267.
8928
8929 2004-05-29  Martin Baulig  <martin@ximian.com>
8930
8931         * literal.cs (NullPointer): Provide a private .ctor which sets
8932         `type' to TypeManager.object_type.  Fixes #59048.
8933
8934 2004-05-29  Martin Baulig  <martin@ximian.com>
8935
8936         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
8937         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
8938
8939         * ecore.cs (EventExpr.instance_expr): Make the field private.
8940
8941 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
8942
8943         Fixed bug #50080 & cs0214-2.cs
8944         * expression.cs (Cast.DoResolve): Check unsafe context here.
8945         
8946         * statement.cs (Resolve.DoResolve): Likewise.
8947
8948 2004-05-26  Martin Baulig  <martin@ximian.com>
8949
8950         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
8951
8952         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
8953         (RootContext.LookupType): Pass down the `silent' flag.
8954
8955 2004-05-25  Martin Baulig  <martin@ximian.com>
8956
8957         * expression.cs
8958         (MethodGroupExpr.IdenticalTypeName): New public property.
8959         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
8960         expression actually refers to a type.
8961
8962 2004-05-25  Martin Baulig  <martin@ximian.com>
8963
8964         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
8965         for #56176 and made it actually work.
8966
8967 2004-05-25  Martin Baulig  <martin@ximian.com>
8968
8969         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
8970         (FieldExpr, PropertyExpr): Override and implement
8971         CacheTemporaries.  Fixes #52279.
8972
8973 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
8974
8975         * location.cs: In the new compiler listing a file twice is a
8976         warning, not an error.
8977
8978 2004-05-24  Martin Baulig  <martin@ximian.com>
8979
8980         * enum.cs (Enum.DefineType): For the `BaseType' to be a
8981         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
8982
8983 2004-05-24  Martin Baulig  <martin@ximian.com>
8984
8985         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
8986         walking the `using' list.  Fixes #53921.
8987
8988 2004-05-24  Martin Baulig  <martin@ximian.com>
8989
8990         * const.cs (Const.LookupConstantValue): Added support for
8991         EmptyCast's; fixes #55251.
8992
8993 2004-05-24  Martin Baulig  <martin@ximian.com>
8994
8995         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
8996         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
8997         which does the CS0135 check.  The reason is that we first need to
8998         check whether the variable actually exists.
8999
9000 2004-05-24  Martin Baulig  <martin@ximian.com>
9001
9002         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9003         than RootContext.LookupType() to find the explicit interface
9004         type.  Fixes #58584.
9005
9006 2004-05-24  Raja R Harinath  <rharinath@novell.com>
9007
9008         * Makefile: Simplify.  Use executable.make.
9009         * mcs.exe.sources: New file.  List of sources of mcs.exe.
9010
9011 2004-05-24  Anders Carlsson  <andersca@gnome.org>
9012
9013         * decl.cs:
9014         * enum.cs:
9015         Use the invariant culture when doing String.Compare for CLS case
9016         sensitivity.
9017         
9018 2004-05-23  Martin Baulig  <martin@ximian.com>
9019
9020         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9021         don't have any dots.  Fixes #52622, added cs0246-8.cs.
9022
9023         * namespace.cs (NamespaceEntry.Lookup): Likewise.
9024
9025 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9026
9027         * class.cs (MemberBase.Define): Reuse MemberType member for 
9028         resolved type. Other methods can use it too.
9029
9030 2004-05-23  Martin Baulig  <martin@ximian.com>
9031
9032         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9033         the variable also exists in the current block (otherwise, we need
9034         to report a CS0103).  Fixes #58670.
9035
9036 2004-05-23  Martin Baulig  <martin@ximian.com>
9037
9038         * flowanalysis.cs (Reachability.Reachable): Compute this
9039         on-the-fly rather than storing it as a field.
9040
9041 2004-05-23  Martin Baulig  <martin@ximian.com>
9042
9043         * flowanalysis.cs (Reachability.And): Manually compute the
9044         resulting `barrier' from the reachability.      
9045        
9046 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9047
9048         Fix bug #57835
9049         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9050         instance of ObsoleteAttribute when symbol is obsolete.
9051
9052         * class.cs
9053         (IMethodData): Extended interface for ObsoleteAttribute support.
9054
9055 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9056
9057         * attribute.cs: Fix bug #55970
9058
9059 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9060
9061         Fix bug #52705
9062         * attribute.cs
9063         (GetObsoleteAttribute): New method. Creates the instance of
9064         ObsoleteAttribute.
9065         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9066         ObsoleteAttribute when member is obsolete.
9067         (AttributeTester.Report_ObsoleteMessage): Common method for
9068         Obsolete error/warning reporting.
9069
9070         * class.cs
9071         (TypeContainer.base_classs_type): New member for storing parent type.
9072
9073         * decl.cs
9074         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9075         for this MemberCore.
9076
9077 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9078
9079         * attribute.cs, const.cs: Fix bug #58590
9080
9081 2004-05-21  Martin Baulig  <martin@ximian.com>
9082
9083         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9084         out parameters if the end of the method is unreachable.  Fixes
9085         #58098. 
9086
9087 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9088
9089         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9090         Hari was right, why extra method.
9091
9092 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9093
9094         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9095
9096 2004-05-20  Martin Baulig  <martin@ximian.com>
9097
9098         * delegate.cs: Convert this file to Unix mode - like the original
9099         version in mcs is.
9100
9101 2004-05-20  Martin Baulig  <martin@ximian.com>
9102
9103         * attribute.cs: Convert this file to Unix mode - like the original
9104         version in mcs is.
9105
9106 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
9107
9108        Fix bug #58688 (MCS does not report error when the same attribute
9109        is assigned twice)
9110
9111        * attribute.cs (Attribute.Emit): Distinction between null and default.
9112
9113 2004-05-19  Raja R Harinath  <rharinath@novell.com>
9114
9115        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9116        of a top-level attribute without an attribute target.
9117        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
9118        Make non-static.
9119        (Attribute.Conditional_GetConditionName), 
9120        (Attribute.Obsolete_GetObsoleteMessage): Update.
9121        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
9122        part of ScanForIndexerName.
9123        (Attribute.CanIgnoreInvalidAttribute): New function.
9124        (Attribute.ScanForIndexerName): Move to ...
9125        (Attributes.ScanForIndexerName): ... here.
9126        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9127        (Attributes.Search): New internal variant that can choose not to
9128        complain if types aren't resolved.  The original signature now
9129        complains.
9130        (Attributes.GetClsCompliantAttribute): Use internal variant, with
9131        complaints suppressed.
9132        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9133        only if it not useful.
9134        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9135        top-level for attributes that are shared between the assembly
9136        and a top-level class.
9137        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9138        * class.cs: Update to reflect changes.
9139        (DefineIndexers): Fuse loops.
9140        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
9141        a couple more variants of attribute names.
9142
9143 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
9144
9145         Fix bug #52585 (Implemented explicit attribute declaration)
9146
9147         * attribute.cs:
9148         (Attributable.ValidAttributeTargets): New abstract method. It gets
9149         list of valid attribute targets for explicit target declaration.
9150         (Attribute.Target): It holds target itself.
9151         (AttributeSection): Removed.
9152         (Attribute.CheckTargets): New method. It checks whether attribute
9153         target is valid for the current element.
9154
9155         * class.cs:
9156         (EventProperty): New class. For events that are declared like
9157         property (with add and remove accessors).
9158         (EventField): New class. For events that are declared like field.
9159         class.cs
9160
9161         * cs-parser.jay: Implemented explicit attribute target declaration.
9162
9163         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
9164         Override ValidAttributeTargets.
9165
9166         * parameter.cs:
9167         (ReturnParameter): Class for applying custom attributes on 
9168         the return type.
9169         (ParameterAtribute): New class. Class for applying custom
9170         attributes on the parameter type.
9171
9172 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
9173
9174         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9175         definitions. 
9176
9177         (Method): Allow UNSAFE here.
9178
9179         * modifiers.cs: Support unsafe reporting.
9180
9181 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
9182
9183         * decl.cs: Fix bug #58478.
9184
9185 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9186
9187         * statement.cs: When checking for unreachable code on an EmptyStatement,
9188         set the location. Fixes bug #58488.
9189
9190 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
9191
9192         * driver.cs: Add -pkg handling.
9193
9194         From Gonzalo: UseShelLExecute=false
9195
9196 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
9197
9198         * attribute.cs:
9199         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9200         for attribute.
9201         (Attribute.IsClsCompliaceRequired): Moved to base for better
9202         accesibility.
9203         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9204         when attribute is AttributeUsageAttribute.
9205         (Attribute.GetValidTargets): Simplified.
9206         (Attribute.GetAttributeUsage): New method returns AttributeUsage
9207         attribute for this type.
9208         (Attribute.ApplyAttributes): Method renamed to Emit and make
9209         non-static.
9210         (GlobalAttributeSection): New class for special handling of global
9211         attributes (assembly, module).
9212         (AttributeSection.Emit): New method.
9213
9214         * class.cs: Implemented Attributable abstract methods.
9215         (MethodCore.LabelParameters): Moved to Parameter class.
9216         (Accessor): Is back simple class.
9217         (PropertyMethod): Implemented Attributable abstract class.
9218         (DelegateMethod): Implemented Attributable abstract class.
9219         (Event): New constructor for disctintion between normal Event
9220         and Event with accessors.
9221
9222         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9223
9224         * codegen.cs, const.cs, decl.cs, delegate.cs:
9225         (CommonAssemblyModulClass): Implemented Attributable abstract class
9226         and simplified.
9227
9228         * enum.cs: Implement IAttributeSupport interface.
9229         (EnumMember): New class for emum members. Implemented Attributable
9230         abstract class
9231
9232         * parameter.cs:
9233         (ParameterBase): Is abstract.
9234         (ReturnParameter): New class for easier [return:] attribute handling.
9235
9236         * typemanager.cs: Removed builder_to_attr.
9237
9238 2004-05-11  Raja R Harinath  <rharinath@novell.com>
9239
9240         Fix bug #57151.
9241         * attribute.cs (Attribute.GetPositionalValue): New function.
9242         * class.cs (TypeContainer.VerifyMembers): New function.
9243         (TypeContainer.Emit): Use it.
9244         (ClassOrStruct): New base class for Class and Struct.
9245         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
9246         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9247         class.
9248         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9249         then each non-static field should have a FieldOffset attribute.
9250         Otherwise, none of the fields should have a FieldOffset attribute.
9251         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
9252         and FieldOffset attributes.
9253         * typemanager.cs (TypeManager.struct_layout_attribute_type)
9254         (TypeManager.field_offset_attribute_type): New core types.
9255         (TypeManager.InitCoreTypes): Initialize them.
9256
9257 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
9258
9259         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9260         Return correct type.
9261         From bug #58270.
9262
9263 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
9264
9265         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9266         be implicitly converted to ulong.
9267         
9268         * expression.cs: The logic for allowing operator &, | and ^ worked
9269         was wrong, it worked before because we did not report an error in
9270         an else branch.  Fixes 57895.
9271
9272         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9273         allow volatile fields to be reference types.
9274
9275 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
9276
9277         * driver.cs: Add support for /debug-
9278
9279 2004-05-07  Raja R Harinath  <rharinath@novell.com>
9280
9281         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
9282         Add a 'complain' parameter to silence errors.
9283         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
9284         silently overlooked type-resolutions.
9285         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9286         to reflect changes.
9287         (Attributes.Search): New function.
9288         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9289         (Attributes.GetAttributeFullName): Remove hack.
9290         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
9291         Update to reflect changes.
9292         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9293         Use Attributes.Search instead of nested loops.
9294
9295 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
9296
9297         * decl.cs:
9298         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9299         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9300         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9301
9302         * report.cs: (Report.Warning): Renamed to Warning_T because of
9303         parameter collision.
9304
9305 2004-05-05  Raja R Harinath  <rharinath@novell.com>
9306
9307         * expression.cs (MemberAccess.ResolveMemberAccess):
9308         Exit with non-zero status after Report.Error.
9309         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9310         Likewise.
9311         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9312
9313 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9314
9315         * support.cs: Don't hang when the file is empty.
9316
9317 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9318
9319         * support.cs: In SeekableStreamReader, compute the preamble size of the
9320           underlying stream. Position changes should take into account that initial
9321           count of bytes.
9322
9323 2004-05-03  Todd Berman  <tberman@sevenl.net>
9324
9325         * driver.cs: remove unused GetSysVersion function.
9326
9327 2004-05-03  Todd Berman  <tberman@sevenl.net>
9328
9329         * driver.cs: Remove the hack from saturday, as well as the hack
9330         from jackson (LoadAssemblyFromGac), also adds the CWD to the
9331         link_paths to get that bit proper.
9332
9333 2004-05-01  Todd Berman  <tberman@sevenl.net>
9334
9335         * driver.cs: Try a LoadFrom before a Load, this checks the current
9336         path. This is currently a bug in mono that is be fixed, however, this
9337         provides a workaround for now. This will be removed when the bug
9338         is fixed.
9339
9340 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
9341
9342         * CryptoConvert.cs: Updated to latest version. Fix issue with 
9343         incomplete key pairs (#57941).
9344
9345 2004-05-01  Todd Berman  <tberman@sevenl.net>
9346
9347         * driver.cs: Remove '.' from path_chars, now System.* loads properly
9348         from the GAC
9349
9350 2004-04-30  Jackson Harper  <jackson@ximian.com>
9351
9352         * codegen.cs: Open keys readonly.
9353         
9354 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9355
9356         * typemanager.cs: don't report cyclic struct layout when a struct
9357         contains 2 or more fields of the same type. Failed for Pango.AttrShape
9358         which has 2 Pango.Rectangle fields.
9359
9360 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9361
9362         * expression.cs: Handle IntPtr comparisons with IL code
9363         rather than a method call.
9364
9365 2004-04-29  Martin Baulig  <martin@ximian.com>
9366
9367         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
9368         the list of PropertyInfo's in class hierarchy and find the
9369         accessor.  Fixes #56013.
9370
9371 2004-04-29  Martin Baulig  <martin@ximian.com>
9372
9373         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9374
9375 2004-04-29  Martin Baulig  <martin@ximian.com>
9376
9377         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9378
9379         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9380
9381 2004-04-29  Martin Baulig  <martin@ximian.com>
9382
9383         * class.cs (ConstructorInitializer.Resolve): Check whether the
9384         parent .ctor is accessible.  Fixes #52146.
9385
9386 2004-04-29  Martin Baulig  <martin@ximian.com>
9387
9388         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9389
9390         * statement.cs (Using.EmitLocalVariableDecls): Use
9391         TypeManager.idisposable_type, not typeof (IDisposable).
9392         (Foreach.EmitCollectionForeach): Added support for valuetypes.
9393
9394 2004-04-29  Martin Baulig  <martin@ximian.com>
9395
9396         * class.cs (Event.Define): Don't emit the field and don't set
9397         RTSpecialName and SpecialName for events on interfaces.  Fixes
9398         #57703. 
9399
9400 2004-04-29  Raja R Harinath  <rharinath@novell.com>
9401
9402         Refactor Attribute.ApplyAttributes.
9403         * attribute.cs (Attributable): New base class for objects that can
9404         have Attributes applied on them.
9405         (Attribute): Make AttributeUsage fields public.
9406         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9407         (Attribute.IsInternalCall): New property.
9408         (Attribute.UsageAttr): Convert to a public read-only property.
9409         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9410         (Attribute.ResolveType, Attribute.Resolve)
9411         (Attribute.ScanForIndexerName): Update to reflect changes.
9412         (Attribute.CheckAttributeTarget): Re-format.
9413         (Attribute.ApplyAttributes): Refactor, to various
9414         Attributable.ApplyAttributeBuilder methods.
9415         * decl.cs (MemberCore): Make Attributable.
9416         * class.cs (Accessor): Make Attributable.
9417         (MethodData.ApplyAttributes): Use proper attribute types, not
9418         attribute names.
9419         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9420         (TypeContainer.ApplyAttributeBuilder)
9421         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9422         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
9423         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9424         (Operator.ApplyAttributeBuilder): New factored-out methods.
9425         * const.cs (Const.ApplyAttributeBuilder): Likewise.
9426         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9427         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9428         * parameter.cs (ParameterBase): New Attributable base class
9429         that can also represent Return types.
9430         (Parameter): Update to the changes.
9431
9432 2004-04-29  Jackson Harper  <jackson@ximian.com>
9433
9434         * driver.cs: Prefer the corlib system version when looking for
9435         assemblies in the GAC. This is still a hack, but its a better hack
9436         now.
9437         
9438 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
9439
9440         * decl.cs, enum.cs: Improved error 3005 reporting.
9441   
9442         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9443         (related_symbols): New private member for list of symbols
9444         related to reported error/warning.
9445         
9446         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9447
9448 2004-04-29  Martin Baulig  <martin@ximian.com>
9449
9450         * ecore.cs (Expression.Constantify): If we're an enum and
9451         TypeManager.TypeToCoreType() doesn't give us another type, use
9452         t.UnderlyingSystemType.  Fixes #56178.  
9453
9454 2004-04-29  Martin Baulig  <martin@ximian.com>
9455
9456         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9457         interfaces and for each interface, only add members directly
9458         declared in that interface.  Fixes #53255.
9459
9460 2004-04-28  Martin Baulig  <martin@ximian.com>
9461
9462         * expression.cs (ConditionalLogicalOperator): Use a temporary
9463         variable for `left' to avoid that we evaluate it more than once;
9464         bug #52588.
9465
9466 2004-04-28  Martin Baulig  <martin@ximian.com>
9467
9468         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9469         `void[]' (CS1547).
9470
9471 2004-04-28  Martin Baulig  <martin@ximian.com>
9472
9473         * statement.cs (LocalInfo.Resolve): Check whether the type is not
9474         void (CS1547).
9475
9476         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9477         whether the type is not void (CS1547).
9478
9479 2004-04-28  Martin Baulig  <martin@ximian.com>
9480
9481         * expression.cs (Unary.DoResolveLValue): Override this and report
9482         CS0131 for anything but Operator.Indirection.
9483
9484 2004-04-28  Martin Baulig  <martin@ximian.com>
9485
9486         Committing a patch from Ben Maurer; see bug #50820.
9487
9488         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9489         check for classes.
9490
9491         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9492         classes.        
9493
9494 2004-04-28  Martin Baulig  <martin@ximian.com>
9495
9496         Committing a patch from Ben Maurer; see bug #50820.
9497
9498         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9499         check for classes.
9500
9501         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9502         classes.        
9503
9504 2004-04-28  Martin Baulig  <martin@ximian.com>
9505
9506         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9507         (Block.AddLabel): Call DoLookupLabel() to only search in the
9508         current block.
9509
9510 2004-04-28  Martin Baulig  <martin@ximian.com>
9511
9512         * cfold.cs (ConstantFold.BinaryFold): Added special support for
9513         comparing StringConstants and NullLiterals in Equality and Inequality.
9514
9515 2004-04-28  Jackson Harper  <jackson@ximian.com>
9516
9517         * driver.cs: Attempt to load referenced assemblies from the
9518         GAC. This is the quick and dirty version of this method that
9519         doesnt take into account versions and just takes the first
9520         canidate found. Will be good enough for now as we will not have more
9521         then one version installed into the GAC until I update this method.
9522
9523 2004-04-28  Martin Baulig  <martin@ximian.com>
9524
9525         * typemanager.cs (TypeManager.CheckStructCycles): New public
9526         static method to check for cycles in the struct layout.
9527
9528         * rootcontext.cs (RootContext.PopulateTypes): Call
9529         TypeManager.CheckStructCycles() for each TypeContainer.
9530         [Note: We only need to visit each type once.]
9531
9532 2004-04-28  Martin Baulig  <martin@ximian.com>
9533
9534         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9535
9536         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9537         success and added `out object value'.  Use a `bool resolved' field
9538         to check whether we've already been called rather than
9539         `ConstantValue != null' since this breaks for NullLiterals.
9540
9541 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9542
9543         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9544         setting of this flag, since the 'set' method may be non-public.
9545
9546 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9547
9548         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9549         check on current_vector.Block.
9550
9551 2004-04-27  Martin Baulig  <martin@ximian.com>
9552
9553         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9554         a field initializer.  Fixes #56459.
9555
9556 2004-04-27  Martin Baulig  <martin@ximian.com>
9557
9558         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9559         we're not attempting to use an indexer.  Fixes #52154.
9560
9561 2004-04-27  Martin Baulig  <martin@ximian.com>
9562
9563         * statement.cs (Return): Don't create a return label if we don't
9564         need it; reverts my change from January 20th.  Thanks to Ben
9565         Maurer for this.
9566
9567 2004-04-27  Martin Baulig  <martin@ximian.com>
9568
9569         According to the spec, `goto' can only leave a nested scope, but
9570         never enter it.
9571
9572         * statement.cs (Block.LookupLabel): Only lookup in the current
9573         block, don't recurse into parent or child blocks.
9574         (Block.AddLabel): Check in parent and child blocks, report
9575         CS0140/CS0158 if we find a duplicate.
9576         (Block): Removed this indexer for label lookups.
9577         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9578         this already does the error reporting for us.
9579
9580         * flowanalysis.cs
9581         (FlowBranching.UsageVector.Block): New public variable; may be null.
9582         (FlowBranching.CreateSibling): Added `Block' argument.
9583         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
9584         label for the target of a `goto' and check whether we're not
9585         leaving a `finally'.
9586
9587 2004-04-27  Martin Baulig  <martin@ximian.com>
9588
9589         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9590         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9591         just for returns).
9592
9593 2004-04-27  Martin Baulig  <martin@ximian.com>
9594
9595         * statement.cs (Block.AddLabel): Also check for implicit blocks
9596         and added a CS0158 check.
9597
9598 2004-04-27  Martin Baulig  <martin@ximian.com>
9599
9600         * flowanalysis.cs (FlowBranchingLoop): New class.
9601         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9602         UsageVector's instead of an ArrayList.
9603         (FlowBranching.Label): Likewise.
9604         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9605         (FlowBranching.AddBreakVector): New method.
9606
9607 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
9608
9609         * attribute.cs: Small regression fix: only convert the type if we
9610         the type is different, fixes System.Drawing build.
9611
9612 2004-04-27  Martin Baulig  <martin@ximian.com>
9613
9614         * attribute.cs (Attribute.Resolve): If we have a constant value
9615         for a named field or property, implicity convert it to the correct
9616         type.
9617
9618 2004-04-27  Raja R Harinath  <rharinath@novell.com>
9619
9620         * statement.cs (Block.Block): Implicit blocks share
9621         'child_variable_names' fields with parent blocks.
9622         (Block.AddChildVariableNames): Remove.
9623         (Block.AddVariable): Mark variable as "used by a child block" in
9624         every surrounding block.
9625         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9626         been used in a child block, complain about violation of "Invariant
9627         meaning in blocks" rule.
9628         * cs-parser.jay (declare_local_variables): Don't use
9629         AddChildVariableNames.
9630         (foreach_statement): Don't create an implicit block: 'foreach'
9631         introduces a scope.
9632
9633 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
9634
9635         * convert.cs (ImplicitNumericConversion): 0 is also positive when
9636         converting from 0L to ulong.  Fixes 57522.
9637
9638 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9639
9640         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9641         derived class hides via 'new' keyword field from base class (test-242.cs).
9642         TODO: Handle this in the more general way.
9643         
9644         * class.cs (CheckBase): Ditto.
9645
9646 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9647
9648         * decl.cs (caching_flags): New member for storing cached values
9649         as bit flags.
9650         (MemberCore.Flags): New enum where bit flags for caching_flags
9651         are defined.
9652         (MemberCore.cls_compliance): Moved to caching_flags.
9653         (DeclSpace.Created): Moved to caching_flags.
9654
9655         * class.cs: Use caching_flags instead of DeclSpace.Created
9656         
9657 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
9658
9659         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9660         if we are only a derived class, not a nested class.
9661
9662         * typemanager.cs: Same as above, but do this at the MemberLookup
9663         level (used by field and methods, properties are handled in
9664         PropertyExpr).   Allow for the qualified access if we are a nested
9665         method. 
9666
9667 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
9668
9669         * class.cs: Refactoring.
9670         (IMethodData): New inteface; Holds links to parent members
9671         to avoid member duplication (reduced memory allocation).
9672         (Method): Implemented IMethodData interface.
9673         (PropertyBase): New inner classes for get/set methods.
9674         (PropertyBase.PropertyMethod): Implemented IMethodData interface
9675         (Event): New inner classes for add/remove methods.
9676         (Event.DelegateMethod): Implemented IMethodData interface.
9677
9678         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9679         EmitContext (related to class.cs refactoring).
9680
9681 2004-04-21  Raja R Harinath  <rharinath@novell.com>
9682
9683         * delegate.cs (Delegate.VerifyApplicability): If the number of
9684         arguments are the same as the number of parameters, first try to
9685         verify applicability ignoring  any 'params' modifier on the last
9686         parameter.
9687         Fixes #56442.
9688
9689 2004-04-08  Martin Baulig  <martin@ximian.com>
9690
9691         Merged latest changes into gmcs.  Please keep this comment in
9692         here, it makes it easier for me to see what changed in MCS since
9693         the last time I merged.
9694
9695 2004-04-16  Raja R Harinath  <rharinath@novell.com>
9696
9697         * class.cs (TypeContainer.AddIndexer): Use
9698         'ExplicitInterfaceName' to determine if interface name was
9699         explicitly specified.  'InterfaceType' is not initialized at this time.
9700         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
9701         Indexers array is already in the required order.  Initialize
9702         'IndexerName' only if there are normal indexers.
9703         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
9704         (TypeContainer.Emit): Emit DefaultMember attribute only if
9705         IndexerName is initialized.
9706         Fixes #56300.
9707
9708 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
9709
9710         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
9711         Fixes #57007
9712
9713 2004-04-15  Raja R Harinath  <rharinath@novell.com>
9714
9715         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
9716         attributes.
9717         Fix for #56456.
9718
9719         * attribute.cs (Attribute.Resolve): Check for duplicate named
9720         attributes.
9721         Fix for #56463.
9722
9723 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
9724
9725         * iterators.cs (MarkYield): track whether we are in an exception,
9726         and generate code accordingly.  Use a temporary value to store the
9727         result for our state.
9728
9729         I had ignored a bit the interaction of try/catch with iterators
9730         since their behavior was not entirely obvious, but now it is
9731         possible to verify that our behavior is the same as MS .NET 2.0
9732
9733         Fixes 54814
9734
9735 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
9736
9737         * iterators.cs: Avoid creating temporaries if there is no work to
9738         do. 
9739
9740         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
9741         Enumerations, use TypeManager.EnumToUnderlying and call
9742         recursively. 
9743
9744         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
9745         bug #57013
9746
9747         (This.Emit): Use EmitContext.EmitThis to emit our
9748         instance variable.
9749
9750         (This.EmitAssign): Ditto.
9751
9752         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
9753         codepaths, we will move all the functionality into
9754         Mono.CSharp.This 
9755
9756         (FieldExpr.EmitAssign): Ditto.
9757
9758         This fixes several hidden bugs that I uncovered while doing a code
9759         review of this today.
9760
9761         * codegen.cs (EmitThis): reworked so the semantics are more clear
9762         and also support value types "this" instances.
9763
9764         * iterators.cs: Changed so that for iterators in value types, we
9765         do not pass the value type as a parameter.  
9766
9767         Initialization of the enumerator helpers is now done in the caller
9768         instead of passing the parameters to the constructors and having
9769         the constructor set the fields.
9770
9771         The fields have now `assembly' visibility instead of private.
9772
9773 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
9774
9775         * expression.cs (Argument.Resolve): Check if fields passed as ref
9776         or out are contained in a MarshalByRefObject.
9777
9778         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
9779         another compiler type.
9780
9781 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
9782
9783         * class.cs (Indexer.Define): use the new name checking method.
9784         Also, return false on an error.
9785         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
9786         (is_identifier_[start/part]_character): make static.
9787
9788 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
9789
9790         * expression.cs (Binary.ResolveOperator): Do no append strings
9791         twice: since we can be invoked more than once (array evaluation)
9792         on the same concatenation, take care of this here.  Based on a fix
9793         from Ben (bug #56454)
9794
9795 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
9796
9797         * codegen.cs: Fix another case where CS1548 must be reported (when 
9798         delay-sign isn't specified and no private is available #56564). Fix
9799         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
9800         error when MCS is used on the MS runtime and we need to delay-sign 
9801         (which seems unsupported by AssemblyBuilder - see #56621).
9802
9803 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
9804
9805         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
9806         (TypeManager.ComputeNamespaces): Faster implementation for
9807         Microsoft runtime.
9808
9809         * compiler.csproj: Updated AssemblyName to mcs.
9810
9811 2004-05-11  Jackson Harper  <jackson@ximian.com>
9812
9813         * Makefile: Preserve MONO_PATH
9814         
9815 2004-05-11  Jackson Harper  <jackson@ximian.com>
9816
9817         * Makefile: Use mono and mcs to build gmcs
9818         
9819 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
9820
9821         * codegen.cs: Add patch from Robert Shade
9822         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
9823         sync with mcs.
9824
9825 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
9826
9827         * CryptoConvert.cs: Updated to latest version. Fix issue with 
9828         incomplete key pairs (#57941).
9829
9830 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
9831
9832         * codegen.cs: Fix another case where CS1548 must be reported (when 
9833         delay-sign isn't specified and no private is available #56564). Fix
9834         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
9835         error when MCS is used on the MS runtime and we need to delay-sign 
9836         (which seems unsupported by AssemblyBuilder - see #56621).
9837
9838 2004-04-29  Jackson Harper  <jackson@ximian.com>
9839
9840         * Makefile: Set MONO_PATH to use the bootstrap corlib
9841         * driver.cs: Check the GAC for referenced assemblies.
9842                 
9843 2004-04-29  Martin Baulig  <martin@ximian.com>
9844
9845         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
9846
9847 2004-04-07  Martin Baulig  <martin@ximian.com>
9848
9849         * expression.cs (Binary.ResolveOperator): Added special case for
9850         Equality/Inequality between a type parameter and a null literal.
9851
9852 2004-04-07  Martin Baulig  <martin@ximian.com>
9853
9854         * convert.cs: Check null literal -> type parameter conversions.
9855
9856 2004-04-07  Martin Baulig  <martin@ximian.com>
9857
9858         * generic.cs (ConstructedType.CheckConstraints): Enforce the
9859         `class' and `struct' constraints.
9860
9861 2004-04-07  Martin Baulig  <martin@ximian.com>
9862
9863         * generic.cs (SpecialConstraint): New public enum.
9864         (Constraints.Resolve): Added support for the `class' and `struct'
9865         constraints.
9866
9867         * cs-parser.jay (type_parameter_constraint): Added support for the
9868         `class' and `struct' constraints.
9869
9870 2004-04-07  Martin Baulig  <martin@ximian.com>
9871
9872         * support.cs (GenericConstraints): Replaced `Types' by
9873         `ClassConstraint' and `InterfaceConstraints'; added
9874         `HasClassConstraint'.   
9875
9876 2004-04-07  Martin Baulig  <martin@ximian.com>
9877
9878         * generic.cs
9879         (Constraints.InterfaceConstraints): New public property.
9880         (Constraints.Types): Make this property public
9881         (TypeParameter): Implement IMemberContainer.
9882         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
9883         instead of a TypeBuilder/MethodBuilder; pass the interface
9884         constraints to TypeManager.AddTypeParameter().
9885         (TypeParameter.DefineType): Just take an EmitContext and no
9886         TypeBuilder/MethodBuilder.  Use the new public API.
9887
9888         * typemanager.cs (TypeManager.AddTypeParameter): Added
9889         `TypeExpr[]' argument; add the interfaces to the
9890         `builder_to_ifaces' hash.
9891         (TypeManager.LookupMemberContainer): For
9892         GenericTypeParameterBuilders, get the TypeParameter from the
9893         `builder_to_type_param'.
9894         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
9895         the TypeParameter and call FindMembers on it.
9896
9897 2004-04-07  Martin Baulig  <martin@ximian.com>
9898
9899         * class.cs
9900         (MethodCore.GenericMethod): Moved this field here from Method.
9901         (MethodCore.IsDuplicateImplementation): Take the number of type
9902         parameters into account if we're a generic method.
9903
9904         * expression.cs (Invocation.InferTypeArguments): Don't return true
9905         if `arguments' is null; we still need to check whether we actually
9906         don't need to infer anything in this case.
9907         (MemberAccess): Merged the functionality from GenericMemberAccess
9908         into this class.
9909
9910         * generic.cs (GenericMemberAccess): Removed.
9911
9912 2004-04-05  Martin Baulig  <martin@ximian.com>
9913
9914         * decl.cs (MemberCore): For generic classes, interfaces and
9915         structs, `Name' now includes the number of type parameters
9916         ("Stack!1.Node!1").
9917         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
9918         encode the number of type arguments in the type name.
9919
9920         * expression.cs (Expression.MemberLookup): Removed the
9921         `num_type_args' argument; we now encode the number of type
9922         arguments in the type name.
9923
9924         * ecore.cs (SimpleName): Encode the number of type arguments in
9925         the type name itself.
9926
9927         * generic.cs (ConstructedType): Likewise.
9928
9929         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
9930         `MemberName'; we now include the number of type parameters in the
9931         type name.
9932
9933         * typemanager.cs (TypeManager.CheckGeneric): Removed.
9934         (TypeManager.MemberLookup): Removed the
9935         `num_type_args' argument; we now encode the number of type
9936         arguments in the type name.     
9937
9938 2004-04-03  Martin Baulig  <martin@ximian.com>
9939
9940         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
9941         (MemberCore.MemberName): Moved here from MemberBase.
9942         (DeclSpace.SetParameterInfo): Just take the constraints as an
9943         ArrayList; we already have the type parameters in our
9944         `MemberName'; also do the CS0080 reporting here.
9945
9946         * cs-parser.jay (struct_declaration): Use `member_name' instead of
9947         `IDENTIFIER opt_type_parameter_list'; when constructing our
9948         `MemberName', it'll already include our type parameters.
9949         (class_declaration, interface_declaration): Likewise.
9950         (delegate_declaration): Likewise.
9951         (MakeName): Take a MemberName and return a MemberName.
9952         The following two changes are required to avoid shift/reduce conflicts:
9953         (member_name): Don't include a TypeName anymore; ie. this is now
9954         just 'IDENTIFIER opt_type_parameter_list'.
9955         (property_declaration, event_declaration): Use a
9956         `namespace_or_type_name' instead of a `member_name'.            
9957
9958 2004-04-03  Martin Baulig  <martin@ximian.com>
9959
9960         * decl.cs (MemberName): Renamed to `TypeName' and created a new
9961         `MemberName' class.
9962         (TypeName): Formerly known as MemberName.
9963
9964         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
9965         instead of a `MemberName'.
9966
9967         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
9968         (member_name): New rule; create a MemberName.
9969
9970 2004-04-02  Martin Baulig  <martin@ximian.com>
9971
9972         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
9973         (CS0305 and CS0308).
9974
9975 2004-04-02  Martin Baulig  <martin@ximian.com>
9976
9977         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
9978         support for nested types.
9979
9980 2004-04-02  Martin Baulig  <martin@ximian.com>
9981
9982         * ecore.cs (IAlias): New public interface.
9983         (TypeExpr, TypeExpression): Implement IAlias.
9984         (TypeAliasExpression): New public class.
9985
9986         * namespace.cs (Namespace): Implement IAlias.
9987         (Namespace.Lookup): Return an IAlias instead on an object.
9988         (Namespace.DefineName): Take an IAlias instead of an object.
9989         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
9990         an object.
9991         (NamespaceEntry.UsingAlias): Take a Membername instead of an
9992         Expression.
9993         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
9994         object.
9995         (NamespaceEntry.Lookup): Likewise.
9996
9997         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
9998         instead of a Type.      
9999
10000         * decl.cs (DeclSpace): Implement IAlias.
10001         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
10002
10003         * generic.cs (ConstructedType): Improved error checking.
10004
10005 2004-04-02  Martin Baulig  <martin@ximian.com>
10006
10007         * convert.cs: Added type parameter conversions.
10008
10009         * ecore.cs
10010         (UnboxCast.Emit): Emit an `unbox.any' for type params.
10011         (ClassCast.Emit): If the source type is a type parameter, box it.
10012         If the target type is a type parameter, emit an `unbox.any'
10013         instead of a `classcast'.1      
10014
10015 2004-04-01  Martin Baulig  <martin@ximian.com>
10016
10017         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
10018
10019 2004-04-01  Martin Baulig  <martin@ximian.com>
10020
10021         * generic.cs (ConstructedType.CheckConstraints): Use
10022         Convert.ImplicitStandardConversionExists(); user-defined implicit
10023         conversions are not allowed according to the spec.
10024
10025 2004-03-30  Martin Baulig  <martin@ximian.com>
10026
10027         * expression.cs (New): Added support for type parameters.
10028
10029         * typemanager.cs
10030         (TypeManager.activator_type): New public static field.
10031         (TypeManager.activator_create_instance): Likewise.
10032
10033 2004-03-30  Martin Baulig  <martin@ximian.com>
10034
10035         * typemanager.cs (TypeManager.HasConstructorConstraint): New
10036         public method.
10037
10038 2004-03-30  Martin Baulig  <martin@ximian.com>
10039
10040         * generic.cs (ConstructedType.CheckConstraints): Actually follow
10041         the spec here: the argument type must be convertible to the
10042         constraints.
10043
10044 2004-03-30  Martin Baulig  <martin@ximian.com>
10045
10046         * generic.cs
10047         (TypeParameter.Define, TypeParameter.DefineMethod): Call
10048         TypeManager.AddTypeParameter().
10049         (ConstructedType.CheckConstraints): Re-enable this and actually
10050         check whether we have a constructor constraint.
10051
10052         * typemanager.cs
10053         (TypeManager.builder_to_type_param): New static field.
10054         (TypeManager.AddTypeParameter): New static method.
10055         (TypeManager.LookupTypeParameter): New public method.
10056
10057 2004-03-30  Martin Baulig  <martin@ximian.com>
10058
10059         * generic.cs (TypeParameter.DefineType): Return a boolean and use
10060         the new API to actually define the constructor constraint.
10061
10062         * typemanager.cs
10063         (TypeManager.new_constraint_attr_type): New static field.
10064         (TypeManager.InitCoreTypes): Initialize it.
10065
10066 2004-03-30  Martin Baulig  <martin@ximian.com>
10067
10068         * generic.cs (Constraints): Completed error checking, use correct
10069         error numbers.
10070
10071 2004-03-29  Martin Baulig  <martin@ximian.com>
10072
10073         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
10074
10075         * expression.cs (Invocation.InferTypeArguments): Added overloaded
10076         public version which takes a `ParameterData pd' instead of an
10077         `ArrayList args'.
10078
10079 2004-03-29  Martin Baulig  <martin@ximian.com>
10080
10081         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
10082         not a MethodInfo.       
10083
10084 2004-03-29  Martin Baulig  <martin@ximian.com>
10085
10086         * expression.cs (Argument.ResolveMethodGroup): If we're a
10087         ConstructedType, call GetMemberAccess() on it.  
10088
10089 2004-03-29  Martin Baulig  <martin@ximian.com>
10090
10091         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
10092         (MethodCore.CheckGenericOverride): When overriding a generic
10093         method, check whether the constraints match.
10094
10095         * support.cs (GenericConstraints): New public interface.
10096         (ParameterData.GenericConstraints): New public method.
10097
10098         * parameter.cs (Parameter.Resolve): Check whether we're a generic
10099         method parameter and compute our constraints if appropriate.
10100         (Parameter.GenericConstraints): New public property.
10101
10102         * generic.cs (Constraints): Implement GenericConstraints.
10103
10104 2004-03-29  Martin Baulig  <martin@ximian.com>
10105
10106         * decl.cs (MemberCache.FindMemberToOverride): Use
10107         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
10108
10109 2004-03-29  Martin Baulig  <martin@ximian.com>
10110
10111         * generic.cs (GenericMethod.Define): Resolve our type parameters.
10112
10113 2004-03-29  Martin Baulig  <martin@ximian.com>
10114
10115         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
10116         not allowed on non-generic declarations").
10117
10118 2004-03-29  Martin Baulig  <martin@ximian.com>
10119
10120         * expression.cs (Invocation.InferTypeArguments): Added overloaded
10121         public version of this method.
10122
10123         * class.cs (MethodCore.IsDuplicateImplementation): Use
10124         Invocation.InferTypeArguments() to check this.
10125
10126 2004-03-29  Martin Baulig  <martin@ximian.com>
10127
10128         * convert.cs: Use TypeManager.IsDelegateType() instead of
10129         comparing types correctly.
10130
10131 2004-03-29  Martin Baulig  <martin@ximian.com>
10132
10133         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
10134         types directly to make it work for generic instances.
10135
10136         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
10137
10138 2004-03-29  Martin Baulig  <martin@ximian.com>
10139
10140         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
10141         support for arrays.     
10142
10143 2004-03-24  Martin Baulig  <martin@ximian.com>
10144
10145         * decl.cs (DeclSpace.FindType): Also use
10146         TypeManager.CheckGeneric() for types from the using clauses.
10147
10148 2004-03-23  Martin Baulig  <martin@ximian.com>
10149
10150         * expression.cs (Invocation.OverloadResolve): Added `bool
10151         may_fail' argument and use it instead of the Location.IsNull() hack.
10152
10153 2004-03-23  Martin Baulig  <martin@ximian.com>
10154
10155         * expression.cs (Invocation.InferType): Use correct type inference
10156         rules here.     
10157
10158 2004-03-23  Martin Baulig  <martin@ximian.com>
10159
10160         * ecore.cs (MethodGroupExpr.Name): Use
10161         TypeManager.CSharpSignature() instead of just the name.
10162
10163         * expression.cs (Invocation.OverloadResolve): Provide better error
10164         reporting.
10165         (Invocation.DoResolve): OverloadResolve() never returns null
10166         without reporting an error, so removed the error -6 reporting here.
10167
10168 2004-03-23  Martin Baulig  <martin@ximian.com>
10169
10170         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
10171         generic methods.
10172
10173         * cs-parser.jay (delegate_declaration): Support generic delegates.
10174
10175         * delegate.cs: Support generic delegates.
10176
10177 2004-03-22  Martin Baulig  <martin@ximian.com>
10178
10179         * expression.cs (Invocation.InferParamsTypeArguments): New static
10180         method; does type inference for params arguments.
10181
10182 2004-03-21  Martin Baulig  <martin@ximian.com>
10183
10184         * typemanager.cs (TypeManager.IsGenericMethod): New public static
10185         method; checks whether a method is a generic method.    
10186
10187         * expression.cs (Invocation.InferTypeArguments): New static method;
10188         infer type arguments for generic method invocation.
10189
10190         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
10191         property; we set this to true if we're resolving a generic method
10192         invocation and the user specified type arguments, ie. we're not
10193         doing type inference.
10194
10195 2004-03-20  Martin Baulig  <martin@ximian.com>
10196
10197         * class.cs (MethodData.DeclaringType): New public property.
10198         (MethodData.Define): Set DeclaringType here.
10199         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
10200         instead of OperatorMethodBuilder.DeclaringType.
10201
10202 2004-03-20  Martin Baulig  <martin@ximian.com>
10203
10204         * cs-tokenizer.cs (xtoken): Return a special
10205         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
10206
10207         * cs-parser.jay (default_value_expression): Switch to the new
10208         syntax (14.5.13).
10209
10210 2004-03-19  Martin Baulig  <martin@ximian.com>
10211
10212         * decl.cs (MemberName): New class.  We use this to "construct"
10213         namespace_or_type_name's.
10214
10215         * generics.cs (TypeArguments.GetDeclarations): New public method;
10216         returns the type arguments as a string[] and reports a CS0081 if
10217         one of them is not an identifier.
10218
10219         * class.cs (MemberBase): The .ctor now takes the name as a
10220         MemberName instead of a string.
10221         (MemberBase.ExplicitInterfaceName): Changed type from string to
10222         Expression.
10223         (MemberBase.DoDefine): If we're an explicit implementation, the
10224         InterfaceType may be a generic instance.
10225
10226         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
10227         (namespace_name): Call MemberName.GetName () to transform the
10228         MemberName into a string and ensure we don't have any type
10229         arguments.
10230         (type_name): Call MemberName.GetTypeExpression() to transfrom the
10231         MemberName into an expression.
10232         (method_header): Use namespace_or_type_name instead of member_name.     
10233
10234 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
10235
10236         * rootcontext.cs: Add new types to the boot resolution.
10237
10238         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
10239         MulticastDelegate is not allowed.
10240
10241         * typemanager.cs: Add new types to lookup: System.TypedReference
10242         and ArgIterator.
10243
10244         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
10245         check for TypedReference or ArgIterator, they are not allowed. 
10246
10247         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
10248         makes us properly catch 1510 in some conditions (see bug 56016 for
10249         details). 
10250
10251 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
10252
10253         * CryptoConvert.cs: update from corlib version
10254         with endian fixes.
10255
10256 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
10257
10258         * class.cs (Indexer.Define): Check indexername declaration
10259
10260 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
10261
10262         * attribute.cs (IsClsCompliant): Fixed problem with handling
10263         all three states (compliant, not-compliant, undetected).
10264
10265 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
10266
10267         * attribute.cs (Attribute): Location is now public.
10268         (Resolve): Store resolved arguments (pos_values) in attribute class.
10269         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
10270         (GetClsCompliantAttributeValue): New method that gets
10271         CLSCompliantAttribute value.
10272         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
10273         if exists else null.
10274         (AttributeTester): New class for CLS-Compliant verification routines.
10275
10276         * class.cs (Emit): Add CLS-Compliant verification.
10277         (Method.GetSignatureForError): Implemented.
10278         (Constructor.GetSignatureForError): Implemented
10279         (Constructor.HasCompliantArgs): Returns if constructor has
10280         CLS-Compliant arguments.
10281         (Constructor.Emit): Override.
10282         (Construcor.IsIdentifierClsCompliant): New method; For constructors
10283         is needed to test only parameters.
10284         (FieldBase.GetSignatureForError): Implemented.
10285         (TypeContainer): New member for storing base interfaces.
10286         (TypeContainer.FindMembers): Search in base interfaces too.
10287
10288         * codegen.cs (GetClsComplianceAttribute): New method that gets
10289         assembly or module CLSCompliantAttribute value.
10290         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10291         for assembly.
10292         (ModuleClass.Emit): Add error 3012 test.
10293
10294         * const.cs (Emit): Override and call base for CLS-Compliant tests.
10295
10296         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10297         state for all decl types.
10298         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10299         if CLS-Compliant tests are required.
10300         (IsClsCompliaceRequired): New method. Analyze whether code
10301         must be CLS-Compliant.
10302         (IsExposedFromAssembly): New method. Returns true when MemberCore
10303         is exposed from assembly.
10304         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10305         value or gets cached value.
10306         (HasClsCompliantAttribute): New method. Returns true if MemberCore
10307         is explicitly marked with CLSCompliantAttribute.
10308         (IsIdentifierClsCompliant): New abstract method. This method is
10309         used to testing error 3005.
10310         (IsIdentifierAndParamClsCompliant): New method. Common helper method
10311         for identifier and parameters CLS-Compliant testing.
10312         (VerifyClsCompliance): New method. The main virtual method for
10313         CLS-Compliant verifications.
10314         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10315         null. I don't know why is null (too many public members !).
10316         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10317         and get value of first CLSCompliantAttribute that found.
10318
10319         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10320         (VerifyClsCompliance): Override and add extra tests.
10321
10322         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10323         clscheck- disable CLS-Compliant verification event if assembly is has
10324         CLSCompliantAttribute(true).
10325
10326         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10327         ApllyAttribute is now called in emit section as in the other cases.
10328         Possible future Emit integration.
10329         (IsIdentifierClsCompliant): New override.
10330         (VerifyClsCompliance): New override.
10331         (GetEnumeratorName): Returns full enum name.
10332
10333         * parameter.cs (GetSignatureForError): Implemented.
10334
10335         * report.cs (WarningData): New struct for Warning message information.
10336         (LocationOfPreviousError): New method.
10337         (Warning): New method. Reports warning based on the warning table.
10338         (Error_T): New method. Reports error based on the error table.
10339
10340         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10341         verifications are done here.
10342
10343         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10344
10345         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10346         CLSCompliantAttribute.
10347         (all_imported_types): New member holds all imported types from other
10348         assemblies.
10349         (LoadAllImportedTypes): New method fills static table with exported types
10350         from all referenced assemblies.
10351         (Modules): New property returns all assembly modules.
10352
10353 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
10354
10355         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10356         throwing a parser error.
10357
10358         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10359         which removes the hardcoded get_/set_ prefixes for properties, as
10360         IL allows for the properties to be named something else.  
10361
10362         Bug #56013
10363
10364         * expression.cs: Do not override operand before we know if it is
10365         non-null.  Fix 56207
10366
10367 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10368
10369         * typemanager.cs: support for pinned variables.
10370
10371 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10372
10373         * decl.cs, typemanager.cs: Avoid using an arraylist
10374         as a buffer if there is only one result set.
10375
10376 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10377
10378         * expression.cs: Make sure you cant call a static method
10379         with an instance expression, bug #56174.
10380
10381 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
10382
10383         * class.cs (IsDuplicateImplementation): Improve error reporting to
10384         flag 663 (method only differs in parameter modifier).
10385
10386         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10387         in preprocessor directives.
10388
10389         * location.cs (LookupFile): Allow for the empty path.
10390
10391         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
10392         better approach for some of that patch, but its failing with the
10393         CharSet enumeration.  For now try/catch will do.
10394
10395         * typemanager.cs: Do not crash if a struct does not have fields.
10396         Fixes 56150.
10397
10398 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10399
10400         * expression.cs: cs0213, cant fix a fixed expression.
10401         fixes 50231.
10402
10403 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10404
10405         * cs-parser.jay: detect invalid embeded statements gracefully.
10406         bug #51113.
10407
10408 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10409
10410         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10411         As a regex:
10412         s/
10413         the invocation type may not be a subclass of the tye of the item/
10414         The type of the item must be a subclass of the invocation item.
10415         /g
10416
10417         Fixes bug #50820.
10418
10419 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
10420
10421         * attribute.cs: Added methods to get a string and a bool from an
10422         attribute. Required to information from AssemblyKeyFileAttribute,
10423         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10424         * codegen.cs: Modified AssemblyName creation to include support for
10425         strongnames. Catch additional exceptions to report them as CS1548.
10426         * compiler.csproj: Updated include CryptoConvert.cs.
10427         * compiler.csproj.user: Removed file - user specific configuration.
10428         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
10429         Mono.Security assembly. The original class is maintained and tested in
10430         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10431         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10432         like CSC 8.0 (C# v2) supports.
10433         * Makefile: Added CryptoConvert.cs to mcs sources.
10434         * rootcontext.cs: Added new options for strongnames.
10435
10436 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
10437
10438         * driver.cs: For --expect-error, report error code `2'
10439         if the program compiled with no errors, error code `1' if
10440         it compiled with an error other than the one expected.
10441
10442 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
10443
10444         * compiler.csproj: Updated for Visual Studio .NET 2003.
10445         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10446         * compiler.sln: Updated for Visual Studio .NET 2003.
10447
10448 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
10449
10450         * expression.cs: Fix bug #47234. We basically need to apply the
10451         rule that we prefer the conversion of null to a reference type
10452         when faced with a conversion to 'object' (csc behaviour).
10453
10454 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10455
10456         * statement.cs: Shorter form for foreach, eliminates
10457         a local variable. r=Martin.
10458
10459 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10460
10461         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10462         checks if we can use brtrue/brfalse to test for 0.
10463         * expression.cs: use the above in the test for using brtrue/brfalse.
10464         cleanup code a bit.
10465
10466 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10467
10468         * expression.cs: Rewrite string concat stuff. Benefits:
10469
10470         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10471         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10472         rather than a concat chain.
10473
10474         * typemanager.cs: Add lookups for more concat overloads.
10475
10476 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10477
10478         * expression.cs: Emit shorter il code for array init.
10479
10480         newarr
10481         dup
10482         // set 1
10483
10484         // set 2
10485
10486         newarr
10487         stloc.x
10488
10489         ldloc.x
10490         // set 1
10491
10492         ldloc.x
10493         // set 2
10494
10495 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
10496
10497         * statement.cs: Before, two switch blocks would be merged if the
10498         total size of the blocks (end_item - begin_item + 1) was less than
10499         two times the combined sizes of the blocks.
10500
10501         Now, it will only merge if after the merge at least half of the
10502         slots are filled.
10503
10504         fixes 55885.
10505
10506 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
10507
10508         * class.cs : csc build fix for GetMethods(). See bug #52503.
10509
10510 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
10511
10512         * expression.cs: Make sure fp comparisons work with NaN.
10513         This fixes bug #54303. Mig approved this patch a long
10514         time ago, but we were not able to test b/c the runtime
10515         had a related bug.
10516
10517 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
10518
10519         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
10520
10521 2004-03-19  Martin Baulig  <martin@ximian.com>
10522
10523         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
10524         two overloads may unify for some type parameter substitutions and
10525         report a CS0408 if appropriate.
10526
10527 2004-03-19  Martin Baulig  <martin@ximian.com>
10528
10529         * class.cs (MemberCore.IsDuplicateImplementation): Report the
10530         error here and not in our caller.
10531
10532 2004-03-19  Martin Baulig  <martin@ximian.com>
10533
10534         * interface.cs: Completely killed this file.
10535         (Interface): We're now a TypeContainer and live in class.cs.
10536
10537         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
10538         argument; we're now also called for interfaces.
10539         (TypeContainer.DefineMembers): Allow this method being called
10540         multiple times.
10541         (TypeContainer.GetMethods): New public method; formerly known as
10542         Interface.GetMethod().  This is used by PendingImplementation.
10543         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
10544         it's now private and non-static.
10545         (Interface): Moved this here; it's now implemented similar to
10546         Class and Struct.
10547         (Method, Property, Event, Indexer): Added `bool is_interface'
10548         argument to their .ctor's.
10549         (MemberBase.IsInterface): New public field.
10550
10551         * cs-parser.jay: Create normal Method, Property, Event, Indexer
10552         instances instead of InterfaceMethod, InterfaceProperty, etc.
10553         (opt_interface_base): Removed; we now use `opt_class_base' instead.
10554         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
10555
10556 2004-03-19  Martin Baulig  <martin@ximian.com>
10557
10558         * class.cs (MethodCore.IsDuplicateImplementation): New private
10559         method which does the CS0111 checking.
10560         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
10561         Use IsDuplicateImplementation().
10562
10563 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
10564
10565         * decl.cs (FindMemberToOverride): New method to find the correct
10566         method or property to override in the base class.
10567         * class.cs
10568             - Make Method/Property use the above method to find the
10569               version in the base class.
10570             - Remove the InheritableMemberSignatureCompare as it is now
10571               dead code.
10572
10573         This patch makes large code bases much faster to compile, as it is
10574         O(n) rather than O(n^2) to do this validation.
10575
10576         Also, it fixes bug 52458 which is that nested classes are not
10577         taken into account when finding the base class member.
10578
10579         Reviewed/Approved by Martin.
10580
10581 2004-03-17  Martin Baulig  <martin@ximian.com>
10582
10583         * expression.cs (MemberAccess.DoResolve): Take the parent's number
10584         of type arguments into account; use the `real_num_type_args'
10585         approach like in DoResolveAsTypeStep().
10586
10587         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
10588         nested types.
10589
10590 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
10591
10592         * interface.cs: In all interface classes removed redundant
10593         member initialization.
10594
10595 2004-03-16  Martin Baulig  <martin@ximian.com>
10596
10597         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10598
10599 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
10600
10601         * decl.cs (DefineTypeAndParents): New helper method to define a
10602         type's containers before the type itself is defined;  This is a
10603         bug exposed by the recent changes to Windows.Forms when an
10604         implemented interface was defined inside a class that had not been
10605         built yet.   
10606
10607         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10608
10609         (Check): Loop correctly to report errors modifiers
10610         (UNSAFE was not in the loop, since it was the same as TOP).
10611
10612         * interface.cs: Every interface member now takes a ModFlags,
10613         instead of a "is_new" bool, which we set on the base MemberCore. 
10614
10615         Every place where we called "UnsafeOk" in the interface, now we
10616         call the proper member (InterfaceMethod.UnsafeOK) instead to get
10617         the unsafe settings from the member declaration instead of the
10618         container interface. 
10619
10620         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
10621
10622         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10623         `set_indexer_name' to the pending bits (one per type).
10624
10625         We fixed a bug today that was picking the wrong method to
10626         override, since for properties the existing InterfaceMethod code
10627         basically ignored the method name.  Now we make sure that the
10628         method name is one of the valid indexer names.
10629
10630 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
10631  
10632         * support.cs (SeekableStreamReader): Keep track of stream byte
10633         positions and don't mix them with character offsets to the buffer.
10634
10635         Patch from Gustavo Giráldez
10636
10637 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
10638
10639         * interface.cs (InterfaceSetGetBase): Removed double member
10640         initialization, base class does it as well.
10641
10642 2004-03-13  Martin Baulig  <martin@ximian.com>
10643
10644         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10645         when compiling corlib.
10646
10647 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
10648
10649         * convert.cs (ExplicitConversion): We were reporting an error on
10650         certain conversions (object_type source to a value type, when the
10651         expression was `null') before we had a chance to pass it through
10652         the user defined conversions.
10653
10654         * driver.cs: Replace / and \ in resource specifications to dots.
10655         Fixes 50752
10656
10657         * class.cs: Add check for duplicate operators.  Fixes 52477
10658
10659 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
10660
10661         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10662         that are in the middle of the statements, not only at the end.
10663         Fixes #54987
10664
10665         * class.cs (TypeContainer.AddField): No longer set the
10666         `HaveStaticConstructor' flag, now we call it
10667         `UserDefineStaticConstructor' to diferentiate the slightly
10668         semantic difference.
10669
10670         The situation is that we were not adding BeforeFieldInit (from
10671         Modifiers.TypeAttr) to classes that could have it.
10672         BeforeFieldInit should be set to classes that have no static
10673         constructor. 
10674
10675         See:
10676
10677         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10678
10679         And most importantly Zoltan's comment:
10680
10681         http://bugzilla.ximian.com/show_bug.cgi?id=44229
10682
10683         "I think beforefieldinit means 'it's ok to initialize the type sometime 
10684          before its static fields are used', i.e. initialization does not need
10685          to be triggered by the first access to the type. Setting this flag
10686          helps the JIT to compile better code, since it can run the static
10687          constructor at JIT time, and does not need to generate code to call it
10688          (possibly lots of times) at runtime. Unfortunately, mcs does not set
10689          this flag for lots of classes like String. 
10690          
10691          csc sets this flag if the type does not have an explicit static 
10692          constructor. The reasoning seems to be that if there are only static
10693          initalizers for a type, and no static constructor, then the programmer
10694          does not care when this initialization happens, so beforefieldinit
10695          can be used.
10696          
10697          This bug prevents the AOT compiler from being usable, since it 
10698          generates so many calls to mono_runtime_class_init that the AOT code
10699          is much slower than the JITted code. The JITted code is faster, 
10700          because it does not generate these calls if the vtable is type is
10701          already initialized, which is true in the majority of cases. But the
10702          AOT compiler can't do this."
10703
10704 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
10705
10706         * class.cs (MethodData.Emit): Refactor the code so symbolic
10707         information is generated for destructors;  For some reasons we
10708         were taking a code path that did not generate symbolic information
10709         before. 
10710
10711 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
10712
10713         * class.cs: Create a Constructor.CheckBase method that
10714         takes care of all validation type code. The method
10715         contains some code that was moved from Define.
10716
10717         It also includes new code that checks for duplicate ctors.
10718         This fixes bug #55148.
10719
10720 2004-03-09  Joshua Tauberer <tauberer@for.net>
10721
10722         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
10723         a { ... }-style array creation invokes EmitStaticInitializers
10724         which is not good for reference-type arrays.  String, decimal
10725         and now null constants (NullCast) are not counted toward
10726         static initializers.
10727
10728 2004-03-05  Martin Baulig  <martin@ximian.com>
10729
10730         * location.cs (SourceFile.HasLineDirective): New public field;
10731         specifies whether the file contains or is referenced by a "#line"
10732         directive.
10733         (Location.DefineSymbolDocuments): Ignore source files which
10734         either contain or are referenced by a "#line" directive.        
10735
10736 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
10737
10738         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10739         direct access to our parent, so check the method inline there.
10740
10741 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
10742
10743         * expression.cs (Invocation.EmitCall): Miguel's last commit
10744         caused a regression. If you had:
10745
10746             T t = null;
10747             t.Foo ();
10748
10749         In Foo the implict this would be null.
10750
10751 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
10752
10753         * expression.cs (Invocation.EmitCall): If the method is not
10754         virtual, do not emit a CallVirt to it, use Call.
10755
10756         * typemanager.cs (GetFullNameSignature): Improve the method to
10757         cope with ".ctor" and replace it with the type name.
10758
10759         * class.cs (ConstructorInitializer.Resolve): Now the method takes
10760         as an argument the ConstructorBuilder where it is being defined,
10761         to catch the recursive constructor invocations.
10762
10763 2004-03-16  Martin Baulig  <martin@ximian.com>
10764
10765         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
10766         ConstructedType, call ResolveType() on it to get the type rather
10767         than just using `expr.Type'.
10768
10769 2004-03-16  Martin Baulig  <martin@ximian.com>
10770
10771         * generics.cs (ConstructedType.GetMemberAccess): Take the
10772         EmitContext instead on the TypeExpr and use
10773         ec.TypeContainer.CurrentType/ec.ContainerType.
10774
10775 2004-03-16  Martin Baulig  <martin@ximian.com>
10776
10777         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
10778         parameters before aliases.
10779
10780 2004-03-16  Martin Baulig  <martin@ximian.com>
10781
10782         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
10783         New oublic function; checks whether two generic instances may become
10784         equal under some instantiations (26.3.1).
10785
10786         * class.cs (TypeContainer.Define): Call
10787         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
10788         error.
10789
10790 2004-03-16  Martin Baulig  <martin@ximian.com>
10791
10792         * class.cs (TypeContainer.GetClassBases): Moved
10793         Error_TypeParameterAsBase() here and also check whether the base
10794         class is not an attribute.
10795
10796 2004-03-16  Martin Baulig  <martin@ximian.com>
10797
10798         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10799
10800 2004-03-16  Martin Baulig  <martin@ximian.com>
10801
10802         * class.cs (Error_TypeParameterAsBase): Use correct error number
10803         here (CS0689).  
10804
10805 2004-03-16  Martin Baulig  <martin@ximian.com>
10806
10807         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
10808         for generics.
10809
10810         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
10811         error reporting.
10812
10813 2004-03-15  Martin Baulig  <martin@ximian.com>
10814
10815         * typemanager.cs (TypeManager.GetFullName): New public method.
10816         (TypeManager.MemberLookup): Added `int_num_type_arguments'
10817         argument; only return members with the correct number of type
10818         arguments.
10819         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
10820         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
10821         whether the number of type arguments matches.
10822
10823         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
10824         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
10825
10826         * expression.cs (MemberAccess): Added public `NumTypeArguments'
10827         field; it's set by the protected .ctor when we're actually a
10828         GenericMemberAccess.
10829         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
10830         arguments and pass it to MemberLookupFinal ().
10831
10832         * ecore.cs (Expression.MemberLookup): Added `int
10833         num_type_arguments' argument; only return members with the correct
10834         number of type arguments.
10835         (Expression.MemberLookupFailed): Check whether the MemberLookup
10836         failed because we did not have the correct number of type
10837         arguments; report CS0305 in this case.
10838
10839         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
10840         `e.ResolveAsTypeTerminal()' already did so.
10841
10842 2004-03-15  Martin Baulig  <martin@ximian.com>
10843
10844         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
10845         we're a ConstructedType; in this case, the caller must report an
10846         error (for instance CS0131).
10847
10848         * generic.cs (TypeArguments): Added Location argument to the .ctor.
10849         (TypeArguments.Resolve): Actually report errors here.
10850
10851 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
10852
10853         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10854         `set_indexer_name' to the pending bits (one per type).
10855
10856         We fixed a bug today that was picking the wrong method to
10857         override, since for properties the existing InterfaceMethod code
10858         basically ignored the method name.  Now we make sure that the
10859         method name is one of the valid indexer names.
10860
10861 2004-03-15  Martin Baulig  <martin@ximian.com>
10862
10863         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
10864         for generic instances.
10865
10866 2004-03-13  Martin Baulig  <martin@ximian.com>
10867
10868         * class.cs (TypeContainer.DefineType): Call
10869         TypeManager.AddUserType() immediately after creating the
10870         TypeBuilder; pass all type parameters when creating the
10871         CurrentType.
10872
10873         * decl.cs (DeclSpace.FindNestedType): New public method.
10874         (DeclSpace.FindType): Added `int num_type_args' argument; only
10875         return types with the correct number of type parameters.
10876         (DeclSpace.CountTypeParams): New public property.
10877
10878         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
10879         the number of type parameters; defaults to zero.
10880
10881         * generic.cs (TypeArguments.Count): New public property.
10882         (ConstructedType.DoResolveAsTypeStep): First call
10883         ds.FindNestedType() to find out whether we're nested in the
10884         current generic type; in this case, we inherit all type parameters
10885         from the current class.
10886
10887         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
10888         num_type_args' argument.
10889         (RootContext.LookupType): Added overloaded version which takes the
10890         number of type arguments; only return types with the correct
10891         number of type arguments.
10892
10893         * typemanager.cs (TypeManager.CheckGeneric): New public function;
10894         checks whether `Type t' has `int num_type_args'.
10895
10896 2004-03-13  Martin Baulig  <martin@ximian.com>
10897
10898         * generic.cs (GenericMethod.DefineType): New method; calls
10899         DefineType() on all the type parameters.
10900
10901         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
10902         (MethodData.Define): If we're a generic method, call
10903         GenericMethod.DefineType() to define the type parameters.       
10904
10905 2004-03-10  Martin Baulig  <martin@ximian.com>
10906
10907         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
10908         instead of IsAssignableFrom.    
10909
10910 2004-03-10  Martin Baulig  <martin@ximian.com>
10911
10912         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
10913
10914         * support.cs (ParameterData.HasArrayParameter): New property.
10915         (ReflectionParameters.ctor): Take a MethodBase instead of a
10916         ParameterInfo[].  If we have any type parameters, get the generic
10917         method definition and ask it whether we have variable arguments.
10918
10919 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
10920
10921         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
10922         routines to check if a type is an enumerable/enumerator allow
10923         classes that implement the IEnumerable or IEnumerator interfaces.
10924
10925         * class.cs (Property, Operator): Implement IIteratorContainer, and
10926         implement SetYields.
10927
10928         (Property.Define): Do the block swapping for get_methods in the
10929         context of iterators.   We need to check if Properties also
10930         include indexers or not.
10931
10932         (Operator): Assign the Block before invoking the
10933         OperatorMethod.Define, so we can trigger the Iterator code
10934         replacement. 
10935
10936         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
10937         Property and Operator classes are not created when we parse the
10938         declarator but until we have the block completed, so we use a
10939         singleton SimpleIteratorContainer.Simple to flag whether the
10940         SetYields has been invoked.
10941
10942         We propagate this setting then to the Property or the Operator to
10943         allow the `yield' to function.
10944
10945 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
10946
10947         * codegen.cs: Implemented attribute support for modules.
10948         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
10949         Assembly/Module functionality.
10950
10951         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
10952         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
10953         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
10954
10955 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
10956
10957         * interface.cs (FindMembers): The operation is performed on all base
10958         interfaces and not only on the first. It is required for future CLS Compliance patch.
10959
10960 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
10961
10962         * statement.cs, codegen.cs:
10963         This patch deals with patterns such as:
10964
10965         public class List : IEnumerable {
10966
10967                 public MyEnumerator GetEnumerator () {
10968                         return new MyEnumerator(this);
10969                 }
10970
10971                 IEnumerator IEnumerable.GetEnumerator () {
10972                         ...
10973                 }
10974                 
10975                 public struct MyEnumerator : IEnumerator {
10976                         ...
10977                 }
10978         }
10979
10980         Before, there were a few things we did wrong:
10981         1) we would emit callvirt on a struct, which is illegal
10982         2) we emited ldarg when we needed to emit ldarga
10983         3) we would mistakenly call the interface methods on an enumerator
10984         type that derived from IEnumerator and was in another assembly. For example:
10985
10986         public class MyEnumerator : IEnumerator
10987
10988         Would have the interface methods called, even if there were public impls of the
10989         method. In a struct, this lead to invalid IL code.
10990
10991 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
10992
10993         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
10994           renamed to Emit.
10995
10996         * delegate.cs (Define): Fixed crash when delegate type is undefined.
10997
10998 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
10999
11000         * cs-parser.jay: Fix small regression: we were not testing V2
11001         compiler features correctly.
11002
11003         * interface.cs: If the emit context is null, then create one
11004
11005 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
11006
11007         * decl.cs (GetSignatureForError): New virtual method to get full name
11008           for error messages.
11009
11010         * attribute.cs (IAttributeSupport): New interface for attribute setting.
11011           Now it is possible to rewrite ApplyAttributes method to be less if/else.
11012
11013         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11014           Duplicated members and code in these classes has been removed.
11015           Better encapsulation in these classes.
11016
11017 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
11018
11019         * assign.cs (Assign.DoResolve): When dealing with compound
11020         assignments, there is a new rule in ECMA C# 2.4 (might have been
11021         there before, but it is documented here) that states that in:
11022
11023         a op= b;
11024
11025         If b is of type int, and the `op' is a shift-operator, then the
11026         above is evaluated as:
11027
11028         a = (int) a op b 
11029
11030         * expression.cs (Binary.ResolveOperator): Instead of testing for
11031         int/uint/long/ulong, try to implicitly convert to any of those
11032         types and use that in pointer arithmetic.
11033
11034         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11035         method to print information for from the type, not from the
11036         null-method we were given.
11037
11038 2004-02-01  Duncan Mak  <duncan@ximian.com>
11039
11040         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11041         parsing for cmd, fixes bug #53694.
11042
11043 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
11044
11045         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11046         in the member name duplication tests. Property and operator name duplication
11047         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11048
11049 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
11050
11051         * interface.cs (PopulateMethod): Fixed crash when interface method
11052         returns not existing type (error test cs0246-3.cs).
11053
11054 2004-02-02  Ravi Pratap M <ravi@ximian.com>
11055
11056         * cs-parser.jay (interface_accessors): Re-write actions to also
11057         store attributes attached to get and set methods. Fix spelling
11058         while at it.
11059
11060         (inteface_property_declaration): Modify accordingly.
11061
11062         (InterfaceAccessorInfo): New helper class to store information to pass
11063         around between rules that use interface_accessors.
11064
11065         * interface.cs (Emit): Apply attributes on the get and set
11066         accessors of properties and indexers too.
11067
11068         * attribute.cs (ApplyAttributes): Modify accordingly to use the
11069         right MethodBuilder when applying attributes to the get and set accessors.
11070
11071 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
11072
11073         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11074
11075 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
11076
11077         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11078
11079 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
11080
11081         * cs-parser.jay: Remove YIELD token, instead use the new grammar
11082         changes that treat `yield' specially when present before `break'
11083         or `return' tokens.
11084
11085         * cs-tokenizer.cs: yield is no longer a keyword.
11086
11087 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
11088
11089         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11090         setting for default constructors.
11091         For default constructors are almost every time set wrong Modifier. The
11092         generated IL code has been alright. But inside mcs this values was
11093         wrong and this was reason why several of my CLS Compliance tests
11094         failed.
11095
11096 2004-02-27  Martin Baulig  <martin@ximian.com>
11097
11098         * generics.cs (ConstructedType.ResolveType): Make the nested type
11099         stuff actually work.
11100
11101 2004-02-25  Martin Baulig  <martin@ximian.com>
11102
11103         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
11104         property; returns the type parameters just from the current type,
11105         ie. with the ones from outer classes.
11106         (DeclSpace.LookupGeneric): First search in the current class, then
11107         in outer classes.
11108         (DeclSpace.initialize_type_params): When hiding a type parameter
11109         from an outer class, put it into the `type_param_list' anyways.
11110
11111         * expression.cs (MemberAccess.expr): Made this field protected.
11112
11113         * class.cs (TypeContainer.Define): The `CurrentType' just contains
11114         the type parameters from the current class.
11115
11116         * generic.cs (ConstructedType.ResolveType): Support nested generic
11117         types by taking the type parameters which we inherit from outer
11118         classes into account.
11119         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
11120         support for nested generic types.
11121
11122 2004-02-23  Martin Baulig  <martin@ximian.com>
11123
11124         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
11125         field and check whether we're nested inside a generic type.
11126         (DeclSpace.ResolveType): If we're resolving to a generic type
11127         definition, create a ConstructedType and return its resolved type.
11128         (DeclSpace.initialize_type_params): New private method;
11129         initializes the `type_param_list' field from the type parameters
11130         from this and all enclosing classes.
11131         (DeclSpace.TypeParameters): Call initialize_type_params() unless
11132         we're already initialized.
11133
11134 2004-02-23  Martin Baulig  <martin@ximian.com>
11135
11136         * class.cs (Method.Define): Create the generic method before
11137         calling DoDefine().
11138         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
11139         the TypeContainer one); we use this for generic methods.
11140
11141         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
11142         parent's TypeBuilder.
11143
11144 2004-02-18  Martin Baulig  <martin@ximian.com>
11145
11146         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
11147         to check for equality.
11148
11149 2004-02-05  Martin Baulig  <martin@ximian.com>
11150
11151         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
11152         `ec.TypeContainer.CurrentType', use it instead of
11153         `ec.ContainerType' to check whether we're in the type's ctor.
11154
11155 2004-01-29  Martin Baulig  <martin@ximian.com>
11156
11157         * expression.cs (Invocation.DoResolve): If we're a
11158         `ConstructedType', then we're actually a generic method, so
11159         rewrite the expr as a GenericMemberAccess.
11160
11161         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
11162         here; manually parse it into a string.
11163
11164 2004-01-28  Martin Baulig  <martin@ximian.com>
11165
11166         * typemanager.cs (TypeManager.IsEqual): New static method.
11167         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
11168         check for equality instead of using `=='.
11169
11170 2004-01-26  Martin Baulig  <martin@ximian.com>
11171
11172         * decl.cs (DeclSpace.CurrentType): New public field.
11173
11174         * expression.cs (This.ResolveBase): If we have an
11175         `ec.TypeContainer.CurrentType', use it instead of
11176         `ec.ContainerType'.
11177
11178         * class.cs (TypeContainer.DefineType): If we're a generic type,
11179         create the `CurrentType' (unresolved).
11180         (TypeContainer.GenericType): New private field.
11181         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
11182         it and store it in `GenericType' before creating the MemberCache.
11183         (TypeContainer.GetMembers): If we have a `GenericType', call
11184         TypeManager.FindMembers() on it.
11185
11186         * interface.cs (Interface.GenericType): New private field.
11187         (Interface.DefineType): If we're a generic type, create the
11188         `CurrentType' (unresolved).
11189         (Interface.DefineMembers): If we have a `CurrentType', resolve it
11190         and store it in `GenericType' before creating the MemberCache.
11191         (Interface.GetMembers): If we have a `GenericType', call
11192         TypeManager.FindMembers() on it.
11193
11194 2004-01-22  Martin Baulig  <martin@ximian.com>
11195
11196         * cs-parser.jay (namespace_or_type_name): Return an Expression,
11197         not a QualifiedIdentifier.  This is what `type_name_expression'
11198         was previously doing.
11199         (type_name_expression): Removed; the code is now in
11200         `namespace_or_type_name'.
11201         (qualified_identifier): Removed, use `namespace_or_type_name'
11202         instead.
11203         (QualifiedIdentifier): Removed this class.      
11204
11205 2004-01-22  Martin Baulig  <martin@ximian.com>
11206
11207         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11208         not a string as alias name.
11209
11210 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
11211
11212         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11213         #52730 bug, and instead compute correctly the need to use a
11214         temporary variable when requesting an address based on the
11215         static/instace modified of the field and the constructor.
11216  
11217 2004-01-21  Martin Baulig  <martin@ximian.com>
11218
11219         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11220         class and namespace before looking up aliases.  Fixes #52517.
11221
11222 2004-01-21  Martin Baulig  <martin@ximian.com>
11223
11224         * flowanalysis.cs (UsageVector.Merge): Allow variables being
11225         assinged in a 'try'; fixes exception4.cs.
11226
11227 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11228         * class.cs : Implemented parameter-less constructor for TypeContainer
11229
11230         * decl.cs: Attributes are now stored here. New property OptAttributes
11231
11232         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
11233
11234         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
11235
11236 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11237
11238         * typemanager.cs (CSharpSignature): Now reports also inner class name.
11239           (CSharpSignature): New method for indexer and property signature.
11240
11241 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11242
11243         * pending.cs (IsVirtualFilter): Faster implementation.
11244
11245 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11246
11247         * typemanager.cs: Avoid inclusion of same assembly more than once.
11248
11249 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11250
11251         * cs-parser.jay: Fixed problem where the last assembly attribute
11252           has been applied also to following declaration (class, struct, etc.)
11253           
11254 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11255
11256         * class.cs: Added error CS0538, CS0539 reporting.
11257         Fixed crash on Microsoft runtime when field type is void.
11258
11259         * cs-parser.jay: Added error CS0537 reporting.
11260
11261         * pending.cs: Added error CS0535 reporting.
11262         Improved error report for errors CS0536, CS0534.
11263
11264 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
11265
11266         Merge a few bits from the Anonymous Method MCS tree.
11267
11268         * statement.cs (ToplevelBlock): New class for toplevel methods,
11269         will hold anonymous methods, lifted variables.
11270
11271         * cs-parser.jay: Create toplevel blocks for delegates and for
11272         regular blocks of code. 
11273
11274 2004-01-20  Martin Baulig  <martin@ximian.com>
11275
11276         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11277         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11278         and `NeedExplicitReturn'; added `IsLastStatement'.
11279         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11280         have a `ReturnLabel' or we're not unreachable.
11281
11282         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
11283         child's reachability; don't just override ours with it.  Fixes
11284         #58058 (lluis's example).
11285         (FlowBranching): Added public InTryOrCatch(), InCatch(),
11286         InFinally(), InLoop(), InSwitch() and
11287         BreakCrossesTryCatchBoundary() methods.
11288
11289         * statement.cs (Return): Do all error checking in Resolve().
11290         Unless we are the last statement in a top-level block, always
11291         create a return label and jump to it.
11292         (Break, Continue): Do all error checking in Resolve(); also make
11293         sure we aren't leaving a `finally'.
11294         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
11295         statement in a top-level block.
11296         (Block.Flags): Added `IsDestructor'.
11297         (Block.IsDestructor): New public property.
11298
11299 2004-01-20  Martin Baulig  <martin@ximian.com>
11300
11301         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11302
11303 2004-01-20  Martin Baulig  <martin@ximian.com>
11304
11305         * statement.cs (Statement.ResolveUnreachable): New public method.
11306         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11307         (Block.Resolve): Resolve unreachable statements.
11308
11309 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11310
11311         * expression.cs: We need to fix the case where we do
11312         not have a temp variable here.
11313
11314         * assign.cs: Only expression compound assignments need
11315         temporary variables.
11316
11317 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11318
11319         * flowanalysis.cs: Reduce memory allocation in a few ways:
11320           - A block with no variables should not allocate a bit
11321             vector for itself.
11322           - A method with no out parameters does not need any tracking
11323             for assignment of the parameters, so we need not allocate
11324             any data for it.
11325           - The arrays:
11326                 public readonly Type[] VariableTypes;
11327                 public readonly string[] VariableNames;
11328             Are redundant. The data is already stored in the variable
11329             map, so we need not allocate another array for it.
11330           - We need to add alot of checks for if (params | locals) == null
11331             due to the first two changes.
11332
11333 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
11334
11335         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11336         implement IMemoryLocation, we store a copy on a local variable and
11337         take the address of it.  Patch from Benjamin Jemlich
11338
11339         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11340         to use a special "type_name_expression" rule which reduces the
11341         number of "QualifiedIdentifier" classes created, and instead
11342         directly creates MemberAccess expressions.
11343
11344 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
11345
11346         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11347         that fixes #52853.  Null literal assignment to ValueType
11348
11349         * class.cs (MethodData.Emit): Instead of checking the name of the
11350         method to determine if its a destructor, create a new derived
11351         class from Method called Destructor, and test for that.  
11352
11353         * cs-parser.jay: Create a Destructor object instead of a Method.  
11354
11355         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11356
11357         Fixes: 52933
11358
11359 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
11360
11361         * expression.cs (Binary.ResolveOperator): Perform an implicit
11362         conversion from MethodGroups to their delegate types on the
11363         Addition operation.
11364
11365         * delegate.cs: Introduce a new class DelegateCreation that is the
11366         base class for `NewDelegate' and `ImplicitDelegateCreation',
11367         factor some code in here.
11368
11369         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11370         conversion from MethodGroups to compatible delegate types. 
11371
11372         * ecore.cs (Expression.Resolve): Do not flag error 654
11373         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11374         we allow conversions from MethodGroups to delegate types now.
11375
11376         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11377         assignments in v2 either.
11378
11379 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
11380
11381         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11382         static read-only fields in ctors.
11383
11384         Applied patch from Benjamin Jemlich 
11385
11386         * expression.cs (UnaryMutator): Avoid leaking local variables. 
11387
11388 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
11389
11390         * cs-tokenizer.cs (IsCastToken): Allow the various native types
11391         here to return true, as they can be used like this:
11392
11393                 (XXX) int.MEMBER ()
11394
11395         Fixed 49836 and all the other dups
11396
11397 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
11398
11399         * driver.cs: Implement /win32res and /win32icon.
11400
11401 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
11402
11403         * cs-parser.jay: Add a rule to improve error handling for the
11404         common mistake of placing modifiers after the type.
11405
11406 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
11407
11408         * cs-parser.jay (interface_event_declaration): Catch
11409         initialization of events on interfaces, and report cs0068
11410
11411         * cs-parser.jay (interface_event_declaration): Catch
11412         initialization of events. 
11413
11414         * ecore.cs: Better report missing constructors.
11415
11416         * expression.cs (Binary.ResolveOperator): My previous bug fix had
11417         the error reporting done in the wrong place.  Fix.
11418
11419         * expression.cs (Binary.ResolveOperator): Catch the 
11420         operator + (E x, E y) error earlier, and later allow for implicit
11421         conversions in operator +/- (E e, U x) from U to the underlying
11422         type of E.
11423
11424         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11425         52596, if the container class is abstract, the default constructor
11426         is protected otherwise its public (before, we were always public).
11427
11428         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11429         fixed statement.
11430
11431         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11432         Jemlich that fixes bug #52597, MCS was generating invalid code for
11433         idisposable structs.   Thanks to Ben for following up with this
11434         bug as well.
11435
11436 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
11437
11438         * driver.cs: Allow assemblies without code to be generated, fixes
11439         52230.
11440
11441 2004-01-07  Nick Drochak <ndrochak@gol.com>
11442
11443         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11444
11445 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
11446
11447         * cs-parser.jay: Add rules to improve error reporting if fields or
11448         methods are declared at the namespace level (error 116)
11449
11450         * Add rules to catch event add/remove
11451
11452 2004-01-04  David Sheldon <dave-mono@earth.li>
11453
11454   * expression.cs: Added matching ")" to error message for 
11455   CS0077
11456
11457 2004-01-03 Todd Berman <tberman@gentoo.org>
11458
11459         * ecore.cs, attribute.cs:
11460         Applying fix from #52429.
11461
11462 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11463
11464         * ecore.cs, expression.cs, statement.cs:
11465         Total rewrite of how we handle branching. We
11466         now handle complex boolean expressions with fewer
11467         jumps. As well if (x == 0) no longer emits a ceq.
11468
11469         if (x is Foo) is much faster now, because we generate
11470         better code.
11471
11472         Overall, we get a pretty big improvement on our benchmark
11473         tests. The code we generate is smaller and more readable.
11474
11475         I did a full two-stage bootstrap. The patch was reviewed
11476         by Martin and Miguel.
11477
11478 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11479
11480         * cs-parser.jay: Make primary_expression not take a QI.
11481         we dont need this because the member_access rule covers
11482         us here. So we replace the rule with just IDENTIFIER.
11483
11484         This has two good effects. First, we remove a s/r conflict.
11485         Second, we allocate many fewer QualifiedIdentifier objects.
11486
11487 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11488
11489         * attribute.cs: Handle MarshalAs attributes as pseudo, and
11490         set the correct information via SRE. This prevents
11491         hanging on the MS runtime. Fixes #29374.
11492
11493 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11494
11495         * convert.cs: correctly handle conversions to value types
11496         from Enum and ValueType as unboxing conversions.
11497
11498         Fixes bug #52569. Patch by Benjamin Jemlich.
11499
11500 2004-01-02  Ravi Pratap  <ravi@ximian.com>
11501
11502         * expression.cs (BetterConversion): Prefer int -> uint
11503         over int -> ulong (csc's behaviour). This fixed bug #52046.
11504
11505 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11506
11507         * decl.cs (MemberCache.FindMembers): now returns a
11508         MemberInfo [].
11509
11510         * typemanager.cs: In general, go with with ^^.
11511         (CopyNewMethods): take an IList.
11512         (RealMemberLookup): Only allocate an arraylist
11513         if we copy from two sets of methods.
11514
11515         This change basically does two things:
11516         1) Fewer array lists allocated due to CopyNewMethods.
11517         2) the explicit cast in MemberList costed ALOT.
11518
11519 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
11520
11521         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
11522         a hashtable to avoid needless string allocations when an identifier is
11523         used more than once (the common case).
11524
11525 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11526
11527         * pending.cs: MS's TypeBuilder.GetInterfaces ()
11528         is broken, it will not return anything. So, we
11529         have to use the information we have in mcs to
11530         do the task.
11531
11532         * typemanager.cs: Add a cache for GetInterfaces,
11533         since this will now be used more often (due to ^^)
11534
11535         (GetExplicitInterfaces) New method that gets the
11536         declared, not effective, interfaces on a type
11537         builder (eg, if you have interface IFoo, interface
11538         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
11539         { IBar }.
11540
11541         This patch makes MCS able to bootstrap itself on
11542         Windows again.
11543
11544 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11545
11546         * expression.cs: Remove the Nop's that Miguel put
11547         in by mistake.
11548
11549 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11550
11551         * report.cs, codegen.cs: Give the real stack trace to
11552         the error when an exception is thrown.
11553
11554 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11555
11556         * decl.cs: only allocate hashtables for ifaces if 
11557         it is an iface!
11558
11559 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11560
11561         * expression.cs: fix the error from cs0121-2.cs
11562         (a parent interface has two child interfaces that
11563         have a function with the same name and 0 params
11564         and the function is called through the parent).
11565
11566 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11567
11568         * class.cs, rootcontext.cs, typmanager.cs: do not
11569         leak pointers.
11570
11571 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11572
11573         * codegen.cs: remove stack for the ec flow branching.
11574         It is already a linked list, so no need.
11575
11576 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11577
11578         * Makefile: Allow custom profiler here.
11579
11580 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11581
11582         * typemanager.cs (LookupType):
11583           - Use a static char [], because split takes
11584             a param array for args, so it was allocating
11585             every time.
11586           - Do not store true in a hashtable, it boxes.
11587
11588 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11589
11590         * flowanalysis.cs: bytify common enums.
11591
11592 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11593
11594         * modifiers.cs: Add a new set of flags for the
11595         flags allowed on explicit interface impls.
11596         * cs-parser.jay: catch the use of modifiers in
11597         interfaces correctly.
11598         * class.cs: catch private void IFoo.Blah ().
11599
11600         All related to bug #50572.
11601
11602 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11603
11604         * decl.cs: Rewrite the consistant accessability checking.
11605         Accessability is not linear, it must be implemented in
11606         a tableish way. Fixes #49704.
11607
11608 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11609
11610         * expression.cs: Handle negation in a checked context.
11611         We must use subtraction from zero. Fixes #38674.
11612
11613 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11614
11615         * class.cs: Ignore static void main in DLLs.
11616         * rootcontext.cs: Handle the target type here,
11617         since we are have to access it from class.cs
11618         * driver.cs: account for the above.
11619
11620 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11621
11622         * report.cs: Give line numbers and files if available.
11623
11624 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
11625
11626         * driver.cs: Implement /addmodule.
11627
11628         * typemanager.cs:  Change 'modules' field so it now contains Modules not
11629         ModuleBuilders.
11630
11631 2003-12-20  Martin Baulig  <martin@ximian.com>
11632
11633         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11634         (FieldBase.IsAssigned): Removed this field.
11635         (FieldBase.SetAssigned): New public method.
11636         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11637
11638 2003-12-20  Martin Baulig  <martin@ximian.com>
11639
11640         * expression.cs (LocalVariableReference.DoResolve): Don't set
11641         `vi.Used' if we're called from DoResolveLValue().
11642
11643         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11644         returns the usage vector it just merged into the current one -
11645         pass this one to UsageWarning().
11646         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11647         of the `EmitContext', don't call this recursively on our children.
11648
11649 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
11650
11651         * driver.cs: Implement /target:module.
11652
11653 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
11654
11655         * support.cs (CharArrayHashtable): New helper class.
11656
11657         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
11658         char arrays, not strings, so we can avoid creating a string in
11659         consume_identifier if the identifier is a keyword.
11660
11661 2003-12-16  Martin Baulig  <martin@ximian.com>
11662
11663         * statement.cs (LocalInfo.Assigned): Removed this property.
11664         (LocalInfo.Flags): Removed `Assigned'.
11665         (LocalInfo.IsAssigned): New public method; takes the EmitContext
11666         and uses flow analysis.
11667         (Block.UsageWarning): Made this method private.
11668         (Block.Resolve): Call UsageWarning() if appropriate.
11669
11670         * expression.cs (LocalVariableReference.DoResolve): Always set
11671         LocalInfo.Used here.
11672
11673 2003-12-13  Martin Baulig  <martin@ximian.com>
11674
11675         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11676         any value here; we're now using flow analysis to figure out
11677         whether a statement/block returns a value.
11678
11679 2003-12-13  Martin Baulig  <martin@ximian.com>
11680
11681         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
11682         working again.
11683         (FlowBranching.MergeFinally): Don't call
11684         `branching.CheckOutParameters()' here, this is called in
11685         MergeTopBlock().
11686         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
11687         when adding the `finally' vector.       
11688
11689 2003-12-13  Martin Baulig  <martin@ximian.com>
11690
11691         * flowanalysis.cs
11692         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
11693         actually work and also fix #48962.
11694
11695 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11696
11697         * decl.cs: Do not check System.Object for nested types,
11698         since we know it does not have any. Big bang for buck:
11699
11700         BEFORE:
11701            Run 1:   8.35 seconds
11702            Run 2:   8.32 seconds
11703            corlib:  17.99 seconds
11704         AFTER:
11705            Run 1:   8.17 seconds
11706            Run 2:   8.17 seconds
11707            corlib:  17.39 seconds
11708
11709 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
11710
11711         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
11712         time we are returning 0 members, so we save alot here.
11713
11714 2003-12-11  Martin Baulig  <martin@ximian.com>
11715
11716         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
11717         `MergeChild()', also just take the `FlowBranching' as argument;
11718         call Merge() on it and return the result.
11719         (FlowBranching.Merge): We don't need to do anything if we just
11720         have one sibling.
11721
11722 2003-12-11  Martin Baulig  <martin@ximian.com>
11723
11724         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
11725         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
11726         Maurer for this idea.
11727
11728 2003-12-11  Martin Baulig  <martin@ximian.com>
11729
11730         * flowanalysis.cs (MergeResult): This class is now gone; we now
11731         use the `UsageVector' for this.  The reason for this is that if a
11732         branching just has one sibling, we don't need to "merge" them at
11733         all - that's the next step to do.
11734         (FlowBranching.Merge): We now return a `UsageVector' instead of a
11735         `MergeResult'.
11736
11737 2003-12-11  Martin Baulig  <martin@ximian.com>
11738
11739         Reworked flow analyis and made it more precise and bug-free.  The
11740         most important change is that we're now using a special `Reachability'
11741         class instead of having "magic" meanings of `FlowReturns'.  I'll
11742         do some more cleanups and optimizations and also add some more
11743         documentation this week.
11744
11745         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
11746         largely reworked this class.
11747         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
11748         the new `Reachability' class instead of having "magic" values here.
11749         (FlowBranching): We're now using an instance of `Reachability'
11750         instead of having separate `Returns', `Breaks' etc. fields.
11751
11752         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
11753         based on flow analysis; ignore the return value of block.Emit ().
11754
11755 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
11756
11757         * driver.cs typemanager.cs: Find the mono extensions to corlib even
11758         if they are private.
11759
11760 2003-12-09  Martin Baulig  <martin@ximian.com>
11761
11762         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
11763         call them directly on the UsageVector.
11764
11765 2003-12-09  Martin Baulig  <martin@ximian.com>
11766
11767         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
11768         Changed return type from `FlowReturns' to `Reachability'.
11769
11770 2003-12-09  Martin Baulig  <martin@ximian.com>
11771
11772         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
11773         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
11774         `Reachable' fields with a single `Reachability' one.
11775
11776 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11777
11778         * class.cs (FindMembers): Remove foreach's.
11779
11780         Bootstrap times:
11781
11782         BEFORE
11783                 Run 1:   8.74 seconds
11784                 Run 2:   8.71 seconds
11785
11786         AFTER
11787                 Run 1:   8.64 seconds
11788                 Run 2:   8.58 seconds
11789
11790
11791 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11792
11793         * cs-parser.jay:
11794         * gen-treedump.cs:
11795         * statement.cs:
11796         This patch does a few things:
11797                 1. EmptyStatement is now a singleton, so it is never reallocated.
11798                 2. All blah is EmptyStatement constructs have been changed to
11799                    blah == EmptyStatement.Value, which is much faster and valid
11800                    now that EmptyStatement is a singleton.
11801                 3. When resolving a block, rather than allocating a new array for
11802                    the non-empty statements, empty statements are replaced with
11803                    EmptyStatement.Value
11804                 4. Some recursive functions have been made non-recursive.
11805         Mainly the performance impact is from (3), however (1) and (2) are needed for
11806         this to work. (4) does not make a big difference in normal situations, however
11807         it makes the profile look saner.
11808
11809         Bootstrap times:
11810
11811         BEFORE
11812         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11813         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11814         Total memory allocated: 56397 KB
11815
11816         AFTER
11817         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
11818         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
11819         Total memory allocated: 55666 KB
11820
11821 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11822
11823         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
11824         than the hashtable in a hashtable version
11825
11826         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
11827         we always end up concating a string. This results in a huge perf
11828         loss, because many strings have to be tracked by the GC. In this
11829         patch, we first use a hashtable that works with two keys, so that
11830         the strings do not need to be concat'ed.
11831
11832         Bootstrap times:
11833         BEFORE
11834                 Run 1:   8.74 seconds
11835                 Run 2:   8.71 seconds
11836
11837         AFTER
11838                 Run 1:   8.65 seconds
11839                 Run 2:   8.56 seconds
11840
11841 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11842
11843         * Makefile: Add a new target `do-time' that does a quick and simple
11844         profile, leaving easy to parse output.
11845
11846 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
11847
11848         * codegen.cs (Init): Create the dynamic assembly with 
11849         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
11850
11851 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11852
11853         * support.cs: Make the PtrHashtable use only one
11854         instance of its comparer.
11855
11856 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
11857
11858         * typemanager.cs: Fix lookup of GetNamespaces.
11859
11860 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
11861
11862         * expression.cs: Removed redundant line.
11863
11864         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
11865         ArrayLists, use for loops with bounds.  
11866
11867         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
11868         arraylist.
11869
11870         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
11871         arraylists, use for loop with bounds.
11872
11873         The above three changes give us a 0.071 second performance
11874         improvement out of 3.294 seconds down to 3.223.  On my machine
11875         the above changes reduced the memory usage by 1,387 KB during
11876         compiler bootstrap.
11877
11878         * cs-parser.jay (QualifiedIdentifier): New class used to represent
11879         QualifiedIdentifiers.  Before we created a new string through
11880         concatenation, and mostly later on, the result would be
11881         manipulated by DecomposeQI through string manipulation.
11882
11883         This reduced the compiler memory usage for bootstrapping from
11884         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
11885         compile times in 0.05 seconds.
11886
11887 2003-11-28  Dick Porter  <dick@ximian.com>
11888
11889         * support.cs: Do string compares with the Invariant culture.
11890
11891         * rootcontext.cs: 
11892         * gen-treedump.cs: 
11893         * expression.cs: 
11894         * driver.cs: 
11895         * decl.cs: 
11896         * codegen.cs: 
11897         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
11898         the comparison is done with the Invariant culture.
11899
11900 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
11901
11902         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
11903         GetEnumerator method.
11904
11905         (ProbeCollectionType): Iterate starting at the most specific type
11906         upwards looking for a GetEnumerator
11907
11908         * expression.cs: Shift count can be up to 31 for int/uint and 63
11909         for long/ulong.
11910
11911 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
11912
11913         * statement.cs (Block.LookupLabel): Also look for the label on the
11914         children blocks.  Use a hash table to keep track of visited
11915         nodes. 
11916
11917         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
11918         we actually did transform the other operand, otherwise fall back
11919         to the common codepath that casts to long.
11920
11921         * cs-tokenizer.cs: Use the same code pattern as the int case.
11922         Maybe I should do the parsing myself, and avoid depending on the
11923         Parse routines to get this done.
11924
11925 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
11926
11927         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
11928         which fixes bug 51347.  This time test it.
11929
11930         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
11931         attributes for example can not tell the difference between these.
11932         The difference was only a syntax feature of the language. 
11933
11934         * attribute.cs: Apply attributes to delegates.
11935
11936         * delegate.cs: Call the apply attributes method.
11937
11938 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
11939
11940         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
11941         comparing 0 vs Byte.MinValue, not the value
11942
11943         (ImplicitConversionRequired): When reporting a conversion error,
11944         use error 31 to print out the constant error instead of the
11945         simpler 29.
11946
11947         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
11948         which fixes bug 51347.
11949
11950 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
11951
11952         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
11953         which fixes the -warnaserror command line option.
11954
11955 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
11956
11957         * cfold.cs (DoNumericPromotions): During constant folding of
11958         additions on UIntConstant, special case intconstants with
11959         IntConstants like we do on the expression binary operator. 
11960
11961 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
11962
11963         * convert.cs (ImplicitReferenceConversion): We were missing a case
11964         (System.Enum are not value types or class types, so we need to
11965         classify them separatedly).
11966
11967         * driver.cs: We do not support error 2007.
11968
11969 2003-11-12 Jackson Harper <jackson@ximian.com>
11970
11971         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
11972         system directory. Also use the full file name so users can
11973         libraries names mscorlib-o-tron.dll in a non system dir.
11974         
11975 2004-01-04  David Sheldon <dave-mono@earth.li>
11976
11977         * expression.cs: Added matching ")" to error message for CS0077.
11978
11979 2003-12-19  Martin Baulig  <martin@ximian.com>
11980
11981         * typemanager.cs (TypeManager.IsEqualGenericType): New public
11982         static method; see documentation in the method.
11983         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
11984
11985         * convert.cs (Convert.ImplicitReferenceConversion,
11986         Convert.ImplicitReferenceConversionExists): Add support for
11987         generic type declarations; see gen-36.cs.
11988
11989 2003-12-19  Martin Baulig  <martin@ximian.com>
11990
11991         * pending.cs (Pending.InterfaceMethod): Use
11992         `Type.IsAssignableFrom()' instead of `=='.
11993
11994 2003-12-18  Martin Baulig  <martin@ximian.com>
11995
11996         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
11997         byref types first.
11998
11999         * convert.cs (Convert.ImplicitStandardConversionExists): Use
12000         `expr_type.Equals (target_type)' instead of `=='.
12001
12002 2003-12-08  Martin Baulig  <martin@ximian.com>
12003
12004         * generics.cs (Constraints.Types): Removed.
12005         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
12006         to Type's.
12007         (Constraints.ResolveTypes): New public method; resolves the
12008         TypeExpr's to Type's.
12009         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
12010         longer takes the constraints.
12011         (TypeParameter.DefineMethod): Likewise.
12012         (TypeParameter.DefineType): New public method.  Calls
12013         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
12014         the constraints.
12015
12016 2003-12-08  Martin Baulig  <martin@ximian.com>
12017
12018         * convert.cs (Convert.ImplicitConversionStandard): Use
12019         `expr_type.Equals (target_type)' instead of `=='.
12020
12021 2003-12-08  Martin Baulig  <martin@ximian.com>
12022
12023         * typemanager.cs (TypeManager.GetReferenceType): Call
12024         `Type.MakeByRefType ()'.
12025
12026 2003-12-08  Martin Baulig  <martin@ximian.com>
12027
12028         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
12029         just has some special meaning in some situations.  For instance,
12030         it is allowed to use `where' as the name of a variable etc.
12031
12032 2003-12-04  Martin Baulig  <martin@ximian.com>
12033
12034         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12035         `Type.MakeArrayType()' for array types.
12036
12037 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
12038
12039         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
12040         debugging message.
12041
12042         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
12043         corlib to compile.
12044
12045 2003-11-16  Martin Baulig  <martin@ximian.com>
12046
12047         * codegen.cs (EmitContext.IsGeneric): Removed.
12048
12049         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
12050         ResolveGeneric() on the DeclSpace.
12051
12052 2003-11-16  Martin Baulig  <martin@ximian.com>
12053
12054         * generic.cs (TypeArguments.Resolve):
12055         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
12056         `ResolveType()' on it to get the Type.
12057
12058 2003-11-15  Martin Baulig  <martin@ximian.com>
12059
12060         * generic.cs (ConstructedType.GetInterfaces): Override this.
12061
12062 2003-11-14  Martin Baulig  <martin@ximian.com>
12063
12064         * interface.cs (Interface.DefineType): Define all type parameters
12065         before adding the interfaces we inherit.
12066
12067 2003-11-11  Martin Baulig  <martin@ximian.com>
12068
12069         * generic.cs (ConstructedType.ResolveType): Always call
12070         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
12071
12072 2003-11-10  Martin Baulig  <martin@ximian.com>
12073
12074         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
12075         (TypeManager.InitCoreTypes): Initialize them here, but instead of
12076         calling `ResolveType()' on them, directly assign their `Type'.
12077
12078 2003-11-08  Martin Baulig  <martin@ximian.com>
12079
12080         * generic.cs (ConstructedType): Override `IsClass' etc.
12081
12082 2003-11-08  Martin Baulig  <martin@ximian.com>
12083
12084         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
12085         return value and the `out parent' parameter.
12086         (TypeContainer.DefineType): Moved the CS0644 check into
12087         GetClassBases().  Don't pass the interface types to the
12088         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
12089         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
12090
12091         * ecore.cs (TypeExpr.IsAttribute): New property.
12092         (TypeExpr.GetInterfaces): New method.
12093
12094         * interface.cs (Interface.GetInterfaceTypeByName): Return a
12095         TypeExpr instead of a Type.
12096         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
12097         (Interface.DefineType): Don't pass the interface types to the
12098         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
12099         them later and then call `TypeBulider.AddInterfaceImplementation()'.
12100
12101         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
12102         instead of a `Type[]'.
12103         (TypeManager.RegisterBuilder): Likewise.
12104         (TypeManager.AddUserInterface): Likewise.
12105         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
12106         `Type[]' and also return a `TypeExpr[]'.
12107         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
12108
12109 2003-11-08  Martin Baulig  <martin@ximian.com>
12110
12111         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12112         Expression.     
12113
12114 2003-11-08  Martin Baulig  <martin@ximian.com>
12115
12116         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12117         TypeManager.ResolveExpressionTypes().
12118
12119         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12120         instead of an Expression.
12121         (TypeExpr): This is now an abstract base class for `TypeExpression'.
12122         (TypeExpression): New public class; formerly known as `TypeExpr'.
12123
12124         * expression.cs (ComposedCast): Derive from TypeExpr.
12125
12126         * typemanager.cs (TypeManager.system_*_expr): These are now
12127         TypExpr's instead of Expression's.
12128         (TypeManager.ResolveExpressionTypes): New public static function;
12129         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12130         of them.        
12131
12132 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
12133
12134         * expression.cs (New.DoResolve): Do not dereference value that
12135         might be a null return.
12136
12137         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12138         sure that the constant value has the right type.  Fixes an
12139         unreported bug, similar to 50425.
12140
12141         * const.cs (Const.LookupConstantValue): Call
12142         ImplicitStandardConversionExists before doing a conversion to
12143         avoid havng the TypeManager.ChangeType do conversions.
12144
12145         Reduced the number of casts used
12146
12147         (Const.ChangeType): New routine to enable reuse of the constant
12148         type changing code from statement.
12149
12150         * typemanager.cs (ChangeType): Move common initialization to
12151         static global variables.
12152
12153         Fixes #50425.
12154
12155         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12156         every value type to go through, even if it was void.  Fix that. 
12157
12158         * cs-tokenizer.cs: Use is_identifier_start_character on the start
12159         character of the define, and the is_identifier_part_character for
12160         the rest of the string.
12161
12162 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
12163
12164         * expression.cs (UnaryMutator.EmitCode): When I updated
12165         LocalVariableReference.DoResolve, I overdid it, and dropped an
12166         optimization done on local variable references.
12167
12168 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
12169
12170         * ecore.cs: Convert the return from Ldlen into an int.
12171
12172 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
12173
12174         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12175         the accessibility, this is a special case for toplevel non-public
12176         classes (internal for instance).
12177
12178 2003-10-20  Nick Drochak <ndrochak@gol.com>
12179
12180         * ecore.cs: Fix typo and build.  Needed another right paren.
12181
12182 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
12183
12184         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
12185         `internal' case regular and protected, but not allowing protected
12186         to be evaluated later.  Bug 49840
12187
12188 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
12189
12190         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12191         to kb.Nlast, and not the kb.nFirst to isolate the switch
12192         statement.
12193
12194         Extract the underlying type, so enumerations of long/ulong are
12195         treated like long/ulong.
12196
12197 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
12198
12199         * expression.cs (New): Overload the meaning of RequestedType to
12200         track the possible creation of the NewDelegate type, since
12201         DoResolve is invoked more than once for new constructors on field
12202         initialization.
12203
12204         See bugs: #48800 and #37014
12205
12206         * cs-parser.jay (declare_local_constants): Take an arraylist
12207         instead of a single constant.
12208
12209         (local_constant_declaration): It should take a
12210         constant_declarators, not a constant_declarator.  Fixes 49487
12211
12212         * convert.cs: Fix error report.
12213
12214 2003-10-13 Jackson Harper <jackson@ximian.com>
12215
12216         * typemanager.cs (TypeToCoreType): Add float and double this fixes
12217         bug #49611
12218         
12219 2003-11-03  Martin Baulig  <martin@ximian.com>
12220
12221         * expression.cs (ArrayAccess.GetStoreOpcode): Added
12222         `out bool has_type_arg'; if set, we need to pass the type to
12223         ig.Emit().
12224         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
12225         Stelem_Any/Ldelem_Any for generic parameters.   
12226
12227 2003-11-02  Martin Baulig  <martin@ximian.com>
12228
12229         * expression.cs (Invocation.EmitCall): Use
12230         `TypeManager.IsValueType()' to check whether it's a value type.
12231         Don't set `struct_call' when calling a method on a type parameter.
12232
12233 2003-11-02  Martin Baulig  <martin@ximian.com>
12234
12235         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
12236         and removed the TypeBuilder argument.
12237
12238         * typemanager.cs (TypeManager.IsValueType): Return
12239         `t.IsGenericParameter || t.IsValueType'.
12240
12241 2003-10-25  Martin Baulig  <martin@ximian.com>
12242
12243         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
12244         call ConstructedType.Resolve() on it.
12245
12246         * generic.cs (ConstructedType.Resolve): Set `type' on success.
12247
12248 2003-10-25  Martin Baulig  <martin@ximian.com>
12249
12250         * class.cs (TypeContainer.GetClassBases): Changed
12251         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
12252         CS8214 reporting here.
12253         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
12254         instead of a `Type' for our parent.  In case of a recursive
12255         declaration (see tests/gen-23.cs for an example), our parent is a
12256         ConstructedType and it doesn't have its type set.  So, first
12257         create our own TypeBuilder, then call constructed.Resolve() to get
12258         the parent's type and finally TypeBuilder.SetParent() it.
12259
12260         * ecore.cs (TypeExpr.Name): New public virtual property.
12261
12262         * generic.cs
12263         (ConstructedType): We're now a TypeExpr and not just an Expression.
12264         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
12265         arguments here; this is done later.
12266         (ConstructedType.Resolve): New public method to resolve the type
12267         arguments and bind them.
12268
12269 2003-10-21  Martin Baulig  <martin@ximian.com>
12270
12271         * convert.cs: Use `TypeManager.IsValueType' instead of
12272         'type.IsValueType' everywhere.
12273
12274         * typemanager.cs (TypeManager.IsValueType): Return true for type
12275         parameters.  The reason for this is that we need to box a type
12276         parameter when converting it to a reference type.
12277
12278         * cs-parser.jay: Added support for default value expressions.
12279
12280         * generics.cs (DefaultValueExpression): New public class.       
12281
12282 2003-10-17  Martin Baulig  <martin@ximian.com>
12283
12284         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
12285         TypeContainer so we can also use this for Interfaces.
12286         (TypeParameter.Resolve): Likewise.
12287
12288         * interface.cs (Interface.DefineType): Added support for generic
12289         interfaces.
12290
12291         * cs-parser.jay: Added support for generic structs and interfaces.
12292
12293 2003-10-17  Martin Baulig  <martin@ximian.com>
12294
12295         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
12296         call generic methods :-)
12297
12298 2003-10-16  Martin Baulig  <martin@ximian.com>
12299
12300         * cs-parser.jay (namespace_or_type_name): Only create a
12301         GenericMemberAccess if we actually have type arguments.
12302
12303 2003-10-13  Martin Baulig  <martin@ximian.com>
12304
12305         * class.cs (Method.Define): If we're a generic method, call
12306         TypeBuilder.DefineGenericMethod () before resolving
12307         the parameters.
12308         (MethodData): Added .ctor which takes an additional MethodBuilder
12309         argument; this is used for generic methods.
12310         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
12311         we already have a MethodBuilder.
12312
12313 2003-10-10  Martin Baulig  <martin@ximian.com>
12314
12315         * class.cs (Method): Added .ctor which takes a `GenericMethod'
12316         instead of a `DeclSpace'.  This is used for generic methods.
12317
12318         * cs-parser.jay (method_header): Added support for generic
12319         methods; create a `GenericMethod' instance and pass it to the
12320         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
12321         parameters and locals.
12322
12323         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
12324         since we already have the location.  Check whether we're a generic
12325         type declaration or a generic method and create the correct type
12326         parameter.
12327
12328         * generic.cs (TypeParameter.DefineMethod): New public method.
12329         (GenericMethod): New public class; derives from DeclSpace and is
12330         used for generic methods.       
12331
12332 2003-10-09  Martin Baulig  <martin@ximian.com>
12333
12334         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12335         to the .ctor.
12336         (MethodCore.DoDefineParameters): Removed the TypeContainer
12337         argument; use the DeclSpace which was passed to the .ctor instead.
12338         (MethodCore.CheckParameter): Take a DeclSpace instead of a
12339         TypeContainer; we only need a DeclSpace here.
12340
12341 2003-10-09  Martin Baulig  <martin@ximian.com>
12342
12343         * class.cs (MethodData): Added additional `DeclSpace ds' argument
12344         to the .ctor.
12345         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12346         EmitContext's .ctor.    
12347
12348 2003-10-09  Martin Baulig  <martin@ximian.com>
12349
12350         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12351         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12352         AsAccessible(), moved them as well.
12353
12354         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12355
12356 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
12357
12358         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12359         generation for >=, as spotted by Paolo, bug 48679.  
12360         Patch from David Waite.
12361
12362         * cs-tokenizer.cs: Add handling for #pragma.
12363
12364         * cs-parser.jay: Allow for both yield and yield return in the
12365         syntax.  The anti-cobolization of C# fight will go on!
12366
12367         * class.cs (TypeBuilder.DefineType): Catch error condition here
12368         (Parent.DefineType erroring out and returning null).
12369
12370         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12371         coping with enumerations variables, we were mistakenly processing
12372         them as a regular value type instead of built-in types.  Fixes the
12373         bug #48063
12374
12375         * typemanager.cs (IsBuiltinOrEnum): New method.
12376
12377 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
12378
12379         * cs-parser.jay: Upgrade: yield now needs the return clause.
12380
12381 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12382
12383         * cs-parser.jay : Renamed yyName to yyNames related to jay.
12384
12385 2003-09-29  Martin Baulig  <martin@ximian.com>
12386
12387         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
12388         inflated generic methods.
12389
12390         * generics.cs (ConstructedType): Distinguish between open and
12391         closed constructed types; correctly resolve the arguments.
12392
12393 2003-09-22  Martin Baulig  <martin@ximian.com>
12394
12395         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
12396         all type arguments meet their constraints.
12397
12398 2003-09-19  Martin Baulig  <martin@ximian.com>
12399
12400         * decl.cs (MemberCache.SetupCacheForInterface): Take a
12401         `MemberCache parent' argument.  Normally, an interface doesn't
12402         have a parent type except System.Object, but we use this in gmcs
12403         for generic type parameters.
12404
12405 2003-09-18  Martin Baulig  <martin@ximian.com>
12406
12407         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12408         on `type.IsInterface'; don't check whether the type has a parent
12409         to determine whether it's an interface.
12410
12411 2003-09-17  Martin Baulig  <martin@ximian.com>
12412
12413         * generic.cs (ConstructedType.ToString): Always use `name' as the
12414         type name.
12415
12416 2003-09-15  Martin Baulig  <martin@ximian.com>
12417
12418         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
12419
12420         * generic.cs (Constraints.Resolve): New public method; this is
12421         called to resolve the constraint types and to check whether all
12422         the constraints are correct.
12423         (Constraints.Types): New public property.
12424         (TypeParameter.Resolve): New public method; resolves all the
12425         type's constraints.
12426
12427         * class.cs (TypeContainer.DefineType): Call
12428         TypeParameter.Resolve() before actually defining the type.
12429
12430 2003-09-15  Martin Baulig  <martin@ximian.com>
12431
12432         * class.cs (TypeContainer.DefineType): Added an error flag to
12433         avoid reporting duplicate CS0146's ("class definition is
12434         circular.").
12435
12436         * driver.cs (Driver.MainDriver): Abort if
12437         RootContext.ResolveTree() reported any errors.
12438
12439 2003-09-07  Martin Baulig  <martin@ximian.com>
12440
12441         * report.cs (Error, Warning): Added overloaded versions which take
12442         a `params object[] args' and call String.Format().
12443
12444 2003-09-07  Martin Baulig  <martin@ximian.com>
12445
12446         * decl.cs (DeclSpace..ctor): Don't call
12447         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12448         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
12449         (DeclSpace.RecordDecl): New method.
12450
12451         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12452
12453 2003-09-02  Ravi Pratap  <ravi@ximian.com>
12454
12455         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12456         value attributes to be applied to ParameterBuilders.
12457
12458         * class.cs (MethodCore.LabelParameters): Make static and more
12459         generic so that it can be used from other places - like interface
12460         methods, for instance.
12461
12462         * interface.cs (Interface.Emit): Call LabelParameters before
12463         emitting attributes on the InterfaceMethod.
12464
12465 2003-09-07  Martin Baulig  <martin@ximian.com>
12466
12467         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
12468         if the number of type parameters doesn't match.
12469
12470 2003-09-04  Martin Baulig  <martin@ximian.com>
12471
12472         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
12473         for arrays of generic type params (ie. `!0[]').
12474
12475 2003-09-04  Martin Baulig  <martin@ximian.com>
12476
12477         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
12478         for the moment.
12479
12480 2003-09-04  Martin Baulig  <martin@ximian.com>
12481
12482         * decl.cs (DeclSpace.LookupGeneric): New method.
12483         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
12484         moment.
12485
12486         * generic.cs (TypeParameterExpr): Take a TypeParameter as
12487         argument, not just a string.
12488         (TypeParameter.Define): New public method; this is called to
12489         actually define the generic parameter; after this, you can use the
12490         new `Type' property to get the type.
12491
12492 2003-09-04  Martin Baulig  <martin@ximian.com>
12493
12494         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
12495         is now an ArrayList; initialize the result of the `TypeParameters'
12496         property here.
12497         (DeclSpace.GetGenericData): Removed.
12498         (DeclSpace.LookupGeneric): Temporarily removed; we need to
12499         implement this in a different way.
12500         (DeclSpace.GetTypeParameters): Removed; there's now a
12501         `TypeParameters' property.
12502         (DeclSpace.TypeParameters): New public property.
12503
12504         * generic.cs (Constraints): Make this class public.
12505         (TypeParameter): New public class.
12506
12507 2003-09-04  Martin Baulig  <martin@ximian.com>
12508
12509         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
12510         generic parameters.
12511
12512         * class.cs (TypeContainer.DefineType): Call
12513         TypeBuilder.DefineGenericParameter () on all generic parameters if
12514         this is a generic type.
12515
12516 2003-08-28  Martin Baulig  <martin@ximian.com>
12517
12518         * sample-stack.il: Compile this with ilasm: "ilasm /dll
12519         sample-stack.il".
12520
12521         * sample-hello.cs: Compile this with gmcs: "gmcs
12522         /r:sample-stack.dll sample-hello.cs".
12523
12524 2003-08-28  Martin Baulig  <martin@ximian.com>
12525
12526         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
12527         the parameters to the generic type.
12528
12529 2003-08-28  Martin Baulig  <martin@ximian.com>
12530
12531         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
12532
12533 2003-08-28  Martin Baulig  <martin@ximian.com>
12534
12535         * cs-parser.jay (opt_type_argument_list): Use
12536         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
12537         (primary_expression): Replace `qualified_identifier' with `type_name'.
12538         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
12539
12540         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
12541         parser to check whether it is syntactically a type parameter list;
12542         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
12543         this case.
12544
12545 2003-08-26  Martin Baulig  <martin@ximian.com>
12546
12547         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12548         resolving aliases; fixes #47927.
12549
12550 2003-08-26  Martin Baulig  <martin@ximian.com>
12551
12552         * statement.cs (Using.DoResolve): This is internally emitting a
12553         try/finally clause, so we need to set ec.NeedExplicitReturn if we
12554         do not always return.  Fixes #47681.
12555
12556 2003-08-26  Martin Baulig  <martin@ximian.com>
12557
12558         * decl.cs (MemberCore): Moved WarningNotHiding(),
12559         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
12560         into MemberBase.
12561         (AdditionResult): Make this nested in DeclSpace.
12562         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
12563         argument; call NamespaceEntry.Define() unless we're nested in a
12564         class or struct.
12565
12566         * namespace.cs (Namespace.DefineName): New public function.  This
12567         is called from DeclSpace's .ctor to add 
12568         (Namespace.Lookup): Include DeclSpaces in the lookup.
12569
12570         * class.cs (Operator): Derive from MemberBase, not MemberCore.
12571
12572         * const.cs (Const): Derive from MemberBase, not MemberCore.     
12573
12574 2003-08-25  Martin Baulig  <martin@ximian.com>
12575
12576         * convert.cs (Convert.ExplicitReferenceConversion): When
12577         converting from an interface type to a class, unbox if the target
12578         type is a struct type.  Fixes #47822.
12579
12580 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12581
12582         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
12583         #47854.
12584
12585 2003-08-22  Martin Baulig  <martin@ximian.com>
12586
12587         * class.cs (TypeManager.DefineType): When defining a nested type,
12588         call DefineType() on our parent; fixes #47801.
12589
12590 2003-08-22  Martin Baulig  <martin@ximian.com>
12591
12592         * class.cs (MethodData.Define): While checking if a method is an
12593         interface implementation, improve the test a bit more to fix #47654.
12594
12595 2003-08-22  Martin Baulig  <martin@ximian.com>
12596
12597         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
12598         correctly; fixes #47722.
12599
12600 2003-08-22  Martin Baulig  <martin@ximian.com>
12601
12602         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
12603         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
12604
12605         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
12606
12607 2003-08-22  Martin Baulig  <martin@ximian.com>
12608
12609         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
12610         can only be assigned in static constructors.  Fixes #47161.
12611
12612 2003-08-22  Martin Baulig  <martin@ximian.com>
12613
12614         Rewrote and improved the flow analysis code.
12615
12616         * flowbranching.cs (FlowBranching): Make this class abstract.
12617         (FlowBranching.CreateBranching): New static function to create a
12618         new flow branching.
12619         (FlowBranchingBlock, FlowBranchingException): New classes.
12620         (FlowBranching.UsageVector.Type): New public readonly field.
12621         (FlowBranching.UsageVector.Breaks): Removed the setter.
12622         (FlowBranching.UsageVector.Returns): Removed the setter.
12623         (FlowBranching.UsageVector): Added Break(), Return(),
12624         NeverReachable() and Throw() methods to modify the reachability.
12625         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
12626         done by FlowBranching.Merge().
12627         (FlowBranching.UsageVector.MergeChild): New method; merges the
12628         merge result into the current vector.
12629         (FlowBranching.Merge): New abstract method to merge a branching.
12630
12631 2003-08-12  Martin Baulig  <martin@ximian.com>
12632
12633         * expression.cs (Indirection.CacheTemporaries): Create the
12634         LocalTemporary with the pointer type, not its element type.
12635
12636 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
12637
12638         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
12639         token was a keyword or not.
12640
12641         Add `error' options where an IDENTIFIER was expected;  Provide
12642         CheckToken and CheckIdentifierToken convenience error reporting
12643         functions. 
12644
12645         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
12646
12647         * decl.cs: Rename `NamespaceEntry Namespace' public field into
12648         NameSpaceEntry NameSpaceEntry.
12649
12650         (LookupInterfaceOrClass): Avoid creating a full qualified name
12651         from namespace and name: avoid doing lookups when we know the
12652         namespace is non-existant.   Use new Tree.LookupByNamespace which
12653         looks up DeclSpaces based on their namespace, name pair.
12654
12655         * driver.cs: Provide a new `parser verbose' to display the
12656         exception thrown during parsing.  This is turned off by default
12657         now, so the output of a failure from mcs is more graceful.
12658
12659         * namespace.cs: Track all the namespaces defined in a hashtable
12660         for quick lookup.
12661
12662         (IsNamespace): New method
12663
12664 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
12665
12666         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
12667         we know that we need to concatenate (full typename can never be
12668         null). 
12669
12670         * class.cs: ditto.
12671
12672         * statement.cs: Use a bitfield;  Do not initialize to null things
12673         which are done by the constructor by default.
12674
12675         * cs-parser.jay: bug fix, parameter was 4, not 3.
12676
12677         * expression.cs: Just use the property;
12678
12679         * statement.cs: No need for GetVariableInfo method.
12680
12681 2003-08-08  Martin Baulig  <martin@ximian.com>
12682
12683         * flowanalysis.cs (FlowReturns): This is now nested in the
12684         `FlowBranching' class.
12685         (MyBitVector): Moved this here from statement.cs.
12686         (FlowBranching.SiblingType): New enum type.
12687         (FlowBranching.CreateSibling): Added `SiblingType' argument.
12688
12689 2003-08-07  Martin Baulig  <martin@ximian.com>
12690
12691         * flowanalysis.cs (FlowBranchingType): This is now nested in the
12692         `FlowBranching' class and called `BranchingType'.
12693
12694 2003-08-07  Martin Baulig  <martin@ximian.com>
12695
12696         * flowanalysis.cs: Moved all the control flow analysis code into
12697         its own file.
12698
12699 2003-08-07  Martin Baulig  <martin@ximian.com>
12700
12701         * assign.cs (Assign.DoResolve): `target' must either be an
12702         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
12703         #37319.
12704
12705 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
12706
12707         * expression.cs (BinaryMethod): This kind of expression is created by the
12708         Binary class if it determines that the operator has to be handled
12709         by a method.
12710
12711         (BinaryDelegate): This kind of expression is created if we are
12712         dealing with a + or - operator on delegates.
12713
12714         (Binary): remove method, argumetns, and DelegateOperator: when
12715         dealing with methods, 
12716
12717         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
12718
12719         * statement.cs (Block): use bitfields for the three extra booleans
12720         we had in use.   Remove unused topblock parameter.
12721
12722         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
12723
12724         * assign.cs: Drop extra unneeded tests.
12725
12726 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
12727
12728         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
12729
12730         * statement.cs (Foreach): Use VariableStorage instead of
12731         LocalBuilders.   
12732
12733         * codegen.cs (VariableStorage): New class used by clients that
12734         require a variable stored: locals or fields for variables that
12735         need to live across yield.
12736
12737         Maybe provide a convenience api for EmitThis+EmitLoad?
12738
12739         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
12740         these bad boys.
12741
12742 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
12743
12744         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
12745         RemapParameterLValue): New methods that are used to turn a
12746         precomputed FieldInfo into an expression like this:
12747
12748                 instance.FieldInfo
12749
12750         The idea is to use this instead of making LocalVariableReference
12751         have more than one meaning.
12752
12753         * cs-parser.jay: Add error production to BASE.
12754
12755         * ecore.cs: Deal with TypeManager.GetField returning null, which
12756         is now a valid return value.
12757
12758         (FieldExprNoAddress): New expression for Fields whose address can
12759         not be taken.
12760
12761         * expression.cs (LocalVariableReference): During the resolve
12762         phases, create new expressions if we are in a remapping context.
12763         Remove code that dealt with remapping here.
12764
12765         (ParameterReference): same.
12766
12767         (ProxyInstance): New expression, like the `This' expression, but
12768         it is born fully resolved.  We know what we are doing, so remove
12769         the errors that are targeted to user-provided uses of `this'.
12770
12771         * statement.cs (Foreach): our variable is now stored as an
12772         Expression;  During resolution, follow the protocol, dont just
12773         assume it will return this.
12774
12775 2003-08-06  Martin Baulig  <martin@ximian.com>
12776
12777         * support.cs (SeekableStreamReader.cs): New public class.
12778
12779         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
12780         SeekableStreamReader instead of the normal StreamReader.
12781
12782 2003-08-04  Martin Baulig  <martin@ximian.com>
12783
12784         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
12785         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
12786         deambiguate casts and delegate invocations.
12787         (parenthesized_expression): Use the new tokens to ensure this is
12788         not a cast of method invocation.
12789
12790         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
12791         when reading a `)' and Deambiguate_CloseParens () was previously
12792         called.
12793
12794         * expression.cs (ParenthesizedExpression): New class.  This is
12795         just used for the CS0075 test.
12796         (Binary.DoResolve): Check for CS0075.   
12797
12798 2003-07-29  Ravi Pratap  <ravi@ximian.com>
12799
12800         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
12801         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
12802         reference comparison.
12803
12804         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
12805         examine the ReturnType for equality - this is necessary in the
12806         cases of implicit and explicit operators whose signature also
12807         includes the return type.
12808
12809 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
12810
12811         * namespace.cs: Cache the result of the namespace computation,
12812         instead of computing it every time.
12813
12814 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
12815
12816         * decl.cs: Use a global arraylist that we reuse over invocations
12817         to avoid excesive memory consumption.  Reduces memory usage on an
12818         mcs compile by one meg (45 average).
12819
12820         * typemanager.cs (LookupTypeReflection): In .NET pointers are
12821         private, work around that.
12822
12823 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
12824
12825         * literal.cs (IntLiteral): Define Zero and One static literals. 
12826
12827         * cs-parser.jay (integer_literal): use static literals to reduce
12828         memory usage for the most used literals (0, 1 and -1).  211kb
12829         reduced in memory usage.
12830
12831         Replace all calls to `new ArrayList' with `new
12832         ArrayList(4)' which is a good average number for most allocations,
12833         and also requires only 16 bytes of memory for its buffer by
12834         default. 
12835
12836         This reduced MCS memory usage in seven megabytes for the RSS after
12837         bootstrapping.
12838
12839 2003-07-28  Ravi Pratap  <ravi@ximian.com>
12840
12841         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
12842         handle params methods the correct way by forming only one
12843         applicable set with params and normal methods in them. Earlier we
12844         were looking at params methods only if we found no normal methods
12845         which was not the correct thing to do.
12846
12847         (Invocation.BetterFunction): Take separate arguments indicating
12848         when candidate and the best method are params methods in their
12849         expanded form.
12850
12851         This fixes bugs #43367 and #46199.
12852
12853         * attribute.cs: Documentation updates.
12854
12855         (CheckAttribute): Rename to CheckAttributeTarget.
12856         (GetValidPlaces): Rename to GetValidTargets.
12857
12858         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
12859         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
12860
12861         Fixes bug #44468.
12862
12863 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
12864
12865         * codegen.cs: Compute IsGeneric correctly.
12866
12867         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
12868         resolution. 
12869
12870         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
12871         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
12872         regressions, and I was chasing more bugs than I required.
12873
12874         * interface.cs: Use expressions for base type names (like classes
12875         and structs have been doing for a while now), and resolve that.
12876         This patch should probably go into head as well.
12877
12878         This makes it one less user of FindType.
12879
12880 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
12881
12882         This compiler can not self host currently.  Need to fix that.
12883         
12884         * Makefile: compile to `gmcs.exe'
12885
12886         * driver.cs: Turn on v2 by default on gmcs.
12887
12888         * generic.cs (ConstructedType): Does no longer take a container
12889         type argument;  That will be taken care of later.
12890
12891         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
12892         Use SimpleName to resolve for now, so we can continue the work on
12893         the parser, until we get Type.GetType that understands generics.
12894
12895         (ConstructedType.ToString): Implement
12896
12897         (TypeArguments.Resolve): Resolve the child expressions as types. 
12898         
12899         * cs-parser.jay: Rename interface_constraints to
12900         type_parameter_constraints
12901
12902         (namespace_or_type_name): Only use constructed types for the basic
12903         construction, we will deal with identifier<...> later.
12904
12905         (type/type_name): No longer call DecomposeQI, as
12906         namespace_or_type_name is always decoded now.
12907         
12908 2003-07-22  Ravi Pratap  <ravi@ximian.com>
12909
12910         * expression.cs (Invocation.OverloadResolve): Follow the spec more
12911         closely: we eliminate methods in base types when we have an
12912         applicable method in a top-level type.
12913
12914         Please see section 14.5.5.1 for an exact description of what goes
12915         on. 
12916
12917         This fixes bug #45127 and a host of other related to corlib compilation.
12918
12919         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
12920         array is the method corresponding to the top-level type (this is
12921         because of the changes made to icall.c) so we change this
12922         accordingly.
12923
12924         (MethodGroupExpr.Name): This too.
12925
12926         * typemanager.cs (GetElementType): New method which does the right
12927         thing when compiling corlib. 
12928
12929         * everywhere: Make use of the above in the relevant places.
12930
12931 2003-07-22  Martin Baulig  <martin@ximian.com>
12932
12933         * cs-parser.jay (invocation_expression): Moved
12934         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
12935         `cast_expression', but create a InvocationOrCast which later
12936         resolves to either an Invocation or a Cast.
12937
12938         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
12939         method; call this before EmitStatement() to make sure that this
12940         expression can be used as a statement.
12941
12942         * expression.cs (InvocationOrCast): New class; resolves to either
12943         an Invocation or a Cast.
12944
12945         * statement.cs (StatementExpression): Call ResolveStatement() on
12946         the ExpressionStatement before emitting it.
12947
12948 2003-07-21  Martin Baulig  <martin@ximian.com>
12949
12950         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
12951         `ref' and `out' attributes match; fixes #46220.
12952         (MemberAccess.ResolveMemberAccess): You can't reference a type
12953         through an expression; fixes #33180.
12954         (Indexers.GetIndexersForType): Don't return the indexers from
12955         interfaces the class implements; fixes #46502.
12956
12957 2003-07-21  Martin Baulig  <martin@ximian.com>
12958
12959         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
12960         CS0661 checks; fixes bug #30442.
12961
12962 2003-07-21  Martin Baulig  <martin@ximian.com>
12963
12964         * decl.cs (AdditionResult): Added `Error'.
12965
12966         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
12967
12968         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
12969         cs0031.cs actually work.
12970
12971  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
12972  
12973         * cs-parser.jay (namespace_name): do not use
12974         namespace_or_type_name, use qualified_identifier, because
12975         namespace_or_type_name will soon return a composed expression
12976         instead of a string.
12977  
12978         (namespace_or_type_name): Instead of returning a string, now this
12979         production returns an expression.
12980  
12981         * codegen.cs (EmitContext): Setup IsGeneric property based on
12982         whether our DeclSpace is generic, our the method is generic.
12983  
12984         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
12985         the method is generic.
12986  
12987         * cs-parser.jay (type_arguments, opt_type_argument_list,
12988         type_parameters, type_parameter_list, opt_type_parameter_list,
12989         type_parameter,, opt_type_parameter_constraints_clauses,
12990         type_parameter_constraints_clauses,
12991         type_parameter_constraint_clause, type_parameter_constraint,
12992         interface_constraints): Add new production
12993  
12994         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
12995         DeclSpace is generic or not.
12996  
12997         (DeclSpace.SetParameterInfo): New routine, used to set the
12998         parameter info for a type.
12999  
13000         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
13001         returns a GenericTypeExpr
13002  
13003         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
13004         generic, lookup the generic argument.
13005  
13006         * attribute.cs: Do not allow TypeParameterExpressions in
13007         Attributes.
13008  
13009         * class.cs: Do not allow the Main method to be defined in a
13010         Generic container.
13011  
13012         * expression.cs (SizeOf): Do not allow generic types to be used as
13013         arguments to sizeof.
13014  
13015         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
13016         it: whether a type is generic or not.  Only works for types we are
13017         currently building for now.
13018         
13019 2003-07-20  Martin Baulig  <martin@ximian.com>
13020
13021         * namespace.cs: Fixed that bug which caused a crash when compiling
13022         the debugger's GUI.
13023
13024 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
13025
13026         * typemanager.cs (LookupTypeReflection): Never expose types which
13027         are NotPublic, NestedPrivate, NestedAssembly, or
13028         NestedFamANDAssem.  We used to return these, and later do a check
13029         that would report a meaningful error, but the problem is that we
13030         would not get the real match, if there was a name override.
13031
13032 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
13033
13034         * namespace.cs (Namespace, Name): Do not compute the namespace
13035         name dynamically, compute it in the constructor.  This reduced
13036         memory usage by 1697 KB.
13037
13038         * driver.cs: Use --pause to pause at the end.
13039
13040 2003-07-17  Peter Williams  <peter@newton.cx>
13041
13042         * Makefile: Change the name of the test target so that it doesn't
13043         conflict with the recursive test target.
13044
13045 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
13046
13047         * expression.cs (LocalVariableReference.Emit, EmitAssign,
13048         AddressOf): Do not use EmitThis, that was wrong, use the actual
13049         this pointer.
13050
13051 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
13052
13053         * class.cs (MethodData.Define): While checking if a method is an
13054         interface implementation, improve the test: If we are not public
13055         (use new test here: use the computed MethodAttributes directly,
13056         instead of the parsed modifier flags) check if the `implementing'
13057         method comes from an interface or not.
13058
13059         * pending.cs (VerifyPendingMethods): Slightly better error
13060         message.
13061
13062         * makefile: add test target that does the mcs bootstrap.
13063
13064 2003-07-16  Ravi Pratap  <ravi@ximian.com>
13065
13066         * interface.cs (Define): Do nothing here since there are no
13067         members to populate etc. Move the attribute emission out of here
13068         since this was just totally the wrong place to put it. Attribute
13069         application happens during the 'Emit' phase, not in the 'Define'
13070         phase.
13071
13072         (Emit): Add this method and move the attribute emission here
13073
13074         * rootcontext.cs (EmitCode): Call the Emit method on interface
13075         types too.
13076
13077 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13078
13079         * expression.cs (OverloadResolve): Report error only if Location
13080         is not 'Null' which means that there was a probe going on.
13081
13082 2003-07-14  Martin Baulig  <martin@ximian.com>
13083
13084         * expression.cs (ConditionalLogicalOperator): New public class to
13085         implement user defined conditional logical operators.
13086         This is section 14.11.2 in the spec and bug #40505.
13087
13088 2003-07-14  Martin Baulig  <martin@ximian.com>
13089
13090         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
13091
13092 2003-07-14  Martin Baulig  <martin@ximian.com>
13093
13094         * codegen.cs (EmitContext.InFixedInitializer): New public field.
13095
13096         * ecore.cs (IVariable.VerifyFixed): New interface method.
13097
13098         * expression.cs (Unary.ResolveOperator): When resolving the `&'
13099         operator, check whether the variable is actually fixed.  Fixes bug
13100         #36055.  Set a variable definitely assigned when taking its
13101         address as required by the spec.
13102
13103         * statement.cs (LocalInfo.IsFixed): New field.
13104         (LocalInfo.MakePinned): Set `IsFixed' to true.
13105
13106 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13107
13108         * attribute.cs (Attribute.Resolve): While doing a Member lookup
13109         for .ctors, ensure that we only ask for members declared in the
13110         attribute type (BindingFlags.DeclaredOnly).
13111
13112         Fixes bug #43632.
13113
13114         * expression.cs (Error_WrongNumArguments): Report error 1501
13115         correctly the way CSC does.
13116
13117 2003-07-13  Martin Baulig  <martin@ximian.com>
13118
13119         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
13120         lookup on the fully qualified name, to make things like "X.X" work
13121         where "X.X" is a fully qualified type name, but we also have a
13122         namespace "X" in the using list.  Fixes #41975.
13123
13124 2003-07-13  Martin Baulig  <martin@ximian.com>
13125
13126         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
13127         function. If we're a CompoundAssign, we need to create an embedded
13128         CompoundAssign, not an embedded Assign.
13129         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
13130         Fixes #45854.
13131
13132 2003-07-13  Martin Baulig  <martin@ximian.com>
13133
13134         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
13135         work to fix bug #46088.
13136
13137 2003-07-13  Ravi Pratap <ravi@ximian.com>
13138
13139         * class.cs (Operator.Emit): Do not emit attributes here - it is
13140         taken care of by the Method class that we delegate too. This takes
13141         care of bug #45876.
13142
13143 2003-07-10  Martin Baulig  <martin@ximian.com>
13144
13145         * expression.cs (TypeOfVoid): New class.
13146         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
13147
13148 2003-07-10  Martin Baulig  <martin@ximian.com>
13149
13150         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
13151         bug #35957.
13152
13153 2003-07-10  Martin Baulig  <martin@ximian.com>
13154
13155         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
13156         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
13157
13158         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
13159
13160         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
13161
13162 2003-07-10  Martin Baulig  <martin@ximian.com>
13163
13164         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
13165         of decimal.  Fixes #42850.
13166
13167         NOTE: I also fixed the created byte blob, but this doesn't work on
13168         the MS runtime and csc never produces any byte blobs for decimal
13169         arrays.
13170
13171 2003-07-10  Martin Baulig  <martin@ximian.com>
13172
13173         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
13174         structs; fixes #32068.
13175         (Block.AddChildVariableNames): Fixed #44302.
13176
13177 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13178
13179         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
13180
13181 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13182
13183         * attribute.cs: And this test is onger needed.
13184
13185 2003-07-08  Martin Baulig  <martin@ximian.com>
13186
13187         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
13188         inaccessible types.  Fixes #36313.
13189
13190         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
13191
13192         * namespace.cs (NamespaceEntry): Create implicit entries for all
13193         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
13194         implicit entries for N1.N2 and N1.
13195
13196 2003-07-08  Martin Baulig  <martin@ximian.com>
13197
13198         Rewrote the handling of namespaces to fix a lot of the issues
13199         wrt. `using' aliases etc.
13200
13201         * namespace.cs (Namespace): Splitted this class into a
13202         per-assembly `Namespace' and a per-file `NamespaceEntry'.
13203
13204         * typemanager.cs (TypeManager.IsNamespace): Removed.
13205         (TypeManager.ComputeNamespaces): Only compute namespaces from
13206         loaded assemblies here, not the namespaces from the assembly we're
13207         currently compiling.
13208
13209 2003-07-08  Martin Baulig  <martin@ximian.com>
13210
13211         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
13212
13213 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13214
13215         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
13216         already fixed it.  
13217
13218         I thought about the memory savings here, but LookupTypeReflection
13219         is used under already very constrained scenarios.  Compiling
13220         corlib or mcs only exposes one hit, so it would not really reduce
13221         any memory consumption.
13222
13223 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13224
13225         * typemanager.cs: fixes bug #45889 by only adding public types from
13226         other assemblies to the list of known types.
13227
13228 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13229
13230         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
13231         on the type we resolved.
13232
13233 2003-07-05  Martin Baulig  <martin@ximian.com>
13234
13235         * pending.cs (PendingImplementation.ParentImplements): Don't
13236         create the proxy if the parent is abstract.
13237
13238         * class.cs (TypeContainer.DefineIndexers): Process explicit
13239         interface implementations first.  Fixes #37714.
13240
13241 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
13242
13243         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
13244         defined recursively;  but since we modify the input parameters
13245         (left is set to `this' temporarily), we reset this value if the
13246         left_is_explicit is false, which gives the original semantics to
13247         the code.  
13248
13249         * literal.cs (NullPointer): new class used to represent a null
13250         literal in a pointer context.
13251
13252         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
13253         type is a pointer, use a NullPointer object instead of a
13254         NullLiteral.   Closes 43687
13255
13256         (ExplicitConversion): Convert pointer values using
13257         the conv opcode to the proper type.
13258
13259         * ecore.cs (New): change ValueTypeVariable property into a method,
13260         that returns whether the valuetype is suitable for being used.
13261
13262         * expression.cs (Binary.DoNumericPromotions): Only return if we
13263         the int constant was a valid uint, and we can return both left and
13264         right as uints.  If not, we continue processing, to trigger the
13265         type conversion.  This fixes 39018.
13266
13267         * statement.cs (Block.EmitMeta): During constant resolution, set
13268         the CurrentBlock property on the emitcontext, so that we resolve
13269         constants propertly.
13270
13271 2003-07-02  Martin Baulig  <martin@ximian.com>
13272
13273         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
13274         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
13275
13276         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13277         than emitting it here.
13278
13279         * statement.cs: Fixed some more flow analysis bugs.
13280
13281 2003-07-02  Martin Baulig  <martin@ximian.com>
13282
13283         * class.cs (MethodData.Define): When implementing interface
13284         methods, set Final unless we're Virtual.
13285
13286         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
13287         check work for interface methods.
13288
13289 2003-07-01  Martin Baulig  <martin@ximian.com>
13290
13291         * ecore.cs (EmitContext.This): Replaced this property with a
13292         GetThis() method which takes a Location argument.  This ensures
13293         that we get the correct error location for a CS0188.
13294
13295 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
13296
13297         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13298         ImplicitStandardConversion.
13299
13300         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13301
13302 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
13303
13304         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13305         optimization.
13306
13307 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
13308
13309         * class.cs (Constructor.Define): Turn off initlocals for unsafe
13310         constructors.
13311
13312         (MethodData.Define): Turn off initlocals for unsafe methods.
13313
13314 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
13315
13316         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13317         complete;  Fixes #37521.
13318
13319         * delegate.cs: Use Modifiers.TypeAttr to compute the
13320         TypeAttributes, instead of rolling our own.  This makes the flags
13321         correct for the delegates.
13322
13323 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
13324
13325         * class.cs (Constructor.Define): Set the private flag for static
13326         constructors as well.
13327
13328         * cs-parser.jay (statement_expression): Set the return value to
13329         null, to avoid a crash when we catch an error.
13330
13331 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
13332
13333         * cs-parser.jay: Applied patch from Jackson that adds support for
13334         extern and unsafe modifiers to destructor declarations.
13335
13336         * expression.cs: Report error 21 if the user is trying to index a
13337         System.Array.
13338
13339         * driver.cs: Add an error message, suggested by the bug report.
13340
13341         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13342         if we do not have a ": this ()" constructor initializer.  Fixes 45149
13343
13344 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
13345
13346         * namespace.cs: Add some information to reduce FAQs.
13347
13348 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
13349
13350         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13351         underlying enumeration types.  Fixes #43915.
13352
13353         * expression.cs: Treat ushort/short as legal values to be used in
13354         bitwise operations.
13355
13356 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13357
13358         * delegate.cs: transfer custom attributes for paramenters from
13359         the delegate declaration to Invoke and BeginInvoke.
13360
13361 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13362
13363         * attribute.cs: handle custom marshalers and emit marshal info
13364         for fields, too.
13365
13366 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
13367
13368         * makefile.gnu: Added anonymous.cs to the compiler sources.
13369
13370 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
13371
13372         * iterators.cs: Change the name of the proxy class to include two
13373         underscores.
13374
13375         * cs-parser.jay: Update grammar to include anonymous methods.
13376
13377         * anonymous.cs: new file.
13378
13379 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
13380
13381         * class.cs (Field.Define): Add missing test for pointers and
13382         safety. 
13383
13384 2003-05-27  Ravi Pratap  <ravi@ximian.com>
13385
13386         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13387         we use the stobj opcode.
13388
13389         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13390         since it wasn't the correct fix. 
13391
13392         It still is puzzling that we are required to use stobj for IntPtr
13393         which seems to be a ValueType.
13394
13395 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
13396
13397         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13398         during regular simple name resolution.   Now, the trick is that
13399         instead of returning for processing the simplename, we do a
13400         TypeManager.LookupType (ie, a rooted lookup as opposed to a
13401         contextual lookup type).   If a match is found, return that, if
13402         not, return for further composition.
13403
13404         This fixes long-standing 30485.
13405
13406         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13407         using the address to initialize an object, do an Stobj instead of
13408         using the regular Stelem.
13409
13410         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13411         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13412         Because if we are a BaseIndexerAccess that value will be true.
13413         Fixes 43643.
13414
13415         * statement.cs (GotoCase.Resolve): Return after reporting an
13416         error, do not attempt to continue. 
13417
13418         * expression.cs (PointerArithmetic.Emit): If our operand is a
13419         long, convert our constants to match the operand before
13420         multiplying.  Convert to I type before adding.   Fixes 43670.
13421
13422 2003-05-14  Ravi Pratap  <ravi@ximian.com>
13423
13424         * enum.cs (ImplicitConversionExists) : Rename to
13425         ImplicitEnumConversionExists to remove ambiguity. 
13426
13427         * ecore.cs (NullCast): New type of cast expression class which
13428         basically is very similar to EmptyCast with the difference being
13429         it still is a constant since it is used only to cast a null to
13430         something else
13431         (eg. (string) null)
13432
13433         * convert.cs (ImplicitReferenceConversion): When casting a null
13434         literal, we return a NullCast.
13435
13436         * literal.cs (NullLiteralTyped): Remove - I don't see why this
13437         should be around anymore.
13438
13439         The renaming (reported was slightly wrong). Corrections:
13440
13441         ConvertImplicitStandard -> ImplicitConversionStandard
13442         ConvertExplicitStandard -> ExplicitConversionStandard
13443
13444         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13445         before passing them in !
13446
13447         * convert.cs (ImplicitConversionStandard): When comparing for
13448         equal expr and target types, ensure that expr is not a
13449         NullLiteral.
13450
13451         In general, we must not be checking (expr_type ==
13452         target_type) in the top level conversion methods
13453         (ImplicitConversion, ExplicitConversion etc). This checking is
13454         done in the methods that they delegate to.
13455
13456 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
13457
13458         * convert.cs: Move Error_CannotConvertType,
13459         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13460         ImplicitNumericConversion, ImplicitConversionExists,
13461         ImplicitUserConversionExists, StandardConversionExists,
13462         FindMostEncompassedType, FindMostSpecificSource,
13463         FindMostSpecificTarget, ImplicitUserConversion,
13464         ExplicitUserConversion, GetConversionOperators,
13465         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13466         TryImplicitIntConversion, Error_CannotConvertImplicit,
13467         ConvertImplicitRequired, ConvertNumericExplicit,
13468         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13469         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13470         its own file.
13471
13472         Perform the following renames:
13473
13474         StandardConversionExists -> ImplicitStandardConversionExists
13475         ConvertImplicit -> ImplicitConversion
13476         ConvertImplicitStandard -> ImplicitStandardConversion
13477         TryImplicitIntConversion -> ImplicitIntConversion
13478         ConvertImplicitRequired -> ImplicitConversionRequired
13479         ConvertNumericExplicit -> ExplicitNumericConversion
13480         ConvertReferenceExplicit -> ExplicitReferenceConversion
13481         ConvertExplicit -> ExplicitConversion
13482         ConvertExplicitStandard -> ExplicitStandardConversion
13483
13484 2003-05-19  Martin Baulig  <martin@ximian.com>
13485
13486         * statement.cs (TypeInfo.StructInfo): Made this type protected.
13487         (TypeInfo): Added support for structs having structs as fields.
13488
13489         * ecore.cs (FieldExpr): Implement IVariable.
13490         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13491         VariableInfo for the field.
13492
13493 2003-05-18  Martin Baulig  <martin@ximian.com>
13494
13495         * expression.cs (This.DoResolve): Report a CS0027 if we're
13496         emitting a field initializer.
13497
13498 2003-05-18  Martin Baulig  <martin@ximian.com>
13499
13500         * expression.cs (This.ResolveBase): New public function.
13501         (This.DoResolve): Check for CS0188.
13502
13503         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13504         This.Resolve().
13505
13506         * ecore.cs (MethodGroupExpr.DoResolve): Set the
13507         `instance_expression' to null if we don't have any non-static
13508         methods.
13509
13510 2003-05-18  Martin Baulig  <martin@ximian.com>
13511
13512         Reworked the way how local variables and parameters are handled by
13513         the flow analysis code.
13514
13515         * statement.cs (TypeInfo, VariableMap): New public classes.
13516         (VariableInfo): New public class.  This is now responsible for
13517         checking whether a variable has been assigned.  It is used for
13518         parameters and local variables.
13519         (Block.EmitMeta): Take the InternalParameters as argument; compute
13520         the layout of the flow vectors here.
13521         (Block.LocalMap, Block.ParameterMap): New public properties.
13522         (FlowBranching): The .ctor doesn't get the InternalParameters
13523         anymore since Block.EmitMeta() now computes the layout of the flow
13524         vector.
13525         (MyStructInfo): This class is now known as `StructInfo' and nested
13526         in `TypeInfo'; we don't access this directly anymore.
13527
13528         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13529         property and removed IsAssigned(), IsFieldAssigned(),
13530         SetAssigned() and SetFieldAssigned(); we now call them on the
13531         VariableInfo so we don't need to duplicate this code everywhere.
13532
13533         * expression.cs (ParameterReference): Added `Block block' argument
13534         to the .ctor.
13535         (LocalVariableReference, ParameterReference, This): The new
13536         VariableInfo class is now responsible for all the definite
13537         assignment stuff.
13538
13539         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13540         IsParameterAssigned, SetParameterAssigned): Removed.
13541
13542 2003-05-18  Martin Baulig  <martin@ximian.com>
13543
13544         * typemanager.cs (InitCoreTypes): Try calling
13545         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13546         the 3-args-version.  Corlib now also needs our `void_type'.
13547         (GetMethod): Added overloaded version which takes an optional
13548         `bool report_errors' to allow lookups of optional methods.
13549
13550 2003-05-12  Martin Baulig  <martin@ximian.com>
13551
13552         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13553         only used for locals and not for parameters.
13554
13555 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
13556
13557         * support.cs (InternalParameters.ParameterType): Return the
13558         ExternalType of the parameter.
13559
13560         * parameter.cs (Parameter.ExternalType): drop the two arguments,
13561         they were unused.
13562
13563 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
13564
13565         * class.cs (MethodData.Define): Do not set the `newslot' on
13566         interface members, if they are also flagged as "override".
13567
13568         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
13569         better code for ++i and i++.  This only works for static fields
13570         and local variables.
13571
13572         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
13573         want to pull the DeclSpace out of the builder_to_declspace instead
13574         of the TypeBuilder (like in TypeContainer.FindMembers).
13575
13576         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
13577         instead of LookupTypeContainer.  Fixes the crash on .NET for
13578         looking up interface members.
13579
13580         * const.cs: Create our own emit context during the Definition
13581         stage, so that constants are evaluated in the proper context, when
13582         a recursive definition happens.
13583
13584 2003-05-11  Martin Baulig  <martin@ximian.com>
13585
13586         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
13587         new block for a switch section.
13588         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
13589         the adding/lookup in the switch block.  Fixes #39828.
13590
13591 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
13592
13593         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
13594         functionality: I needed to convert the data after I had performed
13595         the add/sub operation into the operands type size.
13596
13597         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
13598         pass the type for the box operation, otherwise the resulting
13599         object would have been of type object.
13600
13601         (BoxedCast): Add constructor to specify the type to box as.
13602
13603 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
13604
13605         * iterators.cs: I was reusing the `count' variable inadvertently,
13606         take steps to not allow this to happen.
13607
13608 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
13609
13610         * attribute.cs (Attribute.Resolve): Params attributes are encoded
13611         by creating an array at the point where the params starts and
13612         putting all those arguments there, then adjusting the size of the
13613         array.
13614
13615 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
13616
13617         * expression.cs (New.AddressOf): Implement interface
13618         IMemoryLocation.  This is used when the `new' operator is used in
13619         the context of an invocation to a method on a value type.
13620
13621         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
13622         example. 
13623
13624         * namespace.cs: Also check the using aliases here.
13625
13626         * driver.cs: Move the test for using validity after the types have
13627         been entered, so we do a single pass that also includes the using
13628         aliases. 
13629
13630         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
13631         in the regular case.   CreateSiblingForFinally is doing extra
13632         error checking.
13633
13634         * attribute.cs (GetAttributeArgumentExpression): Store the result
13635         on an out value, and use the return value to indicate failure
13636         instead of using null (which is a valid return for Constant.GetValue).
13637
13638         * statement.cs: Perform the analysis flow for the increment
13639         portion after the statement, because this will be the real flow of
13640         execution.  Fixes #42385
13641
13642         * codegen.cs (EmitContext.EmitArgument,
13643         EmitContext.EmitStoreArgument): New helper functions when the
13644         RemapToProxy flag is set.
13645
13646         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
13647         function.
13648
13649         Add support for remapping parameters. 
13650
13651         * iterators.cs: Propagate parameter values;  Store parameter
13652         values in the proxy classes.
13653
13654 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
13655
13656         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
13657         need a proxy reference;  I do not know what I was thinking
13658
13659         * cs-parser.jay (constructor_initializer): catch another error,
13660         and display nice message.
13661
13662         (field_declaration): catch void field declaration
13663         to flag a better error. 
13664
13665         * class.cs (MemberBase.CheckBase): Report an error instead of a
13666         warning if a new protected member is declared in a struct. 
13667         (Field.Define): catch the error of readonly/volatile.
13668
13669         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
13670
13671         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
13672         volatile variable is taken
13673
13674 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
13675
13676         * statement.cs (Fixed.Resolve): Report an error if we are not in
13677         an unsafe context.
13678
13679 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
13680
13681         * typemanager.cs: reuse the code that handles type clashes for
13682         delegates and enumerations.
13683
13684         * class.cs (Report28): Always report.
13685
13686         * expression.cs (EncodeAsAttribute): Allow nulls here.
13687
13688 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
13689
13690         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
13691         the functionality for testing whether an expression is valid for
13692         an attribute here.  Also handle the case of arrays of elements
13693         being stored. 
13694
13695         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
13696         encoding a linear array into an array of objects that are suitable
13697         to be passed to an CustomAttributeBuilder.
13698
13699         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
13700
13701         * ecore.cs: (FieldExpr): Handle field remapping here.
13702
13703         * iteratators.cs: Pass the instance variable (if the method is an
13704         instance method) to the constructors, so we can access the field
13705         variables on the class.
13706
13707         TODO: Test this with structs.  I think the THIS variable on
13708         structs might have to be a pointer, and not a refenrece
13709
13710 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
13711
13712         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
13713         local variables to fields in a proxy class.
13714
13715         * iterators.cs (PopulateProxy): Rename our internal fields to
13716         <XXX>.  
13717         Create a <THIS> field if we are an instance method, so we can
13718         reference our parent container variables.
13719         (MapVariable): Called back from the EmitContext code to enter a
13720         new variable to field mapping into the proxy class (we just create
13721         a FieldBuilder).
13722
13723         * expression.cs
13724         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
13725         for using the remapped locals to fields.
13726
13727         I placed the code here, because that gives the same semantics to
13728         local variables, and only changes the Emit code.
13729
13730         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
13731         statements inside iterators.
13732         (VariableInfo): Add a FieldBuilder for the cases when we are
13733         remapping local variables to fields in a proxy class
13734
13735         * ecore.cs (SimpleNameResolve): Avoid testing two times for
13736         current_block != null.
13737
13738         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
13739         not cope with strings, as it has been moved to the
13740         TableSwitchEmit.  Fixed bug in switch generation.
13741
13742         * expression.cs (New.DoResolve): Provide more context for the user
13743         when reporting an error.
13744
13745         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
13746         pointers. 
13747
13748         * expression.cs (MemberAccess.DoResolve): When we get a type back,
13749         check the permissions for it.  Note than in a type-resolution
13750         context the check was already present in DeclSpace.ResolveType,
13751         but was missing from the MemberAccess.
13752
13753         (ArrayCreation.CheckIndices): warn if the user has
13754         more nested levels of expressions, but there are no more
13755         dimensions specified.  Avoids crash on bug 41906.
13756
13757 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
13758
13759         * statement.cs (Block): replace Implicit bool, for a generic
13760         flags.   
13761         New flag: `Unchecked'.  This is used during the EmitMeta phase
13762         (which is out-of-line with the regular Resolve/Emit process for a
13763         statement, as this is done ahead of time, but still gets a chance
13764         to call constant resolve).
13765
13766         (Block.Flags): new enum for adding a new flag.
13767
13768         (Block.EmitMeta): track the state of unchecked.
13769
13770         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
13771         to enable constant resolution to work there as well.
13772
13773 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
13774
13775         * typemanager.cs (ienumerable_type): Also look up
13776         System.Collections.IEnumerable. 
13777
13778 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
13779
13780         TODO: Test more than one conditional per method.
13781
13782         * class.cs (Indexer.Define): Report the location where the user is
13783         referencing the unsupported feature.
13784
13785         (MethodData): Overload the use of `conditionals' to
13786         minimize the creation of needless ArrayLists.   This saves roughly
13787         212kb on my machine.
13788
13789         (Method): Implement the new IIteratorContainer interface.
13790         (Method.SetYields): Implement the method by setting the ModFlags
13791         to contain METHOD_YIELDS.
13792
13793         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
13794         which just got set to null.
13795
13796         * iterators.cs: New file.
13797
13798         (Yield, YieldBreak): New statements.
13799
13800         * statement.cs (Return.Resolve): Flag an error if we are used in
13801         an iterator method.
13802
13803         * codegen.cs (InIterator): New flag set if the code is being
13804         compiled in an iterator method.
13805
13806         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
13807         internal modifier, and we just use it to avoid adding extra
13808         fields, as this is seldom used.  
13809
13810         * cs-parser.jay: Add yield_statement (yield and yield break).
13811
13812         * driver.cs: New flag -v2 to turn on version 2 features. 
13813
13814         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
13815         hashtable when v2 is enabled.
13816
13817 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
13818
13819         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
13820         there is already a namespace defined with this name.
13821
13822         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
13823         people upgraded their corlibs.
13824
13825         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
13826         always use fully qualified types, no need to use the compiler
13827         front end.
13828
13829         (TypeManager.IsNamespace): Use binarysearch.
13830
13831         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
13832         AddDelegate): I did not quite use the new IsValid API properly: I
13833         have to pass the short-name and the fullname.  I was passing only
13834         the basename instead of the fullname sometimes. 
13835
13836         (TypeContainer.DefineType): call NamespaceClash.
13837
13838         * interface.cs (Interface.DefineType): use NamespaceClash before
13839         defining the type.
13840
13841         * delegate.cs (Delegate.DefineType): use NamespaceClash before
13842         defining the type.
13843
13844         * enum.cs: (Enum.DefineType): use NamespaceClash before
13845         defining the type.
13846
13847         * typemanager.cs (: 3-line patch that gives us some tasty 11%
13848         speed increase.  First, use the negative_hits cache when we get a
13849         negative.  Second, add the type with its full original name
13850         instead of the new . and + encoded name (reflection uses + to
13851         separate type from a nested type).  Use LookupTypeReflection
13852         directly which bypasses the type->name hashtable (that we already
13853         know does not contain the type.
13854
13855         * decl.cs (DeclSpace.ResolveTypeExpr): track the
13856         location/container type. 
13857
13858         * driver.cs: When passing utf8, use directly the UTF8Encoding.
13859
13860 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
13861
13862         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
13863
13864         * delegate.cs (NewDelegate.Resolve): Test whether an instance
13865         method is being referenced in the method group from a static
13866         context, and report error 120 if so.
13867
13868         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
13869         Error118. 
13870
13871         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
13872         is created, we create the A namespace).
13873
13874         * cs-parser.jay: A namespace also introduces a DeclarationFound.
13875         Fixes #41591
13876
13877 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
13878
13879         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
13880         invocation to ModuleBuilder.GetType with the same values will
13881         return a new type instance, so we need to cache its return
13882         values. 
13883
13884         * expression.cs (Binary.ResolveOperator): Only allow the compare
13885         operators on enums if they are of the same type.
13886
13887         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
13888         types of ValueType on their own case.  Before we were giving them
13889         the same treatment as objects.
13890
13891         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
13892         fullname.  Short name is used to compare against container name.
13893         Fullname is used to check against defined namespace names.
13894
13895         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
13896         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
13897
13898         (Method.CheckBase): Call parent.
13899         (MemberBase.CheckBase): Check for protected members on sealed
13900         classes.
13901         (PropertyBase.CheckBase): Call parent.
13902         (Field.Define): Call parent.
13903
13904         * report.cs: Negative error codes are now mapped to 8000 - code,
13905         so that the display is render more nicely.
13906
13907         * typemanager.cs: Do not use try/catch, instead report a regular
13908         error. 
13909
13910         (GetPointerType, GetReferenceType): These methods provide
13911         mechanisms to obtain the T* and T& from a T.  We had the code
13912         previously scattered around the code base, and it also used
13913         TypeManager.LookupType that would go through plenty of caches.
13914         This one goes directly to the type source.
13915
13916         In some places we did the Type.GetType followed by
13917         ModuleBuilder.GetType, but not in others, so this unifies the
13918         processing as well.
13919
13920         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
13921         statements now that we have namespace information.
13922
13923         * typemanager.cs (IsNamespace): New method, returns whether the
13924         string presented is a namespace or not.
13925
13926         (ComputeNamespaces): New public entry point, computes the list of
13927         available namespaces, using the GetNamespaces API call in Mono, or
13928         the slower version in MS.NET.   
13929
13930         Now before we start the semantic analysis phase, we have a
13931         complete list of namespaces including everything that the user has
13932         provided.
13933
13934         Deleted old code to cache namespaces in .nsc files.
13935
13936 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
13937
13938         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
13939         class/struct location definition Location for the implicit
13940         constructor location.
13941
13942         (Operator.Define): Use the location of the operator for the
13943         implicit Method definition.
13944
13945         (Constructor.Emit): use the constructor location for the implicit
13946         base initializer constructor.
13947
13948         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
13949         and the Expression class now contains two new methods:
13950
13951         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
13952         isolate type lookup from the rest of the resolution process.
13953
13954         Since we use Expressions to hold type definitions due to the way
13955         we parse the input we have historically overloaded Resolve to
13956         perform the Type lookups if a special flag is passed.  Now this is
13957         eliminated and two methods take their place. 
13958
13959         The differences in the two methods between xStep and xTerminal is
13960         that xStep is involved in our current lookup system that uses
13961         SimpleNames to compose a name, while xTerminal is used just to
13962         catch the case where the simplename lookup failed.
13963
13964 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
13965
13966         * expression.cs (ResolveMemberAccess): Remove redundant code.
13967         TypeExpr expressions are always born fully resolved.
13968
13969         * interface.cs (PopulateMethod): Do not lookup the types twice.
13970         We were doing it once during SemanticAnalysis and once during
13971         PopulateMethod.
13972
13973         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
13974         in local variable type definitions, were being returned as a
13975         SimpleName (we decomposed everything into a string), that is
13976         because primary_expression was being used instead of a type in the
13977         grammar (reduce/reduce conflicts).
13978
13979         The part that was wrong is that we converted the expression into a
13980         string (an oversimplification in one hand, compounded with primary
13981         expressions doing string concatenation).
13982
13983         So things like:
13984
13985         A.B.C [] x;
13986
13987         Would return "A.B.C[]" as a SimpleName.  This stopped things like
13988         using clauses from working on this particular context.  And a type
13989         was being matched directly against "A.B.C[]".
13990
13991         We now use the correct approach, and allow for ComposedCast to be
13992         part of the unary expression.  So the "A.B.C []" become a composed
13993         cast of "A.B.C" (as a nested group of MemberAccess with a
13994         SimpleName at the end) plus the rank composition "[]". 
13995
13996         Also fixes 35567
13997
13998 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
13999
14000         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
14001         for the access level checking.
14002
14003         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
14004         `TypeContainer container', because I kept getting confused when I
14005         was debugging this code.
14006
14007         * expression.cs (Indexers): Instead of tracking getters/setters,
14008         we now track them in parallel.  We create one arraylist less, but
14009         most importantly it is possible now for the LValue code to find a
14010         matching get for a set.
14011
14012         (IndexerAccess.DoResolveLValue): Update the code.
14013         GetIndexersForType has been modified already to extract all the
14014         indexers from a type.  The code assumed it did not.
14015
14016         Also make the code set the correct return type for the indexer.
14017         This was fixed a long time ago for properties, but was missing for
14018         indexers.  It used to be void_type.
14019
14020         (Binary.Emit): Test first for doubles instead of
14021         floats, as they are more common.
14022
14023         (Binary.EmitBranchable): Use the .un version of the branch opcodes
14024         when dealing with floats and the <=, >= operators.  This fixes bug
14025         #39314 
14026
14027         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14028         to load the array value by emitting a load on the foreach variable
14029         type.  This was incorrect.  
14030
14031         We now emit the code to load an element using the the array
14032         variable type, and then we emit the conversion operator.
14033
14034         Fixed #40176
14035
14036 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
14037
14038         * attribute.cs: Avoid allocation of ArrayLists in the common case.
14039
14040 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
14041
14042         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
14043         test for protection before we test for signatures. 
14044
14045         (MethodSignature.ToString): implement.
14046
14047         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
14048         to the case where we reduced into a LongConstant.
14049
14050         * decl.cs (CheckAccessLevel): If the type is an array, we can not
14051         depend on whether the information is acurrate, because the
14052         Microsoft runtime will always claim that the array type is public,
14053         regardless of the real state.
14054
14055         If the type is a pointer, another problem happens: the type is
14056         reported as non-public in Microsoft.  
14057
14058         In both cases we have to call CheckAccessLevel recursively with
14059         the underlying type as the argument to be tested.
14060
14061 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
14062
14063         * assign.cs (Assign.Emit): If we are dealing with a compound
14064         assignment expression, we should use the code path that stores the
14065         intermediate result in a temporary value.  This fixes #40903.
14066
14067         *expression.cs (Indirection.ToString): Provide ToString method for
14068         debugging. 
14069
14070 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
14071
14072         * class.cs: Null out fields holding references to Block objects so
14073         they can be garbage collected.
14074
14075         * expression.cs (OverloadResolve): Remove unused local.
14076
14077 2003-04-07  Martin Baulig  <martin@ximian.com>
14078
14079         * codegen.cs (EmitContext.CurrentFile): New public field.
14080         (EmitContext.Mark): Use the CurrentFile to check whether the
14081         location is in the correct file.
14082         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
14083
14084 2003-04-07  Martin Baulig  <martin@ximian.com>
14085
14086         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
14087
14088         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
14089         location.  [FIXME: The location argument which gets passed to this
14090         method is sometimes wrong!]
14091
14092 2003-04-07  Nick Drochak <ndrochak@gol.com>
14093
14094         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
14095
14096 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
14097
14098         * expression.cs (Indirection.EmitAssign): We were using the
14099         temporary, but returning immediately instead of continuing the
14100         EmitAssing flow.
14101
14102 2003-04-06  Martin Baulig  <martin@ximian.com>
14103
14104         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
14105         if it's a nested child, but also deriving from the outer class.
14106         See test 190.cs.
14107
14108         * typemanager.cs (IsNestedChildOf): Make this work if it's a
14109         nested child, but also deriving from the outer class.  See
14110         test-190.cs.
14111         (FilterWithClosure): We may access private members of the outer
14112         class if we're a nested child and deriving from the outer class.
14113         (RealMemberLookup): Only set `closure_private_ok' if the
14114         `original_bf' contained BindingFlags.NonPublic.
14115
14116 2003-04-05  Martin Baulig  <martin@ximian.com>
14117
14118         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
14119         probe if its a type parameter, and if so, flag an error.
14120
14121         * decl.cs: Move here the SetParameterInfo code from class.cs.
14122         Handle IsGeneric here.
14123
14124         Handle a variety of errors in the parameter info definition.
14125
14126         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
14127         type parameters here.
14128
14129         * cs-parser.jay (class_declaration): report errors for parameters
14130         here as well.
14131
14132 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
14133
14134         * generic.cs: New file, contains support code for generics.
14135
14136         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
14137         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
14138
14139         Update parser for the above removals.
14140
14141         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
14142         now taken care of in the parser.
14143
14144 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
14145
14146         * class.cs (Event.Define): Do not allow abstract events to have
14147         initializers. 
14148
14149 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
14150
14151         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
14152         block in event declarations.
14153
14154         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
14155         value type, get its address.
14156
14157         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
14158         leaving a class on the stack instead of a boolean value (int
14159         0/1).  Change the code so we compare against null, and then the
14160         result against zero.
14161
14162         * class.cs (TypeContainer.GetClassBases): We were checking for the
14163         parent class being sealed too late.
14164
14165         * expression.cs (Binary.Emit): For <= and >= when dealing with
14166         floating point values, use cgt.un and clt.un instead of cgt and
14167         clt alone.
14168
14169 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
14170
14171         * statement.cs: Apply the same optimization as MS: skip the 
14172         GetEnumerator returning an IEnumerator, and use the one returning a 
14173         CharEnumerator instead. This allows us to avoid the try-finally block 
14174         and the boxing.
14175
14176 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
14177
14178         * cs-parser.jay: Attributes cannot be applied to
14179                          namespaces. Fixes #40473
14180
14181 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14182
14183         * class.cs:
14184         (Add*): check if the name is valid using the full name for constants,
14185         fields, properties and events.
14186
14187 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
14188
14189         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
14190         char constants to be part of the enumeration.
14191
14192         * expression.cs (Conditional.DoResolve): Add support for operator
14193         true. Implements the missing functionality from 14.12
14194
14195         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
14196         operator true/false as required by the spec.
14197
14198         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
14199         implicit conversion to boolean.
14200
14201         * statement.cs (Statement.ResolveBoolean): A boolean expression is
14202         also one where the type implements `operator true'. 
14203
14204         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
14205         get an expression that will invoke operator true based on an
14206         expression.  
14207
14208         (GetConversionOperators): Removed the hack that called op_True
14209         here.  
14210
14211         (Expression.ResolveBoolean): Move this from Statement.
14212
14213 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
14214
14215         * ecore.cs (FieldExpr): do not allow initialization of initonly
14216         fields on derived classes
14217
14218 2003-03-13  Martin Baulig  <martin@ximian.com>
14219
14220         * statement.cs (Block.Emit): Call ig.BeginScope() and
14221         ig.EndScope() when compiling with debugging info; call
14222         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
14223
14224 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
14225
14226         * expression.cs (Indexers): Do not construct immediately, allow
14227         for new members to be appended as we go.  Fixes 38143
14228
14229 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14230
14231         * expression.cs: save/restore context when resolving an unchecked
14232         expression.
14233
14234 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
14235
14236         * cfold.cs: Catch division by zero in modulus operator during
14237         constant folding.
14238
14239 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
14240
14241         * interface.cs (Interface.DefineMembers): Avoid defining members
14242         twice. 
14243
14244 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
14245
14246         * driver.cs: handle the +/- options for -noconfig
14247
14248         * statement.cs (Unckeched.Resolve): Also track the state of
14249         unchecked in the Resolve phase.
14250
14251 2003-02-27  Martin Baulig  <martin@ximian.com>
14252
14253         * ecore.cs (Expression.MemberLookup): Don't create a
14254         MethodGroupExpr for something which is not a method.  Fixes #38291.
14255
14256 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
14257
14258         * class.cs (MemberBase.CheckParameters): Also check that the type
14259         is unmanaged if it is a pointer.
14260
14261         * expression.cs (SizeOf.Resolve): Add location information.
14262
14263         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
14264         a managed type is declared.
14265
14266         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
14267         parameter modifiers as well.  Fixes bug 38606
14268
14269         * class.cs: Very sad.  Am backing out the speed up changes
14270         introduced by the ArrayList -> Array in the TypeContainer, as they
14271         were not actually that much faster, and introduced a bug (no error
14272         reports on duplicated methods).
14273
14274         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
14275         source first, this will guarantee that we have a valid expression
14276         before calling in lower levels functions that will require a
14277         resolved object.  Then use this original_source in the
14278         target.ResolveLValue instead of the original source that was
14279         passed to us.
14280
14281         Another change.  Use target.Resolve instead of LValueResolve.
14282         Although we are resolving for LValues, we will let the Assign code
14283         take care of that (it will be called again from Resolve).  This
14284         basically allows code like this:
14285
14286         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
14287         class Y { void A (X x) { x [0] += o; }
14288
14289         The problem was that the indexer was trying to resolve for
14290         set_Item (idx, object o) and never finding one.  The real set_Item
14291         was set_Item (idx, X).  By delaying the process we get the right
14292         semantics. 
14293
14294         Fixes bug 36505
14295
14296 2003-02-23  Martin Baulig  <martin@ximian.com>
14297
14298         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14299         while calling DoEmit ().
14300
14301         * codegen.cs (EmitContext.Mark): Don't mark locations in other
14302         source files; if you use the #line directive inside a method, the
14303         compiler stops emitting line numbers for the debugger until it
14304         reaches the end of the method or another #line directive which
14305         restores the original file.
14306
14307 2003-02-23  Martin Baulig  <martin@ximian.com>
14308
14309         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14310
14311 2003-02-23  Martin Baulig  <martin@ximian.com>
14312
14313         * statement.cs (Block.AddChildVariableNames): We need to call this
14314         recursively, not just for our immediate children.
14315
14316 2003-02-23  Martin Baulig  <martin@ximian.com>
14317
14318         * class.cs (Event.Define): Always make the field private, like csc does.
14319
14320         * typemanager.cs (TypeManager.RealMemberLookup): Make events
14321         actually work, fixes bug #37521.
14322
14323 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
14324
14325         * delegate.cs: When creating the various temporary "Parameters"
14326         classes, make sure that we call the ComputeAndDefineParameterTypes
14327         on those new parameters (just like we do with the formal ones), to
14328         allow them to be resolved in the context of the DeclSpace.
14329
14330         This fixes the bug that Dick observed in Bugzilla #38530.
14331
14332 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
14333
14334         * expression.cs (ResolveMemberAccess): When resolving a constant,
14335         do not attempt to pull a constant if the value was not able to
14336         generate a valid constant.
14337
14338         * const.cs (LookupConstantValue): Do not report more errors than required.
14339
14340 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14341
14342         * expression.cs: fixes bug #38328.
14343
14344 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14345
14346         * class.cs: Changed all the various members that can be part of a
14347         class from being an ArrayList to be an Array of the right type.
14348         During the DefineType type_list, interface_list, delegate_list and
14349         enum_list are turned into types, interfaces, delegates and enums
14350         arrays.  
14351
14352         And during the member population, indexer_list, event_list,
14353         constant_list, field_list, instance_constructor_list, method_list,
14354         operator_list and property_list are turned into their real arrays.
14355
14356         Although we could probably perform this operation earlier, for
14357         good error reporting we need to keep the lists and remove the
14358         lists for longer than required.
14359
14360         This optimization was triggered by Paolo profiling the compiler
14361         speed on the output of `gen-sample-program.pl' perl script. 
14362
14363         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
14364         not crash in methods like MemberLookupFailed that use this field.  
14365
14366         This problem arises when the compiler fails to resolve a type
14367         during interface type definition for example.
14368
14369 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14370
14371         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14372         inherit from System.Object, so we have to stop at null, not only
14373         when reaching System.Object.
14374
14375 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
14376
14377         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14378         DeclaredOnly because the parent indexer might have had a different
14379         name, but did not loop until the top of the hierarchy was reached.
14380
14381         The problem this one fixes is 35492: when a class implemented an
14382         indexer from an interface, we were getting the interface method
14383         (which was abstract) and we were flagging an error (can not invoke
14384         abstract method).
14385
14386         This also keeps bug 33089 functioning, and test-148 functioning.
14387
14388         * typemanager.cs (IsSpecialMethod): The correct way of figuring
14389         out if a method is special is to see if it is declared in a
14390         property or event, or whether it is one of the predefined operator
14391         names.   This should fix correctly #36804.
14392
14393 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
14394
14395         The goal here is to remove the dependency on EmptyCast.Peel ().
14396         Killing it completely.
14397
14398         The problem is that currently in a number of places where
14399         constants are expected, we have to "probe" for an EmptyCast, and
14400         Peel, which is not the correct thing to do, as this will be
14401         repetitive and will likely lead to errors. 
14402
14403         The idea is to remove any EmptyCasts that are used in casts that
14404         can be reduced to constants, so we only have to cope with
14405         constants. 
14406
14407         This bug hunt was triggered by Bug 37363 and the desire to remove
14408         the duplicate pattern where we were "peeling" emptycasts to check
14409         whether they were constants.  Now constants will always be
14410         constants.
14411
14412         * ecore.cs: Use an enumconstant here instead of wrapping with
14413         EmptyCast.  
14414
14415         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14416         throwing me off.  By handling this we can get rid of a few hacks.
14417
14418         * statement.cs (Switch): Removed Peel() code.
14419
14420 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
14421
14422         * class.cs: Location information for error 508
14423
14424         * expression.cs (New.DoResolve): Add a guard against double
14425         resolution of an expression.  
14426
14427         The New DoResolve might be called twice when initializing field
14428         expressions (see EmitFieldInitializers, the call to
14429         GetInitializerExpression will perform a resolve on the expression,
14430         and later the assign will trigger another resolution
14431
14432         This leads to bugs (#37014)
14433
14434         * delegate.cs: The signature for EndInvoke should contain any ref
14435         or out parameters as well.  We were not doing this in the past. 
14436
14437         * class.cs (Field.Define): Do not overwrite the type definition
14438         inside the `volatile' group.  Turns out that volatile enumerations
14439         were changing the type here to perform a validity test, which
14440         broke conversions. 
14441
14442 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
14443
14444         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14445         and structs, we do not want to load the instance variable
14446
14447         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14448         enum_type has to be handled like an object reference (implicit
14449         conversions exists from this to object), but the regular IsClass
14450         and IsValueType tests will never return true for this one.
14451
14452         Also we use TypeManager.IsValueType instead of type.IsValueType,
14453         just for consistency with the rest of the code (this is only
14454         needed if we ever use the construct exposed by test-180.cs inside
14455         corlib, which we dont today).
14456
14457 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
14458
14459         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14460         just InternalCall.
14461
14462 2003-02-09  Martin Baulig  <martin@ximian.com>
14463
14464         * namespace.cs (Namespace..ctor): Added SourceFile argument.
14465         (Namespace.DefineNamespaces): New static public method; this is
14466         called when we're compiling with debugging to add all namespaces
14467         to the symbol file.
14468
14469         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14470         pass it to the Namespace's .ctor.
14471
14472         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14473         and MethodBase arguments; pass the namespace ID to the symwriter;
14474         pass the MethodBase instead of the token to the symwriter.
14475         (SymbolWriter.DefineNamespace): New method to add a namespace to
14476         the symbol file.
14477
14478 2003-02-09  Martin Baulig  <martin@ximian.com>
14479
14480         * symbolwriter.cs: New file.  This is a wrapper around
14481         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
14482         methods here in near future.
14483
14484 2003-02-09  Martin Baulig  <martin@ximian.com>
14485
14486         * codegen.cs (EmitContext.Mark): Just pass the arguments to
14487         ILGenerator.MarkSequencePoint() which are actually used by the
14488         symbol writer.
14489
14490 2003-02-09  Martin Baulig  <martin@ximian.com>
14491
14492         * location.cs (SourceFile): New public sealed class.  This
14493         contains the name and an index which is used in the location's token.
14494         (Location): Reserve an appropriate number of bits in the token for
14495         the source file instead of walking over that list, this gives us a
14496         really huge performance improvement when compiling with debugging.
14497
14498         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14499         `SourceFile' argument instead of a string.
14500         (Driver.ProcessFile): Add all the files via Location.AddFile(),
14501         but don't parse/tokenize here, we need to generate the list of all
14502         source files before we do that.
14503         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
14504         the files.
14505
14506         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14507         instead of a string.
14508
14509         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14510         of a string.
14511
14512 2003-02-09  Martin Baulig  <martin@ximian.com>
14513
14514         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14515         filename on `#line default'.
14516
14517 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14518
14519         * statement.cs: don't clear the pinned var when the fixed statement
14520         returns from the method (fixes bug#37752).
14521
14522 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14523
14524         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
14525         to IsValueType.
14526
14527 2003-02-07  Martin Baulig  <martin@ximian.com>
14528
14529         * driver.cs: Removed the `--debug-args' command line argument.
14530
14531         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14532         automatically by the AsssemblyBuilder.
14533         (CodeGen.InitializeSymbolWriter): We don't need to call any
14534         initialization function on the symbol writer anymore.  This method
14535         doesn't take any arguments.
14536
14537 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
14538
14539         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14540         from referenced assemblies as well.
14541
14542 2003-02-02  Martin Baulig  <martin@ximian.com>
14543
14544         * class.cs (MethodData.Emit): Generate debugging info for external methods.
14545
14546 2003-02-02  Martin Baulig  <martin@ximian.com>
14547
14548         * class.cs (Constructor.Emit): Open the symbol writer before
14549         emitting the constructor initializer.
14550         (ConstructorInitializer.Emit): Call ec.Mark() to allow
14551         single-stepping through constructor initializers.
14552
14553 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
14554
14555         * class.cs: Handle error 549: do not allow virtual methods in
14556         sealed classes. 
14557
14558 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14559
14560         * decl.cs: Check access levels when resolving types
14561
14562 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14563
14564         * statement.cs: Add parameters and locals set in catch blocks that might 
14565         return to set vector
14566
14567 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
14568
14569         * class.cs (Operator): Set the SpecialName flags for operators.
14570
14571         * expression.cs (Invocation.DoResolve): Only block calls to
14572         accessors and operators on SpecialName methods.
14573
14574         (Cast.TryReduce): Handle conversions from char constants.
14575
14576
14577 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14578
14579         * statement.cs: small memory and time optimization in FlowBranching.
14580
14581 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
14582
14583         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14584         problem that the last fix but in the other sid (Set).
14585
14586         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14587         access when there is no indexer in the hierarchy.
14588
14589 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14590
14591         * class.cs: Combine some if statements.
14592
14593 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14594
14595         * driver.cs: fixed bug #37187.
14596
14597 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
14598
14599         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
14600         any indexer, it's needed to build a list with all the indexers in the
14601         hierarchy (AllGetters), else we have problems. Fixes #35653.
14602
14603 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
14604
14605         * class.cs (MethodData.Define): It is wrong for an interface
14606         implementation to be static in both cases: explicit and implicit.
14607         We were only handling this in one case.
14608
14609         Improve the if situation there to not have negations.
14610
14611         * class.cs (Field.Define): Turns out that we do not need to check
14612         the unsafe bit on field definition, only on usage.  Remove the test.
14613
14614 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14615
14616         * driver.cs: use assembly.Location instead of Codebase (the latest
14617         patch made mcs fail when using MS assemblies).
14618
14619 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
14620
14621         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
14622         get the path to *corlib.dll.
14623
14624 2003-01-21  Nick Drochak <ndrochak@gol.com>
14625
14626         * cs-tokenizer.cs:
14627         * pending.cs:
14628         * typemanager.cs: Remove compiler warnings
14629
14630 2003-01-20  Duncan Mak  <duncan@ximian.com>
14631
14632         * AssemblyInfo.cs: Bump the version number to 0.19.
14633
14634 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14635
14636         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
14637
14638 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
14639
14640         * class.cs (Constructor::Emit): Emit debugging info for constructors.
14641
14642 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
14643
14644         * cs-parser.jay: Small fix: we were not comparing the constructor
14645         name correctly.   Thanks to Zoltan for the initial pointer.
14646
14647 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
14648
14649         * cs-tokenizer.cs: Set file name when specified with #line
14650
14651 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
14652
14653         * cs-parser.jay: Only perform the constructor checks here if we
14654         are named like the class;  This will help provider a better
14655         error.  The constructor path is taken when a type definition is
14656         not found, but most likely the user forgot to add the type, so
14657         report that rather than the constructor error.
14658
14659 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
14660
14661         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
14662         allocations.
14663
14664 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14665
14666         * cs-parser.jay: Add cleanup call.
14667
14668 2003-01-13  Duncan Mak  <duncan@ximian.com>
14669
14670         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
14671         consistent with other methods.
14672
14673 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14674
14675         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
14676
14677 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
14678
14679         * attribute.cs: only set GuidAttr to true when we have a
14680         GuidAttribute.
14681
14682 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14683
14684         * ecore.cs:
14685         * expression.cs:
14686         * typemanager.cs: fixes to allow mcs compile corlib with the new
14687         Type.IsSubclassOf fix.
14688
14689 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
14690
14691         * expression.cs (LocalVariableReference.DoResolve): Classify a
14692         constant as a value, not as a variable.   Also, set the type for
14693         the variable.
14694
14695         * cs-parser.jay (fixed_statement): take a type instead of a
14696         pointer_type, so we can produce a better error message later.
14697
14698         * statement.cs (Fixed.Resolve): Flag types that are not pointers
14699         as an error.  
14700
14701         (For.DoEmit): Make inifinite loops have a
14702         non-conditional branch back.
14703
14704         (Fixed.DoEmit): First populate the pinned variables, then emit the
14705         statement, then clear the variables.  Before I was emitting the
14706         code once for each fixed piece.
14707
14708
14709 2003-01-08  Martin Baulig  <martin@ximian.com>
14710
14711         * statement.cs (FlowBranching.MergeChild): A break in a
14712         SWITCH_SECTION does not leave a loop.  Fixes #36155.
14713
14714 2003-01-08  Martin Baulig  <martin@ximian.com>
14715
14716         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
14717         lives in the same number space than `param_map'.  Fixes #36154.
14718
14719 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
14720
14721         * cs-parser.jay (constructor_declaration): Set the
14722         Constructor.ModFlags before probing for it.  This makes the
14723         compiler report 514, 515 and 132 (the code was there, but got
14724         broken). 
14725
14726         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
14727         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
14728         (GotoCase.Resolve): Set `Returns' to ALWAYS.
14729
14730 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
14731
14732         * enum.cs: create the enum static fields using the enum type.
14733
14734 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
14735
14736         * class.cs: don't try to create the ParamBuilder for the return
14737         type if it's not needed (and handle it breaking for the ms runtime
14738         anyway).
14739
14740 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
14741
14742         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
14743
14744 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
14745
14746         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
14747         the command.   This showed up while compiling the JANET source
14748         code, which used \r as its only newline separator.
14749
14750 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
14751
14752         * class.cs (Method.Define): If we are an operator (because it
14753         reuses our code), then set the SpecialName and HideBySig.  #36128
14754
14755 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
14756
14757         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
14758         exception, report error 120 `object reference required'.
14759
14760         * driver.cs: Add --pause option, used during to measure the size
14761         of the process as it goes with --timestamp.
14762
14763         * expression.cs (Invocation.DoResolve): Do not allow methods with
14764         SpecialName to be invoked.
14765
14766 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
14767
14768         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
14769         number before adding it.
14770
14771 2002-12-21  Ravi Pratap  <ravi@ximian.com>
14772
14773         * ecore.cs (StandardImplicitConversion): When in an unsafe
14774         context, we allow conversion between void * to any other pointer
14775         type. This fixes bug #35973.
14776
14777 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
14778
14779         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
14780         is not thrown when extensionless outputs are used 
14781
14782 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14783
14784         * rootcontext.cs: fixed compilation of corlib.
14785
14786 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
14787
14788         * attribute.cs (Attributes.Contains): Add new method.
14789
14790         * class.cs (MethodCore.LabelParameters): if the parameter is an
14791         `out' parameter, check that no attribute `[In]' has been passed.
14792
14793         * enum.cs: Handle the `value__' name in an enumeration.
14794
14795 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
14796
14797         * decl.cs: Added special case to allow overrides on "protected
14798         internal" methods
14799
14800 2002-12-18  Ravi Pratap  <ravi@ximian.com>
14801
14802         * attribute.cs (Attributes.AddAttributeSection): Rename to this
14803         since it makes much more sense.
14804
14805         (Attributes.ctor): Don't require a Location parameter.
14806
14807         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
14808
14809         * attribute.cs (ApplyAttributes): Remove extra Location parameters
14810         since we already have that information per attribute.
14811
14812         * everywhere : make appropriate changes.
14813
14814         * class.cs (LabelParameters): Write the code which actually
14815         applies attributes to the return type. We can't do this on the MS
14816         .NET runtime so we flag a warning in the case an exception is
14817         thrown.
14818
14819 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
14820
14821         * const.cs: Handle implicit null conversions here too.
14822
14823 2002-12-17  Ravi Pratap  <ravi@ximian.com>
14824
14825         * class.cs (MethodCore.LabelParameters): Remove the extra
14826         Type [] parameter since it is completely unnecessary. Instead
14827         pass in the method's attributes so that we can extract
14828         the "return" attribute.
14829
14830 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
14831
14832         * cs-parser.jay (parse): Use Report.Error to flag errors instead
14833         of ignoring it and letting the compile continue.
14834
14835         * typemanager.cs (ChangeType): use an extra argument to return an
14836         error condition instead of throwing an exception.
14837
14838 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
14839
14840         * expression.cs (Unary.TryReduce): mimic the code for the regular
14841         code path.  Perform an implicit cast in the cases where we can
14842         implicitly convert to one of the integral types, and then reduce
14843         based on that constant.   This fixes bug #35483.
14844
14845 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14846
14847         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
14848
14849 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14850
14851         * namespace.cs: fixed bug #35489.
14852
14853 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
14854
14855         * class.cs: Remove some dead code.
14856
14857         * cs-parser.jay: Estimate the number of methods needed
14858         (RootContext.MethodCount);
14859
14860         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
14861         numbers instead of StringBuilders.
14862
14863         * support.cs (PtrHashtable): Add constructor with initial size;
14864         We can now reduce reallocations of the method table.
14865
14866 2002-12-10  Ravi Pratap  <ravi@ximian.com>
14867
14868         * attribute.cs (ApplyAttributes): Keep track of the emitted
14869         attributes on a per-target basis. This fixes bug #35413.
14870
14871 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
14872
14873         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
14874         default to the Windows 1252 encoding.
14875
14876         (UnixParseOption): Support version, thanks to Alp for the missing
14877         pointer. 
14878
14879         * AssemblyInfo.cs: Add nice assembly information.
14880
14881         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
14882         (bug 35169).
14883
14884         * cs-parser.jay: Allow a trailing comma before the close bracked
14885         in the attribute_section production.
14886
14887         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
14888         address of the instance was being taken, I will take this out,
14889         because we take the address of the object immediately here.
14890
14891 2002-12-09  Ravi Pratap  <ravi@ximian.com>
14892
14893         * typemanager.cs (AreMultipleAllowed): Take care of the most
14894         obvious case where attribute type is not in the current assembly -
14895         stupid me ;-)
14896
14897 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
14898
14899         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
14900         definitions, instead of doing that afterwards.  
14901
14902         Also we use a nice little hack, depending on the constructor, we
14903         know if we are a "composed" name or a simple name.  Hence, we
14904         avoid the IndexOf test, and we avoid 
14905
14906         * codegen.cs: Add code to assist in a bug reporter to track down
14907         the source of a compiler crash. 
14908
14909 2002-12-07  Ravi Pratap  <ravi@ximian.com>
14910
14911         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
14912         types have been emitted for a given element and flag an error
14913         if something which does not have AllowMultiple set is used more
14914         than once.
14915
14916         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
14917         attribute types and their corresponding AllowMultiple properties
14918
14919         (AreMultipleAllowed): Check the property for a given type.
14920
14921         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
14922         property in the case we have a TypeContainer.
14923
14924         (Attributes.AddAttribute): Detect duplicates and just skip on
14925         adding them. This trivial fix catches a pretty gross error in our
14926         attribute emission - global attributes were being emitted twice!
14927
14928         Bugzilla bug #33187 is now fixed.
14929
14930 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
14931
14932         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
14933         instead of pp_and).
14934
14935         * expression.cs (Binary.ResolveOperator): I can only use the
14936         Concat (string, string, string) and Concat (string, string,
14937         string, string) if the child is actually a concatenation of
14938         strings. 
14939
14940 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
14941
14942         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
14943         context where we need a 2-character lookahead.
14944
14945         * pending.cs (PendingImplementation): Rework so we can keep track
14946         of interface types all the time, and flag those which were
14947         implemented by parents as optional.
14948
14949 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
14950
14951         * expression.cs (Binary.ResolveOperator): Use
14952         String.Concat(string,string,string) or
14953         String.Concat(string,string,string,string) when possible. 
14954
14955         * typemanager: More helper methods.
14956
14957
14958 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
14959
14960         * pending.cs: remove the bogus return from GetMissingInterfaces()
14961         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
14962
14963 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14964
14965         * namespace.cs: avoid duplicated 'using xxx' being added to
14966         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
14967         when we get more than one 'using' statement for the same namespace.
14968         Report a CS0105 warning for it.
14969
14970 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
14971
14972         * cs-tokenizer.cs (consume_identifier): use read directly, instead
14973         of calling getChar/putback, uses internal knowledge of it.    
14974
14975         (xtoken): Reorder tokenizer so most common patterns are checked
14976         first.  This reduces the compilation time in another 5% (from 8.11s
14977         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
14978
14979         The parsing time is 22% of the compilation in mcs, and from that
14980         64% is spent on the tokenization process.  
14981
14982         I tried using a binary search for keywords, but this is slower
14983         than the hashtable.  Another option would be to do a couple of
14984         things:
14985
14986                 * Not use a StringBuilder, instead use an array of chars,
14987                   with a set value.  Notice that this way we could catch
14988                   the 645 error without having to do it *afterwards*.
14989
14990                 * We could write a hand-parser to avoid the hashtable
14991                   compares altogether.
14992
14993         The identifier consumption process takes 37% of the tokenization
14994         time.  Another 15% is spent on is_number.  56% of the time spent
14995         on is_number is spent on Int64.Parse:
14996
14997                 * We could probably choose based on the string length to
14998                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
14999                   computations. 
15000
15001         Another 3% is spend on wrapping `xtoken' in the `token' function.
15002
15003         Handle 0xa0 as whitespace (#34752)
15004
15005 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
15006
15007         * typemanager.cs (IsCLRType): New routine to tell whether a type
15008         is one of the builtin types.  
15009
15010         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
15011         typecode in more places instead of doing pointer comparissions.
15012         We could leverage some knowledge about the way the typecodes are
15013         laid out.
15014
15015         New code to cache namespaces in assemblies, it is currently not
15016         invoked, to be used soon.
15017
15018         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
15019
15020         * expression.cs (Binary.ResolveOperator): specially handle
15021         strings, and do not perform user-defined operator overloading for
15022         built-in types.
15023
15024 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
15025
15026         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
15027         internalcall as it is a pretty simple operation;  Avoid whenever
15028         possible to call Char.IsLetter.
15029
15030         (consume_identifier): Cut by half the number of
15031         hashtable calls by merging the is_keyword and GetKeyword behavior.
15032
15033         Do not short-circuit, because if we do, we
15034         report errors (ie, #if false && true would produce an invalid
15035         directive error);
15036
15037
15038 2002-11-24  Martin Baulig  <martin@ximian.com>
15039
15040         * expression.cs (Cast.TryReduce): If we're in checked syntax,
15041         check constant ranges and report a CS0221.  Fixes #33186.
15042
15043 2002-11-24  Martin Baulig  <martin@ximian.com>
15044
15045         * cs-parser.jay: Make this work for uninitialized variable
15046         declarations in the `for' initializer.  Fixes #32416.
15047
15048 2002-11-24  Martin Baulig  <martin@ximian.com>
15049
15050         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
15051         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
15052
15053 2002-11-24  Martin Baulig  <martin@ximian.com>
15054
15055         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
15056         argument; if true, we also check for user-defined conversions.
15057         This is only needed if both arguments are of a user-defined type.
15058         Fixes #30443, added test-175.cs.
15059         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
15060
15061         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
15062
15063 2002-11-24  Martin Baulig  <martin@ximian.com>
15064
15065         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
15066         function to get the store opcode.
15067         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
15068         only emit the Ldelema if the store opcode is Stobj.  You must run
15069         both test-34 and test-167 to test this.  Fixes #34529.
15070
15071 2002-11-23  Martin Baulig  <martin@ximian.com>
15072
15073         * ecore.cs (Expression.MemberLookup): Added additional
15074         `qualifier_type' argument which is used when we're being called
15075         from MemberAccess.DoResolve() and null if we're called from a
15076         SimpleName lookup.
15077         (Expression.MemberLookupFailed): New method to report errors; this
15078         does the CS1540 check and reports the correct error message.
15079
15080         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
15081         argument for the CS1540 check and redone the way how we're dealing
15082         with private members.  See the comment in the source code for details.
15083         (FilterWithClosure): Reverted this back to revision 1.197; renamed
15084         `closure_start_type' to `closure_qualifier_type' and check whether
15085         it's not null.  It was not this filter being broken, it was just
15086         being called with the wrong arguments.
15087
15088         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
15089         and pass it the correct `qualifier_type'; this also does the error
15090         handling for us.
15091
15092 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
15093
15094         * expression.cs (Invocation.EmitParams): If the we are dealing
15095         with a non-built-in value type, load its address as well.
15096
15097         (ArrayCreation): Use a a pretty constant instead
15098         of the hardcoded value 2.   Use 6 instead of 2 for the number of
15099         static initializers.  
15100
15101         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
15102         because they are not really value types, just glorified integers. 
15103
15104         * driver.cs: Do not append .exe, the CSC compiler does not do it.
15105
15106         * ecore.cs: Remove redundant code for enumerations, make them use
15107         the same code path as everything else, fixes the casting issue
15108         with enumerations in Windows.Forms.
15109
15110         * attribute.cs: Do only cast to string if it is a string, the
15111         validation happens later.
15112
15113         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
15114         people upgrade their corlibs.
15115
15116         * ecore.cs: Oops, enumerations were not following the entire code path
15117
15118 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
15119
15120         * typemanager.cs (FilterWithClosure): Commented out the test for
15121         1540 in typemanager.cs, as it has problems when accessing
15122         protected methods from a parent class (see test-174.cs). 
15123
15124         * attribute.cs (Attribute.ValidateGuid): new method.
15125         (Attribute.Resolve): Use above.
15126
15127 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
15128
15129         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
15130
15131         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
15132         handling for enumerations, as we only needed the TypeContainer
15133         functionality to begin with (this is required for the fix below to
15134         work for enums that reference constants in a container class for
15135         example). 
15136
15137         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
15138
15139         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
15140         a valid TypeBuilder to perform lookups on.o
15141
15142         * class.cs (InheritableMemberSignatureCompare): Use true in the
15143         call to GetGetMethod and GetSetMethod, because we are comparing
15144         the signature, and we need to get the methods *even* if they are
15145         private. 
15146
15147         (PropertyBase.CheckBase): ditto.
15148
15149         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
15150         GotoCase.Resolve): Use Peel on EmpytCasts.
15151
15152         * ecore.cs (EmptyCast): drop child, add Peel method.
15153
15154 2002-11-17  Martin Baulig  <martin@ximian.com>
15155
15156         * ecore.cs (EmptyCast.Child): New public property.
15157
15158         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
15159         label resolved to an EmptyCast.  Fixes #34162.
15160         (GotoCase.Resolve): Likewise.
15161         (Block.EmitMeta): Likewise.
15162
15163 2002-11-17  Martin Baulig  <martin@ximian.com>
15164
15165         * expression.cs (Invocation.BetterConversion): Prefer int over
15166         uint; short over ushort; long over ulong for integer literals.
15167         Use ImplicitConversionExists instead of StandardConversionExists
15168         since we also need to check for user-defined implicit conversions.
15169         Fixes #34165.  Added test-173.cs.
15170
15171 2002-11-16  Martin Baulig  <martin@ximian.com>
15172
15173         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
15174         with the `true' and `false' literals.  Fixes #33151.
15175
15176 2002-11-16  Martin Baulig  <martin@ximian.com>
15177
15178         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
15179         October 22nd; don't do the cs1540 check for static members.
15180
15181         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
15182         now using our own filter here and doing the cs1540 check again.
15183
15184 2002-11-16  Martin Baulig  <martin@ximian.com>
15185
15186         * support.cs (InternalParameters): Don't crash if we don't have
15187         any fixed parameters.  Fixes #33532.
15188
15189 2002-11-16  Martin Baulig  <martin@ximian.com>
15190
15191         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
15192         when looking up static methods to make this work on Windows.
15193         Fixes #33773.
15194
15195 2002-11-16  Martin Baulig  <martin@ximian.com>
15196
15197         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
15198         a setter rather than using PropertyInfo.CanWrite.
15199
15200 2002-11-15  Nick Drochak  <ndrochak@gol.com>
15201
15202         * class.cs: Allow acces to block member by subclasses. Fixes build
15203         breaker.
15204
15205 2002-11-14  Martin Baulig  <martin@ximian.com>
15206
15207         * class.cs (Constructor.Emit): Added the extern/block check.
15208         Fixes bug #33678.
15209
15210 2002-11-14  Martin Baulig  <martin@ximian.com>
15211
15212         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
15213         iteration while looking for indexers, this is needed because the
15214         indexer may have a different name in our base classes.  Fixed the
15215         error reporting (no indexers at all, not get accessor, no
15216         overloaded match).  Fixes bug #33089.
15217         (IndexerAccess.DoResolveLValue): Likewise.
15218
15219 2002-11-14  Martin Baulig  <martin@ximian.com>
15220
15221         * class.cs (PropertyBase.CheckBase): Make this work for multiple
15222         indexers.  Fixes the first part of bug #33089.
15223         (MethodSignature.InheritableMemberSignatureCompare): Added support
15224         for properties.
15225
15226 2002-11-13  Ravi Pratap  <ravi@ximian.com>
15227
15228         * attribute.cs (Attribute.Resolve): Catch the
15229         NullReferenceException and report it since it isn't supposed to
15230         happen. 
15231
15232 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
15233
15234         * expression.cs (Binary.EmitBranchable): Also handle the cases for
15235         LogicalOr and LogicalAnd that can benefit from recursively
15236         handling EmitBranchable.  The code now should be nice for Paolo.
15237
15238 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
15239
15240         * typemanager.cs (LookupType): Added a negative-hit hashtable for
15241         the Type lookups, as we perform quite a number of lookups on
15242         non-Types.  This can be removed once we can deterministically tell
15243         whether we have a type or a namespace in advance.
15244
15245         But this might require special hacks from our corlib.
15246
15247         * TODO: updated.
15248
15249         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
15250         and double which avoids a conversion from an integer to a double.
15251
15252         * expression.cs: tiny optimization, avoid calling IsConstant,
15253         because it effectively performs the lookup twice.
15254
15255 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
15256
15257         But a bogus return here to keep the semantics of the old code
15258         until the Mono runtime is fixed.
15259
15260         * pending.cs (GetMissingInterfaces): New method used to remove all
15261         the interfaces that are already implemented by our parent
15262         classes from the list of pending methods. 
15263
15264         * interface.cs: Add checks for calls after ResolveTypeExpr.
15265
15266 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
15267
15268         * class.cs (Class.Emit): Report warning 67: event not used if the
15269         warning level is beyond 3.
15270
15271         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
15272         being a NullLiteral.
15273
15274         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
15275         specifiers. 
15276
15277         * class.cs (TypeContainer.GetClassBases): Cover a missing code
15278         path that might fail if a type can not be resolved.
15279
15280         * expression.cs (Binary.Emit): Emit unsigned versions of the
15281         operators. 
15282
15283         * driver.cs: use error 5.
15284
15285 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
15286
15287         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
15288
15289 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
15290
15291         * cs-parser.jay (switch_section): A beautiful patch from Martin
15292         Baulig that fixed 33094.
15293
15294 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
15295
15296         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15297         Check whether the base is abstract and report an error if so.
15298
15299         * expression.cs (IndexerAccess.DoResolveLValue,
15300         IndexerAccess.DoResolve): ditto. 
15301
15302         (Invocation.DoResolve): ditto.
15303
15304         (Invocation.FullMethodDesc): Improve the report string.
15305
15306         * statement.cs (Block): Eliminate IsVariableDefined as it is
15307         basically just a wrapper for GetVariableInfo.
15308
15309         * ecore.cs (SimpleName): Use new 
15310
15311         * support.cs (ReflectionParamter.ParameterType): We unwrap the
15312         type, as we return the actual parameter ref/unref state on a
15313         different call.
15314
15315 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
15316
15317         * support.cs: Return proper flags REF/OUT fixing the previous
15318         commit.  
15319
15320         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
15321         not used to mean `ref' but `ref or out' in ParameterReference
15322
15323         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15324         full type signature instead of calling TypeManger.CSharpName
15325         ourselves. 
15326
15327         * support.cs (InternalParameters.ParameterDesc): Do not compare
15328         directly to the modflags, because REF/OUT will actually be bitsets
15329         if set. 
15330
15331         * delegate.cs (VerifyMethod): Check also the modifiers.
15332
15333         * cs-tokenizer.cs: Fix bug where floating point values with an
15334         exponent where a sign was missing was ignored.
15335
15336         * driver.cs: Allow multiple assemblies to be specified in a single
15337         /r: argument
15338
15339 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
15340
15341         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
15342         because identifiers after a parenthesis would end up in this kind
15343         of production, and we needed to desamiguate it for having casts
15344         like:
15345
15346                 (UserDefinedType *) xxx
15347
15348 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
15349
15350         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
15351         we should set on the Bindingflags.NonPublic, but not turn on
15352         private_ok.  private_ok controls whether a Private member is
15353         returned (this is chekced on the filter routine), while the
15354         BindingFlags.NonPublic just controls whether private/protected
15355         will be allowed.   This fixes the problem part of the problem of
15356         private properties being allowed to be used in derived classes.
15357
15358         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
15359         so we can call the children DoResolveLValue method (this will
15360         properly signal errors on lvalue assignments to base properties)
15361
15362         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
15363         getter are null, and we have a property info, we know that this
15364         happened because the lookup failed, so we report an error 122 for
15365         protection level violation.
15366
15367         We also silently return if setter and getter are null in the
15368         resolve functions, this condition only happens if we have flagged
15369         the error before.  This is the other half of the problem. 
15370
15371         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15372         not have accessibility information, that is why we were returning
15373         true in the filter function in typemanager.cs.
15374
15375         To properly report 122 (property is inaccessible because of its
15376         protection level) correctly, we report this error in ResolveAccess
15377         by failing if both the setter and the getter are lacking (ie, the
15378         lookup failed). 
15379
15380         DoResolve and DoLResolve have been modified to check for both
15381         setter/getter being null and returning silently, the reason being
15382         that I did not want to put the knowledge about this error in upper
15383         layers, like:
15384
15385         int old = Report.Errors;
15386         x = new PropertyExpr (...);
15387         if (old != Report.Errors)
15388                 return null;
15389         else
15390                 return x;
15391
15392         So the property expr is returned, but it is invalid, so the error
15393         will be flagged during the resolve process. 
15394
15395         * class.cs: Remove InheritablePropertySignatureCompare from the
15396         class, as we no longer depend on the property signature to compute
15397         whether it is possible to implement a method or not.
15398
15399         The reason is that calling PropertyInfo.GetGetMethod will return
15400         null (in .NET, in Mono it works, and we should change this), in
15401         cases where the Get Method does not exist in that particular
15402         class.
15403
15404         So this code:
15405
15406         class X { public virtual int A { get { return 1; } } }
15407         class Y : X { }
15408         class Z : Y { public override int A { get { return 2; } } }
15409
15410         Would fail in Z because the parent (Y) would not have the property
15411         defined.  So we avoid this completely now (because the alternative
15412         fix was ugly and slow), and we now depend exclusively on the
15413         method names.
15414
15415         (PropertyBase.CheckBase): Use a method-base mechanism to find our
15416         reference method, instead of using the property.
15417
15418         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15419         routines are gone now.
15420
15421         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15422         names, they were incorrectly named.
15423
15424         * cs-tokenizer.cs: Return are more gentle token on failure. 
15425
15426         * pending.cs (PendingImplementation.InterfaceMethod): This routine
15427         had an out-of-sync index variable, which caused it to remove from
15428         the list of pending methods the wrong method sometimes.
15429
15430 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
15431
15432         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15433         CanWrite, because those refer to this particular instance of the
15434         property, and do not take into account the fact that we can
15435         override single members of a property.
15436
15437         Constructor requires an EmitContext.  The resolution process does
15438         not happen here, but we need to compute the accessors before,
15439         because the resolution does not always happen for properties.
15440
15441         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15442         subclass, before we did not update this flag, but we did update
15443         bindingflags. 
15444
15445         (GetAccessors): Drop this routine, as it did not work in the
15446         presence of partially overwritten set/get methods. 
15447
15448         Notice that this broke the cs1540 detection, but that will require
15449         more thinking. 
15450
15451 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15452
15453         * class.cs:
15454         * codegen.cs:
15455         * driver.cs: issue a warning instead of an error if we don't support
15456         debugging for the platform. Also ignore a couple of errors that may
15457         arise when trying to write the symbols. Undo my previous patch.
15458
15459 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15460
15461         * driver.cs: ignore /debug switch except for Unix platforms.
15462
15463 2002-10-23  Nick Drochak  <ndrochak@gol.com>
15464
15465         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15466
15467 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
15468
15469         * driver.cs: Do not make mcs-debug conditional, so we do not break
15470         builds that use it.
15471
15472         * statement.cs (UsageVector.MergeChildren): I would like Martin to
15473         review this patch.  But basically after all the children variables
15474         have been merged, the value of "Breaks" was not being set to
15475         new_breaks for Switch blocks.  I think that it should be set after
15476         it has executed.  Currently I set this to the value of new_breaks,
15477         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15478         conservative, but I do not understand this code very well.
15479
15480         I did not break anything in the build, so that is good ;-)
15481
15482         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15483
15484 2002-10-20  Mark Crichton  <crichton@gimp.org>
15485
15486         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
15487
15488 2002-10-20  Nick Drochak  <ndrochak@gol.com>
15489
15490         * cfold.cs: Fixed compile blocker.
15491
15492 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
15493
15494         * driver.cs: I was chekcing the key, not the file.
15495
15496 2002-10-19  Ravi Pratap  <ravi@ximian.com>
15497
15498         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15499         message that we were generating - we just need to silently return
15500         a null.
15501
15502 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
15503
15504         * class.cs (Event.Define): Change my previous commit, as this
15505         breaks the debugger.  This is a temporary hack, as it seems like
15506         the compiler is generating events incorrectly to begin with.
15507
15508         * expression.cs (Binary.ResolveOperator): Added support for 
15509         "U operator - (E x, E y)"
15510
15511         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15512         y)".
15513
15514         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15515         init-only variables, but this path did not take into account that
15516         there might be also instance readonly variables.  Correct this
15517         problem. 
15518
15519         This fixes bug 32253
15520
15521         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15522         delegates as well.
15523
15524         * driver.cs: Change the extension for modules to `netmodule'
15525
15526         * cs-parser.jay: Improved slightly the location tracking for
15527         the debugger symbols.
15528
15529         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15530         modifiers that were specified instead of the hardcoded value
15531         (FamAndAssem).  This was basically ignoring the static modifier,
15532         and others.  Fixes 32429.
15533
15534         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15535         fixed a bug in the process (32476)
15536
15537         * expression.cs (ArrayAccess.EmitAssign): Patch from
15538         hwang_rob@yahoo.ca that fixes bug 31834.3
15539
15540 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
15541
15542         * driver.cs: Make the module extension .netmodule.
15543
15544 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
15545
15546         * driver.cs: Report an error if the resource file is not found
15547         instead of crashing.
15548
15549         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15550         false, like Emit does.
15551
15552 2002-10-16  Nick Drochak  <ndrochak@gol.com>
15553
15554         * typemanager.cs: Remove unused private member.  Also reported mcs
15555         bug to report this as a warning like csc.
15556
15557 2002-10-15  Martin Baulig  <martin@gnome.org>
15558
15559         * statement.cs (Statement.Emit): Made this a virtual method; emits
15560         the line number info and calls DoEmit().
15561         (Statement.DoEmit): New protected abstract method, formerly knows
15562         as Statement.Emit().
15563
15564         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15565
15566 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
15567
15568         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15569         have fixed a remaining problem: not every AddXXXX was adding a
15570         fully qualified name.  
15571
15572         Now everyone registers a fully qualified name in the DeclSpace as
15573         being defined instead of the partial name.  
15574
15575         Downsides: we are slower than we need to be due to the excess
15576         copies and the names being registered this way.  
15577
15578         The reason for this is that we currently depend (on the corlib
15579         bootstrap for instance) that types are fully qualified, because
15580         we dump all the types in the namespace, and we should really have
15581         types inserted into the proper namespace, so we can only store the
15582         basenames in the defined_names array.
15583
15584 2002-10-10  Martin Baulig  <martin@gnome.org>
15585
15586         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15587         from bug #31834, see the bug report for a testcase which is
15588         miscompiled.
15589
15590 2002-10-10  Martin Baulig  <martin@gnome.org>
15591
15592         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
15593         flow analysis code for this.
15594
15595         * statement.cs (Do, While, For): Tell the flow analysis code about
15596         infinite loops.
15597         (FlowBranching.UsageVector): Added support for infinite loops.
15598         (Block.Resolve): Moved the dead code elimination here and use flow
15599         analysis to do it.
15600
15601 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
15602
15603         * class.cs (Field.Define): Catch cycles on struct type
15604         definitions. 
15605
15606         * typemanager.cs (IsUnmanagedtype): Do not recursively check
15607         fields if the fields are static.  We only need to check instance
15608         fields. 
15609
15610         * expression.cs (As.DoResolve): Test for reference type.
15611
15612         * statement.cs (Using.ResolveExpression): Use
15613         ConvertImplicitRequired, not ConvertImplicit which reports an
15614         error on failture
15615         (Using.ResolveLocalVariableDecls): ditto.
15616
15617         * expression.cs (Binary.ResolveOperator): Report errors in a few
15618         places where we had to.
15619
15620         * typemanager.cs (IsUnmanagedtype): Finish implementation.
15621
15622 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
15623
15624         * expression.cs: Use StoreFromPtr instead of extracting the type
15625         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
15626
15627         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
15628         an enumeration value to a System.Enum, but System.Enum is not a
15629         value type, but an class type, so we need to box.
15630
15631         (Expression.ConvertExplicit): One codepath could return
15632         errors but not flag them.  Fix this.  Fixes #31853
15633
15634         * parameter.cs (Resolve): Do not allow void as a parameter type.
15635
15636 2002-10-06  Martin Baulig  <martin@gnome.org>
15637
15638         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
15639         if it's a class type and not a struct.  Fixes #31815.
15640
15641 2002-10-06  Martin Baulig  <martin@gnome.org>
15642
15643         * statement.cs: Reworked the flow analysis code a bit to make it
15644         usable for dead code elimination.
15645
15646 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15647
15648         * cs-parser.jay: allow empty source files. Fixes bug #31781.
15649
15650 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15651
15652         * expression.cs (ComposedCast.DoResolveType): A quick workaround
15653         to fix the test 165, will investigate deeper.
15654
15655 2002-10-04  Martin Baulig  <martin@gnome.org>
15656
15657         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
15658         finally blocks actually work.
15659         (Try.Resolve): We don't need to create a sibling for `finally' if
15660         there is no finally block.
15661
15662 2002-10-04  Martin Baulig  <martin@gnome.org>
15663
15664         * class.cs (Constructor.Define): The default accessibility for a
15665         non-default constructor is private, not public.
15666
15667 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15668
15669         * class.cs (Constructor): Make AllowedModifiers public, add
15670         EXTERN.
15671
15672         * cs-parser.jay: Perform the modifiers test here, as the
15673         constructor for the Constructor class usually receives a zero
15674         because of the way we create it (first we create, later we
15675         customize, and we were never checking the modifiers).
15676
15677         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
15678         is a version of LookupTypeReflection that includes the type-name
15679         cache.  This can be used as a fast path for functions that know
15680         the fully qualified name and are only calling into *.GetType() to
15681         obtain a composed type.
15682
15683         This is also used by TypeManager.LookupType during its type
15684         composition.
15685
15686         (LookupType): We now also track the real type name, as sometimes
15687         we can get a quey for the real type name from things like
15688         ComposedCast.  This fixes bug 31422.
15689
15690         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
15691         complete type fullname, it does not have to go through the type
15692         resolution system to obtain the composed version of the type (for
15693         obtaining arrays or pointers).
15694
15695         (Conditional.Emit): Use the EmitBoolExpression to
15696         generate nicer code, as requested by Paolo.
15697
15698         (ArrayCreation.CheckIndices): Use the patch from
15699         hwang_rob@yahoo.ca to validate the array initializers. 
15700
15701 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
15702
15703         * class.cs (ConstructorInitializer.Emit): simplify code by using
15704         Invocation.EmitCall, and at the same time, fix the bugs in calling
15705         parent constructors that took variable arguments. 
15706
15707         * ecore.cs (Expression.ConvertNumericExplicit,
15708         Expression.ImplicitNumericConversion): Remove the code that
15709         manually wrapped decimal (InternalTypeConstructor call is now gone
15710         as well).
15711
15712         * expression.cs (Cast.TryReduce): Also handle decimal types when
15713         trying to perform a constant fold on the type.
15714
15715         * typemanager.cs (IsUnmanagedtype): Partially implemented.
15716
15717         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
15718         that only turned off an error report, and did nothing else. 
15719
15720 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
15721
15722         * driver.cs: Handle and ignore /fullpaths
15723
15724 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
15725
15726         * expression.cs (Binary.ResolveOperator): Catch the case where
15727         DoNumericPromotions returns true, 
15728
15729         (Binary.DoNumericPromotions): Simplify the code, and the tests.
15730
15731 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
15732
15733         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
15734         report error 70.
15735
15736 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
15737
15738         * ecore.cs (ConvertNumericExplicit): It is not enough that the
15739         conversion exists, but it is also required that the conversion be
15740         performed.  This manifested in "(Type64Enum) 2".  
15741
15742         * class.cs (TypeManager.AddMethod): The fix is not to change
15743         AddEnum, because that one was using a fully qualified name (every
15744         DeclSpace derivative does), but to change the AddMethod routine
15745         that was using an un-namespaced name.  This now correctly reports
15746         the duplicated name.
15747
15748         Revert patch until I can properly fix it.  The issue
15749         is that we have a shared Type space across all namespaces
15750         currently, which is wrong.
15751
15752         Options include making the Namespace a DeclSpace, and merge
15753         current_namespace/current_container in the parser.
15754
15755 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
15756
15757         * cs-parser.jay: Improve error reporting when we get a different
15758         kind of expression in local_variable_type and
15759         local_variable_pointer_type. 
15760
15761         Propagate this to avoid missleading errors being reported.
15762
15763         * ecore.cs (ImplicitReferenceConversion): treat
15764         TypeManager.value_type as a target just like object_type.   As
15765         code like this:
15766
15767         ValueType v = 1;
15768
15769         Is valid, and needs to result in the int 1 being boxed before it
15770         is assigned to the value type v.
15771
15772         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
15773         to validate the enumeration name.
15774
15775         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
15776         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
15777         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
15778
15779         * ecore.cs (TryImplicitIntConversion): When doing an
15780         implicit-enumeration-conversion, check if the type is 64-bits and
15781         perform a conversion before passing to EnumConstant.
15782
15783 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
15784
15785         * decl.cs (Error_AmbiguousTypeReference); New routine used to
15786         report ambiguous type references.  Unlike the MS version, we
15787         report what the ambiguity is.   Innovation at work ;-)
15788
15789         (DeclSpace.FindType): Require a location argument to
15790         display when we display an ambiguous error.
15791
15792         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
15793
15794         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
15795
15796         * expression.cs (EmitDynamicInitializers): Apply patch from
15797         hwang_rob@yahoo.ca that fixes the order in which we emit our
15798         initializers. 
15799
15800 2002-09-21  Martin Baulig  <martin@gnome.org>
15801
15802         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
15803         delegate takes no arguments.
15804
15805 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
15806
15807         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
15808         from integers.
15809
15810         * expression.cs: Extract the underlying type.
15811
15812         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
15813
15814         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
15815
15816 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
15817
15818         * class.cs (TypeContainer.DefineType): We can not use the nice
15819         PackingSize with the size set to 1 DefineType method, because it
15820         will not allow us to define the interfaces that the struct
15821         implements.
15822
15823         This completes the fixing of bug 27287
15824
15825         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
15826         means also structs.  This fixes part of the problem. 
15827         (Expresion.ImplicitReferenceConversionExists): ditto.
15828
15829         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
15830         error if there were no errors reported during the type lookup
15831         process, to avoid duplicates or redundant errors.  Without this
15832         you would get an ambiguous errors plus a type not found.  We have
15833         beaten the user enough with the first error.  
15834
15835         (DeclSparce.FindType): Emit a warning if we have an ambiguous
15836         reference. 
15837
15838         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
15839         during the resolution process, stop the lookup, this avoids
15840         repeated error reports (same error twice).
15841
15842         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
15843
15844         * typemanager.cs (LookupType): Redo the type lookup code to match
15845         the needs of System.Reflection.  
15846
15847         The issue is that System.Reflection requires references to nested
15848         types to begin with a "+" sign instead of a dot.  So toplevel
15849         types look like: "NameSpace.TopLevelClass", and nested ones look
15850         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
15851         levels. 
15852
15853 2002-09-19  Martin Baulig  <martin@gnome.org>
15854
15855         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
15856         says that a method always returns or always throws an exception,
15857         don't report the CS0161.
15858
15859         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
15860         set `Returns = new_returns'.
15861
15862 2002-09-19  Martin Baulig  <martin@gnome.org>
15863
15864         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
15865         to an enum constant, check for a CS0176.
15866
15867 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
15868
15869         * class.cs (TypeContainer.CheckPairedOperators): Now we check
15870         for operators that must be in pairs and report errors.
15871
15872         * ecore.cs (SimpleName.DoResolveType): During the initial type
15873         resolution process, when we define types recursively, we must
15874         check first for types in our current scope before we perform
15875         lookups in the enclosing scopes.
15876
15877         * expression.cs (MakeByteBlob): Handle Decimal blobs.
15878
15879         (Invocation.VerifyArgumentsCompat): Call
15880         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
15881         I thought we were supposed to always call this, but there are a
15882         few places in the code where we dont do it.
15883
15884 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
15885
15886         * driver.cs: Add support in -linkres and -resource to specify the
15887         name of the identifier.
15888
15889 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
15890
15891         * ecore.cs (StandardConversionExists): Sync with the conversion
15892         code: allow anything-* to void* conversions.
15893
15894         (FindMostSpecificSource): Use an Expression argument
15895         instead of a Type, because we might be handed over a Literal which
15896         gets a few more implicit conversions that plain types do not.  So
15897         this information was being lost.
15898
15899         Also, we drop the temporary type-holder expression when not
15900         required.
15901
15902 2002-09-17  Martin Baulig  <martin@gnome.org>
15903
15904         * class.cs (PropertyBase.CheckBase): Don't check the base class if
15905         this is an explicit interface implementation.
15906
15907 2002-09-17  Martin Baulig  <martin@gnome.org>
15908
15909         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
15910         different `IndexerName' attributes.
15911
15912         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
15913         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
15914         virtual CommonResolve().
15915
15916 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
15917
15918         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
15919         and convert that to the UnderlyingType.
15920
15921         * statement.cs (Foreach.Resolve): Indexers are just like variables
15922         or PropertyAccesses.
15923
15924         * cs-tokenizer.cs (consume_string): Track line numbers and columns
15925         inside quoted strings, we were not doing this before.
15926
15927 2002-09-16  Martin Baulig  <martin@gnome.org>
15928
15929         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
15930         resolve it.  This is needed for the definite assignment check of the
15931         instance expression, fixes bug #29846.
15932         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
15933
15934 2002-09-16  Nick Drochak  <ndrochak@gol.com>
15935
15936         * parameter.cs: Fix compile error.  Cannot reference static member
15937         from an instance object.  Is this an mcs bug?
15938
15939 2002-09-14  Martin Baulig  <martin@gnome.org>
15940
15941         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
15942         multiple times.  Fixes bug #30295, added test-166.cs.
15943
15944 2002-09-14  Martin Baulig  <martin@gnome.org>
15945
15946         * statement.cs (Block.Emit): Don't emit unreachable code.
15947         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
15948         `break' statements.
15949         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
15950
15951 2002-09-14  Martin Baulig  <martin@gnome.org>
15952
15953         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
15954         is set.
15955
15956 2002-09-14  Martin Baulig  <martin@gnome.org>
15957
15958         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
15959         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
15960         be false on the ms runtime.
15961
15962 2002-09-13  Martin Baulig  <martin@gnome.org>
15963
15964         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
15965         the CS0038 error message.
15966
15967 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
15968
15969         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
15970         constant inside, return it.
15971
15972 2002-09-12  Martin Baulig  <martin@gnome.org>
15973
15974         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
15975         implicit conversion can be done between enum types.
15976
15977         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
15978         check whether an implicit conversion to the current enum's UnderlyingType
15979         exists and report an error if not.
15980
15981         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
15982         without debugging support.
15983
15984         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
15985         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
15986
15987 2002-09-12  Martin Baulig  <martin@gnome.org>
15988
15989         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
15990
15991         * ecore.cs (IMemberExpr.DeclaringType): New property.
15992         (SimpleName.SimpleNameResolve): Check whether we're accessing a
15993         nonstatic member of an outer type (CS0038).
15994
15995 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
15996
15997         * driver.cs: Activate the using-error detector at warning level
15998         4 (at least for MS-compatible APIs).
15999
16000         * namespace.cs (VerifyUsing): Small buglett fix.
16001
16002         * pending.cs (PendingImplementation): pass the container pointer. 
16003
16004         * interface.cs (GetMethods): Allow for recursive definition.  Long
16005         term, I would like to move every type to support recursive
16006         definitions, not the current ordering mechanism that we have right
16007         now.
16008
16009         The situation is this: Attributes are handled before interfaces,
16010         so we can apply attributes to interfaces.  But some attributes
16011         implement interfaces, we will now handle the simple cases
16012         (recursive definitions will just get an error).  
16013
16014         * parameter.cs: Only invalidate types at the end if we fail to
16015         lookup all types.  
16016
16017 2002-09-09  Martin Baulig  <martin@gnome.org>
16018
16019         * ecore.cs (PropertyExpr.Emit): Also check for
16020         TypeManager.system_int_array_get_length so this'll also work when
16021         compiling corlib.  Fixes #30003.
16022
16023 2002-09-09  Martin Baulig  <martin@gnome.org>
16024
16025         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
16026         and throw an exception if we can't get the type's size.  Fixed #30040,
16027         added test-165.cs.
16028
16029 2002-09-09  Martin Baulig  <martin@gnome.org>
16030
16031         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
16032
16033         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
16034         context.  Fixes bug #30027.
16035
16036         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
16037         virtual functions.  Fixes bug #30043, added test-164.cs.
16038
16039 2002-09-08  Ravi Pratap  <ravi@ximian.com>
16040
16041         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
16042
16043 2002-09-08  Nick Drochak  <ndrochak@gol.com>
16044
16045         * driver.cs: Use an object to get the windows codepage since it's not a
16046         static property.
16047
16048 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
16049
16050         * statement.cs (For.Emit): for infinite loops (test == null)
16051         return whether there is a break inside, not always "true".
16052
16053         * namespace.cs (UsingEntry): New struct to hold the name of the
16054         using definition, the location where it is defined, and whether it
16055         has been used in a successful type lookup.
16056
16057         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
16058         strings.
16059
16060         * decl.cs: ditto.
16061
16062 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16063
16064         * attribute.cs : Fix incorrect code which relied on catching
16065         a NullReferenceException to detect a null being passed in
16066         where an object was expected.
16067
16068 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
16069
16070         * statement.cs (Try): flag the catch variable as assigned
16071
16072         * expression.cs (Cast): Simplified by using ResolveType instead of
16073         manually resolving.
16074
16075         * statement.cs (Catch): Fix bug by using ResolveType.
16076
16077 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16078
16079         * expression.cs (BetterConversion): Special case for when we have
16080         a NullLiteral as the argument and we have to choose between string
16081         and object types - we choose string the way csc does.
16082
16083         * attribute.cs (Attribute.Resolve): Catch the
16084         NullReferenceException and report error #182 since the Mono
16085         runtime no more has the bug and having this exception raised means
16086         we tried to select a constructor which takes an object and is
16087         passed a null.
16088
16089 2002-09-05  Ravi Pratap  <ravi@ximian.com>
16090
16091         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
16092         message (1502, 1503) when we can't locate a method after overload
16093         resolution. This is much more informative and closes the bug
16094         Miguel reported.
16095
16096         * interface.cs (PopulateMethod): Return if there are no argument
16097         types. Fixes a NullReferenceException bug.
16098
16099         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
16100         expressions too. Previously we were checking only in one place for
16101         positional arguments leaving out named arguments.
16102
16103         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
16104         type to the enum type is not allowed. Remove code corresponding to
16105         that.
16106
16107         (ConvertNumericExplicit): Allow explicit conversions from
16108         the underlying type to enum type. This precisely follows the spec
16109         and closes a bug filed by Gonzalo.
16110
16111 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16112
16113         * compiler.csproj:
16114         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
16115
16116 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
16117
16118         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
16119         it was important that we stored the right value after the
16120         reduction in `converted'.
16121
16122 2002-09-04  Martin Baulig  <martin@gnome.org>
16123
16124         * location.cs (Location.SymbolDocument): Use full pathnames for the
16125         source files.
16126
16127 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
16128
16129         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
16130         of the expression resolve mechanism, because that will catch the
16131         SimpleName error failures.
16132
16133         (Conditional): If we can not resolve the
16134         expression, return, do not crash.
16135
16136 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16137
16138         * cs-tokenizer.cs:
16139         (location): display token name instead of its number.
16140
16141 2002-08-28  Martin Baulig  <martin@gnome.org>
16142
16143         * expression.cs (Binary.ResolveOperator): Don't silently return
16144         but return an error if an operator cannot be applied between two
16145         enum types.
16146
16147 2002-08-28  Martin Baulig  <martin@gnome.org>
16148
16149         * class.cs (Constructor.Define): Set the permission attributes
16150         correctly instead of making all constructors public.
16151
16152 2002-08-28  Martin Baulig  <martin@gnome.org>
16153
16154         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
16155         for private members before reporting a CS0103; if we find anything,
16156         it's a CS0122.
16157
16158 2002-08-28  Martin Baulig  <martin@gnome.org>
16159
16160         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
16161         to check whether `closure_start_type == closure_invocation_type',
16162         we also need to check whether `m.DeclaringType == closure_invocation_type'
16163         before bypassing the permission checks.  We might be accessing
16164         protected/private members from the base class.
16165         (TypeManager.RealMemberLookup): Only set private_ok if private
16166         members were requested via BindingFlags.NonPublic.
16167
16168         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
16169
16170         * expression.cs (MemberAccess.ResolveMemberAccess): Set
16171         MethodGroupExpr.IsExplicitImpl if appropriate.
16172         (Invocation.DoResolve): Don't report the CS0120 for explicit
16173         interface implementations.
16174
16175 2002-08-27  Martin Baulig  <martin@gnome.org>
16176
16177         * expression.cs (Invocation.DoResolve): If this is a static
16178         method and we don't have an InstanceExpression, we must report
16179         a CS0120.
16180
16181 2002-08-25  Martin Baulig  <martin@gnome.org>
16182
16183         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
16184         `==' between a valuetype and an object.
16185
16186 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
16187
16188         * ecore.cs (TypeExpr): Provide a ToString method.
16189
16190 2002-08-24  Martin Baulig  <martin@gnome.org>
16191
16192         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
16193         now called proggie.dbg and it's a binary file.
16194
16195 2002-08-23  Martin Baulig  <martin@gnome.org>
16196
16197         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
16198
16199 2002-08-23  Martin Baulig  <martin@gnome.org>
16200
16201         * struct.cs (MyStructInfo.ctor): Make this work with empty
16202         structs; it's not allowed to use foreach() on null.
16203
16204 2002-08-23  Martin Baulig  <martin@gnome.org>
16205
16206         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
16207         writer the full pathname of the generated assembly.
16208
16209 2002-08-23  Martin Baulig  <martin@gnome.org>
16210
16211         * statements.cs (FlowBranching.UsageVector.MergeChildren):
16212         A `finally' block never returns or breaks; improved handling of
16213         unreachable code.
16214
16215 2002-08-23  Martin Baulig  <martin@gnome.org>
16216
16217         * statement.cs (Throw.Resolve): Allow `throw null'.
16218
16219 2002-08-23  Martin Baulig  <martin@gnome.org>
16220
16221         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
16222         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
16223         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
16224         MemberLookup would return a wrong event if this is an explicit
16225         interface implementation and the class has an event with the same
16226         name.
16227
16228 2002-08-23  Martin Baulig  <martin@gnome.org>
16229
16230         * statement.cs (Block.AddChildVariableNames): New public method.
16231         (Block.AddChildVariableName): Likewise.
16232         (Block.IsVariableNameUsedInChildBlock): Likewise.
16233         (Block.AddVariable): Check whether a variable name has already
16234         been used in a child block.
16235
16236         * cs-parser.jay (declare_local_variables): Mark all variable names
16237         from the current block as being used in a child block in the
16238         implicit block.
16239
16240 2002-08-23  Martin Baulig  <martin@gnome.org>
16241
16242         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
16243         find the symbol writer.
16244
16245         * driver.cs: csc also allows the arguments to /define being
16246         separated by commas, not only by semicolons.
16247
16248 2002-08-23  Martin Baulig  <martin@gnome.org>
16249
16250         * interface.cs (Interface.GetMembers): Added static check for events.
16251
16252 2002-08-15  Martin Baulig  <martin@gnome.org>
16253
16254         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
16255         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
16256
16257         * ecore.cs (Expression.MemberLookup): Added documentation and explained
16258         why the MethodData.EmitDestructor() change was necessary.
16259
16260 2002-08-20  Martin Baulig  <martin@gnome.org>
16261
16262         * class.cs (TypeContainer.FindMembers): Added static check for events.
16263
16264         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
16265
16266         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
16267         use Type.GetEvents(), not Type.FindMembers().
16268
16269 2002-08-20  Martin Baulig  <martin@gnome.org>
16270
16271         * decl.cs (MemberCache): Added a special method cache which will
16272         be used for method-only searched.  This ensures that a method
16273         search will return a MethodInfo with the correct ReflectedType for
16274         inherited methods.      
16275
16276 2002-08-20  Martin Baulig  <martin@gnome.org>
16277
16278         * decl.cs (DeclSpace.FindMembers): Made this public.
16279
16280 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16281
16282         * delegate.cs: fixed build on windows.
16283         [FIXME:  Filed as bug #29150: MCS must report these errors.]
16284
16285 2002-08-19  Ravi Pratap  <ravi@ximian.com>
16286
16287         * ecore.cs (StandardConversionExists): Return a false
16288         if we are trying to convert the void type to anything else
16289         since that is not allowed.
16290
16291         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16292         we flag error 70 in the event an event is trying to be accessed
16293         directly from outside the declaring type.
16294
16295 2002-08-20  Martin Baulig  <martin@gnome.org>
16296
16297         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16298         MemberCache from typemanager.cs to decl.cs.
16299
16300 2002-08-19  Martin Baulig  <martin@gnome.org>
16301
16302         * class.cs (TypeContainer): Implement IMemberContainer.
16303         (TypeContainer.DefineMembers): Create the MemberCache.
16304         (TypeContainer.FindMembers): Do better BindingFlags checking; only
16305         return public members if BindingFlags.Public was given, check
16306         whether members are static.
16307
16308 2002-08-16  Martin Baulig  <martin@gnome.org>
16309
16310         * decl.cs (DeclSpace.Define): Splitted this in Define and
16311         DefineMembers.  DefineMembers is called first and initializes the
16312         MemberCache.
16313
16314         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
16315         DefineMembers() on all our DeclSpaces.
16316
16317         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16318         but call DefineMembers() on all nested interfaces.  We call their
16319         Define() in our new Define() function.
16320
16321         * interface.cs (Interface): Implement IMemberContainer.
16322         (Interface.Define): Moved all code except the attribute stuf to
16323         DefineMembers().
16324         (Interface.DefineMembers): Initialize the member cache.
16325
16326         * typemanager.cs (IMemberFinder): Removed this interface, we don't
16327         need this anymore since we can use MemberCache.FindMembers directly.
16328
16329 2002-08-19  Martin Baulig  <martin@gnome.org>
16330
16331         * typemanager.cs (MemberCache): When creating the cache for an
16332         interface type, add all inherited members.
16333         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16334         to `out bool used_cache' and documented it.
16335         (TypeManager.MemberLookup): If we already used the cache in the first
16336         iteration, we don't need to do the interfaces check.
16337
16338 2002-08-19  Martin Baulig  <martin@gnome.org>
16339
16340         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
16341         here from IMemberFinder and don't implement this interface anymore.
16342         (DeclSpace.MemberCache): Moved here from IMemberFinder.
16343
16344         * typemanager.cs (IMemberFinder): This interface is now only used by
16345         classes which actually support the member cache.
16346         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16347         since we only put DeclSpaces into this Hashtable.
16348         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
16349         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
16350
16351 2002-08-16  Martin Baulig  <martin@gnome.org>
16352
16353         * typemanager.cs (ICachingMemberFinder): Removed.
16354         (IMemberFinder.MemberCache): New property.
16355         (TypeManager.FindMembers): Merged this with RealFindMembers().
16356         This function will never be called from TypeManager.MemberLookup()
16357         so we can't use the cache here, just the IMemberFinder.
16358         (TypeManager.MemberLookup_FindMembers): Check whether the
16359         IMemberFinder has a MemberCache and call the cache's FindMembers
16360         function.
16361         (MemberCache): Rewrote larger parts of this yet another time and
16362         cleaned it up a bit.
16363
16364 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
16365
16366         * driver.cs (LoadArgs): Support quoting.
16367
16368         (Usage): Show the CSC-like command line arguments.
16369
16370         Improved a few error messages.
16371
16372 2002-08-15  Martin Baulig  <martin@gnome.org>
16373
16374         * typemanager.cs (IMemberContainer.Type): New property.
16375         (IMemberContainer.IsInterface): New property.
16376
16377         The following changes are conditional to BROKEN_RUNTIME, which is
16378         defined at the top of the file.
16379
16380         * typemanager.cs (MemberCache.MemberCache): Don't add the base
16381         class'es members, but add all members from TypeHandle.ObjectType
16382         if we're an interface.
16383         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16384         is the current type.
16385         (MemberCache.CacheEntry.Container): Removed this field.
16386         (TypeHandle.GetMembers): Include inherited members.
16387
16388 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16389
16390         * typemanager.cs: fixed compilation and added a comment on a field that
16391         is never used.
16392
16393 2002-08-15  Martin Baulig  <martin@gnome.org>
16394
16395         * class.cs (ConstructorInitializer.Resolve): In the
16396         Expression.MemberLookup call, use the queried_type as
16397         invocation_type.
16398
16399         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16400         declared' attribute, it's always true.
16401         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16402         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16403         temporary wrapper for FindMembers which tells MemberLookup whether
16404         members from the base classes are included in the return value.
16405         This will go away soon.
16406         (TypeManager.MemberLookup): Use this temporary hack here; once the
16407         new MemberCache is completed, we don't need to do the DeclaredOnly
16408         looping here anymore since the MemberCache will take care of this.
16409         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16410         (MemberCache): When creating the MemberCache for a class, get
16411         members from the current class and all its base classes.
16412         (MemberCache.CacheEntry.Container): New field.  This is a
16413         temporary hack until the Mono runtime is fixed to distinguish
16414         between ReflectedType and DeclaringType.  It allows us to use MCS
16415         with both the MS runtime and the unfixed Mono runtime without
16416         problems and without accecting performance.
16417         (MemberCache.SearchMembers): The DeclaredOnly looping from
16418         TypeManager.MemberLookup is now done here.      
16419
16420 2002-08-14  Martin Baulig  <martin@gnome.org>
16421
16422         * statement.cs (MyStructInfo.MyStructInfo): Don't call
16423         Type.GetFields on dynamic types but get the fields from the
16424         corresponding TypeContainer.
16425         (MyStructInfo.GetStructInfo): Added check for enum types.
16426
16427         * typemanager.cs (MemberList.IsSynchronized): Implemented.
16428         (MemberList.SyncRoot): Implemented.
16429         (TypeManager.FilterWithClosure): No need to check permissions if
16430         closure_start_type == closure_invocation_type, don't crash if
16431         closure_invocation_type is null.
16432
16433 2002-08-13  Martin Baulig  <martin@gnome.org>
16434
16435         Rewrote TypeContainer.FindMembers to use a member cache.  This
16436         gives us a speed increase of about 35% for the self-hosting MCS
16437         build and of about 15-20% for the class libs (both on GNU/Linux).
16438
16439         * report.cs (Timer): New class to get enhanced profiling.  This
16440         whole class is "TIMER" conditional since it remarkably slows down
16441         compilation speed.
16442
16443         * class.cs (MemberList): New class.  This is an IList wrapper
16444         which we're now using instead of passing MemberInfo[]'s around to
16445         avoid copying this array unnecessarily.
16446         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16447         (ICachingMemberFinder, IMemberContainer): New interface.
16448         (TypeManager.FilterWithClosure): If `criteria' is null, the name
16449         has already been checked, otherwise use it for the name comparision.
16450         (TypeManager.FindMembers): Renamed to RealMemberFinder and
16451         provided wrapper which tries to use ICachingMemberFinder.FindMembers
16452         if possible.  Returns a MemberList, not a MemberInfo [].
16453         (TypeHandle): New class, implements IMemberContainer.  We create
16454         one instance of this class per type, it contains a MemberCache
16455         which is used to do the member lookups.
16456         (MemberCache): New class.  Each instance of this class contains
16457         all members of a type and a name-based hash table.
16458         (MemberCache.FindMembers): This is our new member lookup
16459         function.  First, it looks up all members of the requested name in
16460         the hash table.  Then, it walks this list and sorts out all
16461         applicable members and returns them.
16462
16463 2002-08-13  Martin Baulig  <martin@gnome.org>
16464
16465         In addition to a nice code cleanup, this gives us a performance
16466         increase of about 1.4% on GNU/Linux - not much, but it's already
16467         half a second for the self-hosting MCS compilation.
16468
16469         * typemanager.cs (IMemberFinder): New interface.  It is used by
16470         TypeManager.FindMembers to call FindMembers on a TypeContainer,
16471         Enum, Delegate or Interface.
16472         (TypeManager.finder_to_member_finder): New PtrHashtable.
16473         (TypeManager.finder_to_container): Removed.
16474         (TypeManager.finder_to_delegate): Removed.
16475         (TypeManager.finder_to_interface): Removed.
16476         (TypeManager.finder_to_enum): Removed.
16477
16478         * interface.cs (Interface): Implement IMemberFinder.
16479
16480         * delegate.cs (Delegate): Implement IMemberFinder.
16481
16482         * enum.cs (Enum): Implement IMemberFinder.
16483
16484         * class.cs (TypeContainer): Implement IMemberFinder.
16485
16486 2002-08-12  Martin Baulig  <martin@gnome.org>
16487
16488         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16489
16490 2002-08-12  Martin Baulig  <martin@gnome.org>
16491
16492         * ecore.cs (ITypeExpression): New interface for expressions which
16493         resolve to a type.
16494         (TypeExpression): Renamed to TypeLookupExpression.
16495         (Expression.DoResolve): If we're doing a types-only lookup, the
16496         expression must implement the ITypeExpression interface and we
16497         call DoResolveType() on it.
16498         (SimpleName): Implement the new ITypeExpression interface.
16499         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16500         hack, the situation that we're only looking up types can't happen
16501         anymore when this method is called.  Moved the type lookup code to
16502         DoResolveType() and call it.
16503         (SimpleName.DoResolveType): This ITypeExpression interface method
16504         is now doing the types-only lookup.
16505         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16506         (ResolveFlags): Added MaskExprClass.
16507
16508         * expression.cs (MemberAccess): Implement the ITypeExpression
16509         interface.
16510         (MemberAccess.DoResolve): Added support for a types-only lookup
16511         when we're called via ITypeExpression.DoResolveType().
16512         (ComposedCast): Implement the ITypeExpression interface.
16513
16514         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
16515         Expression.Resolve() with ResolveFlags.Type instead.
16516
16517 2002-08-12  Martin Baulig  <martin@gnome.org>
16518
16519         * interface.cs (Interface.Define): Apply attributes.
16520
16521         * attribute.cs (Attribute.ApplyAttributes): Added support for
16522         interface attributes.
16523
16524 2002-08-11  Martin Baulig  <martin@gnome.org>
16525
16526         * statement.cs (Block.Emit): Only check the "this" variable if we
16527         do not always throw an exception.
16528
16529         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16530         whether the property has a set accessor.
16531
16532 2002-08-11  Martin Baulig  <martin@gnome.org>
16533
16534         Added control flow analysis support for structs.
16535
16536         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16537         with control flow analysis turned off.
16538         (IVariable): New interface.
16539         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16540         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16541         (FieldExpr.DoResolve): Resolve the instance expression with flow
16542         analysis turned off and do the definite assignment check after the
16543         resolving when we know what the expression will resolve to.
16544
16545         * expression.cs (LocalVariableReference, ParameterReference):
16546         Implement the new IVariable interface, only call the flow analysis
16547         code if ec.DoFlowAnalysis is true.
16548         (This): Added constructor which takes a Block argument.  Implement
16549         the new IVariable interface.
16550         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16551         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16552         This does the definite assignment checks for struct members.
16553
16554         * class.cs (Constructor.Emit): If this is a non-static `struct'
16555         constructor which doesn't have any initializer, call
16556         Block.AddThisVariable() to tell the flow analysis code that all
16557         struct elements must be initialized before control returns from
16558         the constructor.
16559
16560         * statement.cs (MyStructInfo): New public class.
16561         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16562         argument to this indexer.  If non-zero, check an individual struct
16563         member, not the whole struct.
16564         (FlowBranching.CheckOutParameters): Check struct members.
16565         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16566         overloaded versions of these methods which take an additional
16567         `int field_idx' argument to check struct members.
16568         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16569         overloaded versions of these methods which take an additional
16570         `string field_name' argument to check struct member.s
16571         (VariableInfo): Implement the IVariable interface.
16572         (VariableInfo.StructInfo): New public property.  Returns the
16573         MyStructInfo instance of the variable if it's a struct or null.
16574         (Block.AddThisVariable): New public method.  This is called from
16575         Constructor.Emit() for non-static `struct' constructor which do
16576         not have any initializer.  It creates a special variable for the
16577         "this" instance variable which will be checked by the flow
16578         analysis code to ensure that all of the struct's fields are
16579         initialized before control returns from the constructor.
16580         (UsageVector): Added support for struct members.  If a
16581         variable/parameter is a struct with N members, we reserve a slot
16582         in the usage vector for each member.  A struct is considered fully
16583         initialized if either the struct itself (slot 0) or all its
16584         members are initialized.
16585
16586 2002-08-08  Martin Baulig  <martin@gnome.org>
16587
16588         * driver.cs (Driver.MainDriver): Only report an error CS5001
16589         if there were no compilation errors.
16590
16591         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
16592         `UnsafeContext' property to determine whether the parent is in
16593         unsafe context rather than checking the parent's ModFlags:
16594         classes nested in an unsafe class are unsafe as well.
16595
16596 2002-08-08  Martin Baulig  <martin@gnome.org>
16597
16598         * statement.cs (UsageVector.MergeChildren): Distinguish between
16599         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
16600         we return.  Added test17() and test18() to test-154.cs.
16601
16602 2002-08-08  Martin Baulig  <martin@gnome.org>
16603
16604         * typemanager.cs (TypeManager.FilterWithClosure): If we have
16605         Family access, make sure the invoking type isn't a subclass of the
16606         queried type (that'd be a CS1540).
16607
16608         * ecore.cs (Expression.MemberLookup): Added overloaded version of
16609         this method which takes an additional `Type invocation_type'.
16610
16611         * expression.cs (BaseAccess.DoResolve): Use the base type as
16612         invocation and query type.
16613         (MemberAccess.DoResolve): If the lookup failed and we're about to
16614         report a CS0122, try a lookup with the ec.ContainerType - if this
16615         succeeds, we must report a CS1540.
16616
16617 2002-08-08  Martin Baulig  <martin@gnome.org>
16618
16619         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
16620         (MethodGroupExpr): Implement the IMemberExpr interface.
16621
16622         * expression (MemberAccess.ResolveMemberAccess): No need to have
16623         any special code for MethodGroupExprs anymore, they're now
16624         IMemberExprs.   
16625
16626 2002-08-08  Martin Baulig  <martin@gnome.org>
16627
16628         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
16629         Family, FamANDAssem and FamORAssem permissions.
16630         (TypeManager.IsSubclassOrNestedChildOf): New public method.
16631
16632 2002-08-08  Martin Baulig  <martin@gnome.org>
16633
16634         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
16635         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
16636         or loop block.
16637
16638 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
16639
16640         * driver.cs: implemented /resource option to embed managed resources.
16641
16642 2002-08-07  Martin Baulig  <martin@gnome.org>
16643
16644         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
16645         (FieldBase.HasFieldInitializer): New public property.
16646         (FieldBase.GetInitializerExpression): New public method.  Resolves and
16647         returns the field initializer and makes sure it is only resolved once.
16648         (TypeContainer.EmitFieldInitializers): Call
16649         FieldBase.GetInitializerExpression to get the initializer, this ensures
16650         that it isn't resolved multiple times.
16651
16652         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
16653         the resolving process (SimpleName/MemberLookup) that we're currently
16654         emitting a field initializer (which must not access any instance members,
16655         this is an error CS0236).
16656
16657         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
16658         argument, if the `IsFieldInitializer' flag is set, we must report and
16659         error CS0236 and not an error CS0120.   
16660
16661 2002-08-07  Martin Baulig  <martin@gnome.org>
16662
16663         * ecore.cs (IMemberExpr): New public interface.
16664         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
16665         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
16666         if the expression is an IMemberExpr.
16667
16668         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
16669         to be null, implicitly default to `this' if we're non-static in
16670         this case.  Simplified the code a lot by using the new IMemberExpr
16671         interface.  Also fixed bug #28176 here.
16672
16673 2002-08-06  Martin Baulig  <martin@gnome.org>
16674
16675         * cs-parser.jay (SimpleLookup): Removed.  We need to create
16676         ParameterReferences during semantic analysis so that we can do a
16677         type-only search when resolving Cast, TypeOf and SizeOf.
16678         (block): Pass the `current_local_parameters' to the Block's
16679         constructor.
16680
16681         * class.cs (ConstructorInitializer): Added `Parameters parameters'
16682         argument to the constructor.
16683         (ConstructorInitializer.Resolve): Create a temporary implicit
16684         block with the parameters.
16685
16686         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
16687         references here if we aren't doing a type-only search.
16688
16689         * statement.cs (Block): Added constructor which takes a
16690         `Parameters parameters' argument.
16691         (Block.Parameters): New public property.
16692
16693         * support.cs (InternalParameters.Parameters): Renamed `parameters'
16694         to `Parameters' and made it public readonly.
16695
16696 2002-08-06  Martin Baulig  <martin@gnome.org>
16697
16698         * ecore.cs (Expression.Warning): Made this public as well.
16699
16700         * report.cs (Report.Debug): Print the contents of collections.
16701
16702 2002-08-06  Martin Baulig  <martin@gnome.org>
16703
16704         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
16705         used to tell Resolve() which kinds of expressions it may return.
16706         (Expression.Resolve): Added overloaded version of this method which
16707         takes a `ResolveFlags flags' argument.  This can be used to tell
16708         Resolve() which kinds of expressions it may return.  Reports a
16709         CS0118 on error.
16710         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
16711         ResolveFlags.SimpleName.
16712         (Expression.Error118): Added overloaded version of this method which
16713         takes a `ResolveFlags flags' argument.  It uses the flags to determine
16714         which kinds of expressions are allowed.
16715
16716         * expression.cs (Argument.ResolveMethodGroup): New public method.
16717         Resolves an argument, but allows a MethodGroup to be returned.
16718         This is used when invoking a delegate.
16719
16720         * TODO: Updated a bit.
16721
16722 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16723
16724         Fixed compilation with csc.
16725
16726         * ecore.cs: Expression.Error made public. Is this correct? Should
16727         Warning be made public too?
16728
16729         * expression.cs: use ea.Location instead of ea.loc.
16730         [FIXME:  Filed as bug #28607: MCS must report these errors.]
16731
16732 2002-08-06  Martin Baulig  <martin@gnome.org>
16733
16734         * ecore.cs (Expression.loc): Moved the location here instead of
16735         duplicating it in all derived classes.
16736         (Expression.Location): New public property.
16737         (Expression.Error, Expression.Warning): Made them non-static and
16738         removed the location argument.
16739         (Expression.Warning): Added overloaded version which takes an
16740         `int level' argument.
16741         (Expression.Error118): Make this non-static and removed the
16742         expression and location arguments.
16743         (TypeExpr): Added location argument to the constructor.
16744
16745         * expression.cs (StaticCallExpr): Added location argument to
16746         the constructor.
16747         (Indirection, PointerArithmetic): Likewise.
16748         (CheckedExpr, UnCheckedExpr): Likewise.
16749         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
16750         (StringPtr): Likewise.
16751
16752
16753 2002-08-05  Martin Baulig  <martin@gnome.org>
16754
16755         * expression.cs (BaseAccess.DoResolve): Actually report errors.
16756
16757         * assign.cs (Assign.DoResolve): Check whether the source
16758         expression is a value or variable.
16759
16760         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
16761         while resolving the corresponding blocks.
16762
16763         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
16764         an error, don't silently return null.
16765
16766         * statement.cs (Block.AddVariable): Do the error reporting here
16767         and distinguish between CS0128 and CS0136.
16768         (Block.DoResolve): Report all unused labels (warning CS0164).
16769         (LabeledStatement): Pass the location to the constructor.
16770         (LabeledStatement.HasBeenReferenced): New property.
16771         (LabeledStatement.Resolve): Set it to true here.
16772
16773         * statement.cs (Return.Emit): Return success even after reporting
16774         a type mismatch error (CS0126 or CS0127), this is what csc does and
16775         it avoids confusing the users with any consecutive errors.
16776
16777 2002-08-05  Martin Baulig  <martin@gnome.org>
16778
16779         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
16780
16781         * const.cs (Const.LookupConstantValue): Catch circular definitions.
16782
16783         * expression.cs (MemberAccess.DoResolve): Silently return if an
16784         error has already been reported.
16785
16786         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
16787         error has already been reported.
16788
16789 2002-08-05  Martin Baulig  <martin@gnome.org>
16790
16791         * statement.cs (UsageVector): Only initialize the `parameters'
16792         vector if we actually have any "out" parameters.
16793
16794 2002-08-05  Martin Baulig  <martin@gnome.org>
16795
16796         * expression.cs (Binary.ResolveOperator): When combining delegates,
16797         they must have the same type.
16798
16799 2002-08-05  Martin Baulig  <martin@gnome.org>
16800
16801         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
16802         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
16803         work with the ms runtime and we also don't need it: if we're a
16804         PropertyBuilder and not in the `indexer_arguments' hash, then we
16805         are a property and not an indexer.
16806
16807         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
16808         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
16809         since the latter one doesn't work with the ms runtime.
16810
16811 2002-08-03  Martin Baulig  <martin@gnome.org>
16812
16813         Fixed bugs #27998 and #22735.
16814
16815         * class.cs (Method.IsOperator): New public field.
16816         (Method.CheckBase): Report CS0111 if there's already a method
16817         with the same parameters in the current class.  Report CS0508 when
16818         attempting to change the return type of an inherited method.
16819         (MethodData.Emit): Report CS0179 if a method doesn't have a body
16820         and it's not marked abstract or extern.
16821         (PropertyBase): New abstract base class for Property and Indexer.
16822         (PropertyBase.CheckBase): Moved here from Property and made it work
16823         for indexers.
16824         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
16825         the same so we can reuse it there.
16826         (Property, Indexer): Derive from PropertyBase.
16827         (MethodSignature.inheritable_property_signature_filter): New delegate
16828         to find properties and indexers.
16829
16830         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
16831         argument and improved error reporting.
16832
16833         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
16834         EmptyReadOnlyParameters and made it a property.
16835
16836         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
16837         version of this method which takes a `PropertyInfo indexer'.
16838         (TypeManager.RegisterIndexer): New method.
16839
16840         * class.cs: Added myself as author of this file :-)
16841
16842 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16843
16844         * class.cs: fixed compilation on windoze.
16845
16846 2002-08-03  Martin Baulig  <martin@gnome.org>
16847
16848         * interface.cs (Interface.GetInterfaceBases): Check whether all
16849         base interfaces are at least as accessible than the current one.
16850
16851         * class.cs (TypeContainer.GetClassBases): Check whether base types
16852         are at least as accessible than the current type.
16853         (TypeContainer.AsAccessible): Implemented and made non-static.
16854         (MemberBase.CheckParameters): Report errors if the accessibility
16855         checks fail.
16856
16857         * delegate.cs (Delegate.Delegate): The default visibility is
16858         internal for top-level types and private for nested types.
16859         (Delegate.Define): Report errors if the accessibility checks fail.
16860
16861         * enum.cs (Enum.Enum): The default visibility is internal for
16862         top-level types and private for nested types.
16863         (Enum.DefineType): Compute the correct visibility.
16864
16865         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
16866         function which takes a `bool is_toplevel' instead of a TypeContainer.
16867
16868         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
16869         builtin type.
16870
16871 2002-08-02  Martin Baulig  <martin@gnome.org>
16872
16873         * expression.cs (LocalVariableReferenc): Added constructor which
16874         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
16875         (LocalVariableReference.IsReadOnly): New property.
16876         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
16877         variable is readonly, use our own readonly flag to do this; you can
16878         use the new constructor to get a writable reference to a read-only
16879         variable.
16880
16881         * cs-parser.jay (foreach_statement, using_statement): Get a writable
16882         reference to the local variable.
16883
16884 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
16885
16886         * rootcontext.cs (ResolveCore): Also include System.Exception
16887
16888         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
16889         we reach an EmptyStatement.
16890
16891         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
16892         is also fine.
16893
16894         * expression.cs (Binary.ResolveOperator): Check error result in
16895         two places.
16896
16897         use brtrue/brfalse directly and avoid compares to null.
16898
16899 2002-08-02  Martin Baulig  <martin@gnome.org>
16900
16901         * class.cs (TypeContainer.Define): Define all nested interfaces here.
16902         Fixes bug #28407, added test-155.cs.
16903
16904 2002-08-01  Martin Baulig  <martin@gnome.org>
16905
16906         * class.cs (Event.EmitDefaultMethod): Make this work with static
16907         events.  Fixes #28311, added verify-3.cs.
16908
16909 2002-08-01  Martin Baulig  <martin@gnome.org>
16910
16911         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
16912         `is_disposable' fields.
16913         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
16914         `hm.is_disposable' if we're using the collection pattern.
16915         (Foreach.EmitCollectionForeach): Use the correct type for the
16916         enumerator's local variable, only emit the try/finally block if
16917         necessary (fixes #27713).
16918
16919 2002-08-01  Martin Baulig  <martin@gnome.org>
16920
16921         * ecore.cs (Expression.report118): Renamed to Error118 and made
16922         it public static.
16923
16924         * statement.cs (Throw.Resolve): Check whether the expression is of
16925         the correct type (CS0118) and whether the type derives from
16926         System.Exception (CS0155).
16927         (Catch.Resolve): New method.  Do the type lookup here and check
16928         whether it derives from System.Exception (CS0155).
16929         (Catch.CatchType, Catch.IsGeneral): New public properties.
16930
16931         * typemanager.cs (TypeManager.exception_type): Added.
16932
16933 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
16934
16935         * driver.cs: Updated About function.
16936
16937 2002-07-31  Martin Baulig  <martin@gnome.org>
16938
16939         Implemented Control Flow Analysis.
16940
16941         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
16942         (EmitContext.CurrentBranching): Added.
16943         (EmitContext.StartFlowBranching): Added.
16944         (EmitContext.EndFlowBranching): Added.
16945         (EmitContext.KillFlowBranching): Added.
16946         (EmitContext.IsVariableAssigned): Added.
16947         (EmitContext.SetVariableAssigned): Added.
16948         (EmitContext.IsParameterAssigned): Added.
16949         (EmitContext.SetParameterAssigned): Added.
16950         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
16951         Added control flow analysis stuff here.
16952
16953         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
16954         resolve the expression as lvalue.
16955         (LocalVariableReference.DoResolve): Check whether the variable has
16956         already been assigned.
16957         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
16958         the parameter as assigned here.
16959         (ParameterReference.DoResolve): Check whether the parameter has already
16960         been assigned.
16961         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
16962         expression as lvalue.
16963
16964         * statement.cs (FlowBranching): New class for the flow analysis code.
16965         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
16966         (LabeledStatement.IsDefined): New public property.
16967         (LabeledStatement.AddUsageVector): New public method to tell flow
16968         analyis that the label may be reached via a forward jump.
16969         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
16970         flow analysis.
16971         (VariableInfo.Number): New public field.  This is used by flow analysis
16972         to number all locals of a block.
16973         (Block.CountVariables): New public property.  This is the number of
16974         local variables in this block (including the locals from all parent
16975         blocks).
16976         (Block.EmitMeta): Number all the variables.
16977
16978         * statement.cs: Added flow analysis support to all classes.
16979
16980 2002-07-31  Martin Baulig  <martin@gnome.org>
16981
16982         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
16983         To get debugging messages, compile mcs with /define:MCS_DEBUG and
16984         then use this argument.
16985
16986         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
16987
16988         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
16989         use this to specify /define options.
16990
16991 2002-07-29  Martin Baulig  <martin@gnome.org>
16992
16993         * statement.cs (Fixed): Moved all code that does variable lookups
16994         and resolvings from Emit to Resolve.
16995
16996         * statement.cs (For): Moved all code that does variable lookups
16997         and resolvings from Emit to Resolve.
16998
16999         * statement.cs (Using): Moved all code that does variable lookups
17000         and resolvings from Emit to Resolve.
17001
17002 2002-07-29  Martin Baulig  <martin@gnome.org>
17003
17004         * attribute.cs (Attribute.Resolve): Explicitly catch a
17005         System.NullReferenceException when creating the
17006         CustromAttributeBuilder and report a different warning message.
17007
17008 2002-07-29  Martin Baulig  <martin@gnome.org>
17009
17010         * support.cs (ParameterData.ParameterName): Added method to
17011         get the name of a parameter.
17012
17013         * typemanager.cs (TypeManager.IsValueType): New public method.
17014
17015 2002-07-29  Martin Baulig  <martin@gnome.org>
17016
17017         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
17018         is a flag which specifies that it's either ref or out.
17019         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
17020         the out parameter to `out Parameter.Modifier mod', also set the
17021         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
17022
17023         * support.cs (InternalParameters.ParameterModifier): Distinguish
17024         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17025         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17026
17027         * expression.cs (Argument.GetParameterModifier): Distinguish
17028         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17029         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17030
17031 2002-07-29  Martin Baulig  <martin@gnome.org>
17032
17033         * expression.cs (ParameterReference.ParameterReference): Added
17034         `Location loc' argument to the constructor.
17035
17036         * cs-parser.jay: Pass location to ParameterReference.
17037
17038 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
17039
17040         * statement.cs (Try): Initialize the location.
17041
17042         * cs-parser.jay: pass location to Try.
17043
17044         * expression.cs (Unary.Reduce): Change the prototype to return
17045         whether a constant fold could be performed or not.  The result is
17046         returned in an out parameters.  In the case of Indirection and
17047         AddressOf, we want to perform the full tests.
17048
17049 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
17050
17051         * statement.cs (Statement.Emit): Flag dead code.
17052
17053 2002-07-27  Andrew Birkett  <andy@nobugs.org>
17054
17055         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
17056
17057 2002-07-27  Martin Baulig  <martin@gnome.org>
17058
17059         * class.cs (MethodData.Define): Put back call to
17060         TypeManager.AddMethod(), accidentally commented this out.
17061
17062         * report.cs (Debug): New public method to print debugging information,
17063         this is `[Conditional ("DEBUG")]'.
17064
17065 2002-07-26  Martin Baulig  <martin@gnome.org>
17066
17067         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
17068         (switch_statement): Push the current_block to the switch_stack and
17069         pop it again when we're done with the switch.
17070         (switch_section): The new block is a child of the current_block.
17071         Fixes bug #24007, added test-152.cs.
17072
17073 2002-07-27  Martin Baulig  <martin@gnome.org>
17074
17075         * expression.cs (Invocation.EmitArguments): When calling a varargs
17076         function with only its fixed arguments, we need to pass an empty
17077         array.
17078
17079 2002-07-27  Martin Baulig  <martin@gnome.org>
17080
17081         Mono 0.13 has been released.
17082
17083 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
17084
17085         * driver.cs: Rename --resource to --linkres, because that is what
17086         we do currently, we dont support --resource yet.
17087
17088         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
17089
17090 2002-07-25  Martin Baulig  <martin@gnome.org>
17091
17092         * class.cs (MethodData): New public class.  This is a `method builder'
17093         class for a method or one accessor of a Property/Indexer/Event.
17094         (MethodData.GetMethodFlags): Moved here from MemberBase.
17095         (MethodData.ApplyAttributes): Likewise.
17096         (MethodData.ApplyObsoleteAttribute): Likewise.
17097         (MethodData.ApplyConditionalAttribute): Likewise.
17098         (MethodData.ApplyDllImportAttribute): Likewise.
17099         (MethodData.CheckAbstractAndExternal): Likewise.
17100         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
17101         (MethodData.Emit): Formerly known as Method.Emit().
17102         (MemberBase): Moved everything which was specific to a single
17103         accessor/method to MethodData.
17104         (Method): Create a new MethodData and call Define() and Emit() on it.
17105         (Property, Indexer, Event): Create a new MethodData objects for each
17106         accessor and call Define() and Emit() on them.
17107
17108 2002-07-25  Martin Baulig  <martin@gnome.org>
17109
17110         Made MethodCore derive from MemberBase to reuse the code from there.
17111         MemberBase now also checks for attributes.
17112
17113         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
17114         (MemberBase.GetMethodFlags): Moved here from class Method and marked
17115         as virtual.
17116         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
17117         `CallingConventions cc' and `Attributes opt_attrs' arguments.
17118         (MemberBase.ApplyAttributes): New virtual method; applies the
17119         attributes to a method or accessor.
17120         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
17121         (MemberBase.ApplyConditionalAttribute): Likewise.
17122         (MemberBase.ApplyDllImportAttribute): Likewise.
17123         (MemberBase.CheckAbstractAndExternal): Likewise.
17124         (MethodCore.ParameterTypes): This is now a property instead of a
17125         method, it's initialized from DoDefineParameters().
17126         (MethodCore.ParameterInfo): Removed the set accessor.
17127         (MethodCore.DoDefineParameters): New protected virtual method to
17128         initialize ParameterTypes and ParameterInfo.
17129         (Method.GetReturnType): We can now simply return the MemberType.
17130         (Method.GetMethodFlags): Override the MemberBase version and add
17131         the conditional flags.
17132         (Method.CheckBase): Moved some code from Define() here, call
17133         DoDefineParameters() here.
17134         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
17135         here to avoid some larger code duplication.
17136         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
17137         ensure that abstract and external accessors don't declare a body.
17138
17139         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
17140         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
17141         lookup in the attribute's parent classes, so we need to abort as soon
17142         as we found the first match.
17143         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
17144         the attribute has no arguments.
17145
17146         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
17147         of a Method.
17148
17149 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17150
17151         * cs-parser.jay: reverted previous patch.
17152
17153 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17154
17155         * cs-parser.jay: fixed bug #22119.
17156
17157 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17158
17159         * attribute.cs: fixed compilation. The error was:
17160         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
17161         be assigned to before control leaves the current method."
17162         [FIXME:  Filed as bug #28186: MCS must report this error.]
17163
17164 2002-07-25  Martin Baulig  <martin@gnome.org>
17165
17166         * attribute.cs (Attribute.Conditional_GetConditionName): New static
17167         method to pull the condition name ouf of a Conditional attribute.
17168         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
17169         the obsolete message and error flag out of an Obsolete attribute.
17170
17171         * class.cs (Method.GetMethodFlags): New public method to get the
17172         TypeManager.MethodFlags for this method.
17173         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
17174         private methods.
17175         (Method.Define): Get and apply the Obsolete and Conditional attributes;
17176         if we're overriding a virtual function, set the new private variable
17177         `parent_method'; call the new TypeManager.AddMethod().
17178
17179         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
17180         the MethodBuilder and the Method in a PtrHashtable.
17181         (TypeManager.builder_to_method): Added for this purpose.
17182         (TypeManager.MethodFlags): Added IsObsoleteError.
17183         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
17184         Obsolete and Conditional arguments in MethodBuilders.  If we discover
17185         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
17186         the message from the attribute.
17187
17188 2002-07-24  Martin Baulig  <martin@gnome.org>
17189
17190         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
17191         preprocessor directives, ensure that the argument to #define/#undef is
17192         exactly one identifier and that it's actually an identifier.
17193
17194         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
17195         did not work ....
17196
17197 2002-07-24  Martin Baulig  <martin@gnome.org>
17198
17199         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
17200         initialize it to TypeManager.object_type in the constructor.
17201         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
17202         of the `hm.get_current' method if we're using the collection pattern.
17203         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
17204         for the explicit conversion to make it work when we're using the collection
17205         pattern and the `Current' property has a different return type than `object'.
17206         Fixes #27713.
17207
17208 2002-07-24  Martin Baulig  <martin@gnome.org>
17209
17210         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
17211         does not match, but don't report any errors.  This method is called in
17212         order for all methods in a MethodGroupExpr until a matching method is
17213         found, so we don't want to bail out if the first method doesn't match.
17214         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
17215         matches, report the 123.  Fixes #28070.
17216
17217 2002-07-24  Martin Baulig  <martin@gnome.org>
17218
17219         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
17220         TypeManager.TypeToCoreType() to the top of the method so the
17221         following equality checks will work.  Fixes #28107.
17222
17223 2002-07-24  Martin Baulig  <martin@gnome.org>
17224
17225         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
17226         operand is of type uint, and the other operand is of type sbyte,
17227         short or int, the operands are converted to type long." -
17228         Actually do what this comment already told us.  Fixes bug #28106,
17229         added test-150.cs.
17230
17231 2002-07-24  Martin Baulig  <martin@gnome.org>
17232
17233         * class.cs (MethodBase): New abstract class.  This is now a base
17234         class for Property, Indexer and Event to avoid some code duplication
17235         in their Define() and DefineMethods() methods.
17236         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
17237         generic methods for Define() and DefineMethods().
17238         (FieldBase): Derive from MemberBase, not MemberCore.
17239         (Property): Derive from MemberBase, not MemberCore.
17240         (Property.DefineMethod): Moved all the code from this method to the
17241         new MethodBase.DefineAccessor(), just call it with appropriate
17242         argumetnts.
17243         (Property.Define): Call the new Property.DoDefine(), this does some
17244         sanity checks and we don't need to duplicate the code everywhere.
17245         (Event): Derive from MemberBase, not MemberCore.
17246         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
17247         accessors, this will also make them work with interface events.
17248         (Indexer): Derive from MemberBase, not MemberCore.
17249         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
17250         (Indexer.Define): Use the new MethodBase functions.
17251
17252         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
17253         argument to the constructor.
17254         (Interface.FindMembers): Added support for interface events.
17255         (Interface.PopluateEvent): Implemented.
17256
17257         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
17258
17259 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
17260
17261         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
17262         but this is required to check for a method name being the same as
17263         the containing class.  
17264
17265         Handle this now.
17266
17267 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17268
17269         * interface.cs: initialize variable.
17270
17271 2002-07-23  Martin Baulig  <martin@gnome.org>
17272
17273         Implemented the IndexerName attribute in interfaces.
17274
17275         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17276         name if this is an explicit interface implementation.
17277         (Indexer.InterfaceIndexerName): New public variable.  If we're
17278         implementing an interface indexer, this is the IndexerName in that
17279         interface.  Otherwise, it's the IndexerName.
17280         (Indexer.DefineMethod): If we're implementing interface indexer,
17281         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
17282         and Pending.ImplementIndexer methods.
17283         (Indexer.Define): Also define the PropertyBuilder if we're
17284         implementing an interface indexer and this is neither an explicit
17285         interface implementation nor do the IndexerName match the one in
17286         the interface.
17287
17288         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17289         If a method is defined here, then we always need to create a proxy
17290         for it.  This is used when implementing interface indexers.
17291         (Pending.IsInterfaceIndexer): New public method.
17292         (Pending.ImplementIndexer): New public method.
17293         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17294         This is used when implementing interface indexers to define a proxy
17295         if necessary.
17296         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17297         define a proxy if necessary.
17298
17299         * interface.cs (Interface.IndexerName): New public variable.
17300         (Interface.PopulateIndexer): Set the IndexerName.
17301         (Interface.DefineIndexers): New private method.  Populate all the
17302         indexers and make sure their IndexerNames match.
17303
17304         * typemanager.cs (IndexerPropertyName): Added support for interface
17305         indexers.
17306
17307 2002-07-22  Martin Baulig  <martin@gnome.org>
17308
17309         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17310         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17311         ret if HasReturnLabel.
17312         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17313         variables.
17314
17315         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17316         and set the ec.LoopBeginTryCatchLevel.
17317         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17318         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17319         the current ec.TryCatchLevel, the branch goes out of an exception
17320         block.  In this case, we need to use Leave and not Br.
17321
17322 2002-07-22  Martin Baulig  <martin@gnome.org>
17323
17324         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17325         block unless the block does not always return or it is contained in
17326         another try { ... } catch { ... } block.  Fixes bug #26506.
17327         Added verify-1.cs to the test suite.
17328
17329 2002-07-22  Martin Baulig  <martin@gnome.org>
17330
17331         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17332         then we do not always return.  Fixes bug #24985.
17333
17334 2002-07-22  Martin Baulig  <martin@gnome.org>
17335
17336         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17337         lookup on a per-class level; ie. walk up the class hierarchy until we
17338         found at least one applicable method, then choose the best among them.
17339         Fixes bug #24463 and test-29.cs.
17340
17341 2002-07-22  Martin Baulig  <martin@gnome.org>
17342
17343         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17344         return types of the methods.  The return type is not part of the
17345         signature and we must not check it to make the `new' modifier work.
17346         Fixes bug #27999, also added test-147.cs.
17347         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
17348
17349         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
17350         on the method's return type.
17351
17352 2002-07-21  Martin Baulig  <martin@gnome.org>
17353
17354         * assign.cs: Make this work if the rightmost source is a constant and
17355         we need to do an implicit type conversion.  Also adding a few more tests
17356         to test-38.cs which should have caught this.
17357
17358         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
17359         target in the makefile for this.  The makefile.gnu is primarily intended
17360         for end-users who don't want to debug the compiler.
17361
17362 2002-07-21  Martin Baulig  <martin@gnome.org>
17363
17364         * assign.cs: Improved the Assign class so it can now handle embedded
17365         assignments (X = Y = Z = something).  As a side-effect this'll now also
17366         consume less local variables.  test-38.cs now passes with MCS, added
17367         a few new test cases to that test.
17368
17369 2002-07-20  Martin Baulig  <martin@gnome.org>
17370
17371         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17372         instructions.  Fixes bug #27977, also added test-146.cs.
17373
17374 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17375
17376         * cs-tokenizer.cs: fixed getHex ().
17377
17378 2002-07-19  Martin Baulig  <martin@gnome.org>
17379
17380         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17381         not Type.GetType() to lookup the array type.  This is needed when
17382         we're constructing an array of a user-defined type.
17383         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17384         single-dimensional arrays, but also for single-dimensial arrays of
17385         type decimal.
17386
17387 2002-07-19  Martin Baulig  <martin@gnome.org>
17388
17389         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17390         this function is called, it's not allowed to share LocalBuilders
17391         among ILGenerators.
17392
17393 2002-07-19  Martin Baulig  <martin@gnome.org>
17394
17395         * expression.cs (Argument.Resolve): Report an error 118 when trying
17396         to pass a type as argument.
17397
17398 2002-07-18  Martin Baulig  <martin@gnome.org>
17399
17400         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17401         Conv_R_Un for the signed `long' type.
17402
17403 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
17404
17405         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17406         `expr' for the temporary result, as that will fail if we do
17407         multiple resolves on the same expression.
17408
17409 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
17410
17411         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17412         ec.TypeContainer for looking up aliases. 
17413
17414         * class.cs (TypeContainer): Remove LookupAlias from here.
17415
17416         * decl.cs (DeclSpace); Move here.
17417
17418 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
17419
17420         * class.cs (FindMembers): Only call filter if the constructor
17421         bulider is not null.
17422
17423         Also handle delegates in `NestedTypes' now.  Now we will perform
17424         type lookups using the standard resolution process.  This also
17425         fixes a bug.
17426
17427         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17428         This uses Expressions (the limited kind that can be parsed by the
17429         tree) instead of strings.
17430
17431         * expression.cs (ComposedCast.ToString): Implement, used to flag
17432         errors since now we have to render expressions.
17433
17434         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
17435         FormArrayType. 
17436
17437         * ecore.cs (SimpleName.ToString): ditto.
17438
17439         * cs-parser.jay: Instead of using strings to assemble types, use
17440         Expressions to assemble the type (using SimpleName, ComposedCast,
17441         MemberAccess).  This should fix the type lookups in declarations,
17442         because we were using a different code path for this.
17443
17444         * statement.cs (Block.Resolve): Continue processing statements
17445         even when there is an error.
17446
17447 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
17448
17449         * class.cs (Event.Define): Also remove the `remove' method from
17450         the list of pending items.
17451
17452         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17453         generate more compact code. 
17454
17455 2002-07-17  Martin Baulig  <martin@gnome.org>
17456
17457         * const.cs (Const.LookupConstantValue): Add support for constant
17458         `unchecked' and `checked' expressions.
17459         Also adding test case test-140.cs for this.
17460
17461 2002-07-17  Martin Baulig  <martin@gnome.org>
17462
17463         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17464         check whether mi.ReturnType implements the IEnumerator interface; the
17465         `==' and the IsAssignableFrom() will fail in this situation.
17466
17467 2002-07-16  Ravi Pratap  <ravi@ximian.com>
17468
17469         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
17470         here too.
17471
17472 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17473
17474         * expression.cs: fixed bug #27811.
17475
17476 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
17477
17478         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17479         Molaro: when we are a ref, the value already contains a pointer
17480         value, do not take the address of it.
17481
17482 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17483         * removed mb-parser.jay and mb-tokenizer.cs
17484
17485 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17486
17487         * expression.cs: check against the building corlib void type.
17488
17489 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17490
17491         * ecore.cs: fix for valuetype static readonly fields: when 
17492         initializing them, we need their address, not the address of a copy.
17493
17494 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17495
17496         * typemanager.cs: register also enum_type in corlib.
17497
17498 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17499
17500         * class.cs: allow calling this (but not base) initializers in structs.
17501
17502 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17503
17504         * ecore.cs: make sure we compare against the building base types
17505         in GetTypeSize ().
17506
17507 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
17508
17509         * typemanager.cs: fix TypeToCoreType() to handle void and object
17510         (corlib gets no more typerefs after this change).
17511
17512 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
17513
17514         * expression.cs (ArrayCreation.EmitArrayArguments): use
17515         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17516
17517         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17518         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
17519         array indexes, the runtime actually forbids them.
17520
17521         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17522         for array arguments here.
17523
17524         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17525         instead of the default for ValueTypes.
17526
17527         (New.DoEmit): Use IsValueType instead of
17528         IsSubclassOf (value_type)
17529         (New.DoResolve): ditto.
17530         (Invocation.EmitCall): ditto.
17531
17532         * assign.cs (Assign): ditto.
17533
17534         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17535         Statements *are* currently doing part of their resolution during
17536         Emit.  
17537
17538         Expressions do always resolve during resolve, but statements are
17539         only required to propagate resolution to their children.
17540
17541 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
17542
17543         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17544
17545         (LoadAssembly): Do not add the dll if it is already specified
17546
17547         (MainDriver): Add the System directory to the link path at the end,
17548         after all the other -L arguments. 
17549
17550         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17551         wrong opcode for loading bytes and bools (ldelem.i1 instead of
17552         ldelem.u1) and using the opposite for sbytes.
17553
17554         This fixes Digger, and we can finally run it.
17555
17556         * driver.cs (UnixParseOption): Move the option parsing here.  
17557         (CSCParseOption): Implement CSC-like parsing of options.
17558
17559         We now support both modes of operation, the old Unix way, and the
17560         new CSC-like way.  This should help those who wanted to make cross
17561         platform makefiles.
17562
17563         The only thing broken is that /r:, /reference: and /lib: are not
17564         implemented, because I want to make those have the same semantics
17565         as the CSC compiler has, and kill once and for all the confussion
17566         around this.   Will be doing this tomorrow.
17567
17568         * statement.cs (Unsafe.Resolve): The state is checked during
17569         resolve, not emit, so we have to set the flags for IsUnsfe here.
17570
17571 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17572
17573         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17574         not catch the Error_ObjectRefRequired in SimpleName (as it is
17575         possible to have a class/instance variable name that later gets
17576         deambiguated), we have to check this here.      
17577
17578 2002-07-10  Ravi Pratap  <ravi@ximian.com>
17579
17580         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17581         make static and put into Expression.
17582
17583         (Event.Define): Register the private field of the event with the 
17584         TypeManager so that GetFieldFromEvent can get at it.
17585
17586         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17587         keep track of the private field associated with an event which
17588         has no accessors.
17589
17590         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
17591         private field.
17592
17593         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
17594
17595 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17596
17597         * expression.cs (Binary.EmitBranchable): this routine emits the
17598         Binary expression in a branchable context.  This basically means:
17599         we need to branch somewhere, not just get the value on the stack.
17600
17601         This works together with Statement.EmitBoolExpression.
17602
17603         * statement.cs (Statement.EmitBoolExpression): Use
17604         EmitBranchable. 
17605
17606 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
17607
17608         * statement.cs (For): Reduce the number of jumps in loops.
17609
17610         (For): Implement loop inversion for the For statement.
17611
17612         (Break): We can be breaking out of a Try/Catch controlled section
17613         (foreach might have an implicit try/catch clause), so we need to
17614         use Leave instead of Br.
17615
17616         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
17617         now).  If the instace expression supports IMemoryLocation, we use
17618         the AddressOf method from the IMemoryLocation to extract the
17619         address instead of emitting the instance.
17620
17621         This showed up with `This', as we were emitting the instance
17622         always (Emit) instead of the Address of This.  Particularly
17623         interesting when This is a value type, as we dont want the Emit
17624         effect (which was to load the object).
17625
17626 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
17627
17628         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
17629
17630         * statement.cs (Checked): Set the CheckedState during the resolve
17631         process too, as the ConvCast operations track the checked state on
17632         the resolve process, and not emit.
17633
17634         * cs-parser.jay (namespace_member_declaration): Flag that we have
17635         found a declaration when we do.  This is used to flag error 1529
17636
17637         * driver.cs: Report ok when we display the help only.
17638
17639 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
17640
17641         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
17642
17643 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
17644
17645         * cs-tokenizer.cs (define): We also have to track locally the
17646         defines.  AllDefines is just used for the Conditional Attribute,
17647         but we also need the local defines for the current source code. 
17648
17649 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
17650
17651         * statement.cs (While, For, Do): These loops can exit through a
17652         Break statement, use this information to tell whether the
17653         statement is the last piece of code.
17654
17655         (Break): Flag that we break.
17656
17657         * codegen.cs (EmitContexts): New `Breaks' state variable.
17658
17659 2002-07-03  Martin Baulig  <martin@gnome.org>
17660
17661         * class.cs (TypeContainer.MethodModifiersValid): Allow override
17662         modifiers in method declarations in structs.  Otherwise, you won't
17663         be able to override things like Object.Equals().
17664
17665 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17666
17667         * class.cs (Method, Property, Indexer): Do not allow the public
17668         modifier to be used in explicit interface implementations.
17669
17670         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
17671         override modifiers in method declarations in structs
17672
17673 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
17674
17675         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
17676         integer or real overflow, report an error
17677
17678 2002-07-02  Martin Baulig  <martin@gnome.org>
17679
17680         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
17681         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
17682         to tell the runtime about our newly created System.Object and
17683         System.ValueType types.
17684
17685 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17686
17687         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
17688         struct instead of Ldarg/Starg.
17689
17690 2002-07-02  Martin Baulig  <martin@gnome.org>
17691
17692         * expression.cs (Indirection.Indirection): Call
17693         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
17694
17695 2002-07-02  Martin Baulig  <martin@gnome.org>
17696
17697         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
17698         ValueType, call TypeManager.TypeToCoreType() on it.
17699         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
17700         the OpCodes.Newarr argument.
17701
17702 2002-07-02  Martin Baulig  <martin@gnome.org>
17703
17704         * expression.cs (Invocation.EmitCall): When compiling corlib,
17705         replace all calls to the system's System.Array type to calls to
17706         the newly created one.
17707
17708         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
17709         System.Array methods.
17710         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
17711         from the system's System.Array type which must be replaced.
17712
17713 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
17714
17715         * typemanager.cs: load unverifiable_code_ctor so we can build
17716         corlib using the correct type. Avoid using GetTypeCode() with
17717         TypeBuilders.
17718         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
17719         TypeManager.object_type to allow building corlib.
17720
17721 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
17722
17723         * ecore.cs: handle System.Enum separately in LoadFromPtr().
17724
17725 2002-07-01  Martin Baulig  <martin@gnome.org>
17726
17727         * class.cs: Make the last change actually work, we need to check
17728         whether `ifaces != null' to avoid a crash.
17729
17730 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17731
17732         * class.cs: when we build structs without fields that implement
17733         interfaces, we need to add the interfaces separately, since there is
17734         no API to both set the size and add the interfaces at type creation
17735         time.
17736
17737 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17738
17739         * expression.cs: the dimension arguments to the array constructors
17740         need to be converted if they are a long.
17741
17742 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
17743
17744         * class.cs: don't emit ldarg.0 if there is no parent constructor
17745         (fixes showstopper for corlib).
17746
17747 2002-06-29  Martin Baulig  <martin@gnome.org>
17748
17749         MCS now compiles corlib on GNU/Linux :-)
17750
17751         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
17752         ie. check for MethodImplOptions.InternalCall.
17753
17754         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
17755         and TypeManager.attribute_type are null, so we must explicitly check
17756         whether parent is not null to find out whether it's an attribute type.
17757         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
17758         and SetBuilder, not only if the property is neither abstract nor external.
17759         This is necessary to set the MethodImplOptions on the accessor methods.
17760         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
17761         SetBuilder, see Property.Emit().
17762
17763         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
17764         populate "System.Object", "System.ValueType" and "System.Attribute" since
17765         they've already been populated from BootCorlib_PopulateCoreTypes().
17766
17767 2002-06-29  Martin Baulig  <martin@gnome.org>
17768
17769         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
17770         is the NullLiteral, we also need to make sure that target_type is not
17771         an enum type.   
17772
17773 2002-06-29  Martin Baulig  <martin@gnome.org>
17774
17775         * rootcontext.cs (RootContext.ResolveCore): We must initialize
17776         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
17777         before calling BootstrapCorlib_ResolveDelegate ().
17778
17779 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17780
17781         * statement.cs: fixed build-breaker. All tests passed ok.
17782
17783 2002-06-27  Martin Baulig  <martin@gnome.org>
17784
17785         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
17786         for System.Decimal when compiling corlib.
17787
17788 2002-06-27  Martin Baulig  <martin@gnome.org>
17789
17790         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
17791         switch blocks which contain nothing but a default clause.
17792
17793 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
17794
17795        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
17796
17797 2002-06-27  Martin Baulig  <martin@gnome.org>
17798
17799         * ecore.cs (PropertyExpr.PropertyExpr): Call
17800         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
17801
17802         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
17803         is already a TypeBuilder.
17804
17805 2002-06-27  Martin Baulig  <martin@gnome.org>
17806
17807         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
17808         `target_type == TypeManager.array_type', not IsAssignableFrom() in
17809         the "from an array-type to System.Array" case.  This makes it work
17810         when compiling corlib.
17811
17812 2002-06-27  Martin Baulig  <martin@gnome.org>
17813
17814         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
17815         non-static PropertyExpr, set its InstanceExpression.  This makes
17816         the `ICollection.Count' property work in System/Array.cs.
17817
17818 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
17819
17820         * driver.cs: Made error handling more consistent.  Errors now
17821         tracked by Report class, so many methods which used to return int
17822         now return void.  Main() now prints success/failure and 
17823         errors/warnings message.
17824
17825         Renamed '--probe' compiler argument to '--expect-error'.  Removed
17826         the magic number return values (123 and 124).  Now, if the
17827         expected error occurs, the compiler exits with success (exit value
17828         0).  If the compilation completes without seeing that particular
17829         error, the compiler exits with failure (exit value 1).  The
17830         makefile in mcs/errors has been changed to handle the new behaviour.
17831
17832         * report.cs: Made 'expected error' number a property and renamed
17833         it from 'Probe' to 'ExpectedError'.
17834
17835         * genericparser.cs: Removed error handling support, since it is
17836         now all done by Report class.
17837
17838         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
17839         class, so parse() no longer returns an int.
17840
17841         * namespace.cs: Use Report.Error instead of GenericParser.error
17842
17843 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
17844
17845         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
17846         TypeContainer.AddOperator): At the front of the list put the
17847         explicit implementations, so they get resolved/defined first. 
17848
17849 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
17850
17851         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
17852         interface type is implemented by this TypeContainer.  Used during
17853         explicit interface implementation.
17854
17855         (Property.Define, Indexer.Define, Method.Define): Validate that
17856         the given interface in the explicit implementation is one of the
17857         base classes for the containing type.
17858
17859         Also if we are explicitly implementing an interface, but there is
17860         no match in the pending implementation table, report an error.
17861
17862         (Property.Define): Only define the property if we are
17863         not explicitly implementing a property from an interface.  Use the
17864         correct name also for those properties (the same CSC uses,
17865         although that is really not needed).
17866
17867         (Property.Emit): Do not emit attributes for explicitly implemented
17868         properties, as there is no TypeBuilder.
17869
17870         (Indexer.Emit): ditto.
17871
17872         Hiding then means that we do not really *implement* a pending
17873         implementation, which makes code fail.
17874
17875 2002-06-22  Martin Baulig  <martin@gnome.org>
17876
17877         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
17878         the return value of Object.GetType().  [FIXME: we need to do this whenever
17879         we get a type back from the reflection library].
17880
17881 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
17882
17883         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
17884
17885 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
17886
17887         * attribute.cs: Return null if we can not look up the type.
17888
17889         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
17890         the interface types found.
17891
17892         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
17893         interface types found.
17894
17895         * typemanager.cs (GetInterfaces): Make this routine returns alll
17896         the interfaces and work around the lame differences between
17897         System.Type and System.Reflection.Emit.TypeBuilder in the results
17898         result for GetInterfaces.
17899
17900         (ExpandInterfaces): Given an array of interface types, expand and
17901         eliminate repeated ocurrences of an interface.  This expands in
17902         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
17903         be IA, IB, IC.
17904
17905 2002-06-21  Martin Baulig  <martin@gnome.org>
17906
17907         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
17908         on System.Enum.
17909
17910 2002-06-21  Martin Baulig  <martin@gnome.org>
17911
17912         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
17913         and called with one of the core types, return the corresponding typebuilder for
17914         that type.
17915
17916         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
17917         element type.
17918
17919 2002-06-21  Martin Baulig  <martin@gnome.org>
17920
17921         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
17922         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
17923         (Expression.ConvertReferenceExplicit): Likewise.
17924
17925         * expression.cs (ElementAccess.DoResolve): Likewise.
17926         (ElementAccess.DoResolveLValue): Likewise.
17927
17928 2002-06-10  Martin Baulig  <martin@gnome.org>
17929
17930         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
17931         add the "value" parameter to the parameter list.
17932
17933         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
17934         to our caller.
17935
17936 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
17937
17938         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
17939         the argument to an int, uint, long or ulong, per the spec.  Also
17940         catch negative constants in array creation.
17941
17942 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
17943
17944         * class.cs: do not allow the same interface to appear twice in
17945         the definition list.
17946
17947 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
17948
17949         * ecore.cs: don't use ldlen with System.Array.
17950
17951 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
17952
17953         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
17954
17955 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
17956
17957         * modifiers.cs: produce correct field attributes for protected
17958         internal. Easy fix so miguel can work on ther harder stuff:-)
17959
17960 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
17961
17962         * pending.cs: New file.  Move the code from class.cs here.
17963         Support clearning the pending flag for all methods (when not doing
17964         explicit interface implementation).
17965
17966 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
17967
17968         * rootcontext.cs: added a couple more types needed to bootstrap.
17969
17970 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
17971
17972         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
17973         constructor in the type, instead of any constructor in the type
17974         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
17975         a bug in the Mono runtime when applying the params attribute). 
17976
17977 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
17978         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
17979
17980 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
17981
17982         * expression.cs (Unary.ResolveOperator): Use TypeManager
17983         to resolve the type.
17984
17985 2002-06-13  Ravi Pratap  <ravi@ximian.com>
17986
17987         * cs-parser.jay (enum_member_declaration): Pass in the attributes
17988         attached.
17989
17990         * enum.cs (AddEnumMember): Add support to store the attributes associated 
17991         with each member too.
17992
17993         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
17994         field builders too - this takes care of the enum member case.
17995
17996 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
17997
17998         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
17999         address-of operator on both value types and pointers.
18000
18001 2002-06-10  Martin Baulig  <martin@gnome.org>
18002
18003         * interface.cs (Interface.PopulateIndexer): Add the indexer's
18004         PropertyBuilder to the `property_builders' list.
18005
18006         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
18007         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
18008         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
18009         find any indexers which are inherited from an interface.
18010
18011 2002-06-09  Martin Baulig  <martin@gnome.org>
18012
18013         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
18014         the same type as the constant if necessary.  There's also a test-130.cs
18015         for this.
18016
18017         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
18018
18019         * typemanager.cs (TypeManager.ChangeType): Previously known as
18020         Enum.ChangeEnumType().
18021
18022 2002-06-09  Martin Baulig  <martin@gnome.org>
18023
18024         * expression.cs (Cast.TryReduce): Added support for consts.
18025
18026 2002-06-08  Ravi Pratap  <ravi@ximian.com>
18027
18028         * class.cs (Accessor): Hold attributes information so we can pass
18029         it along.
18030
18031         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
18032         Modify to pass in attributes attached to the methods.
18033
18034         (add_accessor_declaration, remove_accessor_declaration): Ditto.
18035
18036         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
18037         to handle the Accessor kind :-)
18038
18039         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
18040
18041 2002-06-08  Martin Baulig  <martin@gnome.org>
18042
18043         * expression.cs (Unary.TryReduceNegative): Added support for
18044         ULongConstants.
18045
18046 2002-06-08  Martin Baulig  <martin@gnome.org>
18047
18048         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
18049         name can't be found in the `defined_names' - the caller will do a
18050         MemberLookup in this case and thus find methods in System.Enum
18051         such as Enum.IsDefined().
18052
18053 2002-06-08  Martin Baulig  <martin@gnome.org>
18054
18055         * enum.cs (Enum.ChangeEnumType): This is a custom version of
18056         Convert.ChangeType() which works with TypeBuilder created types.
18057         (Enum.LookupEnumValue, Enum.Define): Use it here.
18058
18059         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
18060         `TypeBuilder.BaseType != null' check.
18061         (TypeContainer.FindMembers): Only lookup parent members if we
18062         actually have a parent.
18063         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
18064         (ConstructorInitializer.Resolve): Likewise.
18065
18066         * interface.cs (Interface.FindMembers): Added
18067         `TypeBuilder.BaseType != null' check.
18068
18069         * rootcontext.cs (RootContext.ResolveCore): Added
18070         "System.Runtime.CompilerServices.IndexerNameAttribute" to
18071         classes_second_stage.
18072
18073         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
18074         debug_type and trace_type when compiling with --nostdlib.       
18075
18076 2002-06-07  Martin Baulig  <martin@gnome.org>
18077
18078         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
18079         (AddField): Set it to true when adding a non-static field.
18080         (DefineType): Use `have_nonstatic_fields' to find out whether we
18081         have non-static fields, not `Fields != null'.
18082
18083 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
18084
18085         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
18086         dereferencing a null on the static-field code path)
18087
18088 2002-05-30  Martin Baulig  <martin@gnome.org>
18089
18090         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
18091         to take command line arguments.  Use reflection to call the new
18092         custom `Initialize' function on the symbol writer and pass it the
18093         command line arguments.
18094
18095         * driver.cs (--debug-args): New command line argument to pass command
18096         line arguments to the symbol writer.
18097
18098 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
18099
18100         * assign.cs (DoResolve): Forgot to do the implicit conversion to
18101         the target type for indexers and properties.  Thanks to Joe for
18102         catching this.
18103
18104 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
18105
18106         * typemanager.cs (MethodFlags): returns the method flags
18107         (Obsolete/ShouldIgnore) that control warning emission and whether
18108         the invocation should be made, or ignored. 
18109
18110         * expression.cs (Invocation.Emit): Remove previous hack, we should
18111         not do this on matching a base type, we should do this based on an attribute
18112
18113         Only emit calls to System.Diagnostics.Debug and
18114         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
18115         on the command line.
18116
18117         * rootcontext.cs: Global settings for tracing and debugging.
18118
18119         * cs-tokenizer.cs (define): New utility function to track
18120         defines.   Set the global settings for TRACE and DEBUG if found.
18121
18122 2002-05-25  Ravi Pratap  <ravi@ximian.com>
18123
18124         * interface.cs (Populate*): Pass in the TypeContainer as well as
18125         the DeclSpace as parameters so that we can create EmitContexts and
18126         then use that to apply attributes etc.
18127
18128         (PopulateMethod, PopulateEvent, PopulateProperty)
18129         (PopulateIndexer): Apply attributes everywhere.
18130
18131         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
18132         etc.
18133
18134         (ApplyAttributes): Update accordingly.
18135
18136         We now apply interface attributes for all members too.
18137
18138 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
18139
18140         * class.cs (Indexer.Define); Correctly check if we are explicit
18141         implementation (instead of checking the Name for a ".", we
18142         directly look up if the InterfaceType was specified).
18143
18144         Delay the creation of the PropertyBuilder.
18145
18146         Only create the PropertyBuilder if we are not an explicit
18147         interface implementation.   This means that explicit interface
18148         implementation members do not participate in regular function
18149         lookups, and hence fixes another major ambiguity problem in
18150         overload resolution (that was the visible effect).
18151
18152         (DefineMethod): Return whether we are doing an interface
18153         implementation. 
18154
18155         * typemanager.cs: Temporary hack until we get attributes in
18156         interfaces (Ravi is working on that) and we get IndexerName
18157         support in interfaces.
18158
18159         * interface.cs: Register the indexers as properties.
18160
18161         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
18162         warning, I have verified that this is a bug in the .NET runtime
18163         (JavaScript suffers of the same problem).
18164
18165         * typemanager.cs (MemberLookup): When looking up members for
18166         interfaces, the parent of an interface is the implicit
18167         System.Object (so we succeed in searches of Object methods in an
18168         interface method invocation.  Example:  IEnumerable x;  x.ToString
18169         ()) 
18170
18171 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
18172
18173         * class.cs (Event): Events should also register if they do
18174         implement the methods that an interface requires.
18175
18176         * typemanager.cs (MemberLookup); use the new GetInterfaces
18177         method. 
18178
18179         (GetInterfaces): The code used to lookup interfaces for a type is
18180         used in more than one place, factor it here. 
18181
18182         * driver.cs: Track the errors at the bottom of the file, we kept
18183         on going.
18184
18185         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
18186         instance if the method we are calling is static!
18187
18188 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
18189
18190         * attribute.cs (ApplyAttributes): Make this function filter out
18191         the IndexerName attribute (as that attribute in reality is never
18192         applied) and return the string constant for the IndexerName
18193         attribute. 
18194
18195         * class.cs (TypeContainer.Emit): Validate that all the indexers
18196         have the same IndexerName attribute, and if so, set the
18197         DefaultName attribute on the class. 
18198
18199         * typemanager.cs: The return value might contain other stuff (not
18200         only methods).  For instance, consider a method with an "Item"
18201         property and an Item method.
18202
18203         * class.cs: If there is a problem with the parameter types,
18204         return. 
18205
18206 2002-05-24  Ravi Pratap  <ravi@ximian.com>
18207
18208         * ecore.cs (ImplicitConversionExists): Wrapper function which also
18209         looks at user defined conversion after making a call to 
18210         StandardConversionExists - we need this for overload resolution.
18211
18212         * expression.cs : Update accordingly the various method calls.
18213
18214         This fixes 2 bugs filed against implicit user defined conversions 
18215
18216 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
18217
18218         * statement.cs: Track the result of the assignment.
18219
18220 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
18221
18222         * expression.cs (MemberAccess): Improved error reporting for
18223         inaccessible members.
18224
18225 2002-05-22  Martin Baulig  <martin@gnome.org>
18226
18227         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
18228         itself with debugging support.
18229
18230 2002-05-22  Martin Baulig  <martin@gnome.org>
18231
18232         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
18233         Removed, this isn't needed anymore.
18234
18235 2002-05-20  Martin Baulig  <martin@gnome.org>
18236
18237         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
18238         be underlying type for an enum.
18239
18240 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
18241
18242         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
18243         that splits out the loading of just the core types.
18244
18245         * rootcontext.cs (ResolveCore): Split the struct resolution in
18246         two, so we can load the enumeration underlying types before any
18247         enums are used.
18248
18249         * expression.cs (Is): Bandaid until we fix properly Switch (see
18250         bug #24985 for details).
18251
18252         * typemanager.cs (ImplementsInterface): The hashtable will contain
18253         a null if there are no interfaces implemented.
18254
18255 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
18256
18257         * cs-parser.jay (indexer_declarator): It is fine to have array
18258         parameters
18259
18260 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18261
18262         * typemanager.cs: (RegisterBuilder): New function used to register
18263         TypeBuilders that implement interfaces.  Since
18264         TypeBuilder.GetInterfaces (as usual) does not work with lame
18265         Reflection.Emit. 
18266         (AddUserType): register interfaces.
18267
18268         (ImplementsInterface): Use the builder_to_ifaces hash if we are
18269         dealing with TypeBuilder.  Also, arrays are showing up as
18270         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
18271         methods can not be invoked on them!
18272
18273         * ecore.cs (ExplicitReferenceConversionExists): Made public.
18274         (ImplicitReferenceConversionExists): Split out from
18275         StandardConversionExists. 
18276
18277         * expression.cs (As): We were only implementing one of the three
18278         cases for the as operator.  We now implement them all.
18279         (Is): Implement the various other cases for Is as well.
18280
18281         * typemanager.cs (CACHE): New define used to control if we want or
18282         not the FindMembers cache.  Seems to have a negative impact on
18283         performance currently
18284
18285         (MemberLookup): Nested types have full acess to
18286         enclosing type members
18287
18288         Remove code that coped with instance/static returns for events, we
18289         now catch this in RealFindMembers.
18290
18291         (RealFindMembers): only perform static lookup if the instance
18292         lookup did not return a type or an event.  
18293
18294 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18295
18296         * assign.cs (CompoundAssign): We pass more semantic information
18297         now to Compound Assignments than we did before: now we have all
18298         the information at hand, and now we resolve the target *before* we
18299         do the expression expansion, which allows the "CacheValue" method
18300         to have the effect we intended (before, a [x] += 1 would generate
18301         two differen ArrayAccess expressions from the ElementAccess,
18302         during the resolution process).
18303
18304         (CompoundAssign.DoResolve): Resolve target and original_source here.
18305
18306 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
18307
18308         * expression.cs (ArrayAccess): dropped debugging information. 
18309
18310         * typemanager.cs: Small bug fix: I was always returning i_members,
18311         instead of one of i_members or s_members (depending on which had
18312         the content).
18313
18314         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
18315         method is invoked before any code generation takes place, and it
18316         is a mechanism to inform that the expression will be invoked more
18317         than once, and that the method should use temporary values to
18318         avoid having side effects
18319
18320         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18321
18322         * ecore.cs (Expression.CacheTemporaries): Provide empty default
18323         implementation.
18324
18325         * expression.cs (Indirection, ArrayAccess): Add support for
18326         CacheTemporaries in these two bad boys. 
18327
18328         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18329         ldobj or ldind_ref.  
18330         (StoreFromPtr): Handle stobj as well.
18331
18332         * expression.cs (UnaryMutator): Share more code.
18333
18334         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18335         down: I was not tracking the Filter function as well, which
18336         was affecting the results of the cache.
18337
18338 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
18339
18340         * attribute.cs: Remove the hack to handle the CharSet property on
18341         StructLayouts. 
18342
18343 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
18344
18345         * attribute.cs (DoResolve): More uglyness, we now only try to
18346         resolve the attribute partially, to extract the CharSet
18347         information (only if we are a StructLayout attribute).  Otherwise 
18348
18349         (GetExtraTypeInfo): Add some code to conditionally kill in the
18350         future this.   I am more and more convinced that the .NET
18351         framework has special code to handle the attribute setting on
18352         certain elements.
18353
18354         * expression.cs (IsParamsMethodApplicable): Revert my previous
18355         foreach change here, it was wrong.
18356
18357 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
18358
18359         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
18360         (pp_expr): do not abort on unknown input, just return.
18361         (eval): abort if there are pending chars.
18362
18363         * attribute.cs (Attribute.Resolve): Positional parameters are
18364         optional.  Deal with that case.
18365
18366         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
18367         the Ansi/Unicode/Auto information for the type.
18368
18369         (TypeContainer.DefineType): instantiate the EmitContext here, as
18370         we will be using it during the type definition (to resolve
18371         attributes) and during the emit phase.
18372
18373         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18374         to pull type information out of the attributes
18375
18376         (Attribute.Resolve): track the constructor builder, and allow for
18377         multiple invocations (structs and classes will use this).
18378
18379         * ecore.cs (MemberLookupFinal): new version with all the
18380         parameters customizable.
18381
18382         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18383         constructors.  Return if the result value is null (as the error
18384         would have been flagged already by MemberLookupFinal)
18385
18386         Do not allow instances of abstract classes or interfaces to be
18387         created.
18388
18389         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18390         We have to compare the assembly property here when dealing with
18391         FamANDAssem and Assembly access modifiers, because we might be
18392         creating an assembly from *modules* (that means that we are not
18393         getting TypeBuilders for types defined in other modules that are
18394         part of this assembly).
18395
18396         (Method.Emit): If the method is marked abstract and has a body,
18397         emit an error. 
18398
18399         (TypeContainer.DefineMembers): If both the defined member and the
18400         parent name match are methods, then do not emit any warnings: let
18401         the Method.Define routine take care of flagging warnings.  But if
18402         there is a mismatch (method overrides something else, or method is
18403         overriwritten by something, then emit warning).
18404
18405         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18406         set to null, this means `do not check for the return type on the
18407         signature'. 
18408
18409         (Method.Define): set the return type for the method signature to
18410         null, so that we get methods with the same name and parameters and
18411         different return types.  This is used to flag warning 114 (you are
18412         hiding a method, and you probably want to use the new/override
18413         keywords instead).
18414
18415         * typemanager.cs (MemberLookup): Implemented proper access
18416         control, closing a long standing set of bug reports.  The problem
18417         was that the Framework only has two bits: Public and NonPublic,
18418         and NonPublic includes private and protected methods, but we need
18419         to enforce the FamANDAssem, FamOrAssem and Family. 
18420
18421 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
18422
18423         * statement.cs (GotoCase): Return true: Ammounts to giving up
18424         knowledge on whether we return or not, and letting the other case
18425         be responsible for it.
18426
18427 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
18428
18429         * driver.cs: Do not load directories for each file processed, only
18430         do it if there is a pattern.
18431
18432         * ecore.cs: Report readonly assigns here as well, as we might have
18433         been resolved only by MemberAccess.
18434
18435         (SimpleName.SimpleNameResolve): Also be useful for LValue
18436         resolution.   We need this to propagate assign to local readonly variables
18437
18438         * typemanager.cs: Use a ptrhashtable for the criteria, because we
18439         do not want to reuse potential criteria memory.
18440
18441         * class.cs (MyEventBuilder): Set reflected_type;
18442
18443         * ecore.cs (Constantify): Added support for constifying bools.
18444
18445         (RootContext.LookupType): Added a cache for values looked up in
18446         the declaration space.
18447
18448         * typemanager.cs (FindMembers): Now is a front-end to
18449         RealFindMembers, and provides a two-level hashtable-based cache to
18450         the request.  
18451
18452         15% performance improvement: from 22.5 to 19.2 seconds.
18453
18454         * expression.cs (IsParamsMethodApplicable): use foreach.
18455         (Invocation.DoResolve): ditto.
18456         (New.DoResolve): ditto.
18457         (ArrayCreation.DoResolve): ditto.
18458
18459         * ecore.cs (FindMostEncompassingType): use foreach.
18460
18461         * delegate.cs (NewDelegate.DoResolve): Use foreach
18462
18463         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18464         (RemoveMethods): use foreach.
18465
18466         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18467         nested foreach statements instead of for, and also break out of
18468         the inner loop once a match is found.
18469
18470         (Invocation.OverloadResolve): Use foreach, simplify the code. 
18471
18472 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
18473
18474         * cfold.cs (BinaryFold): During an enumeration evaluation context,
18475         we actually unwrap the expression to allow for extra information
18476         to be extracted. 
18477
18478         * expression.cs: Use Shr_Un on unsigned operations. 
18479
18480 2002-05-08  Ravi Pratap  <ravi@ximian.com>
18481
18482         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
18483         applicable operators was not being considered correctly. This closes
18484         the bug Miguel reported.
18485
18486 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18487
18488         * attribute.cs: check that the type derives from System.Attribute
18489         and report the correct error in that case (moved the duplicate code to
18490         its own method, too).
18491
18492 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18493
18494         * attribute.cs: lookup attribute type name as the spec says: first the
18495         bare attribute name and then name + "Attribute" (nant compiles with
18496         mcs after this fix).
18497
18498 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
18499
18500         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
18501         Because of the way we parse things, we should try to see if a
18502         UIntConstant can fit in an integer.
18503
18504 2002-05-07  Ravi Pratap  <ravi@ximian.com>
18505
18506         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18507         when we are in an explicit context.
18508
18509         (ConvertReferenceExplicit): When converting from Iface type S to Class
18510         T make sure the rules are implemented as an OR.
18511
18512         * parameter.cs (ParameterType): Make it a property for now although the
18513         purpose really isn't anything immediate.
18514
18515         * expression.cs (Is*Applicable): Do better checking on the parameter type
18516         of a ref/out parameter. The ones from the system assemblies are already 
18517         marked with the correct type so we don't need to do any correction.
18518
18519         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
18520         the object type is standard too so include that.
18521
18522 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18523
18524         * ecore.cs (StandardConversionExists): Augment with missing code:
18525         deal with IntConstant, LongConstants and Enumerations.
18526
18527         * assign.cs: Report the error, instead of failing silently
18528
18529         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18530         typecontainer that they are declared, because the
18531         typecontainer/namespace will have the list of using clauses that
18532         need to be applied.
18533
18534         Assembly Attributes were escaping the normal registration
18535         mechanism. 
18536
18537         (EmitCode): Apply attributes within an EmitContext that represents
18538         the container they were declared on.
18539
18540         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
18541
18542 2002-05-06  Ravi Pratap  <ravi@ximian.com>
18543
18544         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18545         Revamp completely - make much cleaner as we now operate only
18546         on a set of Types.
18547
18548         (FindMostSpecificSource, FindMostSpecificTarget): New methods
18549         to implement the logic detailed in the spec more correctly.
18550
18551         (UserDefinedConversion): Update accordingly.
18552
18553 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18554
18555         * statement.cs: Return flow analysis information up.
18556
18557         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18558         and the default.
18559
18560         (token): Do not consume an extra character before calling
18561         decimal_digits.
18562
18563 2002-05-06  Piers Haken <piersh@friskit.com>
18564
18565         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18566
18567 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18568
18569         * class.cs (Constructor.Emit): Set the IsStatic flag in the
18570         EmitContext during the instance constructor initializer
18571         resolution, to stop access to instance variables.
18572
18573         This is mandated by the spec, last paragraph of the `constructor
18574         initializers' section. 
18575
18576 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
18577
18578         * cs-parser.jay, class.cs (Accessor): new class used to represent
18579         an accessor (get or set).  In the past we used `null' to represent
18580         a missing accessor.  But this is ambiguous because there was no
18581         way to tell in abstract indexers/properties if one of them was
18582         specified.
18583
18584         Now there is a way of addressing that.
18585
18586         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18587         instead of FindMembers.
18588
18589         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18590         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
18591
18592         * attribute.cs: Treat indexers and properties as the same in terms
18593         of applying attributes
18594
18595         * ecore.cs (FindMostEncompassedType): Use statically initialized
18596         EmptyExpressions()s like we do elsewhere to avoid creating useless
18597         objects (and we take this out of the tight loop).
18598
18599         (GetConversionOperators): Move the code to extract the actual
18600         operators to a separate routine to clean things up.
18601
18602 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
18603
18604         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
18605         events are always registered FieldBuilders.
18606
18607         * class.cs (FieldBase): New class shared by Fields 
18608
18609         * delegate.cs: If we are a toplevel delegate, use our full name.
18610         If we are a nested delegate, then only use our tail name.
18611
18612 2002-05-02  Ravi Pratap  <ravi@ximian.com>
18613
18614         * expression.cs (IsApplicable): Ensure that we add the "&" to
18615         ref/out types before comparing it with the type of the argument.
18616
18617         (IsParamsMethodApplicable): Ditto.
18618
18619         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
18620         silly me ;-)
18621
18622         * delegate.cs : Handle the case when we have more than one applicable
18623         method. Flag an error only when we finish checking all.
18624
18625 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
18626
18627         * expression.cs: Add support for boolean static initializers.
18628
18629 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
18630
18631         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
18632
18633         * parameter.cs (ComputeParameterTypes,
18634         ComputeAndDefineParameterTypes): Better error handling: now we
18635         clear the `types' cache if we fail during any of the type lookups.
18636         We also return the status code correctly to our caller
18637
18638         * delegate.cs: If we fail to define a delegate, abort the extra
18639         steps. 
18640
18641         * expression.cs (Binary.ResolveOperator): for
18642         operator==(object,object) and operator !=(object, object) we also
18643         have to verify that there is an implicit conversion from one to
18644         the other.
18645
18646         (ArrayAccess.DoResolve): Array Access can operate on
18647         non-variables. 
18648
18649 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
18650
18651         * assign.cs (CompoundAssign): A new class used as a "flag" that
18652         the assignment actually is happening as part of a compound
18653         assignment operator.
18654
18655         During compound assignment, a few new rules exist to enable things
18656         like:
18657
18658         byte b |= 1 + 2
18659
18660         From the spec:
18661
18662         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
18663         to the type of x) if y is implicitly convertible to the type of x,
18664         and the operator is a builtin operator and the return type of the
18665         operator is explicitly convertible to the type of x. 
18666
18667         * rootcontext.cs: Reset warning level to 2.  4 catches various
18668         "interesting" features in mcs, we must clean this up at some
18669         point, but currently am trying to kill other bugs ;-)
18670
18671         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
18672         in container classes as well.  
18673
18674         * expression.cs (Binary.ResolveOperator): Handle string case
18675         before anything else (as operator overloading does emit an error
18676         before doing anything else).
18677
18678         This code could go away when we move to a table driven model, but
18679         i could not come up with a good plan last night.
18680
18681 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
18682
18683         * typemanager.cs (CSharpName): reimplementation using regex.
18684         * class.cs: added null check for fields in Emit
18685         * rootcontext.cs: set warninglevel to 4
18686
18687 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
18688
18689         * typemanager.cs (CSharpName): reimplemented with Lupus
18690         suggestion.
18691
18692 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
18693
18694         * statement.cs (If): correclty implement Resolve, because we were
18695         not catching sem errors in there.  The same process is needed
18696         everywhere else. 
18697         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
18698
18699
18700         (Statement.Warning_DeadCodeFound): Factorize code.
18701         (While): Report dead code here too.
18702
18703         (Statement): Added Resolve virtual method to allow
18704         for resolution split from the emit code.
18705
18706 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
18707
18708         * statement.cs (EmitBoolExpression): No longer try to resolve the
18709         expression here.    
18710         (MakeBoolean): New utility function that resolve, implicitly
18711         converts to boolean and tags the expression. 
18712
18713
18714         (If, Do): Implement dead code elimination.
18715         (While): Implement loop inversion
18716
18717         (Do, While, For, If): Resolve the expression prior to calling our
18718         code generation.
18719
18720 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
18721
18722         * class.cs:
18723           - added method Report28 (warning: program has more than one entry point)
18724           - added method IsEntryPoint, implements paragraph 10.1 of the spec
18725           - modified method Method.Define, the part at the end of the method
18726
18727         * rootcontext.cs: added static public Location EntryPointLocation;
18728           
18729         * ../errors/cs0028.cs : Add test case for the above warning.              
18730
18731         * typemanager.cs:
18732           - modified method CSharpName to allow arrays of primitive type to
18733             be printed nicely (e.g. instead of System.Int32[][] it now prints
18734             int[][])
18735           - added method CSharpSignature: returns the signature of a method
18736             in string format to be used in reporting errors, warnings, etc.
18737
18738         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
18739         with String.Empty.
18740
18741 2002-04-26  Ravi Pratap  <ravi@ximian.com>
18742
18743         * delegate.cs (Define): Fix extremely silly bug where I was
18744         setting the type of the 'object' parameter of the BeginInvoke
18745         method to System.IAsyncResult instead of System.Object ;-)
18746
18747 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
18748
18749         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
18750         here. 
18751
18752         (Constructor.Emit): return if we fail to initialize the
18753         constructor.  Another door closed!  
18754
18755         * expression.cs (New.DoResolve): Improve error message (from -6 to
18756         1501).  Use DeclaredOnly lookup to find the exact constructor.
18757
18758         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
18759         loop.  This is useful.
18760
18761         * cs-parser.jay: Adjust the default parameters so that destructors
18762         have the proper signature.
18763
18764 2002-04-26  Martin Baulig  <martin@gnome.org>
18765
18766         * driver.cs (LoadAssembly): If `assembly' contains any characters
18767         which are only valid in path names and not in assembly names
18768         (currently slash, backslash and point), use Assembly.LoadFrom ()
18769         instead of Assembly.Load () on the `assembly' (before iteration
18770         over the link_paths).
18771
18772 2002-04-26  Martin Baulig  <martin@gnome.org>
18773
18774         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
18775
18776 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
18777
18778         * class.cs (Property): use the new typemanager.MemberLookup
18779
18780         (TypeContainer.MemberLookup): Implement using the
18781         TypeManager.MemberLookup now. 
18782
18783         * typemanager.cs: Make MemberLookup a function of the TypeManager,
18784         and return MemberInfos, so that these can be used without an
18785         EmitContext (what we had before).
18786
18787 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
18788
18789         * expression.cs: Fix the case where the argument to params if the
18790         type of the params.  I omitted handling this before.   Fixed
18791
18792 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
18793
18794         * driver.cs: Call BootCorlib_PopulateCoreType
18795
18796         * class.cs (Property.CheckBase): Check for properties only, not
18797         for all members. 
18798
18799         * interface.cs: Temporary hack: try/catch around the
18800         CustomAttributeBuilder, because I am getting an exception that I
18801         do not understand.
18802
18803         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
18804         types whose definitions are required to be there (attributes are
18805         defined before standard types).
18806
18807         Compute definitions as we boot the various types, as they are used
18808         immediately (value_type class will need object_type, but if we do
18809         not initialize object_type, we will pass a null, which will let
18810         the runtime pick the System.Object from the existing corlib, which
18811         is not what we want).
18812
18813 2002-04-22  Patrik Torstensson <totte@labs2.com>
18814
18815         * cs-tokenizer.cs: fixed a number of trim() issues.
18816
18817 2002-04-22  Ravi Pratap  <ravi@ximian.com>
18818
18819         * expression.cs (Argument.Type): Ensure that we return the correct
18820         type when we have out or ref parameters [in which case we 
18821         append a "&"].
18822
18823 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
18824
18825         * class.cs (Property, Indexer): Allow extern modifier in there. 
18826
18827         * typemanager.cs (InitBaseTypes): Initializes object_type and
18828         value_type, since those will be used early on during the bootstrap
18829         process to compile corlib.
18830
18831         (InitCoreTypes): Move code from here to InitBaseTypes.
18832
18833 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
18834
18835         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
18836         single-dimension arrays as using the ldlen opcode.  
18837
18838         Daniel Lewis discovered this optimization.  
18839
18840         * typemanager.cs: Add signature for System.Array::get_Length
18841
18842 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18843
18844         * statement.cs: report the error when the foreach does not apply to an
18845         array nor a collection.
18846
18847 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
18848
18849         * expression.cs: Add implicit conversions to the operator ~.
18850
18851         * constant.cs (DecimalConstant.Emit): Emit decimal value.
18852
18853         * typemanager.cs: Locate the decimal constructor.
18854
18855 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18856
18857         * attribute.cs: use the new property of TypeOf.
18858         * expression.cs: added 'get' property around typearg.
18859
18860         These changes fix a build breaker reported by NickD. Is this the
18861         correct way to fix?  If not, please, revert my changes and make it
18862         work :-).
18863
18864 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
18865
18866         * attribute.cs: Add support for typeof in attribute invocations.
18867         I am not sure that this is right though.
18868
18869 2002-04-14  Duncan Mak  <duncan@ximian.com>
18870
18871         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
18872         Binary.Operator.Division case.
18873
18874 2002-04-13  Ravi Pratap  <ravi@ximian.com>
18875
18876         * class.cs (DefineType): Ensure that we do a proper check on
18877         attribute types and also register it with the TypeManager.
18878
18879         (TypeContainer.Targets): The default for attribute types is
18880         AttributeTargets.All.
18881
18882         * attribute.cs (ApplyAttributes): Registering the attribute type
18883         is done elsewhere, not when we discover we have a Usage attribute.
18884
18885 2002-04-12  Ravi Pratap  <ravi@ximian.com>
18886
18887         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
18888         and get rid of is_delegate parameter.
18889
18890         * everywhere : update.
18891
18892 2002-04-12  Ravi Pratap  <ravi@ximian.com>
18893
18894         * cs-parser.jay (compilation_unit): Revamp completely to use
18895         some new ideas that I got from Rhys' grammar to solve the problems
18896         with assembly level attributes.
18897
18898         (outer_declaration): New grammar production.
18899
18900         (attribute_sections): Add.
18901
18902         (opt_attributes): Base on attribute_sections
18903
18904         (namespace_declaration): Allow opt_attributes to tackle the case
18905         when we have assembly level attributes - we are clever in this
18906         regard now ;-)
18907
18908         * attribute.cs (ApplyAttributes): Do not worry about assembly 
18909         attributes in the non-global context.
18910
18911         * rootcontext.cs (AddGlobalAttributes): Go back to using this
18912         instead of SetGlobalAttributes.
18913
18914         * class.cs, rootcontext.cs : Ensure we define and generate 
18915         attribute types before anything else.
18916
18917         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
18918         and flag the new error -20 for the case when the attribute type
18919         does not have valid targets specified. csc does not catch this.
18920
18921         * ../errors/errors.txt : update for error # -20
18922
18923 2002-04-11  Ravi Pratap  <ravi@ximian.com>
18924
18925         * support.cs (InternalParameters.ParameterModifier): Do some null
18926         checking and return sane values.
18927
18928         * class.cs (Method.Define): If we are a PInvoke method, ensure
18929         that we are static and extern. Report error # 601
18930
18931         * ../errors/cs0601.cs : Add test case for the above error.
18932
18933 2002-04-07  Ravi Pratap  <ravi@ximian.com>
18934
18935         * rootcontext.cs (attribute_types): We need to keep type of
18936         all attribute types separately and emit code for them first.
18937
18938         (RegisterAttribute) : Implement.
18939
18940         * class.cs (DefineType): Check if the current Type is a custom
18941         attribute type and register it accordingly.
18942
18943         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
18944         adding the first attribute twice and rename to
18945
18946         (SetGlobalAttributes): this.
18947
18948         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
18949         lookups.
18950
18951         * attribute.cs (ApplyAttributes): Take an additional argument telling us
18952         if we are processing global arguments. Hmm, I am unsure of this.
18953
18954 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18955
18956         * expression.cs: added static array of strings to avoid calling
18957         Enum.ToString () for Operator in Binary. Significant recover of
18958         performance.
18959
18960 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
18961
18962         * class.cs (FindMembers): Allow the Builders of the various
18963         members to be null.  If they are skip them.  This only happens
18964         during the PInvoke declaration.
18965
18966 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
18967
18968         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
18969         failure, so we do not keep going afterwards.
18970
18971         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
18972         wanted to pass `false' as the `is_delegate' argument.  If this is
18973         the case, why not use delegate_type == null to mean `is_delegate =
18974         false' and anything else as is_delegate = true.
18975
18976 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
18977
18978         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
18979         code for the section, not the beginning of the tests.
18980
18981 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
18982
18983         * cfold.cs: Handle operator + (Enum x, Underlying x) 
18984
18985         * expression.cs (Binary): same.  Warn about errors where we have
18986         Enum/Enum in operator + as well.
18987
18988 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
18989
18990         * statement.cs:
18991                 - added support for switch(bool)
18992                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
18993                 - add TableSwitchEmit() to handle table-based switch statements
18994
18995 2002-04-05  Ravi Pratap  <ravi@ximian.com>
18996
18997         * expression.cs (Invocation.OverloadResolve): Factor out code which
18998         does parameter compatibility checking with arguments so that we can 
18999         re-use the code even from Delegate.VerifyApplicability
19000
19001         (VerifyArgumentsCompat): Move above code here.
19002
19003         * delegate.cs (VerifyApplicability): Get rid of duplicate code
19004         and instead make a call to the above method.
19005
19006 2002-03-31  Ravi Pratap  <ravi@ximian.com>
19007
19008         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
19009         We use it to keep track of classes which are attribute types.
19010
19011 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
19012
19013         * delegate.cs (Delegate.Define): Correctly define the types in the
19014         presence of fixed and array parameters.
19015
19016         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
19017         doing FindMembers.
19018
19019         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
19020         include NonPublic after the first iteration.
19021
19022         * class.cs (Indexer.CheckBase): Only check if both parents are
19023         non-null. 
19024
19025         * cs-parser.jay (accessor_body): If empty, set to null.
19026
19027         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
19028         same code path here to resolve constants names that we did have in
19029         MemberAccess.DoResolve.  There is too much code duplicated here.
19030
19031 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
19032
19033         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
19034
19035         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
19036         to MakeUnionSet.
19037
19038         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
19039         tokens, numbers and strings.
19040
19041         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
19042         parenthesis.
19043
19044         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
19045         asyncronous parameters and the regular parameters.  
19046
19047         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
19048         specify the target directory.
19049
19050         * expression.cs: (This.DoResolve): Simplify
19051         (As.Emit): Optimize, do not generate IsInst if the expression is
19052         always of the given type.
19053
19054         (Is.DoResolve): Bug fix, we were reporting both always/never for
19055         the is expression.
19056
19057         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
19058         creating too many unnecessary arrays.
19059
19060 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
19061
19062         * class.cs (EmitFieldInitializer): Use Assign expression to assign
19063         fields instead of rolling our own initializer.   Takes care of all
19064         implicit conversions, and drops unnecessary static checks/argument.
19065
19066 2002-03-31  Dick Porter  <dick@ximian.com>
19067
19068         * driver.cs: use the GetDirectories() return values properly, and
19069         use "/" as path separator.
19070
19071 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
19072
19073         * expression.cs (Unary): Optimize - - expr into expr.
19074         (Binary): Optimize a + (-b) into a -b.
19075
19076         * codegen.cs (CodeGen): Made all methods static.
19077
19078 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
19079
19080         * rootcontext.cs: 
19081
19082         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
19083         TypeBuilder property.
19084
19085         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
19086         instead. 
19087
19088         * tree.cs: Removed the various RecordXXXX, and replaced with a
19089         single RecordDecl.  Removed all the accessor methods, and just
19090         left a single access point Type 
19091
19092         * enum.cs: Rename DefineEnum to DefineType.
19093
19094         * decl.cs: New abstract method `DefineType' used to unify the
19095         Defines for Enumerations, Interfaces, TypeContainers and
19096         Delegates.
19097
19098         (FindType): Moved LookupInterfaceOrClass here.  Moved the
19099         LookupBaseClasses method that used to live in class.cs and
19100         interface.cs here, and renamed to FindType.
19101
19102         * delegate.cs: Implement DefineType.  Take advantage of the
19103         refactored pattern for locating the parent builder without taking
19104         the parent_builder argument (which we know does not work if we are
19105         nested, and triggering a toplevel definition).
19106
19107 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19108
19109         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
19110         accessibility of a member has changed during override and report
19111         an error if so.
19112
19113         * class.cs (Method.Define, Property.Define): Only complain on
19114         overrides if the method is private, any other accessibility is
19115         fine (and since we just checked the permission is the same, we are
19116         good to go).
19117
19118         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
19119         and elif are processed always.  The other pre-processing
19120         directives are only processed if we are "taking" the path
19121
19122 2002-03-29  Martin Baulig  <martin@gnome.org>
19123
19124         * class.cs (Method.Emit): Only emit symbolic debugging info if the
19125         current location is not Null.
19126
19127         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
19128         a separate method so we can profile it.
19129
19130         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
19131         `span.Seconds' are just seconds, but no minutes or hours.
19132         (MainDriver): Profile the CodeGen.SaveSymbols calls.
19133
19134 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19135
19136         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
19137         Remove the gratuitous set of Final:
19138
19139                                 // If an interface implementation, then we can set Final.
19140                                 if (((flags & MethodAttributes.Abstract) == 0) &&
19141                                     implementing.DeclaringType.IsInterface)
19142                                         flags |= MethodAttributes.Final;
19143
19144         I do not know what I was smoking when I used that.
19145
19146
19147         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
19148         step into fixing the name resolution issues for delegates and
19149         unifying the toplevel name resolution.
19150
19151 2002-03-28  Martin Baulig  <martin@gnome.org>
19152
19153         * class.cs (Method.Emit): If we have a symbol writer, call its
19154         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
19155         tell it about the current method.
19156
19157         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
19158         writer that we're going to emit the first byte of IL code for a new
19159         statement (a new source line).
19160         (EmitContext.EmitTopBlock): If we have a symbol writer, call
19161         EmitContext.Mark() before emitting any code.
19162
19163         * location.cs (SymbolDocument): Return null when we're Null.
19164
19165         * statement.cs (Statement): Moved the `Location loc' variable here.
19166         (Statement.EmitBoolExpression): If we have a symbol writer, call
19167         ec.Mark() before emitting any code to tell it that we're at the
19168         beginning of a new statement.
19169         (StatementExpression): Added `Location' argument to the constructor.
19170         (Block): Added public readonly variable `StartLocation' and public
19171         variable `EndLocation'.  The latter is to be set using SetEndLocation().
19172         (Block): Added constructor which takes a start and end location.
19173         (Block.SetEndLocation): New method. This sets the end location.
19174         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
19175         local variables we create.
19176         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
19177         each statement and do also mark the begin and end of the block.
19178
19179         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
19180         tell it the current lexer.Location, use Location.Null for the end of the
19181         block.
19182         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
19183         current block, set its end location using SetEndLocation().
19184         (statement_expression): StatementExpression constructor now takes the
19185         lexer.Location as additional argument.
19186         (for_statement, declare_local_variables): Likewise.
19187         (declare_local_variables): When creating a new implicit block, use the
19188         new Block constructor and pass it the lexer.Location.
19189
19190 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19191
19192         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
19193         members also on the parent interfaces recursively.
19194
19195 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
19196
19197         * report.cs: Use new formats, since Gonzalo finished the missing
19198         bits. 
19199
19200         * expression.cs (Binary.ResolveOperator): added missing operator|
19201         operator& and operator^ for bool/bool.
19202
19203         * cs-parser.jay: CheckDef now takes a Location argument that is
19204         used to report errors more precisly (instead of reporting the end
19205         of a definition, we try to track something which is a lot closer
19206         to the source of the problem).
19207
19208         * cs-tokenizer.cs: Track global token use, so we can properly flag
19209         the use of #define/#undef after the first token has been seen.
19210
19211         Also, rename the reportXXXX to Error_DescriptiveName
19212
19213         * decl.cs (DeclSpace.IsTopLevel): Move property here from
19214         TypeContainer, so that Enum and Interface can use this too.
19215
19216         * class.cs (TypeContainer.LookupInterfaceOrClass,
19217         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
19218         `builder' argument.  Typically this was used to pass the parent
19219         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
19220         the definition).  
19221
19222         The problem is that a nested class could trigger the definition of
19223         a toplevel class, and the builder would be obviously wrong in that
19224         case. 
19225
19226         So we drop this argument, and we compute dynamically the
19227         TypeBuilder/ModuleBuilder (the correct information was available
19228         to us anyways from DeclSpace.Parent)
19229
19230         * interface.cs (Interface.DefineInterface): Drop builder
19231         parameter cleanup like class.cs
19232
19233         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
19234         like class.cs
19235
19236         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
19237         values. 
19238
19239         (Try.Emit): Propagate the returns value from the statement.
19240
19241         (Return.Emit): Even if we are leavning 
19242
19243         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
19244
19245         * modifiers.cs: Fix the computation of MethodAttributes flags.
19246
19247 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
19248
19249         * driver.cs: allow compilation of files that start with '/'.
19250         Add a default case when checking the argument of --target.
19251
19252 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
19253
19254         * interface.cs: Implement the same search algorithm for types in
19255         the interface code.
19256
19257         * delegate.cs: Do not allow multiple definition.
19258
19259         * Recovered ChangeLog that got accidentally amputated
19260
19261         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
19262
19263         * rootcontext.cs: Load manually enum to allow core classes to
19264         contain enumerations.
19265
19266         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
19267         Update to new static methods in TypeManager.
19268
19269         * typemanager.cs (GetMethod, GetConstructor): Use our
19270         implementation of FindMembers to find the members, since during
19271         corlib compilation, the types are TypeBuilders and GetMethod and
19272         GetConstructor do not work.
19273
19274         Make all methods in TypeManager static.
19275
19276         (InitCodeHelpers): Split the functionality from
19277         the InitCodeTypes function.
19278
19279         * driver.cs: Call InitCodeHelpers after we have populated the
19280         types. 
19281
19282         * cs-parser.jay (delegate_declaration): we did not used to compute
19283         the delegate name correctly for void delegates.
19284
19285 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
19286
19287         * rootcontext.cs (RootContext): Init the interface_resolve_order
19288         and type_container_resolve_order always.
19289
19290         (ResolveCore, BootstrapCorlib_ResolveClass,
19291         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19292         compiler when compiling with --nostdlib
19293
19294         * class.cs (TypeContainer.DefineType): Check that our parent is
19295         not null.  This test is most important when we are bootstraping
19296         the core types.
19297
19298         * codegen.cs: Split out the symbol writing code.
19299
19300 2002-03-25  Martin Baulig  <martin@gnome.org>
19301
19302         * driver.cs (-g): Made -g an alias for --debug.
19303
19304 2002-03-24  Martin Baulig  <martin@gnome.org>
19305
19306         * codegen.cs (SymbolWriter): New public variable. Returns the
19307         current symbol writer.
19308         (CodeGen): Added `bool want_debugging_support' argument to the
19309          constructor. If true, tell the ModuleBuild that we want debugging
19310         support and ask it for the ISymbolWriter.
19311         (Save): If we have a symbol writer, call it's Close() method after
19312         saving the assembly.
19313
19314         * driver.c (--debug): New command line argument to create a
19315         debugger information file.
19316
19317         * location.cs (SymbolDocument): New public property. Returns an
19318         ISymbolDocumentWriter object for the current source file or null
19319         if we don't have a symbol writer.
19320
19321 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
19322
19323         * driver.cs (LoadAssembly): Correctly return when all the paths
19324         have been tried and not before.
19325
19326         * statement.cs (Switch.Emit): return the actual coverage for this
19327         statement (returns/not-returns)
19328
19329         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19330         switch of the statement if we are the last switch section.  That
19331         kills two problems: try/catch problems (we used to emit an empty
19332         nop at the end) and switch statements where all branches would
19333         return. 
19334
19335 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
19336
19337         * driver.cs: Add default assemblies (the equivalent to the
19338         Microsoft CSC.RSP file)
19339
19340         * cs-tokenizer.cs: When updating `cols and setting it to zero,
19341         also update tokens_seen and set it to false.
19342
19343         * driver.cs: Implement --recurse for Mike.
19344
19345         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19346         correctly splitting out the paths.
19347
19348 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
19349
19350         * interface.cs (Interface.PopulateProperty): Instead of using
19351         `parent' as the declaration space for the set parameters, use
19352         `this' 
19353
19354         * support.cs (InternalParameters): InternalParameters constructor
19355         takes a DeclSpace instead of a TypeContainer.
19356
19357         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
19358         types are being initialized, load the address of it before calling
19359         the function.  
19360
19361         (New): Provide a mechanism to disable the generation of local
19362         value type temporaries when the caller will be providing us with
19363         an address to store it.
19364
19365         (ArrayCreation.EmitDynamicInitializers): Use it.
19366
19367 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
19368
19369         * expression.cs (Invocation.EmitArguments): Only probe for array
19370         property if there is more than one argument.  Sorry about that.
19371
19372         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19373         empty param arrays.
19374
19375         * class.cs (Method.LabelParameters): Fix incorrect code path that
19376         prevented the `ParamArrayAttribute' from being applied to the
19377         params attribute.
19378
19379 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
19380
19381         * support.cs (ReflectionParameters): Correctly compute whether the
19382         last argument is a params array.  Fixes the problem with
19383         string.Split ('a')
19384
19385         * typemanager.cs: Make the assemblies array always be non-null
19386         (empty, but non-null)
19387
19388         * tree.cs (RecordDecl): New function that abstracts the recording
19389         of names.  This reports error 101, and provides a pointer to the
19390         previous declaration.  Fixes a crash in the compiler.
19391
19392         * cs-parser.jay (constructor_declaration): Update to new grammar,
19393         and provide a constructor_body that can be empty.
19394
19395 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
19396
19397         * driver.cs: Add support for --resources.
19398
19399         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19400         Make all types for the various array helper methods be integer.
19401
19402         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19403         CheckState to ConvCast.
19404
19405         (ConvCast): Now it takes a `checked' state argument, to avoid
19406         depending on the emit context for the conversion, and just using
19407         the resolve time setting.
19408
19409         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19410         instead of Invocation.EmitArguments.  We do not emit the original
19411         arguments, instead we emit those which have been converted to
19412         unsigned int expressions.
19413
19414         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19415
19416         * codegen.cs: ditto.
19417
19418         * expression.cs (LocalVariableReference): Drop the use of the
19419         Store function that depended on the variable index.
19420
19421         * statement.cs (VariableInfo): Drop the `Idx' property from this
19422         class, as this is not taking into account the indexes for
19423         temporaries tat we generate during the execution, getting the
19424         indexes wrong.
19425
19426         * class.cs: First emit class initializers, then call the parent
19427         constructor. 
19428
19429         * expression.cs (Binary): Fix opcode emision.
19430         (UnaryMutator.EmitCode): Support checked code generation
19431
19432         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19433         matches for events for both the Static and Instance scans,
19434         pointing to the same element.   Fix that.
19435
19436 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
19437
19438         * rootcontext.cs (ResolveTree): Always set the
19439         interface_resolve_order, because nested interfaces will be calling
19440         into us.
19441
19442         * class.cs (GetInterfaceOrClass): Track the same resolution
19443         process used by TypeManager.LookupType.  This fixes the nested
19444         type lookups in class declarations (separate path from
19445         LookupType). 
19446
19447         (TypeContainer.DefineType): Also define nested interfaces.
19448         (TypeContainer.RegisterOrder): New public function used to
19449         register the order in which child interfaces need to be closed.
19450
19451         Nested interfaces need to be closed after their parents have been
19452         created. 
19453
19454         * interface.cs (InterfaceAttr): Put all the logic for computing
19455         the interface attribute here. 
19456
19457         (DefineInterface): Register our interface order with the
19458         RootContext or with the TypeContainer depending on the case.
19459
19460 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19461
19462         * cs-parser.jay: rework foreach statement to work with the new
19463         changes to the policy on SimpleNames.
19464
19465         * report.cs: support Stacktrace on warnings as well.
19466
19467         * makefile: drop --unsafe and /unsafe from the compile.
19468
19469 2002-03-13  Ravi Pratap  <ravi@ximian.com>
19470
19471         * ecore.cs (StandardConversionExists): Modify to take an Expression
19472         as the first parameter. Ensure we do null -> reference type conversion
19473         checking.
19474
19475         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19476         temporary Expression objects.
19477
19478 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19479
19480         * interface.cs: workaround bug in method overloading resolution
19481         (there is already a bugzilla bug for it).
19482
19483 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19484
19485         We could also solve this problem by having a separate path for
19486         performing type lookups, instead of DoResolve, we could have a
19487         ResolveType entry point, and only participating pieces of the
19488         production (simplename, deref, array) would implement this. 
19489
19490         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19491         signal SimpleName to only resolve type names and not attempt to
19492         resolve anything else.
19493
19494         * expression.cs (Cast): Set the flag.
19495
19496         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19497
19498         * class.cs: Only report 108 if there is no `new' modifier.
19499
19500         * cs-parser.jay: rework foreach statement to work with the new
19501         changes to the policy on SimpleNames.
19502         
19503         * report.cs: support Stacktrace on warnings as well.
19504
19505         * makefile: drop --unsafe and /unsafe from the compile.
19506
19507 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
19508
19509         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19510         lookups here, instead of doing that at parse time.  This means
19511         that our grammar will not introduce `LocalVariableReferences' as
19512         expressions at this point.  That solves the problem of code like
19513         this:
19514
19515         class X {
19516            static void Main ()
19517            { int X = 1;
19518             { X x = null }}}
19519
19520         This is only half the fix.  The full fix requires parameters to
19521         also be handled in this way.
19522
19523         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19524         makes the use more obvious of the DeclSpace.  The
19525         ec.TypeContainer.TypeBuilder is now only used to pull the
19526         TypeBuilder for it.
19527
19528         My theory is that I can get rid of the TypeBuilder completely from
19529         the EmitContext, and have typecasts where it is used (from
19530         DeclSpace to where it matters).  
19531
19532         The only pending problem is that the code that implements Aliases
19533         is on TypeContainer, and probably should go in DeclSpace.
19534
19535         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19536         lookups here, instead of doing that at parse time.  This means
19537         that our grammar will not introduce `LocalVariableReferences' as
19538         expressions at this point.  That solves the problem of code like
19539         this:
19540
19541         class X {
19542            static void Main ()
19543            { int X = 1;
19544             { X x = null }}}
19545
19546         This is only half the fix.  The full fix requires parameters to
19547         also be handled in this way.
19548
19549         * class.cs (Property.DefineMethod): When implementing an interface
19550         method, set newslot, when implementing an abstract method, do not
19551         set the flag (before we tried never setting it, or always setting
19552         it, which is the difference).
19553         (Indexer.DefineMethod): same.
19554         (Method.DefineMethod): same.
19555
19556         * ecore.cs: Only set the status used flag if we get back a Field.
19557
19558         * attribute.cs: Temporary hack, so Paolo can keep working.
19559
19560 2002-03-08  Ravi Pratap  <ravi@ximian.com>
19561
19562         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19563         the unmanaged type in the case we have a MarshalAs attribute.
19564
19565         (Resolve): Handle the case when we are parsing the special MarshalAs
19566         attribute [we need to store the unmanaged type to use later]
19567
19568         * typemanager.cs (marshal_as_attr_type): Built in type for the 
19569         MarshalAs Attribute.
19570
19571         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
19572         on parameters and accordingly set the marshalling info.
19573
19574 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
19575
19576         * class.cs: Optimizing slightly by removing redundant code after
19577         we switched to the `NoTypes' return value.
19578         (Property.DefineMethod): use NoTypes here too.
19579
19580         This fixes the bug I introduced in my last batch of changes.
19581
19582 2002-03-05  Ravi Pratap  <ravi@ximian.com>
19583
19584         * tree.cs (RecordEnum): Add. We now keep track of enums too.
19585
19586         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19587         Enums since those are types too. 
19588
19589         * cs-parser.jay (enum_declaration): Record enums as we parse them.
19590
19591         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
19592         thanks to a call during the lookup process.
19593
19594 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
19595
19596         * statement.cs (Foreach): Lots of work to accomodate a particular
19597         kind of foreach statement that I had not kept in mind.  It is
19598         possible to have foreachs on classes that provide a GetEnumerator
19599         method that return objects that implement the "pattern" for using
19600         a foreach, there is no need to support GetEnumerator
19601         specifically. 
19602
19603         This is needed to compile nant.
19604
19605         * decl.cs: Only report 114 if the member is not `Finalize' and if
19606         the warning level is at least 2.
19607
19608         * class.cs: Moved the compare function from Method to
19609         MethodSignature. 
19610
19611         (MethodSignature.InheritableMemberSignatureCompare): Add new
19612         filter function that is used to extract inheritable methods from a
19613         class. 
19614
19615         (Method.Define): Use the new `inheritable_method_signature_filter'
19616         delegate
19617
19618         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
19619         command. 
19620
19621 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
19622
19623         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
19624
19625         * cs-parser.jay: Add opt_semicolon to the interface declaration.
19626
19627         * expression.cs: Pass location information to
19628         ConvertImplicitStandard. 
19629
19630         * class.cs: Added debugging code to track return values from
19631         interfaces. 
19632
19633 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
19634
19635         * expression.cs (Is.DoResolve): If either side of the `is' is an
19636         interface, do not flag the warning.
19637
19638         * ecore.cs (ImplicitReferenceConversion): We need a separate test
19639         for interfaces
19640
19641         * report.cs: Allow for --fatal to be used with --probe.
19642
19643         * typemanager.cs (NoTypes): Move the definition for the empty Type
19644         array here. 
19645
19646         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
19647         properties. 
19648         (TypeContainer.DefineProxy): New function used to proxy to parent
19649         implementations when implementing interfaces.
19650         (TypeContainer.ParentImplements): used to lookup if our parent
19651         implements a public function that is required by an interface.
19652         (TypeContainer.VerifyPendingMethods): Hook this up.
19653
19654         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
19655         `modules' and `assemblies' arraylists into arrays.  We only grow
19656         these are the very early start up of the program, so this improves
19657         the speedof LookupType (nicely measured).
19658
19659         * expression.cs (MakeByteBlob): Replaced unsafe code with
19660         BitConverter, as suggested by Paolo.
19661
19662         * cfold.cs (ConstantFold.Binary): Special case: perform constant
19663         folding of string concatenation, but if either side is a string,
19664         and the other is not, then return null, and let the runtime use
19665         the concatenation on the string plus the object (using
19666         `Object.ToString'). 
19667
19668 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
19669
19670         Constant Folding has been implemented now.
19671
19672         * expression.cs (Unary.Reduce): Do not throw an exception, catch
19673         the error instead on types that are not supported in one's
19674         complement. 
19675
19676         * constant.cs (Constant and all children): New set of functions to
19677         perform implict and explicit conversions.
19678
19679         * ecore.cs (EnumConstant): Implement the new functions to perform
19680         conversion by proxying to the child expression.
19681
19682         * codegen.cs: (ConstantCheckState): Constant evaluation has its
19683         own separate setting that can not be turned off from the command
19684         line using --unchecked or --checked and is only controlled using
19685         the checked/unchecked statements and expressions.  This setting is
19686         used by the constant folder to flag errors.
19687
19688         * expression.cs (CheckedExpr, UncheckedExpr): Set the
19689         ConstantCheckState as well.   
19690
19691         During Resolve, they also have to flag the state, because the
19692         constant folder runs completely in the Resolve phase.
19693
19694         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
19695         well.
19696
19697 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
19698
19699         * cfold.cs: New file, this file contains the constant folder.
19700
19701         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
19702         argument to track whether we are using the resulting address to
19703         load or store a value and provide better error messages. 
19704
19705         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
19706         new AddressOf arguments.
19707
19708         * statement.cs (Foreach.EmitCollectionForeach): Update
19709
19710         * expression.cs (Argument.Emit): Call AddressOf with proper
19711         arguments to track usage.
19712
19713         (New.DoEmit): Call AddressOf with new arguments.
19714
19715         (Unary.Emit): Adjust AddressOf call.
19716
19717 2002-03-01  Ravi Pratap  <ravi@ximian.com>
19718
19719         * cs-parser.jay (member_access): Change the case for pre-defined types
19720         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
19721         this suggestion.
19722
19723         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
19724         a method body.
19725
19726         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
19727         essentially like methods and apply attributes like MethodImplOptions to them too.
19728
19729         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
19730         not being null.
19731
19732         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
19733         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
19734         is the DeclSpace.
19735
19736         * Update code everywhere accordingly.
19737
19738         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
19739
19740         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
19741
19742 2002-02-28  Ravi Pratap  <ravi@ximian.com>
19743
19744         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
19745         try performing lookups against those instead of jumping straight into using
19746         the 'using' clauses.
19747
19748         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
19749
19750         (LookupType): Perform lookups in implicit parents too.
19751
19752         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
19753         sequence as RootContext.LookupType. 
19754
19755         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
19756         the various cases of namespace lookups into this method.
19757
19758 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
19759
19760         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
19761         in positional arguments)
19762
19763         * class.cs (Operator): Update the AllowedModifiers to contain
19764         extern. 
19765
19766         * cs-parser.jay: Update operator declaration to allow for the
19767         operator body to be empty.
19768
19769         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
19770         values. 
19771
19772 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
19773
19774         * class.cs (Method.Emit): Label parameters.
19775
19776         * driver.cs: Return 1 or 0 as the program exit code.
19777
19778 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
19779
19780         * expression.cs: Special case the `null' object when trying to
19781         auto-compute the type, as anything can be explicitly converted to
19782         that. 
19783
19784         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
19785         spotting this Paolo.
19786
19787         (Expression.ImplicitNumericConversion): Perform comparissions of
19788         the type using the underlying type in the case of an enumeration
19789         rather than using the enumeration type for the compare.
19790
19791         Cope with the underlying == type case, which is not possible to
19792         catch before. 
19793
19794         (Expression.ConvertNumericExplicit): Perform comparissions of
19795         the type using the underlying type in the case of an enumeration
19796         rather than using the enumeration type for the compare.
19797
19798         * driver.cs: If the user does not supply an extension, assume .exe
19799
19800         * cs-parser.jay (if_statement): Rewrote so that we can track the
19801         location for the if statement.
19802
19803         * expression.cs (Binary.ConstantFold): Only concat strings when
19804         the operation is "+", not everything ;-)
19805
19806         * statement.cs (Statement.EmitBoolExpression): Take a location
19807         argument. 
19808         (If, While, Do): Track location.
19809
19810         * expression.cs (Binary.ResolveOperator): In the object + string
19811         case, I was missing a call to ConvertImplicit
19812
19813 2002-02-25  Ravi Pratap  <ravi@ximian.com>
19814
19815         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
19816         Location arguments. Ensure we use RootContext.LookupType to do our work
19817         and not try to do a direct Type.GetType and ModuleBuilder.GetType
19818
19819         * interface.cs (PopulateMethod): Handle the type of the parameter being
19820         null gracefully.
19821
19822         * expression.cs (Invocation.BetterFunction): Handle the case when we 
19823         have a params method with no fixed arguments and a call is made with no
19824         arguments.
19825
19826 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
19827
19828         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
19829         the verbatim-string-literal
19830
19831         * support.cs (InternalParameters.ParameterModifier): handle null
19832         fixed parameters.
19833         (InternalParameters.ParameterType): ditto.
19834
19835         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
19836         duplicating the name of the variable parameter.
19837         (GetParameterByName): Fix bug where we were not looking up array
19838         paramters if they were the only present (thanks Paolo!).
19839         (GetParameterInfo): We only have an empty set of types if both
19840         fixed and array are set to null.
19841         (GetParameterInfo-idx): Handle FixedParameter == null
19842
19843         * cs-parser.jay: Handle the case where there is no catch
19844         statements (missing null test).
19845
19846 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
19847
19848         * driver.cs (MainDriver): Be conservative on our command line
19849         handling.
19850
19851         Catch DirectoryNotFoundException when calling GetFiles.
19852
19853         (SplitPathAndPattern): Used to split the input specification into
19854         a path and a pattern that we can feed to Directory.GetFiles.
19855
19856 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
19857
19858         * statement.cs (Fixed): Implement the last case of the Fixed
19859         statement (string handling).
19860
19861         * expression.cs (StringPtr): New class used to return a char * to
19862         a string;  Used by the Fixed statement.
19863
19864         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
19865
19866         * expression.cs (Binary.ResolveOperator): Remove redundant
19867         MemberLookup pn parent type.
19868         Optimize union call, we do not need a union if the types are the same.
19869         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
19870         type.
19871
19872         Specialize the use of MemberLookup everywhere, instead of using
19873         the default settings. 
19874
19875         (StackAlloc): Implement stackalloc keyword.
19876
19877         * cs-parser.jay: Add rule to parse stackalloc.
19878
19879         * driver.cs: Handle /h, /help, /?
19880
19881         * expression.cs (MakeByteBlob): Removed the hacks we had in place
19882         before we supported unsafe code.
19883
19884         * makefile: add --unsafe to the self compilation of mcs.
19885
19886 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
19887
19888         * expression.cs (PointerArithmetic): New class that is used to
19889         perform pointer arithmetic.
19890         (Binary.Resolve): Handle pointer arithmetic
19891         Handle pointer comparission.
19892         (ArrayPtr): Utility expression class that is used to take the
19893         address of an array.
19894
19895         (ElementAccess): Implement array access for pointers
19896
19897         * statement.cs (Fixed): Implement fixed statement for arrays, we
19898         are missing one more case before we are done.
19899
19900         * expression.cs (Indirection): Implement EmitAssign and set the
19901         ExprClass to Variable.  This allows pointer dereferences to be
19902         treated as variables, and to have values assigned to them.
19903
19904         * ecore.cs (Expression.StoreFromPtr): New utility function to
19905         store values dereferencing.
19906
19907 2002-02-20  Ravi Pratap  <ravi@ximian.com>
19908
19909         * expression.cs (Binary.ResolveOperator): Ensure that we are
19910         not trying to operate on a void type - this fixes the reported
19911         bug.
19912
19913         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
19914         the parent implementation is sealed.
19915
19916         * ../errors/cs0239.cs : Add.
19917
19918         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
19919
19920         * typemanager.cs (unverifiable_code_type): Corresponds to 
19921         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
19922         which have unsafe code in them.
19923
19924         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
19925         unsafe context.
19926
19927 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
19928
19929         * cs-tokenizer.cs: Add support for @"litreal strings"
19930
19931         Make tokenizer accept pre-processor directives
19932         on any column (remove the old C-like limitation). 
19933
19934         * rootcontext.cs (EmitCode): Emit any global attributes.
19935         (AddGlobalAttributes): Used to keep track of assembly attributes. 
19936
19937         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
19938
19939         * cs-parser.jay: Add support for global attributes.  
19940
19941 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
19942
19943         * expression.cs (Indirection): New helper class.  Unary will
19944         create Indirection classes to be able to implement the
19945         IMemoryLocation interface on it.
19946
19947 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
19948
19949         * cs-parser.jay (fixed_statement): reference the right statement.
19950
19951         * statement.cs (Fixed.Emit): Finish implementing the fixed
19952         statement for the &x case.
19953
19954 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
19955
19956         * class.cs (Property.Define, Method.Define): Remove newslot when
19957         `implementing'.  
19958
19959         * modifiers.cs: My use of NewSlot when `Abstract' was set was
19960         wrong.  NewSlot should only be used if the `new' keyword is present.
19961
19962         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
19963         locating our system dir.  Sorry about this.
19964
19965 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
19966
19967         * driver.cs (GetSystemDir): Compute correctly the location of our
19968         system assemblies.  I was using the compiler directory instead of
19969         the library directory.
19970
19971 2002-02-13  Ravi Pratap  <ravi@ximian.com>
19972
19973         * expression.cs (BetterFunction): Put back in what Miguel commented out
19974         since it is the correct fix. The problem is elsewhere ;-)
19975
19976         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
19977         parameters of the parms method are themselves compatible or not !
19978
19979         (StandardConversionExists): Fix very dangerous bug where we were forgetting
19980         to check that a class implements an interface before saying that an implicit
19981         conversion was allowed. Use ImplementsInterface to do the checking.
19982
19983 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
19984
19985         * class.cs (Method.Define): Track whether we are an explicit
19986         implementation or not.  And only call DefineMethodOverride if we
19987         are an explicit implementation.
19988
19989         (Property.DefineMethod): Ditto.
19990
19991 2002-02-11  Ravi Pratap  <ravi@ximian.com>
19992
19993         * expression.cs (BetterFunction): Catch hideous bug which was
19994          preventing us from detecting ambiguous calls due to implicit casts i.e
19995         cs0121.
19996
19997 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
19998
19999         * support.cs (Pair): Remove un-needed method.  I figured why I was
20000         getting the error in cs-parser.jay, the variable in a foreach loop
20001         is readonly, and the compiler does not really treat this as a variable.
20002
20003         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
20004         instead of EQUALS in grammar.  
20005
20006         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
20007
20008         * expression.cs (Unary.DoResolve): Check whether the argument is
20009         managed or not.
20010
20011 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
20012
20013         * support.cs: Api for Pair to set a value.  Despite the fact that
20014         the variables are public the MS C# compiler refuses to compile
20015         code that accesses the field if the variable is part of a foreach
20016         statement. 
20017
20018         * statement.cs (Fixed): Begin implementation of the fixed
20019         statement.
20020
20021         (Block.AddVariable): Return the VariableInfo on success and null
20022         on failure instead of true/false. 
20023
20024         * cs-parser.jay (foreach): Catch errors on variables already
20025         defined (we were ignoring this value before) and properly unwind
20026         the block hierarchy
20027
20028         (fixed_statement): grammar for the fixed statement.
20029
20030 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
20031
20032         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
20033         pointer types to be incretemented.
20034
20035         (SizeOf): Implement.
20036
20037         * cs-parser.jay (pointer_member_access): Implement
20038         expr->IDENTIFIER production.
20039
20040         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
20041         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
20042         on safe contexts.
20043
20044         (Unary): Implement indirection.
20045
20046         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
20047         use in non-unsafe context).
20048
20049         (SimpleName.DoResolve): Check for pointers in field access on safe
20050         contexts. 
20051
20052         (Expression.LoadFromPtr): Factor the load-indirect code in this
20053         function.  This was duplicated in UnboxCast and ParameterReference
20054
20055 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
20056
20057         * expression.cs (ComposedCast): report an error if a pointer cast
20058         is used in a safe region.
20059
20060         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
20061         pointer type casts in unsafe context.
20062
20063         * codegen.cs (EmitContext): Set up IsUnsafe.
20064
20065         * cs-parser.jay (non_expression_type): Add productions for pointer
20066         casts. 
20067
20068         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
20069         code.  We should not use force into static mode if the method is
20070         not virtual.  Fixes bug in MIS
20071
20072         * statement.cs (Do.Emit, While.Emit, For.Emit,
20073         Statement.EmitBoolExpression): Add support to Do and While to
20074         propagate infinite loop as `I do return' semantics.
20075
20076         Improve the For case to also test for boolean constants.
20077
20078         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
20079         to the list of attributes we can add.
20080
20081         Remove `EmitContext' argument.
20082
20083         * class.cs (Method.Define): Apply parameter attributes.
20084         (Constructor.Define): Apply parameter attributes.
20085         (MethodCore.LabelParameters): Move here the core of labeling
20086         parameters. 
20087
20088         * support.cs (ReflectionParameters.ParameterModifier,
20089         InternalParameters.ParameterModifier): Use IsByRef on the type and
20090         only return the OUT bit for these parameters instead of in/out/ref
20091         flags.
20092
20093         This is because I miss-understood things.  The ParameterInfo.IsIn
20094         and IsOut represent whether the parameter has the [In] and [Out]
20095         attributes set.  
20096
20097 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
20098
20099         * ecore.cs (FieldExpr.Emit): Release temporaries.
20100
20101         * assign.cs (LocalTemporary.Release): new function.
20102
20103         * codegen.cs (EmitContext.GetTemporaryStorage,
20104         EmitContext.FreeTemporaryStorage): Rework the way we deal with
20105         temporary storage.  Now we can "put back" localbuilders when we
20106         are done with them
20107
20108 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
20109
20110         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
20111         need to make a copy of the variable to generate verifiable code.
20112
20113 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
20114
20115         * driver.cs: Compute dynamically the system directory.
20116
20117         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
20118         Slower, but more generally useful.  Used by the abstract
20119         registering implementation. 
20120
20121         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
20122         the rules for the special rule on Type/instances.  First check if
20123         we have the same name, and if so, try that special static path
20124         rather than the instance path.
20125
20126 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
20127
20128         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
20129         for, while and if.
20130
20131         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
20132         Enum, ValueType, Delegate or Array for non-corlib compiles.
20133
20134         * cs-tokenizer.cs: Catch long identifiers (645)
20135
20136         * typemanager.cs (IndexerPropetyName): Ravi never tested this
20137         piece of code.
20138
20139         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
20140         fix, we were returning too early, so we were not registering
20141         pending methods from abstract classes.
20142
20143         Do not register pending methods if the class is abstract.
20144
20145         * expression.cs (Conditional.DoResolve): Report circular implicit
20146         conversions when we neecd to compute it for conditional
20147         expressions. 
20148
20149         (Is.DoResolve): If the expression is always of the provided type,
20150         flag warning 183.  If the expression can not ever be of the
20151         provided type flag warning 184.
20152
20153         * class.cs: Catch 169 as well.
20154
20155         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
20156         read. 
20157
20158 2002-01-18  Nick Drochak  <ndrochak@gol.com>
20159
20160         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
20161
20162 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
20163
20164         * interface.cs: (PopulateMethod): Check for pointers being defined
20165         only if the unsafe context is active.
20166         (PopulateProperty): ditto.
20167         (PopulateIndexer): ditto.
20168
20169         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
20170         specified.  If pointers are present, make sure that they are
20171         present in an unsafe context.
20172         (Constructor, Constructor.Define): ditto.
20173         (Field, Field.Define): ditto.
20174         (Property, Property.Define): ditto.
20175         (Event, Event.Define): ditto.
20176
20177         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
20178         hashtable if there are classes or structs defined.
20179
20180         * expression.cs (LocalVariableReference.DoResolve): Simplify this
20181         code, as the constant resolution moved.
20182
20183         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
20184         the metadata, so we can flag error 133. 
20185
20186         * decl.cs (MemberCore.UnsafeOK): New function to test that a
20187         pointer is being declared in an unsafe context.
20188
20189 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
20190
20191         * modifiers.cs (Modifiers.Check): Require a Location argument.
20192         Report error 227 for Unsafe use.
20193
20194         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
20195
20196         * statement.cs (For.Emit): If the test is null, then report that
20197         we do `return', as we wont reach anything afterwards.
20198
20199         (Switch.SwitchGoverningType): Track the expression that matched
20200         the conversion.
20201
20202         * driver.cs: Allow negative numbers as an error code to flag.
20203
20204         * cs-parser.jay: Handle 1551.
20205
20206         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
20207
20208 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20209
20210         * cs-parser.jay: Report 1518 (type declaration can only contain
20211         class, struct, interface, enum or delegate)
20212
20213         (switch_label): Report 1523 (keywords `case' or `default' must
20214         preced code)
20215
20216         (opt_switch_sections): Report 1522 (empty switch)
20217
20218         * driver.cs: Report 1515 (response file specified multiple times)
20219         Report 1516 (Source file specified multiple times).
20220
20221         * expression.cs (Argument.Resolve): Signal 1510
20222
20223         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
20224         access not allowed in static code)
20225
20226 2002-01-11  Ravi Pratap  <ravi@ximian.com>
20227
20228         * typemanager.cs (IsPointerType): Utility method which we are going
20229         to need a lot.
20230
20231         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
20232         the object type, so we take care of that.
20233
20234         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
20235
20236         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
20237         added to non-params parameters :-)
20238
20239         * typemanager.cs (CSharpName): Include 'void' type too. 
20240
20241         (void_ptr_type): Include in the set of core types.
20242
20243         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
20244         duplicating code.
20245
20246         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
20247         an unsafe context.
20248
20249         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
20250         completely forgotten about it.
20251
20252 2002-01-10  Ravi Pratap  <ravi@ximian.com>
20253
20254         * cs-parser.jay (pointer_type): Add. This begins our implementation
20255         of parsing rules for unsafe code.
20256
20257         (unsafe_statement): Implement.
20258
20259         (embedded_statement): Modify to include the above.
20260
20261         * statement.cs (Unsafe): Implement new class for unsafe blocks.
20262
20263         * codegen.cs (EmitContext.InUnsafe): Add. This determines
20264         if the current context is an unsafe one.
20265
20266         * cs-parser.jay (local_variable_pointer_type): Since local variable types
20267         are handled differently, we need separate rules for them.
20268
20269         (local_variable_declaration): Update to use local_variable_pointer_type
20270         to allow variable declarations of unmanaged pointer types.
20271
20272         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
20273         in unsafe contexts.
20274
20275         * ../errors/cs0214.cs : Add.
20276
20277 2002-01-16  Nick Drochak  <ndrochak@gol.com>
20278
20279         * makefile: remove 'response' file when cleaning.
20280
20281 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20282
20283         * cs-parser.jay: Report 1524.
20284
20285 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
20286
20287         * typemanager.cs (RegisterMethod): drop checking if we have
20288         registered this from here
20289
20290 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
20291
20292         * class.cs (Method.EmitDestructor): Implement calling our base
20293         destructor. 
20294
20295         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20296         value of InFinally.
20297
20298         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20299         this routine and will wrap the call in a try/catch block.  Deal
20300         with the case.
20301
20302 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
20303
20304         * ecore.cs (Expression.MemberLookup): instead of taking a
20305         parameter `same_type' that was used to tell whether we could
20306         access private members we compute our containing type from the
20307         EmitContext.
20308
20309         (FieldExpr): Added partial support for volatile fields.  This does
20310         not work for volatile fields exposed from assemblies, as I can not
20311         figure out how to extract the modreq from it.
20312
20313         Updated all the source files to use this.
20314
20315         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20316         because it is referenced by MemberLookup very often. 
20317
20318 2002-01-09  Ravi Pratap  <ravi@ximian.com>
20319
20320         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20321         TypeBuilder.GetCustomAttributes to retrieve what we need.
20322
20323         Get rid of redundant default_member_attr_type as this is the same as
20324         default_member_type which already exists.
20325
20326         * interface.cs, attribute.cs : Update accordingly.
20327
20328 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
20329
20330         * typemanager.cs: Enable IndexerPropertyName again.  It does not
20331         work for TYpeBuilders though.  Ravi, can you please fix this?
20332
20333         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20334
20335         * expression.cs (Argument.Emit): Handle the case of ref objects
20336         being passed to ref functions;  
20337
20338         (ParameterReference.EmitLoad): Loads the content of the pointer
20339         without dereferencing.
20340
20341 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20342
20343         * cs-tokenizer.cs: Implemented the pre-processing expressions.
20344
20345 2002-01-08  Ravi Pratap  <ravi@ximian.com>
20346
20347         * class.cs (Indexer.DefineMethod): Incorporate the interface
20348         type in the name of the method if we are doing explicit interface
20349         implementation.
20350
20351         * expression.cs (ConversionExists): Remove as it is completely obsolete.
20352
20353         (BetterConversion): Fix extremely trivial bug where we were referring to
20354         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
20355         again !
20356
20357         * ../errors/bug16.cs : Add although we have fixed it.
20358
20359 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20360
20361         * expression.cs (BaseIndexer): Begin implementation.
20362
20363         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
20364
20365         * cs-parser.jay (indexer_declarator): Use qualified_identifier
20366         production directly to remove a shift/reduce, and implement
20367         explicit interface implementation.
20368
20369         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
20370         after a floating point suffix.
20371
20372         * expression.cs (DoNumericPromotions): Improved the conversion for
20373         uint/uint.  If we have a constant, we avoid doing a typecast to a
20374         larger type.
20375
20376         * class.cs (Indexer): Implement explicit interface implementation
20377         for indexers.
20378
20379 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20380
20381         * class.cs: make the default instance constructor public and hidebysig.
20382
20383 2001-01-03  Ravi Pratap  <ravi@ximian.com>
20384
20385         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20386         so we can call it from elsewhere.
20387
20388         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20389         we emit it internally if the class has a defined indexer; otherwise the user
20390         emits it by decorating the class definition with the DefaultMemberAttribute.
20391
20392         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20393         attribute is not used on a type which defines an indexer.
20394
20395         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20396         character when we skip whitespace.
20397
20398         * ../errors/cs0646.cs : Add.
20399
20400 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
20401
20402         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20403         again. 
20404
20405         * makefile: Add practical target `mcs3.exe' which builds the third
20406         generation compiler. 
20407
20408         * expression.cs (New): Fix structures constructor calling.
20409
20410         * class.cs (Property, Method, Indexer): Emit Final flag on the
20411         method if we are an interface implementation and we are not
20412         abstract. 
20413
20414         * ecore.cs (PropertyExpr): New public field `IsBase', tells
20415         whether this property is referencing a `base' method.
20416
20417         * expression.cs (Invocation.EmitCall): take an extra argument:
20418         is_base, this is used to determine whether the `call' or
20419         `callvirt' opcode should be used.
20420
20421
20422         * delegate.cs: update EmitCall.
20423
20424         * class.cs (Method.Define): Set NewSlot for the cases where we are
20425         not implementing an interface method.
20426
20427         (Property.Define): ditto.
20428
20429 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
20430
20431         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20432         'r'.  Allows mcs to parse itself fully.
20433
20434 2002-01-02  Ravi Pratap  <ravi@ximian.com>
20435
20436         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20437         of the number of initializers that require the InitializeArray method.
20438
20439         (CheckIndices): Store the Expression in all cases - not the plain value. Also
20440         update the above field where necessary.
20441
20442         (MakeByteBlob): Update accordingly.
20443
20444         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
20445         greater than 2.
20446
20447         (EmitDynamicInitializers): Update in accordance with the new optimization.
20448
20449         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20450         same OpCode applies.
20451
20452         * cs-parser.jay : Fix some glaring errors I introduced.
20453
20454 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
20455
20456         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20457         so that we can check for name clashes there too.
20458
20459         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20460         for interface indexers.
20461
20462         * interfaces.cs (Define): Emit the default member attribute.
20463
20464         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20465         variable was being referred to while setting the value ;-)
20466
20467 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
20468
20469         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20470         byte-by-byte information when we know the data is zero.
20471
20472         Make the block always a multiple of 4, because
20473         DefineInitializedData has a bug.
20474
20475         * assign.cs: Fix, we should assign from the temporary, not from
20476         the source. 
20477
20478         * expression.cs (MakeByteBlob): Fix my incorrect code.
20479
20480 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
20481
20482         * typemanager.cs (EnumToUnderlying): This function is used to get
20483         the underlying type from an enumeration, because it does not
20484         always work. 
20485
20486         * constant.cs: Use the I4_S form for values between -128 and 127.
20487
20488         * statement.cs (Block.LookupLabel): Looks up a label.
20489         (Block): Drop support for labeled blocks.
20490
20491         (LabeledStatement): New kind of statement that represents a label
20492         only.
20493
20494         (Goto): Finally implement this bad boy.
20495
20496         * cs-parser.jay: Update to reflect new mechanism to implement
20497         labels.
20498
20499 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
20500
20501         * codegen.cs (EmitContext.This): a codegen property that keeps the
20502         a single instance of this instead of creating many different this
20503         instances. 
20504
20505         * delegate.cs (Delegate.DoResolve): Update to use the property;
20506
20507         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
20508
20509         * expression.cs (BaseAccess.DoResolve): Ditto.
20510
20511 2001-12-29  Ravi Pratap  <ravi@ximian.com>
20512
20513         * typemanager.cs (methodimpl_attr_type): Add to hold the type
20514         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20515
20516         (InitCoreTypes): Update accordingly.
20517
20518         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20519         so we can quickly store the state.
20520
20521         (ApplyAttributes): Set the correct implementation flags
20522         for InternalCall methods.
20523
20524 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
20525
20526         * expression.cs (EmitCall): if a method is not virtual, then do
20527         not use callvirt on it.
20528
20529         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20530         user defined stuff) requires the use of stobj, which takes an
20531         address on the stack instead of an array and an index.  So emit
20532         the Ldelema operation for it.
20533
20534         (EmitStoreOpcode): Use stobj for valuetypes.
20535
20536         (UnaryMutator.EmitCode): Use the right 1 value depending on
20537         whether we are dealing with int64/uint64, float or doubles.
20538
20539         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20540         constructors that I implemented last night.
20541
20542         (Constructor.IsDefault): Fix to work properly for static
20543         constructors.
20544
20545         * cs-parser.jay (CheckDef): report method signature errors.
20546         Update error number 103 to be 132.
20547
20548         * decl.cs: New AdditionResult enumeration value: MethodExists.
20549         Although we do this check for methods later on in the semantic
20550         analysis, catching repeated default constructors is so easy that
20551         we catch these here. 
20552
20553         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20554         promotions code.
20555
20556         (ParameterReference.EmitAssign, Emit): handle
20557         bools as bytes.
20558
20559         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20560         (ArrayAccess.EmitStoreOpcode): ditto.
20561
20562         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20563
20564         * expression.cs (MakeByteBlob): Complete all the missing types
20565         (uint, short, ushort, byte, sbyte)
20566
20567         * class.cs: Only init instance field initializers on instance
20568         constructors. 
20569
20570         Rename `constructors' to instance_constructors. 
20571
20572         (TypeContainer.AddConstructor): Only add constructors to the list
20573         if it is not static.
20574
20575         Make sure that we handle default_static_constructor independently
20576         everywhere where we handle instance_constructors
20577
20578 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
20579
20580         * class.cs: Do not lookup or create a base initializer for a
20581         static constructor.
20582
20583         (ConstructorInitializer.Resolve): use the proper type to lookup
20584         for constructors.
20585
20586         * cs-parser.jay: Report error 1585 (modifiers between type and name).
20587
20588         * enum.cs, interface.cs: Remove CloseType, this is taken care by
20589         in DeclSpace. 
20590
20591         * decl.cs: CloseType is now an virtual method, the default
20592         implementation just closes this type.
20593
20594 2001-12-28  Ravi Pratap  <ravi@ximian.com>
20595
20596         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
20597         to PreserveSig by default. Also emit HideBySig on such methods.
20598
20599         Basically, set the defaults to standard values.
20600
20601         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
20602         argument, if candidate is better, it can't be worse than the best !
20603
20604         (Invocation): Re-write bits to differentiate between methods being
20605         applicable in their expanded form and their normal form - for params
20606         methods of course.
20607
20608         Get rid of use_standard everywhere as only standard conversions are allowed
20609         in overload resolution. 
20610
20611         More spec conformance.
20612
20613 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20614
20615         * driver.cs: Add --timestamp, to see where the compiler spends
20616         most of its time.
20617
20618         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
20619         `this' in static code.
20620
20621         (SimpleName.DoResolve): Implement in terms of a helper function
20622         that allows static-references to be passed upstream to
20623         MemberAccess.
20624
20625         (Expression.ResolveWithSimpleName): Resolve specially simple
20626         names when called by MemberAccess to implement the special
20627         semantics. 
20628
20629         (Expression.ImplicitReferenceConversion): Handle conversions from
20630         Null to reference types before others, as Null's type is
20631         System.Object. 
20632
20633         * expression.cs (Invocation.EmitCall): Handle the special case of
20634         calling methods declared on a reference type from a ValueType
20635         (Base classes System.Object and System.Enum)
20636
20637         (MemberAccess.Resolve): Only perform lookups on Enumerations if
20638         the left hand side is a TypeExpr, not on every enumeration. 
20639
20640         (Binary.Resolve): If types are reference types, then do a cast to
20641         object on operators != and == of both arguments.
20642
20643         * typemanager.cs (FindMembers): Extract instance and static
20644         members if requested.
20645
20646         * interface.cs (PopulateProperty): Use void_type instead of null
20647         as the return type for the setter method.
20648
20649         (PopulateIndexer): ditto.
20650
20651 2001-12-27  Ravi Pratap  <ravi@ximian.com>
20652
20653         * support.cs (ReflectionParameters): Fix minor bug where we
20654         were examining the wrong parameter for the ParamArray attribute.
20655
20656         Cope with requests for the type of the parameter at position
20657         greater than the params parameter's. We now return the element
20658         type of the params array as that makes more sense.
20659
20660         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
20661         accordingly as we no longer have to extract the element type
20662         ourselves.
20663
20664         (Invocation.OverloadResolve): Update.
20665
20666 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20667
20668         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
20669         against IEnumerator, test whether the return value is a descendant
20670         of the IEnumerator interface.
20671
20672         * class.cs (Indexer.Define): Use an auxiliary method to implement
20673         the other bits of the method definition.  Begin support for
20674         explicit interface implementation.
20675
20676         (Property.DefineMethod): Use TypeManager.void_type instead of null
20677         for an empty return value.
20678
20679 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
20680
20681         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
20682         dealing with a FieldExpr which is composed of a FieldBuilder, in
20683         the code path we did extract the constant, but we should have
20684         obtained the underlying value to be able to cast it (otherwise we
20685         end up in an infinite loop, this is what Ravi was running into).
20686
20687         (ArrayCreation.UpdateIndices): Arrays might be empty.
20688
20689         (MemberAccess.ResolveMemberAccess): Add support for section
20690         14.5.4.1 that deals with the special case of E.I when E is a type
20691         and something else, that I can be a reference to a static member.
20692
20693         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
20694         handle a particular array type to create byte blobs, it is just
20695         something we dont generate byteblobs for.
20696
20697         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
20698         arguments. 
20699
20700         * location.cs (Push): remove the key from the hashtable that we
20701         are about to add.   This happens for empty files.
20702
20703         * driver.cs: Dispose files after we have parsed them.
20704
20705         (tokenize): new function that only runs the tokenizer on its
20706         input, for speed testing.
20707
20708 2001-12-26  Ravi Pratap  <ravi@ximian.com>
20709
20710         * class.cs (Event.Define): Define the private field only if there
20711         are no accessors defined.
20712
20713         * expression.cs (ResolveMemberAccess): If there is no associated
20714         field with the event, that means we have an event defined with its
20715         own accessors and we should flag error cs0070 since transforming
20716         ourselves into a field is not valid in that case.
20717
20718         * ecore.cs (SimpleName.DoResolve): Same as above.
20719
20720         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
20721         and charset to sane values.
20722
20723 2001-12-25  Ravi Pratap  <ravi@ximian.com>
20724
20725         * assign.cs (DoResolve): Perform check on events only if they 
20726         are being accessed outside the declaring type.
20727
20728         * cs-parser.jay (event_declarations): Update rules to correctly
20729         set the type of the implicit parameter etc.
20730
20731         (add_accessor, remove_accessor): Set current local parameters.
20732
20733         * expression.cs (Binary): For delegate addition and subtraction,
20734         cast the return value from the method into the appropriate delegate
20735         type.
20736
20737 2001-12-24  Ravi Pratap  <ravi@ximian.com>
20738
20739         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
20740         of these as the workaround is unnecessary.
20741
20742         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
20743         delegate data - none of that is needed at all.
20744
20745         Re-write bits to extract the instance expression and the delegate method
20746         correctly.
20747
20748         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
20749         on delegates too.
20750
20751         * attribute.cs (ApplyAttributes): New method to take care of common tasks
20752         of attaching attributes instead of duplicating code everywhere.
20753
20754         * everywhere : Update code to do attribute emission using the above method.
20755
20756 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
20757
20758         * expression.cs (IsParamsMethodApplicable): if there are not
20759         parameters, return immediately.
20760
20761         * ecore.cs: The 0 literal can be implicity converted to an enum
20762         type. 
20763
20764         (SimpleName.DoResolve): First lookup the type, then lookup the
20765         members. 
20766
20767         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
20768         want to get its address.  If the InstanceExpression is not
20769         addressable, store the result in a temporary variable, then get
20770         the address of it.
20771
20772         * codegen.cs: Only display 219 errors on warning level or above. 
20773
20774         * expression.cs (ArrayAccess): Make it implement the
20775         IMemoryLocation interface.
20776
20777         (Binary.DoResolve): handle the operator == (object a, object b)
20778         and operator != (object a, object b) without incurring into a
20779         BoxedCast (because 5 != o should never be performed).
20780
20781         Handle binary enumerator operators.
20782
20783         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
20784         value type, otherwise use Ldelem_ref.
20785
20786         Use precomputed names;
20787
20788         (AddressOf): Implement address of
20789
20790         * cs-parser.jay (labeled_statement): Fix recursive block
20791         addition by reworking the production.
20792
20793         * expression.cs (New.DoEmit): New has a special case:
20794                 
20795                  If we are dealing with a ValueType, we have a few
20796                  situations to deal with:
20797                 
20798                     * The target of New is a ValueType variable, that is
20799                       easy, we just pass this as the variable reference
20800                 
20801                     * The target of New is being passed as an argument,
20802                       to a boxing operation or a function that takes a
20803                       ValueType.
20804                 
20805                       In this case, we need to create a temporary variable
20806                       that is the argument of New.
20807
20808
20809 2001-12-23  Ravi Pratap  <ravi@ximian.com>
20810
20811         * rootcontext.cs (LookupType): Check that current_type is not null before
20812         going about looking at nested types.
20813
20814         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
20815         not implement the IAssignMethod interface any more.
20816
20817         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
20818         where we tranform them into FieldExprs if they are being resolved from within
20819         the declaring type.
20820
20821         * ecore.cs (SimpleName.DoResolve): Do the same here.
20822
20823         * assign.cs (DoResolve, Emit): Clean up code considerably. 
20824
20825         * ../errors/bug10.cs : Add.
20826
20827         * ../errors/cs0070.cs : Add.
20828
20829         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
20830
20831         * assign.cs : Get rid of EventIsLocal everywhere.
20832
20833 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
20834
20835         * ecore.cs (ConvertIntLiteral): finished the implementation.
20836
20837         * statement.cs (SwitchLabel): Convert the value we are using as a
20838         key before looking up the table.
20839
20840 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
20841
20842         * codegen.cs (EmitTopBlock): Require a Location argument now.
20843
20844         * cs-parser.jay (constructor_declarator): We need to setup
20845         current_local_parameters before we parse the
20846         opt_constructor_initializer, to allow the variables to be bound
20847         to the constructor arguments.
20848
20849         * rootcontext.cs (LookupType): First lookup nested classes in our
20850         class and our parents before we go looking outside our class.
20851
20852         * expression.cs (ConstantFold): Extract/debox the values at the
20853         beginnning. 
20854
20855         * rootcontext.cs (EmitCode): Resolve the constants first before we
20856         resolve the types.  This is not really needed, but it helps debugging.
20857
20858         * statement.cs: report location.
20859
20860         * cs-parser.jay: pass location to throw statement.
20861
20862         * driver.cs: Small bug fix.
20863
20864         * report.cs: Updated format to be 4-zero filled digits.
20865
20866 2001-12-22  Ravi Pratap  <ravi@ximian.com>
20867
20868         * expression.cs (CheckIndices): Fix minor bug where the wrong
20869         variable was being referred to ;-)
20870
20871         (DoEmit): Do not call EmitStaticInitializers when the 
20872         underlying type is System.Object.
20873
20874 2001-12-21  Ravi Pratap  <ravi@ximian.com>
20875
20876         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
20877         and do the usual workaround for SRE.
20878
20879         * class.cs (MyEventBuilder.EventType): New member to get at the type
20880         of the event, quickly.
20881
20882         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
20883
20884         * assign.cs (Assign.DoResolve): Handle the case when the target
20885         is an EventExpr and perform the necessary checks.
20886
20887         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
20888         interface.
20889
20890         (SimpleName.MemberStaticCheck): Include check for EventExpr.
20891
20892         (EventExpr): Set the type in the constructor itself since we 
20893         are meant to be born fully resolved.
20894
20895         (EventExpr.Define): Revert code I wrote earlier.
20896                 
20897         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
20898         instance expression is null. The instance expression is a This in that case
20899         or a null, depending on whether it is a static method or not.
20900
20901         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
20902         refers to more than one method.
20903
20904         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
20905         and accordingly flag errors.
20906
20907 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
20908
20909         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
20910
20911 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
20912
20913         * location.cs (ToString): Provide useful rutine.
20914
20915 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
20916
20917         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
20918         objects, return the actual integral boxed.
20919
20920         * statement.cs (SwitchLabel): define an ILLabel for each
20921         SwitchLabel. 
20922
20923         (Switch.CheckSwitch): If the value is a Literal, extract
20924         the underlying literal.
20925
20926         Also in the unused hashtable we had, add the SwitchLabel so we can
20927         quickly look this value up.
20928
20929         * constant.cs: Implement a bunch of new constants.  Rewrite
20930         Literal based on this.  Made changes everywhere to adapt to this.
20931
20932         * expression.cs (Expression.MakeByteBlob): Optimize routine by
20933         dereferencing array only once, and also copes with enumrations.
20934
20935         bytes are two bytes wide, not one.
20936
20937         (Cast): Perform constant conversions.
20938
20939         * ecore.cs (TryImplicitIntConversion): Return literals instead of
20940         wrappers to the literals here.
20941
20942         * expression.cs (DoNumericPromotions): long literals can converted
20943         to ulong implicity (this is taken care of elsewhere, but I was
20944         missing this spot).
20945
20946         * ecore.cs (Expression.Literalize): Make the return type Literal,
20947         to improve type checking.
20948
20949         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
20950
20951 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
20952
20953         * literal.cs: Revert code from ravi that checked the bounds.  The
20954         bounds are sane by the definition of the type itself. 
20955
20956         * typemanager.cs: Fix implementation of ImplementsInterface.  We
20957         need to actually look up in our parent hierarchy for interfaces
20958         implemented. 
20959
20960         * const.cs: Use the underlying type for enumerations
20961
20962         * delegate.cs: Compute the basename for the delegate creation,
20963         that should fix the delegate test case, and restore the correct
20964         Type Lookup semantics in rootcontext
20965
20966         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
20967         referencing a nested type with the Reflection API is using the "+"
20968         sign. 
20969
20970         * cs-parser.jay: Do not require EOF token at the end.
20971
20972 2001-12-20  Ravi Pratap  <ravi@ximian.com>
20973
20974         * rootcontext.cs (LookupType): Concatenate type names with
20975         a '.' instead of a '+' The test suite passes again.
20976
20977         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
20978         field of the enumeration.
20979
20980         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
20981         the case when the member is an EventExpr.
20982
20983         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
20984         static has an associated instance expression.
20985
20986         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
20987
20988         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
20989
20990         * class.cs (Event.Define): Register event and perform appropriate checks
20991         for error #111.
20992
20993         We define the Add and Remove methods even if the use provides none because
20994         in that case, we provide default implementations ourselves.
20995
20996         Define a private field of the type of the event. This is done by the CSC compiler
20997         and we should be doing it too ;-)
20998
20999         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
21000         More methods we use in code we generate.
21001
21002         (multicast_delegate_type, delegate_type): Two separate types since the distinction
21003         is important.
21004
21005         (InitCoreTypes): Update accordingly for the above.
21006
21007         * class.cs (Event.Emit): Generate code for default accessors that we provide
21008
21009         (EmitDefaultMethod): Do the job in the above.
21010
21011         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
21012         appropriate place.
21013
21014 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21015
21016         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
21017         builders even if we were missing one.
21018
21019         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
21020         pass the Basename as our class name instead of the Name.  The
21021         basename will be correctly composed for us.
21022
21023         * parameter.cs (Paramters): Now takes a Location argument.
21024
21025         * decl.cs (DeclSpace.LookupType): Removed convenience function and
21026         make all the code call directly LookupType in RootContext and take
21027         this chance to pass the Location information everywhere.
21028
21029         * Everywhere: pass Location information.
21030
21031 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
21032
21033         * class.cs (Constructor.Define): Updated way of detecting the
21034         length of the parameters.
21035
21036         (TypeContainer.DefineType): Use basename as the type name for
21037         nested types.
21038
21039         (TypeContainer.Define): Do not recursively define types here, as
21040         definition is taken care in order by the RootContext.
21041
21042         * tree.cs: Keep track of namespaces in a per-file basis.
21043
21044         * parameter.cs (Parameter.ComputeSignature): Update to use
21045         DeclSpace. 
21046
21047         (Parameters.GetSignature): ditto.
21048
21049         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
21050         instead of a TypeContainer.
21051
21052         (Interface.SemanticAnalysis): Use `this' instead of our parent to
21053         resolve names.  Because we need to be resolve in our context, not
21054         our parents.
21055
21056         * driver.cs: Implement response files.
21057
21058         * class.cs (TypeContainer.DefineType): If we are defined, do not
21059         redefine ourselves.
21060
21061         (Event.Emit): Emit the code for add/remove handlers.
21062         (Event.Define): Save the MethodBuilders for add/remove.
21063
21064         * typemanager.cs: Use pair here too.
21065
21066         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
21067         DictionaryEntry requires the first argument to be non-null.  
21068
21069         (enum_declaration): Compute full name for registering the
21070         enumeration.
21071
21072         (delegate_declaration): Instead of using
21073         formal_parameter_list, use opt_formal_parameter_list as the list
21074         can be empty.
21075
21076         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
21077         (EventParsing): New property that controls whether `add' and
21078         `remove' are returned as tokens or identifiers (for events);
21079
21080 2001-12-19  Ravi Pratap  <ravi@ximian.com>
21081
21082         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
21083         use MyEventBuilder only and let it wrap the real builder for us.
21084
21085         (MyEventBuilder): Revamp constructor etc.
21086
21087         Implement all operations that we perform on EventBuilder in precisely the same
21088         way here too.
21089
21090         (FindMembers): Update to use the EventBuilder member.
21091
21092         (Event.Emit): Update accordingly.
21093
21094 2001-12-18  Ravi Pratap  <ravi@ximian.com>
21095
21096         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
21097         by calling the appropriate methods.
21098
21099         (GetCustomAttributes): Make stubs as they cannot possibly do anything
21100         useful.
21101
21102         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
21103
21104 2001-12-17  Ravi Pratap  <ravi@ximian.com>
21105
21106         * delegate.cs (Delegate.Populate): Check that the return type
21107         and various parameters types are indeed accessible.
21108
21109         * class.cs (Constructor.Define): Same here.
21110
21111         (Field.Define): Ditto.
21112
21113         (Event.Define): Ditto.
21114
21115         (Operator.Define): Check that the underlying Method defined itself
21116         correctly - so it's MethodBuilder should not be null.
21117
21118         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
21119         expression happens to be null.
21120
21121         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
21122         members but as of now we don't seem to be able to do anything really useful with it.
21123
21124         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
21125         not the EventBuilder.
21126
21127 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
21128
21129         * cs-tokenizer.cs: Add support for defines.
21130         Add support for #if, #elif, #else, #endif
21131
21132         (eval_var): evaluates a variable.
21133         (eval): stubbed for evaluating functions.
21134
21135         * cs-parser.jay: Pass the defines information
21136
21137         * driver.cs: Add --define command line option.
21138
21139         * decl.cs: Move MemberCore here.
21140
21141         Make it the base class for DeclSpace.  This allows us to catch and
21142         report 108 and 109 for everything now.
21143
21144         * class.cs (TypeContainer.Define): Extract all the members
21145         before populating and emit the warning 108 (new keyword required
21146         to override) instead of having each member implement this.
21147
21148         (MemberCore.Define): New abstract method, we will be using this in
21149         the warning reporting engine in Populate.
21150
21151         (Operator.Define): Adjust to new MemberCore protocol. 
21152
21153         * const.cs (Const): This does not derive from Expression, it is a
21154         temporary object we use to create fields, it is a MemberCore. 
21155
21156         * class.cs (Method.Define): Allow the entry point to be in a
21157         specific class.
21158
21159         * driver.cs: Rewrite the argument handler to clean it up a bit.
21160
21161         * rootcontext.cs: Made it just an auxiliary namespace feature by
21162         making everything static.
21163
21164         * driver.cs: Adapt code to use RootContext type name instead of
21165         instance variable.
21166
21167         * delegate.cs: Remove RootContext argument.
21168
21169         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
21170         argument. 
21171
21172         * class.cs (Event.Define): The lookup can fail.
21173
21174         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
21175
21176         * expression.cs: Resolve the this instance before invoking the code.
21177
21178 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
21179
21180         * cs-parser.jay: Add a production in element_access that allows
21181         the thing to become a "type" reference.  This way we can parse
21182         things like "(string [])" as a type.
21183
21184         Note that this still does not handle the more complex rules of
21185         casts. 
21186
21187
21188         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
21189
21190         * ecore.cs: (CopyNewMethods): new utility function used to
21191         assemble the list of methods from running FindMembers.
21192
21193         (MemberLookup): Rework FindMembers so that 
21194
21195 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
21196
21197         * class.cs (TypeContainer): Remove Delegates who fail to be
21198         defined.
21199
21200         * delegate.cs (Populate): Verify that we dont get null return
21201         values.   TODO: Check for AsAccessible.
21202
21203         * cs-parser.jay: Use basename to emit error 574 (destructor should
21204         have the same name as container class), not the full name.
21205
21206         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
21207         possible representation.  
21208
21209         Also implements integer type suffixes U and L.
21210
21211 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
21212
21213         * expression.cs (ArrayCreation.DoResolve): We need to do the
21214         argument resolution *always*.
21215
21216         * decl.cs: Make this hold the namespace.  Hold the root context as
21217         well.
21218         (LookupType): Move here.
21219
21220         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
21221
21222         * location.cs (Row, Name): Fixed the code, it was always returning
21223         references to the first file.
21224
21225         * interface.cs: Register properties defined through interfaces.
21226
21227         * driver.cs: Add support for globbing on the command line
21228
21229         * class.cs (Field): Make it derive from MemberCore as well.
21230         (Event): ditto.
21231
21232 2001-12-15  Ravi Pratap  <ravi@ximian.com>
21233
21234         * class.cs (Event::Define): Check that the type of the event is a delegate
21235         type else flag error #66.
21236
21237         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
21238         same.
21239
21240         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
21241         values of EntryPoint, CharSet etc etc.
21242
21243         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
21244
21245         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
21246         be null and we should ignore this. I am not sure if this is really clean. Apparently,
21247         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
21248         which needs this to do its work.
21249
21250         * ../errors/cs0066.cs : Add.
21251
21252 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
21253
21254         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
21255         helper functions.
21256
21257         * class.cs: (MethodSignature.MethodSignature): Removed hack that
21258         clears out the parameters field.
21259         (MemberSignatureCompare): Cleanup
21260
21261         (MemberCore): New base class used to share code between MethodCore
21262         and Property.
21263
21264         (RegisterRequiredImplementations) BindingFlags.Public requires
21265         either BindingFlags.Instace or Static.  Use instance here.
21266
21267         (Property): Refactored code to cope better with the full spec.
21268
21269         * parameter.cs (GetParameterInfo): Return an empty array instead
21270         of null on error.
21271
21272         * class.cs (Property): Abstract or extern properties have no bodies.
21273
21274         * parameter.cs (GetParameterInfo): return a zero-sized array.
21275
21276         * class.cs (TypeContainer.MethodModifiersValid): Move all the
21277         method modifier validation to the typecontainer so we can reuse
21278         this on properties.
21279
21280         (MethodCore.ParameterTypes): return an empty sized array of types.
21281
21282         (Property.Define): Test property modifier validity.
21283
21284         Add tests for sealed/override too.
21285
21286         (Method.Emit): abstract or extern methods have no bodies.
21287
21288 2001-12-14  Ravi Pratap  <ravi@ximian.com>
21289
21290         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21291         thing.
21292
21293         (Method::Define, ::Emit): Modify accordingly.
21294
21295         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21296
21297         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21298
21299         * makefile: Pass in /unsafe.
21300
21301 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
21302
21303         * class.cs (MakeKey): Kill routine.
21304
21305         * class.cs (TypeContainer.Define): Correctly define explicit
21306         method implementations (they require the full interface name plus
21307         the method name).
21308
21309         * typemanager.cs: Deply the PtrHashtable here and stop using the
21310         lame keys.  Things work so much better.
21311
21312         This of course broke everyone who depended on `RegisterMethod' to
21313         do the `test for existance' test.  This has to be done elsewhere.
21314
21315         * support.cs (PtrHashtable): A hashtable that avoid comparing with
21316         the object stupid Equals method (because, that like fails all over
21317         the place).  We still do not use it.
21318
21319         * class.cs (TypeContainer.SetRequiredInterface,
21320         TypeContainer.RequireMethods): Killed these two routines and moved
21321         all the functionality to RegisterRequiredImplementations.
21322
21323         (TypeContainer.RegisterRequiredImplementations): This routine now
21324         registers all the implementations required in an array for the
21325         interfaces and abstract methods.  We use an array of structures
21326         which can be computed ahead of time to reduce memory usage and we
21327         also assume that lookups are cheap as most classes will not
21328         implement too many interfaces.
21329
21330         We also avoid creating too many MethodSignatures.
21331
21332         (TypeContainer.IsInterfaceMethod): Update and optionally does not
21333         clear the "pending" bit if we find that there are problems with
21334         the declaration.
21335
21336         (TypeContainer.VerifyPendingMethods): Update to report errors of
21337         methods that look like implementations but are not.
21338
21339         (TypeContainer.Define): Add support for explicit interface method
21340         implementation. 
21341
21342 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
21343
21344         * typemanager.cs: Keep track of the parameters here instead of
21345         being a feature of the TypeContainer.
21346
21347         * class.cs: Drop the registration of parameters here, as
21348         InterfaceMethods are also interface declarations.
21349
21350         * delegate.cs: Register methods with the TypeManager not only with
21351         the TypeContainer.  This code was buggy.
21352
21353         * interface.cs: Full registation here.
21354
21355 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
21356
21357         * expression.cs: Remove reducer for binary expressions, it can not
21358         be done this way.
21359
21360         * const.cs: Put here the code that used to go into constant.cs
21361
21362         * constant.cs: Put here the code for constants, this is a new base
21363         class for Literals.
21364
21365         * literal.cs: Make Literal derive from Constant.
21366
21367 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
21368
21369         * statement.cs (Return.Emit): Report error 157 if the user
21370         attempts to return from a finally block.
21371
21372         (Return.Emit): Instead of emitting a return, jump to the end of
21373         the function.
21374
21375         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21376         LocalBuilder to store the result of the function.  ReturnLabel is
21377         the target where we jump.
21378
21379
21380 2001-12-09  Radek Doulik  <rodo@ximian.com>
21381
21382         * cs-parser.jay: remember alias in current namespace
21383
21384         * ecore.cs (SimpleName::DoResolve): use aliases for types or
21385         namespaces
21386
21387         * class.cs (LookupAlias): lookup alias in my_namespace
21388
21389         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21390         aliases hashtable
21391         (LookupAlias): lookup alias in this and if needed in parent
21392         namespaces
21393
21394 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
21395
21396         * support.cs: 
21397
21398         * rootcontext.cs: (ModuleBuilder) Made static, first step into
21399         making things static.  I need this to avoid passing the
21400         TypeContainer when calling ParameterType.
21401
21402         * support.cs (InternalParameters.ParameterType): Remove ugly hack
21403         that did string manipulation to compute the type and then call
21404         GetType.  Use Parameter.ParameterType instead.
21405
21406         * cs-tokenizer.cs: Consume the suffix for floating values.
21407
21408         * expression.cs (ParameterReference): figure out whether this is a
21409         reference parameter or not.  Kill an extra variable by computing
21410         the arg_idx during emission.
21411
21412         * parameter.cs (Parameters.GetParameterInfo): New overloaded
21413         function that returns whether a parameter is an out/ref value or not.
21414
21415         (Parameter.ParameterType): The type of the parameter (base,
21416         without ref/out applied).
21417
21418         (Parameter.Resolve): Perform resolution here.
21419         (Parameter.ExternalType): The full type (with ref/out applied).
21420
21421         * statement.cs (Using.Emit, Using.EmitExpression): Implement
21422         support for expressions on the using statement.
21423
21424 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
21425
21426         * statement.cs (Using.EmitLocalVariableDecls): Split the
21427         localvariable handling of the using statement.
21428
21429         (Block.EmitMeta): Keep track of variable count across blocks.  We
21430         were reusing slots on separate branches of blocks.
21431
21432         (Try.Emit): Emit the general code block, we were not emitting it. 
21433
21434         Check the type of the declaration to be an IDisposable or
21435         something that can be implicity converted to it. 
21436
21437         Emit conversions if required.
21438
21439         * ecore.cs (EmptyExpression): New utility class.
21440         (Expression.ImplicitConversionExists): New utility function.
21441
21442 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
21443
21444         * statement.cs (Using): Implement.
21445
21446         * expression.cs (LocalVariableReference): Support read only variables.
21447
21448         * statement.cs: Remove the explicit emit for the Leave opcode.
21449         (VariableInfo): Add a readonly field.
21450
21451 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
21452
21453         * ecore.cs (ConvCast): new class used to encapsulate the various
21454         explicit integer conversions that works in both checked and
21455         unchecked contexts.
21456
21457         (Expression.ConvertNumericExplicit): Use new ConvCast class to
21458         properly generate the overflow opcodes.
21459
21460 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21461
21462         * statement.cs: The correct type for the EmptyExpression is the
21463         element_type, not the variable type.  Ravi pointed this out.
21464
21465 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21466
21467         * class.cs (Method::Define): Handle PInvoke methods specially
21468         by using DefinePInvokeMethod instead of the usual one.
21469
21470         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21471         above to do the task of extracting information and defining the method.
21472
21473 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21474
21475         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21476         of the condition for string type.
21477
21478         (Emit): Move that here. 
21479
21480         (ArrayCreation::CheckIndices): Keep string literals in their expression
21481         form.
21482
21483         (EmitDynamicInitializers): Handle strings appropriately.
21484
21485 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21486
21487         * codegen.cs (EmitContext): Replace multiple variables with a
21488         single pointer to the current Switch statement.
21489
21490         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21491         EmitContext.
21492
21493 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21494
21495         * statement.cs 
21496
21497         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21498         default'.
21499
21500         (Foreach.Emit): Foreach on arrays was not setting
21501         up the loop variables (for break/continue).
21502
21503         (GotoCase): Semi-implented.
21504
21505 2001-12-03  Ravi Pratap  <ravi@ximian.com>
21506
21507         * attribute.cs (CheckAttribute): Handle system attributes by using
21508         Attribute.GetAttributes to examine information we need.
21509
21510         (GetValidPlaces): Same here.
21511
21512         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21513
21514         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21515
21516         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21517
21518         (Method::Define): Set appropriate flags if we have a DllImport attribute.
21519
21520         (Method::Emit): Handle the case when we are a PInvoke method.
21521
21522 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21523
21524         * expression.cs: Use ResolveWithSimpleName on compound names.
21525
21526 2001-12-02  Ravi Pratap  <ravi@ximian.com>
21527
21528         * constant.cs (EmitConstant): Make sure we resolve the associated expression
21529         before trying to reduce it.
21530
21531         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21532
21533         * constant.cs (LookupConstantValue): Implement.
21534
21535         (EmitConstant): Use the above in emitting the constant.
21536
21537         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21538         that are user-defined by doing a LookupConstantValue on them.
21539
21540         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21541         too, like above.
21542
21543 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
21544
21545         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21546
21547         (BaseAccess.DoResolve): Implement.
21548
21549         (MemberAccess.DoResolve): Split this routine into a
21550         ResolveMemberAccess routine that can be used independently
21551
21552 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
21553
21554         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21555         As that share bits of the implementation.  Is returns a boolean,
21556         while As returns the Type that is being probed.
21557
21558 2001-12-01  Ravi Pratap  <ravi@ximian.com>
21559
21560         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21561         instead of a Literal - much easier.
21562
21563         (EnumInTransit): Remove - utterly useless :-)
21564
21565         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21566
21567         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21568
21569         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21570         chain when we have no associated expression.
21571
21572 2001-11-30  Ravi Pratap  <ravi@ximian.com>
21573
21574         * constant.cs (Define): Use Location while reporting the errror.
21575
21576         Also emit a warning when 'new' is used and there is no inherited
21577         member to hide.
21578
21579         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
21580         populated.
21581
21582         (LookupEnumValue): Implement to lookup an enum member's value and define it
21583         if necessary.
21584
21585         (Populate): Re-write accordingly to use the above routine.
21586
21587 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
21588
21589         * expression.cs (This): Fix prototype for DoResolveLValue to
21590         override the base class DoResolveLValue.
21591
21592         * cs-parser.cs: Report errors cs574 and cs575 (destructor
21593         declarations) 
21594
21595         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
21596         (we need to load the address of the field here).  This fixes
21597         test-22. 
21598
21599         (FieldExpr.DoResolveLValue): Call the DoResolve
21600         function to initialize the Instance expression.
21601
21602         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
21603         correctly the GetEnumerator operation on a value type.
21604
21605         * cs-parser.jay: Add more simple parsing error catches.
21606
21607         * statement.cs (Switch): Add support for string switches.
21608         Handle null specially.
21609
21610         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
21611
21612 2001-11-28  Ravi Pratap  <ravi@ximian.com>
21613
21614         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
21615
21616         (declare_local_constant): New helper function.
21617
21618         * statement.cs (AddConstant): Keep a separate record of constants
21619
21620         (IsConstant): Implement to determine if a variable is a constant.
21621
21622         (GetConstantExpression): Implement.
21623
21624         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
21625
21626         * statement.cs (IsVariableDefined): Re-write.
21627
21628 2001-11-27  Ravi Pratap  <ravi@ximian.com>
21629
21630         * class.cs (TypeContainer::FindMembers): Look for constants
21631         in the case when we are looking for MemberTypes.Field
21632
21633         * expression.cs (MemberAccess::DoResolve): Check that in the
21634         case we are a FieldExpr and a Literal, we are not being accessed
21635         by an instance reference.
21636
21637         * cs-parser.jay (local_constant_declaration): Implement.
21638
21639         (declaration_statement): Implement for constant declarations.
21640
21641 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
21642
21643         * statement.cs (Switch): Catch double defaults.
21644
21645         (Switch): More work on the switch() statement
21646         implementation.  It works for integral values now, need to finish
21647         string support.
21648
21649
21650 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21651
21652         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
21653         integer literals into other integer literals.  To be used by
21654         switch. 
21655
21656 2001-11-24  Ravi Pratap  <ravi@ximian.com>
21657
21658         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
21659         some memory.
21660
21661         (EmitDynamicInitializers): Cope with the above since we extract data
21662         directly from ArrayData now.
21663
21664         (ExpectInitializers): Keep track of whether initializers are mandatory
21665         or not.
21666
21667         (Bounds): Make it a hashtable to prevent the same dimension being 
21668         recorded for every element in that dimension.
21669
21670         (EmitDynamicInitializers): Fix bug which prevented the Set array method
21671         from being found.
21672
21673         Also fix bug which was causing the indices to be emitted in the reverse
21674         order.
21675
21676 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21677
21678         * expression.cs (ArrayCreation): Implement the bits that Ravi left
21679         unfinished.  They do not work, because the underlying code is
21680         sloppy.
21681
21682 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21683
21684         * cs-parser.jay: Remove bogus fixme.
21685
21686         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
21687         on Switch statement.
21688
21689 2001-11-23  Ravi Pratap  <ravi@ximian.com>
21690
21691         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
21692         the same. 
21693
21694         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
21695         parameter. Apparently, any expression is allowed. 
21696
21697         (ValidateInitializers): Update accordingly.
21698
21699         (CheckIndices): Fix some tricky bugs thanks to recursion.
21700
21701         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
21702         I was being completely brain-dead.
21703
21704         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
21705         and re-write acordingly.
21706
21707         (DelegateInvocation): Re-write accordingly.
21708
21709         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
21710
21711         (MakeByteBlob): Handle types more correctly.
21712
21713         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
21714         initialization from expressions but it is incomplete because I am a complete
21715         Dodo :-|
21716
21717 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21718
21719         * statement.cs (If.Emit): Fix a bug that generated incorrect code
21720         on If.  Basically, we have to return `true' (ie, we do return to
21721         our caller) only if both branches of the if return.
21722
21723         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
21724         short-circuit operators, handle them as short circuit operators. 
21725
21726         (Cast.DoResolve): Resolve type.
21727         (Cast.Cast): Take an expression as the target type.
21728
21729         * cs-parser.jay (cast_expression): Remove old hack that only
21730         allowed a limited set of types to be handled.  Now we take a
21731         unary_expression and we resolve to a type during semantic
21732         analysis.
21733
21734         Use the grammar productions from Rhys to handle casts (this is
21735         not complete like Rhys syntax yet, we fail to handle that corner
21736         case that C# has regarding (-x), but we will get there.
21737
21738 2001-11-22  Ravi Pratap  <ravi@ximian.com>
21739
21740         * class.cs (EmitFieldInitializer): Take care of the case when we have a
21741         field which is an array type.
21742
21743         * cs-parser.jay (declare_local_variables): Support array initialization too.
21744
21745         * typemanager.cs (MakeKey): Implement.
21746
21747         (everywhere): Use the above appropriately.
21748
21749         * cs-parser.jay (for_statement): Update for array initialization while
21750         declaring variables.
21751
21752         * ecore.cs : The error message was correct, it's the variable's names that
21753         were misleading ;-) Make the code more readable.
21754
21755         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
21756         the correct type etc.
21757
21758         (ConvertExplicit): Handle Enum types by examining the underlying type.
21759
21760 2001-11-21  Ravi Pratap  <ravi@ximian.com>
21761
21762         * parameter.cs (GetCallingConvention): Always return
21763         CallingConventions.Standard for now.
21764
21765 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21766
21767         * expression.cs (Binary.ResolveOperator): Update the values of `l'
21768         and `r' after calling DoNumericPromotions.
21769
21770         * ecore.cs: Fix error message (the types were in the wrong order).
21771
21772         * statement.cs (Foreach.ProbeCollectionType): Need to pass
21773         BindingFlags.Instance as well 
21774
21775         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
21776         implicit int literal conversion in an empty cast so that we
21777         propagate the right type upstream.
21778
21779         (UnboxCast): new class used to unbox value types.
21780         (Expression.ConvertExplicit): Add explicit type conversions done
21781         by unboxing.
21782
21783         (Expression.ImplicitNumericConversion): Oops, forgot to test for
21784         the target type before applying the implicit LongLiterals to ULong
21785         literal cast.
21786
21787 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
21788
21789         * cs-parser.jay (for_statement): Reworked the way For works: now
21790         we declare manually any variables that are introduced in
21791         for_initializer to solve the problem of having out-of-band code
21792         emition (that is what got for broken).
21793
21794         (declaration_statement): Perform the actual variable declaration
21795         that used to be done in local_variable_declaration here.
21796
21797         (local_variable_declaration): Do not declare anything, just pass
21798         the information on a DictionaryEntry
21799
21800 2001-11-20  Ravi Pratap  <ravi@ximian.com>
21801
21802         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
21803         re-write of the logic to now make it recursive.
21804
21805         (UpdateIndices): Re-write accordingly.
21806
21807         Store element data in a separate ArrayData list in the above methods.
21808
21809         (MakeByteBlob): Implement to dump the array data into a byte array.
21810
21811 2001-11-19  Ravi Pratap  <ravi@ximian.com>
21812
21813         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
21814         into CheckIndices.
21815
21816         * constant.cs (Define): Implement.
21817
21818         (EmitConstant): Re-write fully.
21819
21820         Pass in location info.
21821
21822         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
21823         respectively.
21824
21825         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
21826         DictionaryEntry since we need location info too.
21827
21828         (constant_declaration): Update accordingly.
21829
21830         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
21831         code into another method : UpdateIndices.
21832
21833 2001-11-18  Ravi Pratap  <ravi@ximian.com>
21834
21835         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
21836         some type checking etc.
21837
21838 2001-11-17  Ravi Pratap  <ravi@ximian.com>
21839
21840         * expression.cs (ArrayCreation::ValidateInitializers): Implement
21841         bits to provide dimension info if the user skips doing that.
21842
21843         Update second constructor to store the rank correctly.
21844
21845 2001-11-16  Ravi Pratap  <ravi@ximian.com>
21846
21847         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
21848         and try to implement.
21849
21850         * ../errors/cs0150.cs : Add.
21851
21852         * ../errors/cs0178.cs : Add.
21853
21854 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
21855
21856         * statement.cs: Implement foreach on multi-dimensional arrays. 
21857
21858         * parameter.cs (Parameters.GetParameterByName): Also lookup the
21859         name of the params argument.
21860
21861         * expression.cs: Use EmitStoreOpcode to get the right opcode while
21862         initializing the array.
21863
21864         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
21865         we can use this elsewhere.
21866
21867         * statement.cs: Finish implementation of foreach for single
21868         dimension arrays.
21869
21870         * cs-parser.jay: Use an out-of-band stack to pass information
21871         around, I wonder why I need this.
21872
21873         foreach_block: Make the new foreach_block the current_block.
21874
21875         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
21876         function used to return a static Parameters structure.  Used for
21877         empty parameters, as those are created very frequently.
21878
21879         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
21880
21881 2001-11-15  Ravi Pratap  <ravi@ximian.com>
21882
21883         * interface.cs : Default modifier is private, not public. The
21884         make verify test passes again.
21885
21886 2001-11-15  Ravi Pratap  <ravi@ximian.com>
21887
21888         * support.cs (ReflectionParameters): Fix logic to determine
21889         whether the last parameter is a params one. Test 9 passes again.
21890
21891         * delegate.cs (Populate): Register the builders we define with
21892         RegisterParameterForBuilder. Test 19 passes again.
21893
21894         * cs-parser.jay (property_declaration): Reference $6 instead
21895         of $$ to get at the location.
21896
21897         (indexer_declaration): Similar stuff.
21898
21899         (attribute): Ditto.
21900
21901         * class.cs (Property): Register parameters for the Get and Set methods
21902         if they exist. Test 23 passes again.
21903
21904         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
21905         call to EmitArguments as we are sure there aren't any params arguments. 
21906         Test 32 passes again.
21907
21908         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
21909         IndexOutOfRangeException. 
21910
21911         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
21912         Test 33 now passes again.
21913
21914 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
21915
21916         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
21917         broke a bunch of things.  Will have to come up with a better way
21918         of tracking locations.
21919
21920         * statement.cs: Implemented foreach for single dimension arrays.
21921
21922 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
21923
21924         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
21925         an error.  This removes the lookup from the critical path.
21926
21927         * cs-parser.jay: Removed use of temporary_loc, which is completely
21928         broken. 
21929
21930 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
21931
21932         * support.cs (ReflectionParameters.ParameterModifier): Report
21933         whether the argument is a PARAMS argument or not.
21934
21935         * class.cs: Set the attribute `ParamArrayAttribute' on the
21936         parameter argument.
21937
21938         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
21939         and cons_param_array_attribute (ConstructorInfo for
21940         ParamArrayAttribute)., 
21941
21942         * codegen.cs: Emit the return using the `Return' statement, that
21943         way we can report the error correctly for missing return values. 
21944
21945         * class.cs (Method.Emit): Clean up.
21946
21947         * expression.cs (Argument.Resolve): Take another argument: the
21948         location where this argument is used.  Notice that this is not
21949         part of the "Argument" class as to reduce the size of the
21950         structure (we know the approximate location anyways).
21951
21952         Test if the argument is a variable-reference, if not, then
21953         complain with a 206.
21954
21955         (Argument.Emit): Emit addresses of variables.
21956
21957         (Argument.FullDesc): Simplify.
21958
21959         (Invocation.DoResolve): Update for Argument.Resolve.
21960
21961         (ElementAccess.DoResolve): ditto.
21962
21963         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
21964         method should be virtual, as this method is always virtual.
21965
21966         (NewDelegate.DoResolve): Update for Argument.Resolve.
21967
21968         * class.cs (ConstructorInitializer.DoResolve): ditto.
21969
21970         * attribute.cs (Attribute.Resolve): ditto.
21971
21972 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
21973
21974         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
21975
21976         * expression.cs (ParameterReference): Drop IStackStorage and implement
21977         IAssignMethod instead. 
21978
21979         (LocalVariableReference): ditto.
21980
21981         * ecore.cs (FieldExpr): Drop IStackStorage and implement
21982         IAssignMethod instead. 
21983
21984 2001-11-13  Miguel de Icaza <miguel@ximian.com>
21985
21986         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
21987         enumerations that are used in heavily used structures derive from
21988         byte in a laughable and pathetic attempt to reduce memory usage.
21989         This is the kind of pre-optimzations that you should not do at
21990         home without adult supervision.
21991
21992         * expression.cs (UnaryMutator): New class, used to handle ++ and
21993         -- separatedly from the other unary operators.  Cleans up the
21994         code, and kills the ExpressionStatement dependency in Unary.
21995
21996         (Unary): Removed `method' and `Arguments' from this class, making
21997         it smaller, and moving it all to SimpleCall, so I can reuse this
21998         code in other locations and avoid creating a lot of transient data
21999         strucutres when not required.
22000
22001         * cs-parser.jay: Adjust for new changes.
22002
22003 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
22004
22005         * enum.cs (Enum.Populate): If there is a failure during
22006         definition, return
22007
22008         * cs-parser.jay (opt_enum_base): we used to catch type errors
22009         here, but this is really incorrect.  The type error should be
22010         catched during semantic analysis.
22011
22012 2001-12-11  Ravi Pratap  <ravi@ximian.com>
22013
22014         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
22015         current_local_parameters as expected since I, in my stupidity, had forgotten
22016         to do this :-)
22017
22018         * attribute.cs (GetValidPlaces): Fix stupid bug.
22019
22020         * class.cs (Method::Emit): Perform check on applicability of attributes.
22021
22022         (Constructor::Emit): Ditto.
22023
22024         (Field::Emit): Ditto.
22025
22026         (Field.Location): Store location information.
22027
22028         (Property, Event, Indexer, Operator): Ditto.
22029
22030         * cs-parser.jay (field_declaration): Pass in location for each field.
22031
22032         * ../errors/cs0592.cs : Add.
22033
22034 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22035
22036         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
22037
22038         (InitCoreTypes): Update accordingly.
22039
22040         (RegisterAttrType, LookupAttr): Implement.
22041
22042         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
22043         info about the same.
22044
22045         (Resolve): Update to populate the above as necessary.
22046
22047         (Error592): Helper.
22048
22049         (GetValidPlaces): Helper to the above.
22050
22051         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
22052
22053         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
22054
22055 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22056
22057         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
22058
22059         * ../errors/cs0617.cs : Add.
22060
22061 2001-11-11  Ravi Pratap  <ravi@ximian.com>
22062
22063         * enum.cs (Emit): Rename to Populate to be more consistent with what
22064         we expect it to do and when exactly it is called.
22065
22066         * class.cs, rootcontext.cs : Update accordingly.
22067
22068         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
22069         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
22070
22071         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
22072
22073         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
22074         of a fieldinfo using the above, when dealing with a FieldBuilder.
22075
22076 2001-11-10  Ravi Pratap  <ravi@ximian.com>
22077
22078         * ../errors/cs0031.cs : Add.
22079
22080         * ../errors/cs1008.cs : Add.
22081
22082         * ../errrors/cs0543.cs : Add.
22083
22084         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
22085         enum type.
22086
22087         (FindMembers): Implement.
22088
22089         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
22090         enums and delegates too.
22091
22092         (enum_types): Rename to builder_to_enum.
22093
22094         (delegate_types): Rename to builder_to_delegate.
22095
22096         * delegate.cs (FindMembers): Implement.
22097
22098 2001-11-09  Ravi Pratap  <ravi@ximian.com>
22099
22100         * typemanager.cs (IsEnumType): Implement.
22101
22102         * enum.cs (Emit): Re-write parts to account for the underlying type
22103         better and perform checking etc.
22104
22105         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
22106         of the underlying type.
22107
22108         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
22109         value
22110
22111         * enum.cs (error31): Helper to report error #31.
22112
22113         * cs-parser.jay (enum_declaration): Store location of each member too.
22114
22115         * enum.cs (member_to_location): New hashtable. 
22116
22117         (AddEnumMember): Update location hashtable.
22118
22119         (Emit): Use the location of each member while reporting errors.
22120
22121 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22122
22123         * cs-parser.jay: A for_initializer if is a
22124         local_variable_declaration really ammount to have an implicit
22125         block with the variable declaration and no initializer for for.
22126
22127         * statement.cs (For.Emit): Cope with null initializers.
22128
22129         This fixes the infinite loop on for initializers.
22130
22131 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
22132
22133         * enum.cs: More cleanup.
22134
22135         * ecore.cs: Remove dead code.
22136
22137         * class.cs (Property.Emit): More simplification.
22138         (Event.Emit): ditto.
22139
22140         Reworked to have less levels of indentation.
22141
22142 2001-11-08  Ravi Pratap  <ravi@ximian.com>
22143
22144         * class.cs (Property): Emit attributes.
22145
22146         (Field): Ditto.
22147
22148         (Event): Ditto.
22149
22150         (Indexer): Ditto.
22151
22152         (Operator): Ditto.
22153
22154         * enum.cs (Emit): Ditto.
22155
22156         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
22157         Enums too.
22158
22159         * class.cs (Field, Event, etc.): Move attribute generation into the
22160         Emit method everywhere.
22161
22162         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
22163         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
22164         as we had no way of defining nested enums !
22165
22166         * rootcontext.cs : Adjust code accordingly.
22167
22168         * typemanager.cs (AddEnumType): To keep track of enum types separately.
22169
22170 2001-11-07  Ravi Pratap  <ravi@ximian.com>
22171
22172         * expression.cs (EvalConstantExpression): Move into ecore.cs
22173
22174         * enum.cs (Enum): Rename some members and make them public and readonly
22175         according to our convention.
22176
22177         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
22178         nothing else.
22179
22180         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
22181
22182         (Enum::Emit): Write a simple version for now which doesn't try to compute
22183         expressions. I shall modify this to be more robust in just a while.
22184
22185         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
22186
22187         (TypeContainer::CloseType): Create the Enum types too.
22188
22189         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
22190
22191         * expression.cs (EvalConstantExpression): Get rid of completely.
22192
22193         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
22194         user-defined values and other cases.
22195
22196         (IsValidEnumLiteral): Helper function.
22197
22198         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
22199         out there in the case we had a literal FieldExpr.
22200
22201         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
22202
22203         (Literalize): Revamp a bit to take two arguments.
22204
22205         (EnumLiteral): New class which derives from Literal to wrap enum literals.
22206
22207 2001-11-06  Ravi Pratap  <ravi@ximian.com>
22208
22209         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
22210
22211         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
22212
22213         (Resolve): Use the above to ensure we have proper initializers.
22214
22215 2001-11-05  Ravi Pratap  <ravi@ximian.com>
22216
22217         * expression.cs (Expression::EvalConstantExpression): New method to 
22218         evaluate constant expressions.
22219
22220         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
22221
22222 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
22223
22224         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
22225         in an array.
22226
22227         (Binary.ResolveOperator): Handle operator != (object a, object b)
22228         and operator == (object a, object b);
22229
22230         (Binary.DoNumericPromotions): Indicate whether the numeric
22231         promotion was possible.
22232
22233         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
22234         Implement.  
22235
22236         Made the ArrayAccess implement interface IAssignMethod instead of
22237         IStackStore as the order in which arguments are passed reflects
22238         this.
22239
22240         * assign.cs: Instead of using expr.ExprClass to select the way of
22241         assinging, probe for the IStackStore/IAssignMethod interfaces.
22242
22243         * typemanager.cs: Load InitializeArray definition.
22244
22245         * rootcontext.cs (RootContext.MakeStaticData): Used to define
22246         static data that can be used to initialize arrays. 
22247
22248 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
22249
22250         * expression.cs: Handle operator== and operator!= for booleans.
22251
22252         (Conditioal.Reduce): Implement reducer for the ?: operator.
22253
22254         (Conditional.Resolve): Implement dead code elimination.
22255
22256         (Binary.Resolve): Catch string literals and return a new
22257         concatenated string.
22258
22259         (Unary.Reduce): Implement reduction of unary expressions.
22260
22261         * ecore.cs: Split out the expression core handling here.
22262
22263         (Expression.Reduce): New method used to perform constant folding
22264         and CSE.  This is needed to support constant-expressions. 
22265
22266         * statement.cs (Statement.EmitBoolExpression): Pass true and false
22267         targets, and optimize for !x.
22268
22269 2001-11-04  Ravi Pratap  <ravi@ximian.com>
22270
22271         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
22272         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
22273         set custom atttributes.
22274
22275         * literal.cs (Literal::GetValue): New abstract method to return the actual
22276         value of the literal, cast as an object.
22277
22278         (*Literal): Implement GetValue method.
22279
22280         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22281         expressions to the arraylist but objects of type Argument.
22282
22283         * class.cs (TypeContainer::Emit): Emit our attributes too.
22284
22285         (Method::Emit, Constructor::Emit): Ditto.
22286
22287         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
22288         to be ignoring earlier.
22289
22290 2001-11-03  Ravi Pratap  <ravi@ximian.com>
22291
22292         * attribute.cs (AttributeSection::Define): Implement to do the business
22293         of constructing a CustomAttributeBuilder.
22294
22295         (Attribute): New trivial class. Increases readability of code.  
22296
22297         * cs-parser.jay : Update accordingly.
22298
22299         (positional_argument_list, named_argument_list, named_argument): New rules
22300
22301         (attribute_arguments): Use the above so that we are more correct.
22302
22303 2001-11-02  Ravi Pratap  <ravi@ximian.com>
22304
22305         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22306         to perform all checks for a method with a params parameter.
22307
22308         (Invocation::OverloadResolve): Update to use the above method and therefore
22309         cope correctly with params method invocations.
22310
22311         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
22312         params too.
22313
22314         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22315         constructors in our parent too because we can't afford to miss out on 
22316         protected ones ;-)
22317
22318         * attribute.cs (AttributeSection): New name for the class Attribute
22319
22320         Other trivial changes to improve readability.
22321
22322         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22323         use the new class names.
22324
22325 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22326
22327         * class.cs (Method::Define): Complete definition for params types too
22328
22329         (Indexer::Define): Ditto.
22330
22331         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22332         Cope everywhere with a request for info about the array parameter.
22333
22334 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22335
22336         * tree.cs (RecordNamespace): Fix up to check for the correct key.
22337
22338         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
22339         local_variable_type to extract the string corresponding to the type.
22340
22341         (local_variable_type): Fixup the action to use the new helper method.
22342
22343         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
22344         go.
22345
22346         * expression.cs : Clean out code which uses the above.
22347
22348 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22349
22350         * typemanager.cs (RegisterMethod): Check if we already have an existing key
22351         and bale out if necessary by returning a false.
22352
22353         (RegisterProperty): Ditto.
22354
22355         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
22356         and print out appropriate error messages.
22357
22358         * interface.cs (everywhere): Ditto.
22359
22360         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
22361         location to constructor.
22362
22363         * class.cs (Property, Event, Indexer): Update accordingly.
22364
22365         * ../errors/cs111.cs : Added.
22366
22367         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
22368         of a method, as laid down by the spec.
22369
22370         (Invocation::OverloadResolve): Use the above method.
22371
22372 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22373
22374         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22375         now take a TypeContainer and a Parameters object.
22376
22377         (ParameterData): Modify return type of ParameterModifier method to be 
22378         Parameter.Modifier and not a string.
22379
22380         (ReflectionParameters, InternalParameters): Update accordingly.
22381
22382         * expression.cs (Argument::GetParameterModifier): Same here.
22383
22384         * support.cs (InternalParameters::ParameterType): Find a better way of determining
22385         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22386         symbol in it at all so maybe this is only for now.
22387
22388 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22389
22390         * support.cs (InternalParameters): Constructor now takes an extra argument 
22391         which is the actual Parameters class.
22392
22393         (ParameterDesc): Update to provide info on ref/out modifiers.
22394
22395         * class.cs (everywhere): Update call to InternalParameters to pass in
22396         the second argument too.
22397
22398         * support.cs (ParameterData): Add ParameterModifier, which is a method 
22399         to return the modifier info [ref/out etc]
22400
22401         (InternalParameters, ReflectionParameters): Implement the above.
22402
22403         * expression.cs (Argument::ParameterModifier): Similar function to return
22404         info about the argument's modifiers.
22405
22406         (Invocation::OverloadResolve): Update to take into account matching modifiers 
22407         too.
22408
22409         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22410         a new SetFormalParameters object which we pass to InternalParameters.
22411
22412 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22413
22414         * expression.cs (NewArray): Merge into the ArrayCreation class.
22415
22416 2001-10-29  Ravi Pratap  <ravi@ximian.com>
22417
22418         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
22419         NewUserdefinedArray into one as there wasn't much of a use in having
22420         two separate ones.
22421
22422         * expression.cs (Argument): Change field's name to ArgType from Type.
22423
22424         (Type): New readonly property which returns the proper type, taking into 
22425         account ref/out modifiers.
22426
22427         (everywhere): Adjust code accordingly for the above.
22428
22429         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22430         whether we are emitting for a ref or out parameter.
22431
22432         * expression.cs (Argument::Emit): Use the above field to set the state.
22433
22434         (LocalVariableReference::Emit): Update to honour the flag and emit the
22435         right stuff.
22436
22437         * parameter.cs (Attributes): Set the correct flags for ref parameters.
22438
22439         * expression.cs (Argument::FullDesc): New function to provide a full desc.
22440
22441         * support.cs (ParameterData): Add method ParameterDesc to the interface.
22442
22443         (ReflectionParameters, InternalParameters): Implement the above method.
22444
22445         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22446         reporting errors.
22447
22448         (Invocation::FullMethodDesc): Ditto. 
22449
22450 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
22451
22452         * cs-parser.jay: Add extra production for the second form of array
22453         creation. 
22454
22455         * expression.cs (ArrayCreation): Update to reflect the above
22456         change. 
22457
22458         * Small changes to prepare for Array initialization.
22459
22460 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
22461
22462         * typemanager.cs (ImplementsInterface): interface might be null;
22463         Deal with this problem;
22464
22465         Also, we do store negative hits on the cache (null values), so use
22466         this instead of calling t.GetInterfaces on the type everytime.
22467
22468 2001-10-28  Ravi Pratap  <ravi@ximian.com>
22469
22470         * typemanager.cs (IsBuiltinType): New method to help determine the same.
22471
22472         * expression.cs (New::DoResolve): Get rid of array creation code and instead
22473         split functionality out into different classes.
22474
22475         (New::FormArrayType): Move into NewBuiltinArray.
22476
22477         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22478         quite useless.
22479
22480         (NewBuiltinArray): New class to handle creation of built-in arrays.
22481
22482         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22483         account creation of one-dimensional arrays.
22484
22485         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22486
22487         (NewUserdefinedArray::DoResolve): Implement.
22488
22489         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22490
22491         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22492         we maintain inside the TypeManager. This is necessary to perform lookups on the
22493         module builder.
22494
22495         (LookupType): Update to perform GetType on the module builders too.     
22496
22497         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22498
22499         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22500
22501 2001-10-23  Ravi Pratap  <ravi@ximian.com>
22502
22503         * expression.cs (New::DoResolve): Implement guts of array creation.
22504
22505         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22506
22507 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
22508
22509         * expression.cs: Fix bug I introduced lsat night that broke
22510         Delegates. 
22511
22512         (Expression.Resolve): Report a 246 error (can not resolve name)
22513         if we find a SimpleName in the stream.
22514
22515         (Expression.ResolveLValue): Ditto.
22516
22517         (Expression.ResolveWithSimpleName): This function is a variant of
22518         ResolveName, this one allows SimpleNames to be returned without a
22519         warning.  The only consumer of SimpleNames is MemberAccess
22520
22521 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
22522
22523         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22524         might arrive here.  I have my doubts that this is correct.
22525
22526         * statement.cs (Lock): Implement lock statement.
22527
22528         * cs-parser.jay: Small fixes to support `lock' and `using'
22529
22530         * cs-tokenizer.cs: Remove extra space
22531
22532         * driver.cs: New flag --checked, allows to turn on integer math
22533         checking. 
22534
22535         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22536         Threading.Monitor.Exit 
22537
22538 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
22539
22540         * expression.cs (IndexerAccess::DoResolveLValue): Set the
22541         Expression Class to be IndexerAccess.
22542
22543         Notice that Indexer::DoResolve sets the eclass to Value.
22544
22545 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
22546
22547         * class.cs (TypeContainer::Emit): Emit code for indexers.
22548
22549         * assign.cs (IAssignMethod): New interface implemented by Indexers
22550         and Properties for handling assignment.
22551
22552         (Assign::Emit): Simplify and reuse code. 
22553
22554         * expression.cs (IndexerAccess, PropertyExpr): Implement
22555         IAssignMethod, clean up old code. 
22556
22557 2001-10-22  Ravi Pratap  <ravi@ximian.com>
22558
22559         * typemanager.cs (ImplementsInterface): New method to determine if a type
22560         implements a given interface. Provides a nice cache too.
22561
22562         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22563         method.
22564
22565         (ConvertReferenceExplicit): Ditto.
22566
22567         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
22568         various methods, with correct names etc.
22569
22570         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
22571         Operator.UnaryNegation.
22572
22573         * cs-parser.jay (operator_declarator): Be a little clever in the case where
22574         we have a unary plus or minus operator.
22575
22576         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
22577         UnaryMinus.
22578
22579         * everywhere : update accordingly.
22580
22581         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22582         respectively.
22583
22584         * class.cs (Method::Define): For the case where we are implementing a method
22585         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
22586         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22587
22588 2001-10-21  Ravi Pratap  <ravi@ximian.com>
22589
22590         * interface.cs (FindMembers): Implement to work around S.R.E
22591         lameness.
22592
22593         * typemanager.cs (IsInterfaceType): Implement.
22594
22595         (FindMembers): Update to handle interface types too.
22596
22597         * expression.cs (ImplicitReferenceConversion): Re-write bits which
22598         use IsAssignableFrom as that is not correct - it doesn't work.
22599
22600         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
22601         and accordingly override EmitStatement.
22602
22603         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
22604         using the correct logic :-)
22605
22606 2001-10-19  Ravi Pratap  <ravi@ximian.com>
22607
22608         * ../errors/cs-11.cs : Add to demonstrate error -11 
22609
22610 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
22611
22612         * assign.cs (Assign::Resolve): Resolve right hand side first, and
22613         then pass this as a hint to ResolveLValue.
22614
22615         * expression.cs (FieldExpr): Add Location information
22616
22617         (FieldExpr::LValueResolve): Report assignment to readonly
22618         variable. 
22619
22620         (Expression::ExprClassFromMemberInfo): Pass location information.
22621
22622         (Expression::ResolveLValue): Add new method that resolves an
22623         LValue. 
22624
22625         (Expression::DoResolveLValue): Default invocation calls
22626         DoResolve. 
22627
22628         (Indexers): New class used to keep track of indexers in a given
22629         Type. 
22630
22631         (IStackStore): Renamed from LValue, as it did not really describe
22632         what this did.  Also ResolveLValue is gone from this interface and
22633         now is part of Expression.
22634
22635         (ElementAccess): Depending on the element access type
22636
22637         * typemanager.cs: Add `indexer_name_type' as a Core type
22638         (System.Runtime.CompilerServices.IndexerNameAttribute)
22639
22640         * statement.cs (Goto): Take a location.
22641
22642 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22643
22644         * delegate.cs (Delegate::VerifyDelegate): New method to verify
22645         if two delegates are compatible.
22646
22647         (NewDelegate::DoResolve): Update to take care of the case when
22648         we instantiate a delegate from another delegate.
22649
22650         * typemanager.cs (FindMembers): Don't even try to look up members
22651         of Delegate types for now.
22652
22653 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22654
22655         * delegate.cs (NewDelegate): New class to take care of delegate
22656         instantiation.
22657
22658         * expression.cs (New): Split the delegate related code out into 
22659         the NewDelegate class.
22660
22661         * delegate.cs (DelegateInvocation): New class to handle delegate 
22662         invocation.
22663
22664         * expression.cs (Invocation): Split out delegate related code into
22665         the DelegateInvocation class.
22666
22667 2001-10-17  Ravi Pratap  <ravi@ximian.com>
22668
22669         * expression.cs (New::DoResolve): Implement delegate creation fully
22670         and according to the spec.
22671
22672         (New::DoEmit): Update to handle delegates differently.
22673
22674         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
22675         because of which we were printing out arguments in reverse order !
22676
22677         * delegate.cs (VerifyMethod): Implement to check if the given method
22678         matches the delegate.
22679
22680         (FullDelegateDesc): Implement.
22681
22682         (VerifyApplicability): Implement.
22683
22684         * expression.cs (Invocation::DoResolve): Update to accordingly handle
22685         delegate invocations too.
22686
22687         (Invocation::Emit): Ditto.
22688
22689         * ../errors/cs1593.cs : Added.
22690
22691         * ../errors/cs1594.cs : Added.
22692
22693         * delegate.cs (InstanceExpression, TargetMethod): New properties.
22694
22695 2001-10-16  Ravi Pratap  <ravi@ximian.com>
22696
22697         * typemanager.cs (intptr_type): Core type for System.IntPtr
22698
22699         (InitCoreTypes): Update for the same.
22700
22701         (iasyncresult_type, asynccallback_type): Ditto.
22702
22703         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
22704         correct.
22705
22706         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
22707         too.
22708
22709         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
22710         the builders for the 4 members of a delegate type :-)
22711
22712         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
22713         type.
22714
22715         * expression.cs (New::DoResolve): Implement guts for delegate creation.
22716
22717         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
22718
22719 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
22720
22721         * statement.cs (Break::Emit): Implement.   
22722         (Continue::Emit): Implement.
22723
22724         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22725         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22726         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22727         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
22728         end loop
22729
22730         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
22731         properties that track the label for the current loop (begin of the
22732         loop and end of the loop).
22733
22734 2001-10-15  Ravi Pratap  <ravi@ximian.com>
22735
22736         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
22737         use of emitting anything at all.
22738
22739         * class.cs, rootcontext.cs : Get rid of calls to the same.
22740
22741         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
22742
22743         (Populate): Define the constructor correctly and set the implementation
22744         attributes.
22745
22746         * typemanager.cs (delegate_types): New hashtable to hold delegates that
22747         have been defined.
22748
22749         (AddDelegateType): Implement.
22750
22751         (IsDelegateType): Implement helper method.
22752
22753         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
22754
22755         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
22756         and accordingly handle it.
22757
22758         * delegate.cs (Populate): Take TypeContainer argument.
22759         Implement bits to define the Invoke method. However, I still haven't figured out
22760         how to take care of the native int bit :-(
22761
22762         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
22763         Qualify the name of the delegate, not its return type !
22764
22765         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
22766         conversion.
22767
22768         (StandardConversionExists): Checking for array types turns out to be recursive.
22769
22770         (ConvertReferenceExplicit): Implement array conversion.
22771
22772         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
22773
22774 2001-10-12  Ravi Pratap  <ravi@ximian.com>
22775
22776         * cs-parser.jay (delegate_declaration): Store the fully qualified
22777         name as it is a type declaration.
22778
22779         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
22780         readonly.
22781
22782         (DefineDelegate): Renamed from Define. Does the same thing essentially,
22783         as TypeContainer::DefineType.
22784
22785         (Populate): Method in which all the definition of the various methods (Invoke)
22786         etc is done.
22787
22788         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
22789         see.
22790
22791         (CloseDelegate): Finally creates the delegate.
22792
22793         * class.cs (TypeContainer::DefineType): Update to define delegates.
22794         (Populate, Emit and CloseType): Do the same thing here too.
22795
22796         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
22797         delegates in all these operations.
22798
22799 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
22800
22801         * expression.cs: LocalTemporary: a new expression used to
22802         reference a temporary that has been created.
22803
22804         * assign.cs: Handle PropertyAccess back here, so that we can
22805         provide the proper semantic access to properties.
22806
22807         * expression.cs (Expression::ConvertReferenceExplicit): Implement
22808         a few more explicit conversions. 
22809
22810         * modifiers.cs: `NEW' modifier maps to HideBySig.
22811
22812         * expression.cs (PropertyExpr): Make this into an
22813         ExpressionStatement, and support the EmitStatement code path. 
22814
22815         Perform get/set error checking, clean up the interface.
22816
22817         * assign.cs: recognize PropertyExprs as targets, and if so, turn
22818         them into toplevel access objects.
22819
22820 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
22821
22822         * expression.cs: PropertyExpr::PropertyExpr: use work around the
22823         SRE.
22824
22825         * typemanager.cs: Keep track here of our PropertyBuilders again to
22826         work around lameness in SRE.
22827
22828 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
22829
22830         * expression.cs (LValue::LValueResolve): New method in the
22831         interface, used to perform a second resolution pass for LValues. 
22832
22833         (This::DoResolve): Catch the use of this in static methods.
22834
22835         (This::LValueResolve): Implement.
22836
22837         (This::Store): Remove warning, assigning to `this' in structures
22838         is 
22839
22840         (Invocation::Emit): Deal with invocation of
22841         methods on value types.  We need to pass the address to structure
22842         methods rather than the object itself.  (The equivalent code to
22843         emit "this" for structures leaves the entire structure on the
22844         stack instead of a pointer to it). 
22845
22846         (ParameterReference::DoResolve): Compute the real index for the
22847         argument based on whether the method takes or not a `this' pointer
22848         (ie, the method is static).
22849
22850         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
22851         value types returned from functions when we need to invoke a
22852         method on the sturcture.
22853
22854
22855 2001-10-11  Ravi Pratap  <ravi@ximian.com>
22856
22857         * class.cs (TypeContainer::DefineType): Method to actually do the business of
22858         defining the type in the Modulebuilder or Typebuilder. This is to take
22859         care of nested types which need to be defined on the TypeBuilder using
22860         DefineNestedMethod.
22861
22862         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
22863         methods in RootContext, only ported to be part of TypeContainer.
22864
22865         (TypeContainer::GetInterfaceOrClass): Ditto.
22866
22867         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
22868
22869         * interface.cs (Interface::DefineInterface): New method. Does exactly
22870         what RootContext.CreateInterface did earlier, only it takes care of nested types 
22871         too.
22872
22873         (Interface::GetInterfaces): Move from RootContext here and port.
22874
22875         (Interface::GetInterfaceByName): Same here.
22876
22877         * rootcontext.cs (ResolveTree): Re-write.
22878
22879         (PopulateTypes): Re-write.
22880
22881         * class.cs (TypeContainer::Populate): Populate nested types too.
22882         (TypeContainer::Emit): Emit nested members too.
22883
22884         * typemanager.cs (AddUserType): Do not make use of the FullName property,
22885         instead just use the name argument passed in as it is already fully
22886         qualified.
22887
22888         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
22889         to TypeContainer mapping to see if a type is user-defined.
22890
22891         * class.cs (TypeContainer::CloseType): Implement. 
22892
22893         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
22894         the default constructor.
22895
22896         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
22897         twice.
22898
22899         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
22900
22901         * interface.cs (CloseType): Create the type here.
22902
22903         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
22904         the hierarchy.
22905
22906         Remove all the methods which are now in TypeContainer.
22907
22908 2001-10-10  Ravi Pratap  <ravi@ximian.com>
22909
22910         * delegate.cs (Define): Re-write bits to define the delegate
22911         correctly.
22912
22913 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
22914
22915         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
22916
22917         * expression.cs (ImplicitReferenceConversion): handle null as well
22918         as a source to convert to any reference type.
22919
22920         * statement.cs (Return): Perform any implicit conversions to
22921         expected return type.  
22922
22923         Validate use of return statement.  
22924
22925         * codegen.cs (EmitContext): Pass the expected return type here.
22926
22927         * class.cs (Method, Constructor, Property): Pass expected return
22928         type to EmitContext.
22929
22930 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
22931
22932         * expression.cs: Make DoResolve take an EmitContext instead of a
22933         TypeContainer.
22934
22935         Replaced `l' and `location' for `loc', for consistency.
22936
22937         (Error, Warning): Remove unneeded Tc argument.
22938
22939         * assign.cs, literal.cs, constant.cs: Update to new calling
22940         convention. 
22941
22942         * codegen.cs: EmitContext now contains a flag indicating whether
22943         code is being generated in a static method or not.
22944
22945         * cs-parser.jay: DecomposeQI, new function that replaces the old
22946         QualifiedIdentifier.  Now we always decompose the assembled
22947         strings from qualified_identifier productions into a group of
22948         memberaccesses.
22949
22950 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
22951
22952         * rootcontext.cs: Deal with field-less struct types correctly now
22953         by passing the size option to Define Type.
22954
22955         * class.cs: Removed hack that created one static field. 
22956
22957 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
22958
22959         * statement.cs: Moved most of the code generation here. 
22960
22961 2001-10-09  Ravi Pratap  <ravi@ximian.com>
22962
22963         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
22964         seem very right.
22965
22966         (ElementAccess): Remove useless bits for now - keep checks as the spec
22967         says.
22968
22969 2001-10-08  Ravi Pratap  <ravi@ximian.com>
22970
22971         * expression.cs (ElementAccess::DoResolve): Remove my crap code
22972         and start performing checks according to the spec.
22973
22974 2001-10-07  Ravi Pratap  <ravi@ximian.com>
22975
22976         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
22977         rank_specifiers instead.
22978
22979         (rank_specifiers): Change the order in which the rank specifiers are stored
22980
22981         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
22982
22983         * expression.cs (ElementAccess): Implement the LValue interface too.
22984
22985 2001-10-06  Ravi Pratap  <ravi@ximian.com>
22986
22987         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
22988         except that user defined conversions are not included.
22989
22990         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
22991         perform the conversion of the return type, if necessary.
22992
22993         (New::DoResolve): Check whether we are creating an array or an object
22994         and accordingly do the needful.
22995
22996         (New::Emit): Same here.
22997
22998         (New::DoResolve): Implement guts of array creation.
22999
23000         (New::FormLookupType): Helper function.
23001
23002 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23003
23004         * codegen.cs: Removed most of the code generation here, and move the
23005         corresponding code generation bits to the statement classes. 
23006
23007         Added support for try/catch/finalize and throw.
23008
23009         * cs-parser.jay: Added support for try/catch/finalize.
23010
23011         * class.cs: Catch static methods having the flags override,
23012         virtual or abstract.
23013
23014         * expression.cs (UserCast): This user cast was not really doing
23015         what it was supposed to do.  Which is to be born in fully resolved
23016         state.  Parts of the resolution were being performed at Emit time! 
23017
23018         Fixed this code.
23019
23020 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23021
23022         * expression.cs: Implicity convert the result from UserCast.
23023
23024 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23025
23026         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
23027         prevented it from working correctly. 
23028
23029         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
23030         merely ConvertImplicit.
23031
23032 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23033
23034         * typemanager.cs: Make the LookupTypeContainer function static,
23035         and not per-instance.  
23036
23037         * class.cs: Make static FindMembers (the one that takes a Type
23038         argument). 
23039
23040         * codegen.cs: Add EmitForeach here.
23041
23042         * cs-parser.jay: Make foreach a toplevel object instead of the
23043         inline expansion, as we need to perform semantic analysis on it. 
23044
23045 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23046
23047         * expression.cs (Expression::ImplicitUserConversion): Rename to
23048         UserDefinedConversion.
23049
23050         (Expression::UserDefinedConversion): Take an extra argument specifying 
23051         whether we look for explicit user conversions too.
23052
23053         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
23054
23055         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
23056
23057         (ExplicitUserConversion): Make it a call to UserDefinedConversion
23058         with the appropriate arguments.
23059
23060         * cs-parser.jay (cast_expression): Record location too.
23061
23062         * expression.cs (Cast): Record location info.
23063
23064         (Expression::ConvertExplicit): Take location argument.
23065
23066         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
23067         to determine if we are doing explicit conversions.
23068
23069         (UserCast::Emit): Update accordingly.
23070
23071         (Expression::ConvertExplicit): Report an error if everything fails.
23072
23073         * ../errors/cs0030.cs : Add.
23074
23075 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
23076
23077         * modifiers.cs: If the ABSTRACT keyword is present, also set the
23078         virtual and newslot bits. 
23079
23080         * class.cs (TypeContainer::RegisterRequiredImplementations):
23081         Record methods we need.
23082
23083         (TypeContainer::MakeKey): Helper function to make keys for
23084         MethodBases, since the Methodbase key is useless.
23085
23086         (TypeContainer::Populate): Call RegisterRequiredImplementations
23087         before defining the methods.   
23088
23089         Create a mapping for method_builders_to_methods ahead of time
23090         instead of inside a tight loop.
23091
23092         (::RequireMethods):  Accept an object as the data to set into the
23093         hashtable so we can report interface vs abstract method mismatch.
23094
23095 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23096
23097         * report.cs: Make all of it static.
23098
23099         * rootcontext.cs: Drop object_type and value_type computations, as
23100         we have those in the TypeManager anyways.
23101
23102         Drop report instance variable too, now it is a global.
23103
23104         * driver.cs: Use try/catch on command line handling.
23105
23106         Add --probe option to debug the error reporting system with a test
23107         suite. 
23108
23109         * report.cs: Add support for exiting program when a probe
23110         condition is reached.
23111
23112 2001-10-03  Ravi Pratap  <ravi@ximian.com>
23113
23114         * expression.cs (Binary::DoNumericPromotions): Fix the case when
23115         we do a forcible conversion regardless of type, to check if 
23116         ForceConversion returns a null.
23117
23118         (Binary::error19): Use location to report error.
23119
23120         (Unary::error23): Use location here too.
23121
23122         * ../errors/cs0019.cs : Check in.
23123
23124         * ../errors/cs0023.cs : Check in.
23125
23126         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
23127         case of a non-null MethodInfo object with a length of 0 !
23128
23129         (Binary::ResolveOperator): Flag error if overload resolution fails to find
23130         an applicable member - according to the spec :-)
23131         Also fix logic to find members in base types.
23132
23133         (Unary::ResolveOperator): Same here.
23134
23135         (Unary::report23): Change name to error23 and make first argument a TypeContainer
23136         as I was getting thoroughly confused between this and error19 :-)
23137
23138         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
23139         (::FindMostEncompassedType): Implement.
23140         (::FindMostEncompassingType): Implement.
23141         (::StandardConversionExists): Implement.
23142
23143         (UserImplicitCast): Re-vamp. We now need info about most specific
23144         source and target types so that we can do the necessary conversions.
23145
23146         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
23147         mathematical union with no duplicates.
23148
23149 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23150
23151         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
23152         in order from base classes to child classes, so that we can in
23153         child classes look up in our parent for method names and
23154         attributes (required for handling abstract, virtual, new, override
23155         constructs: we need to instrospect our base class, and if we dont
23156         populate the classes in order, the introspection might be
23157         incorrect.  For example, a method could query its parent before
23158         the parent has any methods and would determine that the parent has
23159         no abstract methods (while it could have had them)).
23160
23161         (RootContext::CreateType): Record the order in which we define the
23162         classes.
23163
23164 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
23165
23166         * class.cs (TypeContainer::Populate): Also method definitions can
23167         fail now, keep track of this.
23168
23169         (TypeContainer::FindMembers): Implement support for
23170         DeclaredOnly/noDeclaredOnly flag.
23171
23172         (Constructor::Emit) Return the ConstructorBuilder.
23173
23174         (Method::Emit) Return the MethodBuilder. 
23175         Check for abstract or virtual methods to be public.
23176
23177         * rootcontext.cs (RootContext::CreateType): Register all the
23178         abstract methods required for the class to be complete and the
23179         interface methods that must be implemented. 
23180
23181         * cs-parser.jay: Report error 501 (method requires body if it is
23182         not marked abstract or extern).
23183
23184         * expression.cs (TypeOf::Emit): Implement.
23185
23186         * typemanager.cs: runtime_handle_type, new global type.
23187
23188         * class.cs (Property::Emit): Generate code for properties.
23189
23190 2001-10-02  Ravi Pratap  <ravi@ximian.com>
23191
23192         * expression.cs (Unary::ResolveOperator): Find operators on base type
23193         too - we now conform exactly to the spec.
23194
23195         (Binary::ResolveOperator): Same here.
23196
23197         * class.cs (Operator::Define): Fix minor quirk in the tests.
23198
23199         * ../errors/cs0215.cs : Added.
23200
23201         * ../errors/cs0556.cs : Added.
23202
23203         * ../errors/cs0555.cs : Added.
23204
23205 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23206
23207         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
23208         single integer which is really efficient
23209
23210 2001-10-01  Ravi Pratap  <ravi@ximian.com>
23211
23212         *  expression.cs (Expression::ImplicitUserConversion): Use location
23213         even in the case when we are examining True operators.
23214  
23215         * class.cs (Operator::Define): Perform extensive checks to conform
23216         with the rules for operator overloading in the spec.
23217
23218         * expression.cs (Expression::ImplicitReferenceConversion): Implement
23219         some of the other conversions mentioned in the spec.
23220
23221         * typemanager.cs (array_type): New static member for the System.Array built-in
23222         type.
23223
23224         (cloneable_interface): For System.ICloneable interface.
23225
23226         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
23227         we start resolving the tree and populating types.
23228
23229         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
23230  
23231 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23232
23233         * expression.cs (Expression::ExprClassFromMemberInfo,
23234         Expression::Literalize): Create literal expressions from
23235         FieldInfos which are literals.
23236
23237         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
23238         type casts, because they were wrong.  The test suite in tests
23239         caught these ones.
23240
23241         (ImplicitNumericConversion): ushort to ulong requires a widening
23242         cast. 
23243
23244         Int32 constant to long requires widening cast as well.
23245
23246         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
23247         for integers because the type on the stack is not i4.
23248
23249 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
23250
23251         * expression.cs (report118): require location argument. 
23252
23253         * parameter.cs: Do not dereference potential null value.
23254
23255         * class.cs: Catch methods that lack the `new' keyword when
23256         overriding a name.  Report warnings when `new' is used without
23257         anything being there to override.
23258
23259         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
23260
23261         * class.cs: Only add constructor to hashtable if it is non-null
23262         (as now constructors can fail on define).
23263
23264         (TypeManager, Class, Struct): Take location arguments.
23265
23266         Catch field instance initialization in structs as errors.
23267
23268         accepting_filter: a new filter for FindMembers that is static so
23269         that we dont create an instance per invocation.
23270
23271         (Constructor::Define): Catch errors where a struct constructor is
23272         parameterless 
23273
23274         * cs-parser.jay: Pass location information for various new
23275         constructs. 
23276
23277         * delegate.cs (Delegate): take a location argument.
23278
23279         * driver.cs: Do not call EmitCode if there were problesm in the
23280         Definition of the types, as many Builders wont be there. 
23281
23282         * decl.cs (Decl::Decl): Require a location argument.
23283
23284         * cs-tokenizer.cs: Handle properly hex constants that can not fit
23285         into integers, and find the most appropiate integer for it.
23286
23287         * literal.cs: Implement ULongLiteral.
23288
23289         * rootcontext.cs: Provide better information about the location of
23290         failure when CreateType fails.
23291
23292 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
23293
23294         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23295         as well.
23296
23297         * expression.cs (Binary::CheckShiftArguments): Add missing type
23298         computation.
23299         (Binary::ResolveOperator): Add type to the logical and and logical
23300         or, Bitwise And/Or and Exclusive Or code paths, it was missing
23301         before.
23302
23303         (Binary::DoNumericPromotions): In the case where either argument
23304         is ulong (and most signed types combined with ulong cause an
23305         error) perform implicit integer constant conversions as well.
23306
23307 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23308
23309         * expression.cs (UserImplicitCast): Method should always be
23310         non-null. 
23311         (Invocation::BetterConversion): Simplified test for IntLiteral.
23312
23313         (Expression::ImplicitNumericConversion): Split this routine out.
23314         Put the code that performs implicit constant integer conversions
23315         here. 
23316
23317         (Expression::Resolve): Become a wrapper around DoResolve so we can
23318         check eclass and type being set after resolve.
23319
23320         (Invocation::Badness): Remove this dead function
23321
23322         (Binary::ResolveOperator): Do not compute the expensive argumnets
23323         unless we have a union for it.
23324
23325         (Probe::Emit): Is needs to do an isinst and then
23326         compare against null.
23327
23328         (::CanConvert): Added Location argument.  If the Location argument
23329         is null (Location.Null), then we do not report errors.  This is
23330         used by the `probe' mechanism of the Explicit conversion.  We do
23331         not want to generate an error for something that the user
23332         explicitly requested to be casted.  But the pipeline for an
23333         explicit cast first tests for potential implicit casts.
23334
23335         So for now, if the Location is null, it means `Probe only' to
23336         avoid adding another argument.   Might have to revise this
23337         strategy later.
23338
23339         (ClassCast): New class used to type cast objects into arbitrary
23340         classes (used in Explicit Reference Conversions).
23341
23342         Implement `as' as well.
23343
23344         Reverted all the patches from Ravi below: they were broken:
23345
23346                 * The use of `level' as a mechanism to stop recursive
23347                   invocations is wrong.  That was there just to catch the
23348                   bug with a strack trace but not as a way of addressing
23349                   the problem.
23350
23351                   To fix the problem we have to *understand* what is going
23352                   on and the interactions and come up with a plan, not
23353                   just get things going.
23354
23355                 * The use of the type conversion cache that I proposed
23356                   last night had an open topic: How does this work across
23357                   protection domains.  A user defined conversion might not
23358                   be public in the location where we are applying the
23359                   conversion, a different conversion might be selected
23360                   (ie, private A->B (better) but public B->A (worse),
23361                   inside A, A->B applies, but outside it, B->A will
23362                   apply).
23363
23364                 * On top of that (ie, even if the above is solved),
23365                   conversions in a cache need to be abstract.  Ie, `To
23366                   convert from an Int to a Short use an OpcodeCast', not
23367                   `To convert from an Int to a Short use the OpcodeCast on
23368                   the variable 5' (which is what this patch was doing).
23369
23370 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23371
23372         * expression.cs (Invocation::ConversionExists): Re-write to use
23373         the conversion cache
23374
23375         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23376         cache all conversions done, not just user-defined ones.
23377
23378         (Invocation::BetterConversion): The real culprit. Use ConversionExists
23379         to determine if a conversion exists instead of acutually trying to 
23380         perform the conversion. It's faster too.
23381
23382         (Expression::ConvertExplicit): Modify to use ConversionExists to check
23383         and only then attempt the implicit conversion.
23384
23385 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23386
23387         * expression.cs (ConvertImplicit): Use a cache for conversions
23388         already found. Check level of recursion and bail out if necessary.
23389
23390 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23391
23392         * typemanager.cs (string_concat_string_string, string_concat_object_object):
23393         Export standard methods that we expect for string operations.
23394
23395         * statement.cs (Block::UsageWarning): Track usage of variables and
23396         report the errors for not used variables.
23397
23398         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23399         operator. 
23400
23401 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23402
23403         * codegen.cs: remove unnneded code 
23404
23405         * expression.cs: Removed BuiltinTypeAccess class
23406
23407         Fix the order in which implicit conversions are
23408         done.  
23409
23410         The previous fixed dropped support for boxed conversions (adding a
23411         test to the test suite now)
23412
23413         (UserImplicitCast::CanConvert): Remove test for source being null,
23414         that code is broken.  We should not feed a null to begin with, if
23415         we do, then we should track the bug where the problem originates
23416         and not try to cover it up here.
23417
23418         Return a resolved expression of type UserImplicitCast on success
23419         rather than true/false.  Ravi: this is what I was talking about,
23420         the pattern is to use a static method as a "constructor" for
23421         objects. 
23422
23423         Also, do not create arguments until the very last minute,
23424         otherwise we always create the arguments even for lookups that
23425         will never be performed. 
23426
23427         (UserImplicitCast::Resolve): Eliminate, objects of type
23428         UserImplicitCast are born in a fully resolved state. 
23429
23430         * typemanager.cs (InitCoreTypes): Init also value_type
23431         (System.ValueType). 
23432
23433         * expression.cs (Cast::Resolve): First resolve the child expression.
23434
23435         (LValue): Add new method AddressOf to be used by
23436         the `&' operator.  
23437
23438         Change the argument of Store to take an EmitContext instead of an
23439         ILGenerator, because things like FieldExpr need to be able to call
23440         their children expression to generate the instance code. 
23441
23442         (Expression::Error, Expression::Warning): Sugar functions for
23443         reporting errors.
23444
23445         (Expression::MemberLookup): Accept a TypeContainer instead of a
23446         Report as the first argument.
23447
23448         (Expression::ResolvePrimary): Killed.  I still want to improve
23449         this as currently the code is just not right.
23450
23451         (Expression::ResolveMemberAccess): Simplify, but it is still
23452         wrong. 
23453
23454         (Unary::Resolve): Catch errors in AddressOf operators.
23455
23456         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23457         index to a byte for the short-version, or the compiler will choose
23458         the wrong Emit call, which generates the wrong data.
23459
23460         (ParameterReference::Emit, ::Store): same.
23461
23462         (FieldExpr::AddressOf): Implement.
23463
23464         * typemanager.cs: TypeManager: made public variable instead of
23465         property.
23466
23467         * driver.cs: document --fatal.
23468
23469         * report.cs (ErrorMessage, WarningMessage): new names for the old
23470         Error and Warning classes.
23471
23472         * cs-parser.jay (member_access): Turn built-in access to types
23473         into a normal simplename
23474
23475 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23476
23477         * expression.cs (Invocation::BetterConversion): Fix to cope
23478         with q being null, since this was introducing a bug.
23479
23480         * expression.cs (ConvertImplicit): Do built-in conversions first.
23481
23482 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23483
23484         * expression.cs (UserImplicitCast::Resolve): Fix bug.
23485
23486 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23487
23488         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23489         I had introduced long ago (what's new ?).
23490
23491         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
23492         the work of all the checking. 
23493         (ConvertImplicit): Call CanConvert and only then create object if necessary.
23494         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23495
23496         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23497         that is the right way. 
23498
23499         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
23500         overloading resolution. Use everywhere instead of cutting and pasting code.
23501
23502         (Binary::ResolveOperator): Use MakeUnionSet.
23503
23504         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
23505         we have to convert to bool types. Not complete yet.
23506
23507 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23508
23509         * typemanager.cs (TypeManager::CSharpName): support ushort.
23510
23511         * expression.cs (Expression::TryImplicitIntConversion): Attempts
23512         to provide an expression that performsn an implicit constant int
23513         conversion (section 6.1.6).
23514         (Expression::ConvertImplicitRequired): Reworked to include
23515         implicit constant expression conversions.
23516
23517         (Expression::ConvertNumericExplicit): Finished.
23518
23519         (Invocation::Emit): If InstanceExpression is null, then it means
23520         that we perform a call on this.
23521
23522 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23523
23524         * expression.cs (Unary::Emit): Remove some dead code.
23525         (Probe): Implement Resolve and Emit for `is'.
23526         (Expression::ConvertImplicitRequired): Attempt to do constant
23527         expression conversions here.  Maybe should be moved to
23528         ConvertImplicit, but I am not sure.
23529         (Expression::ImplicitLongConstantConversionPossible,
23530         Expression::ImplicitIntConstantConversionPossible): New functions
23531         that tell whether is it possible to apply an implicit constant
23532         expression conversion.
23533
23534         (ConvertNumericExplicit): Started work on explicit numeric
23535         conversions.
23536
23537         * cs-parser.jay: Update operator constants.
23538
23539         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23540         (Parameters::GetSignature): Hook up VerifyArgs here.
23541         (Parameters::VerifyArgs): Verifies that no two arguments have the
23542         same name. 
23543
23544         * class.cs (Operator): Update the operator names to reflect the
23545         ones that the spec expects (as we are just stringizing the
23546         operator names).
23547
23548         * expression.cs (Unary::ResolveOperator): Fix bug: Use
23549         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23550         previous usage did only work for our methods.
23551         (Expression::ConvertImplicit): Handle decimal implicit numeric
23552         conversions as well.
23553         (Expression::InternalTypeConstructor): Used to invoke constructors
23554         on internal types for default promotions.
23555
23556         (Unary::Emit): Implement special handling for the pre/post
23557         increment/decrement for overloaded operators, as they need to have
23558         the same semantics as the other operators.
23559
23560         (Binary::ResolveOperator): ditto.
23561         (Invocation::ConversionExists): ditto.
23562         (UserImplicitCast::Resolve): ditto.
23563
23564 2001-09-26  Ravi Pratap  <ravi@ximian.com>
23565
23566         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23567         operator, return after emitting body. Regression tests pass again !
23568
23569         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23570         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23571         (Invocation::OverloadResolve): Ditto.
23572         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23573
23574         * everywhere : update calls to the above methods accordingly.
23575
23576 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23577
23578         * assign.cs (Assign): Make it inherit from ExpressionStatement.
23579
23580         * expression.cs (ExpressionStatement): New base class used for
23581         expressions that can appear in statements, so that we can provide
23582         an alternate path to generate expression that do not leave a value
23583         on the stack.
23584
23585         (Expression::Emit, and all the derivatives): We no longer return
23586         whether a value is left on the stack or not.  Every expression
23587         after being emitted leaves a single value on the stack.
23588
23589         * codegen.cs (EmitContext::EmitStatementExpression): Use the
23590         facilties of ExpressionStatement if possible.
23591
23592         * cs-parser.jay: Update statement_expression.
23593
23594 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
23595
23596         * driver.cs: Change the wording of message
23597
23598 2001-09-25  Ravi Pratap  <ravi@ximian.com>
23599
23600         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
23601         the type of the expression to the return type of the method if
23602         we have an overloaded operator match ! The regression tests pass again !
23603         (Unary::ResolveOperator): Ditto.
23604
23605         * expression.cs (Invocation::ConversionExists): Correct the member lookup
23606         to find "op_Implicit", not "implicit" ;-)
23607         (UserImplicitCast): New class to take care of user-defined implicit conversions.
23608         (ConvertImplicit, ForceConversion): Take TypeContainer argument
23609
23610         * everywhere : Correct calls to the above accordingly.
23611
23612         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
23613         (ConvertImplicit): Do user-defined conversion if it exists.
23614
23615 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
23616
23617         * assign.cs: track location.
23618         (Resolve): Use implicit conversions on assignment.
23619
23620         * literal.cs: Oops.  Not good, Emit of short access values should
23621         pass (Bytes) or the wrong argument will be selected.
23622
23623         * expression.cs (Unary::Emit): Emit code for -expr.
23624
23625         (Unary::ResolveOperator): Handle `Substract' for non-constants
23626         (substract from zero from the non-constants).
23627         Deal with Doubles as well. 
23628
23629         (Expression::ConvertImplicitRequired): New routine that reports an
23630         error if no implicit conversion exists. 
23631
23632         (Invocation::OverloadResolve): Store the converted implicit
23633         expressions if we make them
23634
23635 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23636
23637         * class.cs (ConstructorInitializer): Take a Location argument.
23638         (ConstructorBaseInitializer): Same here.
23639         (ConstructorThisInitializer): Same here.
23640
23641         * cs-parser.jay : Update all calls accordingly.
23642
23643         * expression.cs (Unary, Binary, New): Take location argument.
23644         Update accordingly everywhere.
23645
23646         * cs-parser.jay : Update all calls to the above to take a location
23647         argument.
23648
23649         * class.cs : Ditto.
23650
23651 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23652
23653         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
23654         (Invocation::BetterConversion): Same here
23655         (Invocation::ConversionExists): Ditto.
23656
23657         (Invocation::ConversionExists): Implement.
23658
23659 2001-09-22  Ravi Pratap  <ravi@ximian.com>
23660
23661         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
23662         Also take an additional TypeContainer argument.
23663
23664         * All over : Pass in TypeContainer as argument to OverloadResolve.
23665
23666         * typemanager.cs (CSharpName): Update to check for the string type and return
23667         that too.
23668
23669         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
23670         a given method.
23671
23672 2001-09-21  Ravi Pratap  <ravi@ximian.com>
23673
23674         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
23675         (Invocation::BetterFunction): Implement.
23676         (Invocation::BetterConversion): Implement.
23677         (Invocation::ConversionExists): Skeleton, no implementation yet.
23678
23679         Okay, things work fine !
23680
23681 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
23682
23683         * typemanager.cs: declare and load enum_type, delegate_type and
23684         void_type. 
23685
23686         * expression.cs (Expression::Emit): Now emit returns a value that
23687         tells whether a value is left on the stack or not.  This strategy
23688         might be reveted tomorrow with a mechanism that would address
23689         multiple assignments.
23690         (Expression::report118): Utility routine to report mismatches on
23691         the ExprClass.
23692
23693         (Unary::Report23): Report impossible type/operator combination
23694         utility function.
23695
23696         (Unary::IsIncrementableNumber): Whether the type can be
23697         incremented or decremented with add.
23698         (Unary::ResolveOperator): Also allow enumerations to be bitwise
23699         complemented. 
23700         (Unary::ResolveOperator): Implement ++, !, ~,
23701
23702         (Invocation::Emit): Deal with new Emit convetion.
23703
23704         * All Expression derivatives: Updated their Emit method to return
23705         whether they leave values on the stack or not.
23706
23707         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
23708         stack for expressions that are statements. 
23709
23710 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
23711
23712         * expression.cs (LValue): New interface.  Must be implemented by
23713         LValue objects.
23714         (LocalVariableReference, ParameterReference, FieldExpr): Implement
23715         LValue interface.
23716
23717         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
23718         interface for generating code, simplifies the code.
23719
23720 2001-09-20  Ravi Pratap  <ravi@ximian.com>
23721
23722         * expression.cs (everywhere): Comment out return statements in ::Resolve
23723         methods to avoid the warnings.
23724
23725 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
23726
23727         * driver.cs (parse): Report error 2001 if we can not open the
23728         source file.
23729
23730         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
23731         not resolve it.
23732
23733         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
23734         object. 
23735
23736         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
23737         otherwise nested blocks end up with the same index.
23738
23739         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
23740
23741         * expression.cs:  Instead of having FIXMEs in the Resolve
23742         functions, throw exceptions so it is obvious that we are facing a
23743         bug. 
23744
23745         * cs-parser.jay (invocation_expression): Pass Location information.
23746
23747         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
23748         Use a basename for those routines because .NET does not like paths
23749         on them. 
23750
23751         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
23752         already defined.
23753
23754 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
23755
23756         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
23757         are loading the correct data types (throws an exception if not).
23758         (TypeManager::InitCoreTypes): Use CoreLookupType
23759
23760         * expression.cs (Unary::ResolveOperator): return the child
23761         expression for expressions which are just +expr.
23762         (Unary::ResolveOperator): Return negative literals for -LITERAL
23763         expressions (otherwise they are Unary {Literal}).
23764         (Invocation::Badness): Take into account `Implicit constant
23765         expression conversions'.
23766
23767         * literal.cs (LongLiteral): Implement long literal class.
23768         (IntLiteral): export the `Value' of the intliteral. 
23769
23770 2001-09-19  Ravi Pratap  <ravi@ximian.com>
23771
23772         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
23773
23774         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
23775         instead of 'Operator'
23776
23777         * expression.cs (Binary::ResolveOperator): Update accordingly.
23778         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
23779         and 'Minus'
23780
23781         * cs-parser.jay (unary_expression): Update to use the new names.
23782
23783         * gen-treedump.cs (GetUnary): Same here.
23784
23785         * expression.cs (Unary::Resolve): Implement.
23786         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
23787         operators are found instead of making noise ;-)
23788         (Unary::ResolveOperator): New method to do precisely the same thing which
23789         Binary::ResolveOperator does for Binary expressions.
23790         (Unary.method, .Arguments): Add.
23791         (Unary::OperName): Implement.   
23792         (Unary::ForceConversion): Copy and Paste !
23793
23794         * class.cs (Operator::Define): Fix a small bug for the case when we have 
23795         a unary operator.
23796
23797         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
23798         for the inbuilt operators. Only overloading works for now ;-)
23799
23800 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
23801
23802         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
23803         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
23804
23805         * expression.cs (This::Emit): Implement. 
23806         (This::Resolve): Implement.
23807         (TypeOf:Resolve): Implement.
23808         (Expression::ResolveSimpleName): Add an implicit this to instance
23809         field references. 
23810         (MemberAccess::Resolve): Deal with Parameters and Fields. 
23811         Bind instance variable to Field expressions.
23812         (FieldExpr::Instance): New field used to track the expression that
23813         represents the object instance.
23814         (FieldExpr::Resolve): Track potential errors from MemberLookup not
23815         binding 
23816         (FieldExpr::Emit): Implement.
23817
23818         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
23819         the last instruction contains a return opcode to avoid generating
23820         the last `ret' instruction (this generates correct code, and it is
23821         nice to pass the peverify output).
23822
23823         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
23824         initializer for static and instance variables.
23825         (Constructor::Emit): Allow initializer to be null in the case of
23826         static constructors.  Only emit initializer for instance
23827         constructors. 
23828
23829         (TypeContainer::FindMembers): Return a null array if there are no
23830         matches.
23831
23832         Also fix the code for the MemberTypes.Method branch, as it was not
23833         scanning that for operators (or tried to access null variables before).
23834
23835         * assign.cs (Assign::Emit): Handle instance and static fields. 
23836
23837         * TODO: Updated.
23838
23839         * driver.cs: Stop compilation if there are parse errors.
23840
23841         * cs-parser.jay (constructor_declaration): Provide default base
23842         initializer for non-static constructors.
23843         (constructor_declarator): Do not provide a default base
23844         initializers if none was specified.
23845         Catch the fact that constructors should not have parameters.
23846
23847         * class.cs: Do not emit parent class initializers for static
23848         constructors, that should be flagged as an error.
23849
23850 2001-09-18  Ravi Pratap  <ravi@ximian.com>
23851
23852         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
23853         Move back code into TypeContainer::Populate.
23854
23855 2001-09-18  Ravi Pratap  <ravi@ximian.com>
23856
23857         * class.cs (TypeContainer::AddConstructor): Fix the check to
23858         compare against Name, not Basename. 
23859         (Operator::OpType): Change Plus and Minus to Add and Subtract.
23860
23861         * cs-parser.jay : Update accordingly.
23862
23863         * class.cs (TypeContainer::FindMembers): For the case where we are searching
23864         for methods, don't forget to look into the operators too.
23865         (RegisterMethodBuilder): Helper method to take care of this for
23866         methods, constructors and operators.
23867         (Operator::Define): Completely revamp.
23868         (Operator.OperatorMethod, MethodName): New fields.
23869         (TypeContainer::Populate): Move the registering of builders into
23870         RegisterMethodBuilder.
23871         (Operator::Emit): Re-write.
23872
23873         * expression.cs (Binary::Emit): Comment out code path to emit method
23874         invocation stuff for the case when we have a user defined operator. I am
23875         just not able to get it right !
23876
23877 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
23878
23879         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
23880         argument. 
23881
23882         (Expression::MemberLookup): Provide a version that allows to
23883         specify the MemberTypes and BindingFlags. 
23884
23885         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
23886         so it was not fetching variable information from outer blocks.
23887
23888         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
23889         Beforefieldinit as it was buggy.
23890
23891         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
23892         that Ravi put here.  
23893
23894         * class.cs (Constructor::Emit): Only emit if block is not null.
23895         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
23896         deal with this by semantically definining it as if the user had
23897         done it.
23898
23899         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
23900         constructors as we now "emit" them at a higher level.
23901
23902         (TypeContainer::DefineDefaultConstructor): Used to define the
23903         default constructors if none was provided.
23904
23905         (ConstructorInitializer): Add methods Resolve and Emit. 
23906
23907         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
23908
23909 2001-09-17  Ravi Pratap  <ravi@ximian.com>
23910
23911         * class.cs (TypeContainer::EmitDefaultConstructor): Register
23912         the default constructor builder with our hashtable for methodbuilders
23913         to methodcores.
23914
23915         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
23916         and argument_count is 0 in which case we have a match.
23917         (Binary::ResolveOperator): More null checking and miscellaneous coding
23918         style cleanup.
23919
23920 2001-09-17  Ravi Pratap  <ravi@ximian.com>
23921
23922         * rootcontext.cs (IsNameSpace): Compare against null.
23923
23924         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
23925
23926         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
23927         and Unary::Operator.
23928
23929         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
23930         accordingly.
23931
23932         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
23933         we have overloaded operators.
23934         (Binary::ResolveOperator): Implement the part which does the operator overload
23935         resolution.
23936
23937         * class.cs (Operator::Emit): Implement.
23938         (TypeContainer::Emit): Emit the operators we have too.
23939
23940         * expression.cs (Binary::Emit): Update to emit the appropriate code for
23941         the case when we have a user-defined operator.
23942
23943 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
23944
23945         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
23946
23947 2001-09-16  Ravi Pratap  <ravi@ximian.com>
23948
23949         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
23950         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
23951         (Constructor::Emit): Implement.
23952         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
23953         if we have no work to do. 
23954         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
23955         Emit method.
23956
23957         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
23958         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
23959
23960         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
23961         of parent.parent.
23962
23963 2001-09-15  Ravi Pratap  <ravi@ximian.com>
23964
23965         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
23966         in the source.
23967         (Tree::RecordNamespace): Method to do what the name says ;-)
23968         (Tree::Namespaces): Property to get at the namespaces hashtable.
23969
23970         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
23971         keep track.
23972
23973         * rootcontext.cs (IsNamespace): Fixed it :-)
23974
23975 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
23976
23977         * class.cs (TypeContainer::FindMembers): Add support for
23978         constructors. 
23979         (MethodCore): New class that encapsulates both the shared aspects
23980         of a Constructor and a Method.  
23981         (Method, Constructor): Factored pieces into MethodCore.
23982
23983         * driver.cs: Added --fatal which makes errors throw exceptions.
23984         Load System assembly as well as part of the standard library.
23985
23986         * report.cs: Allow throwing exceptions on errors for debugging.
23987
23988         * modifiers.cs: Do not use `parent', instead use the real type
23989         container to evaluate permission settings.
23990
23991         * class.cs: Put Ravi's patch back in.  He is right, and we will
23992         have to cope with the
23993
23994 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23995
23996         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
23997         FamORAssem, not FamANDAssem.
23998
23999 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24000
24001         * driver.cs: Added --parse option that only parses its input files
24002         and terminates.
24003
24004         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
24005         incorrect.  IsTopLevel is not used to tell whether an object is
24006         root_types or not (that can be achieved by testing this ==
24007         root_types).  But to see if this is a top-level *class* (not
24008         necessarly our "toplevel" container). 
24009
24010 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24011
24012         * enum.cs (Enum::Define): Modify to call the Lookup method on the
24013         parent instead of a direct call to GetType.
24014
24015 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24016
24017         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
24018         Modifiers.TypeAttr. This should just be a call to that method.
24019
24020         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
24021         object so that we can determine if we are top-level or not.
24022
24023         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
24024         TypeContainer too.
24025
24026         * enum.cs (Enum::Define): Ditto.
24027
24028         * modifiers.cs (FieldAttr): Re-write.
24029
24030         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
24031         (TypeContainer::HaveStaticConstructor): New property to provide access
24032         to precisely that info.
24033
24034         * modifiers.cs (MethodAttr): Re-write.
24035         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
24036
24037         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
24038         of top-level types as claimed.
24039
24040 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24041
24042         * expression.cs (MemberLookup): Fruitless attempt to lookup
24043         constructors.  Maybe I need to emit default constructors?  That
24044         might be it (currently .NET emits this for me automatically).
24045         (Invocation::OverloadResolve): Cope with Arguments == null.
24046         (Invocation::EmitArguments): new function, shared by the new
24047         constructor and us.
24048         (Invocation::Emit): Handle static and instance methods.  Emit
24049         proper call instruction for virtual or non-virtual invocations.
24050         (New::Emit): Implement.
24051         (New::Resolve): Implement.
24052         (MemberAccess:Resolve): Implement.
24053         (MethodGroupExpr::InstanceExpression): used conforming to the spec
24054         to track instances.
24055         (FieldExpr::Resolve): Set type.
24056
24057         * support.cs: Handle empty arguments.
24058                 
24059         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
24060         SimpleLookup): Auxiliary routines to help parse a qualifier
24061         identifier.  
24062
24063         Update qualifier_identifier rule.
24064
24065         * codegen.cs: Removed debugging messages.
24066
24067         * class.cs: Make this a global thing, this acts just as a "key" to
24068         objects that we might have around.
24069
24070         (Populate): Only initialize method_builders_to_methods once.
24071
24072         * expression.cs (PropertyExpr): Initialize type from the
24073         PropertyType. 
24074
24075         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
24076         Resolve pattern.  Attempt to implicitly convert value to boolean.
24077         Emit code.
24078
24079         * expression.cs: Set the type for the int32/int32 argument case.
24080         (Binary::ResolveOperator): Set the return type to boolean for
24081         comparission operators
24082
24083         * typemanager.cs: Remove debugging print code.
24084
24085         (Invocation::Resolve): resolve type.
24086
24087         * class.cs: Allocate a MemberInfo of the correct size, as the code
24088         elsewhere depends on the test to reflect the correct contents.
24089
24090         (Method::) Keep track of parameters, due to System.Reflection holes
24091
24092         (TypeContainer::Populate): Keep track of MethodBuilders to Method
24093         mapping here.
24094
24095         (TypeContainer::FindMembers): Use ArrayList and then copy an array
24096         of the exact size and return that.
24097
24098         (Class::LookupMethodByBuilder): New function that maps
24099         MethodBuilders to its methods.  Required to locate the information
24100         on methods because System.Reflection bit us again.
24101
24102         * support.cs: New file, contains an interface ParameterData and
24103         two implementations: ReflectionParameters and InternalParameters
24104         used to access Parameter information.  We will need to grow this
24105         as required.
24106
24107         * expression.cs (Invocation::GetParameterData): implement a cache
24108         and a wrapper around the ParameterData creation for methods. 
24109         (Invocation::OverloadResolve): Use new code.
24110
24111 2001-09-13  Ravi Pratap  <ravi@ximian.com>
24112
24113         * class.cs (TypeContainer::EmitField): Remove and move into 
24114         (Field::Define): here and modify accordingly.
24115         (Field.FieldBuilder): New member.
24116         (TypeContainer::Populate): Update accordingly.
24117         (TypeContainer::FindMembers): Implement.
24118
24119 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24120
24121         * statement.cs: (VariableInfo::VariableType): New field to be
24122         initialized with the full type once it is resolved. 
24123
24124 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
24125
24126         * parameter.cs (GetParameterInfo): Use a type cache to compute
24127         things only once, and to reuse this information
24128
24129         * expression.cs (LocalVariableReference::Emit): Implement.
24130         (OpcodeCast::Emit): fix.
24131
24132         (ParameterReference::Resolve): Implement.
24133         (ParameterReference::Emit): Implement.
24134
24135         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
24136         that are expressions need to stay as Expressions.
24137
24138         * typemanager.cs (CSharpName): Returns the C# name of a type if
24139         possible. 
24140
24141         * expression.cs (Expression::ConvertImplicit): New function that
24142         implements implicit type conversions.
24143
24144         (Expression::ImplicitReferenceConversion): Implements implicit
24145         reference conversions.
24146
24147         (EmptyCast): New type for transparent casts.
24148
24149         (OpcodeCast): New type for casts of types that are performed with
24150         a sequence of bytecodes.
24151
24152         (BoxedCast): New type used for casting value types into reference
24153         types.  Emits a box opcode.
24154
24155         (Binary::DoNumericPromotions): Implements numeric promotions of
24156         and computation of the Binary::Type.
24157
24158         (Binary::EmitBranchable): Optimization.
24159
24160         (Binary::Emit): Implement code emission for expressions.
24161
24162         * typemanager.cs (TypeManager): Added two new core types: sbyte
24163         and byte.
24164
24165 2001-09-12  Ravi Pratap  <ravi@ximian.com>
24166
24167         * class.cs (TypeContainer::FindMembers): Method which does exactly
24168         what Type.FindMembers does, only we don't have to use reflection. No
24169         implementation yet.
24170
24171         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
24172         typecontainer objects as we need to get at them.
24173         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
24174
24175         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
24176         typecontainer object.
24177
24178         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
24179         of just a Report object.
24180
24181 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24182
24183         * class.cs (Event::Define): Go back to using the prefixes "add_" and
24184         "remove_"
24185         (TypeContainer::Populate): Now define the delegates of the type too.
24186         (TypeContainer.Delegates): Property to access the list of delegates defined
24187         in the type.
24188
24189         * delegates.cs (Delegate::Define): Implement partially.
24190
24191         * modifiers.cs (TypeAttr): Handle more flags.
24192
24193 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24194
24195         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
24196         and not <=
24197         (Operator::Define): Re-write logic to get types by using the LookupType method
24198         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
24199         (Indexer::Define): Ditto.
24200         (Event::Define): Ditto.
24201         (Property::Define): Ditto.
24202
24203 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24204
24205         * class.cs (TypeContainer::Populate): Now define operators too. 
24206         (TypeContainer.Operators): New property to access the list of operators
24207         in a type.
24208         (Operator.OperatorMethodBuilder): New member to hold the method builder
24209         for the operator we are defining.
24210         (Operator::Define): Implement.
24211
24212 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24213
24214         * class.cs (Event::Define): Make the prefixes of the accessor methods
24215         addOn_ and removeOn_ 
24216
24217         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
24218         of the location being passed in too. Ideally, this should go later since all
24219         error reporting should be done through the Report object.
24220
24221         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
24222         (Populate): Iterate thru the indexers we have and define them too.
24223         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
24224         for the get and set accessors.
24225         (Indexer::Define): Implement.
24226
24227 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
24228
24229         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
24230         my previous implementation, did not work.
24231
24232         * typemanager.cs: Add a couple of missing types (the longs).
24233
24234         * literal.cs: Use TypeManager.bool_type instead of getting it.
24235
24236         * expression.cs (EventExpr): New kind of expressions.
24237         (Expressio::ExprClassFromMemberInfo): finish
24238
24239 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
24240
24241         * assign.cs: Emit stores to static fields differently.
24242
24243 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24244
24245         * Merge in changes and adjust code to tackle conflicts. Backed out my
24246         code in Assign::Resolve ;-) 
24247
24248 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24249
24250         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
24251         instead Report.Error and also pass in the location.
24252         (CSharpParser::Lexer): New readonly property to return the reference
24253         to the Tokenizer object.
24254         (declare_local_variables): Use Report.Error with location instead of plain 
24255         old error.
24256         (CheckDef): Ditto.
24257
24258         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
24259         (Operator.CheckBinaryOperator): Ditto.
24260
24261         * cs-parser.jay (operator_declarator): Update accordingly.
24262
24263         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
24264         (CheckBinaryOperator): Same here.
24265
24266         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
24267         on the name without any prefixes of namespace names etc. This is because we
24268         already might have something already fully qualified like 
24269         'System.Console.WriteLine'
24270
24271         * assign.cs (Resolve): Begin implementation. Stuck ;-)
24272
24273 2001-09-07  Ravi Pratap  <ravi@ximian.com>
24274
24275         * cs-tokenizer.cs (location): Return a string which also contains
24276         the file name.
24277
24278         * expression.cs (ElementAccess): New class for expressions of the
24279         type 'element access.'
24280         (BaseAccess): New class for expressions of the type 'base access.'
24281         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
24282         respectively.
24283
24284         * cs-parser.jay (element_access): Implement action.
24285         (base_access): Implement actions.
24286         (checked_expression, unchecked_expression): Implement.
24287
24288         * cs-parser.jay (local_variable_type): Correct and implement.
24289         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24290
24291         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24292
24293         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24294         name and the specifiers.
24295
24296         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24297
24298         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
24299         making them all public ;-)
24300
24301         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24302         class anyways.
24303
24304 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
24305
24306         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24307         PropertyExprs.
24308         (FieldExpr, PropertyExprs): New resolved expressions.
24309         (SimpleName::MemberStaticCheck): Perform static checks for access
24310         to non-static fields on static methods. Maybe this should be
24311         generalized for MemberAccesses. 
24312         (SimpleName::ResolveSimpleName): More work on simple name
24313         resolution. 
24314
24315         * cs-parser.jay (primary_expression/qualified_identifier): track
24316         the parameter index.
24317
24318         * codegen.cs (CodeGen::Save): Catch save exception, report error.
24319         (EmitContext::EmitBoolExpression): Chain to expression generation
24320         instead of temporary hack.
24321         (::EmitStatementExpression): Put generic expression code generation.
24322
24323         * assign.cs (Assign::Emit): Implement variable assignments to
24324         local variables, parameters and fields.
24325
24326 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
24327
24328         * statement.cs (Block::GetVariableInfo): New method, returns the
24329         VariableInfo for a variable name in a block.
24330         (Block::GetVariableType): Implement in terms of GetVariableInfo
24331
24332         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24333         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24334
24335 2001-09-06  Ravi Pratap  <ravi@ximian.com>
24336
24337         * cs-parser.jay (operator_declaration): Continue on my quest : update
24338         to take attributes argument.
24339         (event_declaration): Ditto.
24340         (enum_declaration): Ditto.
24341         (indexer_declaration): Ditto.
24342
24343         * class.cs (Operator::Operator): Update constructor accordingly.
24344         (Event::Event): Ditto.
24345
24346         * delegate.cs (Delegate::Delegate): Same here.
24347
24348         * enum.cs (Enum::Enum): Same here.
24349
24350 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24351
24352         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
24353
24354         * ../tests/cs0658.cs : New file to demonstrate error 0658.
24355
24356         * attribute.cs (Attributes): New class to encapsulate all attributes which were
24357         being passed around as an arraylist.
24358         (Attributes::AddAttribute): Method to add attribute sections.
24359
24360         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
24361         (struct_declaration): Update accordingly.
24362         (constant_declaration): Update.
24363         (field_declaration): Update.
24364         (method_header): Update.
24365         (fixed_parameter): Update.
24366         (parameter_array): Ditto.
24367         (property_declaration): Ditto.
24368         (destructor_declaration): Ditto.
24369
24370         * class.cs (Struct::Struct): Update constructors accordingly.
24371         (Class::Class): Ditto.
24372         (Field::Field): Ditto.
24373         (Method::Method): Ditto.
24374         (Property::Property): Ditto.
24375         (TypeContainer::OptAttribute): update property's return type.
24376
24377         * interface.cs (Interface.opt_attributes): New member.
24378         (Interface::Interface): Update to take the extra Attributes argument.
24379
24380         * parameter.cs (Parameter::Parameter): Ditto.
24381
24382         * constant.cs (Constant::Constant): Ditto.
24383
24384         * interface.cs (InterfaceMemberBase): New OptAttributes field.
24385         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
24386         the attributes as a parameter.
24387         (InterfaceProperty): Update constructor call.
24388         (InterfaceEvent): Ditto.
24389         (InterfaceMethod): Ditto.
24390         (InterfaceIndexer): Ditto.
24391
24392         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
24393         pass the attributes too.
24394         (interface_event_declaration): Ditto.
24395         (interface_property_declaration): Ditto.
24396         (interface_method_declaration): Ditto.
24397         (interface_declaration): Ditto.
24398
24399 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
24400
24401         * class.cs (Method::Define): Track the "static Main" definition to
24402         create an entry point. 
24403
24404         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24405         EntryPoint if we find it. 
24406
24407         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24408         (EmitContext::ig): Make this variable public.
24409
24410         * driver.cs: Make the default output file be the first file name
24411         with the .exe extension.  
24412
24413         Detect empty compilations
24414
24415         Handle various kinds of output targets.  Handle --target and
24416         rename -t to --dumper.
24417
24418         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24419         methods inherited from Expression return now an Expression.  This
24420         will is used during the tree rewriting as we resolve them during
24421         semantic analysis.
24422
24423         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24424         the spec.  Missing entirely is the information about
24425         accessability of elements of it.
24426
24427         (Expression::ExprClassFromMemberInfo): New constructor for
24428         Expressions that creates a fully initialized Expression based on
24429         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24430         a Type.
24431
24432         (Invocation::Resolve): Begin implementing resolution of invocations.
24433
24434         * literal.cs (StringLiteral):  Implement Emit.
24435
24436 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24437
24438         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24439         member.
24440
24441 2001-09-04  Ravi Pratap  <ravi@ximian.com>
24442
24443         * cs-parser.jay (attribute_arguments): Implement actions.
24444         (attribute): Fix bug in production. Implement action.
24445         (attribute_list): Implement.
24446         (attribute_target): Implement.
24447         (attribute_target_specifier, opt_target_specifier): Implement
24448         (CheckAttributeTarget): New method to check if the attribute target
24449         is valid.
24450         (attribute_section): Implement.
24451         (opt_attributes): Implement.
24452
24453         * attribute.cs : New file to handle attributes.
24454         (Attribute): Class to hold attribute info.
24455
24456         * cs-parser.jay (opt_attribute_target_specifier): Remove production
24457         (attribute_section): Modify production to use 2 different rules to 
24458         achieve the same thing. 1 s/r conflict down !
24459         Clean out commented, useless, non-reducing dimension_separator rules.
24460
24461         * class.cs (TypeContainer.attributes): New member to hold list
24462         of attributes for a type.
24463         (Struct::Struct): Modify to take one more argument, the attribute list.
24464         (Class::Class): Ditto.
24465         (Field::Field): Ditto.
24466         (Method::Method): Ditto.
24467         (Property::Property): Ditto.
24468
24469         * cs-parser.jay (struct_declaration): Update constructor call to
24470         pass in the attributes too.
24471         (class_declaration): Ditto.
24472         (constant_declaration): Ditto.
24473         (field_declaration): Ditto.
24474         (method_header): Ditto.
24475         (fixed_parameter): Ditto.
24476         (parameter_array): Ditto.
24477         (property_declaration): Ditto.
24478
24479         * constant.cs (Constant::Constant): Update constructor similarly.
24480         Use System.Collections.
24481
24482         * parameter.cs (Parameter::Parameter): Update as above.
24483
24484 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24485
24486         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24487         (TypeContainer.delegates): New member to hold list of delegates.
24488
24489         * cs-parser.jay (delegate_declaration): Implement the action correctly 
24490         this time as I seem to be on crack ;-)
24491
24492 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
24493
24494         * rootcontext.cs (RootContext::IsNamespace): new function, used to
24495         tell whether an identifier represents a namespace.
24496
24497         * expression.cs (NamespaceExpr): A namespace expression, used only
24498         temporarly during expression resolution.
24499         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24500         utility functions to resolve names on expressions.
24501
24502 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
24503
24504         * codegen.cs: Add hook for StatementExpressions. 
24505
24506         * class.cs: Fix inverted test for static flag in methods.
24507
24508 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24509
24510         * class.cs (Operator::CheckUnaryOperator): Correct error number used
24511         to make it coincide with MS' number.
24512         (Operator::CheckBinaryOperator): Ditto.
24513
24514         * ../errors/errors.txt : Remove error numbers added earlier.
24515
24516         * ../errors/cs1019.cs : Test case for error # 1019
24517
24518         * ../errros/cs1020.cs : Test case for error # 1020
24519
24520         * cs-parser.jay : Clean out commented cruft.
24521         (dimension_separators, dimension_separator): Comment out. Ostensibly not
24522         used anywhere - non-reducing rule.
24523         (namespace_declarations): Non-reducing rule - comment out.
24524
24525         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24526         with TypeContainer::AddEnum.
24527
24528         * delegate.cs : New file for delegate handling classes.
24529         (Delegate): Class for declaring delegates.
24530
24531         * makefile : Update.
24532
24533         * cs-parser.jay (delegate_declaration): Implement.
24534
24535 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
24536
24537         * class.cs (Event::Define): Implement.
24538         (Event.EventBuilder): New member.
24539
24540         * class.cs (TypeContainer::Populate): Update to define all enums and events
24541         we have.
24542         (Events): New property for the events arraylist we hold. Shouldn't we move to using
24543         readonly fields for all these cases ?
24544
24545 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24546
24547         * class.cs (Property): Revamp to use the convention of making fields readonly.
24548         Accordingly modify code elsewhere.
24549
24550         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24551         the Define method of the Property class.
24552
24553         * class.cs : Clean up applied patch and update references to variables etc. Fix 
24554         trivial bug.
24555         (TypeContainer::Populate): Update to define all the properties we have. Also
24556         define all enumerations.
24557
24558         * enum.cs (Define): Implement.
24559
24560 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24561
24562         * cs-parser.jay (overloadable_operator): The semantic value is an
24563         enum of the Operator class.
24564         (operator_declarator): Implement actions.
24565         (operator_declaration): Implement.
24566
24567         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24568         validity of definitions.
24569         (Operator::CheckBinaryOperator): Static method to check for binary operators
24570         (TypeContainer::AddOperator): New method to add an operator to a type.
24571
24572         * cs-parser.jay (indexer_declaration): Added line to actually call the
24573         AddIndexer method so it gets added ;-)
24574
24575         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
24576         already taken care of by the MS compiler ?  
24577
24578 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24579
24580         * class.cs (Operator): New class for operator declarations.
24581         (Operator::OpType): Enum for the various operators.
24582
24583 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24584
24585         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24586         ostensibly handle this in semantic analysis.
24587
24588         * cs-parser.jay (general_catch_clause): Comment out
24589         (specific_catch_clauses, specific_catch_clause): Ditto.
24590         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24591         (catch_args, opt_catch_args): New productions.
24592         (catch_clause): Rewrite to use the new productions above
24593         (catch_clauses): Modify accordingly.
24594         (opt_catch_clauses): New production to use in try_statement
24595         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
24596         and re-write the code in the actions to extract the specific and
24597         general catch clauses by being a little smart ;-)
24598
24599         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
24600         Hooray, try and catch statements parse fine !
24601
24602 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24603
24604         * statement.cs (Block::GetVariableType): Fix logic to extract the type
24605         string from the hashtable of variables.
24606
24607         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
24608         I end up making that mistake ;-)
24609         (catch_clauses): Fixed gross error which made Key and Value of the 
24610         DictionaryEntry the same : $1 !!
24611
24612 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24613
24614         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
24615
24616         * cs-parser.jay (event_declaration): Correct to remove the semicolon
24617         when the add and remove accessors are specified. 
24618
24619 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24620
24621         * cs-parser.jay (IndexerDeclaration): New helper class to hold
24622         information about indexer_declarator.
24623         (indexer_declarator): Implement actions.
24624         (parsing_indexer): New local boolean used to keep track of whether
24625         we are parsing indexers or properties. This is necessary because 
24626         implicit_parameters come into picture even for the get accessor in the 
24627         case of an indexer.
24628         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
24629
24630         * class.cs (Indexer): New class for indexer declarations.
24631         (TypeContainer::AddIndexer): New method to add an indexer to a type.
24632         (TypeContainer::indexers): New member to hold list of indexers for the
24633         type.
24634
24635 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24636
24637         * cs-parser.jay (add_accessor_declaration): Implement action.
24638         (remove_accessor_declaration): Implement action.
24639         (event_accessors_declaration): Implement
24640         (variable_declarators): swap statements for first rule - trivial.
24641
24642         * class.cs (Event): New class to hold information about event
24643         declarations.
24644         (TypeContainer::AddEvent): New method to add an event to a type
24645         (TypeContainer::events): New member to hold list of events.
24646
24647         * cs-parser.jay (event_declaration): Implement actions.
24648
24649 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24650
24651         * cs-parser.jay (dim_separators): Implement. Make it a string
24652         concatenating all the commas together, just as they appear.
24653         (opt_dim_separators): Modify accordingly
24654         (rank_specifiers): Update accordingly. Basically do the same
24655         thing - instead, collect the brackets here.
24656         (opt_rank_sepcifiers): Modify accordingly.
24657         (array_type): Modify to actually return the complete type string
24658         instead of ignoring the rank_specifiers.
24659         (expression_list): Implement to collect the expressions
24660         (variable_initializer): Implement. We make it a list of expressions
24661         essentially so that we can handle the array_initializer case neatly too.
24662         (variable_initializer_list): Implement.
24663         (array_initializer): Make it a list of variable_initializers
24664         (opt_array_initializer): Modify accordingly.
24665
24666         * expression.cs (New::NType): Add enumeration to help us
24667         keep track of whether we have an object/delegate creation
24668         or an array creation.
24669         (New:NewType, New::Rank, New::Indices, New::Initializers): New
24670         members to hold data about array creation.
24671         (New:New): Modify to update NewType
24672         (New:New): New Overloaded contructor for the array creation
24673         case.
24674
24675         * cs-parser.jay (array_creation_expression): Implement to call
24676         the overloaded New constructor.
24677
24678 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
24679
24680         * class.cs (TypeContainer::Constructors): Return member
24681         constructors instead of returning null.
24682
24683 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
24684
24685         * typemanager.cs (InitCoreTypes): Initialize the various core
24686         types after we have populated the type manager with the user
24687         defined types (this distinction will be important later while
24688         compiling corlib.dll)
24689
24690         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
24691         on Expression Classification.  Now all expressions have a method
24692         `Resolve' and a method `Emit'.
24693
24694         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
24695         generation from working.     Also add some temporary debugging
24696         code. 
24697
24698 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
24699
24700         * codegen.cs: Lots of code generation pieces.  This is only the
24701         beginning, will continue tomorrow with more touches of polish.  We
24702         handle the fundamentals of if, while, do, for, return.  Others are
24703         trickier and I need to start working on invocations soon.
24704
24705         * gen-treedump.cs: Bug fix, use s.Increment here instead of
24706         s.InitStatement. 
24707
24708         * codegen.cs (EmitContext): New struct, used during code
24709         emission to keep a context.   Most of the code generation will be
24710         here. 
24711
24712         * cs-parser.jay: Add embedded blocks to the list of statements of
24713         this block.  So code generation proceeds in a top down fashion.
24714
24715 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
24716
24717         * statement.cs: Add support for multiple child blocks.
24718
24719 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
24720
24721         * codegen.cs (EmitCode): New function, will emit the code for a
24722         Block of code given a TypeContainer and its ILGenerator. 
24723
24724         * statement.cs (Block): Standard public readonly optimization.
24725         (Block::Block constructors): Link children. 
24726         (Block::Child): Child Linker.
24727         (Block::EmitVariables): Emits IL variable declarations.
24728
24729         * class.cs: Drop support for MethodGroups here, delay until
24730         Semantic Analysis.
24731         (Method::): Applied the same simplification that I did before, and
24732         move from Properties to public readonly fields.
24733         (Method::ParameterTypes): Returns the parameter types for the
24734         function, and implements a cache that will be useful later when I
24735         do error checking and the semantic analysis on the methods is
24736         performed.
24737         (Constructor::GetCallingConvention): Renamed from CallingConvetion
24738         and made a method, optional argument tells whether this is a class
24739         or a structure to apply the `has-this' bit.
24740         (Method::GetCallingConvention): Implement, returns the calling
24741         convention. 
24742         (Method::Define): Defines the type, a second pass is performed
24743         later to populate the methods.
24744
24745         (Constructor::ParameterTypes): implement a cache similar to the
24746         one on Method::ParameterTypes, useful later when we do semantic
24747         analysis. 
24748
24749         (TypeContainer::EmitMethod):  New method.  Emits methods.
24750
24751         * expression.cs: Removed MethodGroup class from here.
24752
24753         * parameter.cs (Parameters::GetCallingConvention): new method.
24754
24755 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
24756
24757         * class.cs (TypeContainer::Populate): Drop RootContext from the
24758         argument. 
24759
24760         (Constructor::CallingConvention): Returns the calling convention.
24761         (Constructor::ParameterTypes): Returns the constructor parameter
24762         types. 
24763
24764         (TypeContainer::AddConstructor): Keep track of default constructor
24765         and the default static constructor.
24766
24767         (Constructor::) Another class that starts using `public readonly'
24768         instead of properties. 
24769
24770         (Constructor::IsDefault): Whether this is a default constructor. 
24771
24772         (Field::) use readonly public fields instead of properties also.
24773
24774         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
24775         track of static constructors;  If none is used, turn on
24776         BeforeFieldInit in the TypeAttributes. 
24777
24778         * cs-parser.jay (opt_argument_list): now the return can be null
24779         for the cases where there are no arguments. 
24780
24781         (constructor_declarator): If there is no implicit `base' or
24782         `this', then invoke the default parent constructor. 
24783
24784         * modifiers.cs (MethodAttr): New static function maps a set of
24785         modifiers flags into a MethodAttributes enum
24786         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
24787         MethodAttr, TypeAttr to represent the various mappings where the
24788         modifiers are used.
24789         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
24790
24791 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
24792
24793         * parameter.cs (GetParameterInfo): Fix bug where there would be no
24794         method arguments.
24795
24796         * interface.cs (PopulateIndexer): Implemented the code generator
24797         for interface indexers.
24798
24799 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
24800
24801         * interface.cs (InterfaceMemberBase): Now we track the new status
24802         here.  
24803
24804         (PopulateProperty): Implement property population.  Woohoo!  Got
24805         Methods and Properties going today. 
24806
24807         Removed all the properties for interfaces, and replaced them with
24808         `public readonly' fields. 
24809
24810 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
24811
24812         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
24813         initialize their hashtables/arraylists only when they are needed
24814         instead of doing this always.
24815
24816         * parameter.cs: Handle refs and out parameters.
24817
24818         * cs-parser.jay: Use an ArrayList to construct the arguments
24819         instead of the ParameterCollection, and then cast that to a
24820         Parameter[] array.
24821
24822         * parameter.cs: Drop the use of ParameterCollection and use
24823         instead arrays of Parameters.
24824
24825         (GetParameterInfo): Use the Type, not the Name when resolving
24826         types. 
24827
24828 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
24829
24830         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
24831         and instead use public readonly fields.
24832
24833         * class.cs: Put back walking code for type containers.
24834
24835 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
24836
24837         * class.cs (MakeConstant): Code to define constants.
24838
24839         * rootcontext.cs (LookupType): New function.  Used to locate types 
24840
24841
24842 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
24843
24844         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
24845         this System.Reflection code is.  Kudos to Microsoft
24846
24847         * typemanager.cs: Implement a type cache and avoid loading all
24848         types at boot time.  Wrap in LookupType the internals.  This made
24849         the compiler so much faster.  Wow.  I rule!
24850
24851         * driver.cs: Make sure we always load mscorlib first (for
24852         debugging purposes, nothing really important).
24853
24854         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
24855         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
24856
24857         * rootcontext.cs: Lookup types on their namespace;  Lookup types
24858         on namespaces that have been imported using the `using' keyword.
24859
24860         * class.cs (TypeContainer::TypeAttr): Virtualize.
24861         (Class::TypeAttr): Return attributes suitable for this bad boy.
24862         (Struct::TypeAttr): ditto.
24863         Handle nested classes.
24864         (TypeContainer::) Remove all the type visiting code, it is now
24865         replaced with the rootcontext.cs code
24866
24867         * rootcontext.cs (GetClassBases): Added support for structs. 
24868
24869 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
24870
24871         * interface.cs, statement.cs, class.cs, parameter.cs,
24872         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
24873         Drop use of TypeRefs, and use strings instead.
24874
24875 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
24876
24877         * rootcontext.cs: 
24878
24879         * class.cs (Struct::Struct): set the SEALED flags after
24880         checking the modifiers.
24881         (TypeContainer::TypeAttr): new property, returns the
24882         TypeAttributes for a class.  
24883
24884         * cs-parser.jay (type_list): Oops, list production was creating a
24885         new list of base types.
24886
24887         * rootcontext.cs (StdLib): New property.
24888         (GetInterfaceTypeByName): returns an interface by type name, and
24889         encapsulates error handling here.
24890         (GetInterfaces): simplified.
24891         (ResolveTree): Encapsulated all the tree resolution here.
24892         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
24893         types. 
24894
24895         * driver.cs: Add support for --nostdlib, to avoid loading the
24896         default assemblies.
24897         (Main): Do not put tree resolution here. 
24898
24899         * rootcontext.cs: Beginning of the class resolution.
24900
24901 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
24902
24903         * rootcontext.cs: Provide better error reporting. 
24904
24905         * cs-parser.jay (interface_base): set our $$ to be interfaces.
24906
24907         * rootcontext.cs (CreateInterface): Handle the case where there
24908         are no parent interfaces.
24909
24910         (CloseTypes): Routine to flush types at the end.
24911         (CreateInterface): Track types.
24912         (GetInterfaces): Returns an array of Types from the list of
24913         defined interfaces.
24914
24915         * typemanager.c (AddUserType): Mechanism to track user types (puts
24916         the type on the global type hash, and allows us to close it at the
24917         end). 
24918
24919 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
24920
24921         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
24922         RecordInterface instead.
24923
24924         * cs-parser.jay: Updated to reflect changes above.
24925
24926         * decl.cs (Definition): Keep track of the TypeBuilder type that
24927         represents this type here.  Not sure we will use it in the long
24928         run, but wont hurt for now.
24929
24930         * driver.cs: Smaller changes to accomodate the new code.
24931
24932         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
24933         when done. 
24934
24935         * rootcontext.cs (CreateInterface):  New method, used to create
24936         the System.TypeBuilder type for interfaces.
24937         (ResolveInterfaces): new entry point to resolve the interface
24938         hierarchy. 
24939         (CodeGen): Property, used to keep track of the code generator.
24940
24941 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
24942
24943         * cs-parser.jay: Add a second production for delegate_declaration
24944         with `VOID'.
24945
24946         (enum_body): Put an opt_comma here instead of putting it on
24947         enum_body or enum_member_declarations so we can handle trailing
24948         commas on enumeration members.  Gets rid of a shift/reduce.
24949
24950         (type_list): Need a COMMA in the middle.
24951
24952         (indexer_declaration): Tell tokenizer to recognize get/set
24953
24954         * Remove old targets.
24955
24956         * Re-add the parser target.
24957
24958 2001-07-13  Simon Cozens <simon@simon-cozens.org>
24959
24960         * cs-parser.jay: Add precendence rules for a number of operators
24961         ot reduce the number of shift/reduce conflicts in the grammar.
24962
24963 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
24964
24965         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
24966         and put it here.
24967
24968         Get rid of old crufty code.
24969
24970         * rootcontext.cs: Use this to keep track of the parsed
24971         representation and the defined types available to the program. 
24972
24973         * gen-treedump.cs: adjust for new convention.
24974
24975         * type.cs: Split out the type manager, and the assembly builder
24976         from here. 
24977
24978         * typemanager.cs: the type manager will live here now.
24979
24980         * cil-codegen.cs: And the code generator here. 
24981
24982 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
24983
24984         * makefile: Fixed up for easy making.
24985
24986 2001-07-13  Simon Cozens <simon@simon-cozens.org>
24987
24988         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
24989         the 
24990
24991         (unary_expression): Expand pre_increment_expression and
24992         post_decrement_expression to reduce a shift/reduce.
24993
24994 2001-07-11  Simon Cozens
24995
24996         * cs-tokenizer.cs: Hex numbers should begin with a 0.
24997
24998         Improve allow_keyword_as_indent name.
24999
25000 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
25001
25002         * Adjustments for Beta2. 
25003
25004 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
25005
25006         * decl.cs: Added `Define' abstract method.
25007         (InTransit): new property, used to catch recursive definitions. 
25008
25009         * interface.cs: Implement `Define'. 
25010
25011         * modifiers.cs: Map Modifiers.constants to
25012         System.Reflection.TypeAttribute flags.
25013
25014         * class.cs: Keep track of types and user-defined types.
25015         (BuilderInit): New method for creating an assembly
25016         (ResolveType): New function to launch the resolution process, only
25017         used by interfaces for now.
25018
25019         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
25020         that are inserted into the name space. 
25021
25022 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
25023
25024         * ARGH.  I have screwed up my tree so many times due to the use of
25025         rsync rather than using CVS.  Going to fix this at once. 
25026
25027         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
25028         load types.
25029
25030 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
25031
25032         * Experiment successful: Use System.Type rather that our own
25033         version of Type.  
25034
25035 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
25036
25037         * cs-parser.jay: Removed nsAliases from here.
25038
25039         Use new namespaces, handle `using XXX;' 
25040
25041         * namespace.cs: Reimplemented namespace handling, use a recursive
25042         definition of the class.  Now we can keep track of using clauses
25043         and catch invalid using clauses.
25044
25045 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
25046
25047         * gen-treedump.cs: Adapted for all the renaming.
25048
25049         * expression.cs (Expression): this class now has a Type property
25050         which returns an expression Type.
25051
25052         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
25053         `Type', as this has a different meaning now in the base
25054
25055 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
25056
25057         * interface.cs, class.cs: Removed from all the sources the
25058         references to signature computation, as we can not do method
25059         signature computation during the parsing time, as we are not
25060         trying to solve at that point distinguishing:
25061
25062         class X {
25063                 void a (Blah x) {}
25064                 void a (NS.Blah x) {}
25065         }
25066
25067         Which depending on the context might be valid or not, as we do not
25068         know if Blah is the same thing as NS.Blah at that point.
25069
25070         * Redid everything so the code uses TypeRefs now instead of
25071         Types.  TypeRefs are just temporary type placeholders, that need
25072         to be resolved.  They initially have a pointer to a string and the
25073         current scope in which they are used.  This is used later by the
25074         compiler to resolve the reference to an actual Type. 
25075
25076         * DeclSpace is no longer a CIR.Type, and neither are
25077         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
25078         are all DeclSpaces, but no Types. 
25079
25080         * type.cs (TypeRefManager): This implements the TypeRef manager,
25081         which keeps track of all the types that need to be resolved after
25082         the parsing has finished. 
25083
25084 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
25085
25086         * ARGH.  We are going to have to store `foreach' as a class rather
25087         than resolving it, as we need to verify error 1579 after name
25088         resolution.   *OR* we could keep a flag that says `This request to
25089         IEnumerator comes from a foreach statement' which we can then use
25090         to generate the error.
25091
25092 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
25093
25094         * class.cs (TypeContainer.AddMethod): we now add methods to the
25095         MethodGroup instead of the method hashtable.  
25096
25097         * expression.cs: Add MethodGroup abstraction, which gets us one
25098         step closer to the specification in the way we handle method
25099         declarations.  
25100
25101         * cs-parser.jay (primary_expression): qualified_identifier now
25102         tried to match up an identifier to a local variable reference or
25103         to a parameter reference.
25104
25105         current_local_parameters is now a parser global variable that
25106         points to the current parameters for the block, used during name
25107         lookup.
25108
25109         (property_declaration): Now creates an implicit `value' argument to
25110         the set accessor.
25111
25112 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
25113
25114         * parameter.cs: Do not use `param' arguments as part of the
25115         signature, per the spec.
25116
25117 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
25118
25119         * decl.cs: Base class for classes, structs and interfaces.  This
25120         is the "Declaration Space" 
25121
25122         * cs-parser.jay: Use CheckDef for checking declaration errors
25123         instead of having one on each function.
25124
25125         * class.cs: Factor out some code for handling error handling in
25126         accordance to the "Declarations" section in the "Basic Concepts"
25127         chapter in the ECMA C# spec.
25128
25129         * interface.cs: Make all interface member classes derive from
25130         InterfaceMemberBase.
25131
25132 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
25133
25134         * Many things: all interfaces are parsed and generated in
25135         gen-treedump.  Support for member variables, constructors,
25136         destructors, properties, constants is there.
25137
25138         Beginning of the IL backend, but very little done, just there for
25139         testing purposes. 
25140
25141 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
25142
25143         * cs-parser.jay: Fix labeled statement.
25144
25145         * cs-tokenizer.cs (escape): Escape " and ' always.
25146         ref_line, ref_name: keep track of the line/filename as instructed
25147         by #line by the compiler.
25148         Parse #line.
25149
25150 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
25151
25152         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
25153         to match the values in System.CodeDOM.
25154
25155         Divid renamed to Divide.
25156
25157         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
25158         statements. 
25159         (Statements.set): remove.
25160
25161         * System.CodeDOM/CodeCatchClause.cs: always have a valid
25162         statements. 
25163
25164         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
25165         falseStatements always have valid values. 
25166
25167         * cs-parser.jay: Use System.CodeDOM now.
25168