* ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
[mono.git] / mcs / gmcs / ChangeLog
1 2006-03-10  Raja R Harinath  <rharinath@novell.com>
2
3         * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
4         (Expression.ResolveAsTypeTerminal): Likewise.
5         * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
6         * expression.cs, generic.cs, iterators.cs: Likewise.
7         * parameter.cs, statement.cs, typemanager.cs: Likewise.
8
9 2006-03-09  Martin Baulig  <martin@ximian.com>
10
11         * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
12         TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
13
14 2006-03-09  Martin Baulig  <martin@ximian.com>
15
16         * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
17         `prepared' flag is set.
18
19         * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
20         (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
21         issues; see gtest-254.cs.
22
23 2006-03-07  Martin Baulig  <martin@ximian.com>
24
25         * generic.cs (TypeManager.InferType): Allow infering
26         `IEnumerable<T>' with an array of T; see gtest-251.cs.
27
28 2006-03-06  Martin Baulig  <martin@ximian.com>
29
30         * generic.cs
31         (TypeManager.InferType): Fix gtest-250.cs.
32
33         * typemanager.cs
34         (TypeManager.IsSubclassOf): Also check the base class.
35
36         * expression.cs
37         (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
38         fixes gtest-249.cs.
39
40 2006-03-01  Raja R Harinath  <rharinath@novell.com>
41
42         Fix #77679.
43         * expression.cs (ParameterReference.DoResolveBase): Change return
44         type to bool.
45         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
46         Update.
47
48         Fix #77628.
49         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
50
51         Fix #77642.
52         * typemanager.cs (GetFullNameSignature): Don't nullref on
53         protected accessors.
54
55 2006-02-16  Martin Baulig  <martin@ximian.com>
56
57         * generic.cs
58         (TypeManager.GetGenericFieldDefinition): New public method; use it
59         instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
60
61 2006-02-14  Martin Baulig  <martin@ximian.com>
62
63         * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
64
65 2006-02-14  Martin Baulig  <martin@ximian.com>
66
67         * generic.cs
68         (TypeManager.DropGenericMethodArguments): New public method; don't
69         use GetGenericMethodDefinition() on something which is not a
70         generic method.
71
72 2006-02-14  Martin Baulig  <martin@ximian.com>
73
74         * generic.cs
75         (ConstraintChecker.CheckConstraints): If a type parameter has the
76         `struct' constraint, the type must be a non-nullable valuetype.
77
78 2006-02-10  Martin Baulig  <martin@ximian.com>
79
80         * typemanager.cs
81         (TypeManager.IsOverride): Make this work for instantiated methods
82         in a generic class; fixes #77509.
83         (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
84         rather than calling it directly; fixes #77488.  
85
86 2006-02-08  Martin Baulig  <martin@ximian.com>
87
88         * generic.cs (ConstraintChecker.CheckConstraints): Move the error
89         reporting into CheckConstraint() so we can use the correctly
90         instantiated type.
91
92 2006-02-08  Martin Baulig  <martin@ximian.com>
93
94         * expression.cs (BaseAccess): Add support for generic methods.
95
96         * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
97         the new MethodGroupExpr.
98
99 2006-02-07  Martin Baulig  <martin@ximian.com>
100
101         * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
102         also reference types; fixes #77483.
103
104 2006-02-07  Martin Baulig  <martin@ximian.com>
105
106         * generic.cs
107         (TypeManager.IsGenericMethod): We now return whether something is
108         an instantiated generic method (and not a generic method def).
109         (TypeManager.IsGenericMethodDefinition): New public method.
110
111         * typemanager.cs
112         (TypeManager.CSharpSignature): Only include type arguments for
113         "real" generic methods, not for any instantiated method.
114         (TypeManager.GetMethodName): Likewise, but also allow generic
115         method definitions here.
116
117 2006-02-06  Miguel de Icaza  <miguel@novell.com>
118
119         * codegen.cs (EmitScopeInitFromBlock): check here the
120         capture_context, there is no need to make two calls to the
121         EmitContext. 
122
123         * anonymous.cs: Add some debugging messages that might help me
124         track other instances of this problem in the future (the
125         regression of test 467).
126
127         * cs-parser.jay: track the variable block, as we need to initalize
128         any captured variables declared in this block for the "catch"
129         portion of the "Try" statement.
130
131         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
132         scope initialization for captured variables. 
133
134         Also, move the emit for the variables after the block location has
135         been marked.
136
137 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
138
139        * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
140         
141 2006-02-06  Martin Baulig  <martin@ximian.com>
142
143         * class.cs (TypeContainer.DefineType): If we're a struct, pass
144         `TypeManager.value_type' as parent type to
145         ModuleBuilder.DefineType().  Fixes #77358.      
146
147 2006-02-02  Miguel de Icaza  <miguel@novell.com>
148
149         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
150         commit yesterday, the initialization for the roots is necessary.
151         What is not necessary is the scope activation.
152
153 2006-02-02  Raja R Harinath  <rharinath@novell.com>
154
155         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
156         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
157         CS0206 checks.
158         (Argument.Resolve): Remove CS0206 checks.
159
160 2006-02-01  Miguel de Icaza  <miguel@novell.com>
161
162         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
163         scopes for all the roots, the scopes will now be emitted when the
164         Blocks are entered. [This change was wrong, fixed on 2006-02-02]
165
166         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
167         code.  This reduces a lot of existing cruft.
168         
169         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
170         that the ScopeInfo is generated as we enter the scope, not at the
171         time of use, which is what we used to do before.
172
173         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
174         every time a Block is about to be emitted if we have a
175         CaptureContext. 
176
177 2006-02-01  Raja R Harinath  <rharinath@novell.com>
178
179         * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
180         attribute for mscorlib too.
181
182         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
183         (Reset): Update.
184         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
185
186         * typemanager.cs (cons_param_array_attribute): Make private.
187         (Reset): Set it to null.
188         (InitCoreHelpers): Don't initialize it.
189         (ConsParamArrayAttribute): New.  Initialize it as needed.
190         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
191
192 2006-01-31  Miguel de Icaza  <miguel@novell.com>
193
194         * expression.cs: There might be errors reported during the
195         selection of applicable methods.  If there are errors, do not
196         continue execution as it will lead the compiler to crash.
197
198 2006-01-30  Miguel de Icaza  <miguel@novell.com>
199
200         * expression.cs: Member access is not allowed on anonymous
201         methods.  Fixes #77402.
202
203 2006-01-30  Raja R Harinath  <rharinath@novell.com>
204
205         Fix #77401
206         * cs-parser.jay (VariableDeclaration): Don't set
207         current_array_type to null.
208         (field_declaration, event_declaration, declaration_statement):
209         Set it to null here.
210
211 2006-01-29  Raja R Harinath  <harinath@gmail.com>
212
213         Fix part of #77397
214         * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
215
216 2006-01-28  Raja R Harinath  <harinath@gmail.com>
217
218         * typemanager.cs (GenericParameterPosition): New.
219         * doc.cs: Use it.
220
221 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
222
223         * doc.cs : To process "include" elements, first we should create
224           another list than XmlNodeList, because it could result in node
225           removal, which could result in that the XmlNodeList gives up
226           yielding next node.
227
228 2006-01-25  Miguel de Icaza  <miguel@novell.com>
229
230         * expression.cs: Introduce an error report that we were not
231         catching before.   Gonzalo ran into it.
232
233 2006-01-23  Miguel de Icaza  <miguel@novell.com>
234
235         A fix for bug: #76957
236         
237         * iterators.cs (MoveNextMethod.CreateMethodHost): call
238         ComputeMethodHost before creating the method, this is a new
239         requirement. 
240
241         * anonymous.cs (AnonymousContainer): Now we track all the scopes
242         that this method references (RegisterScope).  The actual scope
243         where the method is hosted is computed with the ComputeMethodHost
244         before we create the method.
245
246         Moved the Deepest routine here.
247
248         (AnonymousContainer.ComputeMethodHost): New routine used to
249         compute the proper ScopeInfo that will host the anonymous method.
250
251         (ScopeInfo): Deal with multiple roots.  The problem was that we
252         did not have a unique root where all ScopeInfos could be hanged
253         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
254         of roots.  
255
256         Remove AdjustMethodScope which is now computed at the end.  Remove
257         LinkScope which did a partial link, instead link all ScopeInfos
258         before code generation from the new "LinkScopes" routine. 
259
260         Simplify all the Add* routines as they no longer need to maintain
261         the tree, they just need to record that they are using variables
262         from a ScopeInfo.
263
264         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
265         routines to produce the forest of ScopeInfo trees.
266
267         * class.cs (TypeContainer.AppendMethod): This is just like
268         AddMethod, but ensures that an interface implementation method
269         (IEnumerable.XXX) is not inserted at the beginning of the queue of
270         methods, but at the end.
271
272         We use this functionality to ensure that the generated MoveNext
273         method in the iterator class is resolved/emitted before the
274         enumerator methods created.   
275
276         This is required because the MoveNext method computes the right
277         ScopeInfo for the method.  And the other methods will eventually
278         need to resolve and fetch information computed from the anonymous
279         method. 
280
281         
282 2006-01-23  Raja R Harinath  <rharinath@novell.com>
283
284         Improve implementation of section 14.4.2.2 (Better function member).
285         * expression.cs (Invocation.MoreSpecific): Compare all type
286         arguments before deciding if one type is more specific than
287         another.  Handle array types too.  Return the more specific type.
288         (Invocation.BetterFunction): Add more tie-breaking rules from
289         section 14.4.2.2.  Perform "more specific" check after
290         other tie-breaking rules.  Compare all parameter types before
291         choosing the "more specific" method.
292
293 2006-01-21  Raja R Harinath  <harinath@gmail.com>
294             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
295
296         Fix rest of #76995.
297         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
298         the 'aliases' hash.
299         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
300         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
301
302 2006-01-18  Martin Baulig  <martin@ximian.com>
303
304         * class.cs (TypeContainer.AddToMemberContainer): Use
305         `symbol.MemberName.MethodName' instead of just `symbol.Name';
306         fixes #77124.
307
308 2006-01-18  Martin Baulig  <martin@ximian.com>
309
310         Fix #76417: a generic class may now have methods which may unify
311         for some type parameter substitutions.
312
313         * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
314         for methods which may unify anymore.
315
316         * expression.cs (Invocation.MoreSpecific): New private static
317         method; checks whether one method is more specific than another
318         according to 14.4.2.2 of the spec.
319         (Invocation.BetterFunction): Implement the tie-breaking rules from
320         14.4.2.2 of the spec: if two methods unify for some type parameter
321         substitution, we need to pick the more specific one.
322
323 2006-01-18  Raja R Harinath  <rharinath@novell.com>
324
325         Fix #76656, cs0231-2.cs.
326         * cs-parser.jay (formal_parameter_list): Make error case catch
327         more issues.
328         (parenthesized_expression_0): Add CS1026 check.
329         (invocation_expression): Remove unused { $$ = lexer.Location }.
330
331 2006-01-17  Raja R Harinath  <rharinath@novell.com>
332
333         Fix #76824.
334         * cs-parser.jay (statement_expression): Don't list out the
335         individual statement-expressions.  Convert syntax error into
336         CS0201 check.
337
338 2006-01-16  Raja R Harinath  <rharinath@novell.com>
339
340         Fix #76874.
341         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
342         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
343         CheckIntermediateModification.
344         (FieldExpr.DoResolve): Add new two-argument version that
345         allows us to resolve the InstanceExpression as an lvalue.
346         The one-argument variant is now just a wrapper.
347         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
348         Resolve the lhs as an lvalue if the it has a value type.
349         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
350         from Assign.DoResolve.
351         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
352         resolved as an lvalue.
353         (PropertyExpr.DoResolve): Update.
354         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
355         has a value type.  Move CS1612 check here from
356         CheckIntermediateModification.
357         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
358         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
359         'right_side' of a ResolveLValue on an 'out' argument.
360         (EmptyExpression.LValueMemberAccess): New.  Used as the
361         'right_side' of a propagated ResolveLValue on a value type.
362         (LocalVariableReference.DoResolveBase): Recognize
363         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
364         Add CS1654 check.
365         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
366         EmptyExpression.Null.
367
368 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
369
370         * typemanager.cs : added IsGenericParameter(). In gmcs it returns
371           Type.IsGenericParameter(). Fixed bug #77183.
372         * doc.cs : it is now identical to doc.cs in mcs.
373
374 2006-01-16  Martin Baulig  <martin@ximian.com>
375
376         * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
377
378 2006-01-16  Martin Baulig  <martin@ximian.com>
379
380         * typemanager.cs (TypeManager.CSharpSignature): Make this work for
381         ctors; fixes #77250.
382
383 2006-01-12  Miguel de Icaza  <miguel@novell.com>
384
385         This fixes the problem where we used ldfld instead of ldflda to
386         load the "THIS" pointer on captured parameters, when THIS is a
387         value type.  See bug #77205.
388         
389         * iterators.cs (CapturedThisReference.Emit): Pass false to
390         EmitThis (we do not need the address).
391
392         * codegen.cs (EmitThis): it needs to know whether we need the
393         address of `this' or not.  This is used by value types.  
394
395         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
396         every other call passes false.
397
398 2006-01-12  Raja R Harinath  <rharinath@novell.com>
399
400         Fix #77221.
401         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
402         GetOverride.
403         * expression.cs (Invocation.OverloadResolve): Update.
404         (Invocation.DoResolve): Avoid double resolution of invocation.
405
406 2006-01-11  Raja R Harinath  <rharinath@novell.com>
407
408         Fix #77180.
409         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
410         unary negation of floating point types as 0-expr; negation cannot
411         overflow in floating point types.
412
413         Fix #77204.
414         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
415         on operands of 'void' type.
416
417         Fix #77200.
418         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
419         and ExclusiveOr for boolean constants too.
420
421 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
422
423         * expression.cs: Fix Console.WriteLine ((this = x).foo);
424
425 2006-01-12  Miguel de Icaza  <miguel@novell.com>
426
427         * cs-tokenizer.cs (Position): New class used to save and restore
428         the position state in the tokenizer.  Before this patch the save
429         and restore was not complete enough so the line and columns would
430         start to drift and the debugger and stack traces will get the
431         wrong data.
432
433 2006-01-10  Martin Baulig  <martin@ximian.com>
434
435         * generic.cs
436         (TypeParameter.InflateConstraints): New public method.
437
438         * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
439         constraints; fixes #77042.
440
441 2006-01-10  Martin Baulig  <martin@ximian.com>
442
443         * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
444         instead of the `TypeBuilder' for this "<>THIS" variable; fixes
445         #77061. 
446
447 2006-01-09  Raja R Harinath  <rharinath@novell.com>
448
449         Fix #75636.
450         * expression.cs (Invocation.OverloadResolve): Replace reflected
451         override methods with their base virtual methods, rather than
452         skipping over them.
453         * typemanager.cs (TypeManager.GetOverride): New.
454
455 2005-12-21  Miguel de Icaza  <miguel@novell.com>
456
457         * driver.cs: Report the case of no source files and no -out:
458         argument provided.
459
460 2005-12-20  Raja R Harinath  <rharinath@novell.com>
461
462         Fix #77035.
463         * expression.cs (ComposedCast.GetSignatureForError): Define.
464
465 2006-01-05  Jb Evain  <jbevain@gmail.com>
466
467         * class.cs (Property.Define, Indexer.Define): do not tag the
468         properties as SpecialName | RTSpecialName.
469
470 2006-01-04  Miguel de Icaza  <miguel@novell.com>
471
472         * class.cs (MethodCore.IsDuplicateImplementation): This method was
473         doing a low-level comparission of parameter types.  It was lacking
474         a check for __argslist. 
475
476 2005-12-30  Miguel de Icaza  <miguel@novell.com>
477
478         * expression.cs (ParameterReference.DoResolveBase): Allow
479         reference parameters if they are local to this block. 
480
481         This allows the ref and out parameters of a delegate to be used in
482         an anonymous method, for example:
483
484         delegate void set (out int x);
485
486         set s = delegate (out int x){
487                 x = 0;
488         };
489
490         This is used by functionality introduced late in the C# language.
491         
492         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
493         method that take ref and out parameters. 
494
495         Fixes #77119 which was a late change in the spec.
496
497 2005-12-23  Miguel de Icaza  <miguel@novell.com>
498
499         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
500         parent if its the same scope.  Fixes #77060.
501
502 2005-12-22  Marek Safar  <marek.safar@seznam.cz>
503
504         * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
505
506 2005-12-21  Carlos Alberto Cortez <calberto.cortez@gmail.com>
507
508         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
509         errors 1726 for strong named assemblies with InternalsVisibleToAttribute 
510         that doesn't contain the full public key. This is a update of the
511         friend assemblies in .Net 2.0 release.
512         
513 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
514
515         Fix #76995
516
517         * namespace.cs (NamespaceEntry): Add extern_aliases as a
518         ListDictionary, to contain the ExternAliasEntry entries (in
519         addition to the NamespaceEntry.aliases hashtable). This field is
520         shared between the original entry and its doppelganger (bodyless 
521         copy of it).
522         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
523         extern_aliases field.
524         (NamespaceEntry.Lookup): Move the IsImplicit check after the
525         lookup in extern_aliases.
526
527 2005-12-16  Raja R Harinath  <rharinath@novell.com>
528
529         Fix #77006.
530         * class.cs (TypeContainer.Mark_HasEquals): New.
531         (TypeContainer.Mark_HasGetHashCode): New.
532         (ClassPart): Override them.
533         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
534
535         * generic.cs (GenericMethod.DefineMembers): Update to changes.
536         (TypeParameter.TypeParameter): Change type of 'parent' argument to
537         DeclSpace.
538
539         Fix #77008.
540         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
541         'parent' argument to the base constructor.
542
543         Remove all mention of TypeContainer from decl.cs.
544         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
545         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
546         (DeclSpace.DeclSpace): Likewise.
547         (DeclSpace.DefineMembers): Remove unused argument.
548         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
549         debugging check -- we don't care if the debug code throws an
550         InvalidCastException instead of an InternalErrorException.
551         * class.cs (TypeContainer.DefineMembers): Update to changes.
552         (TypeContainer.DoDefineMembers): Likewise.
553         (TypeContainer.GetMethods): Likewise.
554         (PropertyMember.Define): Likewise.
555         (MemberBase.Parent): New property that forwards to
556         MemberCore.Parent, but ensures that we get a TypeContainer.
557         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
558         (RootContext.PopulateTypes): Likewise.  Remove special case code
559         for !RootContext.StdLib: DefineMembers is idempotent.
560
561 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
562
563         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
564
565 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
566
567         * doc.cs : The search for referenced namespace was insufficient to
568           get global one as it used to do. Fixed bug #76965.
569
570 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
571
572         * doc.cs : check name in cref in the last phase that whether it is
573           namespace or not.
574
575 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
576
577         * cs-tokenizer.cs : reverted the latest change: it somehow broke
578           Mono.C5.
579
580 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
581
582         * doc.cs : so it turned out that we cannot skip override check for 
583           interface members. Fixed bug #76954.
584
585 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
586
587         * cs-tokenizer.cs : fixed bug #75984:
588           - #warning and #error should not be handled when the source line
589             is disabled.
590           - #line is not checked strictly when the source line is disabled.
591           - #define and #undef is on the other hand checked strictly at any
592             state.
593
594 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
595
596         * cs-tokenizer.cs : missing Location (actually, filename) in one of
597           CS1027 report.
598
599 2005-12-15  Raja R Harinath  <rharinath@novell.com>
600
601         * generic.cs (TypeManager.IsGeneric): Remove unused method.
602
603         * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
604         nested types.
605
606 2005-12-14  Martin Baulig  <martin@ximian.com>
607
608         * typemanager.cs (TypeManager.GetFullName): Make this public;
609         `Type.Fullname' now never returns null.
610
611         * class.cs (Method.Define): Use TypeManager.GetFullName() for
612         explicit interface implementations; we're now using the same
613         naming convention than csc does.
614
615 2005-12-14  Miguel de Icaza  <miguel@novell.com>
616
617         * convert.cs (ExplicitConversionCore): Check the return value from
618         ExplicitConversionCore which can return null on failure.  Fixes #76914
619
620 2005-12-09  Raja R Harinath  <rharinath@novell.com>
621
622         * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
623         instead of IsGenericInstance.
624         * generic.cs (TypeManager.IsEqual): Likewise.  Delete redundant
625         code that's now covered by the more general test.
626         * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
627
628         * generic.cs (DropGenericTypeArguments): New.  Captures the common
629         pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
630         * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
631         * generic.cs, report.cs, typemanager.cs: Likewise.
632
633 2005-12-08  Martin Baulig  <martin@ximian.com>
634
635         * generic.cs (TypeArguments.Resolve): Added CS1547 check.
636
637         * typemanager.cs (TypeManager.CSharpSignature): Include type
638         arguments in the signature of a generic method.
639
640 2005-12-07  Martin Baulig  <martin@ximian.com>
641
642         Add support for custom attributes on type parameters.
643
644         * cs-parser.jay (type_arguments): Added `opt_attributes'.
645
646         * generic.cs (TypeParameterName): New public class; we use this
647         instead of a `string' to store the name of a type parameter, so we
648         can also have `Attributes'.
649         (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
650         array instead of a `string[]' array.
651         (TypeParameter.ctor): We now also take an `Attributes' argument.
652         (TypeParameter.EmitAttributes): New public method; emit our
653         `OptAttributes' here.
654         (GenericMethod.EmitAttributes): New public method; emit the custom
655         attributes on all our type parameters.
656
657         * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
658         our type parameters.
659         (MethodData.Define): If we're a generic method, call
660         EmitAttributes() on it.
661
662 2005-12-07  Martin Baulig  <martin@ximian.com>
663
664         * generic.cs
665         (ConstraintChecker): New public abstract class; move the
666         constraint checking here from `ConstructedType' and also do
667         constraint checking for generic methods here.
668
669         * expression.cs (Invocation.OverloadResolve): Use
670         ConstraintChecker.CheckConstraints() if we resolved to a generic
671         method.  Fix #76806.
672
673 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
674
675         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
676
677         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
678         event initializers.
679         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
680         (FieldBase.Initializer): Initializer is now optional.
681         (EventField.Define): Only event field can have initializer.
682
683         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
684
685         * const.cs (Const): Reuse initializer.
686
687         * cs-parser.jay: Updated after FieldBase changes.
688         Added current_array_type to simplify array initializers.
689
690         * ecore.cs (NullCast.IsDefaultValue): Implemented.
691
692         * expression.cs, iterators.cs: Updated.
693
694         * namespace.cs (NamespaceEntry): Made UsingFound private.
695
696 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
697
698         * parameterCollection.cs: Obsolete, removed.
699         * parser.cs: Obsolete, removed.
700
701 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
702
703         Fix #76849.
704         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
705
706         * enum.cs (Enum.Define): Set obsolete context here.
707
708 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
709
710         * doc.cs :
711           - FindDocumentedMember() now expects 1) paramList as null
712             when "we don't have to check the number of parameters" and
713             2) Type.EmptyTypes when "there is no arguments".
714           - Introduced FoundMember struct to hold the exact type which was
715             used to find the documented member (the above change broke
716             test-xml-044; it might be better just to use DeclaringType than
717             what MS does, like this change does, but it depends on usage.)
718
719 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
720
721         * doc.cs : documented member might be from DeclaringType for nested
722           types. Fixed bug #76782.
723
724 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
725
726         * anonymous.cs: Have the param code handle leaving copies on the
727         stack etc. Allows anonymous params to take part in the assignment
728         code (++, +=, etc). Fixes bug #76550
729
730         * expression.cs: Handle the prepare_for_load/leave_copy by passing
731         it down to the anon code.
732
733         * iterators.cs: Use dummy var here
734
735         * codegen.cs: Handle new vars
736
737 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
738
739         Fix #76849.
740         * class.cs (MethodData.Define): Set proper Obsolete context.
741
742         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
743         obsolete context.
744         (FieldExpr.DoResolve): Ditto.
745
746 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
747
748         Fix #76849.
749         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
750         parent is not obsolete.
751
752 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
753
754         * doc.cs : (FindDocumentedMember) find parameterless members first
755           and get CS0419 in the early stage. Fixed first case of bug #76727.
756
757 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
758
759         Fix #76859.
760         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
761         no error was reported.
762
763         *expression.cs (Binary.DoResolve): left can be null.
764
765 2005-12-06  Raja R Harinath  <rharinath@novell.com>
766
767         * class.cs (MethodCore.CheckGenericOverride): Delete unused
768         abstract method and all overrides.
769         * support.cs (ParameterData.GenericConstraints): Delete.
770         (ReflectionParameters.type_params): Delete.
771         (ReflectionParameters.ReflectionParameters): Make private.
772         (ReflectionParameters.GetConstaints): New factory method.
773         * generic.cs (TypeParameterDefineType): Use it.
774         (TypeManager.GetTypeParameterConstraints): Likewise.
775
776 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
777
778         Fix #76783.
779         * class.cs (MethodData.Emit): Parameters should be labeled first.
780
781 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
782
783         Fix #76761.
784         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
785
786 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
787
788         * attribute.cs (AreParametersCompliant): Moved to Parameter.
789
790         * class.cs (MethodCore): Parameter clean up.
791         (IMethodData): Added ParameterInfo.
792         (MethodData): Parameter clean up.
793         (Indexer.Define): Parameter clean up.
794
795         * anonymous.cs,
796         * codegen.cs,
797         * cs-parser.jay,
798         * decl.cs,
799         * doc.cs,
800         * ecore.cs,
801         * flowanalysis.cs,
802         * iterators.cs,
803         * pending.cs,
804         * statement.cs,
805         * typemanager.cs: Parameter clean up.
806
807         * delegate.cs (Define): Get rid of duplicated code.
808
809         * expression.cs (ParameterReference): Removed useless parameters
810         and simplified.
811         (Invocation): Ditto.
812
813         * parameter.cs (ParamsParameter): New class, params specialization.
814         (ArglistParameter): Attemp to separate arglist.
815         (Parameter): Refactored to be reusable and faster.
816         (Parameter.Modifier): Made understandable.
817         (Parameters): Changed to be used as a class for `this' assembly
818         parameters. Refactored to use new specialized classes.
819
820         * support.cs (ParameterData): Added Types property.
821         (InternalParameters): Deleted.
822
823 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
824
825         * doc.cs : the previous patch does not actually fix the bug.
826           PropertyInfo override check is now implemented and really fixed it.
827         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
828
829 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
830
831         * doc.cs : apply "override filter" also to properties.
832           Fixed bug #76730.
833
834 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
835
836         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
837           no need to check overrides. For classes, omit those results from 
838           interfaces since they must exist in the class. Fixed bug #76726.
839
840 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
841
842         * typemanager.cs : (GetFullNameSignature) differentiate indexers
843           with different parameters. Fixed the second problem in #76685.
844
845 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
846
847         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
848           get expected 'protected' access in CheckValidFamilyAccess()).
849           Fixed bug #76692.
850
851 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
852
853         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
854           Fixed bug #76705.  CS1569 was incorrectly commented out.
855
856 2005-11-23  Martin Baulig  <martin@ximian.com>
857
858         * generic.cs (Constraints.Define): Removed.
859         (TypeParameter.DefineConstraints): Removed.
860         (TypeParameter.DefineType): Call SetGenericParameterAttributes()
861         on the GenericTypeParameterBuilder here.
862
863 2005-11-23  Martin Baulig  <martin@ximian.com>
864
865         * typemanager.cs (TypeManager.GetProperty): Make this public.
866
867         * generic.cs (Nullable.NullableInfo.ctor): Use
868         TypeManager.GetProperty() rather than using reflection directly.
869
870 2005-11-17  Martin Baulig  <martin@ximian.com>
871
872         * expression.cs (Indexers.GetIndexersForType): Added support for
873         generic parameters; fixes #76587.
874
875 2005-11-17  Martin Baulig  <martin@ximian.com>
876
877         * anonymous.cs
878         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
879         inherit the scope from our parent.  Fixes #76653.
880
881 2005-11-15  Martin Baulig  <martin@ximian.com>
882
883         * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
884         instead of `ScopeTypeBuilder' to refer to the "current" type.
885         (AnonymousMethod.CreateScopeType): Correctly create the helper
886         class if we're inside a generic type definition.
887
888 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
889
890         * doc.cs : use Invocation.IsOverride() to do real override check.
891         * expression.cs : made Invocation.IsOverride() internal.
892
893 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
894
895         * doc.cs : use TypeManager.FindMembers() instead of (possible)
896           TypeBuilder.FindMembers() and filter overriden base members out.
897           Fixed bug #76990.
898
899 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
900
901         * doc.cs : ref/out parameters are represented as '@' (instead of
902           '&' in type FullName). Fixed bug #76630 (additionally crefs).
903
904 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
905
906         * doc.cs : when there was no '.' in cref to methods in doc comment,
907           then parameters were missing in the output. Fixed bug #76691.
908
909 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
910
911         * driver.cs : don't output docs when there is an error.
912           Fixed bug #76693.
913
914 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
915
916         * doc.cs :
917           Now it should detect indexers. Fixed primary concern in bug #76685.
918           Fixed CS0419 message to not show the identical member signature in
919           the message.
920
921 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
922
923         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
924           instead of Type.FindMembers() since it does not handle events.
925           Fixed bug #71604.
926
927 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
928
929         * codegen.cs: Fixed typo (speficied -> specified).
930
931 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
932
933         Fix #76369.
934         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
935
936 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
937
938         * attribute.cs: Changed error message.
939
940         * cs-tokenizer.cs: One more check.
941
942 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
943
944         * statement.cs (Block.Resolve): Ignore empty statement.
945
946 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
947
948         * report.cs: Made error/warning methods more strict to avoid
949         their misuse.
950
951         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
952         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
953         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
954         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
955
956 2005-11-11  Carlos Alberto Cortez <calberto.cortez@gmail.com>
957
958         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): 
959         Use the more explicit AssemblyName.FullName instead of 
960         AssemblyName.Name to report errors.
961         
962 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
963
964         * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
965         with mcs.
966
967 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
968
969         * class.cs,
970         * convert.cs,
971         * cs-parser.jay,
972         * decl.cs,
973         * enum.cs,
974         * expression.cs,
975         * generic.cs,
976         * pending.cs,
977         * report.cs: Fixed error reporting and typos.
978
979         * generic.cs (TypeParameter.GetSignatureForError): New method.
980         (ConstructedType.GetSignatureForError): Instead of DeclarationName.
981
982         * typemanager.cs (GetFullName): Refactored.
983
984 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
985
986         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
987         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
988
989         * class.cs (TypeContainer.IsComImport): New property.
990         (Constructor.Define): Create proper ctor for ComImport types.
991
992         * expression.cs (New.CheckComImport): Fixed.
993
994 2005-11-07  Miguel de Icaza  <miguel@novell.com>
995
996         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
997         that a parameter has been captured does not mean that we do not
998         have to do the rest of the processing.  This fixes the second part
999         of #76592.  If there was another anonymous method capturing
1000         values in the past, the Scope would never be set for the second
1001         method that captured the same parameter.
1002
1003         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
1004         properly manipulate the stack.   Second part of fix for #76592.
1005
1006         * expression.cs (New): Add support for invoking "new" on
1007         interfaces that have been flagged with the ComImport attribute and
1008         the CoClass.  Fixes #76637 
1009
1010         * statement.cs (Try.DoEmit): When a variable is captured, do not
1011         try to emit the vi.LocalBuilder variable as it has been captured.
1012         Create a temporary variable and store the results on the
1013         FieldBuilder.  Fixes #76642
1014
1015 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1016
1017         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
1018
1019         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
1020
1021         * expression.cs (Binary.DoResolve): Added && optimalization.
1022     
1023         * typemanager.cs (AddUserType): Removed useless argument.
1024
1025 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
1026
1027         * statement.cs (Block.variables): Uses ListDictionary.
1028
1029 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1030
1031         Fix #75969.
1032         * class.cs (PartialContainer.EmitType): Customized to emit
1033         security attributes.
1034         (ClassPart.ApplyAttributeBuilder): Transform security attribute
1035         for partial classes.
1036
1037 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1038
1039         Fix #76599.
1040         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
1041         access has to be fixed.
1042         
1043         * typemanager.cs (IsUnmanagedType): Wrong common field type.
1044
1045 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
1046
1047         Fix #76590.
1048         * ecore.cs (NullCast.Reduce): Implemented.
1049
1050         * expression.cs (ArrayCreation.CheckIndices): Correcly check
1051         constant type.
1052         
1053         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
1054         properly.
1055         (Foreach.Resolve): Catch null properly.
1056
1057 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1058  
1059         * cs-tokenizer.cs: Warning text fix.
1060
1061         * driver.cs: AllWarningNumbers exposed on public interface.
1062
1063         * report.cs (): Reviewed warning numbers.
1064         (IsValidWarning): Use binary search.
1065
1066 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1067  
1068         * driver.cs: Implemeted resource visibility.
1069         (Resources): New class for code sharing between /res: and
1070         /linkres:
1071  
1072 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1073
1074         decl.cs (CurrentTypeParameters): Fixed to be public.
1075
1076 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1077
1078         generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
1079
1080 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1081
1082         gmcs.exe.sources: Use CryptoConvert.cs from corlib.
1083
1084 2005-11-05  Kornél Pál  <kornelpal@hotmail.com>
1085
1086         * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
1087
1088 2005-11-04  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1089
1090         Add friend assembly access support.
1091         * typemanager.cs: assembly_internals_vis_attrs
1092         cache for friend assembly access. 
1093         (TypeManager.IsFriendAssembly): New method for
1094         checking friend assembly access.
1095         (TypeManager.Error_FriendAccessNameNotMatching): New
1096         helper method.
1097         (TypeManager.CompareKeyTokens): Likewise.
1098         (TypeManager.Filter): Handle friend accessible
1099         members.
1100
1101         * namespace.cs (RootNamespace.GetTypeInAssembly): Return
1102         friend accessible types.
1103
1104         * ecore.cs (Expression.IsAccessorAccessible): Handle
1105         friend accessible properties.
1106
1107         * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
1108         accessible types.
1109         
1110 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
1111
1112         Fix #76568.
1113         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
1114         folding.
1115         
1116         * convert (Convert.ImplicitReferenceConversion): NullCast holds
1117         contants only.
1118         
1119         * ecore.cs (NullCast): Child is contant only.
1120         
1121         * literal.cs (NullLiteral.Reduce): null can be converted to any
1122         reference type.
1123
1124 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
1125
1126         * driver.cs: Use Encoding.Default as default code page instead
1127           of ISO-28591.
1128
1129 2005-10-27  Raja R Harinath  <rharinath@novell.com>
1130
1131         Fix #76085.
1132         * expression.cs (Invocation.Error_InvalidArguments): Handle
1133         __arglist parameters.
1134         (Invocation.VerifyArgumentsCompat): Likewise.
1135         * support.cs (ReflectionParameters.GetSignatureForError): Print
1136         __arglist parameters.
1137         (InternalParamters.GetSignatureForError): Likewise.
1138         * parameter.cs (Parameters.GetSignatureForError): Likewise.
1139
1140 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
1141
1142         * attribute.cs (GetPropertyValue): Made public.
1143
1144         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
1145         Resolve.
1146         Add new property WrapNonExceptionThrows to handle 2.0 assembly
1147         attribute.
1148         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
1149         is not defined.
1150         
1151         * driver.cs: Reflect method name change.
1152         
1153         * statement.cs (Try.Resolve): Warn when try has both general
1154         exception handlers.
1155         
1156         * typemanager.cs: runtime_compatibility_attr_type new predefined
1157         type.
1158
1159 2005-10-26  Raja R Harinath  <harinath@gmail.com>
1160
1161         Fix #76419.
1162         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
1163         treat it as an empty parameter list.
1164
1165 2005-10-26  Raja R Harinath  <rharinath@novell.com>
1166
1167         Fix #76271.     
1168         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
1169         ResolveAsTypeStep silent.
1170         * statement.cs (Block.AddConstant): Mark block as used.
1171         (Block.ResolveMeta): Avoid piling on error messages
1172         if a constant initializer resolution fails.
1173
1174 2005-10-25  Raja R Harinath  <rharinath@novell.com>
1175
1176         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
1177         Remove.
1178         (NamespaceEntry.VerifyAllUsing): New.
1179         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
1180         behaviour.  Delegates actual resolution of alias to ...
1181         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
1182         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
1183         Update.
1184         * driver.cs (Driver.MainDriver): Update.
1185         
1186         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
1187         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
1188         property.
1189         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
1190         Remove.
1191         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
1192         RootNamespace.DefineNamespacesForAll.
1193
1194 2005-10-24  Raja R Harinath  <harinath@gmail.com>
1195
1196         * typemanager.cs (assemblies, external_aliases, modules)
1197         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
1198         (ComputeNamespaces, GetRootNamespace): Remove extra staging
1199         overhead.  Move resposibility ...
1200         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
1201         * driver.cs, attribute.cs, codegen.cs: Update to changes.
1202
1203 2005-10-23  Raja R Harinath  <harinath@gmail.com>
1204
1205         * namespace.cs (RootNamespace.all_namespaces): Renamed from
1206         cached_namespaces.  Improve usage.
1207         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
1208         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
1209         Move from GlobalRootNamespace and simplify.
1210         (RootNamespace.Global): Make instance variable.
1211         (RootNamespace.RootNamespace): Add "alias name" parameter.
1212         (GlobalRootNamespace): Simplify drastically.
1213         (Namespace.Lookup): Don't use GetNamespace.
1214         * typemanager.cs (GetRootNamespace): Rename from
1215         ComputeNamespaceForAlias.
1216         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
1217
1218 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1219
1220         * anonymous.cs (AnonymousContainer): Don't crash when container
1221         doesn't exist.
1222
1223 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1224
1225         * expression.cs (Binary.DoResolve): Warn when comparing same
1226         values.
1227
1228 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1229
1230         Fix #76486.
1231         * expression.cs (Binary.DoResolve): It looks like there are no
1232         convetsion rules in enum context.
1233
1234 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1235
1236         Add support for extern alias qualifiers.
1237         * typemanager.cs: Move some LookupTypeReflection code
1238         to namespace.cs, to have cleaner code. Added some methods
1239         to help us keep track of the extern aliased references.
1240         * driver.cs: Add suport for extern alias assemblies on command
1241         line and check for their warnings/errors. Also keep track of the
1242         extern aliased assemblies.
1243         * namespace.cs: Move the global functionality of Namespace
1244         to GlobalRootNamespace/RootNamespace. Now the global namespace
1245         is GlobalRootNamespace.Globa. Also the code moved from 
1246         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
1247         Finally added LocalAliasEntry (AliasEntry before) and
1248         ExternAliasEntry, to handle alias statements.
1249         * cs-parser.jay: Add support in the grammar for extern alias
1250         statement.
1251         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
1252         Update callings to Namespace (now in GlobalRootNamespace).
1253
1254 2005-10-25  Martin Baulig  <martin@ximian.com>
1255
1256         * convert.cs (ImplicitTypeParameterConversion): Make base
1257         interfaces actually work; fixes #76557.
1258
1259 2005-10-25  Martin Baulig  <martin@ximian.com>
1260
1261         * generic.cs
1262         (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
1263         all the type parameters; fixes #76551.
1264
1265 2005-10-25  Martin Baulig  <martin@ximian.com>
1266
1267         Fix #76472.
1268
1269         * generic.cs
1270         (GenericMethod.ctor): Added `Expression return_type' and
1271         `Parameters parameters' arguments.
1272         (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
1273         parameter and return types to check their constraints if they're
1274         generic types.
1275
1276         * codegen.cs (EmitContext.ResolvingGenericMethod): New public
1277         boolean field.
1278
1279         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
1280         constraints of a generic type if `ec.ResolvingGenericMethod'.
1281
1282         * class.cs (MethodCore.DoDefineParameters): Set
1283         `ec.ResolvingGenericMethod' if we're a generic method.
1284         (MemberBase.MemberType): Likewise.
1285
1286 2005-10-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1287
1288         * typemanager.cs (TypeManager): Added 
1289         TypeManager.internals_visible_attr_type to cache
1290         S.R.CompilerServices.InternalsVisibleToAttribute.
1291
1292         * codegen.cs (AssemblyClass): Added checks for 
1293         InternalsVisibleToAttribute in new method 
1294         CheckInternalsVisibleAttribute () and also cache the
1295         AssemblyName in AssemblyClass.Name.
1296         
1297 2005-10-24  Martin Baulig  <martin@ximian.com>
1298
1299         * typemanager.cs
1300         (TypeManager.ExpandInterfaces): Added overloaded version which
1301         just takes a `Type[]' array.
1302
1303         * generic.cs
1304         (Constraints.Resolve): Don't expand the interfaces here; ie. we
1305         just use the interfaces which were explicitly specified and not
1306         the interfaces they inherit.  Fixes #76482.
1307         (TypeParameter.FindMembers): Expand the interfaces here.
1308
1309 2005-10-21  Martin Baulig  <martin@ximian.com>
1310
1311         * generic.cs
1312         (Constraints.Resolve): Also resolve the actual types here.
1313         (Constraints.ResolveTypes): Just check the constraints here.
1314         Fixes #76363; see gtest-218.cs.
1315
1316 2005-10-21  Martin Baulig  <martin@ximian.com>
1317
1318         * convert.cs
1319         (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
1320         instead of a `BoxedCast'; fixes gtest-217.cs.
1321
1322 2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
1323
1324         * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
1325           1) "new()" is specified as generic parameter constraint and 2) the
1326           type is TypeBuilder and 3) the type is abstract even if it has a
1327           default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
1328
1329 2005-10-20  Martin Baulig  <martin@ximian.com>
1330
1331         * generic.cs
1332         (GenericConstraints.TypeParameter): New public property.
1333         (TypeParameter.ctor): Also take a `DeclSpace' argument.
1334         (TypeParameter.DeclSpace): New public property.
1335         (TypeParameter.DefineType): Inflate the constraints if our
1336         `DeclSpace' is an `Iterator'.   
1337
1338 2005-10-19  Atsushi Enomoto  <atsushi@ximian.com>
1339
1340         * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added 
1341           GenericMethod argument to compare methods' generic type arguments.
1342           Fixed bug #76382.
1343
1344 2005-10-19  Martin Baulig  <martin@ximian.com>
1345
1346         * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
1347         not ResolveType() when resolving the base type, so we're not
1348         checking the constraints here.
1349         (TypeContainer.ResolveType): Call ResolveType() on our base_type
1350         if we have any.
1351
1352 2005-10-19  Martin Baulig  <martin@ximian.com>
1353
1354         * generic.cs (ConstructedType.CheckConstraints): Committing
1355         untested fix for #76441.
1356
1357 2005-10-18  Raja R Harinath  <rharinath@novell.com>
1358
1359         Fix #76371.
1360         * class.cs (TypeContainer.DefineType): Move updating of
1361         topological sort earlier in the code.
1362         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
1363
1364 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
1365
1366         Fix #76273.
1367         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
1368         
1369         * constant.cs (Constant.TryReduce): Moved from Cast class.
1370         (Reduce): Made little bit more OO and fixed missing conversions.
1371         
1372         * ecore.cs (Reduce): Implemented.
1373         (Binary.EnumLiftUp): New method to upgrade values to enum values.
1374         
1375         * literal.cs (Reduce): Implemented.
1376         
1377         * class.cs: Reverted Miguel's wrong commit.
1378
1379 2005-10-14  Miguel de Icaza  <miguel@novell.com>
1380
1381         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
1382
1383 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
1384
1385         * cs-parser.jay, expression.cs : CS0214 was missing error location
1386           for constants. Fixed bug #76404.
1387
1388 2005-10-10  Raja R Harinath  <rharinath@novell.com>
1389
1390         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
1391         InstanceExpression.
1392         (PropertyExpr.EmitCall): Likewise.
1393         * expression.cs (Invocation.EmitArguments): Handle case where
1394         arguments == null.
1395         (Invocation.EmitCall): Avoid allocating temporary variable if
1396         there are no arguments.
1397
1398 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
1399
1400         Fix #76370.
1401         * convert.cs (ExplicitConversionCore): Fixed object->enum
1402         conversion.
1403
1404 2005-10-07  Raja R Harinath  <rharinath@novell.com>
1405
1406         Fix #76323.
1407         * convert.cs (ImplicitConversionStandard): Move conversion of
1408         void* to arbitrary pointer types ...
1409         (ExplicitConversionStandard): .. here.
1410         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
1411         error to always print typenames.
1412
1413 2005-10-07  Raja R Harinath  <rharinath@novell.com>
1414
1415         * convert.cs (GetConversionOperator): Rename from
1416         GetConversionOperators.  Move operator selection code from ...
1417         (UserDefinedConversion): ... here.
1418
1419 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
1420
1421         * convert.cs (ExplicitConversionCore): Removed duplicate enum
1422         conversion.
1423
1424 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
1425
1426         * assign.cs (Assign.DoResolve): Error method changed.
1427
1428         * cfold.cs (DoConstantNumericPromotions): Error method changed.
1429         
1430         * const.cs (ResolveValue): Reset in_transit immediately.
1431         
1432         * constant.cs: Error method changed.
1433         
1434         * convert.cs: Removed useless location parameter.
1435         (ExplicitNumericConversion): Don't do double enum check.
1436         (ExplicitConversionCore): Renamed from ExplicitConversion.
1437         (ExplicitUnsafe): Extracted from ExplicitConversion.
1438         (ExplicitConversion): Uses for error reporting.
1439         
1440         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
1441         error messages.
1442         (ResolveBoolean): Uses common error method.
1443         (CastToDecimal): Get rid of ec.
1444         (CastFromDecimal): Optimized.
1445         (ConvCast): Get rid of ec.
1446         
1447         * enum.cs (ResolveValue): Reset in_transit immediately.
1448         (Emit): Return after first error.
1449         
1450         * expression.cs: Convert changes.
1451         
1452         * literal.cs: Error method changed.
1453         
1454         * statement.cs: Error method changed.
1455
1456 2005-10-06  Raja R Harinath  <rharinath@novell.com>
1457
1458         Fix gtest-131.cs and gtest-211.cs.
1459         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
1460         Only emit code for a label if it is used.  Unreachable code can
1461         violate ECMA evaluation stack invariants.
1462
1463 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
1464
1465         * anonymous.cs: Implemented ExprClassName.
1466         
1467         * assign.cs (Assign.DoResolve): Don't chrash when type is not
1468         delegate.
1469         
1470         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
1471         check.
1472         
1473         * class.cs (StaticClass.DefineContainerMembers): Report protected
1474         members as error.
1475         
1476         * codegen.cs: if(ed) PRODUCTION.
1477         
1478         * convert.cs (Error_CannotImplicitConversion): Better error
1479         distinction.
1480         
1481         * cs-parser.jay: More error checks.
1482         
1483         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
1484         
1485         * driver.cs (CSCParseOption): Enabled wrong option check.
1486         
1487         * ecore.cs (Expression.ExprClassName): Turned to property.
1488         (MemberExpr.CheckIntermediateModification): For checking boxed
1489         value types     modification.
1490         
1491         * statement.cs (Fixed.Resolve): Expression type must be
1492         convertible to fixed type.
1493         (CollectionForeach.GetEnumeratorFilter,TryType):
1494         Small refactoring for easier error checking.
1495
1496 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
1497
1498         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
1499         attributes.
1500         
1501         * class.cs (GeneratedBaseInitializer): New class for customization
1502         compiler generated initializers.
1503         (MemberBase.DoDefine): Check Obsolete attribute here.
1504         (FieldMember.DoDefine): Ditto.
1505         
1506         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
1507         constants.
1508         
1509         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
1510         (MemberCore.GetObsoleteAttribute): Removed argument.
1511         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
1512         (MemberCore.CheckObsoleteType): New helper.
1513         
1514         * delegate.cs,
1515         * enum.cs,
1516         * statement.cs: Updates after MemberCore changes.
1517         
1518         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
1519         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
1520         
1521         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
1522         obsolete attribute for compiler construct.
1523         (As.DoResolve): Cache result.
1524         
1525         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
1526
1527 2005-10-01  Miguel de Icaza  <miguel@novell.com>
1528
1529         * expression.cs (Probe): instead of having a "Type probe_type"
1530         keep the extra information as a TypeExpr probe_type_expr since the
1531         "As" operator needs to perform some type checks.
1532
1533         * (As.DoResolve): If the type is a type parameter, ensure that it
1534         is constrained by a class.
1535
1536 2005-09-22  Miguel de Icaza  <miguel@novell.com>
1537
1538         * statement.cs (Lock): Use the TemporaryVariable class instead of
1539         manually using local variables as those do not work when variables
1540         are captured.
1541
1542         * ecore.cs: Moved the TemporaryVariable class from being a nested
1543         class inside Foreach to be a public class that can be employed in
1544         other places. 
1545
1546 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
1547
1548         * cs-parser.jay: interface_accessors replaced by
1549         accessor_declarations.
1550
1551         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
1552         location.
1553         
1554         * statement.cs (GotoCase.Resolve): Convert null constant to
1555         null case.
1556         (SwitchLabel.ResolveAndReduce): Ditto.
1557         (SwitchLabel.NullStringCase): Custom null stamp.
1558         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
1559         
1560         typemanager.cs (CSharpSignature): Don't skip first argument
1561         for full names.
1562
1563 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
1564
1565         * cfold.cs, constant.cs, convert.cs, ecore.cs,
1566         expression.cs, iterators.cs, literal.cs: Store constants and
1567         literals location.
1568         
1569         * class.cs (MemberBase.ShortName): Pass location.
1570         
1571         * cs-parser.jay: Some location fixes.
1572         
1573         * ecore.cs (Expression.Location): Made virtual.
1574
1575 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
1576
1577         Fix #72930.
1578         * const.cs (Const.ResolveValue): Check for assigning non-null
1579         value to reference type.
1580
1581 2005-09-26  Raja R Harinath  <rharinath@novell.com>
1582
1583         Fix #76133.
1584         * expression.cs (This.VerifyFixed): In a value type T, the type of
1585         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
1586         value type R, 'this' is treated as a value parameter.
1587
1588 2005-09-05  Miguel de Icaza  <miguel@novell.com>
1589
1590         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
1591         if the underlying types are the same, otherwise we need to produce
1592         code that will do the proper cast.
1593
1594         This was exposed by Marek's constant rewrite which produced
1595         invalid code for the call site:
1596
1597         enum X : long { a }
1598         void Method (X v) {}
1599
1600         Method ((X) 5)
1601
1602         This fixes test-49.cs
1603
1604 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
1605
1606         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
1607           Type/Object should be allowed as well. Fixed bug #75968.
1608
1609 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
1610
1611         * expression.cs : (Binary.DoResolve): when one is enum constant and
1612           another is constant 0, then return enum one *as enum type*.
1613           Fixed bug 74846.
1614
1615 2005-10-04  Martin Baulig  <martin@ximian.com>
1616
1617         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
1618         `SetMemberIsUsed()' work for generics, too.
1619
1620 2005-10-04  Martin Baulig  <martin@ximian.com>
1621
1622         * expression.cs (DelegateInvocation.EmitStatement): Make this work
1623         for corlib.  Fixes #75691.
1624
1625 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
1626
1627         Fix #76255.
1628         * driver.cs: Fix compilation files with full root path.
1629
1630 2005-09-25  Miguel de Icaza  <miguel@novell.com>
1631
1632         * report.cs (SymbolRelatedToPreviousError): Format the output so
1633         it does not use an open parenthesis that is never closed. 
1634
1635         * driver.cs: Follow coding guidelines
1636
1637 2005-09-18  Miguel de Icaza  <miguel@novell.com>
1638
1639         * driver.cs: Set InEmacs based on the environment variable EMACS. 
1640
1641         * location.cs (InEmacs): in this mode, do not report column
1642         location as it confuses Emacs.
1643
1644 2005-10-03  Raja R Harinath  <rharinath@novell.com>
1645
1646         * support.cs (SeekableStreamReader.Position): Don't error out when
1647         the requested position is just beyond the end of the current
1648         buffered data.
1649
1650 2005-09-28  Raja R Harinath  <rharinath@novell.com>
1651
1652         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
1653         try to keep in sync with the byte count of the underlying Stream.
1654         However, this limits us to a window size of 2048 characters: i.e.,
1655         the maximum lookahead of our lexer/parser can be 2048 characters.
1656
1657 2005-09-22  Martin Baulig  <martin@ximian.com>
1658
1659         * driver.cs: Removed a debugging FIXME.
1660
1661 2005-09-21  Raja R Harinath  <rharinath@novell.com>
1662
1663         * cs-parser.jay (type_arguments): Add CS1644 check.
1664         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
1665
1666 2005-09-15  Raja R Harinath  <rharinath@novell.com>
1667
1668         * Makefile (PROGRAM): Make profile specific.
1669         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
1670         the current directory.
1671
1672         Fix test-455.cs.
1673         * expression.cs (Invocation.EmitCall): Remove optimization on
1674         this_call since it doesn't handle 'this' being a value type.
1675
1676 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
1677
1678         * driver.cs: Ensure file handles are closed after parsing
1679
1680 2005-09-05  Miguel de Icaza  <miguel@novell.com>
1681
1682         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
1683         if the underlying types are the same, otherwise we need to produce
1684         code that will do the proper cast.
1685
1686         This was exposed by Marek's constant rewrite which produced
1687         invalid code for the call site:
1688
1689         enum X : long { a }
1690         void Method (X v) {}
1691
1692         Method ((X) 5)
1693
1694         This fixes test-49.cs
1695
1696 2005-09-05  Martin Baulig  <martin@ximian.com>
1697
1698         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
1699         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
1700
1701         * cs-parser.jay (delegate_declaration): Small fix for #75852.
1702
1703 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
1704
1705         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
1706           to be a pointer type due to the spec 25.2, so check if declaring
1707           type is generic type definition. Fixed bug #75772.
1708
1709 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
1710
1711         Fixed bug #75957.
1712         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
1713           both types are not defined by methods.
1714         * expression.cs : (Invocation.IsApplicable): it should work when
1715           the argument type is equal to the parameter type, not only when
1716           ImplicitConversionExists() returns true.
1717
1718 2005-09-02  Raja R Harinath  <rharinath@novell.com>
1719
1720         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
1721         internal.
1722
1723         Fix #75941.
1724         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
1725         flow-branching for LocalVariableReferences in case we were invoked
1726         from a MemberAccess.
1727         * expression.cs (LocalVariableReference.VerifyAssigned): New.
1728         Carved out of ...
1729         (LocalVariableReference.DoResolveBase): ... this.
1730         (MemberAccess.Resolve): Do the check that was disabled during
1731         SimpleNameResolve.
1732
1733 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
1734
1735         * class.cs :
1736           (PartialContainer.Create): check abstract/sealed/static strictly
1737           but abstract/sealed can exist only at one side. Fixed bug #75883.
1738
1739 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
1740
1741         Fix #75945.
1742         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
1743         specified, don't default to UnmanagedType.I4.
1744
1745 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
1746
1747         * expression.cs : conditional operator should check possibly
1748           incorrect assign expression. Fixed bug #75946.
1749
1750 2005-08-30  Raja R Harinath  <rharinath@novell.com>
1751
1752         Fix #75934.
1753         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
1754         (ScopeInfo.EmitScopeType): Use it to construct field names from
1755         names of captured locals.
1756
1757         Fix #75929.
1758         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
1759         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
1760         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
1761         (ExplicitConversion): Remove enum cases already handled by
1762         implicit conversion.  Move implicit conversion check to the beginning.
1763         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
1764         * expression.cs (ArrayCreation.EmitDynamicInitializers):
1765         Don't treat System.Enum as a struct.
1766
1767 2005-08-30  Jb Evain  <jbevain@gmail.com>
1768
1769         * attribute.cs: handles as expression in parameters.
1770
1771 2005-08-30  Raja R Harinath  <rharinath@novell.com>
1772
1773         Fix #75802.
1774         * class.cs (TypeContainer.VerifyClsName): Don't use a
1775         PartialContainer when verifying CLS compliance.
1776         (AbstractPropertyEventMethod): Set Parent here, ...
1777         (PropertyMethod): ... not here.
1778
1779 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
1780
1781         * attribute.cs : escaped attribute name should not be allowed to be
1782           resolved (e.g. @class as classAttribute). Fixed bug #75930.
1783
1784 2005-08-29  Raja R Harinath  <rharinath@novell.com>
1785
1786         Fix #75927.
1787         * convert.cs (ImplicitStandardConversionExists): Allow zero also
1788         when converting a long constant to unsigned long.
1789         * expression.cs (Invocation.OverloadResolve): Add sanity check to
1790         detect where IsApplicable and VerifyArgumentsCompat disagree.
1791
1792 2005-08-29  Raja R Harinath  <rharinath@novell.com>
1793         and Carlos Alberto Cortez  <carlos@unixmexico.org>
1794
1795         Fix #75848.
1796         * class.cs (TypeContainer.CanElideInitializer): New helper.
1797         (TypeContainer.EmitFieldInitializers): Use it to determine if we
1798         can safely emitting the initializer of a field.
1799
1800 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
1801
1802         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
1803           allowed inside a switch (without loop). Fixed bug #75433.
1804
1805 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
1806
1807         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
1808         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
1809
1810 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
1811
1812         * driver.cs : kinda reverting the default encoding changes (not exact 
1813           revert since I noticed that "codepage:reset" might not work fine).
1814
1815 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
1816
1817         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
1818           Location. Now getter and setter store location correctly.
1819           (errors/cs0111-12.cs now reports the expected location.)
1820
1821 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
1822
1823         * driver.cs : Use default encoding on the environment.
1824           Removed (now that) extra parameter for SeekableStreamReader.
1825         * support.cs : (SeekableStreamReader) third .ctor() argument for
1826           StreamReader is not required (always true). preamble size could
1827           be acquired in simpler and safe way.
1828
1829 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
1830
1831         * cs-parser.jay: report CS0642 at warning level 3
1832           and report CS0642 for an if else statement also
1833           fixes bug #74745. Patch by John Luke (and a bit
1834           modified by me).
1835           Removed extra CS0642 warning check for "while",
1836           "for" and "fixed".
1837         * statement.cs: In Block.Resolve(), CS0642 check
1838           is reimplemented to check a sequence of an empty
1839           statement and a block.
1840
1841           Both fix bug #66777.
1842
1843 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
1844
1845         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
1846         detection until I fix it.
1847         
1848         * cs-tokenizer.cs: Changed error message.
1849         
1850         * cs-parser.jay: Fixed 2 error locations.
1851         
1852         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
1853         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
1854         properties.
1855         
1856         * enum.cs (GetSignatureForError): Fixed.
1857         
1858         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
1859         method detection.
1860         
1861         * class.cs,
1862         * typemanager.cs (RegisterProperty): Removed.
1863         
1864         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
1865
1866 2005-08-24  Raja R Harinath  <rharinath@novell.com>
1867
1868         Fix #75874.
1869         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
1870         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
1871
1872 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1873
1874         * expression.cs : tiny fix is required for not warning positive ulong.
1875           See test-441.cs.
1876
1877 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1878
1879         * expression.cs : add CS0652 check for constant and integral
1880           expression. Fixed bug #53974.
1881
1882 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1883
1884         * expression.cs : in DoNumericPromotions(), check if there is implicit
1885           conversion overload for string (to check CS0034). Fixed bug #52492.
1886
1887 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1888
1889         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
1890
1891 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1892
1893         * ecore.cs : report location when it is *not* Null.
1894
1895 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1896
1897         * codegen.cs,
1898           ecore.cs,
1899           flowanalysis.cs,
1900           expression.cs:
1901           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
1902           correctly. Fixed bug #75721.
1903
1904 2005-08-23  Raja R Harinath  <rharinath@novell.com>
1905
1906         * support.cs (SeekableStreamReader.Position): Avoid an expensive
1907         loop that performs 'min (pos, char_count)'.
1908
1909         Fix #75862.
1910         * expression.cs (Unary.ResolveOperator): Don't discard implicit
1911         converted value in Operator.OnesComplement.
1912
1913 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
1914
1915         * anonymous.cs: If the anon method is pulled into a helper class,
1916         it needs to be `internal' not `private'. Fixes runtime behavior on
1917         msft. bug #75704
1918
1919 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
1920
1921         Fix #75803
1922         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
1923         is a partial class.
1924
1925 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
1926
1927         The big constants rewrite
1928         Fix #75746, #75685 and more
1929         As a side effect saved 1MB for MWF ;-)
1930         
1931         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
1932         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
1933         enum based for corlib compilation.
1934         
1935         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
1936         subtractions.
1937         
1938         * class.cs (FixedField.Define): Use ResolveAsConstant.
1939         
1940         * const.cs (IConstant): Interface constants and enums.
1941         (Const.ResolveValue): New method for constant resolvning.
1942         (ExternalConstant): Constants from imported assemblies.
1943         
1944         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
1945         conversion; like enums.
1946         (Constant.ToType): Converts this constant to different type.
1947         (Constant.Increment): Adds 1.
1948         
1949         * convert.cs (ImplicitConversionRequired): Simplified.
1950         
1951         * cs-parser.jay: Create EnumMember directly.
1952         
1953         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
1954         
1955         * doc.cs (GenerateEnumDocComment): Removed.
1956         
1957         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
1958         (ConvertIntLiteral): Removed.
1959         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
1960         
1961         * enum.cs (EnumMember): Implement IConstant.
1962         (Enum.IsValidEnumConstant): Removed.
1963         (Enum.GetNextDefaultValue): Removed.
1964         (Enum.FindMembers): Updated.
1965         (Enum.GenerateDocComment): Iterate enum members.
1966         
1967         * expression.cs (Cast.TryReduce): Handle enums correctly.
1968         (New.Constantify): Made public.
1969         (MemberAccess.DoResolve): Removed contant specific if(s).
1970         
1971         * literal.cs (NullLiteral): Implement new abstract methods.
1972         
1973         * statement.cs (GotoCase.Resolve): Use new constant methods.
1974         (SwitchLabel.ResolveAndReduce): Use new constant methods.
1975         
1976         * typemanager.cs (LookupEnum): Removed.
1977         (IsEnumType): Fixed to work with corlib.
1978         (RegisterConstant): Removed.
1979         (LookupConstant): Removed.
1980         (GetConstant): Changed to work with IConstant.
1981
1982 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
1983
1984         * location.cs : Fixed overflown (>255) column number.
1985
1986 2005-08-03  Raja R Harinath  <rharinath@novell.com>
1987
1988         First cut of the qualified-alias-member feature.
1989         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
1990         token.
1991         * cs-parser.jay (DOUBLE_COLON): New token.
1992         (namespace_or_type_name): Add rule for recognizing
1993         qualified-alias-members.
1994         (primary_expression): Likewise.
1995         (element_access): Allow QualifiedAliasMember as a possible
1996         type-bearing expression.
1997         (local_variable_type, local_variable_pointer_type): Likewise.
1998         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
1999         aliases in the current and enclosing namespace declarations.
2000         (NamespaceEntry.UsingAlias): Add CS0440 warning.
2001         * decl.cs (MemberName.is_double_colon): New.
2002         (MemberName.MemberName): Add new constructor for alias-member.
2003         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
2004         * expression.cs (QualifiedAliasMember): New expression type.
2005
2006 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2007
2008         * location.cs : it borked when no argument was specified.
2009
2010 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2011
2012         * location.cs : tiny ToString() format fix.
2013
2014 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2015
2016         * statement.cs : oops, it was missing.
2017
2018 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2019
2020         A set of fixes for precise line/column location.
2021
2022         * location.cs :
2023           "token" field now holds a file/line "delta", a line number offset 
2024           from the segment, and a column number. See also:
2025           http://lists.ximian.com/pipermail/mono-devel-list/2004-
2026           December/009508.html
2027           Removed static IsNull. Use instance IsNull property instead.
2028         * cs-tokenizer.cs :
2029           For some tokens it stores Location. For Identifier it stores
2030           LocatedToken which is a pair of string name and location.
2031           Column numbers are adjusted only at getChar().
2032         * report.cs :
2033           Use Location.ToString() for reporting (it now contains column).
2034         * cs-parser.jay :
2035           Largely modified to use LocatedToken instead of
2036           string (IDENTIFIER), and to acquire Location from some tokens.
2037         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2038           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2039           codegen.cs :
2040           Now MemberName holds Location. DeclSpace.ctor() receives Location
2041           as a parameter. Removed extra parameters to all derived classes.
2042           Replaced Location.IsNull() with instance property.
2043         * assign.cs, expression.cs :
2044           Added .ctor() overload that omits Location.
2045         * attribute.cs :
2046           Added "nameEscaped" flag that indicates the identifier was escaped
2047           in the source file. This fixes bug #57047.
2048
2049 2005-09-02  Martin Baulig  <martin@ximian.com>
2050
2051         * class.cs: Make CS3005 a warning, not an error.
2052
2053 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
2054
2055         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2056         New method, looking for lo-case imported cls type.
2057
2058         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2059         here.
2060
2061         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2062
2063         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2064
2065         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2066         all_imported_types.
2067         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2068
2069         Optimized to save 3.5 MB for SWF compilation.
2070
2071 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2072
2073         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
2074         (PartialContainer.Create): Moved logic AddToContainer.
2075         (PartialContainer.MarkForDuplicationCheck): Shares name.
2076         
2077         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
2078         place.
2079         
2080         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
2081         initialization.
2082         (Namespace.GetSignatureForError): New method.
2083         
2084         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
2085         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
2086
2087 2005-08-01  Raja R Harinath  <rharinath@novell.com>
2088
2089         Fix #75669.
2090         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
2091         member lookup rather than qualifier_type, since qualifier_type can
2092         be null.
2093
2094 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2095
2096         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
2097         enum member.
2098
2099 2005-07-31  Miguel de Icaza  <miguel@novell.com>
2100
2101         * statement.cs: Copy the local exception into the exception
2102         captured local.  Fixes 75674
2103
2104 2005-07-31  Raja R Harinath  <harinath@gmail.com>
2105
2106         Fix #75658.
2107         * expression.cs (Invocation.OverloadResolve): Don't report error
2108         CS1501 if error CS1502 has been reported.
2109         (New.DoResolve): Delegate CS1501 reporting to
2110         Invocation.OverloadResolve.
2111
2112         Fix #75656.
2113         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
2114         invariant-meaning-in-block property in an enclosing block if
2115         necessary.
2116
2117 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
2118
2119         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
2120         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
2121         (Switch.CheckSwitch): Just save 50kb for SWF.
2122
2123 2005-07-27  Martin Baulig  <martin@ximian.com>
2124
2125         * anonymous.cs (CaptureContext.AddField): Added
2126         `AnonymousContainer am' argument; compute its toplevel scope if
2127         it's not already computed.  Fixes #75649.
2128
2129 2005-07-26  Raja R Harinath  <rharinath@novell.com>
2130
2131         Fix #75628.
2132         * class.cs (Constructor.Emit): Reset block to null if the block
2133         resolve fails.
2134
2135 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
2136
2137         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
2138
2139 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
2140
2141         * class.cs (MethodData.Define): Check whether accessor implementing
2142         interface is public.
2143
2144         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
2145
2146 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
2147
2148         Fix #57245
2149         * namespace.cs (LookupType): Moved same type check to...
2150         
2151         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
2152         with the same name.
2153
2154 2005-07-21  Raja R Harinath  <rharinath@novell.com>
2155
2156         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
2157         already found a typebuilder.
2158         * class.cs (MethodCore.IsDuplicateImplementation): Compare
2159         MemberNames, not strings.
2160
2161         * const.cs (Error_ExpressionMustBeConst): 
2162         Rename from Error_EpressionMustBeConst.
2163         * const.cs, class.cs, statement.cd: Update.
2164
2165 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
2166
2167         Fix #65573
2168
2169         * const.cs (Const.LookupConstantValue): Report missing contant expression
2170         everytime.
2171         (Error_EpressionMustBeConstant): Only one error method.
2172
2173         * class.cs, statement.c: Updated.
2174
2175 2005-07-20  Raja R Harinath  <rharinath@novell.com>
2176
2177         * statement.cs (Block.Flags): Add back HasVarargs.
2178         (Block.flags): Make protected.
2179         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
2180
2181         * typemanager.cs (types, typecontainers, user_types): Remove.
2182         (UserTypes, TypeContainers): Likewise.
2183         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
2184         (CleanUp, Reset): Update.
2185         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
2186         (GetNestedType): Use Type.GetNestedType.
2187         (CoreLookupType): Take two arguments, the namespace and the
2188         basename of the type.  Update to use the Namespace.Lookup
2189         mechanism.
2190         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
2191         (RealMemberLookup): Use IsNestedChildOf instead of playing with
2192         string concatenation and substring matches.
2193         * class.cs, enum.cs, delegate.cs: Update to changes.
2194
2195 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
2196
2197         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
2198         Expression and made virtual.
2199
2200         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
2201         (ImplicitStandardConversionExists): Fixed `byte' typo ?
2202
2203         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
2204
2205         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
2206         error message.
2207
2208         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
2209         change.
2210
2211 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
2212
2213         Fix #57707
2214         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
2215         AssemblyCultureAttribute is not used on executable.
2216
2217         * rootcontext.cs,
2218         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
2219
2220 2005-07-16  Raja R Harinath  <rharinath@novell.com>
2221
2222         Fix #60638.
2223         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
2224         New.  Reports CS0252/CS0253.
2225         Mostly taken from preliminary patch by Duncak Mak.
2226         (Binary.DoResolveOperator): Store results of operator lookup.
2227         Use them to detect if we need to warn about unintended reference
2228         comparisons.
2229
2230 2005-07-15  Raja R Harinath  <rharinath@novell.com>
2231
2232         Fix #72969.
2233         * namespace.cs (Namespace.Lookup): Add back location parameter.
2234         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
2235         * delegate.cs, ecore.cs, expression.cs: Update to changes.
2236
2237         * codegen.cs (EmitContext.DeclSpace): Make readonly.
2238         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
2239         (Namespace.LookupType): ... this.
2240         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
2241         of namespaces.
2242         * typemanager.cs (LookupTypeReflection): Remove buggy code that
2243         purported to handle pointers.
2244         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
2245         CoreLookupType.
2246
2247 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
2248
2249         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2250         type as namespace.
2251
2252 2005-07-15  Raja R Harinath  <rharinath@novell.com>
2253
2254         * namespace.cs (Namespace.Lookup): Drop location parameter.
2255         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
2256         (NamespaceEntry.Lookup): ... this.
2257         (NamespaceEntry.Error_AmbiguousTypeReference):
2258         Move here from DeclSpace.
2259         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
2260         names ...
2261         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
2262         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
2263         Move to NamespaceEntry.
2264         * delegate.cs, expression.cs: Update to changes.
2265
2266 2005-08-31  Martin Baulig  <martin@ximian.com>
2267
2268         Committing a patch from Atsushi Enomoto for #75850.
2269
2270         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
2271         Prefer a generic enumerator over a non-generic one.
2272
2273 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
2274
2275         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2276         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2277
2278 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2279
2280         * driver.cs : reverting default encoding change as well as mcs.
2281
2282 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2283
2284         * driver.cs, support.cs : merged r48826.
2285           Marek Safer wrote:
2286           > could you integrate your mcs changes to gmcs otherwise
2287           > gmcs cannot compile some files.
2288
2289 2005-08-20  Martin Baulig  <martin@ximian.com>
2290
2291         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2292         scope if we don't already have it.
2293
2294         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2295         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2296         fixes #75867.
2297
2298 2005-07-31  Miguel de Icaza  <miguel@novell.com>
2299
2300         * statement.cs: Copy the local exception into the exception
2301         captured local.  Fixes 75674
2302
2303 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
2304
2305         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2306         type as namespace.
2307
2308 2005-08-12  Martin Baulig  <martin@ximian.com>
2309
2310         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
2311         for nested types here to avoid hitting the cache too early.
2312
2313 2005-08-09  Miguel de Icaza  <miguel@novell.com>
2314
2315         * enum.cs: On the new compiler CLS error 3005 is now a warning not
2316         an error. 
2317
2318 2005-08-03  Martin Baulig  <martin@ximian.com>
2319
2320         Make iterators in generic methods work; see gtest-191.cs.
2321
2322         * generic.cs
2323         (Constraints.Resolve): Protect against being called twice.
2324
2325         * class.cs
2326         (TypeContainer.GetClassBases): Make this `protected virtual'.
2327
2328         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
2329         (Iterator.GetClassBases): Override this and compute the base
2330         classes here.
2331         (Iterator.DefineNestedTypes): If we're a generic method, all our
2332         method type parameters become class type parameters on the proxy
2333         class.
2334
2335         * statement.cs
2336         (ToplevelBlock.Parameters): Make this a property, not a field.
2337         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
2338
2339 2005-08-03  Martin Baulig  <martin@ximian.com>
2340
2341         * typemanager.cs (TypeManager.IsSubclassOf): Use
2342         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
2343         (TypeManager.GetFullName_recursed): Improved.
2344
2345 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2346
2347         Fix #75417
2348         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
2349         Private accessor case, using TypeManager.IsPrivateAccessible instead of
2350         invocation_type == mi.DeclaringType, since the first one also checks
2351         other condition used by generic instances.
2352         
2353 2005-07-27  Martin Baulig  <martin@ximian.com>
2354
2355         * anonymous.cs (CaptureContext.AddField): Added
2356         `AnonymousContainer am' argument; compute its toplevel scope if
2357         it's not already computed.  Fixes #75649.
2358
2359 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
2360
2361         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
2362         CheckAttributeType and refactored.
2363         (Attribute.ResolvePossibleAttributeType): Changed to reuse
2364         ResolveAsTypeTerminal error handling.
2365         (ResolveAsTypeTerminal): Introduced because of global attributes extra
2366         handling.
2367         (GetSignatureForError): Print errors in same way.
2368
2369         * class.cs,
2370         * codegen.cs: Reflect attribute GetSignatureForError change.
2371
2372         * ecore.cs,
2373         * expression.cs: Add silent parameter to ResolveAsTypeStep.
2374
2375         * namespace.cs (UsingEntry): Refactored to make fields private.
2376
2377         * assign.cs,
2378         statement.cs: Error_UnexpectedKind has extra parameter.
2379
2380 2005-07-14  Raja R Harinath  <rharinath@novell.com>
2381
2382         * ecore.cs (IAlias): Remove.
2383         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
2384         that implement the interface.
2385         * namespace.cs (Namespace): Likewise.
2386         (Namespace.declspaces): Renamed from 'defined_names'.
2387         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
2388         DeclSpace instead of an IAlias.
2389         * tree.cs (Tree.AddDecl): Update.
2390
2391 2005-07-12  Raja R Harinath  <rharinath@novell.com>
2392
2393         * statement.cs (Block.Flags); Remove HasVarargs.
2394         (Block.HasVarargs): Move to ToplevelBlock.
2395         (Block.ThisVariable, Block.AddThisVariable): Likewise.
2396         (Block.Variables): Make protected.  Initialize variable hashtable
2397         if necessary.
2398         (Block.AddVariable): Update.
2399         (Block.Resolve): Update to changes.
2400         (ToplevelBlock.HasVarargs): New boolean.
2401         (ToplevelBlock.ThisVariable): Move here from Block.
2402         (ToplevelBlock.AddThisVariable): Likewise.
2403         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
2404         * expression.cs (This.ResolveBase): Update to changes.
2405         (ArglistAccess.DoResolve): Likewise.
2406
2407 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
2408
2409         Fix #75321
2410         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
2411
2412         * class.cs (TypeContainer.VerifyMembers): Distinguish between
2413         not used and not used & assigned.
2414         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
2415
2416 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
2417
2418         Fix #75053
2419         * expression.cs (Is.DoResolve): null is never provided type.
2420
2421 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
2422
2423         Fix #52496
2424         * cs-parser.jay: Less strict event error rule to catch more errors.
2425
2426 2005-07-11  Martin Baulig  <martin@ximian.com>
2427
2428         * generic.cs (ConstructedType.CheckConstraints): Improve the check
2429         for the constructor constraint: we do not only have to check
2430         whether the class has a public constructor, but also ensure that
2431         it's parameterless.  Fixes #75492.
2432
2433 2005-07-11  Martin Baulig  <martin@ximian.com>
2434
2435         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
2436         between type parameters if they either have the reference type
2437         constraint or the class constraint.
2438
2439 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
2440
2441         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
2442
2443 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
2444
2445         Fix #74975
2446         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
2447         (ExtractSecurityPermissionSet): Cope with self referencing security
2448         attributes properly.
2449
2450         * driver.cs (SetOutputFile): Made public property OutputFile.
2451
2452 2005-07-07  Raja R Harinath  <rharinath@novell.com>
2453
2454         Fix #75486.
2455         * class.cs (TypeContainer.first_nonstatic_field): Rename from
2456         has_nonstatic_fields.  Make into a FieldBase pointer.
2457         (TypeContainer.AddField): Add CS0282 check.
2458         (TypeContainer.EmitType): Update.
2459
2460 2005-07-06  Miguel de Icaza  <miguel@novell.com>
2461
2462         * cs-tokenizer.cs (consume_identifier): Do not create strings to
2463         compare if they start with __.
2464
2465 2005-07-06  Raja R Harinath  <rharinath@novell.com>
2466
2467         * statement.cs (Switch.SwitchGoverningType): Only look at
2468         UserCasts that don't need implicit standard conversions to one of
2469         the allowed switch types (Fixes test-322.cs).
2470         (LocalInfo.Resolve): Re-enable sanity-test.
2471
2472 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
2473
2474         * cs-tokenizer.cs (consume_identifier): Detect double undescores
2475         
2476         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
2477         
2478         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
2479
2480 2005-07-06  Raja R Harinath  <rharinath@novell.com>
2481
2482         Fix #75472.
2483         * ecore.cs (SimpleName.GetSignatureForError): Add.
2484         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
2485         (MemberAccess.GetSignatureForError): Add.
2486
2487 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
2488  
2489         The big error and warning messages review.
2490         
2491         * anonymous.cs,
2492         * assign.cs,
2493         * attribute.cs,
2494         * class.cs,
2495         * codegen.cs,
2496         * convert.cs,
2497         * cs-parser.jay,
2498         * cs-tokenizer.cs,
2499         * decl.cs,
2500         * delegate.cs,
2501         * doc.cs,
2502         * driver.cs,
2503         * ecore.cs,
2504         * enum.cs,
2505         * expression.cs,
2506         * flowanalysis.cs,
2507         * iterators.cs,
2508         * literal.cs,
2509         * location.cs,
2510         * modifiers.cs,
2511         * namespace.cs,
2512         * parameter.cs,
2513         * pending.cs,
2514         * report.cs,
2515         * rootcontext.cs,
2516         * statement.cs,
2517         * support.cs,
2518         * tree.cs,
2519         * typemanager.cs: Updated.
2520         
2521         * class.cs: (MethodCore.SetYields): Moved here to share.
2522         (PropertyMethod.Define): Moved iterator setup here.
2523         
2524         * iterators.cs: Add orig_method to have full access to parent
2525         container.
2526
2527 2005-07-05  Raja R Harinath  <rharinath@novell.com>
2528
2529         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
2530         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
2531         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
2532         variable of struct type.
2533         * expression.cs (Unary.ResolveOperator): Update to change.
2534         (Indirection.VerifyFixed): Likewise.
2535         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
2536         (ParameterReference.VerifyFixed): Value parameters are fixed.
2537         (This.VerifyFixed): Treat 'this' as a value parameter.
2538         * statement.cs (LocalInfo.IsFixed): Remove.
2539
2540 2005-07-01  Martin Baulig  <martin@ximian.com>
2541
2542         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
2543         `ec.EmitThis ()' to get the correct scope.
2544
2545 2005-07-01  Martin Baulig  <martin@ximian.com>
2546
2547         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
2548         instance is a ParameterReference; fixes #75299.
2549
2550 2005-06-30  Raja R Harinath  <rharinath@novell.com>
2551
2552         Fix #75412.
2553         * expression.cs (Indexers.map): Remove.
2554         (Indexers.Append): Filter out inaccessible setters and getters.
2555         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
2556
2557         Fix #75283.
2558         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
2559         Refactored from ...
2560         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
2561         (FieldExpr.Emit, PropertyExpr.Emit): Update.
2562         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
2563         * expression.cs (Invocation.EmitCall): Add CS0120 check.
2564
2565 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
2566
2567         Fix #75322
2568         * class.cs (FieldBase.GetInitializerExpression): One more field
2569         for backup.
2570
2571 2005-06-28  Miguel de Icaza  <miguel@novell.com>
2572
2573         * pending.cs: Do not define a proxy if the base method is virtual,
2574         it will be picked up by the runtime (bug 75270).
2575
2576 2005-07-08  Martin Baulig  <martin@ximian.com>
2577
2578         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
2579         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
2580
2581 2005-07-07  Martin Baulig  <martin@ximian.com>
2582
2583         * generic.cs (ConstructedType.CheckConstraint): Use
2584         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
2585         called recursively; fixes #75329.
2586
2587 2005-07-06  Martin Baulig  <martin@ximian.com>
2588
2589         * generic.cs (TypeManager.InferTypeArguments): Added support for
2590         anonymous methods; fixes #75461.
2591
2592 2005-07-01  Martin Baulig  <martin@ximian.com>
2593
2594         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
2595         `ec.EmitThis ()' to get the correct scope.
2596
2597 2005-07-01  Martin Baulig  <martin@ximian.com>
2598
2599         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
2600         instance is `This'; fixes #75299.
2601
2602 2005-06-30  Martin Baulig  <martin@ximian.com>
2603
2604         * class.cs (Indexer): Implement IIteratorContainer; added support
2605         for iterators in indexers.
2606
2607         * codegen.cs
2608         (EmitContext.CurrentIterator): Make this a property, not a field.
2609
2610         * anonymous.cs (AnonymousContainer.Iterator): New public property.
2611
2612 2005-06-28  Miguel de Icaza  <miguel@novell.com>
2613
2614         * pending.cs: Do not define a proxy if the base method is virtual,
2615         it will be picked up by the runtime (bug 75270).
2616
2617 2005-06-28  Martin Baulig  <martin@ximian.com>
2618
2619         * cs-parser.jay (interface_method_declaration): Avoid a
2620         reduce/reduce conflict by moving some of the code into a separate
2621         `interface_method_declaration_body' rule; fixes #75368.
2622
2623 2005-06-28  Martin Baulig  <martin@ximian.com>
2624
2625         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
2626         array check after the check for TypeBuilder's.
2627
2628 2005-06-21  Raja R Harinath  <rharinath@novell.com>
2629
2630         * convert.cs (FindMostEncompassedType): Add two trivial special
2631         cases (number_of_types == 0 || number_of_types == 1).
2632         (FindMostEncompasingType): Likewise.
2633
2634 2005-06-17  Raja R Harinath  <rharinath@novell.com>
2635
2636         Some cleanups preparing for the fix of #75283.
2637         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
2638         error testing.
2639         (EventExpr.InstanceResolve): Likewise.
2640         (EventExpr.DoResolve): Remove redundant checks.
2641
2642 2005-06-08  Miguel de Icaza  <miguel@novell.com>
2643
2644         * class.cs: Small fix.
2645
2646 2005-06-08  Raja R Harinath  <rharinath@novell.com>
2647
2648         Fix #75160.
2649         * class.cs (GetPartialBases): Fix return value check of
2650         part.GetClassBases.
2651
2652 2005-06-07  Raja R Harinath  <rharinath@novell.com>
2653
2654         Ensure that partial classes are registered in their enclosing
2655         namespace.  Initial part of fix of #75160.
2656         * tree.cs (Tree.RecordDecl): Add new namespace argument.
2657         Register declspace with namespace here, not in
2658         DeclSpace.RecordDecl.
2659         * cs-parser.jay: Pass namespace to RecordDecl.
2660         * class.cs (PartialContainer.Create): Likewise.
2661         (ClassPart.DefineType): New sanity-check.  Throws an exception if
2662         called.
2663         * decl.cs (Declspace.RecordDecl): Remove.
2664         * namespace.cs (NamespaceEntry.DefineName): Remove.
2665
2666 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
2667
2668         * rootcontext.cs: Reset TargetExt as well.
2669
2670 2005-06-03  Raja R Harinath  <rharinath@novell.com>
2671
2672         * ecore.cs (Expression.Resolve): Emit CS0654 error when
2673         -langversion:ISO-1.
2674
2675 2005-06-02  Raja R Harinath  <rharinath@novell.com>
2676
2677         Fix #75080, cs0119.cs.
2678         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
2679         of ...
2680         (Expression.Resolve): ... this.  Use it.  Remove bogus code
2681         allowing ExprClass.Type and ExprClass.Namespace for
2682         ResolveFlags.VariableOrValue.
2683         (Expression.Resolve) [1-argument variant]: Change default resolve
2684         flags based on language version.
2685         (Expression.Error_UnexpectedKind): Use a simple string array
2686         rather than an ArrayList.
2687         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
2688         not ExprClass.Type.
2689         (TypeOfVoid.DoResolve): Likewise.
2690         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
2691         flags argument -- it always has the same value.
2692
2693 2005-05-31  Raja R Harinath  <rharinath@novell.com>
2694
2695         Fix #75081.
2696         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
2697         Use it in the error message.
2698         * assign.cs, expression.cs, statement.cs: Update.
2699
2700 2005-05-30  Raja R Harinath  <rharinath@novell.com>
2701
2702         Fix #75088.
2703         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
2704         the "almostMatchedMember" case too.
2705         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
2706         that failed the accessibility checks to 'almost_match'.
2707
2708 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
2709
2710         * attribute.cs: Use internal MethodBuilder methods to set
2711         ExactSpelling and SetLastError on PInvoke methods, instead
2712         of passing them via charset.  Fixes #75060.
2713
2714 2005-05-27  Raja R Harinath  <rharinath@novell.com>
2715
2716         * parameter.cs (Parameter): Remove TODO comment.
2717         (Parameter.DefineParameter): Remove Location parameter.
2718         (Parameters.LabelParameters): Likewise.
2719         * class.cs (Constructor.Emit): Update to change.
2720         (MethodData.Emit): Likewise.
2721         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
2722         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
2723
2724 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
2725
2726         * parameter.cs,
2727           Removed Parameters.Location and added Parameter.Location instead.
2728           Removed Location parameter from Emit() and GetSignature().
2729         * anonymous.cs,
2730           class.cs,
2731           cs-parser.jay,
2732           delegate.cs,
2733           iterators.cs,
2734           statement.cs :
2735           Modified all related calls.
2736
2737 2005-06-21  Martin Baulig  <martin@ximian.com>
2738
2739         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
2740         left-hand side is not a nullable type; fixes #75328.
2741
2742 2005-06-21  Martin Baulig  <martin@ximian.com>
2743
2744         * typemanager.cs
2745         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
2746         (TypeManager.GetFullNameSignature): Likewise.
2747
2748         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
2749         `source.FullName' and `target.FullName' to check whether there are
2750         two conflicting definitions.
2751
2752 2005-06-21  Martin Baulig  <martin@ximian.com>
2753
2754         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
2755         a BoxedCast - also for reference types - to be compatible with csc.
2756
2757 2005-06-21  Martin Baulig  <martin@ximian.com>
2758
2759         * expression.cs (MemberAccess.DoResolve): Add support for nested
2760         types in a generic instance; fixes #75320.
2761
2762 2005-06-20  Martin Baulig  <martin@ximian.com>
2763
2764         * generic.cs (TypeManager.InferType): Also walk the class
2765         hierarchy for generic instances; fixes #75261.
2766
2767 2005-06-17  Martin Baulig  <martin@ximian.com>
2768
2769         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
2770         to make things work for corlib.
2771
2772 2005-06-15  Martin Baulig  <martin@ximian.com>
2773
2774         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
2775         obsolete `SecurityAction' values.
2776
2777 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
2778
2779         * rootcontext.cs: Reset TargetExt as well.
2780         
2781 2005-06-09  Martin Baulig  <martin@ximian.com>
2782
2783         * delegate.cs (Delegate.VerifyMethod): Added
2784         `MethodGroupExpr old_mg' argument; inherit its
2785         `HasTypeParameters'; fix #75085.
2786
2787 2005-06-09  Martin Baulig  <martin@ximian.com>
2788
2789         * expression.cs (Invocation.OverloadResolve): Correctly handle
2790         generic methods for the SetMemberIsUsed(); fix #75064.
2791
2792 2005-06-09  Martin Baulig  <martin@ximian.com>
2793
2794         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
2795         fixes #75062.
2796
2797 2005-06-08  Martin Baulig  <martin@ximian.com>
2798
2799         * cs-parser.jay (nullable_type_or_conditional): If we put the
2800         nullable back and our `type' is a `ComposedCast', remove the
2801         nullable from it.  Fixes #75156.
2802
2803         * expression.cs (ComposedCast.RemoveNullable): New public method.
2804
2805 2005-06-08  Martin Baulig  <martin@ximian.com>
2806
2807         The big Iterators rewrite :-)
2808
2809         * iterators.cs: Rewrite this to use the anonymous methods framework.
2810
2811         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
2812         before the TypeContainers; see 2test-21.cs.
2813
2814         * class.cs
2815         (TypeContainer.DefineType): Don't create a new EmitContext if we
2816         already have one (this only happens if we're an Iterator).
2817         (TypeContainer.Define): Also call Define() on all our iterators.
2818         (Method.CreateEmitContext): Added support for iterators.
2819
2820         * anonymous.cs
2821         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
2822         (AnonymousContainer.CreateMethodHost): Moved here from
2823         AnonymousMethod and made abstract.
2824         (AnonymousContainer.CreateScopeType): New abstract method.
2825         (AnonymousContainer.IsIterator): New public property.
2826         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
2827         get the ScopeTypeBuilder rather than manually defining it here. 
2828         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
2829         iterators here.
2830
2831         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
2832         before RootContext.DefineTypes().
2833
2834         * codegen.cs (EmitContext.RemapToProxy): Removed.
2835         (EmitContext.CurrentAnonymousMethod): Changed type from
2836         AnonymousMethod -> AnonymousContainer.
2837         (EmitContext.ResolveTopBlock): Protect from being called twice.
2838         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
2839         (EmitContext.EmitThis): Removed the iterators hacks; use the
2840         anonymous methods framework for that.
2841
2842         * statement.cs
2843         (ToplevelBlock.Container): Make this a property, not a field.
2844         (ToplevelBlock.ReParent): New public method; move the
2845         ToplevelBlock into a new container.
2846         (Foreach.TemporaryVariable): Simplify.
2847
2848 2005-06-05  Martin Baulig  <martin@ximian.com>
2849
2850         * statement.cs (LocalInfo.CompilerGenerated): New flag.
2851         (Block.AddTemporaryVariable): New public method; creates a new
2852         `LocalInfo' for a temporary variable.
2853         (Block.EmitMeta): Create the LocalBuilders for all the temporary
2854         variables here.
2855         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
2856         non-iterator variables.
2857
2858 2005-06-05  Martin Baulig  <martin@ximian.com>
2859
2860         * statement.cs (Foreach.TemporaryVariable): Create the
2861         LocalBuilder in the Emit phase and not in Resolve since in some
2862         situations, we don't have an ILGenerator during Resolve; see
2863         2test-19.cs for an example.
2864
2865 2005-06-04  Martin Baulig  <martin@ximian.com>
2866
2867         The big Foreach rewrite - Part II.
2868
2869         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
2870         with `PropertyInfo ienumerator_getcurrent'.
2871
2872         * codegen.cs (VariableStorage): Removed.
2873
2874         * statement.cs
2875         (Foreach): Derive from Statement, not ExceptionStatement.
2876         (Foreach.CollectionForeach): New nested class.  Moved all the code
2877         dealing with collection foreach here.
2878         (Foreach.ForeachHelperMethods): Removed.
2879         (Foreach.TemporaryVariable): Implement IMemoryLocation.
2880
2881 2005-05-23  Martin Baulig  <martin@ximian.com>
2882
2883         * statement.cs (Try.DoResolve): Don't create a `finally' if we
2884         don't need to.  Fix #75014.
2885
2886 2005-05-26  Raja R Harinath  <rharinath@novell.com>
2887
2888         Improve user-defined conversion handling.
2889         * convert.cs (GetConversionOperators): Rewrite.  Return only the
2890         applicable operators.
2891         (AddConversionOperators): New.  Helper for GetConversionOperators.
2892         (FindMostEncompassedType, FindMostEncompassingType): Verify that
2893         there is only one most encompassed/encompassing type.
2894         (FindMostSpecificSource, FindMostSpecificTarget): Remove
2895         "applicable operator" handling.
2896         (UserConversion): Move cache here from GetConversionOperators.
2897         Directly cache the chosen operator, rather than the whole
2898         MethodGroup.
2899         (ExplicitNumericConversion): Fix buggy implementation of Decimal
2900         case.  Allow conversion of decimal to sbyte and byte too.
2901         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
2902         New static methods.  Used to avoid allocating EmptyExpressions in
2903         convert.cs.
2904
2905 2005-05-24  Duncan Mak  <duncan@novell.com>
2906
2907         * ecore.cs (CastFromDecimal): New class for casting a decimal to
2908         another class, used in Convert.ExplicitNumericConversion.
2909         (CastToDecimal): New class, similar to above, but casts to
2910         System.Decimal, used in Convert.ImplicitNumericConversion and also
2911         in explicit convesion from double/float to decimal.
2912
2913         * convert.cs (ImplicitNumericConversion): Handle implicit
2914         conversions to System.Decimal.
2915         (ExplicitNumericConversion): handle explicit conversions to
2916         System.Decimal.
2917
2918         This fixes #68711.
2919         
2920 2005-05-20  Miguel de Icaza  <miguel@novell.com>
2921
2922         * typemanager.cs: Do not throw an exception in the TypeBuilder
2923         case, we take care of it on the TypeCode.
2924
2925 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
2926         
2927         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
2928         is back.
2929         
2930         * cs-parser.jay: Catch more lexical errors.
2931         
2932         * report.cs: Add one more Error method.
2933         
2934         * rootcontext.cs,
2935         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
2936
2937 2005-05-20  Martin Baulig  <martin@ximian.com>
2938
2939         * class.cs (TypeContainer.CircularDepException): Removed.
2940         (TypeContainer.DefineType): Removed the `InTransit' stuff.
2941         (TypeContainer.CheckRecursiveDefinition): Check for circular class
2942         (CS0146) and interface (CS0529) dependencies here.
2943
2944 2005-05-20  Martin Baulig  <martin@ximian.com>
2945
2946         * expression.cs (New.DoResolve): Move the CS0712 check above the
2947         CS0144 check; otherwise it can never be reached.
2948
2949 2005-05-20  Martin Baulig  <martin@ximian.com>
2950
2951         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
2952
2953 2005-05-20  Martin Baulig  <martin@ximian.com>
2954
2955         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
2956
2957         * typemanager.cs (TypeManager.IsAttributeType): New public method.
2958
2959 2005-05-19  Martin Baulig  <martin@ximian.com>
2960
2961         * delegate.cs
2962         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
2963         to disable error reporting.
2964
2965         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
2966         here since we don't want to report an error; see the new test-336.cs.
2967
2968 2005-05-19  Raja R Harinath  <rharinath@novell.com>
2969
2970         * statement.cs (ToplevelBlock.GetParameterReference)
2971         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
2972         Move here from class Block.
2973         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
2974         * expression.cs (ParameterReference.DoResolveBase): Likewise.
2975
2976 2005-05-18  Martin Baulig  <martin@ximian.com>
2977
2978         Fix #74978.
2979
2980         * flowanalysis.cs
2981         (FlowBranching.Reachability): Add non-static public And() and Or()
2982         methods.
2983         (FlowBranchingSwitch): New class; do the `break_origins' thing
2984         like in FlowBranchingLoop.
2985         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
2986         reachability, not just locals and parameters.
2987         (FlowBranching.MergeChild): Remove some of the hacks for loop and
2988         switch; MergeBreakOrigins() now takes care of that.
2989
2990 2005-05-18  Martin Baulig  <martin@ximian.com>
2991
2992         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2993         a loop and may leave it, reset the barrier; fixes #74974.
2994
2995 2005-05-16  Raja R Harinath  <rharinath@novell.com>
2996
2997         Fix test-382.cs.  Emit values of decimal constants.
2998         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
2999         Carved out of ...
3000         (TypeContainer.AddField): ... this.
3001         (TypeContainer.EmitFieldInitializers): Allow the list of fields
3002         with initializers to include 'Const's.
3003         (ClassPart.RegisterFieldForInitialization): Forward to
3004         PartialContainer.
3005         * const.cs (Const.Const): Pass initializer to base class.
3006         (Const.Define): In case of decimal constants, register them for
3007         initialization in a static constructor.
3008
3009 2005-05-14  Martin Baulig  <martin@ximian.com>
3010
3011         * statement.cs (Block.Resolve): Correctly handle unreachable code;
3012         do not call ResolveUnreachable() on unreachable statements in
3013         here, see the comment in the source code.
3014
3015 2005-05-13  Raja R Harinath  <rharinath@novell.com>
3016
3017         Fix #74934.
3018         * expression.cs (BinaryResolveOperator): If one of the operands of
3019         an equality comparison is 'null' and the other is a pointer type,
3020         convert the null to a NullPointer.
3021         * convert.cs (ImplicitReferenceConversion): If the expression is a
3022         NullLiteral and the target type is a pointer type, return a
3023         NullPointer instead.
3024         (ImplicitConversionStandard): Likewise.
3025
3026 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
3027         
3028         * cs-parser.jay: Set readonly context based on special constructs.
3029         
3030         * expression.cs (LocalVariableReference.DoResolveBase): Improved
3031         readonly variable error handling.
3032         
3033         * rootcontext.cs (EmitCode): Don't verify members when error
3034         occurred.
3035         
3036         * statement.cs (LocalInfo): Add reaodnly context information.
3037         (SetReadOnlyContext, GetReadOnlyContext): New methods.
3038
3039 2005-05-17  Martin Baulig  <martin@ximian.com>
3040
3041         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3042         #70970. 
3043
3044 2005-05-13  Martin Baulig  <martin@ximian.com>
3045
3046         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
3047         handle unreachable blocks.
3048
3049 2005-05-13  Martin Baulig  <martin@ximian.com>
3050
3051         * class.cs
3052         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
3053         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
3054         #74905. 
3055
3056 2005-05-13  Martin Baulig  <martin@ximian.com>
3057
3058         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3059         instance variable, not a local.  Fix #74873.
3060         (Block.ResolveUnreachable): Set it to true here.
3061
3062 2005-05-12  Martin Baulig  <martin@ximian.com>
3063
3064         * cs-parser.jay (property_declaration): Pass the `current_class',
3065         not the `current_container' to Property's .ctor.  Fixes #74912.
3066
3067 2005-05-11  Martin Baulig  <martin@ximian.com>
3068
3069         * typemanager.cs (Closure): Copy this from MCS and merge all the
3070         GMCS-specific changes into it.
3071
3072 2005-05-12  Raja R Harinath  <harinath@gmail.com>
3073
3074         Fix #74920.
3075         * typemanager.cs (unmanaged_enclosing_types): New.
3076         (IsUnmanagedType): Avoid infloops by using
3077         'unmanaged_enclosing_types' to talk with recursive invocations.
3078
3079 2005-05-11  Duncan Mak  <duncan@novell.com>
3080
3081         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3082         continuing to process for 'arg'.
3083         (handle_preprocessing_directive): Check the argument of the #endif
3084         directive and report error CS1025 if there are any trailing
3085         characters.
3086
3087         According to the C# spec, having even whitespace after the #endif
3088         directive is illegal; however, because we call arg.TrimEnd ()
3089         beforehand, we have the same behavior as csc, allowing whitespace
3090         after the directive.
3091
3092         Fixes #74892.
3093
3094 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
3095
3096         Fix #74863.
3097         
3098         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3099         (Constructor.GetObsoleteAttribute): Implemented correctly.
3100
3101 2005-05-10  Martin Baulig  <martin@ximian.com>
3102
3103         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
3104         resolve the type; fixes #74864.
3105         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
3106         in DoResolve(); fixes #74862.
3107
3108 2005-05-10  Martin Baulig  <martin@ximian.com>
3109
3110         * support.cs (ReflectionParameters.ParameterModifier): Use
3111         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3112         and `ParameterAttributes.In'.  Fixes #74884.
3113
3114 2005-05-10  Martin Baulig  <martin@ximian.com>
3115
3116         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
3117         the cache if we're just looking for `MemberTypes.NestedType' in a
3118         generic instance.
3119
3120         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3121         constraints if we're still resolving the type tree.
3122         (Expression.MemberLookup): If we're resolving the type tree, only
3123         look for `MemberTypes.NestedType' since we're only interested in
3124         getting types.
3125
3126         * class.cs (TypeContainer.DefineType): Don't resolve the type
3127         parameters here; do this later in ResolveType() after the type
3128         tree has been resolved.
3129         (TypeContainer.ResolveType): New public method; this is called
3130         after the type tree is resolved and before the types are being
3131         populated.  We resolve the generic constraints here.
3132         (TypeContainer.DoDefineMember): Check the constraints on our base
3133         class and interfaces.
3134
3135         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
3136         set the `ResolvingTypeTree' flag on the EmitContext.
3137
3138         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
3139
3140 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
3141
3142         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3143         
3144         * expression.cs (Argument.GetParameterModifier): Turned to property.
3145         (Invocation.Error_InvalidArguments): Add more descriptive errors.
3146         
3147         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3148         its C# equivalent.
3149         
3150 2005-05-09  Raja R Harinath  <rharinath@novell.com>
3151
3152         Fix #74852.
3153         * decl.cs (MemberCache.AddMethods): Register override methods,
3154         rather than non-override methods.
3155         * typemanager.cs (RegisterOverride): New.
3156         (IsOverride): Update.
3157
3158 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3159
3160         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
3161
3162 2005-05-06  Martin Baulig  <martin@ximian.com>
3163
3164         * attribute.cs
3165         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
3166         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
3167
3168 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3169
3170         Fix #73105.
3171         
3172         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3173         recursive declaration.
3174         
3175         * statement.cs (Block.ResolveMeta): Report any error in resolving.
3176         
3177 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
3178
3179         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
3180         
3181         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
3182
3183 2005-05-05  Raja R Harinath  <rharinath@novell.com>
3184
3185         Fix #74797.
3186         * decl.cs (DeclSpace.FamilyAccessible): 
3187         Use TypeManager.IsNestedFamilyAccessible.
3188
3189         Fix reopened #64812.
3190         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
3191         internal'.
3192
3193 2005-05-04  Raja R Harinath  <rharinath@novell.com>
3194             Abin Thomas  <projectmonokochi@rediffmail.com>
3195             Anoob V E  <projectmonokochi@rediffmail.com>
3196             Harilal P R  <projectmonokochi@rediffmail.com>
3197
3198         Fix #64812.
3199         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
3200         allow access to all static members.
3201
3202 2005-05-04  Martin Baulig  <martin@ximian.com>
3203
3204         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
3205
3206 2005-05-04  Martin Baulig  <martin@ximian.com>
3207
3208         Fix #74655.
3209
3210         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
3211         section at the end; make things work if `default' is not the last
3212         section.        
3213
3214 2005-05-04  Martin Baulig  <martin@ximian.com>
3215
3216         Fix #70400.
3217
3218         * statement.cs (Switch): Replaced the `got_default' field with a
3219         `default_section' one.
3220         (Switch.CheckSwitch): Set `default_section' here.
3221         (Switch.Resolve): If we're a constant switch and the constant is
3222         not found, use the default section.
3223
3224 2005-05-03  Martin Baulig  <martin@ximian.com>
3225
3226         * expression.cs (ArrayAccess.EmitGetLength): New public method.
3227
3228         * statement.cs (Foreach.ArrayForeach): New nested class.
3229         (Foreach.TemporaryVariable): New nested class.
3230         (Foreach.EmitArrayForeach): Removed; this is now in the new
3231         ArrayForeach class.
3232
3233 2005-05-03  Raja R Harinath  <rharinath@novell.com>
3234
3235         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
3236         more conservative.
3237         (VerifyPendingMethods): Revert change below.
3238
3239         * typemanager.cs (IsOverride, RegisterNonOverride): New.
3240         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
3241         that used to trigger warning -28.  Remove warning -28.
3242         * expression.cs (Invocation.OverloadResolve): Use
3243         TypeManager.IsOverride to distinguish override methods.
3244
3245         Fix #74773.
3246         * pending.cs (VerifyPendingMethods): If a base type implements the
3247         requested interface, don't bother checking individual methods of
3248         the base type.  As a side-effect, this prevents the creation of
3249         unnecessary proxies.
3250
3251 2005-05-02  Martin Baulig  <martin@ximian.com>
3252
3253         Fix #70182.
3254
3255         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3256         Also `And' the locals if the old vector is null.
3257         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
3258         null; in this case we basically reset all the variables.        
3259
3260 2005-05-02  Martin Baulig  <martin@ximian.com>
3261
3262         Fix #74529.
3263
3264         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
3265         Added `FlowBranching branching' argument; always `and' the
3266         variables instead of `or'ing them unless we're an infinite loop.
3267
3268         * statement.cs (While.Resolve): Create a new sibling unless we're
3269         infinite.       
3270
3271 2005-05-02  Martin Baulig  <martin@ximian.com>
3272
3273         Fix #70140.
3274
3275         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
3276         arguments; use it instead of creating a new TopLevelBlock.
3277         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
3278         our ConstructorInitializer.
3279
3280         * statement.cs
3281         (TopLevelBlock.TopLevelBranching): New public property.
3282         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
3283         and create our `TopLevelBranching'.
3284
3285         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
3286         anonymous method host, use `block.TopLevelBranching' rather than
3287         creating a new branching.
3288
3289 2005-04-20  Miguel de Icaza  <miguel@novell.com>
3290
3291         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
3292         a ScopeInfo, if any of the current children is a child of the new
3293         entry, move those children there.
3294
3295 2005-04-30  Martin Baulig  <martin@ximian.com>
3296
3297         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
3298         at the beginning of a SwitchSection.  Fix #73335.
3299
3300 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
3301
3302         Fix #74378
3303         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
3304         
3305         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
3306         (FieldExpr.DoResolve): Obsolete members are ignored for field
3307         initializers.
3308         
3309 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
3310
3311         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
3312         of arrays detection.
3313
3314         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
3315         verification.
3316         (Field.VerifyClsCompliance): Volatile fields are not compliant.
3317
3318         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
3319         arrays report.
3320
3321 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
3322
3323         * cs-parser.jay: Use the prefered version of -unsafe in error
3324         message.
3325
3326 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
3327
3328         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
3329         circumstances.
3330
3331 2005-04-20  John Luke  <john.luke@gmail.com>
3332
3333         * driver.cs: fix typo in error message, --outout to --output
3334
3335 2005-04-30  Martin Baulig  <martin@ximian.com>
3336
3337         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
3338         handle the .NET 2.x security attributes.
3339
3340 2005-04-30  Martin Baulig  <martin@ximian.com>
3341
3342         * typemanager.cs
3343         (TypeManager.ExpandInterfaces): Don't add things twice.
3344
3345         * class.cs
3346         (TypeContainer.VerifyClsCompliance): Allow generic instances.
3347
3348 2005-04-29  Martin Baulig  <martin@ximian.com>
3349
3350         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
3351
3352         * anonymous.cs: Added support for anonymous generic methods.
3353
3354 2005-04-29  Martin Baulig  <martin@ximian.com>
3355
3356         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
3357         generic instances.
3358
3359 2005-04-29  Martin Baulig  <martin@ximian.com>
3360
3361         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
3362
3363         * expression.cs (New.DoResolve): Fix the CS0304 check.
3364
3365 2005-04-29  Martin Baulig  <martin@ximian.com>
3366
3367         * typemanager.cs (TypeManager.GetFullName): Updated to the new
3368         naming schema.
3369
3370         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
3371         explicit interface implementation, compare the interface types.
3372         (MethodData.Define): Use the new naming scheme from the latest
3373         .NET 2.x beta2.
3374         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
3375
3376         * decl.cs (MemberName.GetMemberName): Removed.
3377         (MemberName.MethodName, FullName): New properties.
3378
3379 2005-04-25  Raja R Harinath  <rharinath@novell.com>
3380
3381         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
3382
3383 2005-04-22  Martin Baulig  <martin@ximian.com>
3384
3385         * generic.cs (GenericMethod): Create the EmitContext in the
3386         `Define()'; in `Define(MethodBuilder)', create the type parameters
3387         before calling `Define()'.  Fixes #73933.
3388
3389 2005-04-22  Martin Baulig  <martin@ximian.com>
3390
3391         * generic.cs
3392         (Constraints.Resolve): Make things work wrt. the new type lookup system.
3393         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
3394
3395         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
3396         ConstructedType, check its constraints.
3397
3398 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
3399
3400         * codegen.cs (InRefOutArgumentResolving): New field.
3401         
3402         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
3403         fields outside contructor.
3404         
3405         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
3406         
3407 2005-04-19  Miguel de Icaza  <miguel@novell.com>
3408
3409         * anonymous.cs (CaptureContext.EmitParameterInstance): The
3410         parameter code was not completed ever, so it was not as up-to-date
3411         as local variables.  Must finish it.
3412
3413         The bug fix was to compare the Toplevel of the block, not the
3414         current block.  Thanks for Ben for pointing this out. 
3415
3416 2005-04-19  Raja R Harinath  <rharinath@novell.com>
3417
3418         * decl.cs (AddMethods): Use the declaring type of the problem
3419         method to determine if we want to squash a warning.
3420
3421 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
3422
3423         * attribute.cs: Removed debug output.
3424
3425         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
3426         
3427         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
3428         Report.Stderr.
3429         
3430 2005-04-18  Raja R Harinath  <rharinath@novell.com>
3431
3432         Fix #74481.
3433         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
3434         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
3435         all null comparisons against reference types.
3436
3437 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
3438
3439         Fix# 74565
3440         * class.cs (TypeContainer.CircularDepException) New nested
3441         exception class.
3442         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
3443         (TypeContainer.DefineType): Removed error, reset InTransit before
3444         exit.
3445         (Class.DefineType): Throw exception when is in Transit.
3446         Catch exception and report error.
3447         (Struct.DefineType): Throw exception when is in Transit.
3448         Catch exception and report error.
3449         (Interface.DefineType): Throw exception when is in Transit.
3450         Catch exception and report error.
3451
3452         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
3453         handle nested exception handlers.
3454
3455         * flowanalysis.cs (InTryWithCatch): New method, search for try with
3456         a catch.
3457
3458         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
3459         InFinally and InCatch storage.
3460
3461         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
3462         (Catch.Resolve): Set and Restore ec.InCatch.
3463         (Try.Resolve): Set and Restore ec.InFinally.
3464         (Try.HasCatch): True when try has catch.
3465
3466 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
3467
3468         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
3469           for the same event member, so exclude such cases from warning 419.
3470           Fixed bug #74633.
3471
3472 2005-04-16  Miguel de Icaza  <miguel@novell.com>
3473
3474         * expression.cs (Binary.ResolveOperator): Apply patch from John
3475         Luke to fix bug 59864: operators &, | and ^ on enumerations
3476         require that the same enum type on both sides.
3477
3478         * driver.cs: Add warnings to old flag usage, this is to assist
3479         people who produce Makefiles and hope that the Makefiles will be
3480         used on Windows.
3481
3482         * class.cs (TypeContainer.EmitType): Moved the definition of the
3483         special $PRIVATE$ field from the resolve phase to the Emit phase.
3484         During resolve we do not know if we are a struct with
3485         HasExplicitLayout, we know this only after the attributes for the
3486         type are emitted.
3487
3488         Set the FieldOffset to zero on the dummy field that we create for
3489         the class.   Fixes 74590.
3490
3491 2005-04-16  Raja R Harinath  <rharinath@novell.com>
3492
3493         Fix #73834.
3494         * ecore.cs (PropertyExpr.resolved): New.
3495         (DoResolve): Use it to handle a case of double resolution here.
3496         Handle a case of identical-name-and-type-name.
3497         * expression.cs (ArrayCreation.CheckIndices): Avoid double
3498         resolution by storing the results of expression resolution back
3499         into the "probes" array.
3500
3501 2005-04-15  Raja R Harinath  <rharinath@novell.com>
3502
3503         Fix cs0208-7.cs and cs0208-8.cs.
3504         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
3505         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
3506         error reporting to point out the reason a struct is not unmanaged.
3507
3508 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
3509
3510         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
3511           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
3512
3513 2005-04-13  Raja R Harinath  <rharinath@novell.com>
3514
3515         Fix #74528.
3516         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
3517         IdenticalNameAndTypeName here.
3518         (EventExpr.InstanceResolve): Likewise.
3519
3520 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
3521
3522         C# 2.0 DefaultCharSetAttribute implementation
3523         
3524         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
3525         which allows us to set GlobalNamespace for every resolve.
3526         (Attribute.ResolveArguments): Cut from Resolve.
3527         (Attribute.GetCharSetValue): Returns CharSet named argument.
3528         (Attribute.DefinePInvokeMethod): Gets default charset from
3529         module settings.
3530         (GlobalAttribute.ResolveAsTypeStep): Override.
3531         (GlobalAttribute.ResolveArguments): Override.
3532         
3533         * class.cs (TypeAttr): Is protected.
3534         
3535         * codegen.cs (ModuleClass.DefaultCharSet): New member.
3536         (ModuleClass.DefaultCharSetType): New memeber.
3537         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
3538         
3539         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
3540         charset from module.
3541         
3542         * delegate.cs (TypeAttr): Override.
3543         (Delegate.DefineType): Use this TypeAttr.
3544         
3545         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
3546         at very early stage (before types are defined) to resolve model
3547         module attributes. It will probably not work with corlib but it
3548         should be ok.
3549         
3550         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
3551         charset from module.
3552         
3553         * typemanager.cs (default_charset_type): New type.
3554
3555 2005-04-13  Raja R Harinath  <rharinath@novell.com>
3556
3557         * decl.cs (MemberCache.AddMethods): Don't warn if
3558         System.Object.Finalize has buggy MethodAttributes.
3559
3560         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
3561         removed below.
3562
3563 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
3564
3565         * doc.cs : detect ambiguous reference to overloaded members.
3566           Fixed bug #71603. MS 1.1 csc does not detect it.
3567
3568 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
3569
3570         * doc.cs : delegates must not be referenced with parameters.
3571           Fixed bug #71605.
3572
3573 2005-04-12  Miguel de Icaza  <miguel@novell.com>
3574
3575         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
3576
3577 2005-04-10  Miguel de Icaza  <miguel@novell.com>
3578
3579         * driver.cs (MainDriver): Stop processing if the CLS stage found
3580         errors. 
3581
3582         (CompilerCallableEntryPoint.InvokeCompiler): Always
3583         reset after execution;   Take a TextWriter argument for the
3584         output.
3585
3586         * report.cs: Use the error stream instead of hardcoding stderr. 
3587
3588 2005-04-09  Miguel de Icaza  <miguel@novell.com>
3589
3590         * class.cs: Reduce code paths to test, too small of an
3591         optimization to make it worth the extra testing.  Always perform
3592         it. 
3593
3594 2005-04-08  Raja R Harinath  <rharinath@novell.com>
3595
3596         Fix #74510.
3597         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
3598         operators that had errors reported on them.
3599
3600 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
3601
3602         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
3603         argument types.
3604         (Attribute.Resolve): Add named argument type checking.
3605         
3606         * class.cs (FixedField.Define): Use IsPrimitiveType
3607         
3608         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
3609         
3610         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
3611         unsafe parameter types.
3612         
3613         * statement.cs (Using.ResolveExpression): Add better error description.
3614         
3615         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
3616         
3617 2005-04-08  Raja R Harinath  <rharinath@novell.com>
3618
3619         Fix #74484.
3620         * attribute.cs (Attribute.GetAttributeUsage): Resolve
3621         AttributeUsageAttribute in the emitcontext of the attribute class,
3622         not in the emitcontext of the attributable entity it was attached to.
3623         * cs-parser.jay: Use 'current_class', not 'current_container',
3624         when creating a GlobalAttribute.
3625
3626 2005-04-08  Alp Toker  <alp@atoker.com>
3627
3628         * pending.cs: The fix to #58413 failed to compile methods implementing
3629         interfaces with/without params modifiers and vice versa, even though
3630         params modifiers aren't part of the signature. Make the modifier check
3631         less strict as in csc.
3632
3633 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
3634             Anoob V E  <projectmonokochi@rediffmail.com>
3635             Harilal P R  <projectmonokochi@rediffmail.com>
3636
3637         Fix #58413.
3638         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
3639         modifiers of pending methods.
3640         (PendingImplementation.PendingImplementation): Initialize it.
3641         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
3642         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
3643         with ParameterData.  Add check for modifiers.
3644         * class.cs (MethodData.Define): Update to changes.
3645
3646 2005-04-07  Raja R Harinath  <rharinath@novell.com>
3647
3648         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
3649
3650 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
3651
3652         * class.cs (PropertyMethod.Define): Check private accessor in abstract
3653         property.
3654         
3655         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
3656         
3657         * rootcontext.cs,
3658         * typemanager.cs: Registered RequiredAttributeAttribute.
3659         
3660 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
3661
3662         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
3663         Warning CS0169 is back at level 3.
3664         (IMethodData.SetMemberIsUsed): New method.
3665         
3666         * decl.cs (IsUsed): New value; moved from FieldBase.Status
3667         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
3668         
3669         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
3670
3671         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
3672         contants.
3673         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
3674         is used.
3675         
3676         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
3677         is used.
3678         
3679         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
3680         to avoid the problems with nested types.
3681
3682 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
3683             Anoob V.E  <projectmonokochi@rediffmail.com>
3684             Harilal P.R  <projectmonokochi@rediffmail.com>
3685             Raja R Harinath  <rharinath@novell.com>
3686
3687         Fix #73820.
3688         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
3689         attribute.
3690         * typemanager (GetConstructor): Make public.
3691
3692 2005-04-05  John Luke  <john.luke@gmail.com>
3693             Raja R Harinath  <rharinath@novell.com>
3694
3695         Fix #62232.
3696         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
3697         struct too.  Return false quicker in a few cases.
3698         (VerifyUnManaged): Use it.
3699
3700 2005-04-05  Raja R Harinath  <rharinath@novell.com>
3701
3702         Fix #74041.
3703         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
3704         not 'unreachable_seen'.
3705
3706 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
3707
3708         * attribute.cs (Attribute.GetValue): Removed unused.
3709         
3710         * codegen.cs (CodeGen.TrimExt): Removed unused.
3711         
3712         * cs-parser.jay (output): Removed unused.
3713         
3714         * cs-tokenizer.cs (hex_digits): Removed unused.
3715         
3716         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
3717         
3718         * expression.cs (Indirection.LoadExprValue): Removed unused.
3719         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
3720         
3721         * iterators.cs (Iterator.param_types): Removed unused.
3722         
3723         * statement.cs (Goto.block): Removed unused.
3724         (ToplevelBlock.did): Removed unused.
3725         (Switch.ResolveConstantSwitch): Removed unused.
3726
3727 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
3728
3729         * rootcontext.cs: Allow mcs to bootstrap with the compilation
3730         resetting thingy.
3731
3732 2005-04-19  Martin Baulig  <martin@ximian.com>
3733
3734         Merged r42462 from MCS and made it work for GMCS.
3735
3736         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
3737
3738         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
3739
3740 2005-04-01  Raja R Harinath  <rharinath@novell.com>
3741
3742         Fix #74232 and cs0208-3.cs.
3743         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
3744         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
3745         unmanaged type.  Don't use FieldBuilders when 't' is a
3746         TypeBuilder.  Use ModFlags and MemberType fields.
3747         * class.cs (MemberBase.member_type): Rename from MemberType.
3748         (MemberBase.MemberType): New property.  Determines member_type on
3749         demand.
3750         (MemberBase.DoDefine): Don't initialize MemberType here.
3751         (FieldMember.Define): Likewise.
3752
3753 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
3754
3755         Fix #74241
3756         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
3757         Attributes are emitted there.
3758         
3759 2005-04-01  Raja R Harinath  <rharinath@novell.com>
3760
3761         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
3762         keyword in 'partial enum' too.
3763         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
3764         is not allowed).
3765         Report from Kamil Skalski <nazgul@omega.pl>.
3766
3767         Fix #74309.
3768         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
3769         have partial containers too.
3770
3771         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
3772         in block' checks to Block.CheckInvariantMeaningInBlock.
3773         * statement.cs (Block.GetKnownVariableInfo): Make private.
3774         (Block.IsVariableUsedInChildBlock): Remove.
3775         (Block.IsVariableUsedInBlock): Likewise.
3776         (Block.CheckInvariantMeaningInBlock): New.  Show location of
3777         conflicting declaration.
3778         (Block.AddVariable): Make error messages less long-winded and more
3779         specific.  Show location of conflicting declaration.
3780         * parameter.cs (Parameters.Location): New readonly property.
3781
3782 2005-03-31  Raja R Harinath  <rharinath@novell.com>
3783
3784         Clean up semantics of invoking ResolveMemberAccess.
3785         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
3786         can have an instance, ensure that we pass in a non-TypeExpression
3787         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
3788         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
3789         argument.  Update to changes and simplify.
3790         (FieldExpr.Emitinstance): Remove CS0120 check.
3791         (PropertyExpr.EmitInstance): Likewise.
3792         * expression.cs (Argument.Resolve): Likewise.
3793         (Invocation.DoResolve): Update to changes in semantics of
3794         InstanceExpression.
3795
3796 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
3797
3798         Fix #74241
3799         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
3800         customization.
3801         
3802         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
3803
3804 2005-03-31  Raja R Harinath  <rharinath@novell.com>
3805
3806         Fix difference in behaviour with commandline invocation.
3807         * driver.cs (Driver.Reset): New.
3808         (CompilerCallableEntryPoint): Call it.
3809
3810         * statement.cs (If.Resolve): Avoid spurious "uninitialized
3811         variable" warnings if the boolean expression failed to resolve.
3812
3813 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
3814
3815         * attribute.cs: Fix the union of several permissions when some of them
3816         are unrestricted (so the result isn't an unrestricted permission set).
3817         Fix #74036.
3818
3819 2005-03-30  Raja R Harinath  <rharinath@novell.com>
3820
3821         * ecore.cs (MemberExpr): New class.  Convert from interface
3822         IMemberExpr.
3823         (MemberExpr.ResolveMemberAccess): Refactor and move here from
3824         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
3825         error checks.
3826         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
3827         (MethodGroupExpr.IsExplicitImpl): Remove.
3828         (Expression.GetFieldFromEvent): Remove.
3829         (SimpleName.MemberStaticCheck): Remove.
3830         (SimpleName.DoSimpleNameResolve): Update to changes.
3831         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
3832         (MemberAccess.IdenticalNameAndTypeName): Remove.
3833         (MemberAccess.error176): Move to MemberExpr.
3834         (MemberAccess.DoResolve): Update to changes.
3835         (BaseAccess.DoResolve): Likewise.
3836
3837 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
3838
3839         C# 2.0 Conditional attribute class implementation
3840         
3841         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
3842         Analyzes class whether it has attribute which has ConditionalAttribute
3843         and its condition is not defined.
3844         
3845         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
3846         (Class.IsExcluded): New method. Search for at least one defined
3847         condition in ConditionalAttribute of attribute class.
3848
3849 2005-03-30  Raja R Harinath  <rharinath@novell.com>
3850
3851         * ecore.cs (PropertyExpr): Derive from Expression, not
3852         ExpressionStatement.
3853         (PropertyExpr.EmitStatement): Remove.
3854
3855 2005-03-29  Raja R Harinath  <rharinath@novell.com>
3856
3857         Fix #74060.
3858         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
3859         internal field "value__" of an enum be private.  The examples for
3860         "value__" that I found on MSDN all used FieldAttributes.Private.
3861
3862         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
3863         Don't mention IL method attribute names.
3864
3865         Fix #47991.  Remove a TODO.
3866         * statement.cs (Block.Toplevel): Make into a field.
3867         (Block.Parameters): Move into ToplevelBlock.
3868         (Block.known_variables): Rename from child_variable_names.
3869         (Block.Block): Remove variants that take Parameters.  Initialize
3870         'Toplevel' with the immediately surrounding toplevel block.
3871         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
3872         LocalInfo parameter.
3873         (Block.GetKnownVariableInfo): New.
3874         (Block.IsVariableNameUsedInChildBlock): Update.
3875         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
3876         the block, even though it may not be in scope.
3877         (Block.AddVariable): Remove Parameters parameter.  Use
3878         Toplevel.Parameters instead.
3879         (Block.AddConstant): Remove Parameters parameter.
3880         (Block.GetParameterReference): Update to use Toplevel.Parameters.
3881         (Block.IsParamaterReference): Likewise.
3882         (Block.IsLocalParameter): Likewise.  Simplify a lot.
3883         (ToplevelBlock.Parameters): New.  Moved from Block.
3884         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
3885         initialize Parameters to a non-null value.
3886         * cs-parser.jay: Update to changes.
3887         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
3888         simple names that mean different things in the same block.  Use
3889         Block.IsVariableNameUsedInBlock.
3890
3891 2005-03-28  Raja R Harinath  <rharinath@novell.com>
3892
3893         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
3894
3895 2005-03-26  Raja R Harinath  <harinath@acm.org>
3896
3897         Fix #73038.
3898         * assign.cs (Assign.DoResolve): When the RHS of an assignment
3899         fails to resolve, ensure that the LHS is still resolved as an
3900         lvalue.
3901
3902 2005-03-25  Raja R Harinath  <harinath@acm.org>
3903
3904         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
3905         ec.ContainerType.
3906         (Enum.current_ec): Remove.
3907         (Enum.LookupEnumValue): Remove EmitContext argument.
3908         Just uses the one created during DefineType.
3909         (Enum.FindMembers): Update.
3910         * expression.cs (MemberAccess.DoResolve): Update.
3911
3912 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
3913
3914         * assign.cs (Assign.DoResolve): Check for CS1717 when
3915         source and target are same (uses Equals).
3916
3917         * expression.cs (LocalVariableReference, ParameterReference,
3918         This): Implemented Equals, GetHashCode.
3919
3920         * statement.cs (Block.GetParameterReference): Removed useless
3921         local variable.
3922
3923 2005-03-22  Raja R Harinath  <rharinath@novell.com>
3924
3925         Fix cs0128.cs
3926         * statement.cs (Block.AddVariable): Ensure that we skip implicit
3927         blocks before deciding whether the error is cs0136 or cs0128.
3928
3929         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
3930         (using_alias_directive, using_namespace_directive): Pass
3931         MemberName, not an expression to Namespace.UsingAlias and
3932         Namespace.Using.
3933         (MakeName): Use the MemberName of the namespace.
3934         * namespace.cs (Namespace.MemberName): New.
3935         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
3936         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
3937         Likewise.
3938         * decl.cs (MemberName.Name): Make readonly.
3939         (MemberName.FromDotted): New "constructor".
3940         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
3941         (MemberCore.Name): Compute from MemberName on demand.
3942         (MemberCore.SetMemberName): Provide a way to change the
3943         MemberName.
3944         (MemberCore.AddToContainer): Don't take a fullname parameter.
3945         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
3946         fully qualified name of the container to the member name.
3947         (TypeContainer.AddToTypeContainer): Use a fully qualified name
3948         only if the type is a member of the root container.
3949         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
3950         MemberName.Left rather than searching for an embedded ".".
3951         (PartialContainer.CreatePart): Update to changes in RootContext.
3952         (MemberBase.ShortName): Turn into a property.  Use
3953         MemberCore.SetMemberName.
3954         (MemberBase.ExplicitInterfaceName): Remove.
3955         (MemberBase.UpdateMemberName): Remove.
3956         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
3957         (PropertyBase.SetMemberName): New override.
3958         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
3959         (Tree.GetDecl): New.
3960         (Tree.AllDecls): Rename from Decls.
3961         * attribute.cs, enum.cs, report.cs: Update to changes.
3962         * driver.cs (MainDriver): Use MemberName.FromDotted on
3963         RootContext.MainClass.
3964
3965 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
3966
3967         * class.cs (FixedField.Define): Check for CS1664 and more sanity
3968         checks.
3969
3970         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
3971
3972 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
3973
3974         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
3975         property accessor modifiers.
3976
3977         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
3978         fixed buffer attribute (CS1716).
3979         (PropertyMethod.HasCustomAccessModifier): When property accessor
3980         has custom modifier.
3981
3982         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
3983         modifiers.
3984         (PropertyExpr.DoResolveLValue): Add CS0272.
3985
3986 2005-03-17  Miguel de Icaza  <miguel@novell.com>
3987
3988         * convert.cs: When converting to a pointer, use the proper Conv.U
3989         or Conv.I depending on the source data type.
3990
3991         * cs-tokenizer.cs: Make the size for large decimal constants,
3992         fixes #72957.
3993
3994 2005-03-17  Martin Baulig  <martin@ximian.com>
3995
3996         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
3997         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
3998
3999 2005-03-17  Martin Baulig  <martin@ximian.com>
4000
4001         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4002         to bool so we can return an error condition.
4003         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4004         returned an error.
4005
4006 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
4007
4008         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4009         attributes.
4010
4011 2005-03-16  Raja R Harinath  <rharinath@novell.com>
4012
4013         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4014         Refactor to avoid traversing the list of assemblies, and to avoid
4015         string concatenation.
4016         * typemanager.cs (guid_attr_type): Remove.
4017         (negative_hits, pointers, references): Remove hashes.
4018         (type_hash): New.
4019         (GetConstructedType): New.  Uses type_hash to handle constructed
4020         types (arrays, references, pointers).
4021         (GetReferenceType, GetPointerType): Use it.
4022         (GetNestedType): New.  Uses type_hash to handle nested types of
4023         reflected types.
4024         (LookupType, LookupTypeDirect): Remove.
4025         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
4026         'types' hash and LookupTypeReflection directly.
4027         (params_string, params_object): Use GetConstructedType.
4028         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
4029         top-level types.
4030         (Namespace.Lookup): Use cached_types.
4031         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4032         provided by old TypeManager.LookupType.
4033         * rootcontext.cs (MakeFQN): Remove.
4034         * decl.cs (DeclSpace.MakeFQN): Likewise.
4035         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4036         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4037         TypeManager.GetConstructedType.
4038         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4039
4040 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
4041
4042         * cs-parser.jay: Fix build.
4043
4044 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
4045
4046         * class.cs (TypeContainer.CircularDepException) New nested
4047         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
4048
4049         * cs-parser.jay: Reports CS1527 for any namespace element.
4050
4051         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4052         Added CS0407.
4053
4054         * expression.cs (ParameterReference.IsAssigned): Changed error to
4055         CS0269.
4056         (Error_WrongNumArguments): Moved CS0245 detection here.
4057
4058         * statement.cs (Return.Resolve): Add CS1622 report.
4059
4060 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
4061
4062         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4063
4064 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
4065
4066         * attribute.cs expression.cs: Get rid of some allocations.
4067
4068 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
4069
4070         * doc.cs : just eliminate the latest change.
4071
4072 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4073
4074         * doc.cs : commented out the latest change. It breaks xml-030.cs
4075
4076 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4077
4078         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4079           fail. So invoke CreateType() in FindDocumentedType().
4080
4081 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4082
4083         * cs-tokenizer.cs : added IsKeyword().
4084         * doc.cs : Detect keyword incorrectly used as identifier.
4085           Allow identifiers prefixed by @.
4086
4087 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
4088
4089         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4090         It caused exception in namespace resolving (again!).
4091         
4092         * class.cs (Class.ctor): Removed exit.
4093         (PropertyMethod.ctor): ditto.
4094         
4095         * codegen.cs (Codegen.Reset): Reset static data.
4096         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4097         
4098         * cs-tokenizer.cs (Cleanup): Removed.
4099         
4100         * driver.cs (GetSystemDir): Rewrote to one line command.
4101         It caused problem with unloaded dynamic modules.
4102         (UnixParseOption): Removed Exit.
4103         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4104         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4105         Now can be mcs used as library.
4106         
4107         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4108         empty location.
4109         
4110         * location.cs (Reset): Reset static data.
4111         
4112         * namespace.cs (Reset): Reset static data.
4113         
4114         * report.cs (Report.Reset): Reset static data.
4115         
4116         * rootcontext.cs (RootContext.Reset): Reset static data.
4117         
4118         * tree.cs (RootTypes.ctor): Use Location.Null
4119         
4120         * typemanager.cs (TypeManager.Reset): Reset static data.
4121         (CoreLookupType): Removed Exit.
4122         (TypeHandle.Reset): Reset static data.
4123         
4124 2005-03-10  Raja R Harinath  <rharinath@novell.com>
4125
4126         Fix #73516.
4127         * typemanager.cs (ComputeNamespaces): Import namespaces from
4128         referenced modules too.
4129
4130 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4131
4132         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4133         than '.'.
4134
4135 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4136
4137         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4138         enclosing DeclSpace.  This ensures that a name-lookup populates
4139         more caches and there are fewer 'TypeExpression's.  Carve out
4140         nested type lookup into ...
4141         (LookupNestedTypeInHierarchy): ... this.
4142
4143 2005-04-15  Martin Baulig  <martin@ximian.com>
4144
4145         Merged r41590 from MCS and make it work in the generics land.
4146
4147         * generic.cs (TypeParameter.UpdateConstraints): Removed the
4148         `check' argument.
4149
4150         * class.cs (PartialContainer.UpdateConstraints): Removed.
4151         (PartialContainer.CheckConstraints): Removed.
4152         (PartialContainer.SetParameterInfo): Store the constraints here.
4153         (PartialContainer.DefineTypeParameters): New public method;
4154         resolve the type parameter's constraints here.  Note that the
4155         PartialContainer doesn't have an EmitContext anymore, so we must
4156         do this in the ClassPart.
4157
4158 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4159
4160         Clean up a few partial-class semantics.  
4161         Fixes test-357.cs and cs1618-2.cs.
4162         * cs-parser.jay (struct_declaration): Use 'current_class' as
4163         parent of newly-created struct.  Remove call to Register ().
4164         Use 'pop_current_class' to complete handing the current struct.
4165         (interface_declaration): Likewise.
4166         (class_declaration): Likewise.
4167         (enum_declaration): Use 'current_class' as parent of newly created
4168         enum.
4169         (delegate_declaration): Likewise.
4170         (pop_current_class): New function.  This is used to handle closing
4171         up the 'current_class' and 'current_container', and pointing them
4172         to the enclosing class/container.
4173         (CSharpParser): Initialize 'current_class' too.
4174         * decl.cs (MemberCore): Add check for invariant: a partial
4175         container is not a parsed entity, and thus does not enclose any
4176         parsed members.
4177         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4178         (DeclSpace.BaseTypeExpr): Use it.
4179         (DeclSpace.LookupType): Add check for invariant.
4180         * class.cs (TypeContainer): Add check for invariant: a nested
4181         class should have the same NamespaceEntry as its enclosing class.
4182         (TypeContainer.EmitFieldInitializers): Make virtual.
4183         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4184         MemberCore.
4185         (TypeContainer.Register): Remove.
4186         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4187         null.  Use TypeResolveEmitContext for resolving base types and
4188         interfaces.  Move initialization of Parts.TypeBuilder here from
4189         ...
4190         (TypeContainer.DefineNestedTypes): ... here.
4191         (PartialContainer): Take a Namespace not a NamespaceEntry.
4192         (PartialContainer.Create): Don't use Register.  Call the
4193         appropriate Add... function directly.
4194         (ClassPart): Take both the PartialContainer and the enclosing
4195         class as constructor arguments.
4196         (ClassPart.EmitFieldInitializers): Override.
4197         (ClassPart.PartFindNestedTypes): Remove.
4198         (FieldBase.GetInitializerExpression): Resolve the initializer
4199         expression in the emit context of the enclosing class.
4200         * tree.cs (RootTypes): Remove Register ().
4201         
4202 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
4203
4204         * cs-parser.jay: Removed CS0134.
4205         
4206         * driver.cs: Removed CS1901.
4207         
4208         * expression.cs (SizeOf.DoResolve): Don't report CS0233
4209         for predefined types.
4210
4211 2005-03-07  Duncan Mak  <duncan@novell.com>
4212
4213         * codegen.cs (Save):  Catch UnauthorizedAccessException as
4214         well. Fixes bug #73454.
4215
4216 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
4217
4218         * cs-tokenizer.cs (xtoken): Add CS1035.
4219         
4220         * class.cs (MethodData.Define): Add CS0683.
4221         (FieldMember.ctor): Add CS0681.
4222
4223 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4224
4225         * ecore.cs (SimpleName.DoResolve): Rename from
4226         SimpleName.DoResolveAllowStatic.
4227         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4228         Pass 'intermediate' flag to MemberStaticCheck.
4229         (SimpleName.MemberStaticCheck): Skip "static check" only in case
4230         of "intermediate" lookups via MemberAccess.
4231         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
4232         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4233
4234 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4235
4236         Fix #73394.
4237         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4238         slipped in because of variable names that are identical to a
4239         builtin type's BCL equivalent ('string String;', 'int Int32;').
4240         (PropertyExpr.EmitInstance): Likewise.
4241
4242 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
4243
4244         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4245         
4246         * report.cs (warning_ignore_table): Made public.
4247
4248 2005-03-04  Raja R Harinath  <rharinath@novell.com>
4249
4250         Fix #73282.
4251         * class.cs (MethodData.Emit): Pass 'container' to
4252         container.GetObsoleteAttribute instead of 'container.Parent'.
4253
4254 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
4255
4256         * cs-parser.jay: Add 1534 error test.
4257
4258         * iterators.cs (Yield.CheckContext): Add error 1629.
4259         (Iterator.ctor): Save unsafe modifier.
4260         (MoveNextMethod.DoEmit): Restore unsafe context.
4261
4262         * namespace.cs (UsingAlias): Better error message.
4263
4264 2005-03-03  Dan Winship  <danw@novell.com>
4265
4266         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
4267         the warning message [#73219]
4268
4269 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4270
4271         Fix compile with MCS 1.0.0.0.
4272         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
4273         w_restore to not depend on string constant folding.
4274
4275 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4276
4277         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
4278         CS0246 check to users who passed 'silent = false'.
4279         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
4280         check.
4281         (SimpleName.SimpleNameResolve): Update.
4282         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
4283         (MemberAccess.IdenticalNameAndTypeName): Update.
4284         * doc.cs (FindDocumentedTypeNonArray): Update.
4285
4286 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
4287
4288         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
4289         * parameters.cs (ComputeAndDefineParameters): Remove.
4290         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
4291         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
4292         Use GetParameterInfo.
4293
4294 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
4295
4296         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
4297
4298 2005-03-02  Raja R Harinath  <rharinath@novell.com>
4299
4300         Unify DeclSpace.LookupType and DeclSpace.FindType.
4301         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
4302         is in charge of defining nested types on demand.
4303         (DeclSpace.LookupType): Use it when the current_type is a
4304         TypeBuilder.  Use LookupTypeDirect for reflected types.
4305         (DeclSpace.FindType): Remove.
4306         (DeclSpace.LookupInterfaceOrClass): Likewise.
4307         (DeclSpace.DefineTypeAndParents): Likewise.
4308         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
4309         DeclSpace.LookupType.
4310         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
4311         * typemanager.cs (LookupType): Simplify.
4312         (AddUserType): Remove type from negative_hits.
4313         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
4314         * class.cs (TypeContainer.FindMembers): Move handling of nested
4315         types ...
4316         (TypeContainer.FindMembers_NestedTypes): ... here.
4317         (TypeContainer.FindNestedType): Implement override.
4318         (ClassPart.FindNestedType): Delegate to PartialContainer.
4319         (ClassPart.PartFindNestedType): Looks up the nested types of the
4320         part alone.
4321
4322 2005-04-14  Martin Baulig  <martin@ximian.com>
4323
4324         * generic.cs (ConstructedType): Moved all the type lookup and
4325         nested class logic into SimpleName.
4326         (ConstructedType.ResolveConstructedType): Our underlying type is
4327         already fully resolved; all the type lookup stuff is in
4328         SimpleName.
4329
4330         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
4331         constructed types here instead of in ConstructedType.
4332
4333         * decl.cs (MemberName.GetTypeExpression): Always create a
4334         SimpleName, not a ConstructedType.
4335         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
4336
4337 2005-03-02  Martin Baulig  <martin@ximian.com>
4338
4339         * class.cs (TypeContainer.DoDefineMembers): We also need a default
4340         static constructor in static classes.
4341
4342 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
4343
4344         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
4345         sizeParamIndex is not specified.
4346
4347 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
4348
4349         Fix #73117
4350         * report.cs (WarningMessage.IsEnabled): Missing null check.
4351
4352 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4353
4354         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
4355         in the fields and not in the properties.
4356
4357 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
4358
4359         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
4360         fields as well.
4361
4362 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4363
4364         * attribute.cs: Small refactoring (improved robustness).
4365         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
4366         (ValidateGuid): Removed.
4367         (Resolve): Removed referenced to above mentioned.
4368         (GetAttributeUsage): Made private and changed to work without
4369         class assistance.
4370         (GetIndexerAttributeValue): Don't crash.
4371         (GetConditionalAttributeValue): Ditto.
4372         (GetClsCompliantAttributeValue): Ditto.
4373         (ExtractSecurityPermissionSet): All attributes exceptions are
4374         error 648.
4375         (GetPropertyValue): New helper.
4376         (GetMethodImplOptions): New method.
4377         (DefinePInvokeMethod): Reuse common code. Implemented handling of
4378         some missing properties.
4379         
4380         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
4381         (Method.ApplyAttributeBuilder): Updated.
4382         
4383         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
4384         exception.
4385
4386 2005-02-28  Raja R Harinath  <rharinath@novell.com>
4387
4388         Fix #73052.
4389         * report.cs (Report.SymbolRelatedToPreviousError): Handle
4390         non-simple types (array, pointer, reference).
4391
4392 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4393
4394         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
4395
4396         * class.cs (MethodCore.IsDuplicateImplementation): Special error
4397         for operators.
4398         (Method.CheckBase): Catch wrong destructor here.
4399         (MethodData.Define): Add errors 550, 668.
4400
4401         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
4402
4403         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
4404
4405         * pending.cs (VerifyPendingMethods): Add error 551.
4406
4407         * typemanager.cs (CSharpName): Next error report helper.
4408
4409 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
4410
4411         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
4412         attributes. Removed useless attribute double check.
4413         It saves almost 2MBs for corlib.
4414
4415 2005-02-25  Raja R Harinath  <rharinath@novell.com>
4416
4417         Fix #72924.
4418         * statement.cs (ExpressionStatement.Resolve): Make robust to being
4419         called twice in case of error.
4420
4421 2005-02-23  Chris Toshok  <toshok@ximian.com>
4422
4423         Fix compiler portions of #72827.
4424         * statement.cs (Block.Emit): call Begin/EndScope on the
4425         EmitContext instead of the ILGenerator.
4426
4427         * codegen.cs (EmitContext.BeginScope): new method, call
4428         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
4429         we have one.)
4430         (EmitContext.BeginScope): same, but EndScope and CloseScope
4431
4432         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
4433         offset and call the superclass's OpenScope(int) with it.
4434         (SymbolWriter.CloseScope): get the current il
4435         offset and call superclass's CloseScope(int) with it.
4436
4437 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
4438
4439         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
4440         CS1677 for out and ref as well.
4441
4442         * class.cs (Method.Define): Add error CS1599 detection.
4443         
4444         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
4445         
4446         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
4447         
4448         * delegate.cs (Delegate.Define): Add error CS1599 detection.
4449         
4450         * support.cs.cs (ModifierDesc): New helper method.
4451
4452 2005-02-23  Raja R Harinath  <rharinath@novell.com>
4453             Abin Thomas  <projectmonokochi@rediffmail.com>
4454             Anoob V E  <projectmonokochi@rediffmail.com>
4455             Harilal P R  <projectmonokochi@rediffmail.com>
4456
4457         Fix #57851, #72718.
4458         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
4459         MemberLookup (used for error reporting) actually returns a result.
4460         Fix error report number (122, not 112).
4461
4462 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
4463             Anoob V E  <projectmonokochi@rediffmail.com>
4464             Harilal P R  <projectmonokochi@rediffmail.com>
4465
4466         Fix #71134.
4467         * pending.cs (PendingImplementation.GetAbstractMethods):
4468         Find NonPublic members too.
4469
4470 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
4471
4472         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
4473         Fixed error 217.
4474         
4475         * class.cs (MethodCore.CheckMethodAgainstBase):
4476         Add error 239 report.
4477
4478 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
4479
4480         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
4481         
4482         * class.cs (Operator.Define): Add error 217 report.
4483         
4484 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4485
4486         Fix #68955.
4487         * expression.cs (Invocation.IsApplicable): Make public.
4488         (Invocation.IsParamsMethodApplicable): Likewise.
4489         * delegate.cs (Delegate.VerifyApplicability): Don't use
4490         Invocation.VerifyArgumentCompat for parameter applicability
4491         testing.  Use Invocation.IsApplicable and
4492         Invocation.IsParamsMethodApplicable.
4493
4494 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
4495
4496         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
4497         
4498         * class.cs (Operator.Define): Add error 217 report.
4499         
4500 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4501
4502         * namespace.cs (UsingEntry.Resolve): Undo change below.
4503
4504 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4505
4506         Fix #72756.
4507         * ecore.cs (Expression.MemberLookupFailed): Add argument to
4508         disable the error message when the extended MemberLookup also
4509         fails.
4510         (Expression.MemberLookupFinal): Update.
4511         (SimpleName.DoSimpleNameResolve): Update.
4512         * expression.cs (MemberAccess.ResolveNamespaceOrType):
4513         Don't use MemberLookupFinal.
4514         (New.DoResolve): Update.
4515         (BaseAccess.CommonResolve): Update.
4516
4517 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4518
4519         Fix #72732.
4520         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
4521         occured previously, don't resolve again.
4522
4523 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
4524
4525         Fix #69949
4526         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
4527         argument. Call ResolveAttributeUsage for unresolved.
4528         when types doesn't match ctor arguments.
4529         
4530         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
4531         for nested attribute classes.
4532         (Class.attribute_usage): Removed.
4533         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
4534         for attribute class.
4535         
4536         * ecore.cs (IsAttribute): Removed.
4537         
4538         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
4539         
4540         * rootcontext.cs (RegisterAttribute): Removed, attributes are
4541         now normal types.
4542         (attribute_types): Removed.
4543         (EmitCode): Global attributes are emited as the latest.
4544
4545 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
4546
4547         * class.cs (EmitFieldInitializers): Don't emit field initializer
4548         for default values when optimilization is on.
4549         
4550         * constant.cs (Constant.IsDefaultValue): New property.
4551         
4552         * driver.cs: Add /optimize handling.
4553         
4554         * constant.cs,
4555         * ecore.cs,
4556         * literal.cs: Implement new IsDefaultValue property.
4557         
4558         * rootcontext.cs (Optimize): New field, holds /optimize option.
4559
4560 2005-02-18  Raja R Harinath  <rharinath@novell.com>
4561
4562         Fix crasher in re-opened #72347.
4563         * namespace.cs (Namespace.Lookup): Return null if
4564         DeclSpace.DefineType returns null.
4565
4566         Fix #72678.
4567         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
4568
4569 2005-02-18  Raja R Harinath  <rharinath@novell.com>
4570
4571         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
4572         now returns null if it cannot resolve to an lvalue.
4573         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
4574         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
4575         returned null.  Remove check for SimpleName.
4576         (EventExpr.DoResolveLValue): New.
4577         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
4578         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
4579         error from ...
4580         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
4581         avoid CS0131 error.
4582         (Unary.ResolveOperator): Move CS0211 check ...
4583         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
4584         CS0131 error.
4585         (Unary.DoResolveLValue): Simplify.
4586         (AddressOf.DoResolveLValue): New.
4587         (ArrayAccess.DoResolveLValue): New.
4588
4589 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
4590
4591         * attribute.cs (Attribute.Resolve): Add arguments casting for
4592         when types doesn't match ctor arguments.
4593
4594 2005-02-16  Raja R Harinath  <rharinath@novell.com>
4595
4596         Fix parts of #63202.
4597         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
4598         lookup of operator in base type.  Ensure that all checks happen
4599         when the operator resolves to an "op_..." method.
4600
4601 2005-02-15  Raja R Harinath  <rharinath@novell.com>
4602
4603         Fix #71992.
4604         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
4605         'ignore_cs0104' parameter.  Pass it to ...
4606         (NamespaceEntry.Lookup): ... this.
4607         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
4608         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
4609         (TypeLookupExpression.DoResolveAsTypeStep): Update.
4610         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
4611         Update.  Request that cs0104 errors be ignored.
4612         (ComposedCast.ResolveAsTypeStep): Update.
4613
4614 2005-02-14  Raja R Harinath  <rharinath@novell.com>
4615
4616         Fix #59209.
4617         * expression.cs (Invocation.BetterFunction): Remove support for
4618         comparing virtual functions and their overrides.
4619         (Invocation.IsOverride): New.
4620         (Invocation.OverloadResolve): Don't consider 'override' functions
4621         during candidate selection.  Store them in a lookaside list.
4622         If the selected method is a 'virtual' function, use the list to
4623         find any overrides that are closer to the LHS type.
4624
4625 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
4626
4627         * expression.cs (New.DoResolve): Add complex core type reduction.
4628         (New.Constantify): Converts complex core type syntax like 'new int ()'
4629         to simple constant.
4630         
4631 2005-02-14  Raja R Harinath  <rharinath@novell.com>
4632
4633         * decl.cs (EntryType.EntryType): New constructor to create an
4634         updated copy of a cache entry.
4635         (MemberCache.AddMethods): Use it.
4636         (MemberCache.ClearDeclaredOnly): Remove.
4637         (MemberCache.MemberCache): Update.
4638
4639 2005-02-11  Miguel de Icaza  <miguel@novell.com>
4640
4641         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
4642         variable.  This one is represents the actual low-level declaration
4643         of the method, as opposed to the semantic level `IsStatic'.   
4644
4645         An anonymous method which is hosted into a static method might be
4646         actually an instance method.  IsStatic would reflect the
4647         container, while MethodIsStatic represents the actual code
4648         generated.
4649
4650         * expression.cs (ParameterReference): Use the new MethodIsStatic
4651         instead of IsStatic.
4652
4653         * anonymous.cs (AnonymousMethod.Compatible): Pass the
4654         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
4655         set on the current EmitContext. 
4656
4657         * expression.cs (Cast): Overload DoResolveLValue so we can pass
4658         resolve our casted expression as an LValue.  This triggers the
4659         proper LValue processing that is later required by Assign.
4660
4661         This fixes 72347.
4662
4663         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
4664
4665 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
4666
4667         C# 2.0 Fixed buffer implementation
4668
4669         * anonymous.cs: Update after RegisterHelperClass renaming.
4670
4671         * attribute.cs (AttributeTester.fixed_buffer_cache):
4672         Cache of external fixed buffers.
4673         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
4674         implementation if field is fixed buffer else null.
4675
4676         * class.cs
4677         (TypeContainer.AddField): Accept FieldMember instead of Field.
4678         (FieldBase.IsFieldClsCompliant): Extracted code from
4679         VerifyClsCompliance descendant customization.
4680         (FixedField): New class handles fixed buffer fields.
4681         (FixedFieldExternal): Keeps information about imported fixed
4682         buffer.
4683         (IFixedField): Make access to internal or external fixed buffer
4684         same.
4685
4686         * cs-parser.jay: Add fixed buffer parsing.
4687
4688         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
4689         buffer.
4690
4691         * expression.cs (Indirection): Extended implementation to accept
4692         fixed buffer field.
4693         (PointerArithmetic.Emit): Get element from fixed buffer as well.
4694         (ElementAccess.MakePointerAccess): Get type as parameter.
4695         (DoResolve): Add fixed buffer field expression conversion.
4696         (DoResolveLValue): Ditto.
4697         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
4698         (ArrayPtr): Derives from FixedBufferPtr.
4699         (ArrayPtr.Emit): Add extra emit for array elements.
4700
4701         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
4702
4703         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
4704         for compiler generated types.
4705         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
4706
4707         * statement.cs (Fixed): Refactored to be easier add fixed buffer
4708         and consume less memory.
4709         (Fixed.Resolve): Add fixed buffer case.
4710
4711         * typemanager.cs (compiler_generated_attr_ctor,
4712         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
4713         (HasElementType): Add our own implementation to work on every
4714         runtime.
4715
4716 2005-02-11  Miguel de Icaza  <miguel@novell.com>
4717
4718         * anonymous.cs (CaptureContext): Track whether `this' has been
4719         referenced.   
4720
4721         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
4722         only captured `this' if it was implicitly done (instance
4723         methods/variables were used). 
4724
4725         * codegen.cs (EmitContext.CaptureThis): New method to flag that
4726         `this' must be captured.
4727
4728 2005-01-30  Miguel de Icaza  <miguel@novell.com>
4729  
4730         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
4731         is null it means that there has been no need to capture anything,
4732         so we just create a sibling.
4733
4734         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
4735
4736         Just a partial fix.  The other half is fairly elusive.
4737         
4738 2005-02-10  Raja R Harinath  <rharinath@novell.com>
4739
4740         Fix #52586, cs0121-4.cs.
4741         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
4742         and return a hashtable.
4743         (MemberCache.ClearDeclaredOnly): New.
4744         (MemberCache.MemberCache): Update to change.  Make a deep copy of
4745         the method_hash of a base type too.
4746         (MemberCache.AddMethods): Adapt to having a deep copy of the base
4747         type methods.  Overwrite entries with the same MethodHandle so
4748         that the ReflectedType is correct.  The process leaves in base
4749         virtual functions and their overrides as distinct entries.
4750         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
4751         matters since it was boxed in a ArrayList before.
4752         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
4753         modifier.
4754         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
4755         case of a virtual function and its override (choose the overload
4756         as better).
4757         (Invocation.OverloadResolve): Avoid 'override' members during
4758         'applicable_type' calculation.
4759
4760 2005-03-28  Raja R Harinath  <rharinath@novell.com>
4761
4762         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
4763         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
4764         GetTypeHandle.  It is possible for a reflected type to derive from
4765         a TypeBuilder (e.g., int[] derives from the TypeBuilder
4766         System.Array during mscorlib compilation).
4767         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
4768         contain a method_hash, don't create one either.  Don't create a
4769         deep copy of the base cache's method_hash.
4770         (MemberCache.SetupCache): Rename back from DeepCopy.
4771         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
4772         already initialized.  If we see an override function, add its
4773         underlying base virtual function to the member_hash too.
4774
4775 2005-02-09  Raja R Harinath  <rharinath@novell.com>
4776
4777         Combine two near-redundant caches.
4778         * typemanager.cs (method_params): Rename from method_internal_params.
4779         (TypeManager.GetParameterData): New.  Replace
4780         Invocation.GetParameterData.
4781         (TypeManager.LookupParametersByBuilder): Remove.
4782         * expression.cs (Invocation.method_parameter_cache): Remove.
4783         (Invocation.GetParameterData): Remove.
4784         Update to changes.
4785         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
4786         Update to changes.
4787
4788 2005-02-08  Raja R Harinath  <rharinath@novell.com>
4789
4790         Fix #72015.
4791         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
4792         TypeManager.multicast_delegate_type is null, resolve it by looking
4793         up "System.MulticastDelegate".
4794         * rootcontext.cs (RootContext.ResolveCore): Simplify.
4795
4796 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
4797             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
4798             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
4799
4800         Fix cs0164.cs.
4801         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
4802         (LabeledStatement.AddReference): New.  Set 'referenced'.
4803         (Goto.Resolve): Use it.
4804
4805 2005-02-05  John Luke  <john.luke@gmail.com>
4806
4807         * driver.cs: remove duplicate -doc line in Usage ()
4808
4809 2005-02-04  Raja R Harinath  <rharinath@novell.com>
4810
4811         * location.cs (Location.AddFile): Fix CS2002 error report.
4812
4813 2005-02-02  Martin Baulig  <martin@ximian.com>
4814
4815         * delegate.cs (Delegate.DefineType): Report an internal error if
4816         TypeManager.multicast_delegate_type is null.  See bug #72015 for
4817         details.        
4818
4819 2005-02-02  Raja R Harinath  <rharinath@novell.com>
4820
4821         Fix a crasher in a variant of #31984.
4822         * const.cs (Constant.CheckBase): New override that defers the
4823         new-or-override check in case the base type hasn't been populated
4824         yet.
4825         (Constant.Define): Ensure the new-or-override check is performed.
4826
4827 2005-02-01  Duncan Mak  <duncan@ximian.com>
4828
4829         * const.cs (LookupConstantValue): Check that `ce' is not null
4830         before calling GetValue ().
4831
4832 2005-02-01  Raja R Harinath  <rharinath@novell.com>
4833
4834         Fix test-334.cs (#69519).
4835         * cs-parser.jay (using_alias_directive): Pass in an expression to
4836         NamespaceEntry.UsingAlias.
4837         (using_namespace_directive): Pass in an expression to
4838         NamespaceEntry.Using.
4839         (namespace_name): Don't flatten to a string.
4840         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
4841         (NamespaceEntry.AliasEntry.Resolve): Lookup using
4842         ResolveAsTypeStep.
4843         (NamespaceEntry.UsingEntry): Likewise.
4844         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
4845         changes.
4846         (NamespaceEntry.LookupForUsing): Remove.
4847         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
4848         names.
4849         (NamespaceEntry.Lookup): Remove support for dotted names.
4850
4851 2005-02-01  Raja R Harinath  <rharinath@novell.com>
4852
4853         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
4854         split into two.
4855         (NamespaceEntry.ImplicitParent): Compute on demand.
4856         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
4857         parallels the current.
4858         (NamespaceEntry.LookupForUsing): Use it.
4859         (NamespaceEntry.Lookup): If the current namespace-entry is
4860         implicit, don't search aliases and using tables.
4861
4862 2005-02-01  Raja R Harinath  <rharinath@novell.com>
4863
4864         Fix #31984.
4865         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
4866         BaseCache here.
4867         (TypeContainer.BaseCache): Compute on demand.
4868         (TypeContainer.FindMembers): Define constants and types if they're
4869         not already created.
4870         (FieldMember.Define): Move resetting of ec.InUnsafe before error
4871         check.
4872         * const.cs (Constant.Define): Make idempotent.
4873
4874 2005-01-29  Miguel de Icaza  <miguel@novell.com>
4875
4876         * pending.cs: Produce better code (no nops produced by using Ldarg
4877         + value).
4878         
4879         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
4880         i - 1' it should be arg + 1.
4881
4882         Fixes bug #71819.
4883
4884 2005-01-28  Raja R Harinath  <rharinath@novell.com>
4885
4886         * attribute.cs (Attribute.CheckAttributeType): Make private
4887         non-virtual.
4888         (Attribute.ResolveType): Make virtual.
4889         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
4890         handling of RootContext.Tree.Types.
4891
4892 2005-01-27  Raja R Harinath  <rharinath@novell.com>
4893
4894         Update attribute-handling to use the SimpleName/MemberAccess
4895         mechanisms.
4896         * cs-parser.jay (attribute): Pass in an expression to the
4897         constructors of Attribute and GlobalAttribute.
4898         * attribute.cs (Attribute): Take an expression for the name.
4899         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
4900         passed in attribute name expression.
4901         (Attribute.CheckAttributeType): Use it.
4902         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
4903         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
4904         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
4905         argument to prevent error messages if the lookup fails.
4906
4907 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
4908
4909         * expression.cs (Indirection): Implemented IVariable interface
4910         to support indirection in AddressOf operator.
4911         (PointerArithmetic.Emit): Add optimalization for case where
4912         result can be precomputed.
4913
4914 2005-01-26  Martin Baulig  <martin@ximian.com>
4915
4916         * class.cs (TypeContainer.AttributeTargets): Return the correct
4917         AttributeTargets depending on our `Kind' instead of throwing an
4918         exception; fixes #71632.
4919
4920 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
4921
4922         Fix #71257
4923         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
4924         constant members.
4925
4926 2005-03-17  Martin Baulig  <martin@ximian.com>
4927
4928         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4929         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
4930
4931 2005-03-17  Martin Baulig  <martin@ximian.com>
4932
4933         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4934         to bool so we can return an error condition.
4935         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4936         returned an error.
4937
4938 2005-03-17  Martin Baulig  <martin@ximian.com>
4939
4940         * generic.cs (TypeMananager.IsIEnumerable): New public method.
4941
4942         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
4943         converting from an array-type of T to `IEnumerable<T>'.
4944
4945 2005-03-16  Martin Baulig  <martin@ximian.com>
4946
4947         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
4948         (Nullable.LiftedUnaryMutator): New public class.
4949
4950         * expression.cs (UnaryMutator.DoResolve): Added support for
4951         Nullable Types.
4952
4953 2005-03-14  Martin Baulig  <martin@ximian.com>
4954
4955         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
4956
4957 2005-03-14  Martin Baulig  <martin@ximian.com>
4958
4959         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
4960         the comparision operators `<', `>', `<=' and `>='.
4961
4962 2005-03-13  Martin Baulig  <martin@ximian.com>
4963
4964         * generic.cs
4965         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
4966         avoid confusion with the `NullLiteral'.
4967         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
4968
4969 2005-03-13  Martin Baulig  <martin@ximian.com>
4970
4971         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
4972         comparing arbitrary types with the null literal.
4973
4974 2005-03-13  Martin Baulig  <martin@ximian.com>
4975
4976         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
4977         boolean operators '&&', '||', '&' and '|'.
4978         (Nullable.OperatorTrueOrFalse): New public class.
4979
4980         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
4981         instead of a `StaticCallExpr'; added support for nullables.
4982
4983 2005-03-10  Martin Baulig  <martin@ximian.com>
4984
4985         * expression.cs
4986         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
4987         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
4988
4989 2005-03-07  Martin Baulig  <martin@ximian.com>
4990
4991         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
4992         it work if `expr' is not an IMemoryLocation.
4993         (Nullable.Lifted): Implement IMemoryLocation.
4994         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
4995         target type.
4996
4997 2005-03-05  Martin Baulig  <martin@ximian.com>
4998
4999         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
5000         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
5001         (Nullable): Added support for lifted unary and binary operators.
5002
5003         * expression.cs (Unary.DoResolve): Added support for nullable types.
5004         (Binary.DoResolve): Likewise.
5005         (Conditional.DoResolve): Likewise.
5006
5007 2005-03-02  Martin Baulig  <martin@ximian.com>
5008
5009         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
5010
5011         * class.cs (ClassPart.SetParameterInfo): Override this.
5012         (PartialContainer.SetParameterInfo): Override this.
5013         (TypeContainer.CheckConstraints): New protected method.
5014         (PartialContainer.CheckConstraints): Override this and check
5015         whether the same contraints were specified in all parts of a
5016         partial generic type definition.
5017         (PartialContainer.UpdateConstraints): New public method.
5018
5019         * generic.cs (TypeParameter.UpdateConstraints): New public method.
5020
5021 2005-03-02  Martin Baulig  <martin@ximian.com>
5022
5023         Committing a patch from Carlos Alberto Cortez to fix #72887.
5024
5025         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
5026         casts from `T []' to `int []'.
5027
5028 2005-03-02  Martin Baulig  <martin@ximian.com>
5029
5030         * generic.cs (TypeManager.IsEqual): Make this symmetric.
5031
5032         * expression.cs (Binary.ResolveOperator): When resolving a
5033         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
5034         `=='.  Fixes #71866.  See gen-127.cs.
5035
5036 2005-03-02  Martin Baulig  <martin@ximian.com>
5037
5038         * class.cs (TypeContainer.DoDefineMembers): We also need a default
5039         static constructor in static classes.
5040
5041 2005-03-02  Martin Baulig  <martin@ximian.com>
5042
5043         * generic.cs
5044         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
5045         (Nullable.LiftedConversion): Added support for user-defined
5046         conversions.
5047
5048         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
5049
5050         * cs-parser.jay: Use ComposedCast everywhere instead of
5051         NullableType, so we don't need to check for NullableType
5052         everywhere.
5053         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
5054         case where we'll be resolved into a `parenthesized_expression_0'
5055         afterwards.
5056
5057         * convert.cs
5058         (Convert.UserDefinedConversion): Added nullable conversions.
5059
5060 2005-02-28  Martin Baulig  <martin@ximian.com>
5061
5062         * generic.cs (TypeManager.IsNullableType): New static method.
5063         (Nullable): New abstract class.
5064         (Nullable.NullLiteral): New public class.
5065         (Nullable.LiftedConversion): New public class.
5066
5067         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
5068         `builtin_types opt_nullable'.
5069
5070         * convert.cs
5071         (Convert.ImplicitConversionStandard): Added nullable conversions.
5072         (Convert.ExplicitConversionStandard): Likewise.
5073         (Convert.ExplicitConversion): Likewise.
5074
5075 2005-02-26  Martin Baulig  <martin@ximian.com>
5076
5077         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
5078         begin with a "?", for instance "?[]".  Don't do a type lookup if
5079         `dim' is empty.
5080
5081 2005-02-25  Martin Baulig  <martin@ximian.com>
5082
5083         The first part of Nullable Types :-)
5084
5085         * generic.cs (NullableType): New public class.
5086         (NullCoalescingOperator): New public class.
5087         (TypeArguments.Resolve): Add a CS0306 check.
5088
5089         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
5090         (opt_nullable): New rule.
5091         (type): Added `opt_nullable' to `namespace_or_type_name',
5092         `builtin_types' and `pointer_type'.
5093         (array_type): Added `opt_nullable'.
5094         (opt_rank_specifier_or_nullable): New rule; this is the
5095         combination of `opt_rank_specifier' and `opt_nullable'.
5096         (opt_error): New rule; catch errors here.
5097         (nullable_type_or_conditional): New rule; we use this to check for
5098         nullable and still detect the conditional operator.
5099         (local_variable_type): Use `opt_rank_specifier_or_nullable'
5100         instead `opt_rank_specifier'.
5101
5102         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
5103         for nullables.
5104
5105 2005-02-24  Martin Baulig  <martin@ximian.com>
5106
5107         * README, README.Changes: Removed; they're old and obsolete.
5108
5109 2005-02-22  Martin Baulig  <martin@ximian.com>
5110
5111         * generic.cs (TypeParameter.Resolve): If resolving the constraints
5112         returned an error, set `constraints' to null to avoid a crash
5113         later on.
5114         (TypeParameter.ResolveType): Likewise.
5115
5116 2005-02-22  Martin Baulig  <martin@ximian.com>
5117
5118         * generic.cs
5119         (Constraints.ResolveTypes): Protect against being called twice.
5120         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
5121         (TypeParameter.ResolveType): New public method; calls
5122         constraints.ResolveTypes().
5123         (TypeParameter.DefineType): Moved constraints.ResolveType() out
5124         into the new ResolveType().
5125         (GenericMethod.Define): Call ResolveType() on all our
5126         TypeParameter's.        
5127
5128 2005-02-21  Martin Baulig  <martin@ximian.com>
5129
5130         * generic.cs
5131         (TypeManager.generic_nullable_type): New static public field.
5132         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
5133
5134         * rootcontext.cs
5135         (RootContext.ResolveCore): Resolve "System.Nullable`1".
5136
5137 2005-02-15  Martin Baulig  <martin@ximian.com>
5138
5139         * generic.cs (ConstructedType.Constraints): Correctly check
5140         constraints if the argument type is a type parameter; fixes
5141         #72326. 
5142
5143 2005-02-02  Martin Baulig  <martin@ximian.com>
5144
5145         * delegate.cs (Delegate.DefineType): Report an internal error if
5146         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5147         details.        
5148
5149 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5150
5151         * pending.cs: Produce better code (no nops produced by using Ldarg
5152         + value).
5153         
5154         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5155         i - 1' it should be arg + 1.
5156
5157         Fixes bug #71819.
5158         
5159 2005-01-26  Martin Baulig  <martin@ximian.com>
5160
5161         * cs-parser.jay (indexer_declarator): Don't report an error if we
5162         have type parameters since we can be an explicit interface
5163         implementation; fixes #71449.
5164
5165 2005-01-26  Martin Baulig  <martin@ximian.com>
5166
5167         * class.cs (TypeContainer.AttributeTargets): Return the correct
5168         AttributeTargets depending on our `Kind' instead of throwing an
5169         exception; fixes #71632.
5170
5171 2005-01-26  Martin Baulig  <martin@ximian.com>
5172
5173         * delegate.cs (Delegate.DefineType): Correctly define our type
5174         parameters.  Fixes #71483.
5175
5176 2005-01-25  Raja R Harinath  <rharinath@novell.com>
5177
5178         Fix #71602.
5179         * expression.cs (MemberAccess.DoResolve): Don't complain with
5180         cs0572 when the LHS of a member access has identical name and type
5181         name.
5182
5183 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
5184
5185         Fix #71651, #71675
5186         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5187         CreatePermission.
5188         Create custom PermissionSet only for PermissionSetAttribute.
5189
5190 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
5191
5192         Fix #71649
5193         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5194         delegates in static class.
5195
5196 2005-01-24  Martin Baulig  <martin@ximian.com>
5197
5198         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5199         merging an implicit block, just use its reachability.
5200
5201         * statement.cs (Block.Resolve): Make the unreachable code check
5202         work wrt. implicit blocks; see test-337 from #63842.
5203
5204 2005-01-21  Alp Toker  <alp@atoker.com>
5205  
5206         * cs-parser.jay: destructor_declaration's container is PartialContainer
5207         not Class when partial types are used, so use Kind prop instead of
5208         'is'.
5209         
5210 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
5211
5212         * cs-parser.jay: Improve error reporting when an interface
5213         declares new types.
5214
5215 2005-01-20  Dick Porter  <dick@ximian.com>
5216
5217         * support.cs: SeekableStreamReader fix from Sandor Dobos
5218         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5219         chars are read.  Fixes bug 70369.
5220
5221 2005-01-20  Raja R Harinath  <rharinath@novell.com>
5222
5223         * cs-parser.jay (catch_clause): Simplify current_block handling
5224         somewhat.
5225
5226 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
5227
5228         * convert.cs (ImplicitStandardConversionExists): Synchronize the
5229         code with ImplicitStandardConversion to handle the implicit
5230         conversion of method groups into valid delegate invocations. 
5231
5232         The problem is that in parameter handling we were using this code
5233         path.  Fixes bug #64698
5234
5235 2005-01-19  Raja R Harinath  <rharinath@novell.com>
5236
5237         * cs-parser.jay: Fix several infelicities.
5238         - Avoid assigning to the parser value stack.  Code like 
5239           '$3 = null' is unclean.  Synthesize a value for the code block
5240           instead. 
5241         - Avoid using oob_stack for storing location information.  Use ...
5242         (_mark_): ... this.  New (empty) rule.  Saves the current location
5243         in $$.
5244         (foreach_statement): Avoid using oob_stack for current_block
5245         handling.  Use technique used in for_statement and
5246         using_statement.  Synthesize a value for the code block to store
5247         additional intermediate information.
5248
5249 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
5250
5251         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5252         of a different type is only allowed to private fields of a
5253         containing type, not on fields of a base class.
5254
5255         See test-174.cs and error cs0122-9.cs
5256
5257 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5258
5259         Fix test-335.cs (bug #58126).
5260         * cs-parser.jay (argument): Split out non-expression parts of the
5261         rule into 'non_simple_argument'.
5262         (invocation_expression): Support parenthesized invocations with
5263         multiple arguments, and with single non-simple arguments.
5264
5265 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5266
5267         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5268         places.
5269
5270 2005-01-12  Raja R Harinath  <rharinath@novell.com>
5271
5272         Fix cs0038-1.cs, cs1640-6.cs.
5273         * ecore.cs (Expression.Resolve): Remove special-case for
5274         SimpleName in error-handling.
5275         (Expression.almostMatchedMembers): Relax access permission to
5276         protected.
5277         (Expression.MemberLookupFailed): Handle duplicates in
5278         almostMatchedMembers list.
5279         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5280         * expression.cs (New.DoResolve): Report CS1540 for more cases.
5281         * typemanager.cs (GetFullNameSignature): Use the MethodBase
5282         overload if the passed in MemberInfo is a MethodBase.
5283
5284 2005-01-25  Martin Baulig  <martin@ximian.com>
5285
5286         * doc.cs
5287         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
5288
5289 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
5290
5291         Fix #70749
5292         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5293         for non-CAS & merge permission sets properly.
5294
5295 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5296
5297         Improve standard-compliance of simple name and member access 
5298         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
5299         * ecore.cs (FullNamedExpression): New abstract base class 
5300         for Namespaces and TypeExpressions.
5301         (ResolveFlags.SimpleName): Remove.
5302         (SimpleName): Remove support for dotted names.
5303         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
5304         DeclSpace.FindType and DeclSpace.LookupType.
5305         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5306         (Expression.ExprClassName): Make member function.
5307         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5308         a namespace.  Remove creation of dotted "SimpleName"s.
5309         (MemberAccess.DoResolve): Likewise.
5310         * decl.cs (DeclSpace.Cache): Make private.
5311         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5312         (DeclSpace.FindType): Update.
5313         (DeclSpace.LookupType): Move here from RootContext.  Return a 
5314         FullNamedExpression.
5315         * namespace.cs (Namespace): Derive from FullNamedExpression
5316         so that it can be part of expression resolution.
5317         (Namespace.Lookup): Return an FullNamedExpression.
5318         (NamespaceEntry.LookupAlias): Lookup aliases only in current
5319         namespace.
5320         * rootcontext.cs (NamespaceLookup): Remove.
5321         (LookupType): Move to DeclSpace.
5322         * attribute.cs (CheckAttributeType): Update.
5323         * doc.cs (FindDocumentedType): Remove allowAlias argument.
5324         (FindDocumentedTypeNonArray): Likewise.
5325
5326 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5327
5328         Fix cs0509.cs, cs1632.cs.
5329         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5330         is the same as IsInterface.
5331         (TypeContainer.GetClassBases): Likewise.
5332         * statement.cs (LabeledStatement.ig): New field.
5333         (LabeledStatement.LabelTarget): Save ILGenerator which created the
5334         label.
5335         (LabeledStatement.DoEmit): Check that the label was created with
5336         the same ILGenerator.
5337
5338 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5339
5340         Fix #71058
5341         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
5342         accessors to its properties.
5343
5344         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
5345         from accessors to property.
5346         
5347 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5348
5349         Fix #70722
5350         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
5351         only for overrides.
5352         
5353 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
5354
5355         * attribute.cs: Check for null and empty strings.  
5356
5357         I have lost another battle to Paolo.
5358
5359 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
5360
5361         Fix #70942
5362         * class.cs (PropertyMethod): Set Parent field in ctors.
5363         (SetMethod.InternalParameters): Add unsafe switch hack.
5364         Override MarkForDuplicationCheck where it is appropriate.
5365
5366         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
5367         It says whether container allows members with the same name.
5368         Base default is no.
5369         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
5370         Removed is_method parameter.
5371
5372 2005-01-06  Duncan Mak  <duncan@ximian.com>
5373
5374         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
5375         because the previous change led to incorrect reporting of CS1032
5376         ("Cannot define/undefine preprocessor symbols after first token in
5377         file"). Instead of using `tokens_seen' as the only flag that
5378         triggers CS1040, introduce `comments_seen'. This new flag is used
5379         to signify having seen comments on the current line, so it is
5380         unset after a newline.
5381
5382 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5383
5384         * doc.cs : When searching for a type, find nested type too.
5385           This fixes bug #71040.
5386
5387 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5388
5389         * doc.cs :
5390           - Warn missing member comment on those classes which also does not
5391             have doc comments. Fixed bug #71041.
5392           - Don't warn missing doc comment on default constructor.
5393             Fixed bug #71042.
5394
5395 2005-01-06  Duncan Mak  <duncan@ximian.com>
5396
5397         * cs-tokenizer.cs (xtoken): After handling traditional C-style
5398         comments, set `tokens_seen' to true. This allows us to detect
5399         misplaced preprocessor directives (i.e. not at the beginning of
5400         the a line, nor after whitespaces). In that case, report error
5401         CS1040. This fixes bug #56460.
5402
5403         * cs-parser.jay (interface_member_declaration): Add checks for
5404         IsExplicitImpl, and report CS0541 error if an interface member is
5405         defined as an explicit interface declaration.
5406
5407 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
5408
5409         Fix #70817
5410         * class.cs (PropertyMethod): Set Parent field in ctors.
5411         (SetMethod.InternalParameters): Add unsafe switch hack.
5412         
5413         * decl.cs (MemberCore.Parent): Cannot be readonly.
5414
5415 2005-01-06  Raja R Harinath  <rharinath@novell.com>
5416
5417         * decl.cs (DeclSpace.ResolveType): Remove.
5418         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
5419         Merge in code from ...
5420         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
5421         * class.cs, enum.cs: Update to changes.
5422
5423 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
5424
5425         * anonymous.cs: Ensure that we init the scope of our parent if it
5426         has not been initialized yet.
5427
5428 2004-12-30  Duncan Mak  <duncan@ximian.com>
5429
5430         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
5431         if field.FieldBuilder is null. Fixes #70758.
5432
5433         * convert.cs: Fixed some typos and updated some of the comments.
5434         (ImplicitStandardConversionExists):
5435         (TryImplicitIntConversion): If `target_type' is an interface and
5436         the type of `ic' implements this interface, return true or a new
5437         BoxedCast instead of null. This fixes #70468.
5438
5439 2004-12-29  Duncan Mak  <duncan@ximian.com>
5440
5441         * expression.cs (Argument.Emit): Check that Expr is
5442         IMemoryLocation before casting to it, and report CS1510 otherwise.
5443
5444         This fixes #70402.
5445
5446 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
5447
5448         * statement.cs (Block.ThisVariable): remove the recursion here, to
5449         make the --profile more sane.
5450
5451 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
5452
5453         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
5454         assembly, by JB Evain.
5455
5456 2004-12-17  Raja R Harinath  <rharinath@novell.com>
5457
5458         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
5459           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
5460         "parent" refers to enclosing type/class.  "base" refers to superclass.
5461
5462 2004-12-17  Raja R Harinath  <rharinath@novell.com>
5463
5464         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5465         Ensure that we only have GlobalAttributes.
5466         * attribute.cs (Attribute.Emit): Make non-virtual.
5467         (GlobalAttribute.Emit): Remove.
5468         (Attribute.Resolve): Make virtual.
5469         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
5470         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
5471         the argument. Don't create one.
5472         (Attribute.GetObsoleteAttribute): Likewise.
5473         (Attribute.GetClsCompliantAttributeValue): Likewise.
5474         * class.cs, decl.cs: Update to changes.
5475
5476 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
5477
5478         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
5479         
5480         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
5481         
5482         * statement.cs (Foreach.Resolve): Add error 186 report.
5483
5484 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
5485
5486         * expression.cs (Conditional.DoResolve): Add warning 429.
5487         
5488         * statement.cs (If.Resolve): Add warning 665.
5489
5490 2004-12-16  Raja R Harinath  <rharinath@novell.com>
5491
5492         New invariant: RootContext.Tree.Types.NamespaceEntry == null
5493         except when in the parser, and in GlobalAttribute.
5494         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
5495         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
5496         RootContext.Tree.Types.NamespaceEntry once work is done.
5497         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
5498         and resets RootContext.Tree.Types.NamespaceEntry.
5499
5500 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
5501
5502         * cs-parser.jay: Don't create a block for every variable.
5503
5504 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
5505
5506         * location.cs: Provide extra information.
5507
5508         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
5509         variables from the captured environment, it is the ldarg_0.
5510
5511 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
5512
5513         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
5514         find a conclusion.
5515         
5516         * class.cs: Changed warning level for 169 to avoid developer
5517         displeasure from warning flooding. It will be changed back when they
5518         fix most of current BCL warnings.
5519         
5520         * RootContext.cs: Pushed default WarningLevel to 3.
5521         
5522         * statement.cs: Removed unused variable.
5523
5524 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
5525
5526         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
5527         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
5528         Add error 502 report.
5529         (StaticClass.DefineType): Add error 441 report.
5530         (Class.AllowedModifiersProp): New virtual property as temporary
5531         extension to AllowedModifiers.
5532         (Class.DefineType): Add error 418 report. Moved ModFlags check here
5533         to share implementation with StaticClass and don't call virtual
5534         methods from ctor.
5535         
5536         * driver.cs (MainDriver): Add error 1558 test.
5537
5538         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
5539         report. Moved error 36 test here.
5540
5541         * statement.cs (Throw.Resolve): Add error 724 report.
5542
5543         * typemanager.cs: Add out_attribute_type core type.
5544         
5545 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
5546
5547         * class.cs (TypeContainer.VerifyClsCompliance): Add error
5548         3018 report.
5549         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
5550
5551         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
5552         3017 report.
5553         
5554         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
5555
5556         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
5557         Add error 3023 report.
5558         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
5559
5560         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
5561         implementation.
5562
5563 2004-12-12  John Luke  <john.luke@gmail.com>
5564
5565         * driver.cs (AddArgs): take -- into account when
5566         adding arguments, fixes bug 65710 
5567
5568 2004-12-12  Martin Baulig  <martin@ximian.com>
5569
5570         * expression.cs (Unary.TryReduceNegative): Added support for
5571         SByteConstant and ByteConstant.
5572         (Unary.Reduce): Check error values from TryReduceNegative().
5573
5574 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
5575
5576         * attributes.cs (Attribute.Resolve): Avoid multiple error report
5577         and report exception as error 182.
5578
5579 2004-12-10  Raja R Harinath  <rharinath@novell.com>
5580
5581         * driver.cs (Main): Fix message when there are warnings.
5582
5583 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
5584
5585         * delegate.cs: Fixed my fix from yesterday, sorry about that.
5586
5587 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
5588
5589         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
5590         Reduced number of warnings.
5591         
5592         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
5593
5594 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
5595
5596         * driver.cs: Removed message.
5597
5598         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
5599
5600 2004-12-08    <vargaz@freemail.hu>
5601
5602         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
5603
5604 2004-12-08  Martin Baulig  <martin@ximian.com>
5605
5606         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5607         instead of a CS3002 for properties and indexer.
5608
5609 2004-12-08  Martin Baulig  <martin@ximian.com>
5610
5611         * decl.cs (MemberName.ToString): Make this work again.
5612
5613 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
5614
5615         * attribute.cs (Resolve): Add error 591 detection.
5616
5617         * class.cs (FieldMember.Define): Add error 1547 detection.
5618         (Indexer.Define): Add error 620 detection.
5619         (Operator.Define): Add error 590 detection.
5620
5621         * ecore.cs: Missing argument for error 79.
5622
5623         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
5624         detection.
5625
5626 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
5627
5628         Fix #70106
5629         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
5630         only.
5631
5632 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
5633
5634         * cs-parser.jay : handle doc comments on implicit/explicit operators.
5635           Some operator comments were suppressed.
5636         * doc.cs : Implicit/explicit operator name in doc comments are like
5637           "op_Explicit(type)~returnType", so added suffix handling.
5638
5639 2005-01-21  Alp Toker  <alp@atoker.com>
5640
5641         * cs-parser.jay: destructor_declaration's container is PartialContainer
5642         not Class when partial types are used, so use Kind prop instead of 'is'.
5643
5644 2004-12-12  Martin Baulig  <martin@ximian.com>
5645
5646         * expression.cs (Unary.TryReduceNegative): Added support for
5647         SByteConstant and ByteConstant.
5648         (Unary.Reduce): Check error values from TryReduceNegative().
5649
5650 2004-12-11  Martin Baulig  <martin@ximian.com>
5651
5652         * support.cs (ReflectionParameters.ParameterName): If we have a
5653         `gpd', call `ParameterName' on it.
5654
5655         * parameter.cs (Parameter.GetParameterAttributes): New static method.
5656
5657         * pending.cs (PendingImplementation.DefineProxy): Call
5658         DefineParameter() for all of the MethodBuilder's arguments.
5659
5660 2004-12-09  Martin Baulig  <martin@ximian.com>
5661
5662         * doc.cs (DocUtil): Make this a static class.
5663
5664 2004-12-09  Martin Baulig  <martin@ximian.com>
5665
5666         * expression.cs (Invocation.InferType): Moved the type inference
5667         implementation into TypeManager.
5668
5669         * generics.cs (TypeManager): Moved the type inference
5670         implementation here.
5671
5672 2004-12-09  Martin Baulig  <martin@ximian.com>
5673
5674         * typemanager.cs (TypeManager): Make this a partial class.
5675
5676         * generics.cs
5677         (TypeManager): Move the generics part of `TypeManager' here.
5678
5679 2004-12-08  Martin Baulig  <martin@ximian.com>
5680
5681         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5682         instead of a CS3002 for properties and indexer.  Added CS3024
5683         check for generic interfaces.
5684
5685         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
5686         instances are not CLS-compliant.
5687
5688 2004-12-08  Martin Baulig  <martin@ximian.com>
5689
5690         * cs-parser.jay
5691         (void_pointer_expression): New rule for `void*', `void**' etc.
5692         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
5693
5694 2004-12-08  Martin Baulig  <martin@ximian.com>
5695
5696         * expression.cs (Invocation.InferType): Removed the hack for
5697         MethodCore.MayUnify().  
5698
5699         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
5700         this actually work.
5701
5702         * class.cs (MethodCore.MayUnify): Use
5703         TypeManager.MayBecomeEqualGenericTypes().       
5704
5705 2004-12-08  Martin Baulig  <martin@ximian.com>
5706
5707         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
5708         parameter, box it.  Fixes #69233.
5709
5710 2004-12-08  Martin Baulig  <martin@ximian.com>
5711
5712         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
5713         have the ctor constraint.  Fixes #68326.
5714
5715 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
5716
5717         * cs-parser.jay : interface comment was not consumed because of
5718           extra opt_semicolon before doc handling.
5719
5720 2004-12-03  Raja R Harinath  <rharinath@novell.com>
5721
5722         Fix test-327.cs, test-328.cs, and put in early infrastructure
5723         for eventually fixing #52697.
5724         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
5725         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
5726         from other methods.
5727         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
5728         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
5729         (VerifyUsing, error246): Update.
5730         * rootcontext.cs (RootContext.NamespaceLookup): Just use
5731         'NamespaceEntry.LookupNamespaceOrType'.
5732
5733 2004-12-07  Martin Baulig  <martin@ximian.com>
5734
5735         * driver.cs: Call it "BETA SOFTWARE" :-)
5736
5737 2004-12-06  Raja R Harinath  <rharinath@novell.com>
5738
5739         Fix crash on cs0657-17.cs.
5740         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5741         Use RootContext.Tree.Types, not 'new RootTypes ()'.
5742         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
5743         the case where the NamespaceEntry gets overwritten.
5744
5745 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
5746
5747         Fixed #69195, #56821
5748         * ecore.cs (ResolveBoolean): Tiny refactoring.
5749
5750         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
5751         of right expression resolving when left is false constant and
5752         operator is LogicalAnd OR true constant and operator is LogicalOr.
5753
5754         * statement.cs (ResolveUnreachable): Always reports warning.
5755
5756 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
5757
5758         * class.cs: Distinguish between 1721 and 1722 (just a little help
5759         for the programmer).
5760
5761 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
5762
5763         * delegate.cs: Only allow this on new versions of the language. 
5764
5765 2004-12-02  Duncan Mak  <duncan@ximian.com>
5766
5767         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
5768         Expression class.
5769         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
5770         here as a static method. Take an additional bool out parameter
5771         `must_do_cs1540_check' for signaling to InstanceResolve.
5772         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
5773         member field from PropertyExpr class and made it an argument of
5774         the method instead.
5775         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
5776         check for MarshalByRefObject, and report CS0122 instead of CS1540.
5777         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
5778         and `remove_accessor' as well as InstanceResolve: report CS0122
5779         where applicable.
5780
5781         Fixes #70129.
5782
5783 2004-12-07  Martin Baulig  <martin@ximian.com>
5784
5785         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
5786         and CS0692 where appropriate.
5787
5788 2004-12-06  Martin Baulig  <martin@ximian.com>
5789
5790         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
5791         IsDuplicateImplementation() and improved it.
5792
5793         * expression.cs (Invocation.InferTypeArguments): Added
5794         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
5795         and removed the "ref" modifier from `infered_types'.
5796
5797         * decl.cs (MemberName.ToString): Removed the exception.
5798
5799 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
5800
5801         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
5802           comments are allowed.
5803
5804 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
5805
5806         * delegate.cs: Add checks for subtypes in paramaters and return values
5807         in VerifyMethod () to add support for Covariance/Contravariance
5808         in delegates.
5809         
5810 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
5811
5812         * report.cs: Remove extra closing parenthesis.
5813
5814         * convert.cs (Error_CannotImplicitConversion): If the name of the
5815         types are the same, provide some extra information.
5816
5817 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
5818
5819         Fix bug #70102
5820         * attribute.cs (Resolve): Improved implementation of params
5821         attribute arguments.
5822
5823         * support.cs (ParameterData): Add HasParams to be faster.
5824
5825 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
5826
5827         all things are for /doc support:
5828
5829         * doc.cs: new file that supports XML documentation generation.
5830         * mcs.exe.sources: added doc.cs.
5831         * driver.cs:
5832           Handle /doc command line option.
5833           Report error 2006 instead of 5 for missing file name for /doc.
5834           Generate XML documentation when required, after type resolution.
5835         * cs-tokenizer.cs:
5836           Added support for picking up documentation (/// and /** ... */),
5837           including a new XmlCommentState enumeration.
5838         * cs-parser.jay:
5839           Added lines to fill Documentation element for field, constant,
5840           property, indexer, method, constructor, destructor, operator, event
5841           and class, struct, interface, delegate, enum.
5842           Added lines to warn incorrect comment.
5843         * rootcontext.cs :
5844           Added Documentation field (passed only when /doc was specified).
5845         * decl.cs:
5846           Added DocComment, DocCommentHeader, GenerateDocComment() and
5847           OnGenerateDocComment() and some supporting private members for
5848           /doc feature to MemberCore.
5849         * class.cs:
5850           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
5851         * delegate.cs:
5852           Added overriden DocCommentHeader.
5853         * enum.cs:
5854           Added overriden DocCommentHeader and GenerateDocComment().
5855
5856 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
5857
5858         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
5859         unwrapping the enumeration values, chain to
5860         DoConstantNumericPromotions again, so we can promote things to the
5861         fundamental types (takes care of enums that are bytes, sbytes).
5862
5863         Fixes bug #62054.
5864
5865 2004-12-01  Raja R Harinath  <rharinath@novell.com>
5866
5867         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
5868         Fix long-standing bug in type-lookup.  Use FindType instead of
5869         LookupType when ec.ResolvingTypeTree.
5870         (Attribute.ResolveType, Attribute.Resolve)
5871         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
5872         Update to changes.
5873         (Attributes.Search): Remove internal version.  Update.
5874         (Attributes.SearchMulti): Update.
5875         (Attributes.GetClsCompliantAttribute): Remove.
5876         (Attributes.GetIndexerNameAttribute): Remove.
5877         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
5878         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
5879         * class.cs (Indexer.Define): Likewise.
5880
5881 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
5882
5883         Fix bug #68790
5884         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
5885         MarshallByReference members access.
5886
5887         * expression.cs: Use CheckMarshallByRefAccess;
5888         Better error CS0197 message.
5889
5890         * report.cs: Print whole related error message.
5891
5892 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
5893
5894         * class (GetClassBases): Better error 60 report.
5895         (EventProperty): Disabled warning 67 detection.
5896
5897 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
5898
5899         Fix bug #60324
5900         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
5901
5902         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
5903         precise values.
5904
5905 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
5906
5907         Fix bug #49488
5908         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
5909
5910         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
5911
5912 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
5913
5914         * attribute.cs (Attribute.Resolve): Refine error reporting and
5915         report a cs0117 if the identifier does not exist, to distinguish
5916         from 0617 which is a miss-use of the actual identifier.
5917
5918         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
5919         between cs0070 and cs0079.
5920
5921         * class.cs (MemberBase.DoDefine): When reporting a wrong
5922         accessibility level, we use MethodCore to compare instead of
5923         Method (this was a regression in some refactoring effort).
5924
5925         So now we correctly report cs0056 again.
5926
5927         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
5928         testing the target_type (which was known to be object_type) and
5929         not the source type (which is anonymous_method).
5930
5931         Fixed reporting of error cs1660.
5932
5933         * expression.cs (UserCast.Source): Expose the underlying cast.
5934
5935         * statement.cs (Switch.SwitchGoverningType): Sort the list of
5936         allowed types to find a match to int32 first (most common).
5937
5938         In addition, it ignores any ImplicitUserConversions that did an
5939         internal implicit conversion (as the switch statement allows only
5940         one integral conversion to exist).
5941
5942         * class.cs (PartialContainer.Create): rename `name' to
5943         `member_name' for clarity.  Then replace the string calls with a
5944         call to MemberName.GetPartialName, as now using
5945         MemberName.ToString is an error (this is due to the side effects
5946         it had, that were fixed in the past).
5947
5948         This will restore the error reporting on a number of partial class
5949         errors that were missusing this (and getting an exception as a
5950         results, which is now just a plain textual warning, because
5951         yyparse debug output would crash otherwise).
5952
5953 2004-11-26  Raja R Harinath  <rharinath@novell.com>
5954
5955         * Makefile (PROGRAM_INSTALL_DIR): Remove.
5956
5957 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
5958
5959         * rootcontext.cs (LookupType): Make sure to cache lookups that
5960         don't give us a negative result. This saves about 5% of corlib
5961         compilation time.
5962
5963 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
5964
5965         * report.cs (AbstractMessage.Print): messages are sent to stderr
5966
5967         * class.cs (TypeContainer.GetClassBases): It is an error to have a
5968         non-interface in the list of interfaces (at this point, either
5969         parent was properly set, or a base class is being listed in the
5970         interfaces section).
5971
5972         This flags error 1722, and resolves the crash from bug 69259.
5973
5974 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
5975
5976         * statement.cs (Using.EmitExpressionFinally): make this work right
5977         for valuetypes. Fixes 69926.
5978
5979 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
5980
5981         * const.cs (Const.ChangeType): Cope with the "0 literal can be
5982         converted to an enum" here, before we try to change the underlying
5983         type.  This code exists, but it is a different code path than the
5984         one used while encoding constants.
5985
5986         (ImplicitReferenceConversionExists): In addition, resynchronized
5987         the code here, so it matches the same code in
5988         ImplicitReferenceConversionExists for the `from any class-type S
5989         to any interface-type T'.       
5990
5991 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
5992
5993         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
5994
5995 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
5996
5997         * cs-parser.jay: Use verbosity accordingly. 
5998
5999 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6000
6001         * expression.cs (Unary.ResolveOperator): Do not report warning;
6002         AddressOf reads from variable.
6003         
6004         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6005
6006 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6007
6008         Fix bug #69462
6009
6010         * attribute.cs (Attributable): Removed CheckTargets.
6011         (Attributes.Emit): Explicit attribute targets are tested here.
6012
6013         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6014         not enabled for interfaces.
6015
6016         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6017         (GetAssemblyName): Ouch next bug there.
6018
6019 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6020
6021         * expression.cs: Error 275 added.
6022         
6023 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
6024
6025         Fix bug #69177 (Implemented decimal constant support)
6026
6027         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6028         (BinaryFold): Add DecimalConstant.
6029
6030         * const.cs (Define): Decimal constant 
6031         (is not constant.
6032         (ChangeType): Add decimal type handling.
6033         (LookupConstantValue): Don't set value for decimal type but
6034         emit DecimalConstantAttribute. Needed for constant optimization.
6035
6036         * constant.cs (ToDecimal): New method.
6037         (ConvertToDecimal): New method.
6038         (IntConstant): Implemented ConvertToDecimal.
6039         (DecimalConstant.Emit): Emit optimized version for decimals in
6040         int range.
6041
6042         * expression.cs (ResolveOperator): Changed order of constant
6043         reduction to work correctly with native types which have
6044         overloaded operators.
6045         (ResolveMemberAccess): Extract constant value from attribute
6046         for decimal type.
6047
6048         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6049
6050         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6051         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6052         (ChangeType): Decimal is special.
6053         (TypeToCoreType): Add decimal type.
6054
6055 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6056
6057         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6058         decimal types.
6059
6060 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6061
6062         * class.cs (EventField.ApplyAttributeBuilder): Fix error
6063         test cs1667-5.cs.
6064
6065 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6066
6067         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6068
6069         * pending.cs (PendingImplementation): Grab only interfaces.
6070
6071 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6072
6073         * statement.cs (ForeachHelperMethods): Add location member and
6074         error 202 detection.
6075
6076 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
6077
6078         * expression.cs (DoResolveBase): Fixed wrong warning for out
6079         variables.
6080
6081 2004-12-04  Martin Baulig  <martin@ximian.com>
6082
6083         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
6084         to check whether the conversion is ok.
6085
6086         * typemanager.cs (TypeManager.GetTypeArguments): Just return
6087         `Type.EmptyTypes' if we're not a generic TypeContainer.
6088
6089 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6090
6091         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6092         old bug: when converting from the null literal to a pointer,
6093         return an EmptyCast, not the NullLiteral.
6094
6095         This fixes #69921, the recent null_type changes probably made this
6096         bug more prominent.
6097
6098 2004-12-03  Martin Baulig  <martin@ximian.com>
6099
6100         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6101         method as our child, call AnonymousMethod.Compatible() on it.
6102
6103 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6104
6105         * class.cs (FieldBase): Use an unused bit field from the field to
6106         encode the `has_offset' property from the FieldMember.  This saves
6107         a couple of Ks on bootstrap compilation.
6108
6109         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6110         method as our child, return the AnonymousMethod resolved
6111         expression.
6112
6113         * expression.cs (New.DoResolve): Allow return values from
6114         NewDelegate to also include AnonymousMethods.
6115
6116         Fixes #70150.
6117
6118 2004-11-29  Raja R Harinath  <rharinath@novell.com>
6119
6120         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
6121         cs1648 report.
6122         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
6123         System.Runtime.InteropServices._Exception, since it's a base
6124         interface of the core type System.Exception in the net_2_0 profile.
6125
6126 2004-11-27  Martin Baulig  <martin@ximian.com>
6127
6128         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
6129
6130 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6131
6132         * Makefile: Convert to use executable.make.
6133         * gmcs.exe.sources: New.
6134
6135 2004-11-25  Martin Baulig  <martin@ximian.com>
6136
6137         * expression.cs (Invocation.InferType): Added support for byref types.
6138
6139 2004-11-25  Martin Baulig  <martin@ximian.com>
6140
6141         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
6142         in TypeManager.TypeToCoreType().
6143
6144 2004-11-25  Martin Baulig  <martin@ximian.com>
6145
6146         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
6147         "Dispose" method from the `current_type'.
6148         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
6149         DoDefineMembers() instead of using the MethodBuilder; this is
6150         required for generic iterators.
6151
6152         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
6153
6154 2004-11-24  Martin Baulig  <martin@ximian.com>
6155
6156         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
6157
6158 2004-11-20  Martin Baulig  <martin@ximian.com>
6159
6160         * expression.cs (Invocation.InferType): Correctly infer generic
6161         instances; see gen-103.cs.
6162         (Invocation.InferTypeArguments): If a generic method doesn't have
6163         any unbound type parameters, we don't need to infer anything.
6164
6165 2004-11-19  Raja R Harinath  <rharinath@novell.com>
6166
6167         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
6168
6169 2004-11-17  Raja R Harinath  <rharinath@novell.com>
6170
6171         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6172         (TypeHandle.GetMemberCache): New.
6173         (TypeHandle.TypeHandle): Update.
6174         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6175         (TypeManager.LookupParentInterfacesCache):
6176         Rename from LookupInterfaceCache.  Optimize slightly.
6177         (TypeManager.MemberLookup_FindMembers): Update.
6178         * decl.cs (MemberCache.MemberCache): Set Container to null in the
6179         multi-type variant.
6180         (AddCacheContents): Rename from AddHashtable.
6181         * class.cs (TypeContainer.parent_container): Remove.
6182         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6183         (TypeContainer.DoDefineMembers): Don't initialize it.
6184         Update to name changes.
6185         
6186 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
6187
6188         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6189         that factors the code to check access modifiers on override.  
6190
6191         (PropertyBase): Use the code here.
6192
6193         Patch from Lluis S'anchez, fixes bug #69361.
6194
6195 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
6196
6197         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6198         routine that is used to report the use of a captured variable
6199         whose address has been taken.
6200
6201         There are two checks: one when variables are being captured and
6202         the other check is when the address of a variable is taken. 
6203         
6204         (because an anonymous methods might be resolved before *or* after
6205         the address has been taken) and 
6206
6207         * expression.cs (Conditional.DoResolve): Remove the special
6208         casing that Martin added to trueExpr and falseExpr being both
6209         NullLiteral.  We get the right behavior now just by introducing
6210         the null_type into the compiler. 
6211
6212         * convert.cs (ExplicitConversion): Change the code to use
6213         null_type instead of testing `expr is NullLiteral'.
6214         (ImplicitConversionStandard): use null_type too.
6215         (ImplicitReferenceConversionExists): use null_type too.
6216         (ImplicitReferenceConversion): use null_type too.
6217
6218         * literal.cs: The type of `NullLiteral' is now null_type instead
6219         of object_type. 
6220         (Resolve): Set the type here.
6221
6222         * typemanager.cs: Introduce null_type.
6223
6224 2004-11-18  Martin Baulig  <martin@ximian.com>
6225
6226         * rootcontext.cs
6227         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
6228
6229 2004-11-18  Martin Baulig  <martin@ximian.com>
6230
6231         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
6232
6233 2004-11-18  Martin Baulig  <martin@ximian.com>
6234
6235         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
6236         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
6237         call ResolveConstructedType() on it to resolve it without checking
6238         constraints.
6239         (Constraints.ResolveTypes): Check them here.
6240         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
6241         but don't check constraints.
6242         (ConstructedType.ResolveAsTypeTerminal): Override this and also
6243         check constraints here.
6244         (ConstructedType.ResolveConstructedType): New public method.  This
6245         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
6246         resolve ourselves without checking constraints.
6247
6248         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
6249
6250 2004-11-18  Martin Baulig  <martin@ximian.com>
6251
6252         * decl.cs
6253         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
6254
6255         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
6256
6257 2004-11-18  Martin Baulig  <martin@ximian.com>
6258
6259         * ecore.cs (TypeExpr.ResolveType): Removed.
6260         (Expression.ResolveAsTypeTerminal): We always return a fully
6261         resolved `TypeExpr', so we can just access its `Type'.
6262
6263         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
6264
6265 2004-11-17  Martin Baulig  <martin@ximian.com>
6266
6267         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
6268         sure we don't return any unresolved TypeExpr's.
6269         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
6270         a `TypeExpr'.
6271         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
6272
6273         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
6274         unresolved `ConstructedType's.
6275
6276 2004-11-17  Martin Baulig  <martin@ximian.com>
6277
6278         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
6279
6280 2004-11-17  Martin Baulig  <martin@ximian.com>
6281
6282         * ecore.cs
6283         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
6284
6285         * decl.cs (DeclSpace.ResolveType): Removed.
6286         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
6287
6288 2004-11-17  Martin Baulig  <martin@ximian.com>
6289
6290         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6291         direction, like FindMembers() does.  Fixes #69546, testcase is in
6292         test-315.cs.    
6293
6294 2004-11-16  Martin Baulig  <martin@ximian.com>
6295
6296         This is based on a patch from Marek Safar, see bug #69082.
6297         Fixes bugs #63705 and #67130.
6298
6299         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6300         method; create a MemberCache for an interface type and cache the
6301         result.
6302
6303         * decl.cs (IMemberContainer.ParentContainer): Removed.
6304         (IMemberContainer.ParentCache): New property.
6305         (MemberCache.SetupCacheForInterface): Removed.
6306         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6307         to create a cache for an interface's "parent".
6308
6309         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6310         interfaces too.
6311
6312 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
6313
6314         * statement.cs: Avoid adding bools to a hashtable.
6315
6316 2004-11-15  Martin Baulig  <martin@ximian.com>
6317
6318         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
6319
6320 2004-11-11  Martin Baulig  <martin@ximian.com>
6321
6322         * typemanager.cs (TypeManager.GetMethodName): New method.
6323
6324         * class.cs (MethodData.Define): Include the generic arity in the
6325         name of an explicit interface; also add it to the method name.
6326
6327         * pending.cs (PendingImplementation.InterfaceMethod): The method
6328         name now includes the generic arity.
6329
6330 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
6331
6332         * expression.cs (Invocation.OverloadResolve): Flag error if we are
6333         calling an unsafe method from a safe location.
6334
6335 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
6336
6337         Fix #69167
6338         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6339
6340 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
6341
6342         * namespace.cs (VerifyUsing): use GetPartialName instead of
6343         ToString. 
6344
6345 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
6346
6347         * statement.cs (Return.Resolve): Fix regression in typo: if
6348         `in_exc', we have to request a NeedReturnLabel, this was a typo
6349         introduced in the anonymous method check-in.  Fixes #69131.
6350
6351         * Indexers were using the ShortName when defining themselves,
6352         causing a regression in the compiler bootstrap when applying the
6353         patch from 2004-11-02 (first part), now they use their full name
6354         and the bug is gone.
6355
6356 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
6357
6358         * driver.cs: Strip the path from the names of embedded resources. Fixes
6359         #68519.
6360
6361 2004-11-04  Raja R Harinath  <rharinath@novell.com>
6362
6363         Fix error message regression: cs0104-2.cs.
6364         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6365         (AliasEntry.Resolve): Update.
6366         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
6367         'silent' flag.
6368         (RootContext.LookupType): Update.
6369
6370 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
6371
6372         * cs-parser.jay: Add support for handling accessor modifiers
6373         * class: Add support port accessor modifiers and error checking,
6374         define PropertyMethod.Define as virtual (not abstract anymore)
6375         * ecore.cs: Add checking for proeprties access with access modifiers
6376         * iterators.cs: Modify Accessor constructor call based in the modified
6377         constructor
6378 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
6379
6380         * expression.cs (StringConcat): Handle being called twice,
6381         as when we have a concat in a field init with more than two
6382         ctors in the class
6383
6384 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
6385
6386         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6387         special case explicit implementations, we should always produce
6388         the .property or .event declaration.
6389         
6390         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6391         since it will not return correct data if people use this
6392         unresolved in the presence of using statements (see test-313).
6393
6394         * class.cs (MethodData.Define): If we are an explicit interface
6395         implementation, set the method name to the full name of the
6396         interface plus the name of the method.  
6397
6398         Notice that using the method.MethodName.GetFullName() does not
6399         work, as it will only contain the name as declared on the source
6400         file (it can be a shorthand in the presence of using statements)
6401         and not the fully qualifed type name, for example:
6402
6403         using System;
6404
6405         class D : ICloneable {
6406                 object ICloneable.Clone ()  {
6407                 }
6408         }
6409
6410         Would produce a method called `ICloneable.Clone' instead of
6411         `System.ICloneable.Clone'.
6412
6413         * namespace.cs (Alias.Resolve): Use GetPartialName.
6414         
6415 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6416
6417         * cs-parser.jay: Add error 1055 report.
6418
6419 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
6420
6421         * assign.cs (Assign.DoResolve): Only do the transform of
6422         assignment into a New if the types are compatible, if not, fall
6423         through and let the implicit code deal with the errors and with
6424         the necessary conversions. 
6425
6426 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6427
6428         * cs-parser.jay: Add error 1031 report.
6429
6430         * cs-tokenizer.cs: Add location for error 1038.
6431
6432 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6433
6434         * cs-parser.jay: Add error 1016 report.
6435
6436 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6437
6438         * cs-parser.jay: Add errors 1575,1611 report.
6439
6440 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6441
6442         * cs-parser.jay: Add error 1001 report.
6443
6444 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6445
6446         Fix #68850
6447         * attribute.cs (GetMarshal): Add method argument for
6448         caller identification.
6449
6450         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
6451         agument for GetMarshal and RuntimeMissingSupport.
6452
6453 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6454
6455         * attribute.cs (ExtractSecurityPermissionSet): Removed
6456         TypeManager.code_access_permission_type.
6457
6458         * typemanager.cs: Removed TypeManager.code_access_permission_type.
6459
6460 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
6461
6462         * expression.cs (LocalVariableReference.DoResolveLValue): Check
6463         for obsolete use of a variable here.   Fixes regression on errors
6464         cs0619-25 and cs0619-26.
6465
6466 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
6467
6468         Fix #62358, implemented security attribute encoding.
6469
6470         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
6471         Tests permitted SecurityAction for assembly or other types.
6472         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
6473         data from SecurityPermissionAttribute to PermisionSet class.
6474
6475         * class.cs (ApplyAttributeBuilder): Added special handling
6476         for System.Security.Permissions.SecurityAttribute based types.
6477
6478         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
6479         special handling for System.Security.Permissions.SecurityAttribute
6480         based types.
6481
6482         * enum.cs (ApplyAttributeBuilder): Added special handling
6483         for System.Security.Permissions.SecurityAttribute based types.
6484
6485         * parameter.cs (ApplyAttributeBuilder): Added special handling
6486         for System.Security.Permissions.SecurityAttribute based types.
6487
6488         * rootcontext.cs: Next 2 core types.
6489
6490         * typemanager.cs (TypeManager.security_permission_attr_type):
6491         Built in type for the SecurityPermission Attribute.
6492         (code_access_permission_type): Build in type.
6493
6494 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
6495
6496         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
6497         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
6498         all of this information into
6499         EmitContext.EmitCapturedVariableInstance.
6500         
6501         * codegen.cs (EmitCapturedVariableInstance): move here the
6502         funcionality of emitting an ldarg.0 in the presence of a
6503         remapping.   This centralizes the instance emit code.
6504
6505         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
6506         then emit a load of this: it means that we have reached the
6507         topmost ScopeInfo: the one that contains the pointer to the
6508         instance of the class hosting the anonymous method.
6509
6510         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
6511         captures to the topmost CaptureContext.
6512
6513 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
6514
6515         * expression.cs (LocalVariableReference): Move the knowledge about
6516         the iterators into codegen's EmitCapturedVariableInstance.
6517
6518 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
6519
6520         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
6521         all code paths return a value from an anonymous method (it is the
6522         same as the 161 error, but for anonymous methods).
6523
6524 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
6525
6526         The introduction of anonymous methods in the compiler changed
6527         various ways of doing things in the compiler.  The most
6528         significant one is the hard split between the resolution phase
6529         and the emission phases of the compiler.
6530
6531         For instance, routines that referenced local variables no
6532         longer can safely create temporary variables during the
6533         resolution phase: they must do so from the emission phase,
6534         since the variable might have been "captured", hence access to
6535         it can not be done with the local-variable operations from the runtime.
6536         
6537         * statement.cs 
6538
6539         (Block.Flags): New flag `IsTopLevel' to indicate that this block
6540         is a toplevel block.
6541
6542         (ToplevelBlock): A new kind of Block, these are the blocks that
6543         are created by the parser for all toplevel method bodies.  These
6544         include methods, accessors and anonymous methods.
6545
6546         These contain some extra information not found in regular blocks:
6547         A pointer to an optional CaptureContext (for tracking captured
6548         local variables and parameters).  A pointer to the parent
6549         ToplevelBlock.
6550         
6551         (Return.Resolve): Catch missmatches when returning a value from an
6552         anonymous method (error 1662).
6553         Invoke NeedReturnLabel from the Resolve phase instead of the emit
6554         phase.
6555
6556         (Break.Resolve): ditto.
6557
6558         (SwitchLabel): instead of defining the labels during the
6559         resolution phase, we now turned the public ILLabel and ILLabelCode
6560         labels into methods called GetILLabelCode() and GetILLabel() that
6561         only define the label during the Emit phase.
6562
6563         (GotoCase): Track the SwitchLabel instead of the computed label
6564         (its contained therein).  Emit the code by using
6565         SwitchLabel.GetILLabelCode ().
6566
6567         (LocalInfo.Flags.Captured): A new flag has been introduce to track
6568         whether the Local has been captured or not.
6569
6570         (LocalInfo.IsCaptured): New property, used to tell whether the
6571         local has been captured.
6572         
6573         * anonymous.cs: Vastly updated to contain the anonymous method
6574         support.
6575
6576         The main classes here are: CaptureContext which tracks any
6577         captured information for a toplevel block and ScopeInfo used to
6578         track the activation frames for various local variables.   
6579
6580         Each toplevel block has an optional capture context associated
6581         with it.  When a method contains an anonymous method both the
6582         toplevel method and the anonymous method will create a capture
6583         context.   When variables or parameters are captured, they are
6584         recorded on the CaptureContext that owns them, for example:
6585
6586         void Demo () {
6587              int a;
6588              MyDelegate d = delegate {
6589                  a = 1;
6590              }
6591         }
6592
6593         Here `a' will be recorded as captured on the toplevel
6594         CapturedContext, the inner captured context will not have anything
6595         (it will only have data if local variables or parameters from it
6596         are captured in a nested anonymous method.
6597
6598         The ScopeInfo is used to track the activation frames for local
6599         variables, for example:
6600
6601         for (int i = 0; i < 10; i++)
6602                 for (int j = 0; j < 10; j++){
6603                    MyDelegate d = delegate {
6604                         call (i, j);
6605                    }
6606                 }
6607
6608         At runtime this captures a single captured variable `i', but it
6609         captures 10 different versions of the variable `j'.  The variable
6610         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
6611         recorded on a child.  
6612
6613         The toplevel ScopeInfo will also track information like the `this'
6614         pointer if instance variables were referenced (this is necessary
6615         as the anonymous method lives inside a nested class in the host
6616         type of the method). 
6617
6618         (AnonymousMethod): Expanded to track the Toplevel, implement
6619         `AnonymousMethod.Compatible' to tell whether an anonymous method
6620         can be converted to a target delegate type. 
6621
6622         The routine now also produces the anonymous method content
6623
6624         (AnonymousDelegate): A helper class that derives from
6625         DelegateCreation, this is used to generate the code necessary to
6626         produce the delegate for the anonymous method that was created. 
6627
6628         * assign.cs: API adjustments for new changes in
6629         Convert.ImplicitStandardConversionExists.
6630
6631         * class.cs: Adjustments to cope with the fact that now toplevel
6632         blocks are of type `ToplevelBlock'. 
6633
6634         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
6635         insteda of standard blocks.
6636
6637         Flag errors if params arguments are passed to anonymous methods.
6638
6639         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
6640         `CurrentAnonymousMethod' which points to the current Anonymous
6641         Method.  The variable points to the AnonymousMethod class that
6642         holds the code being compiled.  It is set in the new EmitContext
6643         created for the anonymous method.
6644
6645         (EmitContext.Phase): Introduce a variable and an enumeration to
6646         assist in enforcing some rules about when and where we are allowed
6647         to invoke certain methods (EmitContext.NeedsReturnLabel is the
6648         only one that enfonces this right now).
6649
6650         (EmitContext.HaveCaptureInfo): new helper method that returns
6651         whether we have a CapturedContext initialized.
6652
6653         (EmitContext.CaptureVariable): New method used to register that a
6654         LocalInfo must be flagged for capturing. 
6655
6656         (EmitContext.CapturedParameter): New method used to register that a
6657         parameters must be flagged for capturing. 
6658         
6659         (EmitContext.CapturedField): New method used to register that a
6660         field must be flagged for capturing. 
6661
6662         (EmitContext.HaveCapturedVariables,
6663         EmitContext.HaveCapturedFields): Return whether there are captured
6664         variables or fields. 
6665
6666         (EmitContext.EmitMethodHostInstance): This is used to emit the
6667         instance for the anonymous method.  The instance might be null
6668         (static methods), this (for anonymous methods that capture nothing
6669         and happen to live side-by-side with the current method body) or a
6670         more complicated expression if the method has a CaptureContext.
6671
6672         (EmitContext.EmitTopBlock): Routine that drives the emission of
6673         code: it will first resolve the top block, then emit any metadata
6674         and then emit the code.  The split is done so that we can extract
6675         any anonymous methods and flag any captured variables/parameters.
6676         
6677         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
6678         during this phase, the ILGenerator should not be used as labels
6679         and local variables declared here might not be accessible to any
6680         code that is part of an anonymous method.  
6681
6682         Exceptions to this include the temporary variables that are
6683         created by some statements internally for holding temporary
6684         variables. 
6685         
6686         (EmitContext.EmitMeta): New routine, in charge of emitting all the
6687         metadata for a cb
6688
6689         (EmitContext.TemporaryReturn): This method is typically called
6690         from the Emit phase, and its the only place where we allow the
6691         ReturnLabel to be defined other than the EmitMeta.  The reason is
6692         that otherwise we would have to duplicate a lot of logic in the
6693         Resolve phases of various methods that today is on the Emit
6694         phase. 
6695
6696         (EmitContext.NeedReturnLabel): This no longer creates the label,
6697         as the ILGenerator is not valid during the resolve phase.
6698
6699         (EmitContext.EmitThis): Extended the knowledge in this class to
6700         work in anonymous methods in addition to iterators. 
6701
6702         (EmitContext.EmitCapturedVariableInstance): This emits whatever
6703         code is necessary on the stack to access the instance to a local
6704         variable (the variable will be accessed as a field).
6705
6706         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
6707         EmitContext.EmitAddressOfParameter): Routines to support
6708         parameters (not completed at this point). 
6709         
6710         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
6711         will also remove the parameters.
6712
6713         * convert.cs (Convert): Define a `ConstantEC' which points to a
6714         null.  This is just to prefity some code that uses
6715         ImplicitStandardConversion code and do not have an EmitContext
6716         handy.
6717
6718         The idea is to flag explicitly that at that point in time, it is
6719         known that the conversion will not trigger the delegate checking
6720         code in implicit conversions (which requires a valid
6721         EmitContext). 
6722
6723         Everywhere: pass new EmitContext parameter since
6724         ImplicitStandardConversionExists now requires it to check for
6725         anonymous method conversions. 
6726
6727         (Convert.ImplicitStandardConversionExists): If the type of an
6728         expression is the anonymous_method_type, and the type is a
6729         delegate, we invoke the AnonymousMethod.Compatible method to check
6730         whether an implicit conversion is possible. 
6731
6732         (Convert.ImplicitConversionStandard): Only do implicit method
6733         group conversions if the language level is not ISO_1.
6734
6735         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
6736         MethodInfo for the Invoke method.  used by Delegate and
6737         AnonymousDelegate.
6738
6739         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
6740         method conversions if the target type is a delegate.
6741
6742         Removed extra debugging nops.
6743
6744         (LocalVariableReference): Turn the `local_info' into a public
6745         field. 
6746
6747         Add `prepared' field, the same hack used for FieldExprs to cope
6748         with composed assignments, as Local variables do not necessarily
6749         operate purely on the stack as they used to: they can be captured
6750         fields. 
6751
6752         Add `temp' for a temporary result, like fields.
6753
6754         Refactor DoResolve and DoResolveLValue into DoResolveBase.
6755
6756         It now copes with Local variables that are captured and emits the
6757         proper instance variable to load it from a field in the captured
6758         case. 
6759
6760         (ParameterReference.DoResolveBase): During the resolve phase,
6761         capture parameters if we are in an anonymous method.
6762
6763         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
6764         anonymous method, use the EmitContext helper routines to emit the
6765         parameter reference.
6766
6767         * iterators.cs: Set RemapToProxy to true/false during the
6768         EmitDispose class.
6769
6770         * parameters.cs (GetParameterByName): New helper method. 
6771
6772         * typemanager.cs (anonymous_method_type) a new type that
6773         represents an anonyous method.  This is always an internal type,
6774         used as a fencepost to test against the anonymous-methodness of an
6775         expression. 
6776         
6777 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
6778
6779         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
6780         561 report.
6781         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
6782
6783 2004-11-10  Martin Baulig  <martin@ximian.com>
6784
6785         * expression.cs (Invocation.BetterFunction): If two methods have
6786         equal parameter types, but only one of them is generic, the
6787         non-generic one wins.
6788         (New.DoResolve): Don't set `is_struct' to false if we're a generic
6789         instance; just use `Type.IsValueType' to determine whether
6790         something is a struct or not.
6791         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
6792         so we can be called multiple times.
6793
6794 2004-11-10  Martin Baulig  <martin@ximian.com>
6795
6796         * generic.cs (TypeParameter.DefineConstraints): New public method.
6797         (TypeParameter.CheckAccessLevel): Override this and return true.
6798         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
6799         override ResolveType() anymore.
6800         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
6801
6802 2004-11-10  Martin Baulig  <martin@ximian.com>
6803
6804         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
6805         call DeclSpace.ResolveNestedType() on it.
6806
6807 2004-11-10  Martin Baulig  <martin@ximian.com>
6808
6809         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
6810         non-null, call ParameterModifier() on it.
6811
6812 2004-11-10  Martin Baulig  <martin@ximian.com>
6813
6814         * iterators.cs
6815         (Iterators): Added `current_type' and `this_type' fields.
6816         (Iterators.DefineIterator): Create a new EmitContext and store it
6817         in `ec'; compute `this_type'.
6818
6819 2004-11-10  Martin Baulig  <martin@ximian.com>
6820
6821         * typemanager.cs
6822         (TypeManager.IsPrivateAccessible): New public method.
6823         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
6824
6825 2004-11-10  Martin Baulig  <martin@ximian.com>
6826
6827         * class.cs (TypeContainer.DefineType): Call
6828         TypeBuilder.DefineGenericParameters() before resolving the type
6829         parameters.
6830         (MethodData.parent_method): New protected field.
6831         (MethodData..ctor): Added `MethodInfo parent_method' argument.
6832         (MethodData.Define): Compute `parent_method'.
6833
6834         * decl.cs
6835         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
6836         (MemberCore.GetClsCompliantAttributeValue): Likewise.
6837         (DeclSpace.ec): New protected field; store the EmitContext here.
6838         (DeclSpace.EmitContext): New public property.
6839         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
6840         (DeclSpace.ResolveNestedType): New public method.
6841         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
6842         (DeclSpace.NestedAccessible): Added `Type tb' argument.
6843         (DeclSpace.FamilyAccessible): Likewise.
6844         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
6845         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
6846         EmitContext.
6847
6848         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
6849         field.
6850
6851         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
6852         (Enum.Emit): Don't create a new EmitContext.
6853
6854 2004-10-18  Martin Baulig  <martin@ximian.com>
6855
6856         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
6857         `Type' directly, but call ResolveType() on it.
6858         (Catch.Resolve): Likewise.
6859         (Foreach.Resolve): Likewise.
6860
6861 2004-10-18  Martin Baulig  <martin@ximian.com>
6862
6863         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
6864         `Type' directly, but call ResolveType() on it.
6865         (Probe.DoResolve): Likewise.
6866         (ArrayCreation.LookupType): Likewise.
6867         (TypeOf.DoResolve): Likewise.
6868         (SizeOf.DoResolve): Likewise.
6869
6870 2004-10-18  Raja R Harinath  <rharinath@novell.com>
6871
6872         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
6873         the ResolveType.
6874
6875 2004-10-17  John Luke  <john.luke@gmail.com>
6876
6877         * class.cs (Operator.GetSignatureForError): use CSharpName
6878
6879         * parameter.cs (Parameter.GetSignatureForError): Returns
6880         correct name even if was not defined.
6881
6882 2004-10-13  Raja R Harinath  <rharinath@novell.com>
6883
6884         Fix #65816.
6885         * class.cs (TypeContainer.EmitContext): New property.
6886         (DefineNestedTypes): Create an emitcontext for each part.
6887         (MethodCore.DoDefineParameters): Use container's emitcontext.
6888         Pass type array to InternalParameters.
6889         (MemberBase.DoDefine): Use container's emitcontext.
6890         (FieldMember.Define): Likewise.
6891         (Event.Define): Likewise.
6892         (SetMethod.GetParameterInfo): Change argument to EmitContext.
6893         Pass type array to InternalParameters.
6894         (SetIndexerMethod.GetParameterInfo): Likewise.
6895         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
6896         * delegate.cs (Define): Pass emitcontext to
6897         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
6898         array to InternalParameters.
6899         * expression.cs (ParameterReference.DoResolveBase): Pass
6900         emitcontext to GetParameterInfo.
6901         (ComposedCast.DoResolveAsTypeStep): Remove check on
6902         ec.ResolvingTypeTree.
6903         * parameter.cs (Parameter.Resolve): Change argument to
6904         EmitContext.  Use ResolveAsTypeTerminal.
6905         (Parameter.GetSignature): Change argument to EmitContext.
6906         (Parameters.ComputeSignature): Likewise.
6907         (Parameters.ComputeParameterTypes): Likewise.
6908         (Parameters.GetParameterInfo): Likewise.
6909         (Parameters.ComputeAndDefineParameterTypes): Likewise.
6910         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
6911         * support.cs (InternalParameters..ctor): Remove variant that takes
6912         a DeclSpace.
6913         * typemanager.cs (system_intptr_expr): New.
6914         (InitExpressionTypes): Initialize it.
6915
6916 2004-10-12  Chris Toshok  <toshok@ximian.com>
6917
6918         * cs-parser.jay: fix location for try_statement and catch_clause.
6919
6920 2004-10-18  Martin Baulig  <martin@ximian.com>
6921
6922         * class.cs (FieldMember.Define): Don't access the TypeExpr's
6923         `Type' directly, but call ResolveType() on it.
6924         (MemberBase.DoDefine): Likewise.
6925
6926         * expression.cs (New.DoResolve): Don't access the TypeExpr's
6927         `Type' directly, but call ResolveType() on it.
6928         (ComposedCast.DoResolveAsTypeStep): Likewise.
6929
6930         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
6931         `Type' directly, but call ResolveType() on it.
6932
6933 2004-10-17  John Luke  <john.luke@gmail.com>
6934
6935         * class.cs (Operator.GetSignatureForError): use CSharpName
6936
6937         * parameter.cs (Parameter.GetSignatureForError): Returns
6938         correct name even if was not defined.
6939
6940 2004-10-13  Raja R Harinath  <rharinath@novell.com>
6941
6942         Fix #65816.
6943         * class.cs (TypeContainer.EmitContext): New property.
6944         (DefineNestedTypes): Create an emitcontext for each part.
6945         (MethodCore.DoDefineParameters): Use container's emitcontext.
6946         Pass type array to InternalParameters.
6947         (MemberBase.DoDefine): Use container's emitcontext.
6948         (FieldMember.Define): Likewise.
6949         (Event.Define): Likewise.
6950         (SetMethod.GetParameterInfo): Change argument to EmitContext.
6951         Pass type array to InternalParameters.
6952         (SetIndexerMethod.GetParameterInfo): Likewise.
6953         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
6954         * delegate.cs (Define): Pass emitcontext to
6955         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
6956         array to InternalParameters.
6957         * expression.cs (ParameterReference.DoResolveBase): Pass
6958         emitcontext to GetParameterInfo.
6959         (ComposedCast.DoResolveAsTypeStep): Remove check on
6960         ec.ResolvingTypeTree.
6961         * parameter.cs (Parameter.Resolve): Change argument to
6962         EmitContext.  Use ResolveAsTypeTerminal.
6963         (Parameter.GetSignature): Change argument to EmitContext.
6964         (Parameters.ComputeSignature): Likewise.
6965         (Parameters.ComputeParameterTypes): Likewise.
6966         (Parameters.GetParameterInfo): Likewise.
6967         (Parameters.ComputeAndDefineParameterTypes): Likewise.
6968         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
6969         * support.cs (InternalParameters..ctor): Remove variant that takes
6970         a DeclSpace.
6971         * typemanager.cs (system_intptr_expr): New.
6972         (InitExpressionTypes): Initialize it.
6973
6974 2004-10-12  Chris Toshok  <toshok@ximian.com>
6975
6976         * cs-parser.jay: fix location for try_statement and catch_clause.
6977
6978 2004-10-07  Raja R Harinath  <rharinath@novell.com>
6979
6980         More DeclSpace.ResolveType avoidance.
6981         * decl.cs (MemberCore.InUnsafe): New property.
6982         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
6983         with newly created EmitContext.
6984         (FieldMember.Define): Likewise.
6985         * delegate.cs (Delegate.Define): Likewise.
6986         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
6987         only if normal name-lookup fails.
6988         (TypeExpr.DoResolve): Enable error-checking.
6989         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
6990         (SizeOf.DoResolve): Likewise.
6991         (ComposedCast.DoResolveAsTypeStep): Likewise.
6992         (StackAlloc.DoResolve): Likewise.
6993         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
6994         (Block.Unsafe): New property.
6995         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
6996         (Unsafe): Set 'unsafe' flag of contained block.
6997         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
6998         (Fixed.Resolve): Likewise.
6999         (Catch.Resolve): Likewise.
7000         (Using.ResolveLocalVariableDecls): Likewise.
7001         (Foreach.Resolve): Likewise.
7002
7003 2004-10-05  John Luke <john.luke@gmail.com>
7004
7005         * cs-parser.jay: add location to error CS0175
7006
7007 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
7008
7009         * ecore.cs (Expression.Constantity): Add support for turning null
7010         into a constant.
7011
7012         * const.cs (Const.Define): Allow constants to be reference types
7013         as long as the value is Null.
7014
7015 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
7016
7017         * namespace.cs (NamespaceEntry.Using): No matter which warning
7018         level is set, check if this namespace name has already been added.
7019
7020 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
7021
7022         * expression.cs: reftype [!=]= null should always use br[true,false].
7023         # 67410
7024
7025 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
7026
7027         Fix #67108
7028         * attribute.cs: Enum conversion moved to 
7029         GetAttributeArgumentExpression to be applied to the all
7030         expressions.
7031
7032 2004-10-01  Raja R Harinath  <rharinath@novell.com>
7033
7034         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7035         * class.c (TypeContainer.DefineType): Flag error if
7036         base types aren't accessible due to access permissions.
7037         * decl.cs (DeclSpace.ResolveType): Move logic to
7038         Expression.ResolveAsTypeTerminal.
7039         (DeclSpace.ResolveTypeExpr): Thin layer over
7040         Expression.ResolveAsTypeTerminal.
7041         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7042         Refactor code into NestedAccess.  Use it.
7043         (DeclSpace.NestedAccess): New.
7044         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7045         argument to silence errors.  Check access permissions.
7046         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7047         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7048         (Cast.DoResolve): Likewise.
7049         (New.DoResolve): Likewise.
7050         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7051         (TypeOf.DoResolve): Likewise.
7052
7053         * expression.cs (Invocation.BetterConversion): Return the Type of
7054         the better conversion.  Implement section 14.4.2.3 more faithfully.
7055         (Invocation.BetterFunction): Make boolean.  Make correspondence to
7056         section 14.4.2.2 explicit.
7057         (Invocation.OverloadResolve): Update.
7058         (Invocation): Remove is_base field.
7059         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
7060         (Invocation.Emit): Likewise.
7061
7062 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
7063
7064         * cs-parser.jay: Reverted 642 warning fix.
7065
7066 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7067
7068         Fix bug #66615
7069         * decl.cs (FindMemberWithSameName): Indexer can have more than
7070         1 argument.
7071
7072 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7073
7074         * expression.cs (LocalVariableReference.DoResolveLValue):
7075         Do not report warning 219 for out values.
7076         (EmptyExpression.Null): New member to avoid extra allocations.
7077
7078 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7079
7080         * cs-parser.jay: Fix wrong warning 642 report.
7081
7082         * cs-tokenizer.cs (CheckNextToken): New helper;
7083         Inspect next character if is same as expected.
7084
7085 2004-09-23  Martin Baulig  <martin@ximian.com>
7086
7087         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7088         (Convert.ImplicitReferenceConversionExists): Likewise.
7089
7090 2004-11-09  Raja R Harinath  <rharinath@novell.com>
7091
7092         * Makefile (DISTFILES): Comment out a few missing files.
7093
7094 2004-10-29  Raja R Harinath  <rharinath@novell.com>
7095
7096         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
7097         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
7098         (gmcs.exe): Invoke bootstrap-libs.
7099         (clean-local): Clean the net_2_0_bootstrap profile too.
7100         (PROGRAM_INSTALL_DIR): New.
7101         (install-local): Use it.
7102
7103 2004-10-13  Martin Baulig  <martin@ximian.com>
7104
7105         * generic.cs (TypeManager.InflatedConstraints): New nested class.
7106         (TypeParameter.DefineType): If we're a method type parameter and
7107         that method is overriding something, "inflate" its constraints.
7108
7109 2004-10-12  Martin Baulig  <martin@ximian.com>
7110
7111         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
7112         and have type arguments, create and resolve a ConstructedType.
7113
7114 2004-10-12  Martin Baulig  <martin@ximian.com>
7115
7116         * decl.cs (MemberCache.FindMemberToOverride): Use
7117         TypeManager.IsEqual() to compare the parameters and Type.Equals()
7118         to compare the invocationType.
7119
7120         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
7121         When comparing two type parameters, only do the signature-only
7122         comparision for method type parameters.
7123
7124 2004-10-11  Martin Baulig  <martin@ximian.com>
7125
7126         * report.cs: Don't make --fatal abort on warnings, we have
7127         -warnaserror for that.
7128
7129 2004-10-11  Martin Baulig  <martin@ximian.com>
7130
7131         * typemanager.cs
7132         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
7133         (TypeManager.IsEqual): Call ourself recursively instead of using
7134         Type.IsEqual(). 
7135
7136 2004-10-11  Martin Baulig  <martin@ximian.com>
7137
7138         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
7139         on our own type parameters, not on the ones we inherit from a containing
7140         class.
7141
7142         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
7143         the comparision.
7144
7145         * generic.cs (TypeParameter.Define): We may only be called once.
7146
7147         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
7148         instead of TypeManager.IsEqual().
7149
7150 2004-09-28  Martin Baulig  <martin@ximian.com>
7151
7152         * generic.cs
7153         (GenericConstraints.EffectiveBaseClass): New public property.
7154         (TypeParameter.GenericConstraints): New public property.
7155         (ConstructedType.CheckConstraints): Improved.
7156
7157         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
7158         (Convert.TypeParameterConversion): New private method; use this in
7159         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
7160         for all conversions related to type parameters.
7161
7162 2004-09-24  Martin Baulig  <martin@ximian.com>
7163
7164         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
7165         type parameter conversions for type parameters which are known to
7166         be reference types.
7167
7168 2004-09-24  Martin Baulig  <martin@ximian.com>
7169
7170         * generic.cs (GenericConstraints): Added `IsReferenceType' and
7171         `IsValueType' properties.
7172
7173         * support.cs (ReflectionConstraints): Use
7174         Type.GetGenericParameterConstraints() instead of the old hack.
7175
7176 2004-09-24  Martin Baulig  <martin@ximian.com>
7177
7178         * generic.cs (GenericConstraints): Moved here and made it an
7179         abstract class.
7180
7181         * support.cs (GenericConstraints): Moved to generic.cs.
7182
7183 2004-09-24  Martin Baulig  <martin@ximian.com>
7184
7185         * support.cs
7186         (ReflectionConstraints): Un-nested this class and made it public.
7187
7188         * typemanager.cs
7189         (TypeManager.GetTypeParameterConstraints): New public method.
7190         (TypeManager.HasConstructorConstraint): Use the attributes.
7191
7192 2004-09-24  Martin Baulig  <martin@ximian.com>
7193
7194         * support.cs (GenericConstraints): Replaced `HasConstructor',
7195         `IsReferenceType' and `IsValueType' with `Attributes'.
7196         (ReflectionParameters.ReflectionConstraints): Removed the Create()
7197         method and made the .ctor public.
7198
7199         * generic.cs (Constraints.Attributes): New public property.
7200         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
7201         `IsReferenceType' -> `HasReferenceTypeConstraint' and
7202         `IsValueType' -> `HasValueTypeConstraint'.
7203
7204 2004-09-23  Martin Baulig  <martin@ximian.com>
7205
7206         * generic.cs (Constraints): Reflect latest runtime changes.
7207
7208 2004-09-23  Martin Baulig  <martin@ximian.com>
7209
7210         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7211         (Convert.ImplicitReferenceConversionExists): Likewise.
7212
7213 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7214
7215         * class.cs (Operator.Define): Add error 448 and 559 report.
7216         
7217 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7218
7219         * class.cs (MemberBase.IsTypePermitted): New protected
7220         method for checking error CS0610.
7221
7222 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7223
7224         * class.cs (TypeContainer.HasExplicitLayout): New property
7225         Returns whether container has StructLayout attribute set Explicit.
7226         (FieldMember): New abstract class for consts and fields.
7227         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7228         (Field): Reuse FieldMember.
7229
7230         * const.cs (Const): Reuse FieldMember.
7231
7232         * rootcontext.cs: EmitConstants call moved to class.
7233
7234 2004-09-22  Martin Baulig  <martin@ximian.com>
7235
7236         Marek and me just fixed one of our oldest bugs: #28562 :-)
7237
7238         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7239
7240         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7241         we're an EnumConstant, just return that.
7242         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7243         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
7244         to get the value which'll actually be written into the attribute.
7245         However, we have to use GetValue() to access the attribute's value
7246         in the compiler.        
7247
7248 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7249
7250         * constant.cs (Constant.IsNegative): New abstract property
7251         IsNegative.
7252
7253         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7254         (StackAlloc.DoResolve): Reused IsNegative.
7255
7256 2004-09-22  Martin Baulig  <martin@ximian.com>
7257
7258         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
7259         public method; like LookupTypeContainer, but also works for
7260         generic instances.
7261
7262         * report.cs (Report.SymbolRelatedToPreviousError): Use
7263         TypeManager.LookupGenericTypeContainer().       
7264
7265 2004-09-22  Martin Baulig  <martin@ximian.com>
7266
7267         Thanks to Peter Sestoft for this bug report.
7268
7269         * expression.cs (Conditional): If both the `trueExpr' and the
7270         `falseExpr' is a NullLiteral, return a NullLiteral.
7271
7272 2004-09-22  Martin Baulig  <martin@ximian.com>
7273
7274         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7275         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7276         for the "get_Current" call.
7277
7278 2004-09-21  Martin Baulig  <martin@ximian.com>
7279
7280         * convert.cs (Convert.ImplicitReferenceConversion): When
7281         converting to an interface type, first check whether we're
7282         converting from a reference type.
7283
7284 2004-09-14  Martin Baulig  <martin@ximian.com>
7285
7286         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7287
7288 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7289
7290         Fixed bug #61902
7291         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7292         called and is obsolete then this member suppress message
7293         when call is inside next [Obsolete] method or type.
7294
7295         * expression.cs: Use TestObsoleteMethodUsage member.
7296
7297 2004-09-14  Martin Baulig  <martin@ximian.com>
7298
7299         * genericparser.cs: Removed.
7300
7301 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
7302
7303         * class.cs (MethodCore.CheckBase): Fix bug #65757.
7304
7305 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
7306
7307         * attribute.cs (Attribute.Resolve): Add error 653 report.
7308
7309         * class.cs (Class.ApplyAttributeBuilder): Add error 641
7310         report.
7311         (Method.ApplyAttributeBuilder): Add error 685 report.
7312         (Operator.Define): Add error 564 report.
7313
7314         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7315
7316         * expression.cs (Invocation.DoResolve): Add error
7317         245 and 250 report.
7318
7319         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7320         error 674 report.
7321
7322 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7323
7324         * class.cs (ConstructorInitializer.Resolve):
7325         Wrong error number (515->516).
7326
7327 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7328
7329         * class.cs (Indexer.Define): Add error 631 report.
7330
7331 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7332
7333         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7334
7335 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7336
7337         * expression.cs (Probe.DoResolve): Add error CS0241 report.
7338
7339 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
7340
7341         * cs-parser.jay: Added error CS0241 report.
7342
7343 2004-09-10  Raja R Harinath  <rharinath@novell.com>
7344
7345         * cs-parser.jay (fixed_statement): Introduce a scope for the
7346         declaration in the 'fixed' statement.
7347
7348 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7349
7350         * cs-parser.jay: Added CS0230 error report.
7351
7352 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7353
7354         * cs-parser.jay: Added errors CS0231 and CS0257 report.
7355
7356 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7357
7358         * expression.cs (Argument.Resolve): Added error CS0192 and
7359         CS0199 report.
7360
7361 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7362
7363         C# 2.0 #pragma warning feature
7364
7365         * cs-tokenizer.cs (PreProcessPragma): New method; 
7366         Handles #pragma directive.
7367
7368         * report.cs (WarningRegions): New class; Support
7369         class for #pragma warning directive. It tests whether
7370         warning is enabled for a given line.
7371
7372 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
7373
7374         * const.cs: Add more descriptive error report, tahnks to
7375         Sebastien. 
7376
7377 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
7378
7379         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7380
7381 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
7382
7383         * expression.cs: Apply patch from Ben: Remove dead code from
7384         ArrayCreation, and remove the TurnintoConstant call in const.cs,
7385         as that code just threw an exception anwyays.
7386
7387         * const.cs: Remove the call to the turnintoconstant, for details
7388         see bug: #63144
7389         
7390         * literal.cs: The type of the null-literal is the null type;  So
7391         we use a placeholder type (literal.cs:System.Null, defined here)
7392         for it.
7393
7394         * expression.cs (Conditional.DoResolve): Remove some old code that
7395         is no longer needed, conversions have been fixed.
7396
7397         (ArrayCreationExpression.DoResolve): Return false if we fail to
7398         resolve the inner expression.
7399
7400 2004-09-07  Raja R Harinath  <rharinath@novell.com>
7401
7402         Fix test-290.cs.
7403         * cs-parser.jay (delegate_declaration): Record a delegate
7404         declaration as a type declaration.
7405         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7406
7407 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
7408
7409         * parameter.cs: Do not crash if the type can not be resolved. 
7410
7411         * expression.cs: Report errors with unsafe pointers, fixes #64896
7412
7413 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7414
7415         * expression.cs: Pointer arith always needs to do a conv.i
7416         if the operand is a long. fix 65320
7417
7418 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7419
7420         Fixed cs0619-37.cs, cs0619-38.cs
7421
7422         * enum.cs (GetObsoleteAttribute): Removed.
7423
7424         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7425         on Enum member is double staged. The first is tested member
7426         and then enum.
7427
7428 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7429
7430         Fixed #56986, #63631, #65231
7431
7432         * class.cs: (TypeContainer.AddToMemberContainer): New method,
7433         adds member to name container.
7434         (TypeContainer.AddToTypeContainer): New method, adds type to
7435         name container.
7436         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
7437         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
7438         AddOperator): Simplified by reusing AddToMemberContainer.
7439         (TypeContainer.UserDefinedStaticConstructor): Changed to property
7440         instead of field.
7441         (Method.CheckForDuplications): Fixed implementation to test all
7442         possibilities.
7443         (MemberBase): Detection whether member is explicit interface
7444         implementation is now in constructor.
7445         (MemberBase.UpdateMemberName): Handles IndexerName.
7446         (Accessor): Changed to keep also location information.
7447         (AbstractPropertyEventMethod): Is derived from MemberCore.
7448         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
7449         will be emited or not.
7450         (PropertyBase.AreAccessorsDuplicateImplementation):
7451         Tests whether accessors are not in collision with some method.
7452         (Operator): Is derived from MethodCore to simplify common
7453         operations.
7454
7455         * decl.cs (Flags.TestMethodDuplication): Test for duplication
7456         must be performed.
7457         (DeclSpace.AddToContainer): Adds the member to defined_names
7458         table. It tests for duplications and enclosing name conflicts.
7459
7460         * enum.cs (EnumMember): Clean up to reuse the base structures
7461
7462 2004-09-03  Martin Baulig  <martin@ximian.com>
7463
7464         Merged latest changes into gmcs.  Please keep this comment in
7465         here, it makes it easier for me to see what changed in MCS since
7466         the last time I merged.
7467
7468 2004-09-03  Martin Baulig  <martin@ximian.com>
7469
7470         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7471         into TypeContainer, to make partial classes work again.
7472
7473 2004-09-03  Martin Baulig  <martin@ximian.com>
7474
7475         * rootcontext.cs (RootContext.V2): Removed.
7476
7477 2004-03-23  Martin Baulig  <martin@ximian.com>
7478
7479         * expression.cs (Invocation.OverloadResolve): Added `bool
7480         may_fail' argument and use it instead of the Location.IsNull() hack.
7481
7482 2004-09-09  Martin Baulig  <martin@ximian.com>
7483
7484         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
7485
7486 2004-09-09  Martin Baulig  <martin@ximian.com>
7487
7488         * generic.cs (TypeParameter.DefineType): Added support for
7489         explicit interface methods.
7490
7491 2004-09-09  Martin Baulig  <martin@ximian.com>
7492
7493         * README.Changes: New document.  Started to list important changes
7494         between MCS and GMCS here.
7495
7496 2004-09-08  Martin Baulig  <martin@ximian.com>
7497
7498         * class.cs
7499         (TypeContainer.CheckRecursiveDefinition): New protected method.
7500         (TypeContainer.DefineType): Move the CS0146 check into
7501         CheckRecursiveDefinition().     
7502
7503 2004-09-06  Martin Baulig  <martin@ximian.com>
7504
7505         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
7506         types for the constructor constraint.
7507
7508 2004-09-03  Martin Baulig  <martin@ximian.com>
7509
7510         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7511         into TypeContainer, to make partial classes work again.
7512
7513 2004-09-03  Martin Baulig  <martin@ximian.com>
7514
7515         * rootcontext.cs (RootContext.V2): Removed.
7516
7517 2004-03-23  Martin Baulig  <martin@ximian.com>
7518
7519         * expression.cs (Invocation.OverloadResolve): Added `bool
7520         may_fail' argument and use it instead of the Location.IsNull() hack.
7521
7522 2004-09-03  Martin Baulig  <martin@ximian.com>
7523
7524         Merged latest changes into gmcs.  Please keep this comment in
7525         here, it makes it easier for me to see what changed in MCS since
7526         the last time I merged.
7527
7528 2004-09-03  Raja R Harinath  <rharinath@novell.com>
7529
7530         Fix #61128.
7531         * expression.cs (BetterConversion): Don't allow either conversion 
7532         to be null.  Remove redundant implicit conversion test when 'q ==
7533         null' -- when this function is invoked, we already know that the
7534         implicit conversion exists.
7535         (BetterFunction): Assume that 'best' is non-null.  Remove
7536         redundant reimplementation of IsApplicable when 'best' is null.
7537         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
7538         number of arguments.
7539         (IsAncestralType): Extract from OverloadResolve.
7540         (OverloadResolve): Make robust to the MethodGroupExpr being
7541         unsorted.  Implement all the logic of Section 14.5.5.1, and
7542         support overloading of methods from multiple applicable types.
7543         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
7544
7545         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
7546         (RealError, Warning): Append type of report to related symbol.
7547
7548 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
7549
7550         * enum.cs: Fixed CLS-Compliance checks for enum members.
7551         Error tests cs3008-8.cs, cs3014-8.cs
7552
7553 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
7554
7555         Fixed bug #62342, #63102
7556         * class.cs: ImplementIndexer uses member.IsExplicitImpl
7557         like ImplementMethod.
7558
7559 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
7560
7561         * attribute.cs (Attribute.GetAttributeArgumentExpression):
7562         Fixed bug #65170.
7563
7564 2004-09-02  Martin Baulig  <martin@ximian.com>
7565
7566         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7567         TypeManager.GetArgumentTypes() rather than calling GetParameters()
7568         on the MethodBase.
7569
7570 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
7571
7572         C# 2.0 Static classes implemented
7573
7574         * class.cs (TypeContainer): instance_constructors,
7575         initialized_fields, initialized_static_fields,
7576         default_constructor, base_inteface_types are protected to be
7577         accessible from StaticClass.
7578         (TypeContainer.DefineDefaultConstructor): New virtual method
7579         for custom default constructor generating
7580         (StaticClass): New class to handle "Static classes" feature.
7581
7582         * cs-parser.jay: Handle static keyword on class like instance
7583         of StaticClass.
7584
7585         * driver.cs: Added "/langversion" command line switch with two
7586         options (iso-1, default).
7587
7588 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
7589
7590         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
7591
7592 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
7593
7594         * delegate.cs: Style.
7595
7596 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7597
7598         * delegate.cs: Add seperate instance expr field for miguel.
7599
7600 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7601
7602         * PointerArithmetic (Resolve): make sure we are not doing
7603         pointer arith on void*. Also, make sure we are resolved
7604         by not setting eclass until resolve.
7605
7606         All callers: Make sure that PointerArithmetic gets resolved.
7607
7608 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7609
7610         * ArrayCreation (LookupType): If the type does not resolve 
7611         to an array, give an error.
7612
7613 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
7614
7615         * statement.cs (Try.Resolve): Fixed bug #64222
7616
7617 2004-08-27  Martin Baulig  <martin@ximian.com>
7618
7619         * class.cs
7620         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7621         crash here.     
7622
7623 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
7624
7625         * ecore.cs (Constantify): Get underlying type via
7626         System.Enum.GetUnderlyingType to avoid StackOverflow on the
7627         Windows in special cases.
7628
7629 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
7630
7631         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
7632         for obtaining also private methods.
7633         (GetRemoveMethod): Used GetRemoveMethod (true)
7634         for obtaining also private methods.
7635
7636 2004-09-02  Martin Baulig  <martin@ximian.com>
7637
7638         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7639         TypeManager.GetArgumentTypes() rather than calling GetParameters()
7640         on the MethodBase.
7641
7642 2004-08-27  Martin Baulig  <martin@ximian.com>
7643
7644         * class.cs
7645         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7646         crash here.     
7647
7648 2004-08-25  Martin Baulig  <martin@ximian.com>
7649
7650         * support.cs (ReflectionParameters..ctor): If this is a generic
7651         method, retrieve and store its type parameters.
7652         (InternalParameters..ctor): Added `TypeParameter[]' argument.
7653         (ReflectionParameters.GenericConstraints): The argument specifies
7654         the type parameter, not the method parameter.
7655         (InternalParameters.GenericConstraints): Likewise.
7656
7657         * generic.cs (TypeParameter.DefineType): Correctly handle
7658         constraints wrt. generic methods in interfaces and their
7659         implementations.        
7660
7661 2004-08-24  Martin Baulig  <martin@ximian.com>
7662
7663         * generic.cs (TypeParameter.IsSubclassOf): New public method.
7664         (Constraints.IsSubclassOf): New internal method.
7665
7666         * typemanager.cs (TypeManager.FindMembers): Added special support
7667         for GenericTypeParameterBuilder's.      
7668         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
7669         type parameters.
7670
7671 2004-08-24  Martin Baulig  <martin@ximian.com>
7672
7673         * typemanager.cs
7674         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
7675         this for accessibility checks.
7676         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
7677         IsNestedFamilyAccessible.
7678         (TypeManager.IsSubclassOf): New method, do what the name actually
7679         says.   
7680
7681 2004-08-24  Martin Baulig  <martin@ximian.com>
7682
7683         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
7684         as a SimpleName, include the generic arity.
7685
7686 2004-08-24  Martin Baulig  <martin@ximian.com>
7687
7688         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
7689         MethodAttributes.HideBySig for operators.
7690
7691 2004-08-23  Martin Baulig  <martin@ximian.com>
7692
7693         Back to the old error reporting system :-)
7694
7695         * report.cs (Message): Removed.
7696         (Report.MessageData, ErrorData, WarningData): Removed.
7697         (Report.Error, Warning): Back to the old system.
7698
7699 2004-08-23  Martin Baulig  <martin@ximian.com>
7700
7701         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
7702
7703         * class.cs (TypeContainer.ParentContainer): New public virtual
7704         method; replaces the explicit interface implementation.
7705         (ClassPart.ParentContainer): Override.
7706
7707 2004-08-23  Martin Baulig  <martin@ximian.com>
7708
7709         * statement.cs (Switch): Added support for constant switches; see
7710         #59428 or test-285.cs.
7711
7712 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
7713
7714         Fixed bug #62740.
7715         * statement.cs (GetEnumeratorFilter): Removed useless
7716         logic because C# specs is strict. GetEnumerator must be
7717         public.
7718
7719 2004-08-22  Martin Baulig  <martin@ximian.com>
7720
7721         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7722         a switch and may break, reset the barrier.  Fixes #59867.
7723
7724 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
7725
7726         CLS-Compliance speed up (~5% for corlib)
7727
7728         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
7729         New method. Tests container for CLS-Compliant names
7730
7731         * class.cs (TypeContainer.VerifyClsName): New method.
7732         Checks whether container name is CLS Compliant.
7733         (Constructor): Implements IMethodData.
7734
7735         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
7736         low-case table for CLS Compliance test.
7737         (MemberCache.VerifyClsParameterConflict): New method.
7738         Checks method parameters for CS3006 error.
7739
7740         * enum.cs (EnumMember): Is derived from MemberCore.
7741         (Enum.VerifyClsName): Optimized for better performance.
7742
7743 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
7744
7745         * report.cs: Renamed Error_T to Error and changed all
7746         references.
7747
7748 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
7749
7750         * class.cs (TypeContainer.IndexerArrayList): New inner class
7751         container for indexers.
7752         (TypeContainer.DefaultIndexerName): New constant for default
7753         indexer name. Replaced all "Item" with this constant.
7754         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
7755
7756         * typemanager.cs (TypeManager.default_member_ctor): Cache here
7757         DefaultMemberAttribute constructor.
7758
7759 2004-08-05  Martin Baulig  <martin@ximian.com>
7760
7761         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
7762         Fix bug #59429.
7763
7764 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
7765
7766         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
7767         multi platforms problem.
7768
7769         * compiler.csproj: Included shared files.
7770
7771 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7772
7773         Fix bug 60333, 55971 in the more general way
7774         * attribute.cs (Attribute.GetAttributeArgumentExpression):
7775         Added arg_type argument for constant conversion.
7776         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
7777
7778 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7779
7780         Fix bug #59760
7781         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
7782         OperatorArrayList, MethodCoreArrayList for typecontainer
7783         containers. Changed class member types to these new types.
7784         (MethodArrayList.DefineMembers): Added test for CS0659.
7785
7786 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
7787
7788         * cfold.cs: Synchronize the folding with the code in expression.cs
7789         Binary.DoNumericPromotions for uint operands.
7790
7791         * attribute.cs: Revert patch from Raja, it introduced a regression
7792         while building Blam-1.2.1 (hard to isolate a test case).
7793
7794 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7795
7796         Fix for #55382
7797         * class.cs:
7798         (TypeContainer.Define): Renamed to DefineContainerMembers because of
7799         name collision.
7800         (MethodCore.parent_method): New member. The method we're overriding
7801         if this is an override method.
7802         (MethodCore.CheckBase): Moved from Method class and made common.
7803         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
7804         private.
7805         (MethodCore.CheckForDuplications): New abstract method. For custom
7806         member duplication search in a container
7807         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
7808         method and its return type.
7809         (Event.conflict_symbol): New member. Symbol with same name in the
7810         parent class.
7811
7812         * decl.cs:
7813         (MemberCache.FindMemberWithSameName): New method. The method
7814         is looking for conflict with inherited symbols.
7815
7816 2004-08-04  Martin Baulig  <martin@ximian.com>
7817
7818         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
7819
7820         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
7821
7822 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7823
7824         * report.cs (Message): New enum for better error, warning reference in
7825         the code.
7826         (MessageData): New inner abstract class. It generally handles printing of
7827         error and warning messages.
7828         Removed unused Error, Warning, Message methods.
7829
7830 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7831
7832         Fix for cs0592-8.cs test
7833         * attribute.cs
7834         (Attributable.ValidAttributeTargets): Made public.
7835         (Attribute.ExplicitTarget): New member for explicit target value.
7836         (Attribute.CheckTargets): Now we translate explicit attribute
7837         target to Target here.
7838
7839 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
7840
7841         * ecore.cs (MethodGroupExpr): new IsBase property.
7842
7843         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
7844
7845         * delegate.cs (DelegateCreation): store a MethodGroupExpr
7846         rather than an instance expr.
7847
7848         (DelegateCreation.Emit): Use the method group rather than
7849         the instance expression. Also, if you have base.Foo as the
7850         method for a delegate, make sure to emit ldftn, not ldftnvirt.
7851
7852         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
7853
7854         (NewDelegate.DoResolve): Only check for the existance of Invoke
7855         if the method is going to be needed. Use MethodGroupExpr.
7856
7857         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
7858
7859         * expression.cs: For pointer arith., make sure to use
7860         the size of the type, not the size of the pointer to
7861         the type.
7862
7863 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7864
7865         Fix for #60722
7866         * class.cs (Class): Added error CS0502 test.
7867
7868 2004-08-03  John Luke  <jluke@cfl.rr.com>
7869             Raja R Harinath  <rharinath@novell.com>
7870
7871         Fix for #60997.
7872         * attribute.cs (Attribute.complained_before): New flag.
7873         (Attribute.ResolveType, Attribute.Resolve),
7874         (Attribute.DefinePInvokeMethod): Set it.
7875         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
7876         
7877 2004-08-03  Martin Baulig  <martin@ximian.com>
7878
7879         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
7880         use a user-defined operator; we still need to do numeric
7881         promotions in case one argument is a builtin type and the other
7882         one has an implicit conversion to that type.  Fixes #62322.
7883
7884 2004-08-18  Martin Baulig  <martin@ximian.com>
7885
7886         * class.cs (Method.Define): Use the correct method name when
7887         creating the MethodBuilder for a generic method.
7888
7889 2004-08-17  Martin Baulig  <martin@ximian.com>
7890
7891         * generic.cs (Constraints): Support type parameter constraints.
7892
7893 2004-08-16  Martin Baulig  <martin@ximian.com>
7894
7895         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
7896         (Token.GENERIC_DIMENSION): New token; this is returned if we
7897         encounter an unbound generic type in a typeof() expression.
7898
7899         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
7900         this token is only generated while parsing a typeof() expression.
7901         (typeof_expression): Removed the old unbound_type hack.
7902
7903         * generic.cs (TypeArguments.IsUnbound): New public property.
7904
7905         * decl.cs (MemberName): Added support for unbound types.
7906
7907 2004-08-14  Martin Baulig  <martin@ximian.com>
7908
7909         * typemanager.cs
7910         (TypeManager.IsEqualGenericInstance): New static method.
7911         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
7912         just used to check accessibility, so follow the rules of 26.1.6.        
7913
7914         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
7915         ConstructedType instead of a TypeExpression if we have type arguments.
7916
7917         * cs-parser.jay (typeof_expression): Support unbound generic types.
7918
7919         * ecore.cs (UnboundTypeExpression): New public class.
7920
7921 2004-08-12  Martin Baulig  <martin@ximian.com>
7922
7923         * typemanager.cs (TypeManager.IsNestedChildOf): Use
7924         TypeManager.IsEqual() rather than `=='.
7925
7926         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
7927         generic instances as well.
7928
7929 2004-08-12  Martin Baulig  <martin@ximian.com>
7930
7931         * expression.cs (Invocation.InferType): We can only infer method
7932         type parameters.  Fixes #62647.
7933
7934 2004-08-11  Martin Baulig  <martin@ximian.com>
7935
7936         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
7937         before resolving the base classes.
7938
7939 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7940
7941         * Makefile: install .mdb file too.
7942
7943 2004-08-05  Martin Baulig  <martin@ximian.com>
7944
7945         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
7946         initializer, the current type is just the TypeBuilder, not the
7947         instantiated generic type.
7948         (FieldExpr.IsFieldInitializer): New public property.
7949
7950 2004-08-04  Martin Baulig  <martin@ximian.com>
7951
7952         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
7953
7954         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
7955
7956 2004-08-03  Martin Baulig  <martin@ximian.com>
7957
7958         * class.cs (MethodData.Define): If we're an explicit
7959         implementation, remove the generic arity from the type name.
7960
7961 2004-08-03  Martin Baulig  <martin@ximian.com>
7962
7963         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
7964         use a user-defined operator; we still need to do numeric
7965         promotions in case one argument is a builtin type and the other
7966         one has an implicit conversion to that type.  Fixes #62322.
7967
7968 2004-08-02  Martin Baulig  <martin@ximian.com>
7969
7970         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
7971         `TypeExpr[]' array.
7972         (TypeContainer.GetClassBases): Return the unexpanded list of
7973         interfaces; we expand them later.
7974         (TypeContainer.DefineType): After creating the TypeBuilder, call
7975         TypeManager.ExpandInterfaces() to get an expanded and resolved
7976         list of interfaces.
7977
7978         * ecore.cs (TypeExpr.GetInterfaces): Removed
7979
7980         * generics.cs (Constraints.InterfaceConstraints): Remove.
7981         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
7982         register the interface constraints.
7983
7984         * typemanager.cs
7985         (TypeManager.AddUserType): Removed the `ifaces' argument.
7986         (TypeManager.AddTypeParameter): Likewise.
7987         (TypeManager.AddUserInterface): Removed, was unused.
7988         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
7989         `TypeExpr[]' array for the interfaces.
7990         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
7991         has been defined, returns a list of the resolved interfaces types.
7992         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
7993         (TypeManager.GetExplicitInterfaces): Likewise.  
7994
7995 2004-08-02  Martin Baulig  <martin@ximian.com>
7996
7997         * expression.cs (Invocation.EmitCall): If we're invoking a method
7998         on a type parameter, use the new `Constrained' prefix opcode.
7999
8000 2004-08-02  Martin Baulig  <martin@ximian.com>
8001
8002         * statement.cs (LocalInfo.Flags): Added `IsThis'.
8003         (LocalInfo.IsThis): New public property.
8004         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8005
8006 2004-08-01  Martin Baulig  <martin@ximian.com>
8007
8008         * class.cs (TypeContainer.GetClassBases): Don't set the default
8009         here since we may get called from GetPartialBases().
8010         (TypeContainer.DefineType): If GetClassBases() didn't return a
8011         parent, use the default one.
8012
8013 2004-07-30  Martin Baulig  <martin@ximian.com>
8014
8015         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8016
8017         * class.cs (SourceMethod): New public class, derive from the
8018         symbol writer's ISourceMethod.
8019         (Method): Use the new symbol writer API.
8020
8021         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8022         as argument and use the new symbol writer.
8023
8024         * location.cs
8025         (SourceFile): Implement the symbol writer's ISourceFile.
8026         (Location.SymbolDocument): Removed.
8027         (Location.SourceFile): New public property.
8028
8029         * symbolwriter.cs: Use the new symbol writer API.
8030
8031 2004-07-30  Raja R Harinath  <rharinath@novell.com>
8032
8033         * Makefile (install-local): Remove.  Functionality moved to
8034         executable.make.
8035
8036 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
8037
8038         * Makefile: Install mcs.exe.config file together with mcs.exe.
8039         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8040         correct runtime version.
8041         
8042 2004-07-25  Martin Baulig  <martin@ximian.com>
8043
8044         * class.cs
8045         (TypeContainer.RegisterOrder): Removed, this was unused.
8046         (TypeContainer, interface_order): Removed.
8047         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8048         TypeContainer as argument since we can also be called with a
8049         `PartialContainer' for a partial class/struct/interface.
8050         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8051         of checking whether we're an `Interface' - we could be a
8052         `PartialContainer'.
8053         (PartialContainer.Register): Override; call
8054         AddClass()/AddStruct()/AddInterface() on our parent.
8055
8056         * cs-parser.jay (interface_member_declaration): Add things to the
8057         `current_container', not the `current_class'.
8058
8059         * rootcontext.cs (RegisterOrder): The overloaded version which
8060         takes an `Interface' was unused, removed.
8061
8062         * typemanager.cs (TypeManager.LookupInterface): Return a
8063         `TypeContainer', not an `Interface'.
8064         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8065         contain a `PartialContainer' for an interface, so check it's
8066         `Kind' to figure out what it is.
8067
8068 2004-07-25  Martin Baulig  <martin@ximian.com>
8069
8070         * class.cs (Class.DefaultTypeAttributes): New public constant.
8071         (Struct.DefaultTypeAttributes): Likewise.
8072         (Interface.DefaultTypeAttributes): Likewise.
8073         (PartialContainer.TypeAttr): Override this and add the
8074         DefaultTypeAttributes.
8075
8076 2004-07-25  Martin Baulig  <martin@ximian.com>
8077
8078         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8079         we can just use the `Parent' field instead.
8080
8081 2004-07-25  Martin Baulig  <martin@ximian.com>
8082
8083         * class.cs (TypeContainer.Emit): Renamed to EmitType().
8084
8085 2004-07-25  Martin Baulig  <martin@ximian.com>
8086
8087         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8088         our parts before defining any methods.
8089         (TypeContainer.VerifyImplements): Make this virtual.
8090         (ClassPart.VerifyImplements): Override and call VerifyImplements()
8091         on our PartialContainer.
8092
8093 2004-07-25  Martin Baulig  <martin@ximian.com>
8094
8095         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8096
8097         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8098         argument, we can just use the `Parent' field instead.
8099
8100         * class.cs
8101         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
8102         (MemberBase.DoDefine): Likewise.
8103
8104 2004-07-24  Martin Baulig  <martin@ximian.com>
8105
8106         * decl.cs (MemberCore.Parent): New public field.
8107         (DeclSpace.Parent): Moved to MemberCore.
8108
8109         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8110         (MemberBase.ctor): Added TypeContainer argument, pass it to our
8111         parent's .ctor.
8112         (FieldBase, Field, Operator): Likewise.
8113         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8114         (EventField, Event): Likewise.
8115
8116 2004-07-23  Martin Baulig  <martin@ximian.com>
8117
8118         * class.cs (PartialContainer): New public class.
8119         (ClassPart): New public class.
8120         (TypeContainer): Added support for partial classes.
8121         (TypeContainer.GetClassBases): Splitted some of the functionality
8122         out into GetNormalBases() and GetPartialBases().
8123
8124         * cs-tokenizer.cs (Token.PARTIAL): New token.
8125         (Tokenizer.consume_identifier): Added some hacks to recognize
8126         `partial', but only if it's immediately followed by `class',
8127         `struct' or `interface'.
8128
8129         * cs-parser.jay: Added support for partial clases.
8130
8131 2004-07-23  Martin Baulig  <martin@ximian.com>
8132
8133         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8134         a `DeclSpace' and also made it readonly.
8135         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8136         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8137         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8138
8139         * cs-parser.jay: Pass the `current_class', not the
8140         `current_container' (at the moment, this is still the same thing)
8141         to a new Method, Property, Event, Indexer or Constructor.
8142
8143 2004-07-23  Martin Baulig  <martin@ximian.com>
8144
8145         * cs-parser.jay (CSharpParser): Added a new `current_class' field
8146         and removed the `current_interface' one.
8147         (struct_declaration, class_declaration, interface_declaration):
8148         Set `current_class' to the newly created class/struct/interface;
8149         set their `Bases' and call Register() before parsing their body.
8150
8151 2004-07-23  Martin Baulig  <martin@ximian.com>
8152
8153         * class.cs (Kind): New public enum.
8154         (TypeContainer): Made this class abstract.
8155         (TypeContainer.Kind): New public readonly field.
8156         (TypeContainer.CheckDef): New public method; moved here from
8157         cs-parser.jay.
8158         (TypeContainer.Register): New public abstract method.
8159         (TypeContainer.GetPendingImplementations): New public abstract
8160         method.
8161         (TypeContainer.GetClassBases): Removed the `is_class' and
8162         `is_iface' parameters.
8163         (TypeContainer.DefineNestedTypes): Formerly known as
8164         DoDefineType().
8165         (ClassOrStruct): Made this class abstract.
8166
8167         * tree.cs (RootTypes): New public type. 
8168
8169 2004-07-20  Martin Baulig  <martin@ximian.com>
8170
8171         * tree.cs (Tree.RecordNamespace): Removed.
8172         (Tree.Namespaces): Removed.
8173
8174         * rootcontext.cs (RootContext.IsNamespace): Removed.
8175
8176         * cs-parser.jay (namespace_declaration): Just create a new
8177         NamespaceEntry here.
8178
8179 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
8180
8181         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
8182         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
8183         entry to make sure it runs in the correct runtime version.
8184         
8185 2004-07-18  Martin Baulig  <martin@ximian.com>
8186
8187         * generic.cs (ConstructedType.CheckConstraints): Improved
8188         constraints checking.
8189
8190 2004-07-18  Martin Baulig  <martin@ximian.com>
8191
8192         * expression.cs (Invocation.BetterMethod): Call
8193         TypeManager.TypeToCoreType() on all types and removed my previous
8194         hack; we're already doig the right thing here.
8195
8196 2004-07-17  Martin Baulig  <martin@ximian.com>
8197
8198         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
8199
8200 2004-07-16  Martin Baulig  <martin@ximian.com>
8201
8202         * iterators.cs: Added generics support.
8203
8204 2004-07-16  Martin Baulig  <martin@ximian.com>
8205
8206         * iterators.cs: Rewrote this.  We're now using one single Proxy
8207         class for both the IEnumerable and the IEnumerator interface and
8208         `Iterator' derives from Class so we can use the high-level API.
8209
8210         * class.cs (TypeContainer.AddIterator): New method.
8211         (TypeContainer.DoDefineType): New protected virtual method, which
8212         is called from DefineType().
8213         (TypeContainer.DoDefineMembers): Call DefineType() and
8214         DefineMembers() on all our iterators.
8215         (TypeContainer.Emit): Call Emit() on all our iterators.
8216         (TypeContainer.CloseType): Call CloseType() on all our iterators.
8217
8218         * codegen.cs (EmitContext.CurrentIterator): New public field.
8219
8220 2004-07-15  Martin Baulig  <martin@ximian.com>
8221
8222         * typemanager.cs
8223         (TypeManager.not_supported_exception_type): New type.   
8224
8225 2004-07-14  Martin Baulig  <martin@ximian.com>
8226
8227         * typemanager.cs
8228         (TypeManager.generic_ienumerable_type): New type.
8229         (TypeManager.generic_ienumerator_type): New type.
8230
8231         * rootcontext.cs
8232         (RootContext.interfaces_first_stage): Added
8233         "System.Collections.Generic.IEnumerator`1" and
8234         "System.Collections.Generic.IEnumerable`1".     
8235
8236 2004-07-14  Martin Baulig  <martin@ximian.com>
8237
8238         * iterators.cs: Use real error numbers.
8239
8240 2004-07-14  Martin Baulig  <martin@ximian.com>
8241
8242         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8243         requires this to be a System.Collection.IEnumerable and not a
8244         class implementing that interface.
8245         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
8246
8247 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
8248
8249         * class.cs: Fixed previous fix, it broke some error tests.
8250
8251 2004-07-12  Martin Baulig  <martin@ximian.com>
8252
8253         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8254         Fixes #61293.
8255
8256 2004-07-14  Martin Baulig  <martin@ximian.com>
8257
8258         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
8259         an exclamation mark (!) for the generic arity to reflect the
8260         latest spec changes; ie. use "System.Collections.Generic.IList`1".
8261
8262 2004-07-13  Martin Baulig  <martin@ximian.com>
8263
8264         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
8265         specifiers being part of a type argument.
8266
8267 2004-07-13  Martin Baulig  <martin@ximian.com>
8268
8269         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
8270         name for generic types.
8271
8272 2004-07-13  Martin Baulig  <martin@ximian.com>
8273
8274         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
8275         bit to fix #60119.
8276
8277 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
8278
8279         * assign.cs (LocalTemporary): Add new argument: is_address,If
8280         `is_address' is true, then the value that we store is the address
8281         to the real value, and not the value itself.
8282         
8283         * ecore.cs (PropertyExpr): use the new local temporary
8284         stuff to allow us to handle X.Y += z (where X is a struct)
8285
8286 2004-07-08  Martin Baulig  <martin@ximian.com>
8287
8288         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8289         not always return, just like we're doing in Using.Resolve().
8290
8291 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
8292
8293         * cs-parser.jay (fixed_statement): flag this as Pinned.
8294
8295 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
8296
8297         * typemanager.cs (TypeManager): Removed MakePinned method, this
8298         mechanism is replaced with the .NET 2.x compatible mechanism of
8299         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8300
8301         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
8302         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8303         `IsFixed' property which has a different meaning.
8304
8305 2004-07-02  Raja R Harinath  <rharinath@novell.com>
8306
8307         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8308         visible from inside a nested class, not just the names of the
8309         immediately enclosing class.
8310         Fix for bug #60730.
8311
8312 2004-06-24  Raja R Harinath  <rharinath@novell.com>
8313
8314         * expression.cs (BetterConversion): Remove buggy special-case
8315         handling of "implicit constant expression conversions".  At this
8316         point, we already know that the conversion is possible -- we're
8317         only checking to see which is better.
8318
8319 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8320
8321         * cs-parser.jay: Added error CS0210 test.
8322
8323 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8324
8325         * cs-parser.jay: Added error CS0134 test.
8326
8327 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8328
8329         Fix bug #52507
8330         * cs-parser.jay: Added error CS0145 test.
8331
8332 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8333
8334         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8335
8336 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
8337         
8338         * expression.cs (StackAlloc.Resolve): The argument may not
8339         be a constant; deal with this case.
8340         
8341 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
8342
8343         * attribute.cs (IndexerName_GetIndexerName): Renamed to
8344         GetIndexerAttributeValue.
8345         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8346
8347         * class.cs (Indexer.Define): Added error tests for CS0415,
8348         CS0609.
8349
8350 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
8351
8352         * attribute.cs (Attribute.Resolve): Keep field code in sync with
8353         property code.
8354
8355 2004-06-23  Martin Baulig  <martin@ximian.com>
8356
8357         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8358         neither return nor throw, reset the barrier as well.  Fixes #60457.
8359
8360 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
8361
8362         * class.cs : EventAttributes is now set to None by default.
8363           This fixes bug #60459.
8364
8365 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8366
8367         Fix bug #60219
8368         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8369         Don't throw exception but return null (it's sufficient now).
8370
8371 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8372
8373         * typemanager.cs (GetArgumentTypes): Faster implementation.
8374
8375 2004-06-18  Martin Baulig  <martin@ximian.com>
8376
8377         * attribute.cs (Attribute.Resolve): Check whether we're an
8378         EmptyCast which a Constant child.  Fixes #60333.
8379
8380 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
8381
8382         * statement.cs (EmitCollectionForeach): Account for the fact that
8383         not all valuetypes are in areas which we can take the address of.
8384         For these variables, we store to a temporary variable. Also, make
8385         sure that we dont emit a `callvirt' on a valuetype method.
8386
8387 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8388
8389         * expression.cs (StackAlloc.DoReSolve): Added test for
8390         negative parameter (CS0247).
8391
8392 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8393
8394         Fix bug #59792
8395         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8396
8397 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8398
8399         Fix bug #59781
8400         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8401         ulong.
8402
8403 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8404
8405         Fix bug #58254 & cs1555.cs, cs1556.cs
8406         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8407
8408 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8409
8410         * cs-parser.jay: Added error CS1669 test for indexers.
8411
8412 2004-06-18  Martin Baulig  <martin@ximian.com>
8413
8414         * generics.cs (GenericMethod.ctor): Don't take an Attributes
8415         argument.  Fixes #60441.
8416
8417 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
8418         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
8419         The name needs to have the actual name of the method in order
8420         for other tests (such as the one in OverloadResolve for Invoke
8421         on a delegate) to work. As well, it does not really help
8422         error reporting because the method group had multiple methods.
8423         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
8424         Make profiling work.
8425         
8426 2004-06-13  Martin Baulig  <martin@ximian.com>
8427
8428         * cs-parser.jay: Don't allow generic attributes.
8429
8430 2004-06-13  Martin Baulig  <martin@ximian.com>
8431
8432         * class.cs (MemberBase.DoDefineBase): New protected method.
8433         (MemberBase.DoDefine): Compute the `flags' in the new
8434         DoDefineBase() which must be called first.
8435         (Method.Define): Call DoDefineBase() first so we have the flags
8436         when defining the generic method.
8437
8438         * cs-parser.jay (interface_method_declaration): Support generic methods.
8439
8440 2004-06-13  Martin Baulig  <martin@ximian.com>
8441
8442         * decl.cs (TypeName): Removed.
8443         (MemberName): Removed TypeName and MemberNow; now we just have
8444         MemberName.
8445
8446         * cs-parser.jay: Don't distinguish between type arguments and type
8447         parameters in the grammar and simplified the rules a bit.  The
8448         reduce/reduce conflicts are now gone (except the one we inherited
8449         from mcs).
8450
8451 2004-06-11  Martin Baulig  <martin@ximian.com>
8452
8453         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
8454         call this twice: for params and varargs methods.
8455
8456 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8457
8458         * class.cs:
8459         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
8460
8461 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8462
8463         * attribute.cs (Attribute.GetValidTargets): Made public.
8464
8465         * class.cs: 
8466         (AbstractPropertyEventMethod): New class for better code sharing.
8467         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
8468         CS1667 report.
8469         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
8470
8471 2004-06-09  Martin Baulig  <martin@ximian.com>
8472
8473         * cs-parser.jay: Removed a reduce/reduce conflict.
8474
8475 2004-06-03  Martin Baulig  <martin@ximian.com>
8476
8477         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
8478         GetSimpleName() and return a SimpleName.
8479
8480         * ecore.cs (SimpleName.Arguments): New public field.
8481         (SimpleName): Added overloaded ctor which takes an additional
8482         TypeArguments argument.
8483         (SimpleName.SimpleNameResolve): Added support for generic methods.
8484         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
8485         formerly in MemberAccess.DoResolve(), but we also need it in
8486         SimpleNameResolve().
8487
8488         * expression.cs (MemberAccess.DoResolve): Use the new
8489         MethodGroupExpr.ResolveGeneric().       
8490
8491 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8492
8493         * decl.cs: If possible, use lookuptypedirect here. We can only do
8494         this if there is no `.' after the namespace. Avoids using
8495         LookupType, which does lots of slow processing.
8496         (FindNestedType) New method, does what it says :-).
8497         * namespace.cs: use LookupTypeDirect.
8498         * rootcontext.cs: use membercache, if possible.
8499         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8500
8501 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8502
8503         * expression.cs:
8504         According to the spec, 
8505
8506         In a member access of the form E.I, if E is a single identifier,
8507         and if the meaning of E as a simple-name (§7.5.2) is a constant,
8508         field, property, localvariable, or parameter with the same type as
8509         the meaning of E as a type-name (§3.8), then both possible
8510         meanings of E are permitted.
8511
8512         We did not check that E as a simple-name had the same type as E as
8513         a type name.
8514
8515         This trivial check gives us 5-7% on bootstrap time.
8516
8517 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8518
8519         * expression.cs (Invocation.OverloadResolve): Avoid the
8520         use of hashtables and boxing here by allocating on demand.
8521
8522 2004-05-30  Martin Baulig  <martin@ximian.com>
8523
8524         * rootcontext.cs (RootContext.LookupType): Don't cache things if
8525         we're doing a silent lookup.  Don't try to lookup nested types in
8526         TypeManager.object_type (thanks to Ben Maurer).
8527
8528 2004-05-30  Martin Baulig  <martin@ximian.com>
8529
8530         Committing a patch from Ben Maurer.
8531
8532         * rootcontext.cs (RootContext.LookupType): Cache negative results.
8533
8534 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8535
8536         * convert.cs: add a trivial cache for overload operator resolution.
8537
8538 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
8539
8540         * attribute.cs
8541         (AttributeTester.GetObsoleteAttribute): Returns instance of
8542         ObsoleteAttribute when type is obsolete.
8543
8544         * class.cs
8545         (TypeContainer.VerifyObsoleteAttribute): Override.
8546         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
8547         (MethodCode.VerifyObsoleteAttribute): Override.
8548         (MemberBase.VerifyObsoleteAttribute): Override.
8549
8550         * decl.cs
8551         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
8552         and report proper error.
8553
8554         *delegate.cs
8555         (Delegate.VerifyObsoleteAttribute): Override.
8556
8557         * ecore.cs
8558         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
8559         and report proper error.
8560         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
8561
8562         * enum.cs
8563         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
8564         and enum member.
8565
8566         * expression.cs
8567         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
8568         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
8569         Added test for ObsoleteAttribute.
8570
8571         * statement.cs
8572         (Catch): Derived from Statement.
8573
8574 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8575
8576         * decl.cs: If possible, use lookuptypedirect here. We can only do
8577         this if there is no `.' after the namespace. Avoids using
8578         LookupType, which does lots of slow processing.
8579         (FindNestedType) New method, does what it says :-).
8580         * namespace.cs: use LookupTypeDirect.
8581         * rootcontext.cs: use membercache, if possible.
8582         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8583
8584 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8585
8586         * expression.cs:
8587         According to the spec, 
8588
8589         In a member access of the form E.I, if E is a single identifier,
8590         and if the meaning of E as a simple-name (§7.5.2) is a constant,
8591         field, property, localvariable, or parameter with the same type as
8592         the meaning of E as a type-name (§3.8), then both possible
8593         meanings of E are permitted.
8594
8595         We did not check that E as a simple-name had the same type as E as
8596         a type name.
8597
8598         This trivial check gives us 5-7% on bootstrap time.
8599
8600 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
8601
8602         Fixed bug #59071 & cs0160.cs
8603         * statement.cs (Try.Resolve): Check here whether order of catch
8604         clauses matches their dependencies.
8605
8606 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
8607
8608         Fixed bug #58624
8609         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
8610         unsafe type.
8611
8612 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8613
8614         * expression.cs (Invocation.OverloadResolve): Avoid the
8615         use of hashtables and boxing here by allocating on demand.
8616
8617 2004-05-30  Martin Baulig  <martin@ximian.com>
8618
8619         * rootcontext.cs (RootContext.LookupType): Don't cache things if
8620         we're doing a silent lookup.  Don't try to lookup nested types in
8621         TypeManager.object_type (thanks to Ben Maurer).
8622
8623 2004-05-30  Martin Baulig  <martin@ximian.com>
8624
8625         Committing a patch from Ben Maurer.
8626
8627         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
8628
8629 2004-05-29  Martin Baulig  <martin@ximian.com>
8630
8631         * class.cs (IMethodData.ShouldIgnore): New method.
8632
8633         * typemanager.cs (TypeManager.MethodFlags): Don't take a
8634         `Location' argument, we don't need it anywhere.  Use
8635         `IMethodData.ShouldIgnore ()' instead of
8636         `MethodData.GetMethodFlags ()'.
8637         (TypeManager.AddMethod): Removed.
8638         (TypeManager.AddMethod2): Renamed to AddMethod.
8639
8640 2004-05-29  Martin Baulig  <martin@ximian.com>
8641
8642         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
8643
8644         * convert.cs (Convert.ImplicitReferenceConversion): If we're
8645         converting from a class type S to an interface type and we already
8646         have an object on the stack, don't box it again.  Fixes #52578.
8647
8648 2004-05-29  Martin Baulig  <martin@ximian.com>
8649
8650         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8651         Added support for `params' parameters.  Fixes #59267.
8652
8653 2004-05-29  Martin Baulig  <martin@ximian.com>
8654
8655         * literal.cs (NullPointer): Provide a private .ctor which sets
8656         `type' to TypeManager.object_type.  Fixes #59048.
8657
8658 2004-05-29  Martin Baulig  <martin@ximian.com>
8659
8660         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
8661         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
8662
8663         * ecore.cs (EventExpr.instance_expr): Make the field private.
8664
8665 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
8666
8667         Fixed bug #50080 & cs0214-2.cs
8668         * expression.cs (Cast.DoResolve): Check unsafe context here.
8669         
8670         * statement.cs (Resolve.DoResolve): Likewise.
8671
8672 2004-05-26  Martin Baulig  <martin@ximian.com>
8673
8674         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
8675
8676         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
8677         (RootContext.LookupType): Pass down the `silent' flag.
8678
8679 2004-05-25  Martin Baulig  <martin@ximian.com>
8680
8681         * expression.cs
8682         (MethodGroupExpr.IdenticalTypeName): New public property.
8683         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
8684         expression actually refers to a type.
8685
8686 2004-05-25  Martin Baulig  <martin@ximian.com>
8687
8688         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
8689         for #56176 and made it actually work.
8690
8691 2004-05-25  Martin Baulig  <martin@ximian.com>
8692
8693         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
8694         (FieldExpr, PropertyExpr): Override and implement
8695         CacheTemporaries.  Fixes #52279.
8696
8697 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
8698
8699         * location.cs: In the new compiler listing a file twice is a
8700         warning, not an error.
8701
8702 2004-05-24  Martin Baulig  <martin@ximian.com>
8703
8704         * enum.cs (Enum.DefineType): For the `BaseType' to be a
8705         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
8706
8707 2004-05-24  Martin Baulig  <martin@ximian.com>
8708
8709         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
8710         walking the `using' list.  Fixes #53921.
8711
8712 2004-05-24  Martin Baulig  <martin@ximian.com>
8713
8714         * const.cs (Const.LookupConstantValue): Added support for
8715         EmptyCast's; fixes #55251.
8716
8717 2004-05-24  Martin Baulig  <martin@ximian.com>
8718
8719         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
8720         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
8721         which does the CS0135 check.  The reason is that we first need to
8722         check whether the variable actually exists.
8723
8724 2004-05-24  Martin Baulig  <martin@ximian.com>
8725
8726         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
8727         than RootContext.LookupType() to find the explicit interface
8728         type.  Fixes #58584.
8729
8730 2004-05-24  Raja R Harinath  <rharinath@novell.com>
8731
8732         * Makefile: Simplify.  Use executable.make.
8733         * mcs.exe.sources: New file.  List of sources of mcs.exe.
8734
8735 2004-05-24  Anders Carlsson  <andersca@gnome.org>
8736
8737         * decl.cs:
8738         * enum.cs:
8739         Use the invariant culture when doing String.Compare for CLS case
8740         sensitivity.
8741         
8742 2004-05-23  Martin Baulig  <martin@ximian.com>
8743
8744         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
8745         don't have any dots.  Fixes #52622, added cs0246-8.cs.
8746
8747         * namespace.cs (NamespaceEntry.Lookup): Likewise.
8748
8749 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
8750
8751         * class.cs (MemberBase.Define): Reuse MemberType member for 
8752         resolved type. Other methods can use it too.
8753
8754 2004-05-23  Martin Baulig  <martin@ximian.com>
8755
8756         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
8757         the variable also exists in the current block (otherwise, we need
8758         to report a CS0103).  Fixes #58670.
8759
8760 2004-05-23  Martin Baulig  <martin@ximian.com>
8761
8762         * flowanalysis.cs (Reachability.Reachable): Compute this
8763         on-the-fly rather than storing it as a field.
8764
8765 2004-05-23  Martin Baulig  <martin@ximian.com>
8766
8767         * flowanalysis.cs (Reachability.And): Manually compute the
8768         resulting `barrier' from the reachability.      
8769        
8770 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
8771
8772         Fix bug #57835
8773         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
8774         instance of ObsoleteAttribute when symbol is obsolete.
8775
8776         * class.cs
8777         (IMethodData): Extended interface for ObsoleteAttribute support.
8778
8779 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
8780
8781         * attribute.cs: Fix bug #55970
8782
8783 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
8784
8785         Fix bug #52705
8786         * attribute.cs
8787         (GetObsoleteAttribute): New method. Creates the instance of
8788         ObsoleteAttribute.
8789         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
8790         ObsoleteAttribute when member is obsolete.
8791         (AttributeTester.Report_ObsoleteMessage): Common method for
8792         Obsolete error/warning reporting.
8793
8794         * class.cs
8795         (TypeContainer.base_classs_type): New member for storing parent type.
8796
8797         * decl.cs
8798         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
8799         for this MemberCore.
8800
8801 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8802
8803         * attribute.cs, const.cs: Fix bug #58590
8804
8805 2004-05-21  Martin Baulig  <martin@ximian.com>
8806
8807         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
8808         out parameters if the end of the method is unreachable.  Fixes
8809         #58098. 
8810
8811 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8812
8813         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
8814         Hari was right, why extra method.
8815
8816 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8817
8818         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
8819
8820 2004-05-20  Martin Baulig  <martin@ximian.com>
8821
8822         * delegate.cs: Convert this file to Unix mode - like the original
8823         version in mcs is.
8824
8825 2004-05-20  Martin Baulig  <martin@ximian.com>
8826
8827         * attribute.cs: Convert this file to Unix mode - like the original
8828         version in mcs is.
8829
8830 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
8831
8832        Fix bug #58688 (MCS does not report error when the same attribute
8833        is assigned twice)
8834
8835        * attribute.cs (Attribute.Emit): Distinction between null and default.
8836
8837 2004-05-19  Raja R Harinath  <rharinath@novell.com>
8838
8839        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
8840        of a top-level attribute without an attribute target.
8841        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
8842        Make non-static.
8843        (Attribute.Conditional_GetConditionName), 
8844        (Attribute.Obsolete_GetObsoleteMessage): Update.
8845        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
8846        part of ScanForIndexerName.
8847        (Attribute.CanIgnoreInvalidAttribute): New function.
8848        (Attribute.ScanForIndexerName): Move to ...
8849        (Attributes.ScanForIndexerName): ... here.
8850        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
8851        (Attributes.Search): New internal variant that can choose not to
8852        complain if types aren't resolved.  The original signature now
8853        complains.
8854        (Attributes.GetClsCompliantAttribute): Use internal variant, with
8855        complaints suppressed.
8856        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
8857        only if it not useful.
8858        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
8859        top-level for attributes that are shared between the assembly
8860        and a top-level class.
8861        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
8862        * class.cs: Update to reflect changes.
8863        (DefineIndexers): Fuse loops.
8864        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
8865        a couple more variants of attribute names.
8866
8867 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
8868
8869         Fix bug #52585 (Implemented explicit attribute declaration)
8870
8871         * attribute.cs:
8872         (Attributable.ValidAttributeTargets): New abstract method. It gets
8873         list of valid attribute targets for explicit target declaration.
8874         (Attribute.Target): It holds target itself.
8875         (AttributeSection): Removed.
8876         (Attribute.CheckTargets): New method. It checks whether attribute
8877         target is valid for the current element.
8878
8879         * class.cs:
8880         (EventProperty): New class. For events that are declared like
8881         property (with add and remove accessors).
8882         (EventField): New class. For events that are declared like field.
8883         class.cs
8884
8885         * cs-parser.jay: Implemented explicit attribute target declaration.
8886
8887         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
8888         Override ValidAttributeTargets.
8889
8890         * parameter.cs:
8891         (ReturnParameter): Class for applying custom attributes on 
8892         the return type.
8893         (ParameterAtribute): New class. Class for applying custom
8894         attributes on the parameter type.
8895
8896 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
8897
8898         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
8899         definitions. 
8900
8901         (Method): Allow UNSAFE here.
8902
8903         * modifiers.cs: Support unsafe reporting.
8904
8905 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
8906
8907         * decl.cs: Fix bug #58478.
8908
8909 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8910
8911         * statement.cs: When checking for unreachable code on an EmptyStatement,
8912         set the location. Fixes bug #58488.
8913
8914 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
8915
8916         * driver.cs: Add -pkg handling.
8917
8918         From Gonzalo: UseShelLExecute=false
8919
8920 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
8921
8922         * attribute.cs:
8923         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
8924         for attribute.
8925         (Attribute.IsClsCompliaceRequired): Moved to base for better
8926         accesibility.
8927         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
8928         when attribute is AttributeUsageAttribute.
8929         (Attribute.GetValidTargets): Simplified.
8930         (Attribute.GetAttributeUsage): New method returns AttributeUsage
8931         attribute for this type.
8932         (Attribute.ApplyAttributes): Method renamed to Emit and make
8933         non-static.
8934         (GlobalAttributeSection): New class for special handling of global
8935         attributes (assembly, module).
8936         (AttributeSection.Emit): New method.
8937
8938         * class.cs: Implemented Attributable abstract methods.
8939         (MethodCore.LabelParameters): Moved to Parameter class.
8940         (Accessor): Is back simple class.
8941         (PropertyMethod): Implemented Attributable abstract class.
8942         (DelegateMethod): Implemented Attributable abstract class.
8943         (Event): New constructor for disctintion between normal Event
8944         and Event with accessors.
8945
8946         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
8947
8948         * codegen.cs, const.cs, decl.cs, delegate.cs:
8949         (CommonAssemblyModulClass): Implemented Attributable abstract class
8950         and simplified.
8951
8952         * enum.cs: Implement IAttributeSupport interface.
8953         (EnumMember): New class for emum members. Implemented Attributable
8954         abstract class
8955
8956         * parameter.cs:
8957         (ParameterBase): Is abstract.
8958         (ReturnParameter): New class for easier [return:] attribute handling.
8959
8960         * typemanager.cs: Removed builder_to_attr.
8961
8962 2004-05-11  Raja R Harinath  <rharinath@novell.com>
8963
8964         Fix bug #57151.
8965         * attribute.cs (Attribute.GetPositionalValue): New function.
8966         * class.cs (TypeContainer.VerifyMembers): New function.
8967         (TypeContainer.Emit): Use it.
8968         (ClassOrStruct): New base class for Class and Struct.
8969         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
8970         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
8971         class.
8972         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
8973         then each non-static field should have a FieldOffset attribute.
8974         Otherwise, none of the fields should have a FieldOffset attribute.
8975         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
8976         and FieldOffset attributes.
8977         * typemanager.cs (TypeManager.struct_layout_attribute_type)
8978         (TypeManager.field_offset_attribute_type): New core types.
8979         (TypeManager.InitCoreTypes): Initialize them.
8980
8981 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
8982
8983         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
8984         Return correct type.
8985         From bug #58270.
8986
8987 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
8988
8989         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
8990         be implicitly converted to ulong.
8991         
8992         * expression.cs: The logic for allowing operator &, | and ^ worked
8993         was wrong, it worked before because we did not report an error in
8994         an else branch.  Fixes 57895.
8995
8996         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
8997         allow volatile fields to be reference types.
8998
8999 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
9000
9001         * driver.cs: Add support for /debug-
9002
9003 2004-05-07  Raja R Harinath  <rharinath@novell.com>
9004
9005         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
9006         Add a 'complain' parameter to silence errors.
9007         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
9008         silently overlooked type-resolutions.
9009         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9010         to reflect changes.
9011         (Attributes.Search): New function.
9012         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9013         (Attributes.GetAttributeFullName): Remove hack.
9014         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
9015         Update to reflect changes.
9016         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9017         Use Attributes.Search instead of nested loops.
9018
9019 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
9020
9021         * decl.cs:
9022         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9023         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9024         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9025
9026         * report.cs: (Report.Warning): Renamed to Warning_T because of
9027         parameter collision.
9028
9029 2004-05-05  Raja R Harinath  <rharinath@novell.com>
9030
9031         * expression.cs (MemberAccess.ResolveMemberAccess):
9032         Exit with non-zero status after Report.Error.
9033         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9034         Likewise.
9035         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9036
9037 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9038
9039         * support.cs: Don't hang when the file is empty.
9040
9041 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9042
9043         * support.cs: In SeekableStreamReader, compute the preamble size of the
9044           underlying stream. Position changes should take into account that initial
9045           count of bytes.
9046
9047 2004-05-03  Todd Berman  <tberman@sevenl.net>
9048
9049         * driver.cs: remove unused GetSysVersion function.
9050
9051 2004-05-03  Todd Berman  <tberman@sevenl.net>
9052
9053         * driver.cs: Remove the hack from saturday, as well as the hack
9054         from jackson (LoadAssemblyFromGac), also adds the CWD to the
9055         link_paths to get that bit proper.
9056
9057 2004-05-01  Todd Berman  <tberman@sevenl.net>
9058
9059         * driver.cs: Try a LoadFrom before a Load, this checks the current
9060         path. This is currently a bug in mono that is be fixed, however, this
9061         provides a workaround for now. This will be removed when the bug
9062         is fixed.
9063
9064 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
9065
9066         * CryptoConvert.cs: Updated to latest version. Fix issue with 
9067         incomplete key pairs (#57941).
9068
9069 2004-05-01  Todd Berman  <tberman@sevenl.net>
9070
9071         * driver.cs: Remove '.' from path_chars, now System.* loads properly
9072         from the GAC
9073
9074 2004-04-30  Jackson Harper  <jackson@ximian.com>
9075
9076         * codegen.cs: Open keys readonly.
9077         
9078 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9079
9080         * typemanager.cs: don't report cyclic struct layout when a struct
9081         contains 2 or more fields of the same type. Failed for Pango.AttrShape
9082         which has 2 Pango.Rectangle fields.
9083
9084 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9085
9086         * expression.cs: Handle IntPtr comparisons with IL code
9087         rather than a method call.
9088
9089 2004-04-29  Martin Baulig  <martin@ximian.com>
9090
9091         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
9092         the list of PropertyInfo's in class hierarchy and find the
9093         accessor.  Fixes #56013.
9094
9095 2004-04-29  Martin Baulig  <martin@ximian.com>
9096
9097         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9098
9099 2004-04-29  Martin Baulig  <martin@ximian.com>
9100
9101         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9102
9103         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9104
9105 2004-04-29  Martin Baulig  <martin@ximian.com>
9106
9107         * class.cs (ConstructorInitializer.Resolve): Check whether the
9108         parent .ctor is accessible.  Fixes #52146.
9109
9110 2004-04-29  Martin Baulig  <martin@ximian.com>
9111
9112         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9113
9114         * statement.cs (Using.EmitLocalVariableDecls): Use
9115         TypeManager.idisposable_type, not typeof (IDisposable).
9116         (Foreach.EmitCollectionForeach): Added support for valuetypes.
9117
9118 2004-04-29  Martin Baulig  <martin@ximian.com>
9119
9120         * class.cs (Event.Define): Don't emit the field and don't set
9121         RTSpecialName and SpecialName for events on interfaces.  Fixes
9122         #57703. 
9123
9124 2004-04-29  Raja R Harinath  <rharinath@novell.com>
9125
9126         Refactor Attribute.ApplyAttributes.
9127         * attribute.cs (Attributable): New base class for objects that can
9128         have Attributes applied on them.
9129         (Attribute): Make AttributeUsage fields public.
9130         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9131         (Attribute.IsInternalCall): New property.
9132         (Attribute.UsageAttr): Convert to a public read-only property.
9133         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9134         (Attribute.ResolveType, Attribute.Resolve)
9135         (Attribute.ScanForIndexerName): Update to reflect changes.
9136         (Attribute.CheckAttributeTarget): Re-format.
9137         (Attribute.ApplyAttributes): Refactor, to various
9138         Attributable.ApplyAttributeBuilder methods.
9139         * decl.cs (MemberCore): Make Attributable.
9140         * class.cs (Accessor): Make Attributable.
9141         (MethodData.ApplyAttributes): Use proper attribute types, not
9142         attribute names.
9143         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9144         (TypeContainer.ApplyAttributeBuilder)
9145         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9146         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
9147         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9148         (Operator.ApplyAttributeBuilder): New factored-out methods.
9149         * const.cs (Const.ApplyAttributeBuilder): Likewise.
9150         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9151         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9152         * parameter.cs (ParameterBase): New Attributable base class
9153         that can also represent Return types.
9154         (Parameter): Update to the changes.
9155
9156 2004-04-29  Jackson Harper  <jackson@ximian.com>
9157
9158         * driver.cs: Prefer the corlib system version when looking for
9159         assemblies in the GAC. This is still a hack, but its a better hack
9160         now.
9161         
9162 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
9163
9164         * decl.cs, enum.cs: Improved error 3005 reporting.
9165   
9166         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9167         (related_symbols): New private member for list of symbols
9168         related to reported error/warning.
9169         
9170         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9171
9172 2004-04-29  Martin Baulig  <martin@ximian.com>
9173
9174         * ecore.cs (Expression.Constantify): If we're an enum and
9175         TypeManager.TypeToCoreType() doesn't give us another type, use
9176         t.UnderlyingSystemType.  Fixes #56178.  
9177
9178 2004-04-29  Martin Baulig  <martin@ximian.com>
9179
9180         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9181         interfaces and for each interface, only add members directly
9182         declared in that interface.  Fixes #53255.
9183
9184 2004-04-28  Martin Baulig  <martin@ximian.com>
9185
9186         * expression.cs (ConditionalLogicalOperator): Use a temporary
9187         variable for `left' to avoid that we evaluate it more than once;
9188         bug #52588.
9189
9190 2004-04-28  Martin Baulig  <martin@ximian.com>
9191
9192         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9193         `void[]' (CS1547).
9194
9195 2004-04-28  Martin Baulig  <martin@ximian.com>
9196
9197         * statement.cs (LocalInfo.Resolve): Check whether the type is not
9198         void (CS1547).
9199
9200         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9201         whether the type is not void (CS1547).
9202
9203 2004-04-28  Martin Baulig  <martin@ximian.com>
9204
9205         * expression.cs (Unary.DoResolveLValue): Override this and report
9206         CS0131 for anything but Operator.Indirection.
9207
9208 2004-04-28  Martin Baulig  <martin@ximian.com>
9209
9210         Committing a patch from Ben Maurer; see bug #50820.
9211
9212         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9213         check for classes.
9214
9215         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9216         classes.        
9217
9218 2004-04-28  Martin Baulig  <martin@ximian.com>
9219
9220         Committing a patch from Ben Maurer; see bug #50820.
9221
9222         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9223         check for classes.
9224
9225         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9226         classes.        
9227
9228 2004-04-28  Martin Baulig  <martin@ximian.com>
9229
9230         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9231         (Block.AddLabel): Call DoLookupLabel() to only search in the
9232         current block.
9233
9234 2004-04-28  Martin Baulig  <martin@ximian.com>
9235
9236         * cfold.cs (ConstantFold.BinaryFold): Added special support for
9237         comparing StringConstants and NullLiterals in Equality and Inequality.
9238
9239 2004-04-28  Jackson Harper  <jackson@ximian.com>
9240
9241         * driver.cs: Attempt to load referenced assemblies from the
9242         GAC. This is the quick and dirty version of this method that
9243         doesnt take into account versions and just takes the first
9244         canidate found. Will be good enough for now as we will not have more
9245         then one version installed into the GAC until I update this method.
9246
9247 2004-04-28  Martin Baulig  <martin@ximian.com>
9248
9249         * typemanager.cs (TypeManager.CheckStructCycles): New public
9250         static method to check for cycles in the struct layout.
9251
9252         * rootcontext.cs (RootContext.PopulateTypes): Call
9253         TypeManager.CheckStructCycles() for each TypeContainer.
9254         [Note: We only need to visit each type once.]
9255
9256 2004-04-28  Martin Baulig  <martin@ximian.com>
9257
9258         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9259
9260         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9261         success and added `out object value'.  Use a `bool resolved' field
9262         to check whether we've already been called rather than
9263         `ConstantValue != null' since this breaks for NullLiterals.
9264
9265 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9266
9267         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9268         setting of this flag, since the 'set' method may be non-public.
9269
9270 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9271
9272         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9273         check on current_vector.Block.
9274
9275 2004-04-27  Martin Baulig  <martin@ximian.com>
9276
9277         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9278         a field initializer.  Fixes #56459.
9279
9280 2004-04-27  Martin Baulig  <martin@ximian.com>
9281
9282         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9283         we're not attempting to use an indexer.  Fixes #52154.
9284
9285 2004-04-27  Martin Baulig  <martin@ximian.com>
9286
9287         * statement.cs (Return): Don't create a return label if we don't
9288         need it; reverts my change from January 20th.  Thanks to Ben
9289         Maurer for this.
9290
9291 2004-04-27  Martin Baulig  <martin@ximian.com>
9292
9293         According to the spec, `goto' can only leave a nested scope, but
9294         never enter it.
9295
9296         * statement.cs (Block.LookupLabel): Only lookup in the current
9297         block, don't recurse into parent or child blocks.
9298         (Block.AddLabel): Check in parent and child blocks, report
9299         CS0140/CS0158 if we find a duplicate.
9300         (Block): Removed this indexer for label lookups.
9301         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9302         this already does the error reporting for us.
9303
9304         * flowanalysis.cs
9305         (FlowBranching.UsageVector.Block): New public variable; may be null.
9306         (FlowBranching.CreateSibling): Added `Block' argument.
9307         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
9308         label for the target of a `goto' and check whether we're not
9309         leaving a `finally'.
9310
9311 2004-04-27  Martin Baulig  <martin@ximian.com>
9312
9313         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9314         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9315         just for returns).
9316
9317 2004-04-27  Martin Baulig  <martin@ximian.com>
9318
9319         * statement.cs (Block.AddLabel): Also check for implicit blocks
9320         and added a CS0158 check.
9321
9322 2004-04-27  Martin Baulig  <martin@ximian.com>
9323
9324         * flowanalysis.cs (FlowBranchingLoop): New class.
9325         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9326         UsageVector's instead of an ArrayList.
9327         (FlowBranching.Label): Likewise.
9328         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9329         (FlowBranching.AddBreakVector): New method.
9330
9331 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
9332
9333         * attribute.cs: Small regression fix: only convert the type if we
9334         the type is different, fixes System.Drawing build.
9335
9336 2004-04-27  Martin Baulig  <martin@ximian.com>
9337
9338         * attribute.cs (Attribute.Resolve): If we have a constant value
9339         for a named field or property, implicity convert it to the correct
9340         type.
9341
9342 2004-04-27  Raja R Harinath  <rharinath@novell.com>
9343
9344         * statement.cs (Block.Block): Implicit blocks share
9345         'child_variable_names' fields with parent blocks.
9346         (Block.AddChildVariableNames): Remove.
9347         (Block.AddVariable): Mark variable as "used by a child block" in
9348         every surrounding block.
9349         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9350         been used in a child block, complain about violation of "Invariant
9351         meaning in blocks" rule.
9352         * cs-parser.jay (declare_local_variables): Don't use
9353         AddChildVariableNames.
9354         (foreach_statement): Don't create an implicit block: 'foreach'
9355         introduces a scope.
9356
9357 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
9358
9359         * convert.cs (ImplicitNumericConversion): 0 is also positive when
9360         converting from 0L to ulong.  Fixes 57522.
9361
9362 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9363
9364         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9365         derived class hides via 'new' keyword field from base class (test-242.cs).
9366         TODO: Handle this in the more general way.
9367         
9368         * class.cs (CheckBase): Ditto.
9369
9370 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9371
9372         * decl.cs (caching_flags): New member for storing cached values
9373         as bit flags.
9374         (MemberCore.Flags): New enum where bit flags for caching_flags
9375         are defined.
9376         (MemberCore.cls_compliance): Moved to caching_flags.
9377         (DeclSpace.Created): Moved to caching_flags.
9378
9379         * class.cs: Use caching_flags instead of DeclSpace.Created
9380         
9381 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
9382
9383         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9384         if we are only a derived class, not a nested class.
9385
9386         * typemanager.cs: Same as above, but do this at the MemberLookup
9387         level (used by field and methods, properties are handled in
9388         PropertyExpr).   Allow for the qualified access if we are a nested
9389         method. 
9390
9391 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
9392
9393         * class.cs: Refactoring.
9394         (IMethodData): New inteface; Holds links to parent members
9395         to avoid member duplication (reduced memory allocation).
9396         (Method): Implemented IMethodData interface.
9397         (PropertyBase): New inner classes for get/set methods.
9398         (PropertyBase.PropertyMethod): Implemented IMethodData interface
9399         (Event): New inner classes for add/remove methods.
9400         (Event.DelegateMethod): Implemented IMethodData interface.
9401
9402         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9403         EmitContext (related to class.cs refactoring).
9404
9405 2004-04-21  Raja R Harinath  <rharinath@novell.com>
9406
9407         * delegate.cs (Delegate.VerifyApplicability): If the number of
9408         arguments are the same as the number of parameters, first try to
9409         verify applicability ignoring  any 'params' modifier on the last
9410         parameter.
9411         Fixes #56442.
9412
9413 2004-04-08  Martin Baulig  <martin@ximian.com>
9414
9415         Merged latest changes into gmcs.  Please keep this comment in
9416         here, it makes it easier for me to see what changed in MCS since
9417         the last time I merged.
9418
9419 2004-04-16  Raja R Harinath  <rharinath@novell.com>
9420
9421         * class.cs (TypeContainer.AddIndexer): Use
9422         'ExplicitInterfaceName' to determine if interface name was
9423         explicitly specified.  'InterfaceType' is not initialized at this time.
9424         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
9425         Indexers array is already in the required order.  Initialize
9426         'IndexerName' only if there are normal indexers.
9427         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
9428         (TypeContainer.Emit): Emit DefaultMember attribute only if
9429         IndexerName is initialized.
9430         Fixes #56300.
9431
9432 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
9433
9434         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
9435         Fixes #57007
9436
9437 2004-04-15  Raja R Harinath  <rharinath@novell.com>
9438
9439         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
9440         attributes.
9441         Fix for #56456.
9442
9443         * attribute.cs (Attribute.Resolve): Check for duplicate named
9444         attributes.
9445         Fix for #56463.
9446
9447 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
9448
9449         * iterators.cs (MarkYield): track whether we are in an exception,
9450         and generate code accordingly.  Use a temporary value to store the
9451         result for our state.
9452
9453         I had ignored a bit the interaction of try/catch with iterators
9454         since their behavior was not entirely obvious, but now it is
9455         possible to verify that our behavior is the same as MS .NET 2.0
9456
9457         Fixes 54814
9458
9459 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
9460
9461         * iterators.cs: Avoid creating temporaries if there is no work to
9462         do. 
9463
9464         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
9465         Enumerations, use TypeManager.EnumToUnderlying and call
9466         recursively. 
9467
9468         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
9469         bug #57013
9470
9471         (This.Emit): Use EmitContext.EmitThis to emit our
9472         instance variable.
9473
9474         (This.EmitAssign): Ditto.
9475
9476         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
9477         codepaths, we will move all the functionality into
9478         Mono.CSharp.This 
9479
9480         (FieldExpr.EmitAssign): Ditto.
9481
9482         This fixes several hidden bugs that I uncovered while doing a code
9483         review of this today.
9484
9485         * codegen.cs (EmitThis): reworked so the semantics are more clear
9486         and also support value types "this" instances.
9487
9488         * iterators.cs: Changed so that for iterators in value types, we
9489         do not pass the value type as a parameter.  
9490
9491         Initialization of the enumerator helpers is now done in the caller
9492         instead of passing the parameters to the constructors and having
9493         the constructor set the fields.
9494
9495         The fields have now `assembly' visibility instead of private.
9496
9497 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
9498
9499         * expression.cs (Argument.Resolve): Check if fields passed as ref
9500         or out are contained in a MarshalByRefObject.
9501
9502         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
9503         another compiler type.
9504
9505 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
9506
9507         * class.cs (Indexer.Define): use the new name checking method.
9508         Also, return false on an error.
9509         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
9510         (is_identifier_[start/part]_character): make static.
9511
9512 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
9513
9514         * expression.cs (Binary.ResolveOperator): Do no append strings
9515         twice: since we can be invoked more than once (array evaluation)
9516         on the same concatenation, take care of this here.  Based on a fix
9517         from Ben (bug #56454)
9518
9519 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
9520
9521         * codegen.cs: Fix another case where CS1548 must be reported (when 
9522         delay-sign isn't specified and no private is available #56564). Fix
9523         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
9524         error when MCS is used on the MS runtime and we need to delay-sign 
9525         (which seems unsupported by AssemblyBuilder - see #56621).
9526
9527 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
9528
9529         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
9530         (TypeManager.ComputeNamespaces): Faster implementation for
9531         Microsoft runtime.
9532
9533         * compiler.csproj: Updated AssemblyName to mcs.
9534
9535 2004-05-11  Jackson Harper  <jackson@ximian.com>
9536
9537         * Makefile: Preserve MONO_PATH
9538         
9539 2004-05-11  Jackson Harper  <jackson@ximian.com>
9540
9541         * Makefile: Use mono and mcs to build gmcs
9542         
9543 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
9544
9545         * codegen.cs: Add patch from Robert Shade
9546         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
9547         sync with mcs.
9548
9549 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
9550
9551         * CryptoConvert.cs: Updated to latest version. Fix issue with 
9552         incomplete key pairs (#57941).
9553
9554 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
9555
9556         * codegen.cs: Fix another case where CS1548 must be reported (when 
9557         delay-sign isn't specified and no private is available #56564). Fix
9558         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
9559         error when MCS is used on the MS runtime and we need to delay-sign 
9560         (which seems unsupported by AssemblyBuilder - see #56621).
9561
9562 2004-04-29  Jackson Harper  <jackson@ximian.com>
9563
9564         * Makefile: Set MONO_PATH to use the bootstrap corlib
9565         * driver.cs: Check the GAC for referenced assemblies.
9566                 
9567 2004-04-29  Martin Baulig  <martin@ximian.com>
9568
9569         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
9570
9571 2004-04-07  Martin Baulig  <martin@ximian.com>
9572
9573         * expression.cs (Binary.ResolveOperator): Added special case for
9574         Equality/Inequality between a type parameter and a null literal.
9575
9576 2004-04-07  Martin Baulig  <martin@ximian.com>
9577
9578         * convert.cs: Check null literal -> type parameter conversions.
9579
9580 2004-04-07  Martin Baulig  <martin@ximian.com>
9581
9582         * generic.cs (ConstructedType.CheckConstraints): Enforce the
9583         `class' and `struct' constraints.
9584
9585 2004-04-07  Martin Baulig  <martin@ximian.com>
9586
9587         * generic.cs (SpecialConstraint): New public enum.
9588         (Constraints.Resolve): Added support for the `class' and `struct'
9589         constraints.
9590
9591         * cs-parser.jay (type_parameter_constraint): Added support for the
9592         `class' and `struct' constraints.
9593
9594 2004-04-07  Martin Baulig  <martin@ximian.com>
9595
9596         * support.cs (GenericConstraints): Replaced `Types' by
9597         `ClassConstraint' and `InterfaceConstraints'; added
9598         `HasClassConstraint'.   
9599
9600 2004-04-07  Martin Baulig  <martin@ximian.com>
9601
9602         * generic.cs
9603         (Constraints.InterfaceConstraints): New public property.
9604         (Constraints.Types): Make this property public
9605         (TypeParameter): Implement IMemberContainer.
9606         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
9607         instead of a TypeBuilder/MethodBuilder; pass the interface
9608         constraints to TypeManager.AddTypeParameter().
9609         (TypeParameter.DefineType): Just take an EmitContext and no
9610         TypeBuilder/MethodBuilder.  Use the new public API.
9611
9612         * typemanager.cs (TypeManager.AddTypeParameter): Added
9613         `TypeExpr[]' argument; add the interfaces to the
9614         `builder_to_ifaces' hash.
9615         (TypeManager.LookupMemberContainer): For
9616         GenericTypeParameterBuilders, get the TypeParameter from the
9617         `builder_to_type_param'.
9618         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
9619         the TypeParameter and call FindMembers on it.
9620
9621 2004-04-07  Martin Baulig  <martin@ximian.com>
9622
9623         * class.cs
9624         (MethodCore.GenericMethod): Moved this field here from Method.
9625         (MethodCore.IsDuplicateImplementation): Take the number of type
9626         parameters into account if we're a generic method.
9627
9628         * expression.cs (Invocation.InferTypeArguments): Don't return true
9629         if `arguments' is null; we still need to check whether we actually
9630         don't need to infer anything in this case.
9631         (MemberAccess): Merged the functionality from GenericMemberAccess
9632         into this class.
9633
9634         * generic.cs (GenericMemberAccess): Removed.
9635
9636 2004-04-05  Martin Baulig  <martin@ximian.com>
9637
9638         * decl.cs (MemberCore): For generic classes, interfaces and
9639         structs, `Name' now includes the number of type parameters
9640         ("Stack!1.Node!1").
9641         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
9642         encode the number of type arguments in the type name.
9643
9644         * expression.cs (Expression.MemberLookup): Removed the
9645         `num_type_args' argument; we now encode the number of type
9646         arguments in the type name.
9647
9648         * ecore.cs (SimpleName): Encode the number of type arguments in
9649         the type name itself.
9650
9651         * generic.cs (ConstructedType): Likewise.
9652
9653         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
9654         `MemberName'; we now include the number of type parameters in the
9655         type name.
9656
9657         * typemanager.cs (TypeManager.CheckGeneric): Removed.
9658         (TypeManager.MemberLookup): Removed the
9659         `num_type_args' argument; we now encode the number of type
9660         arguments in the type name.     
9661
9662 2004-04-03  Martin Baulig  <martin@ximian.com>
9663
9664         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
9665         (MemberCore.MemberName): Moved here from MemberBase.
9666         (DeclSpace.SetParameterInfo): Just take the constraints as an
9667         ArrayList; we already have the type parameters in our
9668         `MemberName'; also do the CS0080 reporting here.
9669
9670         * cs-parser.jay (struct_declaration): Use `member_name' instead of
9671         `IDENTIFIER opt_type_parameter_list'; when constructing our
9672         `MemberName', it'll already include our type parameters.
9673         (class_declaration, interface_declaration): Likewise.
9674         (delegate_declaration): Likewise.
9675         (MakeName): Take a MemberName and return a MemberName.
9676         The following two changes are required to avoid shift/reduce conflicts:
9677         (member_name): Don't include a TypeName anymore; ie. this is now
9678         just 'IDENTIFIER opt_type_parameter_list'.
9679         (property_declaration, event_declaration): Use a
9680         `namespace_or_type_name' instead of a `member_name'.            
9681
9682 2004-04-03  Martin Baulig  <martin@ximian.com>
9683
9684         * decl.cs (MemberName): Renamed to `TypeName' and created a new
9685         `MemberName' class.
9686         (TypeName): Formerly known as MemberName.
9687
9688         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
9689         instead of a `MemberName'.
9690
9691         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
9692         (member_name): New rule; create a MemberName.
9693
9694 2004-04-02  Martin Baulig  <martin@ximian.com>
9695
9696         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
9697         (CS0305 and CS0308).
9698
9699 2004-04-02  Martin Baulig  <martin@ximian.com>
9700
9701         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
9702         support for nested types.
9703
9704 2004-04-02  Martin Baulig  <martin@ximian.com>
9705
9706         * ecore.cs (IAlias): New public interface.
9707         (TypeExpr, TypeExpression): Implement IAlias.
9708         (TypeAliasExpression): New public class.
9709
9710         * namespace.cs (Namespace): Implement IAlias.
9711         (Namespace.Lookup): Return an IAlias instead on an object.
9712         (Namespace.DefineName): Take an IAlias instead of an object.
9713         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
9714         an object.
9715         (NamespaceEntry.UsingAlias): Take a Membername instead of an
9716         Expression.
9717         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
9718         object.
9719         (NamespaceEntry.Lookup): Likewise.
9720
9721         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
9722         instead of a Type.      
9723
9724         * decl.cs (DeclSpace): Implement IAlias.
9725         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
9726
9727         * generic.cs (ConstructedType): Improved error checking.
9728
9729 2004-04-02  Martin Baulig  <martin@ximian.com>
9730
9731         * convert.cs: Added type parameter conversions.
9732
9733         * ecore.cs
9734         (UnboxCast.Emit): Emit an `unbox.any' for type params.
9735         (ClassCast.Emit): If the source type is a type parameter, box it.
9736         If the target type is a type parameter, emit an `unbox.any'
9737         instead of a `classcast'.1      
9738
9739 2004-04-01  Martin Baulig  <martin@ximian.com>
9740
9741         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
9742
9743 2004-04-01  Martin Baulig  <martin@ximian.com>
9744
9745         * generic.cs (ConstructedType.CheckConstraints): Use
9746         Convert.ImplicitStandardConversionExists(); user-defined implicit
9747         conversions are not allowed according to the spec.
9748
9749 2004-03-30  Martin Baulig  <martin@ximian.com>
9750
9751         * expression.cs (New): Added support for type parameters.
9752
9753         * typemanager.cs
9754         (TypeManager.activator_type): New public static field.
9755         (TypeManager.activator_create_instance): Likewise.
9756
9757 2004-03-30  Martin Baulig  <martin@ximian.com>
9758
9759         * typemanager.cs (TypeManager.HasConstructorConstraint): New
9760         public method.
9761
9762 2004-03-30  Martin Baulig  <martin@ximian.com>
9763
9764         * generic.cs (ConstructedType.CheckConstraints): Actually follow
9765         the spec here: the argument type must be convertible to the
9766         constraints.
9767
9768 2004-03-30  Martin Baulig  <martin@ximian.com>
9769
9770         * generic.cs
9771         (TypeParameter.Define, TypeParameter.DefineMethod): Call
9772         TypeManager.AddTypeParameter().
9773         (ConstructedType.CheckConstraints): Re-enable this and actually
9774         check whether we have a constructor constraint.
9775
9776         * typemanager.cs
9777         (TypeManager.builder_to_type_param): New static field.
9778         (TypeManager.AddTypeParameter): New static method.
9779         (TypeManager.LookupTypeParameter): New public method.
9780
9781 2004-03-30  Martin Baulig  <martin@ximian.com>
9782
9783         * generic.cs (TypeParameter.DefineType): Return a boolean and use
9784         the new API to actually define the constructor constraint.
9785
9786         * typemanager.cs
9787         (TypeManager.new_constraint_attr_type): New static field.
9788         (TypeManager.InitCoreTypes): Initialize it.
9789
9790 2004-03-30  Martin Baulig  <martin@ximian.com>
9791
9792         * generic.cs (Constraints): Completed error checking, use correct
9793         error numbers.
9794
9795 2004-03-29  Martin Baulig  <martin@ximian.com>
9796
9797         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
9798
9799         * expression.cs (Invocation.InferTypeArguments): Added overloaded
9800         public version which takes a `ParameterData pd' instead of an
9801         `ArrayList args'.
9802
9803 2004-03-29  Martin Baulig  <martin@ximian.com>
9804
9805         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
9806         not a MethodInfo.       
9807
9808 2004-03-29  Martin Baulig  <martin@ximian.com>
9809
9810         * expression.cs (Argument.ResolveMethodGroup): If we're a
9811         ConstructedType, call GetMemberAccess() on it.  
9812
9813 2004-03-29  Martin Baulig  <martin@ximian.com>
9814
9815         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
9816         (MethodCore.CheckGenericOverride): When overriding a generic
9817         method, check whether the constraints match.
9818
9819         * support.cs (GenericConstraints): New public interface.
9820         (ParameterData.GenericConstraints): New public method.
9821
9822         * parameter.cs (Parameter.Resolve): Check whether we're a generic
9823         method parameter and compute our constraints if appropriate.
9824         (Parameter.GenericConstraints): New public property.
9825
9826         * generic.cs (Constraints): Implement GenericConstraints.
9827
9828 2004-03-29  Martin Baulig  <martin@ximian.com>
9829
9830         * decl.cs (MemberCache.FindMemberToOverride): Use
9831         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
9832
9833 2004-03-29  Martin Baulig  <martin@ximian.com>
9834
9835         * generic.cs (GenericMethod.Define): Resolve our type parameters.
9836
9837 2004-03-29  Martin Baulig  <martin@ximian.com>
9838
9839         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
9840         not allowed on non-generic declarations").
9841
9842 2004-03-29  Martin Baulig  <martin@ximian.com>
9843
9844         * expression.cs (Invocation.InferTypeArguments): Added overloaded
9845         public version of this method.
9846
9847         * class.cs (MethodCore.IsDuplicateImplementation): Use
9848         Invocation.InferTypeArguments() to check this.
9849
9850 2004-03-29  Martin Baulig  <martin@ximian.com>
9851
9852         * convert.cs: Use TypeManager.IsDelegateType() instead of
9853         comparing types correctly.
9854
9855 2004-03-29  Martin Baulig  <martin@ximian.com>
9856
9857         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
9858         types directly to make it work for generic instances.
9859
9860         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
9861
9862 2004-03-29  Martin Baulig  <martin@ximian.com>
9863
9864         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
9865         support for arrays.     
9866
9867 2004-03-24  Martin Baulig  <martin@ximian.com>
9868
9869         * decl.cs (DeclSpace.FindType): Also use
9870         TypeManager.CheckGeneric() for types from the using clauses.
9871
9872 2004-03-23  Martin Baulig  <martin@ximian.com>
9873
9874         * expression.cs (Invocation.OverloadResolve): Added `bool
9875         may_fail' argument and use it instead of the Location.IsNull() hack.
9876
9877 2004-03-23  Martin Baulig  <martin@ximian.com>
9878
9879         * expression.cs (Invocation.InferType): Use correct type inference
9880         rules here.     
9881
9882 2004-03-23  Martin Baulig  <martin@ximian.com>
9883
9884         * ecore.cs (MethodGroupExpr.Name): Use
9885         TypeManager.CSharpSignature() instead of just the name.
9886
9887         * expression.cs (Invocation.OverloadResolve): Provide better error
9888         reporting.
9889         (Invocation.DoResolve): OverloadResolve() never returns null
9890         without reporting an error, so removed the error -6 reporting here.
9891
9892 2004-03-23  Martin Baulig  <martin@ximian.com>
9893
9894         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
9895         generic methods.
9896
9897         * cs-parser.jay (delegate_declaration): Support generic delegates.
9898
9899         * delegate.cs: Support generic delegates.
9900
9901 2004-03-22  Martin Baulig  <martin@ximian.com>
9902
9903         * expression.cs (Invocation.InferParamsTypeArguments): New static
9904         method; does type inference for params arguments.
9905
9906 2004-03-21  Martin Baulig  <martin@ximian.com>
9907
9908         * typemanager.cs (TypeManager.IsGenericMethod): New public static
9909         method; checks whether a method is a generic method.    
9910
9911         * expression.cs (Invocation.InferTypeArguments): New static method;
9912         infer type arguments for generic method invocation.
9913
9914         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
9915         property; we set this to true if we're resolving a generic method
9916         invocation and the user specified type arguments, ie. we're not
9917         doing type inference.
9918
9919 2004-03-20  Martin Baulig  <martin@ximian.com>
9920
9921         * class.cs (MethodData.DeclaringType): New public property.
9922         (MethodData.Define): Set DeclaringType here.
9923         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
9924         instead of OperatorMethodBuilder.DeclaringType.
9925
9926 2004-03-20  Martin Baulig  <martin@ximian.com>
9927
9928         * cs-tokenizer.cs (xtoken): Return a special
9929         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
9930
9931         * cs-parser.jay (default_value_expression): Switch to the new
9932         syntax (14.5.13).
9933
9934 2004-03-19  Martin Baulig  <martin@ximian.com>
9935
9936         * decl.cs (MemberName): New class.  We use this to "construct"
9937         namespace_or_type_name's.
9938
9939         * generics.cs (TypeArguments.GetDeclarations): New public method;
9940         returns the type arguments as a string[] and reports a CS0081 if
9941         one of them is not an identifier.
9942
9943         * class.cs (MemberBase): The .ctor now takes the name as a
9944         MemberName instead of a string.
9945         (MemberBase.ExplicitInterfaceName): Changed type from string to
9946         Expression.
9947         (MemberBase.DoDefine): If we're an explicit implementation, the
9948         InterfaceType may be a generic instance.
9949
9950         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
9951         (namespace_name): Call MemberName.GetName () to transform the
9952         MemberName into a string and ensure we don't have any type
9953         arguments.
9954         (type_name): Call MemberName.GetTypeExpression() to transfrom the
9955         MemberName into an expression.
9956         (method_header): Use namespace_or_type_name instead of member_name.     
9957
9958 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
9959
9960         * rootcontext.cs: Add new types to the boot resolution.
9961
9962         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
9963         MulticastDelegate is not allowed.
9964
9965         * typemanager.cs: Add new types to lookup: System.TypedReference
9966         and ArgIterator.
9967
9968         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
9969         check for TypedReference or ArgIterator, they are not allowed. 
9970
9971         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
9972         makes us properly catch 1510 in some conditions (see bug 56016 for
9973         details). 
9974
9975 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
9976
9977         * CryptoConvert.cs: update from corlib version
9978         with endian fixes.
9979
9980 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
9981
9982         * class.cs (Indexer.Define): Check indexername declaration
9983
9984 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
9985
9986         * attribute.cs (IsClsCompliant): Fixed problem with handling
9987         all three states (compliant, not-compliant, undetected).
9988
9989 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
9990
9991         * attribute.cs (Attribute): Location is now public.
9992         (Resolve): Store resolved arguments (pos_values) in attribute class.
9993         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
9994         (GetClsCompliantAttributeValue): New method that gets
9995         CLSCompliantAttribute value.
9996         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
9997         if exists else null.
9998         (AttributeTester): New class for CLS-Compliant verification routines.
9999
10000         * class.cs (Emit): Add CLS-Compliant verification.
10001         (Method.GetSignatureForError): Implemented.
10002         (Constructor.GetSignatureForError): Implemented
10003         (Constructor.HasCompliantArgs): Returns if constructor has
10004         CLS-Compliant arguments.
10005         (Constructor.Emit): Override.
10006         (Construcor.IsIdentifierClsCompliant): New method; For constructors
10007         is needed to test only parameters.
10008         (FieldBase.GetSignatureForError): Implemented.
10009         (TypeContainer): New member for storing base interfaces.
10010         (TypeContainer.FindMembers): Search in base interfaces too.
10011
10012         * codegen.cs (GetClsComplianceAttribute): New method that gets
10013         assembly or module CLSCompliantAttribute value.
10014         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10015         for assembly.
10016         (ModuleClass.Emit): Add error 3012 test.
10017
10018         * const.cs (Emit): Override and call base for CLS-Compliant tests.
10019
10020         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10021         state for all decl types.
10022         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10023         if CLS-Compliant tests are required.
10024         (IsClsCompliaceRequired): New method. Analyze whether code
10025         must be CLS-Compliant.
10026         (IsExposedFromAssembly): New method. Returns true when MemberCore
10027         is exposed from assembly.
10028         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10029         value or gets cached value.
10030         (HasClsCompliantAttribute): New method. Returns true if MemberCore
10031         is explicitly marked with CLSCompliantAttribute.
10032         (IsIdentifierClsCompliant): New abstract method. This method is
10033         used to testing error 3005.
10034         (IsIdentifierAndParamClsCompliant): New method. Common helper method
10035         for identifier and parameters CLS-Compliant testing.
10036         (VerifyClsCompliance): New method. The main virtual method for
10037         CLS-Compliant verifications.
10038         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10039         null. I don't know why is null (too many public members !).
10040         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10041         and get value of first CLSCompliantAttribute that found.
10042
10043         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10044         (VerifyClsCompliance): Override and add extra tests.
10045
10046         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10047         clscheck- disable CLS-Compliant verification event if assembly is has
10048         CLSCompliantAttribute(true).
10049
10050         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10051         ApllyAttribute is now called in emit section as in the other cases.
10052         Possible future Emit integration.
10053         (IsIdentifierClsCompliant): New override.
10054         (VerifyClsCompliance): New override.
10055         (GetEnumeratorName): Returns full enum name.
10056
10057         * parameter.cs (GetSignatureForError): Implemented.
10058
10059         * report.cs (WarningData): New struct for Warning message information.
10060         (LocationOfPreviousError): New method.
10061         (Warning): New method. Reports warning based on the warning table.
10062         (Error_T): New method. Reports error based on the error table.
10063
10064         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10065         verifications are done here.
10066
10067         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10068
10069         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10070         CLSCompliantAttribute.
10071         (all_imported_types): New member holds all imported types from other
10072         assemblies.
10073         (LoadAllImportedTypes): New method fills static table with exported types
10074         from all referenced assemblies.
10075         (Modules): New property returns all assembly modules.
10076
10077 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
10078
10079         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10080         throwing a parser error.
10081
10082         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10083         which removes the hardcoded get_/set_ prefixes for properties, as
10084         IL allows for the properties to be named something else.  
10085
10086         Bug #56013
10087
10088         * expression.cs: Do not override operand before we know if it is
10089         non-null.  Fix 56207
10090
10091 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10092
10093         * typemanager.cs: support for pinned variables.
10094
10095 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10096
10097         * decl.cs, typemanager.cs: Avoid using an arraylist
10098         as a buffer if there is only one result set.
10099
10100 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10101
10102         * expression.cs: Make sure you cant call a static method
10103         with an instance expression, bug #56174.
10104
10105 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
10106
10107         * class.cs (IsDuplicateImplementation): Improve error reporting to
10108         flag 663 (method only differs in parameter modifier).
10109
10110         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10111         in preprocessor directives.
10112
10113         * location.cs (LookupFile): Allow for the empty path.
10114
10115         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
10116         better approach for some of that patch, but its failing with the
10117         CharSet enumeration.  For now try/catch will do.
10118
10119         * typemanager.cs: Do not crash if a struct does not have fields.
10120         Fixes 56150.
10121
10122 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10123
10124         * expression.cs: cs0213, cant fix a fixed expression.
10125         fixes 50231.
10126
10127 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10128
10129         * cs-parser.jay: detect invalid embeded statements gracefully.
10130         bug #51113.
10131
10132 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10133
10134         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10135         As a regex:
10136         s/
10137         the invocation type may not be a subclass of the tye of the item/
10138         The type of the item must be a subclass of the invocation item.
10139         /g
10140
10141         Fixes bug #50820.
10142
10143 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
10144
10145         * attribute.cs: Added methods to get a string and a bool from an
10146         attribute. Required to information from AssemblyKeyFileAttribute,
10147         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10148         * codegen.cs: Modified AssemblyName creation to include support for
10149         strongnames. Catch additional exceptions to report them as CS1548.
10150         * compiler.csproj: Updated include CryptoConvert.cs.
10151         * compiler.csproj.user: Removed file - user specific configuration.
10152         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
10153         Mono.Security assembly. The original class is maintained and tested in
10154         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10155         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10156         like CSC 8.0 (C# v2) supports.
10157         * Makefile: Added CryptoConvert.cs to mcs sources.
10158         * rootcontext.cs: Added new options for strongnames.
10159
10160 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
10161
10162         * driver.cs: For --expect-error, report error code `2'
10163         if the program compiled with no errors, error code `1' if
10164         it compiled with an error other than the one expected.
10165
10166 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
10167
10168         * compiler.csproj: Updated for Visual Studio .NET 2003.
10169         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10170         * compiler.sln: Updated for Visual Studio .NET 2003.
10171
10172 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
10173
10174         * expression.cs: Fix bug #47234. We basically need to apply the
10175         rule that we prefer the conversion of null to a reference type
10176         when faced with a conversion to 'object' (csc behaviour).
10177
10178 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10179
10180         * statement.cs: Shorter form for foreach, eliminates
10181         a local variable. r=Martin.
10182
10183 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10184
10185         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10186         checks if we can use brtrue/brfalse to test for 0.
10187         * expression.cs: use the above in the test for using brtrue/brfalse.
10188         cleanup code a bit.
10189
10190 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10191
10192         * expression.cs: Rewrite string concat stuff. Benefits:
10193
10194         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10195         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10196         rather than a concat chain.
10197
10198         * typemanager.cs: Add lookups for more concat overloads.
10199
10200 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10201
10202         * expression.cs: Emit shorter il code for array init.
10203
10204         newarr
10205         dup
10206         // set 1
10207
10208         // set 2
10209
10210         newarr
10211         stloc.x
10212
10213         ldloc.x
10214         // set 1
10215
10216         ldloc.x
10217         // set 2
10218
10219 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
10220
10221         * statement.cs: Before, two switch blocks would be merged if the
10222         total size of the blocks (end_item - begin_item + 1) was less than
10223         two times the combined sizes of the blocks.
10224
10225         Now, it will only merge if after the merge at least half of the
10226         slots are filled.
10227
10228         fixes 55885.
10229
10230 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
10231
10232         * class.cs : csc build fix for GetMethods(). See bug #52503.
10233
10234 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
10235
10236         * expression.cs: Make sure fp comparisons work with NaN.
10237         This fixes bug #54303. Mig approved this patch a long
10238         time ago, but we were not able to test b/c the runtime
10239         had a related bug.
10240
10241 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
10242
10243         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
10244
10245 2004-03-19  Martin Baulig  <martin@ximian.com>
10246
10247         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
10248         two overloads may unify for some type parameter substitutions and
10249         report a CS0408 if appropriate.
10250
10251 2004-03-19  Martin Baulig  <martin@ximian.com>
10252
10253         * class.cs (MemberCore.IsDuplicateImplementation): Report the
10254         error here and not in our caller.
10255
10256 2004-03-19  Martin Baulig  <martin@ximian.com>
10257
10258         * interface.cs: Completely killed this file.
10259         (Interface): We're now a TypeContainer and live in class.cs.
10260
10261         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
10262         argument; we're now also called for interfaces.
10263         (TypeContainer.DefineMembers): Allow this method being called
10264         multiple times.
10265         (TypeContainer.GetMethods): New public method; formerly known as
10266         Interface.GetMethod().  This is used by PendingImplementation.
10267         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
10268         it's now private and non-static.
10269         (Interface): Moved this here; it's now implemented similar to
10270         Class and Struct.
10271         (Method, Property, Event, Indexer): Added `bool is_interface'
10272         argument to their .ctor's.
10273         (MemberBase.IsInterface): New public field.
10274
10275         * cs-parser.jay: Create normal Method, Property, Event, Indexer
10276         instances instead of InterfaceMethod, InterfaceProperty, etc.
10277         (opt_interface_base): Removed; we now use `opt_class_base' instead.
10278         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
10279
10280 2004-03-19  Martin Baulig  <martin@ximian.com>
10281
10282         * class.cs (MethodCore.IsDuplicateImplementation): New private
10283         method which does the CS0111 checking.
10284         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
10285         Use IsDuplicateImplementation().
10286
10287 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
10288
10289         * decl.cs (FindMemberToOverride): New method to find the correct
10290         method or property to override in the base class.
10291         * class.cs
10292             - Make Method/Property use the above method to find the
10293               version in the base class.
10294             - Remove the InheritableMemberSignatureCompare as it is now
10295               dead code.
10296
10297         This patch makes large code bases much faster to compile, as it is
10298         O(n) rather than O(n^2) to do this validation.
10299
10300         Also, it fixes bug 52458 which is that nested classes are not
10301         taken into account when finding the base class member.
10302
10303         Reviewed/Approved by Martin.
10304
10305 2004-03-17  Martin Baulig  <martin@ximian.com>
10306
10307         * expression.cs (MemberAccess.DoResolve): Take the parent's number
10308         of type arguments into account; use the `real_num_type_args'
10309         approach like in DoResolveAsTypeStep().
10310
10311         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
10312         nested types.
10313
10314 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
10315
10316         * interface.cs: In all interface classes removed redundant
10317         member initialization.
10318
10319 2004-03-16  Martin Baulig  <martin@ximian.com>
10320
10321         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10322
10323 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
10324
10325         * decl.cs (DefineTypeAndParents): New helper method to define a
10326         type's containers before the type itself is defined;  This is a
10327         bug exposed by the recent changes to Windows.Forms when an
10328         implemented interface was defined inside a class that had not been
10329         built yet.   
10330
10331         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10332
10333         (Check): Loop correctly to report errors modifiers
10334         (UNSAFE was not in the loop, since it was the same as TOP).
10335
10336         * interface.cs: Every interface member now takes a ModFlags,
10337         instead of a "is_new" bool, which we set on the base MemberCore. 
10338
10339         Every place where we called "UnsafeOk" in the interface, now we
10340         call the proper member (InterfaceMethod.UnsafeOK) instead to get
10341         the unsafe settings from the member declaration instead of the
10342         container interface. 
10343
10344         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
10345
10346         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10347         `set_indexer_name' to the pending bits (one per type).
10348
10349         We fixed a bug today that was picking the wrong method to
10350         override, since for properties the existing InterfaceMethod code
10351         basically ignored the method name.  Now we make sure that the
10352         method name is one of the valid indexer names.
10353
10354 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
10355  
10356         * support.cs (SeekableStreamReader): Keep track of stream byte
10357         positions and don't mix them with character offsets to the buffer.
10358
10359         Patch from Gustavo Giráldez
10360
10361 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
10362
10363         * interface.cs (InterfaceSetGetBase): Removed double member
10364         initialization, base class does it as well.
10365
10366 2004-03-13  Martin Baulig  <martin@ximian.com>
10367
10368         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10369         when compiling corlib.
10370
10371 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
10372
10373         * convert.cs (ExplicitConversion): We were reporting an error on
10374         certain conversions (object_type source to a value type, when the
10375         expression was `null') before we had a chance to pass it through
10376         the user defined conversions.
10377
10378         * driver.cs: Replace / and \ in resource specifications to dots.
10379         Fixes 50752
10380
10381         * class.cs: Add check for duplicate operators.  Fixes 52477
10382
10383 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
10384
10385         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10386         that are in the middle of the statements, not only at the end.
10387         Fixes #54987
10388
10389         * class.cs (TypeContainer.AddField): No longer set the
10390         `HaveStaticConstructor' flag, now we call it
10391         `UserDefineStaticConstructor' to diferentiate the slightly
10392         semantic difference.
10393
10394         The situation is that we were not adding BeforeFieldInit (from
10395         Modifiers.TypeAttr) to classes that could have it.
10396         BeforeFieldInit should be set to classes that have no static
10397         constructor. 
10398
10399         See:
10400
10401         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10402
10403         And most importantly Zoltan's comment:
10404
10405         http://bugzilla.ximian.com/show_bug.cgi?id=44229
10406
10407         "I think beforefieldinit means 'it's ok to initialize the type sometime 
10408          before its static fields are used', i.e. initialization does not need
10409          to be triggered by the first access to the type. Setting this flag
10410          helps the JIT to compile better code, since it can run the static
10411          constructor at JIT time, and does not need to generate code to call it
10412          (possibly lots of times) at runtime. Unfortunately, mcs does not set
10413          this flag for lots of classes like String. 
10414          
10415          csc sets this flag if the type does not have an explicit static 
10416          constructor. The reasoning seems to be that if there are only static
10417          initalizers for a type, and no static constructor, then the programmer
10418          does not care when this initialization happens, so beforefieldinit
10419          can be used.
10420          
10421          This bug prevents the AOT compiler from being usable, since it 
10422          generates so many calls to mono_runtime_class_init that the AOT code
10423          is much slower than the JITted code. The JITted code is faster, 
10424          because it does not generate these calls if the vtable is type is
10425          already initialized, which is true in the majority of cases. But the
10426          AOT compiler can't do this."
10427
10428 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
10429
10430         * class.cs (MethodData.Emit): Refactor the code so symbolic
10431         information is generated for destructors;  For some reasons we
10432         were taking a code path that did not generate symbolic information
10433         before. 
10434
10435 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
10436
10437         * class.cs: Create a Constructor.CheckBase method that
10438         takes care of all validation type code. The method
10439         contains some code that was moved from Define.
10440
10441         It also includes new code that checks for duplicate ctors.
10442         This fixes bug #55148.
10443
10444 2004-03-09  Joshua Tauberer <tauberer@for.net>
10445
10446         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
10447         a { ... }-style array creation invokes EmitStaticInitializers
10448         which is not good for reference-type arrays.  String, decimal
10449         and now null constants (NullCast) are not counted toward
10450         static initializers.
10451
10452 2004-03-05  Martin Baulig  <martin@ximian.com>
10453
10454         * location.cs (SourceFile.HasLineDirective): New public field;
10455         specifies whether the file contains or is referenced by a "#line"
10456         directive.
10457         (Location.DefineSymbolDocuments): Ignore source files which
10458         either contain or are referenced by a "#line" directive.        
10459
10460 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
10461
10462         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10463         direct access to our parent, so check the method inline there.
10464
10465 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
10466
10467         * expression.cs (Invocation.EmitCall): Miguel's last commit
10468         caused a regression. If you had:
10469
10470             T t = null;
10471             t.Foo ();
10472
10473         In Foo the implict this would be null.
10474
10475 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
10476
10477         * expression.cs (Invocation.EmitCall): If the method is not
10478         virtual, do not emit a CallVirt to it, use Call.
10479
10480         * typemanager.cs (GetFullNameSignature): Improve the method to
10481         cope with ".ctor" and replace it with the type name.
10482
10483         * class.cs (ConstructorInitializer.Resolve): Now the method takes
10484         as an argument the ConstructorBuilder where it is being defined,
10485         to catch the recursive constructor invocations.
10486
10487 2004-03-16  Martin Baulig  <martin@ximian.com>
10488
10489         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
10490         ConstructedType, call ResolveType() on it to get the type rather
10491         than just using `expr.Type'.
10492
10493 2004-03-16  Martin Baulig  <martin@ximian.com>
10494
10495         * generics.cs (ConstructedType.GetMemberAccess): Take the
10496         EmitContext instead on the TypeExpr and use
10497         ec.TypeContainer.CurrentType/ec.ContainerType.
10498
10499 2004-03-16  Martin Baulig  <martin@ximian.com>
10500
10501         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
10502         parameters before aliases.
10503
10504 2004-03-16  Martin Baulig  <martin@ximian.com>
10505
10506         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
10507         New oublic function; checks whether two generic instances may become
10508         equal under some instantiations (26.3.1).
10509
10510         * class.cs (TypeContainer.Define): Call
10511         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
10512         error.
10513
10514 2004-03-16  Martin Baulig  <martin@ximian.com>
10515
10516         * class.cs (TypeContainer.GetClassBases): Moved
10517         Error_TypeParameterAsBase() here and also check whether the base
10518         class is not an attribute.
10519
10520 2004-03-16  Martin Baulig  <martin@ximian.com>
10521
10522         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10523
10524 2004-03-16  Martin Baulig  <martin@ximian.com>
10525
10526         * class.cs (Error_TypeParameterAsBase): Use correct error number
10527         here (CS0689).  
10528
10529 2004-03-16  Martin Baulig  <martin@ximian.com>
10530
10531         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
10532         for generics.
10533
10534         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
10535         error reporting.
10536
10537 2004-03-15  Martin Baulig  <martin@ximian.com>
10538
10539         * typemanager.cs (TypeManager.GetFullName): New public method.
10540         (TypeManager.MemberLookup): Added `int_num_type_arguments'
10541         argument; only return members with the correct number of type
10542         arguments.
10543         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
10544         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
10545         whether the number of type arguments matches.
10546
10547         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
10548         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
10549
10550         * expression.cs (MemberAccess): Added public `NumTypeArguments'
10551         field; it's set by the protected .ctor when we're actually a
10552         GenericMemberAccess.
10553         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
10554         arguments and pass it to MemberLookupFinal ().
10555
10556         * ecore.cs (Expression.MemberLookup): Added `int
10557         num_type_arguments' argument; only return members with the correct
10558         number of type arguments.
10559         (Expression.MemberLookupFailed): Check whether the MemberLookup
10560         failed because we did not have the correct number of type
10561         arguments; report CS0305 in this case.
10562
10563         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
10564         `e.ResolveAsTypeTerminal()' already did so.
10565
10566 2004-03-15  Martin Baulig  <martin@ximian.com>
10567
10568         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
10569         we're a ConstructedType; in this case, the caller must report an
10570         error (for instance CS0131).
10571
10572         * generic.cs (TypeArguments): Added Location argument to the .ctor.
10573         (TypeArguments.Resolve): Actually report errors here.
10574
10575 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
10576
10577         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10578         `set_indexer_name' to the pending bits (one per type).
10579
10580         We fixed a bug today that was picking the wrong method to
10581         override, since for properties the existing InterfaceMethod code
10582         basically ignored the method name.  Now we make sure that the
10583         method name is one of the valid indexer names.
10584
10585 2004-03-15  Martin Baulig  <martin@ximian.com>
10586
10587         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
10588         for generic instances.
10589
10590 2004-03-13  Martin Baulig  <martin@ximian.com>
10591
10592         * class.cs (TypeContainer.DefineType): Call
10593         TypeManager.AddUserType() immediately after creating the
10594         TypeBuilder; pass all type parameters when creating the
10595         CurrentType.
10596
10597         * decl.cs (DeclSpace.FindNestedType): New public method.
10598         (DeclSpace.FindType): Added `int num_type_args' argument; only
10599         return types with the correct number of type parameters.
10600         (DeclSpace.CountTypeParams): New public property.
10601
10602         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
10603         the number of type parameters; defaults to zero.
10604
10605         * generic.cs (TypeArguments.Count): New public property.
10606         (ConstructedType.DoResolveAsTypeStep): First call
10607         ds.FindNestedType() to find out whether we're nested in the
10608         current generic type; in this case, we inherit all type parameters
10609         from the current class.
10610
10611         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
10612         num_type_args' argument.
10613         (RootContext.LookupType): Added overloaded version which takes the
10614         number of type arguments; only return types with the correct
10615         number of type arguments.
10616
10617         * typemanager.cs (TypeManager.CheckGeneric): New public function;
10618         checks whether `Type t' has `int num_type_args'.
10619
10620 2004-03-13  Martin Baulig  <martin@ximian.com>
10621
10622         * generic.cs (GenericMethod.DefineType): New method; calls
10623         DefineType() on all the type parameters.
10624
10625         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
10626         (MethodData.Define): If we're a generic method, call
10627         GenericMethod.DefineType() to define the type parameters.       
10628
10629 2004-03-10  Martin Baulig  <martin@ximian.com>
10630
10631         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
10632         instead of IsAssignableFrom.    
10633
10634 2004-03-10  Martin Baulig  <martin@ximian.com>
10635
10636         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
10637
10638         * support.cs (ParameterData.HasArrayParameter): New property.
10639         (ReflectionParameters.ctor): Take a MethodBase instead of a
10640         ParameterInfo[].  If we have any type parameters, get the generic
10641         method definition and ask it whether we have variable arguments.
10642
10643 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
10644
10645         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
10646         routines to check if a type is an enumerable/enumerator allow
10647         classes that implement the IEnumerable or IEnumerator interfaces.
10648
10649         * class.cs (Property, Operator): Implement IIteratorContainer, and
10650         implement SetYields.
10651
10652         (Property.Define): Do the block swapping for get_methods in the
10653         context of iterators.   We need to check if Properties also
10654         include indexers or not.
10655
10656         (Operator): Assign the Block before invoking the
10657         OperatorMethod.Define, so we can trigger the Iterator code
10658         replacement. 
10659
10660         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
10661         Property and Operator classes are not created when we parse the
10662         declarator but until we have the block completed, so we use a
10663         singleton SimpleIteratorContainer.Simple to flag whether the
10664         SetYields has been invoked.
10665
10666         We propagate this setting then to the Property or the Operator to
10667         allow the `yield' to function.
10668
10669 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
10670
10671         * codegen.cs: Implemented attribute support for modules.
10672         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
10673         Assembly/Module functionality.
10674
10675         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
10676         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
10677         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
10678
10679 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
10680
10681         * interface.cs (FindMembers): The operation is performed on all base
10682         interfaces and not only on the first. It is required for future CLS Compliance patch.
10683
10684 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
10685
10686         * statement.cs, codegen.cs:
10687         This patch deals with patterns such as:
10688
10689         public class List : IEnumerable {
10690
10691                 public MyEnumerator GetEnumerator () {
10692                         return new MyEnumerator(this);
10693                 }
10694
10695                 IEnumerator IEnumerable.GetEnumerator () {
10696                         ...
10697                 }
10698                 
10699                 public struct MyEnumerator : IEnumerator {
10700                         ...
10701                 }
10702         }
10703
10704         Before, there were a few things we did wrong:
10705         1) we would emit callvirt on a struct, which is illegal
10706         2) we emited ldarg when we needed to emit ldarga
10707         3) we would mistakenly call the interface methods on an enumerator
10708         type that derived from IEnumerator and was in another assembly. For example:
10709
10710         public class MyEnumerator : IEnumerator
10711
10712         Would have the interface methods called, even if there were public impls of the
10713         method. In a struct, this lead to invalid IL code.
10714
10715 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
10716
10717         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
10718           renamed to Emit.
10719
10720         * delegate.cs (Define): Fixed crash when delegate type is undefined.
10721
10722 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
10723
10724         * cs-parser.jay: Fix small regression: we were not testing V2
10725         compiler features correctly.
10726
10727         * interface.cs: If the emit context is null, then create one
10728
10729 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
10730
10731         * decl.cs (GetSignatureForError): New virtual method to get full name
10732           for error messages.
10733
10734         * attribute.cs (IAttributeSupport): New interface for attribute setting.
10735           Now it is possible to rewrite ApplyAttributes method to be less if/else.
10736
10737         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
10738           Duplicated members and code in these classes has been removed.
10739           Better encapsulation in these classes.
10740
10741 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
10742
10743         * assign.cs (Assign.DoResolve): When dealing with compound
10744         assignments, there is a new rule in ECMA C# 2.4 (might have been
10745         there before, but it is documented here) that states that in:
10746
10747         a op= b;
10748
10749         If b is of type int, and the `op' is a shift-operator, then the
10750         above is evaluated as:
10751
10752         a = (int) a op b 
10753
10754         * expression.cs (Binary.ResolveOperator): Instead of testing for
10755         int/uint/long/ulong, try to implicitly convert to any of those
10756         types and use that in pointer arithmetic.
10757
10758         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
10759         method to print information for from the type, not from the
10760         null-method we were given.
10761
10762 2004-02-01  Duncan Mak  <duncan@ximian.com>
10763
10764         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
10765         parsing for cmd, fixes bug #53694.
10766
10767 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
10768
10769         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
10770         in the member name duplication tests. Property and operator name duplication
10771         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
10772
10773 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
10774
10775         * interface.cs (PopulateMethod): Fixed crash when interface method
10776         returns not existing type (error test cs0246-3.cs).
10777
10778 2004-02-02  Ravi Pratap M <ravi@ximian.com>
10779
10780         * cs-parser.jay (interface_accessors): Re-write actions to also
10781         store attributes attached to get and set methods. Fix spelling
10782         while at it.
10783
10784         (inteface_property_declaration): Modify accordingly.
10785
10786         (InterfaceAccessorInfo): New helper class to store information to pass
10787         around between rules that use interface_accessors.
10788
10789         * interface.cs (Emit): Apply attributes on the get and set
10790         accessors of properties and indexers too.
10791
10792         * attribute.cs (ApplyAttributes): Modify accordingly to use the
10793         right MethodBuilder when applying attributes to the get and set accessors.
10794
10795 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
10796
10797         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
10798
10799 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
10800
10801         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
10802
10803 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
10804
10805         * cs-parser.jay: Remove YIELD token, instead use the new grammar
10806         changes that treat `yield' specially when present before `break'
10807         or `return' tokens.
10808
10809         * cs-tokenizer.cs: yield is no longer a keyword.
10810
10811 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
10812
10813         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
10814         setting for default constructors.
10815         For default constructors are almost every time set wrong Modifier. The
10816         generated IL code has been alright. But inside mcs this values was
10817         wrong and this was reason why several of my CLS Compliance tests
10818         failed.
10819
10820 2004-02-27  Martin Baulig  <martin@ximian.com>
10821
10822         * generics.cs (ConstructedType.ResolveType): Make the nested type
10823         stuff actually work.
10824
10825 2004-02-25  Martin Baulig  <martin@ximian.com>
10826
10827         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
10828         property; returns the type parameters just from the current type,
10829         ie. with the ones from outer classes.
10830         (DeclSpace.LookupGeneric): First search in the current class, then
10831         in outer classes.
10832         (DeclSpace.initialize_type_params): When hiding a type parameter
10833         from an outer class, put it into the `type_param_list' anyways.
10834
10835         * expression.cs (MemberAccess.expr): Made this field protected.
10836
10837         * class.cs (TypeContainer.Define): The `CurrentType' just contains
10838         the type parameters from the current class.
10839
10840         * generic.cs (ConstructedType.ResolveType): Support nested generic
10841         types by taking the type parameters which we inherit from outer
10842         classes into account.
10843         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
10844         support for nested generic types.
10845
10846 2004-02-23  Martin Baulig  <martin@ximian.com>
10847
10848         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
10849         field and check whether we're nested inside a generic type.
10850         (DeclSpace.ResolveType): If we're resolving to a generic type
10851         definition, create a ConstructedType and return its resolved type.
10852         (DeclSpace.initialize_type_params): New private method;
10853         initializes the `type_param_list' field from the type parameters
10854         from this and all enclosing classes.
10855         (DeclSpace.TypeParameters): Call initialize_type_params() unless
10856         we're already initialized.
10857
10858 2004-02-23  Martin Baulig  <martin@ximian.com>
10859
10860         * class.cs (Method.Define): Create the generic method before
10861         calling DoDefine().
10862         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
10863         the TypeContainer one); we use this for generic methods.
10864
10865         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
10866         parent's TypeBuilder.
10867
10868 2004-02-18  Martin Baulig  <martin@ximian.com>
10869
10870         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
10871         to check for equality.
10872
10873 2004-02-05  Martin Baulig  <martin@ximian.com>
10874
10875         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
10876         `ec.TypeContainer.CurrentType', use it instead of
10877         `ec.ContainerType' to check whether we're in the type's ctor.
10878
10879 2004-01-29  Martin Baulig  <martin@ximian.com>
10880
10881         * expression.cs (Invocation.DoResolve): If we're a
10882         `ConstructedType', then we're actually a generic method, so
10883         rewrite the expr as a GenericMemberAccess.
10884
10885         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
10886         here; manually parse it into a string.
10887
10888 2004-01-28  Martin Baulig  <martin@ximian.com>
10889
10890         * typemanager.cs (TypeManager.IsEqual): New static method.
10891         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
10892         check for equality instead of using `=='.
10893
10894 2004-01-26  Martin Baulig  <martin@ximian.com>
10895
10896         * decl.cs (DeclSpace.CurrentType): New public field.
10897
10898         * expression.cs (This.ResolveBase): If we have an
10899         `ec.TypeContainer.CurrentType', use it instead of
10900         `ec.ContainerType'.
10901
10902         * class.cs (TypeContainer.DefineType): If we're a generic type,
10903         create the `CurrentType' (unresolved).
10904         (TypeContainer.GenericType): New private field.
10905         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
10906         it and store it in `GenericType' before creating the MemberCache.
10907         (TypeContainer.GetMembers): If we have a `GenericType', call
10908         TypeManager.FindMembers() on it.
10909
10910         * interface.cs (Interface.GenericType): New private field.
10911         (Interface.DefineType): If we're a generic type, create the
10912         `CurrentType' (unresolved).
10913         (Interface.DefineMembers): If we have a `CurrentType', resolve it
10914         and store it in `GenericType' before creating the MemberCache.
10915         (Interface.GetMembers): If we have a `GenericType', call
10916         TypeManager.FindMembers() on it.
10917
10918 2004-01-22  Martin Baulig  <martin@ximian.com>
10919
10920         * cs-parser.jay (namespace_or_type_name): Return an Expression,
10921         not a QualifiedIdentifier.  This is what `type_name_expression'
10922         was previously doing.
10923         (type_name_expression): Removed; the code is now in
10924         `namespace_or_type_name'.
10925         (qualified_identifier): Removed, use `namespace_or_type_name'
10926         instead.
10927         (QualifiedIdentifier): Removed this class.      
10928
10929 2004-01-22  Martin Baulig  <martin@ximian.com>
10930
10931         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
10932         not a string as alias name.
10933
10934 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
10935
10936         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
10937         #52730 bug, and instead compute correctly the need to use a
10938         temporary variable when requesting an address based on the
10939         static/instace modified of the field and the constructor.
10940  
10941 2004-01-21  Martin Baulig  <martin@ximian.com>
10942
10943         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
10944         class and namespace before looking up aliases.  Fixes #52517.
10945
10946 2004-01-21  Martin Baulig  <martin@ximian.com>
10947
10948         * flowanalysis.cs (UsageVector.Merge): Allow variables being
10949         assinged in a 'try'; fixes exception4.cs.
10950
10951 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10952         * class.cs : Implemented parameter-less constructor for TypeContainer
10953
10954         * decl.cs: Attributes are now stored here. New property OptAttributes
10955
10956         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
10957
10958         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
10959
10960 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10961
10962         * typemanager.cs (CSharpSignature): Now reports also inner class name.
10963           (CSharpSignature): New method for indexer and property signature.
10964
10965 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10966
10967         * pending.cs (IsVirtualFilter): Faster implementation.
10968
10969 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10970
10971         * typemanager.cs: Avoid inclusion of same assembly more than once.
10972
10973 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10974
10975         * cs-parser.jay: Fixed problem where the last assembly attribute
10976           has been applied also to following declaration (class, struct, etc.)
10977           
10978 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10979
10980         * class.cs: Added error CS0538, CS0539 reporting.
10981         Fixed crash on Microsoft runtime when field type is void.
10982
10983         * cs-parser.jay: Added error CS0537 reporting.
10984
10985         * pending.cs: Added error CS0535 reporting.
10986         Improved error report for errors CS0536, CS0534.
10987
10988 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
10989
10990         Merge a few bits from the Anonymous Method MCS tree.
10991
10992         * statement.cs (ToplevelBlock): New class for toplevel methods,
10993         will hold anonymous methods, lifted variables.
10994
10995         * cs-parser.jay: Create toplevel blocks for delegates and for
10996         regular blocks of code. 
10997
10998 2004-01-20  Martin Baulig  <martin@ximian.com>
10999
11000         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11001         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11002         and `NeedExplicitReturn'; added `IsLastStatement'.
11003         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11004         have a `ReturnLabel' or we're not unreachable.
11005
11006         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
11007         child's reachability; don't just override ours with it.  Fixes
11008         #58058 (lluis's example).
11009         (FlowBranching): Added public InTryOrCatch(), InCatch(),
11010         InFinally(), InLoop(), InSwitch() and
11011         BreakCrossesTryCatchBoundary() methods.
11012
11013         * statement.cs (Return): Do all error checking in Resolve().
11014         Unless we are the last statement in a top-level block, always
11015         create a return label and jump to it.
11016         (Break, Continue): Do all error checking in Resolve(); also make
11017         sure we aren't leaving a `finally'.
11018         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
11019         statement in a top-level block.
11020         (Block.Flags): Added `IsDestructor'.
11021         (Block.IsDestructor): New public property.
11022
11023 2004-01-20  Martin Baulig  <martin@ximian.com>
11024
11025         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11026
11027 2004-01-20  Martin Baulig  <martin@ximian.com>
11028
11029         * statement.cs (Statement.ResolveUnreachable): New public method.
11030         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11031         (Block.Resolve): Resolve unreachable statements.
11032
11033 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11034
11035         * expression.cs: We need to fix the case where we do
11036         not have a temp variable here.
11037
11038         * assign.cs: Only expression compound assignments need
11039         temporary variables.
11040
11041 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11042
11043         * flowanalysis.cs: Reduce memory allocation in a few ways:
11044           - A block with no variables should not allocate a bit
11045             vector for itself.
11046           - A method with no out parameters does not need any tracking
11047             for assignment of the parameters, so we need not allocate
11048             any data for it.
11049           - The arrays:
11050                 public readonly Type[] VariableTypes;
11051                 public readonly string[] VariableNames;
11052             Are redundant. The data is already stored in the variable
11053             map, so we need not allocate another array for it.
11054           - We need to add alot of checks for if (params | locals) == null
11055             due to the first two changes.
11056
11057 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
11058
11059         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11060         implement IMemoryLocation, we store a copy on a local variable and
11061         take the address of it.  Patch from Benjamin Jemlich
11062
11063         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11064         to use a special "type_name_expression" rule which reduces the
11065         number of "QualifiedIdentifier" classes created, and instead
11066         directly creates MemberAccess expressions.
11067
11068 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
11069
11070         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11071         that fixes #52853.  Null literal assignment to ValueType
11072
11073         * class.cs (MethodData.Emit): Instead of checking the name of the
11074         method to determine if its a destructor, create a new derived
11075         class from Method called Destructor, and test for that.  
11076
11077         * cs-parser.jay: Create a Destructor object instead of a Method.  
11078
11079         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11080
11081         Fixes: 52933
11082
11083 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
11084
11085         * expression.cs (Binary.ResolveOperator): Perform an implicit
11086         conversion from MethodGroups to their delegate types on the
11087         Addition operation.
11088
11089         * delegate.cs: Introduce a new class DelegateCreation that is the
11090         base class for `NewDelegate' and `ImplicitDelegateCreation',
11091         factor some code in here.
11092
11093         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11094         conversion from MethodGroups to compatible delegate types. 
11095
11096         * ecore.cs (Expression.Resolve): Do not flag error 654
11097         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11098         we allow conversions from MethodGroups to delegate types now.
11099
11100         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11101         assignments in v2 either.
11102
11103 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
11104
11105         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11106         static read-only fields in ctors.
11107
11108         Applied patch from Benjamin Jemlich 
11109
11110         * expression.cs (UnaryMutator): Avoid leaking local variables. 
11111
11112 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
11113
11114         * cs-tokenizer.cs (IsCastToken): Allow the various native types
11115         here to return true, as they can be used like this:
11116
11117                 (XXX) int.MEMBER ()
11118
11119         Fixed 49836 and all the other dups
11120
11121 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
11122
11123         * driver.cs: Implement /win32res and /win32icon.
11124
11125 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
11126
11127         * cs-parser.jay: Add a rule to improve error handling for the
11128         common mistake of placing modifiers after the type.
11129
11130 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
11131
11132         * cs-parser.jay (interface_event_declaration): Catch
11133         initialization of events on interfaces, and report cs0068
11134
11135         * cs-parser.jay (interface_event_declaration): Catch
11136         initialization of events. 
11137
11138         * ecore.cs: Better report missing constructors.
11139
11140         * expression.cs (Binary.ResolveOperator): My previous bug fix had
11141         the error reporting done in the wrong place.  Fix.
11142
11143         * expression.cs (Binary.ResolveOperator): Catch the 
11144         operator + (E x, E y) error earlier, and later allow for implicit
11145         conversions in operator +/- (E e, U x) from U to the underlying
11146         type of E.
11147
11148         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11149         52596, if the container class is abstract, the default constructor
11150         is protected otherwise its public (before, we were always public).
11151
11152         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11153         fixed statement.
11154
11155         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11156         Jemlich that fixes bug #52597, MCS was generating invalid code for
11157         idisposable structs.   Thanks to Ben for following up with this
11158         bug as well.
11159
11160 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
11161
11162         * driver.cs: Allow assemblies without code to be generated, fixes
11163         52230.
11164
11165 2004-01-07  Nick Drochak <ndrochak@gol.com>
11166
11167         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11168
11169 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
11170
11171         * cs-parser.jay: Add rules to improve error reporting if fields or
11172         methods are declared at the namespace level (error 116)
11173
11174         * Add rules to catch event add/remove
11175
11176 2004-01-04  David Sheldon <dave-mono@earth.li>
11177
11178   * expression.cs: Added matching ")" to error message for 
11179   CS0077
11180
11181 2004-01-03 Todd Berman <tberman@gentoo.org>
11182
11183         * ecore.cs, attribute.cs:
11184         Applying fix from #52429.
11185
11186 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11187
11188         * ecore.cs, expression.cs, statement.cs:
11189         Total rewrite of how we handle branching. We
11190         now handle complex boolean expressions with fewer
11191         jumps. As well if (x == 0) no longer emits a ceq.
11192
11193         if (x is Foo) is much faster now, because we generate
11194         better code.
11195
11196         Overall, we get a pretty big improvement on our benchmark
11197         tests. The code we generate is smaller and more readable.
11198
11199         I did a full two-stage bootstrap. The patch was reviewed
11200         by Martin and Miguel.
11201
11202 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11203
11204         * cs-parser.jay: Make primary_expression not take a QI.
11205         we dont need this because the member_access rule covers
11206         us here. So we replace the rule with just IDENTIFIER.
11207
11208         This has two good effects. First, we remove a s/r conflict.
11209         Second, we allocate many fewer QualifiedIdentifier objects.
11210
11211 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11212
11213         * attribute.cs: Handle MarshalAs attributes as pseudo, and
11214         set the correct information via SRE. This prevents
11215         hanging on the MS runtime. Fixes #29374.
11216
11217 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11218
11219         * convert.cs: correctly handle conversions to value types
11220         from Enum and ValueType as unboxing conversions.
11221
11222         Fixes bug #52569. Patch by Benjamin Jemlich.
11223
11224 2004-01-02  Ravi Pratap  <ravi@ximian.com>
11225
11226         * expression.cs (BetterConversion): Prefer int -> uint
11227         over int -> ulong (csc's behaviour). This fixed bug #52046.
11228
11229 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11230
11231         * decl.cs (MemberCache.FindMembers): now returns a
11232         MemberInfo [].
11233
11234         * typemanager.cs: In general, go with with ^^.
11235         (CopyNewMethods): take an IList.
11236         (RealMemberLookup): Only allocate an arraylist
11237         if we copy from two sets of methods.
11238
11239         This change basically does two things:
11240         1) Fewer array lists allocated due to CopyNewMethods.
11241         2) the explicit cast in MemberList costed ALOT.
11242
11243 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
11244
11245         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
11246         a hashtable to avoid needless string allocations when an identifier is
11247         used more than once (the common case).
11248
11249 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11250
11251         * pending.cs: MS's TypeBuilder.GetInterfaces ()
11252         is broken, it will not return anything. So, we
11253         have to use the information we have in mcs to
11254         do the task.
11255
11256         * typemanager.cs: Add a cache for GetInterfaces,
11257         since this will now be used more often (due to ^^)
11258
11259         (GetExplicitInterfaces) New method that gets the
11260         declared, not effective, interfaces on a type
11261         builder (eg, if you have interface IFoo, interface
11262         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
11263         { IBar }.
11264
11265         This patch makes MCS able to bootstrap itself on
11266         Windows again.
11267
11268 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11269
11270         * expression.cs: Remove the Nop's that Miguel put
11271         in by mistake.
11272
11273 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11274
11275         * report.cs, codegen.cs: Give the real stack trace to
11276         the error when an exception is thrown.
11277
11278 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11279
11280         * decl.cs: only allocate hashtables for ifaces if 
11281         it is an iface!
11282
11283 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11284
11285         * expression.cs: fix the error from cs0121-2.cs
11286         (a parent interface has two child interfaces that
11287         have a function with the same name and 0 params
11288         and the function is called through the parent).
11289
11290 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11291
11292         * class.cs, rootcontext.cs, typmanager.cs: do not
11293         leak pointers.
11294
11295 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11296
11297         * codegen.cs: remove stack for the ec flow branching.
11298         It is already a linked list, so no need.
11299
11300 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11301
11302         * Makefile: Allow custom profiler here.
11303
11304 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11305
11306         * typemanager.cs (LookupType):
11307           - Use a static char [], because split takes
11308             a param array for args, so it was allocating
11309             every time.
11310           - Do not store true in a hashtable, it boxes.
11311
11312 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11313
11314         * flowanalysis.cs: bytify common enums.
11315
11316 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11317
11318         * modifiers.cs: Add a new set of flags for the
11319         flags allowed on explicit interface impls.
11320         * cs-parser.jay: catch the use of modifiers in
11321         interfaces correctly.
11322         * class.cs: catch private void IFoo.Blah ().
11323
11324         All related to bug #50572.
11325
11326 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11327
11328         * decl.cs: Rewrite the consistant accessability checking.
11329         Accessability is not linear, it must be implemented in
11330         a tableish way. Fixes #49704.
11331
11332 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11333
11334         * expression.cs: Handle negation in a checked context.
11335         We must use subtraction from zero. Fixes #38674.
11336
11337 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11338
11339         * class.cs: Ignore static void main in DLLs.
11340         * rootcontext.cs: Handle the target type here,
11341         since we are have to access it from class.cs
11342         * driver.cs: account for the above.
11343
11344 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11345
11346         * report.cs: Give line numbers and files if available.
11347
11348 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
11349
11350         * driver.cs: Implement /addmodule.
11351
11352         * typemanager.cs:  Change 'modules' field so it now contains Modules not
11353         ModuleBuilders.
11354
11355 2003-12-20  Martin Baulig  <martin@ximian.com>
11356
11357         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11358         (FieldBase.IsAssigned): Removed this field.
11359         (FieldBase.SetAssigned): New public method.
11360         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11361
11362 2003-12-20  Martin Baulig  <martin@ximian.com>
11363
11364         * expression.cs (LocalVariableReference.DoResolve): Don't set
11365         `vi.Used' if we're called from DoResolveLValue().
11366
11367         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11368         returns the usage vector it just merged into the current one -
11369         pass this one to UsageWarning().
11370         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11371         of the `EmitContext', don't call this recursively on our children.
11372
11373 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
11374
11375         * driver.cs: Implement /target:module.
11376
11377 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
11378
11379         * support.cs (CharArrayHashtable): New helper class.
11380
11381         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
11382         char arrays, not strings, so we can avoid creating a string in
11383         consume_identifier if the identifier is a keyword.
11384
11385 2003-12-16  Martin Baulig  <martin@ximian.com>
11386
11387         * statement.cs (LocalInfo.Assigned): Removed this property.
11388         (LocalInfo.Flags): Removed `Assigned'.
11389         (LocalInfo.IsAssigned): New public method; takes the EmitContext
11390         and uses flow analysis.
11391         (Block.UsageWarning): Made this method private.
11392         (Block.Resolve): Call UsageWarning() if appropriate.
11393
11394         * expression.cs (LocalVariableReference.DoResolve): Always set
11395         LocalInfo.Used here.
11396
11397 2003-12-13  Martin Baulig  <martin@ximian.com>
11398
11399         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11400         any value here; we're now using flow analysis to figure out
11401         whether a statement/block returns a value.
11402
11403 2003-12-13  Martin Baulig  <martin@ximian.com>
11404
11405         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
11406         working again.
11407         (FlowBranching.MergeFinally): Don't call
11408         `branching.CheckOutParameters()' here, this is called in
11409         MergeTopBlock().
11410         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
11411         when adding the `finally' vector.       
11412
11413 2003-12-13  Martin Baulig  <martin@ximian.com>
11414
11415         * flowanalysis.cs
11416         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
11417         actually work and also fix #48962.
11418
11419 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11420
11421         * decl.cs: Do not check System.Object for nested types,
11422         since we know it does not have any. Big bang for buck:
11423
11424         BEFORE:
11425            Run 1:   8.35 seconds
11426            Run 2:   8.32 seconds
11427            corlib:  17.99 seconds
11428         AFTER:
11429            Run 1:   8.17 seconds
11430            Run 2:   8.17 seconds
11431            corlib:  17.39 seconds
11432
11433 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
11434
11435         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
11436         time we are returning 0 members, so we save alot here.
11437
11438 2003-12-11  Martin Baulig  <martin@ximian.com>
11439
11440         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
11441         `MergeChild()', also just take the `FlowBranching' as argument;
11442         call Merge() on it and return the result.
11443         (FlowBranching.Merge): We don't need to do anything if we just
11444         have one sibling.
11445
11446 2003-12-11  Martin Baulig  <martin@ximian.com>
11447
11448         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
11449         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
11450         Maurer for this idea.
11451
11452 2003-12-11  Martin Baulig  <martin@ximian.com>
11453
11454         * flowanalysis.cs (MergeResult): This class is now gone; we now
11455         use the `UsageVector' for this.  The reason for this is that if a
11456         branching just has one sibling, we don't need to "merge" them at
11457         all - that's the next step to do.
11458         (FlowBranching.Merge): We now return a `UsageVector' instead of a
11459         `MergeResult'.
11460
11461 2003-12-11  Martin Baulig  <martin@ximian.com>
11462
11463         Reworked flow analyis and made it more precise and bug-free.  The
11464         most important change is that we're now using a special `Reachability'
11465         class instead of having "magic" meanings of `FlowReturns'.  I'll
11466         do some more cleanups and optimizations and also add some more
11467         documentation this week.
11468
11469         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
11470         largely reworked this class.
11471         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
11472         the new `Reachability' class instead of having "magic" values here.
11473         (FlowBranching): We're now using an instance of `Reachability'
11474         instead of having separate `Returns', `Breaks' etc. fields.
11475
11476         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
11477         based on flow analysis; ignore the return value of block.Emit ().
11478
11479 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
11480
11481         * driver.cs typemanager.cs: Find the mono extensions to corlib even
11482         if they are private.
11483
11484 2003-12-09  Martin Baulig  <martin@ximian.com>
11485
11486         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
11487         call them directly on the UsageVector.
11488
11489 2003-12-09  Martin Baulig  <martin@ximian.com>
11490
11491         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
11492         Changed return type from `FlowReturns' to `Reachability'.
11493
11494 2003-12-09  Martin Baulig  <martin@ximian.com>
11495
11496         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
11497         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
11498         `Reachable' fields with a single `Reachability' one.
11499
11500 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11501
11502         * class.cs (FindMembers): Remove foreach's.
11503
11504         Bootstrap times:
11505
11506         BEFORE
11507                 Run 1:   8.74 seconds
11508                 Run 2:   8.71 seconds
11509
11510         AFTER
11511                 Run 1:   8.64 seconds
11512                 Run 2:   8.58 seconds
11513
11514
11515 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11516
11517         * cs-parser.jay:
11518         * gen-treedump.cs:
11519         * statement.cs:
11520         This patch does a few things:
11521                 1. EmptyStatement is now a singleton, so it is never reallocated.
11522                 2. All blah is EmptyStatement constructs have been changed to
11523                    blah == EmptyStatement.Value, which is much faster and valid
11524                    now that EmptyStatement is a singleton.
11525                 3. When resolving a block, rather than allocating a new array for
11526                    the non-empty statements, empty statements are replaced with
11527                    EmptyStatement.Value
11528                 4. Some recursive functions have been made non-recursive.
11529         Mainly the performance impact is from (3), however (1) and (2) are needed for
11530         this to work. (4) does not make a big difference in normal situations, however
11531         it makes the profile look saner.
11532
11533         Bootstrap times:
11534
11535         BEFORE
11536         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11537         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11538         Total memory allocated: 56397 KB
11539
11540         AFTER
11541         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
11542         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
11543         Total memory allocated: 55666 KB
11544
11545 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11546
11547         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
11548         than the hashtable in a hashtable version
11549
11550         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
11551         we always end up concating a string. This results in a huge perf
11552         loss, because many strings have to be tracked by the GC. In this
11553         patch, we first use a hashtable that works with two keys, so that
11554         the strings do not need to be concat'ed.
11555
11556         Bootstrap times:
11557         BEFORE
11558                 Run 1:   8.74 seconds
11559                 Run 2:   8.71 seconds
11560
11561         AFTER
11562                 Run 1:   8.65 seconds
11563                 Run 2:   8.56 seconds
11564
11565 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11566
11567         * Makefile: Add a new target `do-time' that does a quick and simple
11568         profile, leaving easy to parse output.
11569
11570 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
11571
11572         * codegen.cs (Init): Create the dynamic assembly with 
11573         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
11574
11575 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11576
11577         * support.cs: Make the PtrHashtable use only one
11578         instance of its comparer.
11579
11580 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
11581
11582         * typemanager.cs: Fix lookup of GetNamespaces.
11583
11584 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
11585
11586         * expression.cs: Removed redundant line.
11587
11588         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
11589         ArrayLists, use for loops with bounds.  
11590
11591         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
11592         arraylist.
11593
11594         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
11595         arraylists, use for loop with bounds.
11596
11597         The above three changes give us a 0.071 second performance
11598         improvement out of 3.294 seconds down to 3.223.  On my machine
11599         the above changes reduced the memory usage by 1,387 KB during
11600         compiler bootstrap.
11601
11602         * cs-parser.jay (QualifiedIdentifier): New class used to represent
11603         QualifiedIdentifiers.  Before we created a new string through
11604         concatenation, and mostly later on, the result would be
11605         manipulated by DecomposeQI through string manipulation.
11606
11607         This reduced the compiler memory usage for bootstrapping from
11608         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
11609         compile times in 0.05 seconds.
11610
11611 2003-11-28  Dick Porter  <dick@ximian.com>
11612
11613         * support.cs: Do string compares with the Invariant culture.
11614
11615         * rootcontext.cs: 
11616         * gen-treedump.cs: 
11617         * expression.cs: 
11618         * driver.cs: 
11619         * decl.cs: 
11620         * codegen.cs: 
11621         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
11622         the comparison is done with the Invariant culture.
11623
11624 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
11625
11626         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
11627         GetEnumerator method.
11628
11629         (ProbeCollectionType): Iterate starting at the most specific type
11630         upwards looking for a GetEnumerator
11631
11632         * expression.cs: Shift count can be up to 31 for int/uint and 63
11633         for long/ulong.
11634
11635 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
11636
11637         * statement.cs (Block.LookupLabel): Also look for the label on the
11638         children blocks.  Use a hash table to keep track of visited
11639         nodes. 
11640
11641         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
11642         we actually did transform the other operand, otherwise fall back
11643         to the common codepath that casts to long.
11644
11645         * cs-tokenizer.cs: Use the same code pattern as the int case.
11646         Maybe I should do the parsing myself, and avoid depending on the
11647         Parse routines to get this done.
11648
11649 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
11650
11651         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
11652         which fixes bug 51347.  This time test it.
11653
11654         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
11655         attributes for example can not tell the difference between these.
11656         The difference was only a syntax feature of the language. 
11657
11658         * attribute.cs: Apply attributes to delegates.
11659
11660         * delegate.cs: Call the apply attributes method.
11661
11662 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
11663
11664         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
11665         comparing 0 vs Byte.MinValue, not the value
11666
11667         (ImplicitConversionRequired): When reporting a conversion error,
11668         use error 31 to print out the constant error instead of the
11669         simpler 29.
11670
11671         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
11672         which fixes bug 51347.
11673
11674 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
11675
11676         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
11677         which fixes the -warnaserror command line option.
11678
11679 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
11680
11681         * cfold.cs (DoNumericPromotions): During constant folding of
11682         additions on UIntConstant, special case intconstants with
11683         IntConstants like we do on the expression binary operator. 
11684
11685 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
11686
11687         * convert.cs (ImplicitReferenceConversion): We were missing a case
11688         (System.Enum are not value types or class types, so we need to
11689         classify them separatedly).
11690
11691         * driver.cs: We do not support error 2007.
11692
11693 2003-11-12 Jackson Harper <jackson@ximian.com>
11694
11695         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
11696         system directory. Also use the full file name so users can
11697         libraries names mscorlib-o-tron.dll in a non system dir.
11698         
11699 2004-01-04  David Sheldon <dave-mono@earth.li>
11700
11701         * expression.cs: Added matching ")" to error message for CS0077.
11702
11703 2003-12-19  Martin Baulig  <martin@ximian.com>
11704
11705         * typemanager.cs (TypeManager.IsEqualGenericType): New public
11706         static method; see documentation in the method.
11707         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
11708
11709         * convert.cs (Convert.ImplicitReferenceConversion,
11710         Convert.ImplicitReferenceConversionExists): Add support for
11711         generic type declarations; see gen-36.cs.
11712
11713 2003-12-19  Martin Baulig  <martin@ximian.com>
11714
11715         * pending.cs (Pending.InterfaceMethod): Use
11716         `Type.IsAssignableFrom()' instead of `=='.
11717
11718 2003-12-18  Martin Baulig  <martin@ximian.com>
11719
11720         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
11721         byref types first.
11722
11723         * convert.cs (Convert.ImplicitStandardConversionExists): Use
11724         `expr_type.Equals (target_type)' instead of `=='.
11725
11726 2003-12-08  Martin Baulig  <martin@ximian.com>
11727
11728         * generics.cs (Constraints.Types): Removed.
11729         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
11730         to Type's.
11731         (Constraints.ResolveTypes): New public method; resolves the
11732         TypeExpr's to Type's.
11733         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
11734         longer takes the constraints.
11735         (TypeParameter.DefineMethod): Likewise.
11736         (TypeParameter.DefineType): New public method.  Calls
11737         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
11738         the constraints.
11739
11740 2003-12-08  Martin Baulig  <martin@ximian.com>
11741
11742         * convert.cs (Convert.ImplicitConversionStandard): Use
11743         `expr_type.Equals (target_type)' instead of `=='.
11744
11745 2003-12-08  Martin Baulig  <martin@ximian.com>
11746
11747         * typemanager.cs (TypeManager.GetReferenceType): Call
11748         `Type.MakeByRefType ()'.
11749
11750 2003-12-08  Martin Baulig  <martin@ximian.com>
11751
11752         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
11753         just has some special meaning in some situations.  For instance,
11754         it is allowed to use `where' as the name of a variable etc.
11755
11756 2003-12-04  Martin Baulig  <martin@ximian.com>
11757
11758         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
11759         `Type.MakeArrayType()' for array types.
11760
11761 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
11762
11763         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
11764         debugging message.
11765
11766         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
11767         corlib to compile.
11768
11769 2003-11-16  Martin Baulig  <martin@ximian.com>
11770
11771         * codegen.cs (EmitContext.IsGeneric): Removed.
11772
11773         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
11774         ResolveGeneric() on the DeclSpace.
11775
11776 2003-11-16  Martin Baulig  <martin@ximian.com>
11777
11778         * generic.cs (TypeArguments.Resolve):
11779         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
11780         `ResolveType()' on it to get the Type.
11781
11782 2003-11-15  Martin Baulig  <martin@ximian.com>
11783
11784         * generic.cs (ConstructedType.GetInterfaces): Override this.
11785
11786 2003-11-14  Martin Baulig  <martin@ximian.com>
11787
11788         * interface.cs (Interface.DefineType): Define all type parameters
11789         before adding the interfaces we inherit.
11790
11791 2003-11-11  Martin Baulig  <martin@ximian.com>
11792
11793         * generic.cs (ConstructedType.ResolveType): Always call
11794         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
11795
11796 2003-11-10  Martin Baulig  <martin@ximian.com>
11797
11798         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
11799         (TypeManager.InitCoreTypes): Initialize them here, but instead of
11800         calling `ResolveType()' on them, directly assign their `Type'.
11801
11802 2003-11-08  Martin Baulig  <martin@ximian.com>
11803
11804         * generic.cs (ConstructedType): Override `IsClass' etc.
11805
11806 2003-11-08  Martin Baulig  <martin@ximian.com>
11807
11808         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
11809         return value and the `out parent' parameter.
11810         (TypeContainer.DefineType): Moved the CS0644 check into
11811         GetClassBases().  Don't pass the interface types to the
11812         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
11813         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
11814
11815         * ecore.cs (TypeExpr.IsAttribute): New property.
11816         (TypeExpr.GetInterfaces): New method.
11817
11818         * interface.cs (Interface.GetInterfaceTypeByName): Return a
11819         TypeExpr instead of a Type.
11820         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
11821         (Interface.DefineType): Don't pass the interface types to the
11822         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
11823         them later and then call `TypeBulider.AddInterfaceImplementation()'.
11824
11825         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
11826         instead of a `Type[]'.
11827         (TypeManager.RegisterBuilder): Likewise.
11828         (TypeManager.AddUserInterface): Likewise.
11829         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
11830         `Type[]' and also return a `TypeExpr[]'.
11831         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
11832
11833 2003-11-08  Martin Baulig  <martin@ximian.com>
11834
11835         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
11836         Expression.     
11837
11838 2003-11-08  Martin Baulig  <martin@ximian.com>
11839
11840         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
11841         TypeManager.ResolveExpressionTypes().
11842
11843         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
11844         instead of an Expression.
11845         (TypeExpr): This is now an abstract base class for `TypeExpression'.
11846         (TypeExpression): New public class; formerly known as `TypeExpr'.
11847
11848         * expression.cs (ComposedCast): Derive from TypeExpr.
11849
11850         * typemanager.cs (TypeManager.system_*_expr): These are now
11851         TypExpr's instead of Expression's.
11852         (TypeManager.ResolveExpressionTypes): New public static function;
11853         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
11854         of them.        
11855
11856 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
11857
11858         * expression.cs (New.DoResolve): Do not dereference value that
11859         might be a null return.
11860
11861         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
11862         sure that the constant value has the right type.  Fixes an
11863         unreported bug, similar to 50425.
11864
11865         * const.cs (Const.LookupConstantValue): Call
11866         ImplicitStandardConversionExists before doing a conversion to
11867         avoid havng the TypeManager.ChangeType do conversions.
11868
11869         Reduced the number of casts used
11870
11871         (Const.ChangeType): New routine to enable reuse of the constant
11872         type changing code from statement.
11873
11874         * typemanager.cs (ChangeType): Move common initialization to
11875         static global variables.
11876
11877         Fixes #50425.
11878
11879         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
11880         every value type to go through, even if it was void.  Fix that. 
11881
11882         * cs-tokenizer.cs: Use is_identifier_start_character on the start
11883         character of the define, and the is_identifier_part_character for
11884         the rest of the string.
11885
11886 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
11887
11888         * expression.cs (UnaryMutator.EmitCode): When I updated
11889         LocalVariableReference.DoResolve, I overdid it, and dropped an
11890         optimization done on local variable references.
11891
11892 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
11893
11894         * ecore.cs: Convert the return from Ldlen into an int.
11895
11896 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
11897
11898         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
11899         the accessibility, this is a special case for toplevel non-public
11900         classes (internal for instance).
11901
11902 2003-10-20  Nick Drochak <ndrochak@gol.com>
11903
11904         * ecore.cs: Fix typo and build.  Needed another right paren.
11905
11906 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
11907
11908         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
11909         `internal' case regular and protected, but not allowing protected
11910         to be evaluated later.  Bug 49840
11911
11912 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
11913
11914         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
11915         to kb.Nlast, and not the kb.nFirst to isolate the switch
11916         statement.
11917
11918         Extract the underlying type, so enumerations of long/ulong are
11919         treated like long/ulong.
11920
11921 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
11922
11923         * expression.cs (New): Overload the meaning of RequestedType to
11924         track the possible creation of the NewDelegate type, since
11925         DoResolve is invoked more than once for new constructors on field
11926         initialization.
11927
11928         See bugs: #48800 and #37014
11929
11930         * cs-parser.jay (declare_local_constants): Take an arraylist
11931         instead of a single constant.
11932
11933         (local_constant_declaration): It should take a
11934         constant_declarators, not a constant_declarator.  Fixes 49487
11935
11936         * convert.cs: Fix error report.
11937
11938 2003-10-13 Jackson Harper <jackson@ximian.com>
11939
11940         * typemanager.cs (TypeToCoreType): Add float and double this fixes
11941         bug #49611
11942         
11943 2003-11-03  Martin Baulig  <martin@ximian.com>
11944
11945         * expression.cs (ArrayAccess.GetStoreOpcode): Added
11946         `out bool has_type_arg'; if set, we need to pass the type to
11947         ig.Emit().
11948         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
11949         Stelem_Any/Ldelem_Any for generic parameters.   
11950
11951 2003-11-02  Martin Baulig  <martin@ximian.com>
11952
11953         * expression.cs (Invocation.EmitCall): Use
11954         `TypeManager.IsValueType()' to check whether it's a value type.
11955         Don't set `struct_call' when calling a method on a type parameter.
11956
11957 2003-11-02  Martin Baulig  <martin@ximian.com>
11958
11959         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
11960         and removed the TypeBuilder argument.
11961
11962         * typemanager.cs (TypeManager.IsValueType): Return
11963         `t.IsGenericParameter || t.IsValueType'.
11964
11965 2003-10-25  Martin Baulig  <martin@ximian.com>
11966
11967         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
11968         call ConstructedType.Resolve() on it.
11969
11970         * generic.cs (ConstructedType.Resolve): Set `type' on success.
11971
11972 2003-10-25  Martin Baulig  <martin@ximian.com>
11973
11974         * class.cs (TypeContainer.GetClassBases): Changed
11975         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
11976         CS8214 reporting here.
11977         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
11978         instead of a `Type' for our parent.  In case of a recursive
11979         declaration (see tests/gen-23.cs for an example), our parent is a
11980         ConstructedType and it doesn't have its type set.  So, first
11981         create our own TypeBuilder, then call constructed.Resolve() to get
11982         the parent's type and finally TypeBuilder.SetParent() it.
11983
11984         * ecore.cs (TypeExpr.Name): New public virtual property.
11985
11986         * generic.cs
11987         (ConstructedType): We're now a TypeExpr and not just an Expression.
11988         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
11989         arguments here; this is done later.
11990         (ConstructedType.Resolve): New public method to resolve the type
11991         arguments and bind them.
11992
11993 2003-10-21  Martin Baulig  <martin@ximian.com>
11994
11995         * convert.cs: Use `TypeManager.IsValueType' instead of
11996         'type.IsValueType' everywhere.
11997
11998         * typemanager.cs (TypeManager.IsValueType): Return true for type
11999         parameters.  The reason for this is that we need to box a type
12000         parameter when converting it to a reference type.
12001
12002         * cs-parser.jay: Added support for default value expressions.
12003
12004         * generics.cs (DefaultValueExpression): New public class.       
12005
12006 2003-10-17  Martin Baulig  <martin@ximian.com>
12007
12008         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
12009         TypeContainer so we can also use this for Interfaces.
12010         (TypeParameter.Resolve): Likewise.
12011
12012         * interface.cs (Interface.DefineType): Added support for generic
12013         interfaces.
12014
12015         * cs-parser.jay: Added support for generic structs and interfaces.
12016
12017 2003-10-17  Martin Baulig  <martin@ximian.com>
12018
12019         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
12020         call generic methods :-)
12021
12022 2003-10-16  Martin Baulig  <martin@ximian.com>
12023
12024         * cs-parser.jay (namespace_or_type_name): Only create a
12025         GenericMemberAccess if we actually have type arguments.
12026
12027 2003-10-13  Martin Baulig  <martin@ximian.com>
12028
12029         * class.cs (Method.Define): If we're a generic method, call
12030         TypeBuilder.DefineGenericMethod () before resolving
12031         the parameters.
12032         (MethodData): Added .ctor which takes an additional MethodBuilder
12033         argument; this is used for generic methods.
12034         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
12035         we already have a MethodBuilder.
12036
12037 2003-10-10  Martin Baulig  <martin@ximian.com>
12038
12039         * class.cs (Method): Added .ctor which takes a `GenericMethod'
12040         instead of a `DeclSpace'.  This is used for generic methods.
12041
12042         * cs-parser.jay (method_header): Added support for generic
12043         methods; create a `GenericMethod' instance and pass it to the
12044         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
12045         parameters and locals.
12046
12047         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
12048         since we already have the location.  Check whether we're a generic
12049         type declaration or a generic method and create the correct type
12050         parameter.
12051
12052         * generic.cs (TypeParameter.DefineMethod): New public method.
12053         (GenericMethod): New public class; derives from DeclSpace and is
12054         used for generic methods.       
12055
12056 2003-10-09  Martin Baulig  <martin@ximian.com>
12057
12058         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12059         to the .ctor.
12060         (MethodCore.DoDefineParameters): Removed the TypeContainer
12061         argument; use the DeclSpace which was passed to the .ctor instead.
12062         (MethodCore.CheckParameter): Take a DeclSpace instead of a
12063         TypeContainer; we only need a DeclSpace here.
12064
12065 2003-10-09  Martin Baulig  <martin@ximian.com>
12066
12067         * class.cs (MethodData): Added additional `DeclSpace ds' argument
12068         to the .ctor.
12069         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12070         EmitContext's .ctor.    
12071
12072 2003-10-09  Martin Baulig  <martin@ximian.com>
12073
12074         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12075         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12076         AsAccessible(), moved them as well.
12077
12078         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12079
12080 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
12081
12082         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12083         generation for >=, as spotted by Paolo, bug 48679.  
12084         Patch from David Waite.
12085
12086         * cs-tokenizer.cs: Add handling for #pragma.
12087
12088         * cs-parser.jay: Allow for both yield and yield return in the
12089         syntax.  The anti-cobolization of C# fight will go on!
12090
12091         * class.cs (TypeBuilder.DefineType): Catch error condition here
12092         (Parent.DefineType erroring out and returning null).
12093
12094         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12095         coping with enumerations variables, we were mistakenly processing
12096         them as a regular value type instead of built-in types.  Fixes the
12097         bug #48063
12098
12099         * typemanager.cs (IsBuiltinOrEnum): New method.
12100
12101 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
12102
12103         * cs-parser.jay: Upgrade: yield now needs the return clause.
12104
12105 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12106
12107         * cs-parser.jay : Renamed yyName to yyNames related to jay.
12108
12109 2003-09-29  Martin Baulig  <martin@ximian.com>
12110
12111         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
12112         inflated generic methods.
12113
12114         * generics.cs (ConstructedType): Distinguish between open and
12115         closed constructed types; correctly resolve the arguments.
12116
12117 2003-09-22  Martin Baulig  <martin@ximian.com>
12118
12119         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
12120         all type arguments meet their constraints.
12121
12122 2003-09-19  Martin Baulig  <martin@ximian.com>
12123
12124         * decl.cs (MemberCache.SetupCacheForInterface): Take a
12125         `MemberCache parent' argument.  Normally, an interface doesn't
12126         have a parent type except System.Object, but we use this in gmcs
12127         for generic type parameters.
12128
12129 2003-09-18  Martin Baulig  <martin@ximian.com>
12130
12131         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12132         on `type.IsInterface'; don't check whether the type has a parent
12133         to determine whether it's an interface.
12134
12135 2003-09-17  Martin Baulig  <martin@ximian.com>
12136
12137         * generic.cs (ConstructedType.ToString): Always use `name' as the
12138         type name.
12139
12140 2003-09-15  Martin Baulig  <martin@ximian.com>
12141
12142         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
12143
12144         * generic.cs (Constraints.Resolve): New public method; this is
12145         called to resolve the constraint types and to check whether all
12146         the constraints are correct.
12147         (Constraints.Types): New public property.
12148         (TypeParameter.Resolve): New public method; resolves all the
12149         type's constraints.
12150
12151         * class.cs (TypeContainer.DefineType): Call
12152         TypeParameter.Resolve() before actually defining the type.
12153
12154 2003-09-15  Martin Baulig  <martin@ximian.com>
12155
12156         * class.cs (TypeContainer.DefineType): Added an error flag to
12157         avoid reporting duplicate CS0146's ("class definition is
12158         circular.").
12159
12160         * driver.cs (Driver.MainDriver): Abort if
12161         RootContext.ResolveTree() reported any errors.
12162
12163 2003-09-07  Martin Baulig  <martin@ximian.com>
12164
12165         * report.cs (Error, Warning): Added overloaded versions which take
12166         a `params object[] args' and call String.Format().
12167
12168 2003-09-07  Martin Baulig  <martin@ximian.com>
12169
12170         * decl.cs (DeclSpace..ctor): Don't call
12171         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12172         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
12173         (DeclSpace.RecordDecl): New method.
12174
12175         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12176
12177 2003-09-02  Ravi Pratap  <ravi@ximian.com>
12178
12179         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12180         value attributes to be applied to ParameterBuilders.
12181
12182         * class.cs (MethodCore.LabelParameters): Make static and more
12183         generic so that it can be used from other places - like interface
12184         methods, for instance.
12185
12186         * interface.cs (Interface.Emit): Call LabelParameters before
12187         emitting attributes on the InterfaceMethod.
12188
12189 2003-09-07  Martin Baulig  <martin@ximian.com>
12190
12191         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
12192         if the number of type parameters doesn't match.
12193
12194 2003-09-04  Martin Baulig  <martin@ximian.com>
12195
12196         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
12197         for arrays of generic type params (ie. `!0[]').
12198
12199 2003-09-04  Martin Baulig  <martin@ximian.com>
12200
12201         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
12202         for the moment.
12203
12204 2003-09-04  Martin Baulig  <martin@ximian.com>
12205
12206         * decl.cs (DeclSpace.LookupGeneric): New method.
12207         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
12208         moment.
12209
12210         * generic.cs (TypeParameterExpr): Take a TypeParameter as
12211         argument, not just a string.
12212         (TypeParameter.Define): New public method; this is called to
12213         actually define the generic parameter; after this, you can use the
12214         new `Type' property to get the type.
12215
12216 2003-09-04  Martin Baulig  <martin@ximian.com>
12217
12218         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
12219         is now an ArrayList; initialize the result of the `TypeParameters'
12220         property here.
12221         (DeclSpace.GetGenericData): Removed.
12222         (DeclSpace.LookupGeneric): Temporarily removed; we need to
12223         implement this in a different way.
12224         (DeclSpace.GetTypeParameters): Removed; there's now a
12225         `TypeParameters' property.
12226         (DeclSpace.TypeParameters): New public property.
12227
12228         * generic.cs (Constraints): Make this class public.
12229         (TypeParameter): New public class.
12230
12231 2003-09-04  Martin Baulig  <martin@ximian.com>
12232
12233         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
12234         generic parameters.
12235
12236         * class.cs (TypeContainer.DefineType): Call
12237         TypeBuilder.DefineGenericParameter () on all generic parameters if
12238         this is a generic type.
12239
12240 2003-08-28  Martin Baulig  <martin@ximian.com>
12241
12242         * sample-stack.il: Compile this with ilasm: "ilasm /dll
12243         sample-stack.il".
12244
12245         * sample-hello.cs: Compile this with gmcs: "gmcs
12246         /r:sample-stack.dll sample-hello.cs".
12247
12248 2003-08-28  Martin Baulig  <martin@ximian.com>
12249
12250         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
12251         the parameters to the generic type.
12252
12253 2003-08-28  Martin Baulig  <martin@ximian.com>
12254
12255         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
12256
12257 2003-08-28  Martin Baulig  <martin@ximian.com>
12258
12259         * cs-parser.jay (opt_type_argument_list): Use
12260         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
12261         (primary_expression): Replace `qualified_identifier' with `type_name'.
12262         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
12263
12264         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
12265         parser to check whether it is syntactically a type parameter list;
12266         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
12267         this case.
12268
12269 2003-08-26  Martin Baulig  <martin@ximian.com>
12270
12271         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12272         resolving aliases; fixes #47927.
12273
12274 2003-08-26  Martin Baulig  <martin@ximian.com>
12275
12276         * statement.cs (Using.DoResolve): This is internally emitting a
12277         try/finally clause, so we need to set ec.NeedExplicitReturn if we
12278         do not always return.  Fixes #47681.
12279
12280 2003-08-26  Martin Baulig  <martin@ximian.com>
12281
12282         * decl.cs (MemberCore): Moved WarningNotHiding(),
12283         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
12284         into MemberBase.
12285         (AdditionResult): Make this nested in DeclSpace.
12286         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
12287         argument; call NamespaceEntry.Define() unless we're nested in a
12288         class or struct.
12289
12290         * namespace.cs (Namespace.DefineName): New public function.  This
12291         is called from DeclSpace's .ctor to add 
12292         (Namespace.Lookup): Include DeclSpaces in the lookup.
12293
12294         * class.cs (Operator): Derive from MemberBase, not MemberCore.
12295
12296         * const.cs (Const): Derive from MemberBase, not MemberCore.     
12297
12298 2003-08-25  Martin Baulig  <martin@ximian.com>
12299
12300         * convert.cs (Convert.ExplicitReferenceConversion): When
12301         converting from an interface type to a class, unbox if the target
12302         type is a struct type.  Fixes #47822.
12303
12304 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12305
12306         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
12307         #47854.
12308
12309 2003-08-22  Martin Baulig  <martin@ximian.com>
12310
12311         * class.cs (TypeManager.DefineType): When defining a nested type,
12312         call DefineType() on our parent; fixes #47801.
12313
12314 2003-08-22  Martin Baulig  <martin@ximian.com>
12315
12316         * class.cs (MethodData.Define): While checking if a method is an
12317         interface implementation, improve the test a bit more to fix #47654.
12318
12319 2003-08-22  Martin Baulig  <martin@ximian.com>
12320
12321         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
12322         correctly; fixes #47722.
12323
12324 2003-08-22  Martin Baulig  <martin@ximian.com>
12325
12326         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
12327         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
12328
12329         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
12330
12331 2003-08-22  Martin Baulig  <martin@ximian.com>
12332
12333         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
12334         can only be assigned in static constructors.  Fixes #47161.
12335
12336 2003-08-22  Martin Baulig  <martin@ximian.com>
12337
12338         Rewrote and improved the flow analysis code.
12339
12340         * flowbranching.cs (FlowBranching): Make this class abstract.
12341         (FlowBranching.CreateBranching): New static function to create a
12342         new flow branching.
12343         (FlowBranchingBlock, FlowBranchingException): New classes.
12344         (FlowBranching.UsageVector.Type): New public readonly field.
12345         (FlowBranching.UsageVector.Breaks): Removed the setter.
12346         (FlowBranching.UsageVector.Returns): Removed the setter.
12347         (FlowBranching.UsageVector): Added Break(), Return(),
12348         NeverReachable() and Throw() methods to modify the reachability.
12349         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
12350         done by FlowBranching.Merge().
12351         (FlowBranching.UsageVector.MergeChild): New method; merges the
12352         merge result into the current vector.
12353         (FlowBranching.Merge): New abstract method to merge a branching.
12354
12355 2003-08-12  Martin Baulig  <martin@ximian.com>
12356
12357         * expression.cs (Indirection.CacheTemporaries): Create the
12358         LocalTemporary with the pointer type, not its element type.
12359
12360 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
12361
12362         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
12363         token was a keyword or not.
12364
12365         Add `error' options where an IDENTIFIER was expected;  Provide
12366         CheckToken and CheckIdentifierToken convenience error reporting
12367         functions. 
12368
12369         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
12370
12371         * decl.cs: Rename `NamespaceEntry Namespace' public field into
12372         NameSpaceEntry NameSpaceEntry.
12373
12374         (LookupInterfaceOrClass): Avoid creating a full qualified name
12375         from namespace and name: avoid doing lookups when we know the
12376         namespace is non-existant.   Use new Tree.LookupByNamespace which
12377         looks up DeclSpaces based on their namespace, name pair.
12378
12379         * driver.cs: Provide a new `parser verbose' to display the
12380         exception thrown during parsing.  This is turned off by default
12381         now, so the output of a failure from mcs is more graceful.
12382
12383         * namespace.cs: Track all the namespaces defined in a hashtable
12384         for quick lookup.
12385
12386         (IsNamespace): New method
12387
12388 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
12389
12390         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
12391         we know that we need to concatenate (full typename can never be
12392         null). 
12393
12394         * class.cs: ditto.
12395
12396         * statement.cs: Use a bitfield;  Do not initialize to null things
12397         which are done by the constructor by default.
12398
12399         * cs-parser.jay: bug fix, parameter was 4, not 3.
12400
12401         * expression.cs: Just use the property;
12402
12403         * statement.cs: No need for GetVariableInfo method.
12404
12405 2003-08-08  Martin Baulig  <martin@ximian.com>
12406
12407         * flowanalysis.cs (FlowReturns): This is now nested in the
12408         `FlowBranching' class.
12409         (MyBitVector): Moved this here from statement.cs.
12410         (FlowBranching.SiblingType): New enum type.
12411         (FlowBranching.CreateSibling): Added `SiblingType' argument.
12412
12413 2003-08-07  Martin Baulig  <martin@ximian.com>
12414
12415         * flowanalysis.cs (FlowBranchingType): This is now nested in the
12416         `FlowBranching' class and called `BranchingType'.
12417
12418 2003-08-07  Martin Baulig  <martin@ximian.com>
12419
12420         * flowanalysis.cs: Moved all the control flow analysis code into
12421         its own file.
12422
12423 2003-08-07  Martin Baulig  <martin@ximian.com>
12424
12425         * assign.cs (Assign.DoResolve): `target' must either be an
12426         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
12427         #37319.
12428
12429 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
12430
12431         * expression.cs (BinaryMethod): This kind of expression is created by the
12432         Binary class if it determines that the operator has to be handled
12433         by a method.
12434
12435         (BinaryDelegate): This kind of expression is created if we are
12436         dealing with a + or - operator on delegates.
12437
12438         (Binary): remove method, argumetns, and DelegateOperator: when
12439         dealing with methods, 
12440
12441         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
12442
12443         * statement.cs (Block): use bitfields for the three extra booleans
12444         we had in use.   Remove unused topblock parameter.
12445
12446         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
12447
12448         * assign.cs: Drop extra unneeded tests.
12449
12450 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
12451
12452         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
12453
12454         * statement.cs (Foreach): Use VariableStorage instead of
12455         LocalBuilders.   
12456
12457         * codegen.cs (VariableStorage): New class used by clients that
12458         require a variable stored: locals or fields for variables that
12459         need to live across yield.
12460
12461         Maybe provide a convenience api for EmitThis+EmitLoad?
12462
12463         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
12464         these bad boys.
12465
12466 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
12467
12468         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
12469         RemapParameterLValue): New methods that are used to turn a
12470         precomputed FieldInfo into an expression like this:
12471
12472                 instance.FieldInfo
12473
12474         The idea is to use this instead of making LocalVariableReference
12475         have more than one meaning.
12476
12477         * cs-parser.jay: Add error production to BASE.
12478
12479         * ecore.cs: Deal with TypeManager.GetField returning null, which
12480         is now a valid return value.
12481
12482         (FieldExprNoAddress): New expression for Fields whose address can
12483         not be taken.
12484
12485         * expression.cs (LocalVariableReference): During the resolve
12486         phases, create new expressions if we are in a remapping context.
12487         Remove code that dealt with remapping here.
12488
12489         (ParameterReference): same.
12490
12491         (ProxyInstance): New expression, like the `This' expression, but
12492         it is born fully resolved.  We know what we are doing, so remove
12493         the errors that are targeted to user-provided uses of `this'.
12494
12495         * statement.cs (Foreach): our variable is now stored as an
12496         Expression;  During resolution, follow the protocol, dont just
12497         assume it will return this.
12498
12499 2003-08-06  Martin Baulig  <martin@ximian.com>
12500
12501         * support.cs (SeekableStreamReader.cs): New public class.
12502
12503         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
12504         SeekableStreamReader instead of the normal StreamReader.
12505
12506 2003-08-04  Martin Baulig  <martin@ximian.com>
12507
12508         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
12509         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
12510         deambiguate casts and delegate invocations.
12511         (parenthesized_expression): Use the new tokens to ensure this is
12512         not a cast of method invocation.
12513
12514         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
12515         when reading a `)' and Deambiguate_CloseParens () was previously
12516         called.
12517
12518         * expression.cs (ParenthesizedExpression): New class.  This is
12519         just used for the CS0075 test.
12520         (Binary.DoResolve): Check for CS0075.   
12521
12522 2003-07-29  Ravi Pratap  <ravi@ximian.com>
12523
12524         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
12525         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
12526         reference comparison.
12527
12528         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
12529         examine the ReturnType for equality - this is necessary in the
12530         cases of implicit and explicit operators whose signature also
12531         includes the return type.
12532
12533 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
12534
12535         * namespace.cs: Cache the result of the namespace computation,
12536         instead of computing it every time.
12537
12538 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
12539
12540         * decl.cs: Use a global arraylist that we reuse over invocations
12541         to avoid excesive memory consumption.  Reduces memory usage on an
12542         mcs compile by one meg (45 average).
12543
12544         * typemanager.cs (LookupTypeReflection): In .NET pointers are
12545         private, work around that.
12546
12547 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
12548
12549         * literal.cs (IntLiteral): Define Zero and One static literals. 
12550
12551         * cs-parser.jay (integer_literal): use static literals to reduce
12552         memory usage for the most used literals (0, 1 and -1).  211kb
12553         reduced in memory usage.
12554
12555         Replace all calls to `new ArrayList' with `new
12556         ArrayList(4)' which is a good average number for most allocations,
12557         and also requires only 16 bytes of memory for its buffer by
12558         default. 
12559
12560         This reduced MCS memory usage in seven megabytes for the RSS after
12561         bootstrapping.
12562
12563 2003-07-28  Ravi Pratap  <ravi@ximian.com>
12564
12565         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
12566         handle params methods the correct way by forming only one
12567         applicable set with params and normal methods in them. Earlier we
12568         were looking at params methods only if we found no normal methods
12569         which was not the correct thing to do.
12570
12571         (Invocation.BetterFunction): Take separate arguments indicating
12572         when candidate and the best method are params methods in their
12573         expanded form.
12574
12575         This fixes bugs #43367 and #46199.
12576
12577         * attribute.cs: Documentation updates.
12578
12579         (CheckAttribute): Rename to CheckAttributeTarget.
12580         (GetValidPlaces): Rename to GetValidTargets.
12581
12582         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
12583         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
12584
12585         Fixes bug #44468.
12586
12587 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
12588
12589         * codegen.cs: Compute IsGeneric correctly.
12590
12591         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
12592         resolution. 
12593
12594         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
12595         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
12596         regressions, and I was chasing more bugs than I required.
12597
12598         * interface.cs: Use expressions for base type names (like classes
12599         and structs have been doing for a while now), and resolve that.
12600         This patch should probably go into head as well.
12601
12602         This makes it one less user of FindType.
12603
12604 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
12605
12606         This compiler can not self host currently.  Need to fix that.
12607         
12608         * Makefile: compile to `gmcs.exe'
12609
12610         * driver.cs: Turn on v2 by default on gmcs.
12611
12612         * generic.cs (ConstructedType): Does no longer take a container
12613         type argument;  That will be taken care of later.
12614
12615         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
12616         Use SimpleName to resolve for now, so we can continue the work on
12617         the parser, until we get Type.GetType that understands generics.
12618
12619         (ConstructedType.ToString): Implement
12620
12621         (TypeArguments.Resolve): Resolve the child expressions as types. 
12622         
12623         * cs-parser.jay: Rename interface_constraints to
12624         type_parameter_constraints
12625
12626         (namespace_or_type_name): Only use constructed types for the basic
12627         construction, we will deal with identifier<...> later.
12628
12629         (type/type_name): No longer call DecomposeQI, as
12630         namespace_or_type_name is always decoded now.
12631         
12632 2003-07-22  Ravi Pratap  <ravi@ximian.com>
12633
12634         * expression.cs (Invocation.OverloadResolve): Follow the spec more
12635         closely: we eliminate methods in base types when we have an
12636         applicable method in a top-level type.
12637
12638         Please see section 14.5.5.1 for an exact description of what goes
12639         on. 
12640
12641         This fixes bug #45127 and a host of other related to corlib compilation.
12642
12643         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
12644         array is the method corresponding to the top-level type (this is
12645         because of the changes made to icall.c) so we change this
12646         accordingly.
12647
12648         (MethodGroupExpr.Name): This too.
12649
12650         * typemanager.cs (GetElementType): New method which does the right
12651         thing when compiling corlib. 
12652
12653         * everywhere: Make use of the above in the relevant places.
12654
12655 2003-07-22  Martin Baulig  <martin@ximian.com>
12656
12657         * cs-parser.jay (invocation_expression): Moved
12658         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
12659         `cast_expression', but create a InvocationOrCast which later
12660         resolves to either an Invocation or a Cast.
12661
12662         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
12663         method; call this before EmitStatement() to make sure that this
12664         expression can be used as a statement.
12665
12666         * expression.cs (InvocationOrCast): New class; resolves to either
12667         an Invocation or a Cast.
12668
12669         * statement.cs (StatementExpression): Call ResolveStatement() on
12670         the ExpressionStatement before emitting it.
12671
12672 2003-07-21  Martin Baulig  <martin@ximian.com>
12673
12674         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
12675         `ref' and `out' attributes match; fixes #46220.
12676         (MemberAccess.ResolveMemberAccess): You can't reference a type
12677         through an expression; fixes #33180.
12678         (Indexers.GetIndexersForType): Don't return the indexers from
12679         interfaces the class implements; fixes #46502.
12680
12681 2003-07-21  Martin Baulig  <martin@ximian.com>
12682
12683         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
12684         CS0661 checks; fixes bug #30442.
12685
12686 2003-07-21  Martin Baulig  <martin@ximian.com>
12687
12688         * decl.cs (AdditionResult): Added `Error'.
12689
12690         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
12691
12692         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
12693         cs0031.cs actually work.
12694
12695  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
12696  
12697         * cs-parser.jay (namespace_name): do not use
12698         namespace_or_type_name, use qualified_identifier, because
12699         namespace_or_type_name will soon return a composed expression
12700         instead of a string.
12701  
12702         (namespace_or_type_name): Instead of returning a string, now this
12703         production returns an expression.
12704  
12705         * codegen.cs (EmitContext): Setup IsGeneric property based on
12706         whether our DeclSpace is generic, our the method is generic.
12707  
12708         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
12709         the method is generic.
12710  
12711         * cs-parser.jay (type_arguments, opt_type_argument_list,
12712         type_parameters, type_parameter_list, opt_type_parameter_list,
12713         type_parameter,, opt_type_parameter_constraints_clauses,
12714         type_parameter_constraints_clauses,
12715         type_parameter_constraint_clause, type_parameter_constraint,
12716         interface_constraints): Add new production
12717  
12718         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
12719         DeclSpace is generic or not.
12720  
12721         (DeclSpace.SetParameterInfo): New routine, used to set the
12722         parameter info for a type.
12723  
12724         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
12725         returns a GenericTypeExpr
12726  
12727         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
12728         generic, lookup the generic argument.
12729  
12730         * attribute.cs: Do not allow TypeParameterExpressions in
12731         Attributes.
12732  
12733         * class.cs: Do not allow the Main method to be defined in a
12734         Generic container.
12735  
12736         * expression.cs (SizeOf): Do not allow generic types to be used as
12737         arguments to sizeof.
12738  
12739         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
12740         it: whether a type is generic or not.  Only works for types we are
12741         currently building for now.
12742         
12743 2003-07-20  Martin Baulig  <martin@ximian.com>
12744
12745         * namespace.cs: Fixed that bug which caused a crash when compiling
12746         the debugger's GUI.
12747
12748 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
12749
12750         * typemanager.cs (LookupTypeReflection): Never expose types which
12751         are NotPublic, NestedPrivate, NestedAssembly, or
12752         NestedFamANDAssem.  We used to return these, and later do a check
12753         that would report a meaningful error, but the problem is that we
12754         would not get the real match, if there was a name override.
12755
12756 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
12757
12758         * namespace.cs (Namespace, Name): Do not compute the namespace
12759         name dynamically, compute it in the constructor.  This reduced
12760         memory usage by 1697 KB.
12761
12762         * driver.cs: Use --pause to pause at the end.
12763
12764 2003-07-17  Peter Williams  <peter@newton.cx>
12765
12766         * Makefile: Change the name of the test target so that it doesn't
12767         conflict with the recursive test target.
12768
12769 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
12770
12771         * expression.cs (LocalVariableReference.Emit, EmitAssign,
12772         AddressOf): Do not use EmitThis, that was wrong, use the actual
12773         this pointer.
12774
12775 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
12776
12777         * class.cs (MethodData.Define): While checking if a method is an
12778         interface implementation, improve the test: If we are not public
12779         (use new test here: use the computed MethodAttributes directly,
12780         instead of the parsed modifier flags) check if the `implementing'
12781         method comes from an interface or not.
12782
12783         * pending.cs (VerifyPendingMethods): Slightly better error
12784         message.
12785
12786         * makefile: add test target that does the mcs bootstrap.
12787
12788 2003-07-16  Ravi Pratap  <ravi@ximian.com>
12789
12790         * interface.cs (Define): Do nothing here since there are no
12791         members to populate etc. Move the attribute emission out of here
12792         since this was just totally the wrong place to put it. Attribute
12793         application happens during the 'Emit' phase, not in the 'Define'
12794         phase.
12795
12796         (Emit): Add this method and move the attribute emission here
12797
12798         * rootcontext.cs (EmitCode): Call the Emit method on interface
12799         types too.
12800
12801 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
12802
12803         * expression.cs (OverloadResolve): Report error only if Location
12804         is not 'Null' which means that there was a probe going on.
12805
12806 2003-07-14  Martin Baulig  <martin@ximian.com>
12807
12808         * expression.cs (ConditionalLogicalOperator): New public class to
12809         implement user defined conditional logical operators.
12810         This is section 14.11.2 in the spec and bug #40505.
12811
12812 2003-07-14  Martin Baulig  <martin@ximian.com>
12813
12814         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
12815
12816 2003-07-14  Martin Baulig  <martin@ximian.com>
12817
12818         * codegen.cs (EmitContext.InFixedInitializer): New public field.
12819
12820         * ecore.cs (IVariable.VerifyFixed): New interface method.
12821
12822         * expression.cs (Unary.ResolveOperator): When resolving the `&'
12823         operator, check whether the variable is actually fixed.  Fixes bug
12824         #36055.  Set a variable definitely assigned when taking its
12825         address as required by the spec.
12826
12827         * statement.cs (LocalInfo.IsFixed): New field.
12828         (LocalInfo.MakePinned): Set `IsFixed' to true.
12829
12830 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
12831
12832         * attribute.cs (Attribute.Resolve): While doing a Member lookup
12833         for .ctors, ensure that we only ask for members declared in the
12834         attribute type (BindingFlags.DeclaredOnly).
12835
12836         Fixes bug #43632.
12837
12838         * expression.cs (Error_WrongNumArguments): Report error 1501
12839         correctly the way CSC does.
12840
12841 2003-07-13  Martin Baulig  <martin@ximian.com>
12842
12843         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
12844         lookup on the fully qualified name, to make things like "X.X" work
12845         where "X.X" is a fully qualified type name, but we also have a
12846         namespace "X" in the using list.  Fixes #41975.
12847
12848 2003-07-13  Martin Baulig  <martin@ximian.com>
12849
12850         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
12851         function. If we're a CompoundAssign, we need to create an embedded
12852         CompoundAssign, not an embedded Assign.
12853         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
12854         Fixes #45854.
12855
12856 2003-07-13  Martin Baulig  <martin@ximian.com>
12857
12858         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
12859         work to fix bug #46088.
12860
12861 2003-07-13  Ravi Pratap <ravi@ximian.com>
12862
12863         * class.cs (Operator.Emit): Do not emit attributes here - it is
12864         taken care of by the Method class that we delegate too. This takes
12865         care of bug #45876.
12866
12867 2003-07-10  Martin Baulig  <martin@ximian.com>
12868
12869         * expression.cs (TypeOfVoid): New class.
12870         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
12871
12872 2003-07-10  Martin Baulig  <martin@ximian.com>
12873
12874         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
12875         bug #35957.
12876
12877 2003-07-10  Martin Baulig  <martin@ximian.com>
12878
12879         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
12880         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
12881
12882         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
12883
12884         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
12885
12886 2003-07-10  Martin Baulig  <martin@ximian.com>
12887
12888         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
12889         of decimal.  Fixes #42850.
12890
12891         NOTE: I also fixed the created byte blob, but this doesn't work on
12892         the MS runtime and csc never produces any byte blobs for decimal
12893         arrays.
12894
12895 2003-07-10  Martin Baulig  <martin@ximian.com>
12896
12897         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
12898         structs; fixes #32068.
12899         (Block.AddChildVariableNames): Fixed #44302.
12900
12901 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12902
12903         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
12904
12905 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12906
12907         * attribute.cs: And this test is onger needed.
12908
12909 2003-07-08  Martin Baulig  <martin@ximian.com>
12910
12911         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
12912         inaccessible types.  Fixes #36313.
12913
12914         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
12915
12916         * namespace.cs (NamespaceEntry): Create implicit entries for all
12917         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
12918         implicit entries for N1.N2 and N1.
12919
12920 2003-07-08  Martin Baulig  <martin@ximian.com>
12921
12922         Rewrote the handling of namespaces to fix a lot of the issues
12923         wrt. `using' aliases etc.
12924
12925         * namespace.cs (Namespace): Splitted this class into a
12926         per-assembly `Namespace' and a per-file `NamespaceEntry'.
12927
12928         * typemanager.cs (TypeManager.IsNamespace): Removed.
12929         (TypeManager.ComputeNamespaces): Only compute namespaces from
12930         loaded assemblies here, not the namespaces from the assembly we're
12931         currently compiling.
12932
12933 2003-07-08  Martin Baulig  <martin@ximian.com>
12934
12935         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
12936
12937 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12938
12939         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
12940         already fixed it.  
12941
12942         I thought about the memory savings here, but LookupTypeReflection
12943         is used under already very constrained scenarios.  Compiling
12944         corlib or mcs only exposes one hit, so it would not really reduce
12945         any memory consumption.
12946
12947 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12948
12949         * typemanager.cs: fixes bug #45889 by only adding public types from
12950         other assemblies to the list of known types.
12951
12952 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12953
12954         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
12955         on the type we resolved.
12956
12957 2003-07-05  Martin Baulig  <martin@ximian.com>
12958
12959         * pending.cs (PendingImplementation.ParentImplements): Don't
12960         create the proxy if the parent is abstract.
12961
12962         * class.cs (TypeContainer.DefineIndexers): Process explicit
12963         interface implementations first.  Fixes #37714.
12964
12965 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
12966
12967         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
12968         defined recursively;  but since we modify the input parameters
12969         (left is set to `this' temporarily), we reset this value if the
12970         left_is_explicit is false, which gives the original semantics to
12971         the code.  
12972
12973         * literal.cs (NullPointer): new class used to represent a null
12974         literal in a pointer context.
12975
12976         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
12977         type is a pointer, use a NullPointer object instead of a
12978         NullLiteral.   Closes 43687
12979
12980         (ExplicitConversion): Convert pointer values using
12981         the conv opcode to the proper type.
12982
12983         * ecore.cs (New): change ValueTypeVariable property into a method,
12984         that returns whether the valuetype is suitable for being used.
12985
12986         * expression.cs (Binary.DoNumericPromotions): Only return if we
12987         the int constant was a valid uint, and we can return both left and
12988         right as uints.  If not, we continue processing, to trigger the
12989         type conversion.  This fixes 39018.
12990
12991         * statement.cs (Block.EmitMeta): During constant resolution, set
12992         the CurrentBlock property on the emitcontext, so that we resolve
12993         constants propertly.
12994
12995 2003-07-02  Martin Baulig  <martin@ximian.com>
12996
12997         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
12998         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
12999
13000         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13001         than emitting it here.
13002
13003         * statement.cs: Fixed some more flow analysis bugs.
13004
13005 2003-07-02  Martin Baulig  <martin@ximian.com>
13006
13007         * class.cs (MethodData.Define): When implementing interface
13008         methods, set Final unless we're Virtual.
13009
13010         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
13011         check work for interface methods.
13012
13013 2003-07-01  Martin Baulig  <martin@ximian.com>
13014
13015         * ecore.cs (EmitContext.This): Replaced this property with a
13016         GetThis() method which takes a Location argument.  This ensures
13017         that we get the correct error location for a CS0188.
13018
13019 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
13020
13021         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13022         ImplicitStandardConversion.
13023
13024         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13025
13026 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
13027
13028         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13029         optimization.
13030
13031 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
13032
13033         * class.cs (Constructor.Define): Turn off initlocals for unsafe
13034         constructors.
13035
13036         (MethodData.Define): Turn off initlocals for unsafe methods.
13037
13038 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
13039
13040         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13041         complete;  Fixes #37521.
13042
13043         * delegate.cs: Use Modifiers.TypeAttr to compute the
13044         TypeAttributes, instead of rolling our own.  This makes the flags
13045         correct for the delegates.
13046
13047 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
13048
13049         * class.cs (Constructor.Define): Set the private flag for static
13050         constructors as well.
13051
13052         * cs-parser.jay (statement_expression): Set the return value to
13053         null, to avoid a crash when we catch an error.
13054
13055 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
13056
13057         * cs-parser.jay: Applied patch from Jackson that adds support for
13058         extern and unsafe modifiers to destructor declarations.
13059
13060         * expression.cs: Report error 21 if the user is trying to index a
13061         System.Array.
13062
13063         * driver.cs: Add an error message, suggested by the bug report.
13064
13065         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13066         if we do not have a ": this ()" constructor initializer.  Fixes 45149
13067
13068 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
13069
13070         * namespace.cs: Add some information to reduce FAQs.
13071
13072 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
13073
13074         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13075         underlying enumeration types.  Fixes #43915.
13076
13077         * expression.cs: Treat ushort/short as legal values to be used in
13078         bitwise operations.
13079
13080 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13081
13082         * delegate.cs: transfer custom attributes for paramenters from
13083         the delegate declaration to Invoke and BeginInvoke.
13084
13085 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13086
13087         * attribute.cs: handle custom marshalers and emit marshal info
13088         for fields, too.
13089
13090 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
13091
13092         * makefile.gnu: Added anonymous.cs to the compiler sources.
13093
13094 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
13095
13096         * iterators.cs: Change the name of the proxy class to include two
13097         underscores.
13098
13099         * cs-parser.jay: Update grammar to include anonymous methods.
13100
13101         * anonymous.cs: new file.
13102
13103 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
13104
13105         * class.cs (Field.Define): Add missing test for pointers and
13106         safety. 
13107
13108 2003-05-27  Ravi Pratap  <ravi@ximian.com>
13109
13110         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13111         we use the stobj opcode.
13112
13113         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13114         since it wasn't the correct fix. 
13115
13116         It still is puzzling that we are required to use stobj for IntPtr
13117         which seems to be a ValueType.
13118
13119 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
13120
13121         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13122         during regular simple name resolution.   Now, the trick is that
13123         instead of returning for processing the simplename, we do a
13124         TypeManager.LookupType (ie, a rooted lookup as opposed to a
13125         contextual lookup type).   If a match is found, return that, if
13126         not, return for further composition.
13127
13128         This fixes long-standing 30485.
13129
13130         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13131         using the address to initialize an object, do an Stobj instead of
13132         using the regular Stelem.
13133
13134         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13135         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13136         Because if we are a BaseIndexerAccess that value will be true.
13137         Fixes 43643.
13138
13139         * statement.cs (GotoCase.Resolve): Return after reporting an
13140         error, do not attempt to continue. 
13141
13142         * expression.cs (PointerArithmetic.Emit): If our operand is a
13143         long, convert our constants to match the operand before
13144         multiplying.  Convert to I type before adding.   Fixes 43670.
13145
13146 2003-05-14  Ravi Pratap  <ravi@ximian.com>
13147
13148         * enum.cs (ImplicitConversionExists) : Rename to
13149         ImplicitEnumConversionExists to remove ambiguity. 
13150
13151         * ecore.cs (NullCast): New type of cast expression class which
13152         basically is very similar to EmptyCast with the difference being
13153         it still is a constant since it is used only to cast a null to
13154         something else
13155         (eg. (string) null)
13156
13157         * convert.cs (ImplicitReferenceConversion): When casting a null
13158         literal, we return a NullCast.
13159
13160         * literal.cs (NullLiteralTyped): Remove - I don't see why this
13161         should be around anymore.
13162
13163         The renaming (reported was slightly wrong). Corrections:
13164
13165         ConvertImplicitStandard -> ImplicitConversionStandard
13166         ConvertExplicitStandard -> ExplicitConversionStandard
13167
13168         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13169         before passing them in !
13170
13171         * convert.cs (ImplicitConversionStandard): When comparing for
13172         equal expr and target types, ensure that expr is not a
13173         NullLiteral.
13174
13175         In general, we must not be checking (expr_type ==
13176         target_type) in the top level conversion methods
13177         (ImplicitConversion, ExplicitConversion etc). This checking is
13178         done in the methods that they delegate to.
13179
13180 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
13181
13182         * convert.cs: Move Error_CannotConvertType,
13183         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13184         ImplicitNumericConversion, ImplicitConversionExists,
13185         ImplicitUserConversionExists, StandardConversionExists,
13186         FindMostEncompassedType, FindMostSpecificSource,
13187         FindMostSpecificTarget, ImplicitUserConversion,
13188         ExplicitUserConversion, GetConversionOperators,
13189         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13190         TryImplicitIntConversion, Error_CannotConvertImplicit,
13191         ConvertImplicitRequired, ConvertNumericExplicit,
13192         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13193         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13194         its own file.
13195
13196         Perform the following renames:
13197
13198         StandardConversionExists -> ImplicitStandardConversionExists
13199         ConvertImplicit -> ImplicitConversion
13200         ConvertImplicitStandard -> ImplicitStandardConversion
13201         TryImplicitIntConversion -> ImplicitIntConversion
13202         ConvertImplicitRequired -> ImplicitConversionRequired
13203         ConvertNumericExplicit -> ExplicitNumericConversion
13204         ConvertReferenceExplicit -> ExplicitReferenceConversion
13205         ConvertExplicit -> ExplicitConversion
13206         ConvertExplicitStandard -> ExplicitStandardConversion
13207
13208 2003-05-19  Martin Baulig  <martin@ximian.com>
13209
13210         * statement.cs (TypeInfo.StructInfo): Made this type protected.
13211         (TypeInfo): Added support for structs having structs as fields.
13212
13213         * ecore.cs (FieldExpr): Implement IVariable.
13214         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13215         VariableInfo for the field.
13216
13217 2003-05-18  Martin Baulig  <martin@ximian.com>
13218
13219         * expression.cs (This.DoResolve): Report a CS0027 if we're
13220         emitting a field initializer.
13221
13222 2003-05-18  Martin Baulig  <martin@ximian.com>
13223
13224         * expression.cs (This.ResolveBase): New public function.
13225         (This.DoResolve): Check for CS0188.
13226
13227         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13228         This.Resolve().
13229
13230         * ecore.cs (MethodGroupExpr.DoResolve): Set the
13231         `instance_expression' to null if we don't have any non-static
13232         methods.
13233
13234 2003-05-18  Martin Baulig  <martin@ximian.com>
13235
13236         Reworked the way how local variables and parameters are handled by
13237         the flow analysis code.
13238
13239         * statement.cs (TypeInfo, VariableMap): New public classes.
13240         (VariableInfo): New public class.  This is now responsible for
13241         checking whether a variable has been assigned.  It is used for
13242         parameters and local variables.
13243         (Block.EmitMeta): Take the InternalParameters as argument; compute
13244         the layout of the flow vectors here.
13245         (Block.LocalMap, Block.ParameterMap): New public properties.
13246         (FlowBranching): The .ctor doesn't get the InternalParameters
13247         anymore since Block.EmitMeta() now computes the layout of the flow
13248         vector.
13249         (MyStructInfo): This class is now known as `StructInfo' and nested
13250         in `TypeInfo'; we don't access this directly anymore.
13251
13252         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13253         property and removed IsAssigned(), IsFieldAssigned(),
13254         SetAssigned() and SetFieldAssigned(); we now call them on the
13255         VariableInfo so we don't need to duplicate this code everywhere.
13256
13257         * expression.cs (ParameterReference): Added `Block block' argument
13258         to the .ctor.
13259         (LocalVariableReference, ParameterReference, This): The new
13260         VariableInfo class is now responsible for all the definite
13261         assignment stuff.
13262
13263         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13264         IsParameterAssigned, SetParameterAssigned): Removed.
13265
13266 2003-05-18  Martin Baulig  <martin@ximian.com>
13267
13268         * typemanager.cs (InitCoreTypes): Try calling
13269         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13270         the 3-args-version.  Corlib now also needs our `void_type'.
13271         (GetMethod): Added overloaded version which takes an optional
13272         `bool report_errors' to allow lookups of optional methods.
13273
13274 2003-05-12  Martin Baulig  <martin@ximian.com>
13275
13276         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13277         only used for locals and not for parameters.
13278
13279 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
13280
13281         * support.cs (InternalParameters.ParameterType): Return the
13282         ExternalType of the parameter.
13283
13284         * parameter.cs (Parameter.ExternalType): drop the two arguments,
13285         they were unused.
13286
13287 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
13288
13289         * class.cs (MethodData.Define): Do not set the `newslot' on
13290         interface members, if they are also flagged as "override".
13291
13292         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
13293         better code for ++i and i++.  This only works for static fields
13294         and local variables.
13295
13296         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
13297         want to pull the DeclSpace out of the builder_to_declspace instead
13298         of the TypeBuilder (like in TypeContainer.FindMembers).
13299
13300         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
13301         instead of LookupTypeContainer.  Fixes the crash on .NET for
13302         looking up interface members.
13303
13304         * const.cs: Create our own emit context during the Definition
13305         stage, so that constants are evaluated in the proper context, when
13306         a recursive definition happens.
13307
13308 2003-05-11  Martin Baulig  <martin@ximian.com>
13309
13310         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
13311         new block for a switch section.
13312         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
13313         the adding/lookup in the switch block.  Fixes #39828.
13314
13315 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
13316
13317         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
13318         functionality: I needed to convert the data after I had performed
13319         the add/sub operation into the operands type size.
13320
13321         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
13322         pass the type for the box operation, otherwise the resulting
13323         object would have been of type object.
13324
13325         (BoxedCast): Add constructor to specify the type to box as.
13326
13327 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
13328
13329         * iterators.cs: I was reusing the `count' variable inadvertently,
13330         take steps to not allow this to happen.
13331
13332 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
13333
13334         * attribute.cs (Attribute.Resolve): Params attributes are encoded
13335         by creating an array at the point where the params starts and
13336         putting all those arguments there, then adjusting the size of the
13337         array.
13338
13339 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
13340
13341         * expression.cs (New.AddressOf): Implement interface
13342         IMemoryLocation.  This is used when the `new' operator is used in
13343         the context of an invocation to a method on a value type.
13344
13345         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
13346         example. 
13347
13348         * namespace.cs: Also check the using aliases here.
13349
13350         * driver.cs: Move the test for using validity after the types have
13351         been entered, so we do a single pass that also includes the using
13352         aliases. 
13353
13354         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
13355         in the regular case.   CreateSiblingForFinally is doing extra
13356         error checking.
13357
13358         * attribute.cs (GetAttributeArgumentExpression): Store the result
13359         on an out value, and use the return value to indicate failure
13360         instead of using null (which is a valid return for Constant.GetValue).
13361
13362         * statement.cs: Perform the analysis flow for the increment
13363         portion after the statement, because this will be the real flow of
13364         execution.  Fixes #42385
13365
13366         * codegen.cs (EmitContext.EmitArgument,
13367         EmitContext.EmitStoreArgument): New helper functions when the
13368         RemapToProxy flag is set.
13369
13370         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
13371         function.
13372
13373         Add support for remapping parameters. 
13374
13375         * iterators.cs: Propagate parameter values;  Store parameter
13376         values in the proxy classes.
13377
13378 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
13379
13380         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
13381         need a proxy reference;  I do not know what I was thinking
13382
13383         * cs-parser.jay (constructor_initializer): catch another error,
13384         and display nice message.
13385
13386         (field_declaration): catch void field declaration
13387         to flag a better error. 
13388
13389         * class.cs (MemberBase.CheckBase): Report an error instead of a
13390         warning if a new protected member is declared in a struct. 
13391         (Field.Define): catch the error of readonly/volatile.
13392
13393         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
13394
13395         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
13396         volatile variable is taken
13397
13398 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
13399
13400         * statement.cs (Fixed.Resolve): Report an error if we are not in
13401         an unsafe context.
13402
13403 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
13404
13405         * typemanager.cs: reuse the code that handles type clashes for
13406         delegates and enumerations.
13407
13408         * class.cs (Report28): Always report.
13409
13410         * expression.cs (EncodeAsAttribute): Allow nulls here.
13411
13412 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
13413
13414         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
13415         the functionality for testing whether an expression is valid for
13416         an attribute here.  Also handle the case of arrays of elements
13417         being stored. 
13418
13419         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
13420         encoding a linear array into an array of objects that are suitable
13421         to be passed to an CustomAttributeBuilder.
13422
13423         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
13424
13425         * ecore.cs: (FieldExpr): Handle field remapping here.
13426
13427         * iteratators.cs: Pass the instance variable (if the method is an
13428         instance method) to the constructors, so we can access the field
13429         variables on the class.
13430
13431         TODO: Test this with structs.  I think the THIS variable on
13432         structs might have to be a pointer, and not a refenrece
13433
13434 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
13435
13436         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
13437         local variables to fields in a proxy class.
13438
13439         * iterators.cs (PopulateProxy): Rename our internal fields to
13440         <XXX>.  
13441         Create a <THIS> field if we are an instance method, so we can
13442         reference our parent container variables.
13443         (MapVariable): Called back from the EmitContext code to enter a
13444         new variable to field mapping into the proxy class (we just create
13445         a FieldBuilder).
13446
13447         * expression.cs
13448         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
13449         for using the remapped locals to fields.
13450
13451         I placed the code here, because that gives the same semantics to
13452         local variables, and only changes the Emit code.
13453
13454         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
13455         statements inside iterators.
13456         (VariableInfo): Add a FieldBuilder for the cases when we are
13457         remapping local variables to fields in a proxy class
13458
13459         * ecore.cs (SimpleNameResolve): Avoid testing two times for
13460         current_block != null.
13461
13462         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
13463         not cope with strings, as it has been moved to the
13464         TableSwitchEmit.  Fixed bug in switch generation.
13465
13466         * expression.cs (New.DoResolve): Provide more context for the user
13467         when reporting an error.
13468
13469         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
13470         pointers. 
13471
13472         * expression.cs (MemberAccess.DoResolve): When we get a type back,
13473         check the permissions for it.  Note than in a type-resolution
13474         context the check was already present in DeclSpace.ResolveType,
13475         but was missing from the MemberAccess.
13476
13477         (ArrayCreation.CheckIndices): warn if the user has
13478         more nested levels of expressions, but there are no more
13479         dimensions specified.  Avoids crash on bug 41906.
13480
13481 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
13482
13483         * statement.cs (Block): replace Implicit bool, for a generic
13484         flags.   
13485         New flag: `Unchecked'.  This is used during the EmitMeta phase
13486         (which is out-of-line with the regular Resolve/Emit process for a
13487         statement, as this is done ahead of time, but still gets a chance
13488         to call constant resolve).
13489
13490         (Block.Flags): new enum for adding a new flag.
13491
13492         (Block.EmitMeta): track the state of unchecked.
13493
13494         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
13495         to enable constant resolution to work there as well.
13496
13497 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
13498
13499         * typemanager.cs (ienumerable_type): Also look up
13500         System.Collections.IEnumerable. 
13501
13502 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
13503
13504         TODO: Test more than one conditional per method.
13505
13506         * class.cs (Indexer.Define): Report the location where the user is
13507         referencing the unsupported feature.
13508
13509         (MethodData): Overload the use of `conditionals' to
13510         minimize the creation of needless ArrayLists.   This saves roughly
13511         212kb on my machine.
13512
13513         (Method): Implement the new IIteratorContainer interface.
13514         (Method.SetYields): Implement the method by setting the ModFlags
13515         to contain METHOD_YIELDS.
13516
13517         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
13518         which just got set to null.
13519
13520         * iterators.cs: New file.
13521
13522         (Yield, YieldBreak): New statements.
13523
13524         * statement.cs (Return.Resolve): Flag an error if we are used in
13525         an iterator method.
13526
13527         * codegen.cs (InIterator): New flag set if the code is being
13528         compiled in an iterator method.
13529
13530         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
13531         internal modifier, and we just use it to avoid adding extra
13532         fields, as this is seldom used.  
13533
13534         * cs-parser.jay: Add yield_statement (yield and yield break).
13535
13536         * driver.cs: New flag -v2 to turn on version 2 features. 
13537
13538         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
13539         hashtable when v2 is enabled.
13540
13541 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
13542
13543         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
13544         there is already a namespace defined with this name.
13545
13546         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
13547         people upgraded their corlibs.
13548
13549         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
13550         always use fully qualified types, no need to use the compiler
13551         front end.
13552
13553         (TypeManager.IsNamespace): Use binarysearch.
13554
13555         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
13556         AddDelegate): I did not quite use the new IsValid API properly: I
13557         have to pass the short-name and the fullname.  I was passing only
13558         the basename instead of the fullname sometimes. 
13559
13560         (TypeContainer.DefineType): call NamespaceClash.
13561
13562         * interface.cs (Interface.DefineType): use NamespaceClash before
13563         defining the type.
13564
13565         * delegate.cs (Delegate.DefineType): use NamespaceClash before
13566         defining the type.
13567
13568         * enum.cs: (Enum.DefineType): use NamespaceClash before
13569         defining the type.
13570
13571         * typemanager.cs (: 3-line patch that gives us some tasty 11%
13572         speed increase.  First, use the negative_hits cache when we get a
13573         negative.  Second, add the type with its full original name
13574         instead of the new . and + encoded name (reflection uses + to
13575         separate type from a nested type).  Use LookupTypeReflection
13576         directly which bypasses the type->name hashtable (that we already
13577         know does not contain the type.
13578
13579         * decl.cs (DeclSpace.ResolveTypeExpr): track the
13580         location/container type. 
13581
13582         * driver.cs: When passing utf8, use directly the UTF8Encoding.
13583
13584 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
13585
13586         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
13587
13588         * delegate.cs (NewDelegate.Resolve): Test whether an instance
13589         method is being referenced in the method group from a static
13590         context, and report error 120 if so.
13591
13592         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
13593         Error118. 
13594
13595         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
13596         is created, we create the A namespace).
13597
13598         * cs-parser.jay: A namespace also introduces a DeclarationFound.
13599         Fixes #41591
13600
13601 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
13602
13603         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
13604         invocation to ModuleBuilder.GetType with the same values will
13605         return a new type instance, so we need to cache its return
13606         values. 
13607
13608         * expression.cs (Binary.ResolveOperator): Only allow the compare
13609         operators on enums if they are of the same type.
13610
13611         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
13612         types of ValueType on their own case.  Before we were giving them
13613         the same treatment as objects.
13614
13615         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
13616         fullname.  Short name is used to compare against container name.
13617         Fullname is used to check against defined namespace names.
13618
13619         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
13620         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
13621
13622         (Method.CheckBase): Call parent.
13623         (MemberBase.CheckBase): Check for protected members on sealed
13624         classes.
13625         (PropertyBase.CheckBase): Call parent.
13626         (Field.Define): Call parent.
13627
13628         * report.cs: Negative error codes are now mapped to 8000 - code,
13629         so that the display is render more nicely.
13630
13631         * typemanager.cs: Do not use try/catch, instead report a regular
13632         error. 
13633
13634         (GetPointerType, GetReferenceType): These methods provide
13635         mechanisms to obtain the T* and T& from a T.  We had the code
13636         previously scattered around the code base, and it also used
13637         TypeManager.LookupType that would go through plenty of caches.
13638         This one goes directly to the type source.
13639
13640         In some places we did the Type.GetType followed by
13641         ModuleBuilder.GetType, but not in others, so this unifies the
13642         processing as well.
13643
13644         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
13645         statements now that we have namespace information.
13646
13647         * typemanager.cs (IsNamespace): New method, returns whether the
13648         string presented is a namespace or not.
13649
13650         (ComputeNamespaces): New public entry point, computes the list of
13651         available namespaces, using the GetNamespaces API call in Mono, or
13652         the slower version in MS.NET.   
13653
13654         Now before we start the semantic analysis phase, we have a
13655         complete list of namespaces including everything that the user has
13656         provided.
13657
13658         Deleted old code to cache namespaces in .nsc files.
13659
13660 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
13661
13662         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
13663         class/struct location definition Location for the implicit
13664         constructor location.
13665
13666         (Operator.Define): Use the location of the operator for the
13667         implicit Method definition.
13668
13669         (Constructor.Emit): use the constructor location for the implicit
13670         base initializer constructor.
13671
13672         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
13673         and the Expression class now contains two new methods:
13674
13675         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
13676         isolate type lookup from the rest of the resolution process.
13677
13678         Since we use Expressions to hold type definitions due to the way
13679         we parse the input we have historically overloaded Resolve to
13680         perform the Type lookups if a special flag is passed.  Now this is
13681         eliminated and two methods take their place. 
13682
13683         The differences in the two methods between xStep and xTerminal is
13684         that xStep is involved in our current lookup system that uses
13685         SimpleNames to compose a name, while xTerminal is used just to
13686         catch the case where the simplename lookup failed.
13687
13688 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
13689
13690         * expression.cs (ResolveMemberAccess): Remove redundant code.
13691         TypeExpr expressions are always born fully resolved.
13692
13693         * interface.cs (PopulateMethod): Do not lookup the types twice.
13694         We were doing it once during SemanticAnalysis and once during
13695         PopulateMethod.
13696
13697         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
13698         in local variable type definitions, were being returned as a
13699         SimpleName (we decomposed everything into a string), that is
13700         because primary_expression was being used instead of a type in the
13701         grammar (reduce/reduce conflicts).
13702
13703         The part that was wrong is that we converted the expression into a
13704         string (an oversimplification in one hand, compounded with primary
13705         expressions doing string concatenation).
13706
13707         So things like:
13708
13709         A.B.C [] x;
13710
13711         Would return "A.B.C[]" as a SimpleName.  This stopped things like
13712         using clauses from working on this particular context.  And a type
13713         was being matched directly against "A.B.C[]".
13714
13715         We now use the correct approach, and allow for ComposedCast to be
13716         part of the unary expression.  So the "A.B.C []" become a composed
13717         cast of "A.B.C" (as a nested group of MemberAccess with a
13718         SimpleName at the end) plus the rank composition "[]". 
13719
13720         Also fixes 35567
13721
13722 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
13723
13724         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
13725         for the access level checking.
13726
13727         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
13728         `TypeContainer container', because I kept getting confused when I
13729         was debugging this code.
13730
13731         * expression.cs (Indexers): Instead of tracking getters/setters,
13732         we now track them in parallel.  We create one arraylist less, but
13733         most importantly it is possible now for the LValue code to find a
13734         matching get for a set.
13735
13736         (IndexerAccess.DoResolveLValue): Update the code.
13737         GetIndexersForType has been modified already to extract all the
13738         indexers from a type.  The code assumed it did not.
13739
13740         Also make the code set the correct return type for the indexer.
13741         This was fixed a long time ago for properties, but was missing for
13742         indexers.  It used to be void_type.
13743
13744         (Binary.Emit): Test first for doubles instead of
13745         floats, as they are more common.
13746
13747         (Binary.EmitBranchable): Use the .un version of the branch opcodes
13748         when dealing with floats and the <=, >= operators.  This fixes bug
13749         #39314 
13750
13751         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
13752         to load the array value by emitting a load on the foreach variable
13753         type.  This was incorrect.  
13754
13755         We now emit the code to load an element using the the array
13756         variable type, and then we emit the conversion operator.
13757
13758         Fixed #40176
13759
13760 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
13761
13762         * attribute.cs: Avoid allocation of ArrayLists in the common case.
13763
13764 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
13765
13766         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
13767         test for protection before we test for signatures. 
13768
13769         (MethodSignature.ToString): implement.
13770
13771         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
13772         to the case where we reduced into a LongConstant.
13773
13774         * decl.cs (CheckAccessLevel): If the type is an array, we can not
13775         depend on whether the information is acurrate, because the
13776         Microsoft runtime will always claim that the array type is public,
13777         regardless of the real state.
13778
13779         If the type is a pointer, another problem happens: the type is
13780         reported as non-public in Microsoft.  
13781
13782         In both cases we have to call CheckAccessLevel recursively with
13783         the underlying type as the argument to be tested.
13784
13785 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
13786
13787         * assign.cs (Assign.Emit): If we are dealing with a compound
13788         assignment expression, we should use the code path that stores the
13789         intermediate result in a temporary value.  This fixes #40903.
13790
13791         *expression.cs (Indirection.ToString): Provide ToString method for
13792         debugging. 
13793
13794 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
13795
13796         * class.cs: Null out fields holding references to Block objects so
13797         they can be garbage collected.
13798
13799         * expression.cs (OverloadResolve): Remove unused local.
13800
13801 2003-04-07  Martin Baulig  <martin@ximian.com>
13802
13803         * codegen.cs (EmitContext.CurrentFile): New public field.
13804         (EmitContext.Mark): Use the CurrentFile to check whether the
13805         location is in the correct file.
13806         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
13807
13808 2003-04-07  Martin Baulig  <martin@ximian.com>
13809
13810         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
13811
13812         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
13813         location.  [FIXME: The location argument which gets passed to this
13814         method is sometimes wrong!]
13815
13816 2003-04-07  Nick Drochak <ndrochak@gol.com>
13817
13818         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
13819
13820 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
13821
13822         * expression.cs (Indirection.EmitAssign): We were using the
13823         temporary, but returning immediately instead of continuing the
13824         EmitAssing flow.
13825
13826 2003-04-06  Martin Baulig  <martin@ximian.com>
13827
13828         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
13829         if it's a nested child, but also deriving from the outer class.
13830         See test 190.cs.
13831
13832         * typemanager.cs (IsNestedChildOf): Make this work if it's a
13833         nested child, but also deriving from the outer class.  See
13834         test-190.cs.
13835         (FilterWithClosure): We may access private members of the outer
13836         class if we're a nested child and deriving from the outer class.
13837         (RealMemberLookup): Only set `closure_private_ok' if the
13838         `original_bf' contained BindingFlags.NonPublic.
13839
13840 2003-04-05  Martin Baulig  <martin@ximian.com>
13841
13842         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
13843         probe if its a type parameter, and if so, flag an error.
13844
13845         * decl.cs: Move here the SetParameterInfo code from class.cs.
13846         Handle IsGeneric here.
13847
13848         Handle a variety of errors in the parameter info definition.
13849
13850         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
13851         type parameters here.
13852
13853         * cs-parser.jay (class_declaration): report errors for parameters
13854         here as well.
13855
13856 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
13857
13858         * generic.cs: New file, contains support code for generics.
13859
13860         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
13861         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
13862
13863         Update parser for the above removals.
13864
13865         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
13866         now taken care of in the parser.
13867
13868 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
13869
13870         * class.cs (Event.Define): Do not allow abstract events to have
13871         initializers. 
13872
13873 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
13874
13875         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
13876         block in event declarations.
13877
13878         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
13879         value type, get its address.
13880
13881         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
13882         leaving a class on the stack instead of a boolean value (int
13883         0/1).  Change the code so we compare against null, and then the
13884         result against zero.
13885
13886         * class.cs (TypeContainer.GetClassBases): We were checking for the
13887         parent class being sealed too late.
13888
13889         * expression.cs (Binary.Emit): For <= and >= when dealing with
13890         floating point values, use cgt.un and clt.un instead of cgt and
13891         clt alone.
13892
13893 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
13894
13895         * statement.cs: Apply the same optimization as MS: skip the 
13896         GetEnumerator returning an IEnumerator, and use the one returning a 
13897         CharEnumerator instead. This allows us to avoid the try-finally block 
13898         and the boxing.
13899
13900 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
13901
13902         * cs-parser.jay: Attributes cannot be applied to
13903                          namespaces. Fixes #40473
13904
13905 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13906
13907         * class.cs:
13908         (Add*): check if the name is valid using the full name for constants,
13909         fields, properties and events.
13910
13911 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
13912
13913         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
13914         char constants to be part of the enumeration.
13915
13916         * expression.cs (Conditional.DoResolve): Add support for operator
13917         true. Implements the missing functionality from 14.12
13918
13919         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
13920         operator true/false as required by the spec.
13921
13922         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
13923         implicit conversion to boolean.
13924
13925         * statement.cs (Statement.ResolveBoolean): A boolean expression is
13926         also one where the type implements `operator true'. 
13927
13928         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
13929         get an expression that will invoke operator true based on an
13930         expression.  
13931
13932         (GetConversionOperators): Removed the hack that called op_True
13933         here.  
13934
13935         (Expression.ResolveBoolean): Move this from Statement.
13936
13937 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
13938
13939         * ecore.cs (FieldExpr): do not allow initialization of initonly
13940         fields on derived classes
13941
13942 2003-03-13  Martin Baulig  <martin@ximian.com>
13943
13944         * statement.cs (Block.Emit): Call ig.BeginScope() and
13945         ig.EndScope() when compiling with debugging info; call
13946         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
13947
13948 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
13949
13950         * expression.cs (Indexers): Do not construct immediately, allow
13951         for new members to be appended as we go.  Fixes 38143
13952
13953 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13954
13955         * expression.cs: save/restore context when resolving an unchecked
13956         expression.
13957
13958 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
13959
13960         * cfold.cs: Catch division by zero in modulus operator during
13961         constant folding.
13962
13963 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
13964
13965         * interface.cs (Interface.DefineMembers): Avoid defining members
13966         twice. 
13967
13968 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
13969
13970         * driver.cs: handle the +/- options for -noconfig
13971
13972         * statement.cs (Unckeched.Resolve): Also track the state of
13973         unchecked in the Resolve phase.
13974
13975 2003-02-27  Martin Baulig  <martin@ximian.com>
13976
13977         * ecore.cs (Expression.MemberLookup): Don't create a
13978         MethodGroupExpr for something which is not a method.  Fixes #38291.
13979
13980 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
13981
13982         * class.cs (MemberBase.CheckParameters): Also check that the type
13983         is unmanaged if it is a pointer.
13984
13985         * expression.cs (SizeOf.Resolve): Add location information.
13986
13987         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
13988         a managed type is declared.
13989
13990         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
13991         parameter modifiers as well.  Fixes bug 38606
13992
13993         * class.cs: Very sad.  Am backing out the speed up changes
13994         introduced by the ArrayList -> Array in the TypeContainer, as they
13995         were not actually that much faster, and introduced a bug (no error
13996         reports on duplicated methods).
13997
13998         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
13999         source first, this will guarantee that we have a valid expression
14000         before calling in lower levels functions that will require a
14001         resolved object.  Then use this original_source in the
14002         target.ResolveLValue instead of the original source that was
14003         passed to us.
14004
14005         Another change.  Use target.Resolve instead of LValueResolve.
14006         Although we are resolving for LValues, we will let the Assign code
14007         take care of that (it will be called again from Resolve).  This
14008         basically allows code like this:
14009
14010         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
14011         class Y { void A (X x) { x [0] += o; }
14012
14013         The problem was that the indexer was trying to resolve for
14014         set_Item (idx, object o) and never finding one.  The real set_Item
14015         was set_Item (idx, X).  By delaying the process we get the right
14016         semantics. 
14017
14018         Fixes bug 36505
14019
14020 2003-02-23  Martin Baulig  <martin@ximian.com>
14021
14022         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14023         while calling DoEmit ().
14024
14025         * codegen.cs (EmitContext.Mark): Don't mark locations in other
14026         source files; if you use the #line directive inside a method, the
14027         compiler stops emitting line numbers for the debugger until it
14028         reaches the end of the method or another #line directive which
14029         restores the original file.
14030
14031 2003-02-23  Martin Baulig  <martin@ximian.com>
14032
14033         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14034
14035 2003-02-23  Martin Baulig  <martin@ximian.com>
14036
14037         * statement.cs (Block.AddChildVariableNames): We need to call this
14038         recursively, not just for our immediate children.
14039
14040 2003-02-23  Martin Baulig  <martin@ximian.com>
14041
14042         * class.cs (Event.Define): Always make the field private, like csc does.
14043
14044         * typemanager.cs (TypeManager.RealMemberLookup): Make events
14045         actually work, fixes bug #37521.
14046
14047 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
14048
14049         * delegate.cs: When creating the various temporary "Parameters"
14050         classes, make sure that we call the ComputeAndDefineParameterTypes
14051         on those new parameters (just like we do with the formal ones), to
14052         allow them to be resolved in the context of the DeclSpace.
14053
14054         This fixes the bug that Dick observed in Bugzilla #38530.
14055
14056 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
14057
14058         * expression.cs (ResolveMemberAccess): When resolving a constant,
14059         do not attempt to pull a constant if the value was not able to
14060         generate a valid constant.
14061
14062         * const.cs (LookupConstantValue): Do not report more errors than required.
14063
14064 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14065
14066         * expression.cs: fixes bug #38328.
14067
14068 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14069
14070         * class.cs: Changed all the various members that can be part of a
14071         class from being an ArrayList to be an Array of the right type.
14072         During the DefineType type_list, interface_list, delegate_list and
14073         enum_list are turned into types, interfaces, delegates and enums
14074         arrays.  
14075
14076         And during the member population, indexer_list, event_list,
14077         constant_list, field_list, instance_constructor_list, method_list,
14078         operator_list and property_list are turned into their real arrays.
14079
14080         Although we could probably perform this operation earlier, for
14081         good error reporting we need to keep the lists and remove the
14082         lists for longer than required.
14083
14084         This optimization was triggered by Paolo profiling the compiler
14085         speed on the output of `gen-sample-program.pl' perl script. 
14086
14087         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
14088         not crash in methods like MemberLookupFailed that use this field.  
14089
14090         This problem arises when the compiler fails to resolve a type
14091         during interface type definition for example.
14092
14093 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14094
14095         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14096         inherit from System.Object, so we have to stop at null, not only
14097         when reaching System.Object.
14098
14099 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
14100
14101         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14102         DeclaredOnly because the parent indexer might have had a different
14103         name, but did not loop until the top of the hierarchy was reached.
14104
14105         The problem this one fixes is 35492: when a class implemented an
14106         indexer from an interface, we were getting the interface method
14107         (which was abstract) and we were flagging an error (can not invoke
14108         abstract method).
14109
14110         This also keeps bug 33089 functioning, and test-148 functioning.
14111
14112         * typemanager.cs (IsSpecialMethod): The correct way of figuring
14113         out if a method is special is to see if it is declared in a
14114         property or event, or whether it is one of the predefined operator
14115         names.   This should fix correctly #36804.
14116
14117 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
14118
14119         The goal here is to remove the dependency on EmptyCast.Peel ().
14120         Killing it completely.
14121
14122         The problem is that currently in a number of places where
14123         constants are expected, we have to "probe" for an EmptyCast, and
14124         Peel, which is not the correct thing to do, as this will be
14125         repetitive and will likely lead to errors. 
14126
14127         The idea is to remove any EmptyCasts that are used in casts that
14128         can be reduced to constants, so we only have to cope with
14129         constants. 
14130
14131         This bug hunt was triggered by Bug 37363 and the desire to remove
14132         the duplicate pattern where we were "peeling" emptycasts to check
14133         whether they were constants.  Now constants will always be
14134         constants.
14135
14136         * ecore.cs: Use an enumconstant here instead of wrapping with
14137         EmptyCast.  
14138
14139         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14140         throwing me off.  By handling this we can get rid of a few hacks.
14141
14142         * statement.cs (Switch): Removed Peel() code.
14143
14144 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
14145
14146         * class.cs: Location information for error 508
14147
14148         * expression.cs (New.DoResolve): Add a guard against double
14149         resolution of an expression.  
14150
14151         The New DoResolve might be called twice when initializing field
14152         expressions (see EmitFieldInitializers, the call to
14153         GetInitializerExpression will perform a resolve on the expression,
14154         and later the assign will trigger another resolution
14155
14156         This leads to bugs (#37014)
14157
14158         * delegate.cs: The signature for EndInvoke should contain any ref
14159         or out parameters as well.  We were not doing this in the past. 
14160
14161         * class.cs (Field.Define): Do not overwrite the type definition
14162         inside the `volatile' group.  Turns out that volatile enumerations
14163         were changing the type here to perform a validity test, which
14164         broke conversions. 
14165
14166 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
14167
14168         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14169         and structs, we do not want to load the instance variable
14170
14171         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14172         enum_type has to be handled like an object reference (implicit
14173         conversions exists from this to object), but the regular IsClass
14174         and IsValueType tests will never return true for this one.
14175
14176         Also we use TypeManager.IsValueType instead of type.IsValueType,
14177         just for consistency with the rest of the code (this is only
14178         needed if we ever use the construct exposed by test-180.cs inside
14179         corlib, which we dont today).
14180
14181 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
14182
14183         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14184         just InternalCall.
14185
14186 2003-02-09  Martin Baulig  <martin@ximian.com>
14187
14188         * namespace.cs (Namespace..ctor): Added SourceFile argument.
14189         (Namespace.DefineNamespaces): New static public method; this is
14190         called when we're compiling with debugging to add all namespaces
14191         to the symbol file.
14192
14193         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14194         pass it to the Namespace's .ctor.
14195
14196         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14197         and MethodBase arguments; pass the namespace ID to the symwriter;
14198         pass the MethodBase instead of the token to the symwriter.
14199         (SymbolWriter.DefineNamespace): New method to add a namespace to
14200         the symbol file.
14201
14202 2003-02-09  Martin Baulig  <martin@ximian.com>
14203
14204         * symbolwriter.cs: New file.  This is a wrapper around
14205         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
14206         methods here in near future.
14207
14208 2003-02-09  Martin Baulig  <martin@ximian.com>
14209
14210         * codegen.cs (EmitContext.Mark): Just pass the arguments to
14211         ILGenerator.MarkSequencePoint() which are actually used by the
14212         symbol writer.
14213
14214 2003-02-09  Martin Baulig  <martin@ximian.com>
14215
14216         * location.cs (SourceFile): New public sealed class.  This
14217         contains the name and an index which is used in the location's token.
14218         (Location): Reserve an appropriate number of bits in the token for
14219         the source file instead of walking over that list, this gives us a
14220         really huge performance improvement when compiling with debugging.
14221
14222         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14223         `SourceFile' argument instead of a string.
14224         (Driver.ProcessFile): Add all the files via Location.AddFile(),
14225         but don't parse/tokenize here, we need to generate the list of all
14226         source files before we do that.
14227         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
14228         the files.
14229
14230         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14231         instead of a string.
14232
14233         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14234         of a string.
14235
14236 2003-02-09  Martin Baulig  <martin@ximian.com>
14237
14238         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14239         filename on `#line default'.
14240
14241 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14242
14243         * statement.cs: don't clear the pinned var when the fixed statement
14244         returns from the method (fixes bug#37752).
14245
14246 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14247
14248         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
14249         to IsValueType.
14250
14251 2003-02-07  Martin Baulig  <martin@ximian.com>
14252
14253         * driver.cs: Removed the `--debug-args' command line argument.
14254
14255         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14256         automatically by the AsssemblyBuilder.
14257         (CodeGen.InitializeSymbolWriter): We don't need to call any
14258         initialization function on the symbol writer anymore.  This method
14259         doesn't take any arguments.
14260
14261 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
14262
14263         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14264         from referenced assemblies as well.
14265
14266 2003-02-02  Martin Baulig  <martin@ximian.com>
14267
14268         * class.cs (MethodData.Emit): Generate debugging info for external methods.
14269
14270 2003-02-02  Martin Baulig  <martin@ximian.com>
14271
14272         * class.cs (Constructor.Emit): Open the symbol writer before
14273         emitting the constructor initializer.
14274         (ConstructorInitializer.Emit): Call ec.Mark() to allow
14275         single-stepping through constructor initializers.
14276
14277 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
14278
14279         * class.cs: Handle error 549: do not allow virtual methods in
14280         sealed classes. 
14281
14282 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14283
14284         * decl.cs: Check access levels when resolving types
14285
14286 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14287
14288         * statement.cs: Add parameters and locals set in catch blocks that might 
14289         return to set vector
14290
14291 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
14292
14293         * class.cs (Operator): Set the SpecialName flags for operators.
14294
14295         * expression.cs (Invocation.DoResolve): Only block calls to
14296         accessors and operators on SpecialName methods.
14297
14298         (Cast.TryReduce): Handle conversions from char constants.
14299
14300
14301 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14302
14303         * statement.cs: small memory and time optimization in FlowBranching.
14304
14305 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
14306
14307         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14308         problem that the last fix but in the other sid (Set).
14309
14310         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14311         access when there is no indexer in the hierarchy.
14312
14313 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14314
14315         * class.cs: Combine some if statements.
14316
14317 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14318
14319         * driver.cs: fixed bug #37187.
14320
14321 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
14322
14323         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
14324         any indexer, it's needed to build a list with all the indexers in the
14325         hierarchy (AllGetters), else we have problems. Fixes #35653.
14326
14327 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
14328
14329         * class.cs (MethodData.Define): It is wrong for an interface
14330         implementation to be static in both cases: explicit and implicit.
14331         We were only handling this in one case.
14332
14333         Improve the if situation there to not have negations.
14334
14335         * class.cs (Field.Define): Turns out that we do not need to check
14336         the unsafe bit on field definition, only on usage.  Remove the test.
14337
14338 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14339
14340         * driver.cs: use assembly.Location instead of Codebase (the latest
14341         patch made mcs fail when using MS assemblies).
14342
14343 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
14344
14345         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
14346         get the path to *corlib.dll.
14347
14348 2003-01-21  Nick Drochak <ndrochak@gol.com>
14349
14350         * cs-tokenizer.cs:
14351         * pending.cs:
14352         * typemanager.cs: Remove compiler warnings
14353
14354 2003-01-20  Duncan Mak  <duncan@ximian.com>
14355
14356         * AssemblyInfo.cs: Bump the version number to 0.19.
14357
14358 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14359
14360         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
14361
14362 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
14363
14364         * class.cs (Constructor::Emit): Emit debugging info for constructors.
14365
14366 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
14367
14368         * cs-parser.jay: Small fix: we were not comparing the constructor
14369         name correctly.   Thanks to Zoltan for the initial pointer.
14370
14371 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
14372
14373         * cs-tokenizer.cs: Set file name when specified with #line
14374
14375 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
14376
14377         * cs-parser.jay: Only perform the constructor checks here if we
14378         are named like the class;  This will help provider a better
14379         error.  The constructor path is taken when a type definition is
14380         not found, but most likely the user forgot to add the type, so
14381         report that rather than the constructor error.
14382
14383 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
14384
14385         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
14386         allocations.
14387
14388 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14389
14390         * cs-parser.jay: Add cleanup call.
14391
14392 2003-01-13  Duncan Mak  <duncan@ximian.com>
14393
14394         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
14395         consistent with other methods.
14396
14397 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14398
14399         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
14400
14401 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
14402
14403         * attribute.cs: only set GuidAttr to true when we have a
14404         GuidAttribute.
14405
14406 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14407
14408         * ecore.cs:
14409         * expression.cs:
14410         * typemanager.cs: fixes to allow mcs compile corlib with the new
14411         Type.IsSubclassOf fix.
14412
14413 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
14414
14415         * expression.cs (LocalVariableReference.DoResolve): Classify a
14416         constant as a value, not as a variable.   Also, set the type for
14417         the variable.
14418
14419         * cs-parser.jay (fixed_statement): take a type instead of a
14420         pointer_type, so we can produce a better error message later.
14421
14422         * statement.cs (Fixed.Resolve): Flag types that are not pointers
14423         as an error.  
14424
14425         (For.DoEmit): Make inifinite loops have a
14426         non-conditional branch back.
14427
14428         (Fixed.DoEmit): First populate the pinned variables, then emit the
14429         statement, then clear the variables.  Before I was emitting the
14430         code once for each fixed piece.
14431
14432
14433 2003-01-08  Martin Baulig  <martin@ximian.com>
14434
14435         * statement.cs (FlowBranching.MergeChild): A break in a
14436         SWITCH_SECTION does not leave a loop.  Fixes #36155.
14437
14438 2003-01-08  Martin Baulig  <martin@ximian.com>
14439
14440         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
14441         lives in the same number space than `param_map'.  Fixes #36154.
14442
14443 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
14444
14445         * cs-parser.jay (constructor_declaration): Set the
14446         Constructor.ModFlags before probing for it.  This makes the
14447         compiler report 514, 515 and 132 (the code was there, but got
14448         broken). 
14449
14450         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
14451         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
14452         (GotoCase.Resolve): Set `Returns' to ALWAYS.
14453
14454 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
14455
14456         * enum.cs: create the enum static fields using the enum type.
14457
14458 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
14459
14460         * class.cs: don't try to create the ParamBuilder for the return
14461         type if it's not needed (and handle it breaking for the ms runtime
14462         anyway).
14463
14464 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
14465
14466         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
14467
14468 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
14469
14470         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
14471         the command.   This showed up while compiling the JANET source
14472         code, which used \r as its only newline separator.
14473
14474 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
14475
14476         * class.cs (Method.Define): If we are an operator (because it
14477         reuses our code), then set the SpecialName and HideBySig.  #36128
14478
14479 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
14480
14481         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
14482         exception, report error 120 `object reference required'.
14483
14484         * driver.cs: Add --pause option, used during to measure the size
14485         of the process as it goes with --timestamp.
14486
14487         * expression.cs (Invocation.DoResolve): Do not allow methods with
14488         SpecialName to be invoked.
14489
14490 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
14491
14492         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
14493         number before adding it.
14494
14495 2002-12-21  Ravi Pratap  <ravi@ximian.com>
14496
14497         * ecore.cs (StandardImplicitConversion): When in an unsafe
14498         context, we allow conversion between void * to any other pointer
14499         type. This fixes bug #35973.
14500
14501 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
14502
14503         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
14504         is not thrown when extensionless outputs are used 
14505
14506 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14507
14508         * rootcontext.cs: fixed compilation of corlib.
14509
14510 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
14511
14512         * attribute.cs (Attributes.Contains): Add new method.
14513
14514         * class.cs (MethodCore.LabelParameters): if the parameter is an
14515         `out' parameter, check that no attribute `[In]' has been passed.
14516
14517         * enum.cs: Handle the `value__' name in an enumeration.
14518
14519 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
14520
14521         * decl.cs: Added special case to allow overrides on "protected
14522         internal" methods
14523
14524 2002-12-18  Ravi Pratap  <ravi@ximian.com>
14525
14526         * attribute.cs (Attributes.AddAttributeSection): Rename to this
14527         since it makes much more sense.
14528
14529         (Attributes.ctor): Don't require a Location parameter.
14530
14531         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
14532
14533         * attribute.cs (ApplyAttributes): Remove extra Location parameters
14534         since we already have that information per attribute.
14535
14536         * everywhere : make appropriate changes.
14537
14538         * class.cs (LabelParameters): Write the code which actually
14539         applies attributes to the return type. We can't do this on the MS
14540         .NET runtime so we flag a warning in the case an exception is
14541         thrown.
14542
14543 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
14544
14545         * const.cs: Handle implicit null conversions here too.
14546
14547 2002-12-17  Ravi Pratap  <ravi@ximian.com>
14548
14549         * class.cs (MethodCore.LabelParameters): Remove the extra
14550         Type [] parameter since it is completely unnecessary. Instead
14551         pass in the method's attributes so that we can extract
14552         the "return" attribute.
14553
14554 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
14555
14556         * cs-parser.jay (parse): Use Report.Error to flag errors instead
14557         of ignoring it and letting the compile continue.
14558
14559         * typemanager.cs (ChangeType): use an extra argument to return an
14560         error condition instead of throwing an exception.
14561
14562 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
14563
14564         * expression.cs (Unary.TryReduce): mimic the code for the regular
14565         code path.  Perform an implicit cast in the cases where we can
14566         implicitly convert to one of the integral types, and then reduce
14567         based on that constant.   This fixes bug #35483.
14568
14569 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14570
14571         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
14572
14573 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14574
14575         * namespace.cs: fixed bug #35489.
14576
14577 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
14578
14579         * class.cs: Remove some dead code.
14580
14581         * cs-parser.jay: Estimate the number of methods needed
14582         (RootContext.MethodCount);
14583
14584         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
14585         numbers instead of StringBuilders.
14586
14587         * support.cs (PtrHashtable): Add constructor with initial size;
14588         We can now reduce reallocations of the method table.
14589
14590 2002-12-10  Ravi Pratap  <ravi@ximian.com>
14591
14592         * attribute.cs (ApplyAttributes): Keep track of the emitted
14593         attributes on a per-target basis. This fixes bug #35413.
14594
14595 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
14596
14597         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
14598         default to the Windows 1252 encoding.
14599
14600         (UnixParseOption): Support version, thanks to Alp for the missing
14601         pointer. 
14602
14603         * AssemblyInfo.cs: Add nice assembly information.
14604
14605         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
14606         (bug 35169).
14607
14608         * cs-parser.jay: Allow a trailing comma before the close bracked
14609         in the attribute_section production.
14610
14611         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
14612         address of the instance was being taken, I will take this out,
14613         because we take the address of the object immediately here.
14614
14615 2002-12-09  Ravi Pratap  <ravi@ximian.com>
14616
14617         * typemanager.cs (AreMultipleAllowed): Take care of the most
14618         obvious case where attribute type is not in the current assembly -
14619         stupid me ;-)
14620
14621 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
14622
14623         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
14624         definitions, instead of doing that afterwards.  
14625
14626         Also we use a nice little hack, depending on the constructor, we
14627         know if we are a "composed" name or a simple name.  Hence, we
14628         avoid the IndexOf test, and we avoid 
14629
14630         * codegen.cs: Add code to assist in a bug reporter to track down
14631         the source of a compiler crash. 
14632
14633 2002-12-07  Ravi Pratap  <ravi@ximian.com>
14634
14635         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
14636         types have been emitted for a given element and flag an error
14637         if something which does not have AllowMultiple set is used more
14638         than once.
14639
14640         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
14641         attribute types and their corresponding AllowMultiple properties
14642
14643         (AreMultipleAllowed): Check the property for a given type.
14644
14645         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
14646         property in the case we have a TypeContainer.
14647
14648         (Attributes.AddAttribute): Detect duplicates and just skip on
14649         adding them. This trivial fix catches a pretty gross error in our
14650         attribute emission - global attributes were being emitted twice!
14651
14652         Bugzilla bug #33187 is now fixed.
14653
14654 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
14655
14656         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
14657         instead of pp_and).
14658
14659         * expression.cs (Binary.ResolveOperator): I can only use the
14660         Concat (string, string, string) and Concat (string, string,
14661         string, string) if the child is actually a concatenation of
14662         strings. 
14663
14664 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
14665
14666         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
14667         context where we need a 2-character lookahead.
14668
14669         * pending.cs (PendingImplementation): Rework so we can keep track
14670         of interface types all the time, and flag those which were
14671         implemented by parents as optional.
14672
14673 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
14674
14675         * expression.cs (Binary.ResolveOperator): Use
14676         String.Concat(string,string,string) or
14677         String.Concat(string,string,string,string) when possible. 
14678
14679         * typemanager: More helper methods.
14680
14681
14682 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
14683
14684         * pending.cs: remove the bogus return from GetMissingInterfaces()
14685         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
14686
14687 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14688
14689         * namespace.cs: avoid duplicated 'using xxx' being added to
14690         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
14691         when we get more than one 'using' statement for the same namespace.
14692         Report a CS0105 warning for it.
14693
14694 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
14695
14696         * cs-tokenizer.cs (consume_identifier): use read directly, instead
14697         of calling getChar/putback, uses internal knowledge of it.    
14698
14699         (xtoken): Reorder tokenizer so most common patterns are checked
14700         first.  This reduces the compilation time in another 5% (from 8.11s
14701         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
14702
14703         The parsing time is 22% of the compilation in mcs, and from that
14704         64% is spent on the tokenization process.  
14705
14706         I tried using a binary search for keywords, but this is slower
14707         than the hashtable.  Another option would be to do a couple of
14708         things:
14709
14710                 * Not use a StringBuilder, instead use an array of chars,
14711                   with a set value.  Notice that this way we could catch
14712                   the 645 error without having to do it *afterwards*.
14713
14714                 * We could write a hand-parser to avoid the hashtable
14715                   compares altogether.
14716
14717         The identifier consumption process takes 37% of the tokenization
14718         time.  Another 15% is spent on is_number.  56% of the time spent
14719         on is_number is spent on Int64.Parse:
14720
14721                 * We could probably choose based on the string length to
14722                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
14723                   computations. 
14724
14725         Another 3% is spend on wrapping `xtoken' in the `token' function.
14726
14727         Handle 0xa0 as whitespace (#34752)
14728
14729 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
14730
14731         * typemanager.cs (IsCLRType): New routine to tell whether a type
14732         is one of the builtin types.  
14733
14734         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
14735         typecode in more places instead of doing pointer comparissions.
14736         We could leverage some knowledge about the way the typecodes are
14737         laid out.
14738
14739         New code to cache namespaces in assemblies, it is currently not
14740         invoked, to be used soon.
14741
14742         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
14743
14744         * expression.cs (Binary.ResolveOperator): specially handle
14745         strings, and do not perform user-defined operator overloading for
14746         built-in types.
14747
14748 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
14749
14750         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
14751         internalcall as it is a pretty simple operation;  Avoid whenever
14752         possible to call Char.IsLetter.
14753
14754         (consume_identifier): Cut by half the number of
14755         hashtable calls by merging the is_keyword and GetKeyword behavior.
14756
14757         Do not short-circuit, because if we do, we
14758         report errors (ie, #if false && true would produce an invalid
14759         directive error);
14760
14761
14762 2002-11-24  Martin Baulig  <martin@ximian.com>
14763
14764         * expression.cs (Cast.TryReduce): If we're in checked syntax,
14765         check constant ranges and report a CS0221.  Fixes #33186.
14766
14767 2002-11-24  Martin Baulig  <martin@ximian.com>
14768
14769         * cs-parser.jay: Make this work for uninitialized variable
14770         declarations in the `for' initializer.  Fixes #32416.
14771
14772 2002-11-24  Martin Baulig  <martin@ximian.com>
14773
14774         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
14775         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
14776
14777 2002-11-24  Martin Baulig  <martin@ximian.com>
14778
14779         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
14780         argument; if true, we also check for user-defined conversions.
14781         This is only needed if both arguments are of a user-defined type.
14782         Fixes #30443, added test-175.cs.
14783         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
14784
14785         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
14786
14787 2002-11-24  Martin Baulig  <martin@ximian.com>
14788
14789         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
14790         function to get the store opcode.
14791         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
14792         only emit the Ldelema if the store opcode is Stobj.  You must run
14793         both test-34 and test-167 to test this.  Fixes #34529.
14794
14795 2002-11-23  Martin Baulig  <martin@ximian.com>
14796
14797         * ecore.cs (Expression.MemberLookup): Added additional
14798         `qualifier_type' argument which is used when we're being called
14799         from MemberAccess.DoResolve() and null if we're called from a
14800         SimpleName lookup.
14801         (Expression.MemberLookupFailed): New method to report errors; this
14802         does the CS1540 check and reports the correct error message.
14803
14804         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
14805         argument for the CS1540 check and redone the way how we're dealing
14806         with private members.  See the comment in the source code for details.
14807         (FilterWithClosure): Reverted this back to revision 1.197; renamed
14808         `closure_start_type' to `closure_qualifier_type' and check whether
14809         it's not null.  It was not this filter being broken, it was just
14810         being called with the wrong arguments.
14811
14812         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
14813         and pass it the correct `qualifier_type'; this also does the error
14814         handling for us.
14815
14816 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
14817
14818         * expression.cs (Invocation.EmitParams): If the we are dealing
14819         with a non-built-in value type, load its address as well.
14820
14821         (ArrayCreation): Use a a pretty constant instead
14822         of the hardcoded value 2.   Use 6 instead of 2 for the number of
14823         static initializers.  
14824
14825         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
14826         because they are not really value types, just glorified integers. 
14827
14828         * driver.cs: Do not append .exe, the CSC compiler does not do it.
14829
14830         * ecore.cs: Remove redundant code for enumerations, make them use
14831         the same code path as everything else, fixes the casting issue
14832         with enumerations in Windows.Forms.
14833
14834         * attribute.cs: Do only cast to string if it is a string, the
14835         validation happens later.
14836
14837         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
14838         people upgrade their corlibs.
14839
14840         * ecore.cs: Oops, enumerations were not following the entire code path
14841
14842 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
14843
14844         * typemanager.cs (FilterWithClosure): Commented out the test for
14845         1540 in typemanager.cs, as it has problems when accessing
14846         protected methods from a parent class (see test-174.cs). 
14847
14848         * attribute.cs (Attribute.ValidateGuid): new method.
14849         (Attribute.Resolve): Use above.
14850
14851 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
14852
14853         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
14854
14855         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
14856         handling for enumerations, as we only needed the TypeContainer
14857         functionality to begin with (this is required for the fix below to
14858         work for enums that reference constants in a container class for
14859         example). 
14860
14861         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
14862
14863         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
14864         a valid TypeBuilder to perform lookups on.o
14865
14866         * class.cs (InheritableMemberSignatureCompare): Use true in the
14867         call to GetGetMethod and GetSetMethod, because we are comparing
14868         the signature, and we need to get the methods *even* if they are
14869         private. 
14870
14871         (PropertyBase.CheckBase): ditto.
14872
14873         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
14874         GotoCase.Resolve): Use Peel on EmpytCasts.
14875
14876         * ecore.cs (EmptyCast): drop child, add Peel method.
14877
14878 2002-11-17  Martin Baulig  <martin@ximian.com>
14879
14880         * ecore.cs (EmptyCast.Child): New public property.
14881
14882         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
14883         label resolved to an EmptyCast.  Fixes #34162.
14884         (GotoCase.Resolve): Likewise.
14885         (Block.EmitMeta): Likewise.
14886
14887 2002-11-17  Martin Baulig  <martin@ximian.com>
14888
14889         * expression.cs (Invocation.BetterConversion): Prefer int over
14890         uint; short over ushort; long over ulong for integer literals.
14891         Use ImplicitConversionExists instead of StandardConversionExists
14892         since we also need to check for user-defined implicit conversions.
14893         Fixes #34165.  Added test-173.cs.
14894
14895 2002-11-16  Martin Baulig  <martin@ximian.com>
14896
14897         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
14898         with the `true' and `false' literals.  Fixes #33151.
14899
14900 2002-11-16  Martin Baulig  <martin@ximian.com>
14901
14902         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
14903         October 22nd; don't do the cs1540 check for static members.
14904
14905         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
14906         now using our own filter here and doing the cs1540 check again.
14907
14908 2002-11-16  Martin Baulig  <martin@ximian.com>
14909
14910         * support.cs (InternalParameters): Don't crash if we don't have
14911         any fixed parameters.  Fixes #33532.
14912
14913 2002-11-16  Martin Baulig  <martin@ximian.com>
14914
14915         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
14916         when looking up static methods to make this work on Windows.
14917         Fixes #33773.
14918
14919 2002-11-16  Martin Baulig  <martin@ximian.com>
14920
14921         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
14922         a setter rather than using PropertyInfo.CanWrite.
14923
14924 2002-11-15  Nick Drochak  <ndrochak@gol.com>
14925
14926         * class.cs: Allow acces to block member by subclasses. Fixes build
14927         breaker.
14928
14929 2002-11-14  Martin Baulig  <martin@ximian.com>
14930
14931         * class.cs (Constructor.Emit): Added the extern/block check.
14932         Fixes bug #33678.
14933
14934 2002-11-14  Martin Baulig  <martin@ximian.com>
14935
14936         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
14937         iteration while looking for indexers, this is needed because the
14938         indexer may have a different name in our base classes.  Fixed the
14939         error reporting (no indexers at all, not get accessor, no
14940         overloaded match).  Fixes bug #33089.
14941         (IndexerAccess.DoResolveLValue): Likewise.
14942
14943 2002-11-14  Martin Baulig  <martin@ximian.com>
14944
14945         * class.cs (PropertyBase.CheckBase): Make this work for multiple
14946         indexers.  Fixes the first part of bug #33089.
14947         (MethodSignature.InheritableMemberSignatureCompare): Added support
14948         for properties.
14949
14950 2002-11-13  Ravi Pratap  <ravi@ximian.com>
14951
14952         * attribute.cs (Attribute.Resolve): Catch the
14953         NullReferenceException and report it since it isn't supposed to
14954         happen. 
14955
14956 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
14957
14958         * expression.cs (Binary.EmitBranchable): Also handle the cases for
14959         LogicalOr and LogicalAnd that can benefit from recursively
14960         handling EmitBranchable.  The code now should be nice for Paolo.
14961
14962 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
14963
14964         * typemanager.cs (LookupType): Added a negative-hit hashtable for
14965         the Type lookups, as we perform quite a number of lookups on
14966         non-Types.  This can be removed once we can deterministically tell
14967         whether we have a type or a namespace in advance.
14968
14969         But this might require special hacks from our corlib.
14970
14971         * TODO: updated.
14972
14973         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
14974         and double which avoids a conversion from an integer to a double.
14975
14976         * expression.cs: tiny optimization, avoid calling IsConstant,
14977         because it effectively performs the lookup twice.
14978
14979 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
14980
14981         But a bogus return here to keep the semantics of the old code
14982         until the Mono runtime is fixed.
14983
14984         * pending.cs (GetMissingInterfaces): New method used to remove all
14985         the interfaces that are already implemented by our parent
14986         classes from the list of pending methods. 
14987
14988         * interface.cs: Add checks for calls after ResolveTypeExpr.
14989
14990 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
14991
14992         * class.cs (Class.Emit): Report warning 67: event not used if the
14993         warning level is beyond 3.
14994
14995         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
14996         being a NullLiteral.
14997
14998         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
14999         specifiers. 
15000
15001         * class.cs (TypeContainer.GetClassBases): Cover a missing code
15002         path that might fail if a type can not be resolved.
15003
15004         * expression.cs (Binary.Emit): Emit unsigned versions of the
15005         operators. 
15006
15007         * driver.cs: use error 5.
15008
15009 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
15010
15011         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
15012
15013 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
15014
15015         * cs-parser.jay (switch_section): A beautiful patch from Martin
15016         Baulig that fixed 33094.
15017
15018 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
15019
15020         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15021         Check whether the base is abstract and report an error if so.
15022
15023         * expression.cs (IndexerAccess.DoResolveLValue,
15024         IndexerAccess.DoResolve): ditto. 
15025
15026         (Invocation.DoResolve): ditto.
15027
15028         (Invocation.FullMethodDesc): Improve the report string.
15029
15030         * statement.cs (Block): Eliminate IsVariableDefined as it is
15031         basically just a wrapper for GetVariableInfo.
15032
15033         * ecore.cs (SimpleName): Use new 
15034
15035         * support.cs (ReflectionParamter.ParameterType): We unwrap the
15036         type, as we return the actual parameter ref/unref state on a
15037         different call.
15038
15039 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
15040
15041         * support.cs: Return proper flags REF/OUT fixing the previous
15042         commit.  
15043
15044         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
15045         not used to mean `ref' but `ref or out' in ParameterReference
15046
15047         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15048         full type signature instead of calling TypeManger.CSharpName
15049         ourselves. 
15050
15051         * support.cs (InternalParameters.ParameterDesc): Do not compare
15052         directly to the modflags, because REF/OUT will actually be bitsets
15053         if set. 
15054
15055         * delegate.cs (VerifyMethod): Check also the modifiers.
15056
15057         * cs-tokenizer.cs: Fix bug where floating point values with an
15058         exponent where a sign was missing was ignored.
15059
15060         * driver.cs: Allow multiple assemblies to be specified in a single
15061         /r: argument
15062
15063 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
15064
15065         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
15066         because identifiers after a parenthesis would end up in this kind
15067         of production, and we needed to desamiguate it for having casts
15068         like:
15069
15070                 (UserDefinedType *) xxx
15071
15072 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
15073
15074         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
15075         we should set on the Bindingflags.NonPublic, but not turn on
15076         private_ok.  private_ok controls whether a Private member is
15077         returned (this is chekced on the filter routine), while the
15078         BindingFlags.NonPublic just controls whether private/protected
15079         will be allowed.   This fixes the problem part of the problem of
15080         private properties being allowed to be used in derived classes.
15081
15082         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
15083         so we can call the children DoResolveLValue method (this will
15084         properly signal errors on lvalue assignments to base properties)
15085
15086         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
15087         getter are null, and we have a property info, we know that this
15088         happened because the lookup failed, so we report an error 122 for
15089         protection level violation.
15090
15091         We also silently return if setter and getter are null in the
15092         resolve functions, this condition only happens if we have flagged
15093         the error before.  This is the other half of the problem. 
15094
15095         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15096         not have accessibility information, that is why we were returning
15097         true in the filter function in typemanager.cs.
15098
15099         To properly report 122 (property is inaccessible because of its
15100         protection level) correctly, we report this error in ResolveAccess
15101         by failing if both the setter and the getter are lacking (ie, the
15102         lookup failed). 
15103
15104         DoResolve and DoLResolve have been modified to check for both
15105         setter/getter being null and returning silently, the reason being
15106         that I did not want to put the knowledge about this error in upper
15107         layers, like:
15108
15109         int old = Report.Errors;
15110         x = new PropertyExpr (...);
15111         if (old != Report.Errors)
15112                 return null;
15113         else
15114                 return x;
15115
15116         So the property expr is returned, but it is invalid, so the error
15117         will be flagged during the resolve process. 
15118
15119         * class.cs: Remove InheritablePropertySignatureCompare from the
15120         class, as we no longer depend on the property signature to compute
15121         whether it is possible to implement a method or not.
15122
15123         The reason is that calling PropertyInfo.GetGetMethod will return
15124         null (in .NET, in Mono it works, and we should change this), in
15125         cases where the Get Method does not exist in that particular
15126         class.
15127
15128         So this code:
15129
15130         class X { public virtual int A { get { return 1; } } }
15131         class Y : X { }
15132         class Z : Y { public override int A { get { return 2; } } }
15133
15134         Would fail in Z because the parent (Y) would not have the property
15135         defined.  So we avoid this completely now (because the alternative
15136         fix was ugly and slow), and we now depend exclusively on the
15137         method names.
15138
15139         (PropertyBase.CheckBase): Use a method-base mechanism to find our
15140         reference method, instead of using the property.
15141
15142         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15143         routines are gone now.
15144
15145         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15146         names, they were incorrectly named.
15147
15148         * cs-tokenizer.cs: Return are more gentle token on failure. 
15149
15150         * pending.cs (PendingImplementation.InterfaceMethod): This routine
15151         had an out-of-sync index variable, which caused it to remove from
15152         the list of pending methods the wrong method sometimes.
15153
15154 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
15155
15156         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15157         CanWrite, because those refer to this particular instance of the
15158         property, and do not take into account the fact that we can
15159         override single members of a property.
15160
15161         Constructor requires an EmitContext.  The resolution process does
15162         not happen here, but we need to compute the accessors before,
15163         because the resolution does not always happen for properties.
15164
15165         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15166         subclass, before we did not update this flag, but we did update
15167         bindingflags. 
15168
15169         (GetAccessors): Drop this routine, as it did not work in the
15170         presence of partially overwritten set/get methods. 
15171
15172         Notice that this broke the cs1540 detection, but that will require
15173         more thinking. 
15174
15175 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15176
15177         * class.cs:
15178         * codegen.cs:
15179         * driver.cs: issue a warning instead of an error if we don't support
15180         debugging for the platform. Also ignore a couple of errors that may
15181         arise when trying to write the symbols. Undo my previous patch.
15182
15183 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15184
15185         * driver.cs: ignore /debug switch except for Unix platforms.
15186
15187 2002-10-23  Nick Drochak  <ndrochak@gol.com>
15188
15189         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15190
15191 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
15192
15193         * driver.cs: Do not make mcs-debug conditional, so we do not break
15194         builds that use it.
15195
15196         * statement.cs (UsageVector.MergeChildren): I would like Martin to
15197         review this patch.  But basically after all the children variables
15198         have been merged, the value of "Breaks" was not being set to
15199         new_breaks for Switch blocks.  I think that it should be set after
15200         it has executed.  Currently I set this to the value of new_breaks,
15201         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15202         conservative, but I do not understand this code very well.
15203
15204         I did not break anything in the build, so that is good ;-)
15205
15206         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15207
15208 2002-10-20  Mark Crichton  <crichton@gimp.org>
15209
15210         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
15211
15212 2002-10-20  Nick Drochak  <ndrochak@gol.com>
15213
15214         * cfold.cs: Fixed compile blocker.
15215
15216 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
15217
15218         * driver.cs: I was chekcing the key, not the file.
15219
15220 2002-10-19  Ravi Pratap  <ravi@ximian.com>
15221
15222         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15223         message that we were generating - we just need to silently return
15224         a null.
15225
15226 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
15227
15228         * class.cs (Event.Define): Change my previous commit, as this
15229         breaks the debugger.  This is a temporary hack, as it seems like
15230         the compiler is generating events incorrectly to begin with.
15231
15232         * expression.cs (Binary.ResolveOperator): Added support for 
15233         "U operator - (E x, E y)"
15234
15235         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15236         y)".
15237
15238         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15239         init-only variables, but this path did not take into account that
15240         there might be also instance readonly variables.  Correct this
15241         problem. 
15242
15243         This fixes bug 32253
15244
15245         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15246         delegates as well.
15247
15248         * driver.cs: Change the extension for modules to `netmodule'
15249
15250         * cs-parser.jay: Improved slightly the location tracking for
15251         the debugger symbols.
15252
15253         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15254         modifiers that were specified instead of the hardcoded value
15255         (FamAndAssem).  This was basically ignoring the static modifier,
15256         and others.  Fixes 32429.
15257
15258         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15259         fixed a bug in the process (32476)
15260
15261         * expression.cs (ArrayAccess.EmitAssign): Patch from
15262         hwang_rob@yahoo.ca that fixes bug 31834.3
15263
15264 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
15265
15266         * driver.cs: Make the module extension .netmodule.
15267
15268 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
15269
15270         * driver.cs: Report an error if the resource file is not found
15271         instead of crashing.
15272
15273         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15274         false, like Emit does.
15275
15276 2002-10-16  Nick Drochak  <ndrochak@gol.com>
15277
15278         * typemanager.cs: Remove unused private member.  Also reported mcs
15279         bug to report this as a warning like csc.
15280
15281 2002-10-15  Martin Baulig  <martin@gnome.org>
15282
15283         * statement.cs (Statement.Emit): Made this a virtual method; emits
15284         the line number info and calls DoEmit().
15285         (Statement.DoEmit): New protected abstract method, formerly knows
15286         as Statement.Emit().
15287
15288         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15289
15290 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
15291
15292         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15293         have fixed a remaining problem: not every AddXXXX was adding a
15294         fully qualified name.  
15295
15296         Now everyone registers a fully qualified name in the DeclSpace as
15297         being defined instead of the partial name.  
15298
15299         Downsides: we are slower than we need to be due to the excess
15300         copies and the names being registered this way.  
15301
15302         The reason for this is that we currently depend (on the corlib
15303         bootstrap for instance) that types are fully qualified, because
15304         we dump all the types in the namespace, and we should really have
15305         types inserted into the proper namespace, so we can only store the
15306         basenames in the defined_names array.
15307
15308 2002-10-10  Martin Baulig  <martin@gnome.org>
15309
15310         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15311         from bug #31834, see the bug report for a testcase which is
15312         miscompiled.
15313
15314 2002-10-10  Martin Baulig  <martin@gnome.org>
15315
15316         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
15317         flow analysis code for this.
15318
15319         * statement.cs (Do, While, For): Tell the flow analysis code about
15320         infinite loops.
15321         (FlowBranching.UsageVector): Added support for infinite loops.
15322         (Block.Resolve): Moved the dead code elimination here and use flow
15323         analysis to do it.
15324
15325 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
15326
15327         * class.cs (Field.Define): Catch cycles on struct type
15328         definitions. 
15329
15330         * typemanager.cs (IsUnmanagedtype): Do not recursively check
15331         fields if the fields are static.  We only need to check instance
15332         fields. 
15333
15334         * expression.cs (As.DoResolve): Test for reference type.
15335
15336         * statement.cs (Using.ResolveExpression): Use
15337         ConvertImplicitRequired, not ConvertImplicit which reports an
15338         error on failture
15339         (Using.ResolveLocalVariableDecls): ditto.
15340
15341         * expression.cs (Binary.ResolveOperator): Report errors in a few
15342         places where we had to.
15343
15344         * typemanager.cs (IsUnmanagedtype): Finish implementation.
15345
15346 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
15347
15348         * expression.cs: Use StoreFromPtr instead of extracting the type
15349         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
15350
15351         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
15352         an enumeration value to a System.Enum, but System.Enum is not a
15353         value type, but an class type, so we need to box.
15354
15355         (Expression.ConvertExplicit): One codepath could return
15356         errors but not flag them.  Fix this.  Fixes #31853
15357
15358         * parameter.cs (Resolve): Do not allow void as a parameter type.
15359
15360 2002-10-06  Martin Baulig  <martin@gnome.org>
15361
15362         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
15363         if it's a class type and not a struct.  Fixes #31815.
15364
15365 2002-10-06  Martin Baulig  <martin@gnome.org>
15366
15367         * statement.cs: Reworked the flow analysis code a bit to make it
15368         usable for dead code elimination.
15369
15370 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15371
15372         * cs-parser.jay: allow empty source files. Fixes bug #31781.
15373
15374 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15375
15376         * expression.cs (ComposedCast.DoResolveType): A quick workaround
15377         to fix the test 165, will investigate deeper.
15378
15379 2002-10-04  Martin Baulig  <martin@gnome.org>
15380
15381         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
15382         finally blocks actually work.
15383         (Try.Resolve): We don't need to create a sibling for `finally' if
15384         there is no finally block.
15385
15386 2002-10-04  Martin Baulig  <martin@gnome.org>
15387
15388         * class.cs (Constructor.Define): The default accessibility for a
15389         non-default constructor is private, not public.
15390
15391 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15392
15393         * class.cs (Constructor): Make AllowedModifiers public, add
15394         EXTERN.
15395
15396         * cs-parser.jay: Perform the modifiers test here, as the
15397         constructor for the Constructor class usually receives a zero
15398         because of the way we create it (first we create, later we
15399         customize, and we were never checking the modifiers).
15400
15401         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
15402         is a version of LookupTypeReflection that includes the type-name
15403         cache.  This can be used as a fast path for functions that know
15404         the fully qualified name and are only calling into *.GetType() to
15405         obtain a composed type.
15406
15407         This is also used by TypeManager.LookupType during its type
15408         composition.
15409
15410         (LookupType): We now also track the real type name, as sometimes
15411         we can get a quey for the real type name from things like
15412         ComposedCast.  This fixes bug 31422.
15413
15414         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
15415         complete type fullname, it does not have to go through the type
15416         resolution system to obtain the composed version of the type (for
15417         obtaining arrays or pointers).
15418
15419         (Conditional.Emit): Use the EmitBoolExpression to
15420         generate nicer code, as requested by Paolo.
15421
15422         (ArrayCreation.CheckIndices): Use the patch from
15423         hwang_rob@yahoo.ca to validate the array initializers. 
15424
15425 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
15426
15427         * class.cs (ConstructorInitializer.Emit): simplify code by using
15428         Invocation.EmitCall, and at the same time, fix the bugs in calling
15429         parent constructors that took variable arguments. 
15430
15431         * ecore.cs (Expression.ConvertNumericExplicit,
15432         Expression.ImplicitNumericConversion): Remove the code that
15433         manually wrapped decimal (InternalTypeConstructor call is now gone
15434         as well).
15435
15436         * expression.cs (Cast.TryReduce): Also handle decimal types when
15437         trying to perform a constant fold on the type.
15438
15439         * typemanager.cs (IsUnmanagedtype): Partially implemented.
15440
15441         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
15442         that only turned off an error report, and did nothing else. 
15443
15444 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
15445
15446         * driver.cs: Handle and ignore /fullpaths
15447
15448 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
15449
15450         * expression.cs (Binary.ResolveOperator): Catch the case where
15451         DoNumericPromotions returns true, 
15452
15453         (Binary.DoNumericPromotions): Simplify the code, and the tests.
15454
15455 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
15456
15457         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
15458         report error 70.
15459
15460 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
15461
15462         * ecore.cs (ConvertNumericExplicit): It is not enough that the
15463         conversion exists, but it is also required that the conversion be
15464         performed.  This manifested in "(Type64Enum) 2".  
15465
15466         * class.cs (TypeManager.AddMethod): The fix is not to change
15467         AddEnum, because that one was using a fully qualified name (every
15468         DeclSpace derivative does), but to change the AddMethod routine
15469         that was using an un-namespaced name.  This now correctly reports
15470         the duplicated name.
15471
15472         Revert patch until I can properly fix it.  The issue
15473         is that we have a shared Type space across all namespaces
15474         currently, which is wrong.
15475
15476         Options include making the Namespace a DeclSpace, and merge
15477         current_namespace/current_container in the parser.
15478
15479 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
15480
15481         * cs-parser.jay: Improve error reporting when we get a different
15482         kind of expression in local_variable_type and
15483         local_variable_pointer_type. 
15484
15485         Propagate this to avoid missleading errors being reported.
15486
15487         * ecore.cs (ImplicitReferenceConversion): treat
15488         TypeManager.value_type as a target just like object_type.   As
15489         code like this:
15490
15491         ValueType v = 1;
15492
15493         Is valid, and needs to result in the int 1 being boxed before it
15494         is assigned to the value type v.
15495
15496         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
15497         to validate the enumeration name.
15498
15499         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
15500         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
15501         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
15502
15503         * ecore.cs (TryImplicitIntConversion): When doing an
15504         implicit-enumeration-conversion, check if the type is 64-bits and
15505         perform a conversion before passing to EnumConstant.
15506
15507 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
15508
15509         * decl.cs (Error_AmbiguousTypeReference); New routine used to
15510         report ambiguous type references.  Unlike the MS version, we
15511         report what the ambiguity is.   Innovation at work ;-)
15512
15513         (DeclSpace.FindType): Require a location argument to
15514         display when we display an ambiguous error.
15515
15516         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
15517
15518         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
15519
15520         * expression.cs (EmitDynamicInitializers): Apply patch from
15521         hwang_rob@yahoo.ca that fixes the order in which we emit our
15522         initializers. 
15523
15524 2002-09-21  Martin Baulig  <martin@gnome.org>
15525
15526         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
15527         delegate takes no arguments.
15528
15529 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
15530
15531         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
15532         from integers.
15533
15534         * expression.cs: Extract the underlying type.
15535
15536         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
15537
15538         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
15539
15540 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
15541
15542         * class.cs (TypeContainer.DefineType): We can not use the nice
15543         PackingSize with the size set to 1 DefineType method, because it
15544         will not allow us to define the interfaces that the struct
15545         implements.
15546
15547         This completes the fixing of bug 27287
15548
15549         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
15550         means also structs.  This fixes part of the problem. 
15551         (Expresion.ImplicitReferenceConversionExists): ditto.
15552
15553         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
15554         error if there were no errors reported during the type lookup
15555         process, to avoid duplicates or redundant errors.  Without this
15556         you would get an ambiguous errors plus a type not found.  We have
15557         beaten the user enough with the first error.  
15558
15559         (DeclSparce.FindType): Emit a warning if we have an ambiguous
15560         reference. 
15561
15562         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
15563         during the resolution process, stop the lookup, this avoids
15564         repeated error reports (same error twice).
15565
15566         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
15567
15568         * typemanager.cs (LookupType): Redo the type lookup code to match
15569         the needs of System.Reflection.  
15570
15571         The issue is that System.Reflection requires references to nested
15572         types to begin with a "+" sign instead of a dot.  So toplevel
15573         types look like: "NameSpace.TopLevelClass", and nested ones look
15574         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
15575         levels. 
15576
15577 2002-09-19  Martin Baulig  <martin@gnome.org>
15578
15579         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
15580         says that a method always returns or always throws an exception,
15581         don't report the CS0161.
15582
15583         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
15584         set `Returns = new_returns'.
15585
15586 2002-09-19  Martin Baulig  <martin@gnome.org>
15587
15588         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
15589         to an enum constant, check for a CS0176.
15590
15591 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
15592
15593         * class.cs (TypeContainer.CheckPairedOperators): Now we check
15594         for operators that must be in pairs and report errors.
15595
15596         * ecore.cs (SimpleName.DoResolveType): During the initial type
15597         resolution process, when we define types recursively, we must
15598         check first for types in our current scope before we perform
15599         lookups in the enclosing scopes.
15600
15601         * expression.cs (MakeByteBlob): Handle Decimal blobs.
15602
15603         (Invocation.VerifyArgumentsCompat): Call
15604         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
15605         I thought we were supposed to always call this, but there are a
15606         few places in the code where we dont do it.
15607
15608 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
15609
15610         * driver.cs: Add support in -linkres and -resource to specify the
15611         name of the identifier.
15612
15613 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
15614
15615         * ecore.cs (StandardConversionExists): Sync with the conversion
15616         code: allow anything-* to void* conversions.
15617
15618         (FindMostSpecificSource): Use an Expression argument
15619         instead of a Type, because we might be handed over a Literal which
15620         gets a few more implicit conversions that plain types do not.  So
15621         this information was being lost.
15622
15623         Also, we drop the temporary type-holder expression when not
15624         required.
15625
15626 2002-09-17  Martin Baulig  <martin@gnome.org>
15627
15628         * class.cs (PropertyBase.CheckBase): Don't check the base class if
15629         this is an explicit interface implementation.
15630
15631 2002-09-17  Martin Baulig  <martin@gnome.org>
15632
15633         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
15634         different `IndexerName' attributes.
15635
15636         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
15637         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
15638         virtual CommonResolve().
15639
15640 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
15641
15642         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
15643         and convert that to the UnderlyingType.
15644
15645         * statement.cs (Foreach.Resolve): Indexers are just like variables
15646         or PropertyAccesses.
15647
15648         * cs-tokenizer.cs (consume_string): Track line numbers and columns
15649         inside quoted strings, we were not doing this before.
15650
15651 2002-09-16  Martin Baulig  <martin@gnome.org>
15652
15653         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
15654         resolve it.  This is needed for the definite assignment check of the
15655         instance expression, fixes bug #29846.
15656         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
15657
15658 2002-09-16  Nick Drochak  <ndrochak@gol.com>
15659
15660         * parameter.cs: Fix compile error.  Cannot reference static member
15661         from an instance object.  Is this an mcs bug?
15662
15663 2002-09-14  Martin Baulig  <martin@gnome.org>
15664
15665         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
15666         multiple times.  Fixes bug #30295, added test-166.cs.
15667
15668 2002-09-14  Martin Baulig  <martin@gnome.org>
15669
15670         * statement.cs (Block.Emit): Don't emit unreachable code.
15671         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
15672         `break' statements.
15673         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
15674
15675 2002-09-14  Martin Baulig  <martin@gnome.org>
15676
15677         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
15678         is set.
15679
15680 2002-09-14  Martin Baulig  <martin@gnome.org>
15681
15682         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
15683         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
15684         be false on the ms runtime.
15685
15686 2002-09-13  Martin Baulig  <martin@gnome.org>
15687
15688         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
15689         the CS0038 error message.
15690
15691 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
15692
15693         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
15694         constant inside, return it.
15695
15696 2002-09-12  Martin Baulig  <martin@gnome.org>
15697
15698         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
15699         implicit conversion can be done between enum types.
15700
15701         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
15702         check whether an implicit conversion to the current enum's UnderlyingType
15703         exists and report an error if not.
15704
15705         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
15706         without debugging support.
15707
15708         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
15709         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
15710
15711 2002-09-12  Martin Baulig  <martin@gnome.org>
15712
15713         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
15714
15715         * ecore.cs (IMemberExpr.DeclaringType): New property.
15716         (SimpleName.SimpleNameResolve): Check whether we're accessing a
15717         nonstatic member of an outer type (CS0038).
15718
15719 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
15720
15721         * driver.cs: Activate the using-error detector at warning level
15722         4 (at least for MS-compatible APIs).
15723
15724         * namespace.cs (VerifyUsing): Small buglett fix.
15725
15726         * pending.cs (PendingImplementation): pass the container pointer. 
15727
15728         * interface.cs (GetMethods): Allow for recursive definition.  Long
15729         term, I would like to move every type to support recursive
15730         definitions, not the current ordering mechanism that we have right
15731         now.
15732
15733         The situation is this: Attributes are handled before interfaces,
15734         so we can apply attributes to interfaces.  But some attributes
15735         implement interfaces, we will now handle the simple cases
15736         (recursive definitions will just get an error).  
15737
15738         * parameter.cs: Only invalidate types at the end if we fail to
15739         lookup all types.  
15740
15741 2002-09-09  Martin Baulig  <martin@gnome.org>
15742
15743         * ecore.cs (PropertyExpr.Emit): Also check for
15744         TypeManager.system_int_array_get_length so this'll also work when
15745         compiling corlib.  Fixes #30003.
15746
15747 2002-09-09  Martin Baulig  <martin@gnome.org>
15748
15749         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
15750         and throw an exception if we can't get the type's size.  Fixed #30040,
15751         added test-165.cs.
15752
15753 2002-09-09  Martin Baulig  <martin@gnome.org>
15754
15755         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
15756
15757         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
15758         context.  Fixes bug #30027.
15759
15760         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
15761         virtual functions.  Fixes bug #30043, added test-164.cs.
15762
15763 2002-09-08  Ravi Pratap  <ravi@ximian.com>
15764
15765         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
15766
15767 2002-09-08  Nick Drochak  <ndrochak@gol.com>
15768
15769         * driver.cs: Use an object to get the windows codepage since it's not a
15770         static property.
15771
15772 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
15773
15774         * statement.cs (For.Emit): for infinite loops (test == null)
15775         return whether there is a break inside, not always "true".
15776
15777         * namespace.cs (UsingEntry): New struct to hold the name of the
15778         using definition, the location where it is defined, and whether it
15779         has been used in a successful type lookup.
15780
15781         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
15782         strings.
15783
15784         * decl.cs: ditto.
15785
15786 2002-09-06  Ravi Pratap  <ravi@ximian.com>
15787
15788         * attribute.cs : Fix incorrect code which relied on catching
15789         a NullReferenceException to detect a null being passed in
15790         where an object was expected.
15791
15792 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
15793
15794         * statement.cs (Try): flag the catch variable as assigned
15795
15796         * expression.cs (Cast): Simplified by using ResolveType instead of
15797         manually resolving.
15798
15799         * statement.cs (Catch): Fix bug by using ResolveType.
15800
15801 2002-09-06  Ravi Pratap  <ravi@ximian.com>
15802
15803         * expression.cs (BetterConversion): Special case for when we have
15804         a NullLiteral as the argument and we have to choose between string
15805         and object types - we choose string the way csc does.
15806
15807         * attribute.cs (Attribute.Resolve): Catch the
15808         NullReferenceException and report error #182 since the Mono
15809         runtime no more has the bug and having this exception raised means
15810         we tried to select a constructor which takes an object and is
15811         passed a null.
15812
15813 2002-09-05  Ravi Pratap  <ravi@ximian.com>
15814
15815         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
15816         message (1502, 1503) when we can't locate a method after overload
15817         resolution. This is much more informative and closes the bug
15818         Miguel reported.
15819
15820         * interface.cs (PopulateMethod): Return if there are no argument
15821         types. Fixes a NullReferenceException bug.
15822
15823         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
15824         expressions too. Previously we were checking only in one place for
15825         positional arguments leaving out named arguments.
15826
15827         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
15828         type to the enum type is not allowed. Remove code corresponding to
15829         that.
15830
15831         (ConvertNumericExplicit): Allow explicit conversions from
15832         the underlying type to enum type. This precisely follows the spec
15833         and closes a bug filed by Gonzalo.
15834
15835 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15836
15837         * compiler.csproj:
15838         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
15839
15840 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
15841
15842         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
15843         it was important that we stored the right value after the
15844         reduction in `converted'.
15845
15846 2002-09-04  Martin Baulig  <martin@gnome.org>
15847
15848         * location.cs (Location.SymbolDocument): Use full pathnames for the
15849         source files.
15850
15851 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
15852
15853         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
15854         of the expression resolve mechanism, because that will catch the
15855         SimpleName error failures.
15856
15857         (Conditional): If we can not resolve the
15858         expression, return, do not crash.
15859
15860 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15861
15862         * cs-tokenizer.cs:
15863         (location): display token name instead of its number.
15864
15865 2002-08-28  Martin Baulig  <martin@gnome.org>
15866
15867         * expression.cs (Binary.ResolveOperator): Don't silently return
15868         but return an error if an operator cannot be applied between two
15869         enum types.
15870
15871 2002-08-28  Martin Baulig  <martin@gnome.org>
15872
15873         * class.cs (Constructor.Define): Set the permission attributes
15874         correctly instead of making all constructors public.
15875
15876 2002-08-28  Martin Baulig  <martin@gnome.org>
15877
15878         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
15879         for private members before reporting a CS0103; if we find anything,
15880         it's a CS0122.
15881
15882 2002-08-28  Martin Baulig  <martin@gnome.org>
15883
15884         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
15885         to check whether `closure_start_type == closure_invocation_type',
15886         we also need to check whether `m.DeclaringType == closure_invocation_type'
15887         before bypassing the permission checks.  We might be accessing
15888         protected/private members from the base class.
15889         (TypeManager.RealMemberLookup): Only set private_ok if private
15890         members were requested via BindingFlags.NonPublic.
15891
15892         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
15893
15894         * expression.cs (MemberAccess.ResolveMemberAccess): Set
15895         MethodGroupExpr.IsExplicitImpl if appropriate.
15896         (Invocation.DoResolve): Don't report the CS0120 for explicit
15897         interface implementations.
15898
15899 2002-08-27  Martin Baulig  <martin@gnome.org>
15900
15901         * expression.cs (Invocation.DoResolve): If this is a static
15902         method and we don't have an InstanceExpression, we must report
15903         a CS0120.
15904
15905 2002-08-25  Martin Baulig  <martin@gnome.org>
15906
15907         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
15908         `==' between a valuetype and an object.
15909
15910 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
15911
15912         * ecore.cs (TypeExpr): Provide a ToString method.
15913
15914 2002-08-24  Martin Baulig  <martin@gnome.org>
15915
15916         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
15917         now called proggie.dbg and it's a binary file.
15918
15919 2002-08-23  Martin Baulig  <martin@gnome.org>
15920
15921         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
15922
15923 2002-08-23  Martin Baulig  <martin@gnome.org>
15924
15925         * struct.cs (MyStructInfo.ctor): Make this work with empty
15926         structs; it's not allowed to use foreach() on null.
15927
15928 2002-08-23  Martin Baulig  <martin@gnome.org>
15929
15930         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
15931         writer the full pathname of the generated assembly.
15932
15933 2002-08-23  Martin Baulig  <martin@gnome.org>
15934
15935         * statements.cs (FlowBranching.UsageVector.MergeChildren):
15936         A `finally' block never returns or breaks; improved handling of
15937         unreachable code.
15938
15939 2002-08-23  Martin Baulig  <martin@gnome.org>
15940
15941         * statement.cs (Throw.Resolve): Allow `throw null'.
15942
15943 2002-08-23  Martin Baulig  <martin@gnome.org>
15944
15945         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
15946         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
15947         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
15948         MemberLookup would return a wrong event if this is an explicit
15949         interface implementation and the class has an event with the same
15950         name.
15951
15952 2002-08-23  Martin Baulig  <martin@gnome.org>
15953
15954         * statement.cs (Block.AddChildVariableNames): New public method.
15955         (Block.AddChildVariableName): Likewise.
15956         (Block.IsVariableNameUsedInChildBlock): Likewise.
15957         (Block.AddVariable): Check whether a variable name has already
15958         been used in a child block.
15959
15960         * cs-parser.jay (declare_local_variables): Mark all variable names
15961         from the current block as being used in a child block in the
15962         implicit block.
15963
15964 2002-08-23  Martin Baulig  <martin@gnome.org>
15965
15966         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
15967         find the symbol writer.
15968
15969         * driver.cs: csc also allows the arguments to /define being
15970         separated by commas, not only by semicolons.
15971
15972 2002-08-23  Martin Baulig  <martin@gnome.org>
15973
15974         * interface.cs (Interface.GetMembers): Added static check for events.
15975
15976 2002-08-15  Martin Baulig  <martin@gnome.org>
15977
15978         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
15979         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
15980
15981         * ecore.cs (Expression.MemberLookup): Added documentation and explained
15982         why the MethodData.EmitDestructor() change was necessary.
15983
15984 2002-08-20  Martin Baulig  <martin@gnome.org>
15985
15986         * class.cs (TypeContainer.FindMembers): Added static check for events.
15987
15988         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
15989
15990         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
15991         use Type.GetEvents(), not Type.FindMembers().
15992
15993 2002-08-20  Martin Baulig  <martin@gnome.org>
15994
15995         * decl.cs (MemberCache): Added a special method cache which will
15996         be used for method-only searched.  This ensures that a method
15997         search will return a MethodInfo with the correct ReflectedType for
15998         inherited methods.      
15999
16000 2002-08-20  Martin Baulig  <martin@gnome.org>
16001
16002         * decl.cs (DeclSpace.FindMembers): Made this public.
16003
16004 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16005
16006         * delegate.cs: fixed build on windows.
16007         [FIXME:  Filed as bug #29150: MCS must report these errors.]
16008
16009 2002-08-19  Ravi Pratap  <ravi@ximian.com>
16010
16011         * ecore.cs (StandardConversionExists): Return a false
16012         if we are trying to convert the void type to anything else
16013         since that is not allowed.
16014
16015         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16016         we flag error 70 in the event an event is trying to be accessed
16017         directly from outside the declaring type.
16018
16019 2002-08-20  Martin Baulig  <martin@gnome.org>
16020
16021         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16022         MemberCache from typemanager.cs to decl.cs.
16023
16024 2002-08-19  Martin Baulig  <martin@gnome.org>
16025
16026         * class.cs (TypeContainer): Implement IMemberContainer.
16027         (TypeContainer.DefineMembers): Create the MemberCache.
16028         (TypeContainer.FindMembers): Do better BindingFlags checking; only
16029         return public members if BindingFlags.Public was given, check
16030         whether members are static.
16031
16032 2002-08-16  Martin Baulig  <martin@gnome.org>
16033
16034         * decl.cs (DeclSpace.Define): Splitted this in Define and
16035         DefineMembers.  DefineMembers is called first and initializes the
16036         MemberCache.
16037
16038         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
16039         DefineMembers() on all our DeclSpaces.
16040
16041         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16042         but call DefineMembers() on all nested interfaces.  We call their
16043         Define() in our new Define() function.
16044
16045         * interface.cs (Interface): Implement IMemberContainer.
16046         (Interface.Define): Moved all code except the attribute stuf to
16047         DefineMembers().
16048         (Interface.DefineMembers): Initialize the member cache.
16049
16050         * typemanager.cs (IMemberFinder): Removed this interface, we don't
16051         need this anymore since we can use MemberCache.FindMembers directly.
16052
16053 2002-08-19  Martin Baulig  <martin@gnome.org>
16054
16055         * typemanager.cs (MemberCache): When creating the cache for an
16056         interface type, add all inherited members.
16057         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16058         to `out bool used_cache' and documented it.
16059         (TypeManager.MemberLookup): If we already used the cache in the first
16060         iteration, we don't need to do the interfaces check.
16061
16062 2002-08-19  Martin Baulig  <martin@gnome.org>
16063
16064         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
16065         here from IMemberFinder and don't implement this interface anymore.
16066         (DeclSpace.MemberCache): Moved here from IMemberFinder.
16067
16068         * typemanager.cs (IMemberFinder): This interface is now only used by
16069         classes which actually support the member cache.
16070         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16071         since we only put DeclSpaces into this Hashtable.
16072         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
16073         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
16074
16075 2002-08-16  Martin Baulig  <martin@gnome.org>
16076
16077         * typemanager.cs (ICachingMemberFinder): Removed.
16078         (IMemberFinder.MemberCache): New property.
16079         (TypeManager.FindMembers): Merged this with RealFindMembers().
16080         This function will never be called from TypeManager.MemberLookup()
16081         so we can't use the cache here, just the IMemberFinder.
16082         (TypeManager.MemberLookup_FindMembers): Check whether the
16083         IMemberFinder has a MemberCache and call the cache's FindMembers
16084         function.
16085         (MemberCache): Rewrote larger parts of this yet another time and
16086         cleaned it up a bit.
16087
16088 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
16089
16090         * driver.cs (LoadArgs): Support quoting.
16091
16092         (Usage): Show the CSC-like command line arguments.
16093
16094         Improved a few error messages.
16095
16096 2002-08-15  Martin Baulig  <martin@gnome.org>
16097
16098         * typemanager.cs (IMemberContainer.Type): New property.
16099         (IMemberContainer.IsInterface): New property.
16100
16101         The following changes are conditional to BROKEN_RUNTIME, which is
16102         defined at the top of the file.
16103
16104         * typemanager.cs (MemberCache.MemberCache): Don't add the base
16105         class'es members, but add all members from TypeHandle.ObjectType
16106         if we're an interface.
16107         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16108         is the current type.
16109         (MemberCache.CacheEntry.Container): Removed this field.
16110         (TypeHandle.GetMembers): Include inherited members.
16111
16112 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16113
16114         * typemanager.cs: fixed compilation and added a comment on a field that
16115         is never used.
16116
16117 2002-08-15  Martin Baulig  <martin@gnome.org>
16118
16119         * class.cs (ConstructorInitializer.Resolve): In the
16120         Expression.MemberLookup call, use the queried_type as
16121         invocation_type.
16122
16123         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16124         declared' attribute, it's always true.
16125         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16126         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16127         temporary wrapper for FindMembers which tells MemberLookup whether
16128         members from the base classes are included in the return value.
16129         This will go away soon.
16130         (TypeManager.MemberLookup): Use this temporary hack here; once the
16131         new MemberCache is completed, we don't need to do the DeclaredOnly
16132         looping here anymore since the MemberCache will take care of this.
16133         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16134         (MemberCache): When creating the MemberCache for a class, get
16135         members from the current class and all its base classes.
16136         (MemberCache.CacheEntry.Container): New field.  This is a
16137         temporary hack until the Mono runtime is fixed to distinguish
16138         between ReflectedType and DeclaringType.  It allows us to use MCS
16139         with both the MS runtime and the unfixed Mono runtime without
16140         problems and without accecting performance.
16141         (MemberCache.SearchMembers): The DeclaredOnly looping from
16142         TypeManager.MemberLookup is now done here.      
16143
16144 2002-08-14  Martin Baulig  <martin@gnome.org>
16145
16146         * statement.cs (MyStructInfo.MyStructInfo): Don't call
16147         Type.GetFields on dynamic types but get the fields from the
16148         corresponding TypeContainer.
16149         (MyStructInfo.GetStructInfo): Added check for enum types.
16150
16151         * typemanager.cs (MemberList.IsSynchronized): Implemented.
16152         (MemberList.SyncRoot): Implemented.
16153         (TypeManager.FilterWithClosure): No need to check permissions if
16154         closure_start_type == closure_invocation_type, don't crash if
16155         closure_invocation_type is null.
16156
16157 2002-08-13  Martin Baulig  <martin@gnome.org>
16158
16159         Rewrote TypeContainer.FindMembers to use a member cache.  This
16160         gives us a speed increase of about 35% for the self-hosting MCS
16161         build and of about 15-20% for the class libs (both on GNU/Linux).
16162
16163         * report.cs (Timer): New class to get enhanced profiling.  This
16164         whole class is "TIMER" conditional since it remarkably slows down
16165         compilation speed.
16166
16167         * class.cs (MemberList): New class.  This is an IList wrapper
16168         which we're now using instead of passing MemberInfo[]'s around to
16169         avoid copying this array unnecessarily.
16170         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16171         (ICachingMemberFinder, IMemberContainer): New interface.
16172         (TypeManager.FilterWithClosure): If `criteria' is null, the name
16173         has already been checked, otherwise use it for the name comparision.
16174         (TypeManager.FindMembers): Renamed to RealMemberFinder and
16175         provided wrapper which tries to use ICachingMemberFinder.FindMembers
16176         if possible.  Returns a MemberList, not a MemberInfo [].
16177         (TypeHandle): New class, implements IMemberContainer.  We create
16178         one instance of this class per type, it contains a MemberCache
16179         which is used to do the member lookups.
16180         (MemberCache): New class.  Each instance of this class contains
16181         all members of a type and a name-based hash table.
16182         (MemberCache.FindMembers): This is our new member lookup
16183         function.  First, it looks up all members of the requested name in
16184         the hash table.  Then, it walks this list and sorts out all
16185         applicable members and returns them.
16186
16187 2002-08-13  Martin Baulig  <martin@gnome.org>
16188
16189         In addition to a nice code cleanup, this gives us a performance
16190         increase of about 1.4% on GNU/Linux - not much, but it's already
16191         half a second for the self-hosting MCS compilation.
16192
16193         * typemanager.cs (IMemberFinder): New interface.  It is used by
16194         TypeManager.FindMembers to call FindMembers on a TypeContainer,
16195         Enum, Delegate or Interface.
16196         (TypeManager.finder_to_member_finder): New PtrHashtable.
16197         (TypeManager.finder_to_container): Removed.
16198         (TypeManager.finder_to_delegate): Removed.
16199         (TypeManager.finder_to_interface): Removed.
16200         (TypeManager.finder_to_enum): Removed.
16201
16202         * interface.cs (Interface): Implement IMemberFinder.
16203
16204         * delegate.cs (Delegate): Implement IMemberFinder.
16205
16206         * enum.cs (Enum): Implement IMemberFinder.
16207
16208         * class.cs (TypeContainer): Implement IMemberFinder.
16209
16210 2002-08-12  Martin Baulig  <martin@gnome.org>
16211
16212         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16213
16214 2002-08-12  Martin Baulig  <martin@gnome.org>
16215
16216         * ecore.cs (ITypeExpression): New interface for expressions which
16217         resolve to a type.
16218         (TypeExpression): Renamed to TypeLookupExpression.
16219         (Expression.DoResolve): If we're doing a types-only lookup, the
16220         expression must implement the ITypeExpression interface and we
16221         call DoResolveType() on it.
16222         (SimpleName): Implement the new ITypeExpression interface.
16223         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16224         hack, the situation that we're only looking up types can't happen
16225         anymore when this method is called.  Moved the type lookup code to
16226         DoResolveType() and call it.
16227         (SimpleName.DoResolveType): This ITypeExpression interface method
16228         is now doing the types-only lookup.
16229         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16230         (ResolveFlags): Added MaskExprClass.
16231
16232         * expression.cs (MemberAccess): Implement the ITypeExpression
16233         interface.
16234         (MemberAccess.DoResolve): Added support for a types-only lookup
16235         when we're called via ITypeExpression.DoResolveType().
16236         (ComposedCast): Implement the ITypeExpression interface.
16237
16238         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
16239         Expression.Resolve() with ResolveFlags.Type instead.
16240
16241 2002-08-12  Martin Baulig  <martin@gnome.org>
16242
16243         * interface.cs (Interface.Define): Apply attributes.
16244
16245         * attribute.cs (Attribute.ApplyAttributes): Added support for
16246         interface attributes.
16247
16248 2002-08-11  Martin Baulig  <martin@gnome.org>
16249
16250         * statement.cs (Block.Emit): Only check the "this" variable if we
16251         do not always throw an exception.
16252
16253         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16254         whether the property has a set accessor.
16255
16256 2002-08-11  Martin Baulig  <martin@gnome.org>
16257
16258         Added control flow analysis support for structs.
16259
16260         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16261         with control flow analysis turned off.
16262         (IVariable): New interface.
16263         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16264         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16265         (FieldExpr.DoResolve): Resolve the instance expression with flow
16266         analysis turned off and do the definite assignment check after the
16267         resolving when we know what the expression will resolve to.
16268
16269         * expression.cs (LocalVariableReference, ParameterReference):
16270         Implement the new IVariable interface, only call the flow analysis
16271         code if ec.DoFlowAnalysis is true.
16272         (This): Added constructor which takes a Block argument.  Implement
16273         the new IVariable interface.
16274         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16275         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16276         This does the definite assignment checks for struct members.
16277
16278         * class.cs (Constructor.Emit): If this is a non-static `struct'
16279         constructor which doesn't have any initializer, call
16280         Block.AddThisVariable() to tell the flow analysis code that all
16281         struct elements must be initialized before control returns from
16282         the constructor.
16283
16284         * statement.cs (MyStructInfo): New public class.
16285         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16286         argument to this indexer.  If non-zero, check an individual struct
16287         member, not the whole struct.
16288         (FlowBranching.CheckOutParameters): Check struct members.
16289         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16290         overloaded versions of these methods which take an additional
16291         `int field_idx' argument to check struct members.
16292         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16293         overloaded versions of these methods which take an additional
16294         `string field_name' argument to check struct member.s
16295         (VariableInfo): Implement the IVariable interface.
16296         (VariableInfo.StructInfo): New public property.  Returns the
16297         MyStructInfo instance of the variable if it's a struct or null.
16298         (Block.AddThisVariable): New public method.  This is called from
16299         Constructor.Emit() for non-static `struct' constructor which do
16300         not have any initializer.  It creates a special variable for the
16301         "this" instance variable which will be checked by the flow
16302         analysis code to ensure that all of the struct's fields are
16303         initialized before control returns from the constructor.
16304         (UsageVector): Added support for struct members.  If a
16305         variable/parameter is a struct with N members, we reserve a slot
16306         in the usage vector for each member.  A struct is considered fully
16307         initialized if either the struct itself (slot 0) or all its
16308         members are initialized.
16309
16310 2002-08-08  Martin Baulig  <martin@gnome.org>
16311
16312         * driver.cs (Driver.MainDriver): Only report an error CS5001
16313         if there were no compilation errors.
16314
16315         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
16316         `UnsafeContext' property to determine whether the parent is in
16317         unsafe context rather than checking the parent's ModFlags:
16318         classes nested in an unsafe class are unsafe as well.
16319
16320 2002-08-08  Martin Baulig  <martin@gnome.org>
16321
16322         * statement.cs (UsageVector.MergeChildren): Distinguish between
16323         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
16324         we return.  Added test17() and test18() to test-154.cs.
16325
16326 2002-08-08  Martin Baulig  <martin@gnome.org>
16327
16328         * typemanager.cs (TypeManager.FilterWithClosure): If we have
16329         Family access, make sure the invoking type isn't a subclass of the
16330         queried type (that'd be a CS1540).
16331
16332         * ecore.cs (Expression.MemberLookup): Added overloaded version of
16333         this method which takes an additional `Type invocation_type'.
16334
16335         * expression.cs (BaseAccess.DoResolve): Use the base type as
16336         invocation and query type.
16337         (MemberAccess.DoResolve): If the lookup failed and we're about to
16338         report a CS0122, try a lookup with the ec.ContainerType - if this
16339         succeeds, we must report a CS1540.
16340
16341 2002-08-08  Martin Baulig  <martin@gnome.org>
16342
16343         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
16344         (MethodGroupExpr): Implement the IMemberExpr interface.
16345
16346         * expression (MemberAccess.ResolveMemberAccess): No need to have
16347         any special code for MethodGroupExprs anymore, they're now
16348         IMemberExprs.   
16349
16350 2002-08-08  Martin Baulig  <martin@gnome.org>
16351
16352         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
16353         Family, FamANDAssem and FamORAssem permissions.
16354         (TypeManager.IsSubclassOrNestedChildOf): New public method.
16355
16356 2002-08-08  Martin Baulig  <martin@gnome.org>
16357
16358         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
16359         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
16360         or loop block.
16361
16362 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
16363
16364         * driver.cs: implemented /resource option to embed managed resources.
16365
16366 2002-08-07  Martin Baulig  <martin@gnome.org>
16367
16368         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
16369         (FieldBase.HasFieldInitializer): New public property.
16370         (FieldBase.GetInitializerExpression): New public method.  Resolves and
16371         returns the field initializer and makes sure it is only resolved once.
16372         (TypeContainer.EmitFieldInitializers): Call
16373         FieldBase.GetInitializerExpression to get the initializer, this ensures
16374         that it isn't resolved multiple times.
16375
16376         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
16377         the resolving process (SimpleName/MemberLookup) that we're currently
16378         emitting a field initializer (which must not access any instance members,
16379         this is an error CS0236).
16380
16381         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
16382         argument, if the `IsFieldInitializer' flag is set, we must report and
16383         error CS0236 and not an error CS0120.   
16384
16385 2002-08-07  Martin Baulig  <martin@gnome.org>
16386
16387         * ecore.cs (IMemberExpr): New public interface.
16388         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
16389         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
16390         if the expression is an IMemberExpr.
16391
16392         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
16393         to be null, implicitly default to `this' if we're non-static in
16394         this case.  Simplified the code a lot by using the new IMemberExpr
16395         interface.  Also fixed bug #28176 here.
16396
16397 2002-08-06  Martin Baulig  <martin@gnome.org>
16398
16399         * cs-parser.jay (SimpleLookup): Removed.  We need to create
16400         ParameterReferences during semantic analysis so that we can do a
16401         type-only search when resolving Cast, TypeOf and SizeOf.
16402         (block): Pass the `current_local_parameters' to the Block's
16403         constructor.
16404
16405         * class.cs (ConstructorInitializer): Added `Parameters parameters'
16406         argument to the constructor.
16407         (ConstructorInitializer.Resolve): Create a temporary implicit
16408         block with the parameters.
16409
16410         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
16411         references here if we aren't doing a type-only search.
16412
16413         * statement.cs (Block): Added constructor which takes a
16414         `Parameters parameters' argument.
16415         (Block.Parameters): New public property.
16416
16417         * support.cs (InternalParameters.Parameters): Renamed `parameters'
16418         to `Parameters' and made it public readonly.
16419
16420 2002-08-06  Martin Baulig  <martin@gnome.org>
16421
16422         * ecore.cs (Expression.Warning): Made this public as well.
16423
16424         * report.cs (Report.Debug): Print the contents of collections.
16425
16426 2002-08-06  Martin Baulig  <martin@gnome.org>
16427
16428         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
16429         used to tell Resolve() which kinds of expressions it may return.
16430         (Expression.Resolve): Added overloaded version of this method which
16431         takes a `ResolveFlags flags' argument.  This can be used to tell
16432         Resolve() which kinds of expressions it may return.  Reports a
16433         CS0118 on error.
16434         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
16435         ResolveFlags.SimpleName.
16436         (Expression.Error118): Added overloaded version of this method which
16437         takes a `ResolveFlags flags' argument.  It uses the flags to determine
16438         which kinds of expressions are allowed.
16439
16440         * expression.cs (Argument.ResolveMethodGroup): New public method.
16441         Resolves an argument, but allows a MethodGroup to be returned.
16442         This is used when invoking a delegate.
16443
16444         * TODO: Updated a bit.
16445
16446 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16447
16448         Fixed compilation with csc.
16449
16450         * ecore.cs: Expression.Error made public. Is this correct? Should
16451         Warning be made public too?
16452
16453         * expression.cs: use ea.Location instead of ea.loc.
16454         [FIXME:  Filed as bug #28607: MCS must report these errors.]
16455
16456 2002-08-06  Martin Baulig  <martin@gnome.org>
16457
16458         * ecore.cs (Expression.loc): Moved the location here instead of
16459         duplicating it in all derived classes.
16460         (Expression.Location): New public property.
16461         (Expression.Error, Expression.Warning): Made them non-static and
16462         removed the location argument.
16463         (Expression.Warning): Added overloaded version which takes an
16464         `int level' argument.
16465         (Expression.Error118): Make this non-static and removed the
16466         expression and location arguments.
16467         (TypeExpr): Added location argument to the constructor.
16468
16469         * expression.cs (StaticCallExpr): Added location argument to
16470         the constructor.
16471         (Indirection, PointerArithmetic): Likewise.
16472         (CheckedExpr, UnCheckedExpr): Likewise.
16473         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
16474         (StringPtr): Likewise.
16475
16476
16477 2002-08-05  Martin Baulig  <martin@gnome.org>
16478
16479         * expression.cs (BaseAccess.DoResolve): Actually report errors.
16480
16481         * assign.cs (Assign.DoResolve): Check whether the source
16482         expression is a value or variable.
16483
16484         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
16485         while resolving the corresponding blocks.
16486
16487         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
16488         an error, don't silently return null.
16489
16490         * statement.cs (Block.AddVariable): Do the error reporting here
16491         and distinguish between CS0128 and CS0136.
16492         (Block.DoResolve): Report all unused labels (warning CS0164).
16493         (LabeledStatement): Pass the location to the constructor.
16494         (LabeledStatement.HasBeenReferenced): New property.
16495         (LabeledStatement.Resolve): Set it to true here.
16496
16497         * statement.cs (Return.Emit): Return success even after reporting
16498         a type mismatch error (CS0126 or CS0127), this is what csc does and
16499         it avoids confusing the users with any consecutive errors.
16500
16501 2002-08-05  Martin Baulig  <martin@gnome.org>
16502
16503         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
16504
16505         * const.cs (Const.LookupConstantValue): Catch circular definitions.
16506
16507         * expression.cs (MemberAccess.DoResolve): Silently return if an
16508         error has already been reported.
16509
16510         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
16511         error has already been reported.
16512
16513 2002-08-05  Martin Baulig  <martin@gnome.org>
16514
16515         * statement.cs (UsageVector): Only initialize the `parameters'
16516         vector if we actually have any "out" parameters.
16517
16518 2002-08-05  Martin Baulig  <martin@gnome.org>
16519
16520         * expression.cs (Binary.ResolveOperator): When combining delegates,
16521         they must have the same type.
16522
16523 2002-08-05  Martin Baulig  <martin@gnome.org>
16524
16525         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
16526         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
16527         work with the ms runtime and we also don't need it: if we're a
16528         PropertyBuilder and not in the `indexer_arguments' hash, then we
16529         are a property and not an indexer.
16530
16531         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
16532         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
16533         since the latter one doesn't work with the ms runtime.
16534
16535 2002-08-03  Martin Baulig  <martin@gnome.org>
16536
16537         Fixed bugs #27998 and #22735.
16538
16539         * class.cs (Method.IsOperator): New public field.
16540         (Method.CheckBase): Report CS0111 if there's already a method
16541         with the same parameters in the current class.  Report CS0508 when
16542         attempting to change the return type of an inherited method.
16543         (MethodData.Emit): Report CS0179 if a method doesn't have a body
16544         and it's not marked abstract or extern.
16545         (PropertyBase): New abstract base class for Property and Indexer.
16546         (PropertyBase.CheckBase): Moved here from Property and made it work
16547         for indexers.
16548         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
16549         the same so we can reuse it there.
16550         (Property, Indexer): Derive from PropertyBase.
16551         (MethodSignature.inheritable_property_signature_filter): New delegate
16552         to find properties and indexers.
16553
16554         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
16555         argument and improved error reporting.
16556
16557         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
16558         EmptyReadOnlyParameters and made it a property.
16559
16560         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
16561         version of this method which takes a `PropertyInfo indexer'.
16562         (TypeManager.RegisterIndexer): New method.
16563
16564         * class.cs: Added myself as author of this file :-)
16565
16566 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16567
16568         * class.cs: fixed compilation on windoze.
16569
16570 2002-08-03  Martin Baulig  <martin@gnome.org>
16571
16572         * interface.cs (Interface.GetInterfaceBases): Check whether all
16573         base interfaces are at least as accessible than the current one.
16574
16575         * class.cs (TypeContainer.GetClassBases): Check whether base types
16576         are at least as accessible than the current type.
16577         (TypeContainer.AsAccessible): Implemented and made non-static.
16578         (MemberBase.CheckParameters): Report errors if the accessibility
16579         checks fail.
16580
16581         * delegate.cs (Delegate.Delegate): The default visibility is
16582         internal for top-level types and private for nested types.
16583         (Delegate.Define): Report errors if the accessibility checks fail.
16584
16585         * enum.cs (Enum.Enum): The default visibility is internal for
16586         top-level types and private for nested types.
16587         (Enum.DefineType): Compute the correct visibility.
16588
16589         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
16590         function which takes a `bool is_toplevel' instead of a TypeContainer.
16591
16592         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
16593         builtin type.
16594
16595 2002-08-02  Martin Baulig  <martin@gnome.org>
16596
16597         * expression.cs (LocalVariableReferenc): Added constructor which
16598         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
16599         (LocalVariableReference.IsReadOnly): New property.
16600         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
16601         variable is readonly, use our own readonly flag to do this; you can
16602         use the new constructor to get a writable reference to a read-only
16603         variable.
16604
16605         * cs-parser.jay (foreach_statement, using_statement): Get a writable
16606         reference to the local variable.
16607
16608 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
16609
16610         * rootcontext.cs (ResolveCore): Also include System.Exception
16611
16612         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
16613         we reach an EmptyStatement.
16614
16615         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
16616         is also fine.
16617
16618         * expression.cs (Binary.ResolveOperator): Check error result in
16619         two places.
16620
16621         use brtrue/brfalse directly and avoid compares to null.
16622
16623 2002-08-02  Martin Baulig  <martin@gnome.org>
16624
16625         * class.cs (TypeContainer.Define): Define all nested interfaces here.
16626         Fixes bug #28407, added test-155.cs.
16627
16628 2002-08-01  Martin Baulig  <martin@gnome.org>
16629
16630         * class.cs (Event.EmitDefaultMethod): Make this work with static
16631         events.  Fixes #28311, added verify-3.cs.
16632
16633 2002-08-01  Martin Baulig  <martin@gnome.org>
16634
16635         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
16636         `is_disposable' fields.
16637         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
16638         `hm.is_disposable' if we're using the collection pattern.
16639         (Foreach.EmitCollectionForeach): Use the correct type for the
16640         enumerator's local variable, only emit the try/finally block if
16641         necessary (fixes #27713).
16642
16643 2002-08-01  Martin Baulig  <martin@gnome.org>
16644
16645         * ecore.cs (Expression.report118): Renamed to Error118 and made
16646         it public static.
16647
16648         * statement.cs (Throw.Resolve): Check whether the expression is of
16649         the correct type (CS0118) and whether the type derives from
16650         System.Exception (CS0155).
16651         (Catch.Resolve): New method.  Do the type lookup here and check
16652         whether it derives from System.Exception (CS0155).
16653         (Catch.CatchType, Catch.IsGeneral): New public properties.
16654
16655         * typemanager.cs (TypeManager.exception_type): Added.
16656
16657 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
16658
16659         * driver.cs: Updated About function.
16660
16661 2002-07-31  Martin Baulig  <martin@gnome.org>
16662
16663         Implemented Control Flow Analysis.
16664
16665         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
16666         (EmitContext.CurrentBranching): Added.
16667         (EmitContext.StartFlowBranching): Added.
16668         (EmitContext.EndFlowBranching): Added.
16669         (EmitContext.KillFlowBranching): Added.
16670         (EmitContext.IsVariableAssigned): Added.
16671         (EmitContext.SetVariableAssigned): Added.
16672         (EmitContext.IsParameterAssigned): Added.
16673         (EmitContext.SetParameterAssigned): Added.
16674         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
16675         Added control flow analysis stuff here.
16676
16677         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
16678         resolve the expression as lvalue.
16679         (LocalVariableReference.DoResolve): Check whether the variable has
16680         already been assigned.
16681         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
16682         the parameter as assigned here.
16683         (ParameterReference.DoResolve): Check whether the parameter has already
16684         been assigned.
16685         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
16686         expression as lvalue.
16687
16688         * statement.cs (FlowBranching): New class for the flow analysis code.
16689         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
16690         (LabeledStatement.IsDefined): New public property.
16691         (LabeledStatement.AddUsageVector): New public method to tell flow
16692         analyis that the label may be reached via a forward jump.
16693         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
16694         flow analysis.
16695         (VariableInfo.Number): New public field.  This is used by flow analysis
16696         to number all locals of a block.
16697         (Block.CountVariables): New public property.  This is the number of
16698         local variables in this block (including the locals from all parent
16699         blocks).
16700         (Block.EmitMeta): Number all the variables.
16701
16702         * statement.cs: Added flow analysis support to all classes.
16703
16704 2002-07-31  Martin Baulig  <martin@gnome.org>
16705
16706         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
16707         To get debugging messages, compile mcs with /define:MCS_DEBUG and
16708         then use this argument.
16709
16710         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
16711
16712         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
16713         use this to specify /define options.
16714
16715 2002-07-29  Martin Baulig  <martin@gnome.org>
16716
16717         * statement.cs (Fixed): Moved all code that does variable lookups
16718         and resolvings from Emit to Resolve.
16719
16720         * statement.cs (For): Moved all code that does variable lookups
16721         and resolvings from Emit to Resolve.
16722
16723         * statement.cs (Using): Moved all code that does variable lookups
16724         and resolvings from Emit to Resolve.
16725
16726 2002-07-29  Martin Baulig  <martin@gnome.org>
16727
16728         * attribute.cs (Attribute.Resolve): Explicitly catch a
16729         System.NullReferenceException when creating the
16730         CustromAttributeBuilder and report a different warning message.
16731
16732 2002-07-29  Martin Baulig  <martin@gnome.org>
16733
16734         * support.cs (ParameterData.ParameterName): Added method to
16735         get the name of a parameter.
16736
16737         * typemanager.cs (TypeManager.IsValueType): New public method.
16738
16739 2002-07-29  Martin Baulig  <martin@gnome.org>
16740
16741         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
16742         is a flag which specifies that it's either ref or out.
16743         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
16744         the out parameter to `out Parameter.Modifier mod', also set the
16745         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
16746
16747         * support.cs (InternalParameters.ParameterModifier): Distinguish
16748         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16749         Parameter.Modifier.ISBYREF flag if it's either ref or out.
16750
16751         * expression.cs (Argument.GetParameterModifier): Distinguish
16752         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16753         Parameter.Modifier.ISBYREF flag if it's either ref or out.
16754
16755 2002-07-29  Martin Baulig  <martin@gnome.org>
16756
16757         * expression.cs (ParameterReference.ParameterReference): Added
16758         `Location loc' argument to the constructor.
16759
16760         * cs-parser.jay: Pass location to ParameterReference.
16761
16762 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
16763
16764         * statement.cs (Try): Initialize the location.
16765
16766         * cs-parser.jay: pass location to Try.
16767
16768         * expression.cs (Unary.Reduce): Change the prototype to return
16769         whether a constant fold could be performed or not.  The result is
16770         returned in an out parameters.  In the case of Indirection and
16771         AddressOf, we want to perform the full tests.
16772
16773 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
16774
16775         * statement.cs (Statement.Emit): Flag dead code.
16776
16777 2002-07-27  Andrew Birkett  <andy@nobugs.org>
16778
16779         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
16780
16781 2002-07-27  Martin Baulig  <martin@gnome.org>
16782
16783         * class.cs (MethodData.Define): Put back call to
16784         TypeManager.AddMethod(), accidentally commented this out.
16785
16786         * report.cs (Debug): New public method to print debugging information,
16787         this is `[Conditional ("DEBUG")]'.
16788
16789 2002-07-26  Martin Baulig  <martin@gnome.org>
16790
16791         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
16792         (switch_statement): Push the current_block to the switch_stack and
16793         pop it again when we're done with the switch.
16794         (switch_section): The new block is a child of the current_block.
16795         Fixes bug #24007, added test-152.cs.
16796
16797 2002-07-27  Martin Baulig  <martin@gnome.org>
16798
16799         * expression.cs (Invocation.EmitArguments): When calling a varargs
16800         function with only its fixed arguments, we need to pass an empty
16801         array.
16802
16803 2002-07-27  Martin Baulig  <martin@gnome.org>
16804
16805         Mono 0.13 has been released.
16806
16807 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
16808
16809         * driver.cs: Rename --resource to --linkres, because that is what
16810         we do currently, we dont support --resource yet.
16811
16812         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
16813
16814 2002-07-25  Martin Baulig  <martin@gnome.org>
16815
16816         * class.cs (MethodData): New public class.  This is a `method builder'
16817         class for a method or one accessor of a Property/Indexer/Event.
16818         (MethodData.GetMethodFlags): Moved here from MemberBase.
16819         (MethodData.ApplyAttributes): Likewise.
16820         (MethodData.ApplyObsoleteAttribute): Likewise.
16821         (MethodData.ApplyConditionalAttribute): Likewise.
16822         (MethodData.ApplyDllImportAttribute): Likewise.
16823         (MethodData.CheckAbstractAndExternal): Likewise.
16824         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
16825         (MethodData.Emit): Formerly known as Method.Emit().
16826         (MemberBase): Moved everything which was specific to a single
16827         accessor/method to MethodData.
16828         (Method): Create a new MethodData and call Define() and Emit() on it.
16829         (Property, Indexer, Event): Create a new MethodData objects for each
16830         accessor and call Define() and Emit() on them.
16831
16832 2002-07-25  Martin Baulig  <martin@gnome.org>
16833
16834         Made MethodCore derive from MemberBase to reuse the code from there.
16835         MemberBase now also checks for attributes.
16836
16837         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
16838         (MemberBase.GetMethodFlags): Moved here from class Method and marked
16839         as virtual.
16840         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
16841         `CallingConventions cc' and `Attributes opt_attrs' arguments.
16842         (MemberBase.ApplyAttributes): New virtual method; applies the
16843         attributes to a method or accessor.
16844         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
16845         (MemberBase.ApplyConditionalAttribute): Likewise.
16846         (MemberBase.ApplyDllImportAttribute): Likewise.
16847         (MemberBase.CheckAbstractAndExternal): Likewise.
16848         (MethodCore.ParameterTypes): This is now a property instead of a
16849         method, it's initialized from DoDefineParameters().
16850         (MethodCore.ParameterInfo): Removed the set accessor.
16851         (MethodCore.DoDefineParameters): New protected virtual method to
16852         initialize ParameterTypes and ParameterInfo.
16853         (Method.GetReturnType): We can now simply return the MemberType.
16854         (Method.GetMethodFlags): Override the MemberBase version and add
16855         the conditional flags.
16856         (Method.CheckBase): Moved some code from Define() here, call
16857         DoDefineParameters() here.
16858         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
16859         here to avoid some larger code duplication.
16860         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
16861         ensure that abstract and external accessors don't declare a body.
16862
16863         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
16864         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
16865         lookup in the attribute's parent classes, so we need to abort as soon
16866         as we found the first match.
16867         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
16868         the attribute has no arguments.
16869
16870         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
16871         of a Method.
16872
16873 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16874
16875         * cs-parser.jay: reverted previous patch.
16876
16877 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16878
16879         * cs-parser.jay: fixed bug #22119.
16880
16881 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16882
16883         * attribute.cs: fixed compilation. The error was:
16884         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
16885         be assigned to before control leaves the current method."
16886         [FIXME:  Filed as bug #28186: MCS must report this error.]
16887
16888 2002-07-25  Martin Baulig  <martin@gnome.org>
16889
16890         * attribute.cs (Attribute.Conditional_GetConditionName): New static
16891         method to pull the condition name ouf of a Conditional attribute.
16892         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
16893         the obsolete message and error flag out of an Obsolete attribute.
16894
16895         * class.cs (Method.GetMethodFlags): New public method to get the
16896         TypeManager.MethodFlags for this method.
16897         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
16898         private methods.
16899         (Method.Define): Get and apply the Obsolete and Conditional attributes;
16900         if we're overriding a virtual function, set the new private variable
16901         `parent_method'; call the new TypeManager.AddMethod().
16902
16903         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
16904         the MethodBuilder and the Method in a PtrHashtable.
16905         (TypeManager.builder_to_method): Added for this purpose.
16906         (TypeManager.MethodFlags): Added IsObsoleteError.
16907         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
16908         Obsolete and Conditional arguments in MethodBuilders.  If we discover
16909         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
16910         the message from the attribute.
16911
16912 2002-07-24  Martin Baulig  <martin@gnome.org>
16913
16914         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
16915         preprocessor directives, ensure that the argument to #define/#undef is
16916         exactly one identifier and that it's actually an identifier.
16917
16918         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
16919         did not work ....
16920
16921 2002-07-24  Martin Baulig  <martin@gnome.org>
16922
16923         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
16924         initialize it to TypeManager.object_type in the constructor.
16925         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
16926         of the `hm.get_current' method if we're using the collection pattern.
16927         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
16928         for the explicit conversion to make it work when we're using the collection
16929         pattern and the `Current' property has a different return type than `object'.
16930         Fixes #27713.
16931
16932 2002-07-24  Martin Baulig  <martin@gnome.org>
16933
16934         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
16935         does not match, but don't report any errors.  This method is called in
16936         order for all methods in a MethodGroupExpr until a matching method is
16937         found, so we don't want to bail out if the first method doesn't match.
16938         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
16939         matches, report the 123.  Fixes #28070.
16940
16941 2002-07-24  Martin Baulig  <martin@gnome.org>
16942
16943         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
16944         TypeManager.TypeToCoreType() to the top of the method so the
16945         following equality checks will work.  Fixes #28107.
16946
16947 2002-07-24  Martin Baulig  <martin@gnome.org>
16948
16949         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
16950         operand is of type uint, and the other operand is of type sbyte,
16951         short or int, the operands are converted to type long." -
16952         Actually do what this comment already told us.  Fixes bug #28106,
16953         added test-150.cs.
16954
16955 2002-07-24  Martin Baulig  <martin@gnome.org>
16956
16957         * class.cs (MethodBase): New abstract class.  This is now a base
16958         class for Property, Indexer and Event to avoid some code duplication
16959         in their Define() and DefineMethods() methods.
16960         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
16961         generic methods for Define() and DefineMethods().
16962         (FieldBase): Derive from MemberBase, not MemberCore.
16963         (Property): Derive from MemberBase, not MemberCore.
16964         (Property.DefineMethod): Moved all the code from this method to the
16965         new MethodBase.DefineAccessor(), just call it with appropriate
16966         argumetnts.
16967         (Property.Define): Call the new Property.DoDefine(), this does some
16968         sanity checks and we don't need to duplicate the code everywhere.
16969         (Event): Derive from MemberBase, not MemberCore.
16970         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
16971         accessors, this will also make them work with interface events.
16972         (Indexer): Derive from MemberBase, not MemberCore.
16973         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
16974         (Indexer.Define): Use the new MethodBase functions.
16975
16976         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
16977         argument to the constructor.
16978         (Interface.FindMembers): Added support for interface events.
16979         (Interface.PopluateEvent): Implemented.
16980
16981         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
16982
16983 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
16984
16985         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
16986         but this is required to check for a method name being the same as
16987         the containing class.  
16988
16989         Handle this now.
16990
16991 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16992
16993         * interface.cs: initialize variable.
16994
16995 2002-07-23  Martin Baulig  <martin@gnome.org>
16996
16997         Implemented the IndexerName attribute in interfaces.
16998
16999         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17000         name if this is an explicit interface implementation.
17001         (Indexer.InterfaceIndexerName): New public variable.  If we're
17002         implementing an interface indexer, this is the IndexerName in that
17003         interface.  Otherwise, it's the IndexerName.
17004         (Indexer.DefineMethod): If we're implementing interface indexer,
17005         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
17006         and Pending.ImplementIndexer methods.
17007         (Indexer.Define): Also define the PropertyBuilder if we're
17008         implementing an interface indexer and this is neither an explicit
17009         interface implementation nor do the IndexerName match the one in
17010         the interface.
17011
17012         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17013         If a method is defined here, then we always need to create a proxy
17014         for it.  This is used when implementing interface indexers.
17015         (Pending.IsInterfaceIndexer): New public method.
17016         (Pending.ImplementIndexer): New public method.
17017         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17018         This is used when implementing interface indexers to define a proxy
17019         if necessary.
17020         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17021         define a proxy if necessary.
17022
17023         * interface.cs (Interface.IndexerName): New public variable.
17024         (Interface.PopulateIndexer): Set the IndexerName.
17025         (Interface.DefineIndexers): New private method.  Populate all the
17026         indexers and make sure their IndexerNames match.
17027
17028         * typemanager.cs (IndexerPropertyName): Added support for interface
17029         indexers.
17030
17031 2002-07-22  Martin Baulig  <martin@gnome.org>
17032
17033         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17034         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17035         ret if HasReturnLabel.
17036         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17037         variables.
17038
17039         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17040         and set the ec.LoopBeginTryCatchLevel.
17041         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17042         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17043         the current ec.TryCatchLevel, the branch goes out of an exception
17044         block.  In this case, we need to use Leave and not Br.
17045
17046 2002-07-22  Martin Baulig  <martin@gnome.org>
17047
17048         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17049         block unless the block does not always return or it is contained in
17050         another try { ... } catch { ... } block.  Fixes bug #26506.
17051         Added verify-1.cs to the test suite.
17052
17053 2002-07-22  Martin Baulig  <martin@gnome.org>
17054
17055         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17056         then we do not always return.  Fixes bug #24985.
17057
17058 2002-07-22  Martin Baulig  <martin@gnome.org>
17059
17060         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17061         lookup on a per-class level; ie. walk up the class hierarchy until we
17062         found at least one applicable method, then choose the best among them.
17063         Fixes bug #24463 and test-29.cs.
17064
17065 2002-07-22  Martin Baulig  <martin@gnome.org>
17066
17067         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17068         return types of the methods.  The return type is not part of the
17069         signature and we must not check it to make the `new' modifier work.
17070         Fixes bug #27999, also added test-147.cs.
17071         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
17072
17073         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
17074         on the method's return type.
17075
17076 2002-07-21  Martin Baulig  <martin@gnome.org>
17077
17078         * assign.cs: Make this work if the rightmost source is a constant and
17079         we need to do an implicit type conversion.  Also adding a few more tests
17080         to test-38.cs which should have caught this.
17081
17082         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
17083         target in the makefile for this.  The makefile.gnu is primarily intended
17084         for end-users who don't want to debug the compiler.
17085
17086 2002-07-21  Martin Baulig  <martin@gnome.org>
17087
17088         * assign.cs: Improved the Assign class so it can now handle embedded
17089         assignments (X = Y = Z = something).  As a side-effect this'll now also
17090         consume less local variables.  test-38.cs now passes with MCS, added
17091         a few new test cases to that test.
17092
17093 2002-07-20  Martin Baulig  <martin@gnome.org>
17094
17095         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17096         instructions.  Fixes bug #27977, also added test-146.cs.
17097
17098 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17099
17100         * cs-tokenizer.cs: fixed getHex ().
17101
17102 2002-07-19  Martin Baulig  <martin@gnome.org>
17103
17104         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17105         not Type.GetType() to lookup the array type.  This is needed when
17106         we're constructing an array of a user-defined type.
17107         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17108         single-dimensional arrays, but also for single-dimensial arrays of
17109         type decimal.
17110
17111 2002-07-19  Martin Baulig  <martin@gnome.org>
17112
17113         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17114         this function is called, it's not allowed to share LocalBuilders
17115         among ILGenerators.
17116
17117 2002-07-19  Martin Baulig  <martin@gnome.org>
17118
17119         * expression.cs (Argument.Resolve): Report an error 118 when trying
17120         to pass a type as argument.
17121
17122 2002-07-18  Martin Baulig  <martin@gnome.org>
17123
17124         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17125         Conv_R_Un for the signed `long' type.
17126
17127 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
17128
17129         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17130         `expr' for the temporary result, as that will fail if we do
17131         multiple resolves on the same expression.
17132
17133 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
17134
17135         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17136         ec.TypeContainer for looking up aliases. 
17137
17138         * class.cs (TypeContainer): Remove LookupAlias from here.
17139
17140         * decl.cs (DeclSpace); Move here.
17141
17142 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
17143
17144         * class.cs (FindMembers): Only call filter if the constructor
17145         bulider is not null.
17146
17147         Also handle delegates in `NestedTypes' now.  Now we will perform
17148         type lookups using the standard resolution process.  This also
17149         fixes a bug.
17150
17151         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17152         This uses Expressions (the limited kind that can be parsed by the
17153         tree) instead of strings.
17154
17155         * expression.cs (ComposedCast.ToString): Implement, used to flag
17156         errors since now we have to render expressions.
17157
17158         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
17159         FormArrayType. 
17160
17161         * ecore.cs (SimpleName.ToString): ditto.
17162
17163         * cs-parser.jay: Instead of using strings to assemble types, use
17164         Expressions to assemble the type (using SimpleName, ComposedCast,
17165         MemberAccess).  This should fix the type lookups in declarations,
17166         because we were using a different code path for this.
17167
17168         * statement.cs (Block.Resolve): Continue processing statements
17169         even when there is an error.
17170
17171 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
17172
17173         * class.cs (Event.Define): Also remove the `remove' method from
17174         the list of pending items.
17175
17176         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17177         generate more compact code. 
17178
17179 2002-07-17  Martin Baulig  <martin@gnome.org>
17180
17181         * const.cs (Const.LookupConstantValue): Add support for constant
17182         `unchecked' and `checked' expressions.
17183         Also adding test case test-140.cs for this.
17184
17185 2002-07-17  Martin Baulig  <martin@gnome.org>
17186
17187         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17188         check whether mi.ReturnType implements the IEnumerator interface; the
17189         `==' and the IsAssignableFrom() will fail in this situation.
17190
17191 2002-07-16  Ravi Pratap  <ravi@ximian.com>
17192
17193         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
17194         here too.
17195
17196 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17197
17198         * expression.cs: fixed bug #27811.
17199
17200 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
17201
17202         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17203         Molaro: when we are a ref, the value already contains a pointer
17204         value, do not take the address of it.
17205
17206 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17207         * removed mb-parser.jay and mb-tokenizer.cs
17208
17209 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17210
17211         * expression.cs: check against the building corlib void type.
17212
17213 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17214
17215         * ecore.cs: fix for valuetype static readonly fields: when 
17216         initializing them, we need their address, not the address of a copy.
17217
17218 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17219
17220         * typemanager.cs: register also enum_type in corlib.
17221
17222 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17223
17224         * class.cs: allow calling this (but not base) initializers in structs.
17225
17226 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17227
17228         * ecore.cs: make sure we compare against the building base types
17229         in GetTypeSize ().
17230
17231 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
17232
17233         * typemanager.cs: fix TypeToCoreType() to handle void and object
17234         (corlib gets no more typerefs after this change).
17235
17236 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
17237
17238         * expression.cs (ArrayCreation.EmitArrayArguments): use
17239         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17240
17241         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17242         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
17243         array indexes, the runtime actually forbids them.
17244
17245         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17246         for array arguments here.
17247
17248         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17249         instead of the default for ValueTypes.
17250
17251         (New.DoEmit): Use IsValueType instead of
17252         IsSubclassOf (value_type)
17253         (New.DoResolve): ditto.
17254         (Invocation.EmitCall): ditto.
17255
17256         * assign.cs (Assign): ditto.
17257
17258         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17259         Statements *are* currently doing part of their resolution during
17260         Emit.  
17261
17262         Expressions do always resolve during resolve, but statements are
17263         only required to propagate resolution to their children.
17264
17265 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
17266
17267         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17268
17269         (LoadAssembly): Do not add the dll if it is already specified
17270
17271         (MainDriver): Add the System directory to the link path at the end,
17272         after all the other -L arguments. 
17273
17274         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17275         wrong opcode for loading bytes and bools (ldelem.i1 instead of
17276         ldelem.u1) and using the opposite for sbytes.
17277
17278         This fixes Digger, and we can finally run it.
17279
17280         * driver.cs (UnixParseOption): Move the option parsing here.  
17281         (CSCParseOption): Implement CSC-like parsing of options.
17282
17283         We now support both modes of operation, the old Unix way, and the
17284         new CSC-like way.  This should help those who wanted to make cross
17285         platform makefiles.
17286
17287         The only thing broken is that /r:, /reference: and /lib: are not
17288         implemented, because I want to make those have the same semantics
17289         as the CSC compiler has, and kill once and for all the confussion
17290         around this.   Will be doing this tomorrow.
17291
17292         * statement.cs (Unsafe.Resolve): The state is checked during
17293         resolve, not emit, so we have to set the flags for IsUnsfe here.
17294
17295 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17296
17297         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17298         not catch the Error_ObjectRefRequired in SimpleName (as it is
17299         possible to have a class/instance variable name that later gets
17300         deambiguated), we have to check this here.      
17301
17302 2002-07-10  Ravi Pratap  <ravi@ximian.com>
17303
17304         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17305         make static and put into Expression.
17306
17307         (Event.Define): Register the private field of the event with the 
17308         TypeManager so that GetFieldFromEvent can get at it.
17309
17310         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17311         keep track of the private field associated with an event which
17312         has no accessors.
17313
17314         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
17315         private field.
17316
17317         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
17318
17319 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17320
17321         * expression.cs (Binary.EmitBranchable): this routine emits the
17322         Binary expression in a branchable context.  This basically means:
17323         we need to branch somewhere, not just get the value on the stack.
17324
17325         This works together with Statement.EmitBoolExpression.
17326
17327         * statement.cs (Statement.EmitBoolExpression): Use
17328         EmitBranchable. 
17329
17330 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
17331
17332         * statement.cs (For): Reduce the number of jumps in loops.
17333
17334         (For): Implement loop inversion for the For statement.
17335
17336         (Break): We can be breaking out of a Try/Catch controlled section
17337         (foreach might have an implicit try/catch clause), so we need to
17338         use Leave instead of Br.
17339
17340         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
17341         now).  If the instace expression supports IMemoryLocation, we use
17342         the AddressOf method from the IMemoryLocation to extract the
17343         address instead of emitting the instance.
17344
17345         This showed up with `This', as we were emitting the instance
17346         always (Emit) instead of the Address of This.  Particularly
17347         interesting when This is a value type, as we dont want the Emit
17348         effect (which was to load the object).
17349
17350 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
17351
17352         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
17353
17354         * statement.cs (Checked): Set the CheckedState during the resolve
17355         process too, as the ConvCast operations track the checked state on
17356         the resolve process, and not emit.
17357
17358         * cs-parser.jay (namespace_member_declaration): Flag that we have
17359         found a declaration when we do.  This is used to flag error 1529
17360
17361         * driver.cs: Report ok when we display the help only.
17362
17363 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
17364
17365         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
17366
17367 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
17368
17369         * cs-tokenizer.cs (define): We also have to track locally the
17370         defines.  AllDefines is just used for the Conditional Attribute,
17371         but we also need the local defines for the current source code. 
17372
17373 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
17374
17375         * statement.cs (While, For, Do): These loops can exit through a
17376         Break statement, use this information to tell whether the
17377         statement is the last piece of code.
17378
17379         (Break): Flag that we break.
17380
17381         * codegen.cs (EmitContexts): New `Breaks' state variable.
17382
17383 2002-07-03  Martin Baulig  <martin@gnome.org>
17384
17385         * class.cs (TypeContainer.MethodModifiersValid): Allow override
17386         modifiers in method declarations in structs.  Otherwise, you won't
17387         be able to override things like Object.Equals().
17388
17389 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17390
17391         * class.cs (Method, Property, Indexer): Do not allow the public
17392         modifier to be used in explicit interface implementations.
17393
17394         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
17395         override modifiers in method declarations in structs
17396
17397 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
17398
17399         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
17400         integer or real overflow, report an error
17401
17402 2002-07-02  Martin Baulig  <martin@gnome.org>
17403
17404         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
17405         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
17406         to tell the runtime about our newly created System.Object and
17407         System.ValueType types.
17408
17409 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17410
17411         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
17412         struct instead of Ldarg/Starg.
17413
17414 2002-07-02  Martin Baulig  <martin@gnome.org>
17415
17416         * expression.cs (Indirection.Indirection): Call
17417         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
17418
17419 2002-07-02  Martin Baulig  <martin@gnome.org>
17420
17421         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
17422         ValueType, call TypeManager.TypeToCoreType() on it.
17423         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
17424         the OpCodes.Newarr argument.
17425
17426 2002-07-02  Martin Baulig  <martin@gnome.org>
17427
17428         * expression.cs (Invocation.EmitCall): When compiling corlib,
17429         replace all calls to the system's System.Array type to calls to
17430         the newly created one.
17431
17432         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
17433         System.Array methods.
17434         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
17435         from the system's System.Array type which must be replaced.
17436
17437 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
17438
17439         * typemanager.cs: load unverifiable_code_ctor so we can build
17440         corlib using the correct type. Avoid using GetTypeCode() with
17441         TypeBuilders.
17442         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
17443         TypeManager.object_type to allow building corlib.
17444
17445 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
17446
17447         * ecore.cs: handle System.Enum separately in LoadFromPtr().
17448
17449 2002-07-01  Martin Baulig  <martin@gnome.org>
17450
17451         * class.cs: Make the last change actually work, we need to check
17452         whether `ifaces != null' to avoid a crash.
17453
17454 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17455
17456         * class.cs: when we build structs without fields that implement
17457         interfaces, we need to add the interfaces separately, since there is
17458         no API to both set the size and add the interfaces at type creation
17459         time.
17460
17461 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17462
17463         * expression.cs: the dimension arguments to the array constructors
17464         need to be converted if they are a long.
17465
17466 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
17467
17468         * class.cs: don't emit ldarg.0 if there is no parent constructor
17469         (fixes showstopper for corlib).
17470
17471 2002-06-29  Martin Baulig  <martin@gnome.org>
17472
17473         MCS now compiles corlib on GNU/Linux :-)
17474
17475         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
17476         ie. check for MethodImplOptions.InternalCall.
17477
17478         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
17479         and TypeManager.attribute_type are null, so we must explicitly check
17480         whether parent is not null to find out whether it's an attribute type.
17481         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
17482         and SetBuilder, not only if the property is neither abstract nor external.
17483         This is necessary to set the MethodImplOptions on the accessor methods.
17484         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
17485         SetBuilder, see Property.Emit().
17486
17487         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
17488         populate "System.Object", "System.ValueType" and "System.Attribute" since
17489         they've already been populated from BootCorlib_PopulateCoreTypes().
17490
17491 2002-06-29  Martin Baulig  <martin@gnome.org>
17492
17493         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
17494         is the NullLiteral, we also need to make sure that target_type is not
17495         an enum type.   
17496
17497 2002-06-29  Martin Baulig  <martin@gnome.org>
17498
17499         * rootcontext.cs (RootContext.ResolveCore): We must initialize
17500         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
17501         before calling BootstrapCorlib_ResolveDelegate ().
17502
17503 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17504
17505         * statement.cs: fixed build-breaker. All tests passed ok.
17506
17507 2002-06-27  Martin Baulig  <martin@gnome.org>
17508
17509         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
17510         for System.Decimal when compiling corlib.
17511
17512 2002-06-27  Martin Baulig  <martin@gnome.org>
17513
17514         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
17515         switch blocks which contain nothing but a default clause.
17516
17517 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
17518
17519        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
17520
17521 2002-06-27  Martin Baulig  <martin@gnome.org>
17522
17523         * ecore.cs (PropertyExpr.PropertyExpr): Call
17524         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
17525
17526         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
17527         is already a TypeBuilder.
17528
17529 2002-06-27  Martin Baulig  <martin@gnome.org>
17530
17531         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
17532         `target_type == TypeManager.array_type', not IsAssignableFrom() in
17533         the "from an array-type to System.Array" case.  This makes it work
17534         when compiling corlib.
17535
17536 2002-06-27  Martin Baulig  <martin@gnome.org>
17537
17538         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
17539         non-static PropertyExpr, set its InstanceExpression.  This makes
17540         the `ICollection.Count' property work in System/Array.cs.
17541
17542 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
17543
17544         * driver.cs: Made error handling more consistent.  Errors now
17545         tracked by Report class, so many methods which used to return int
17546         now return void.  Main() now prints success/failure and 
17547         errors/warnings message.
17548
17549         Renamed '--probe' compiler argument to '--expect-error'.  Removed
17550         the magic number return values (123 and 124).  Now, if the
17551         expected error occurs, the compiler exits with success (exit value
17552         0).  If the compilation completes without seeing that particular
17553         error, the compiler exits with failure (exit value 1).  The
17554         makefile in mcs/errors has been changed to handle the new behaviour.
17555
17556         * report.cs: Made 'expected error' number a property and renamed
17557         it from 'Probe' to 'ExpectedError'.
17558
17559         * genericparser.cs: Removed error handling support, since it is
17560         now all done by Report class.
17561
17562         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
17563         class, so parse() no longer returns an int.
17564
17565         * namespace.cs: Use Report.Error instead of GenericParser.error
17566
17567 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
17568
17569         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
17570         TypeContainer.AddOperator): At the front of the list put the
17571         explicit implementations, so they get resolved/defined first. 
17572
17573 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
17574
17575         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
17576         interface type is implemented by this TypeContainer.  Used during
17577         explicit interface implementation.
17578
17579         (Property.Define, Indexer.Define, Method.Define): Validate that
17580         the given interface in the explicit implementation is one of the
17581         base classes for the containing type.
17582
17583         Also if we are explicitly implementing an interface, but there is
17584         no match in the pending implementation table, report an error.
17585
17586         (Property.Define): Only define the property if we are
17587         not explicitly implementing a property from an interface.  Use the
17588         correct name also for those properties (the same CSC uses,
17589         although that is really not needed).
17590
17591         (Property.Emit): Do not emit attributes for explicitly implemented
17592         properties, as there is no TypeBuilder.
17593
17594         (Indexer.Emit): ditto.
17595
17596         Hiding then means that we do not really *implement* a pending
17597         implementation, which makes code fail.
17598
17599 2002-06-22  Martin Baulig  <martin@gnome.org>
17600
17601         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
17602         the return value of Object.GetType().  [FIXME: we need to do this whenever
17603         we get a type back from the reflection library].
17604
17605 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
17606
17607         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
17608
17609 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
17610
17611         * attribute.cs: Return null if we can not look up the type.
17612
17613         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
17614         the interface types found.
17615
17616         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
17617         interface types found.
17618
17619         * typemanager.cs (GetInterfaces): Make this routine returns alll
17620         the interfaces and work around the lame differences between
17621         System.Type and System.Reflection.Emit.TypeBuilder in the results
17622         result for GetInterfaces.
17623
17624         (ExpandInterfaces): Given an array of interface types, expand and
17625         eliminate repeated ocurrences of an interface.  This expands in
17626         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
17627         be IA, IB, IC.
17628
17629 2002-06-21  Martin Baulig  <martin@gnome.org>
17630
17631         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
17632         on System.Enum.
17633
17634 2002-06-21  Martin Baulig  <martin@gnome.org>
17635
17636         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
17637         and called with one of the core types, return the corresponding typebuilder for
17638         that type.
17639
17640         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
17641         element type.
17642
17643 2002-06-21  Martin Baulig  <martin@gnome.org>
17644
17645         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
17646         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
17647         (Expression.ConvertReferenceExplicit): Likewise.
17648
17649         * expression.cs (ElementAccess.DoResolve): Likewise.
17650         (ElementAccess.DoResolveLValue): Likewise.
17651
17652 2002-06-10  Martin Baulig  <martin@gnome.org>
17653
17654         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
17655         add the "value" parameter to the parameter list.
17656
17657         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
17658         to our caller.
17659
17660 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
17661
17662         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
17663         the argument to an int, uint, long or ulong, per the spec.  Also
17664         catch negative constants in array creation.
17665
17666 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
17667
17668         * class.cs: do not allow the same interface to appear twice in
17669         the definition list.
17670
17671 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
17672
17673         * ecore.cs: don't use ldlen with System.Array.
17674
17675 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
17676
17677         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
17678
17679 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
17680
17681         * modifiers.cs: produce correct field attributes for protected
17682         internal. Easy fix so miguel can work on ther harder stuff:-)
17683
17684 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
17685
17686         * pending.cs: New file.  Move the code from class.cs here.
17687         Support clearning the pending flag for all methods (when not doing
17688         explicit interface implementation).
17689
17690 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
17691
17692         * rootcontext.cs: added a couple more types needed to bootstrap.
17693
17694 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
17695
17696         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
17697         constructor in the type, instead of any constructor in the type
17698         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
17699         a bug in the Mono runtime when applying the params attribute). 
17700
17701 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
17702         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
17703
17704 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
17705
17706         * expression.cs (Unary.ResolveOperator): Use TypeManager
17707         to resolve the type.
17708
17709 2002-06-13  Ravi Pratap  <ravi@ximian.com>
17710
17711         * cs-parser.jay (enum_member_declaration): Pass in the attributes
17712         attached.
17713
17714         * enum.cs (AddEnumMember): Add support to store the attributes associated 
17715         with each member too.
17716
17717         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
17718         field builders too - this takes care of the enum member case.
17719
17720 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
17721
17722         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
17723         address-of operator on both value types and pointers.
17724
17725 2002-06-10  Martin Baulig  <martin@gnome.org>
17726
17727         * interface.cs (Interface.PopulateIndexer): Add the indexer's
17728         PropertyBuilder to the `property_builders' list.
17729
17730         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
17731         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
17732         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
17733         find any indexers which are inherited from an interface.
17734
17735 2002-06-09  Martin Baulig  <martin@gnome.org>
17736
17737         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
17738         the same type as the constant if necessary.  There's also a test-130.cs
17739         for this.
17740
17741         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
17742
17743         * typemanager.cs (TypeManager.ChangeType): Previously known as
17744         Enum.ChangeEnumType().
17745
17746 2002-06-09  Martin Baulig  <martin@gnome.org>
17747
17748         * expression.cs (Cast.TryReduce): Added support for consts.
17749
17750 2002-06-08  Ravi Pratap  <ravi@ximian.com>
17751
17752         * class.cs (Accessor): Hold attributes information so we can pass
17753         it along.
17754
17755         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
17756         Modify to pass in attributes attached to the methods.
17757
17758         (add_accessor_declaration, remove_accessor_declaration): Ditto.
17759
17760         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
17761         to handle the Accessor kind :-)
17762
17763         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
17764
17765 2002-06-08  Martin Baulig  <martin@gnome.org>
17766
17767         * expression.cs (Unary.TryReduceNegative): Added support for
17768         ULongConstants.
17769
17770 2002-06-08  Martin Baulig  <martin@gnome.org>
17771
17772         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
17773         name can't be found in the `defined_names' - the caller will do a
17774         MemberLookup in this case and thus find methods in System.Enum
17775         such as Enum.IsDefined().
17776
17777 2002-06-08  Martin Baulig  <martin@gnome.org>
17778
17779         * enum.cs (Enum.ChangeEnumType): This is a custom version of
17780         Convert.ChangeType() which works with TypeBuilder created types.
17781         (Enum.LookupEnumValue, Enum.Define): Use it here.
17782
17783         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
17784         `TypeBuilder.BaseType != null' check.
17785         (TypeContainer.FindMembers): Only lookup parent members if we
17786         actually have a parent.
17787         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
17788         (ConstructorInitializer.Resolve): Likewise.
17789
17790         * interface.cs (Interface.FindMembers): Added
17791         `TypeBuilder.BaseType != null' check.
17792
17793         * rootcontext.cs (RootContext.ResolveCore): Added
17794         "System.Runtime.CompilerServices.IndexerNameAttribute" to
17795         classes_second_stage.
17796
17797         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
17798         debug_type and trace_type when compiling with --nostdlib.       
17799
17800 2002-06-07  Martin Baulig  <martin@gnome.org>
17801
17802         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
17803         (AddField): Set it to true when adding a non-static field.
17804         (DefineType): Use `have_nonstatic_fields' to find out whether we
17805         have non-static fields, not `Fields != null'.
17806
17807 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
17808
17809         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
17810         dereferencing a null on the static-field code path)
17811
17812 2002-05-30  Martin Baulig  <martin@gnome.org>
17813
17814         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
17815         to take command line arguments.  Use reflection to call the new
17816         custom `Initialize' function on the symbol writer and pass it the
17817         command line arguments.
17818
17819         * driver.cs (--debug-args): New command line argument to pass command
17820         line arguments to the symbol writer.
17821
17822 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
17823
17824         * assign.cs (DoResolve): Forgot to do the implicit conversion to
17825         the target type for indexers and properties.  Thanks to Joe for
17826         catching this.
17827
17828 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
17829
17830         * typemanager.cs (MethodFlags): returns the method flags
17831         (Obsolete/ShouldIgnore) that control warning emission and whether
17832         the invocation should be made, or ignored. 
17833
17834         * expression.cs (Invocation.Emit): Remove previous hack, we should
17835         not do this on matching a base type, we should do this based on an attribute
17836
17837         Only emit calls to System.Diagnostics.Debug and
17838         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
17839         on the command line.
17840
17841         * rootcontext.cs: Global settings for tracing and debugging.
17842
17843         * cs-tokenizer.cs (define): New utility function to track
17844         defines.   Set the global settings for TRACE and DEBUG if found.
17845
17846 2002-05-25  Ravi Pratap  <ravi@ximian.com>
17847
17848         * interface.cs (Populate*): Pass in the TypeContainer as well as
17849         the DeclSpace as parameters so that we can create EmitContexts and
17850         then use that to apply attributes etc.
17851
17852         (PopulateMethod, PopulateEvent, PopulateProperty)
17853         (PopulateIndexer): Apply attributes everywhere.
17854
17855         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
17856         etc.
17857
17858         (ApplyAttributes): Update accordingly.
17859
17860         We now apply interface attributes for all members too.
17861
17862 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
17863
17864         * class.cs (Indexer.Define); Correctly check if we are explicit
17865         implementation (instead of checking the Name for a ".", we
17866         directly look up if the InterfaceType was specified).
17867
17868         Delay the creation of the PropertyBuilder.
17869
17870         Only create the PropertyBuilder if we are not an explicit
17871         interface implementation.   This means that explicit interface
17872         implementation members do not participate in regular function
17873         lookups, and hence fixes another major ambiguity problem in
17874         overload resolution (that was the visible effect).
17875
17876         (DefineMethod): Return whether we are doing an interface
17877         implementation. 
17878
17879         * typemanager.cs: Temporary hack until we get attributes in
17880         interfaces (Ravi is working on that) and we get IndexerName
17881         support in interfaces.
17882
17883         * interface.cs: Register the indexers as properties.
17884
17885         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
17886         warning, I have verified that this is a bug in the .NET runtime
17887         (JavaScript suffers of the same problem).
17888
17889         * typemanager.cs (MemberLookup): When looking up members for
17890         interfaces, the parent of an interface is the implicit
17891         System.Object (so we succeed in searches of Object methods in an
17892         interface method invocation.  Example:  IEnumerable x;  x.ToString
17893         ()) 
17894
17895 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
17896
17897         * class.cs (Event): Events should also register if they do
17898         implement the methods that an interface requires.
17899
17900         * typemanager.cs (MemberLookup); use the new GetInterfaces
17901         method. 
17902
17903         (GetInterfaces): The code used to lookup interfaces for a type is
17904         used in more than one place, factor it here. 
17905
17906         * driver.cs: Track the errors at the bottom of the file, we kept
17907         on going.
17908
17909         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
17910         instance if the method we are calling is static!
17911
17912 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
17913
17914         * attribute.cs (ApplyAttributes): Make this function filter out
17915         the IndexerName attribute (as that attribute in reality is never
17916         applied) and return the string constant for the IndexerName
17917         attribute. 
17918
17919         * class.cs (TypeContainer.Emit): Validate that all the indexers
17920         have the same IndexerName attribute, and if so, set the
17921         DefaultName attribute on the class. 
17922
17923         * typemanager.cs: The return value might contain other stuff (not
17924         only methods).  For instance, consider a method with an "Item"
17925         property and an Item method.
17926
17927         * class.cs: If there is a problem with the parameter types,
17928         return. 
17929
17930 2002-05-24  Ravi Pratap  <ravi@ximian.com>
17931
17932         * ecore.cs (ImplicitConversionExists): Wrapper function which also
17933         looks at user defined conversion after making a call to 
17934         StandardConversionExists - we need this for overload resolution.
17935
17936         * expression.cs : Update accordingly the various method calls.
17937
17938         This fixes 2 bugs filed against implicit user defined conversions 
17939
17940 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
17941
17942         * statement.cs: Track the result of the assignment.
17943
17944 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
17945
17946         * expression.cs (MemberAccess): Improved error reporting for
17947         inaccessible members.
17948
17949 2002-05-22  Martin Baulig  <martin@gnome.org>
17950
17951         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
17952         itself with debugging support.
17953
17954 2002-05-22  Martin Baulig  <martin@gnome.org>
17955
17956         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
17957         Removed, this isn't needed anymore.
17958
17959 2002-05-20  Martin Baulig  <martin@gnome.org>
17960
17961         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
17962         be underlying type for an enum.
17963
17964 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
17965
17966         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
17967         that splits out the loading of just the core types.
17968
17969         * rootcontext.cs (ResolveCore): Split the struct resolution in
17970         two, so we can load the enumeration underlying types before any
17971         enums are used.
17972
17973         * expression.cs (Is): Bandaid until we fix properly Switch (see
17974         bug #24985 for details).
17975
17976         * typemanager.cs (ImplementsInterface): The hashtable will contain
17977         a null if there are no interfaces implemented.
17978
17979 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
17980
17981         * cs-parser.jay (indexer_declarator): It is fine to have array
17982         parameters
17983
17984 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
17985
17986         * typemanager.cs: (RegisterBuilder): New function used to register
17987         TypeBuilders that implement interfaces.  Since
17988         TypeBuilder.GetInterfaces (as usual) does not work with lame
17989         Reflection.Emit. 
17990         (AddUserType): register interfaces.
17991
17992         (ImplementsInterface): Use the builder_to_ifaces hash if we are
17993         dealing with TypeBuilder.  Also, arrays are showing up as
17994         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
17995         methods can not be invoked on them!
17996
17997         * ecore.cs (ExplicitReferenceConversionExists): Made public.
17998         (ImplicitReferenceConversionExists): Split out from
17999         StandardConversionExists. 
18000
18001         * expression.cs (As): We were only implementing one of the three
18002         cases for the as operator.  We now implement them all.
18003         (Is): Implement the various other cases for Is as well.
18004
18005         * typemanager.cs (CACHE): New define used to control if we want or
18006         not the FindMembers cache.  Seems to have a negative impact on
18007         performance currently
18008
18009         (MemberLookup): Nested types have full acess to
18010         enclosing type members
18011
18012         Remove code that coped with instance/static returns for events, we
18013         now catch this in RealFindMembers.
18014
18015         (RealFindMembers): only perform static lookup if the instance
18016         lookup did not return a type or an event.  
18017
18018 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18019
18020         * assign.cs (CompoundAssign): We pass more semantic information
18021         now to Compound Assignments than we did before: now we have all
18022         the information at hand, and now we resolve the target *before* we
18023         do the expression expansion, which allows the "CacheValue" method
18024         to have the effect we intended (before, a [x] += 1 would generate
18025         two differen ArrayAccess expressions from the ElementAccess,
18026         during the resolution process).
18027
18028         (CompoundAssign.DoResolve): Resolve target and original_source here.
18029
18030 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
18031
18032         * expression.cs (ArrayAccess): dropped debugging information. 
18033
18034         * typemanager.cs: Small bug fix: I was always returning i_members,
18035         instead of one of i_members or s_members (depending on which had
18036         the content).
18037
18038         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
18039         method is invoked before any code generation takes place, and it
18040         is a mechanism to inform that the expression will be invoked more
18041         than once, and that the method should use temporary values to
18042         avoid having side effects
18043
18044         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18045
18046         * ecore.cs (Expression.CacheTemporaries): Provide empty default
18047         implementation.
18048
18049         * expression.cs (Indirection, ArrayAccess): Add support for
18050         CacheTemporaries in these two bad boys. 
18051
18052         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18053         ldobj or ldind_ref.  
18054         (StoreFromPtr): Handle stobj as well.
18055
18056         * expression.cs (UnaryMutator): Share more code.
18057
18058         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18059         down: I was not tracking the Filter function as well, which
18060         was affecting the results of the cache.
18061
18062 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
18063
18064         * attribute.cs: Remove the hack to handle the CharSet property on
18065         StructLayouts. 
18066
18067 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
18068
18069         * attribute.cs (DoResolve): More uglyness, we now only try to
18070         resolve the attribute partially, to extract the CharSet
18071         information (only if we are a StructLayout attribute).  Otherwise 
18072
18073         (GetExtraTypeInfo): Add some code to conditionally kill in the
18074         future this.   I am more and more convinced that the .NET
18075         framework has special code to handle the attribute setting on
18076         certain elements.
18077
18078         * expression.cs (IsParamsMethodApplicable): Revert my previous
18079         foreach change here, it was wrong.
18080
18081 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
18082
18083         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
18084         (pp_expr): do not abort on unknown input, just return.
18085         (eval): abort if there are pending chars.
18086
18087         * attribute.cs (Attribute.Resolve): Positional parameters are
18088         optional.  Deal with that case.
18089
18090         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
18091         the Ansi/Unicode/Auto information for the type.
18092
18093         (TypeContainer.DefineType): instantiate the EmitContext here, as
18094         we will be using it during the type definition (to resolve
18095         attributes) and during the emit phase.
18096
18097         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18098         to pull type information out of the attributes
18099
18100         (Attribute.Resolve): track the constructor builder, and allow for
18101         multiple invocations (structs and classes will use this).
18102
18103         * ecore.cs (MemberLookupFinal): new version with all the
18104         parameters customizable.
18105
18106         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18107         constructors.  Return if the result value is null (as the error
18108         would have been flagged already by MemberLookupFinal)
18109
18110         Do not allow instances of abstract classes or interfaces to be
18111         created.
18112
18113         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18114         We have to compare the assembly property here when dealing with
18115         FamANDAssem and Assembly access modifiers, because we might be
18116         creating an assembly from *modules* (that means that we are not
18117         getting TypeBuilders for types defined in other modules that are
18118         part of this assembly).
18119
18120         (Method.Emit): If the method is marked abstract and has a body,
18121         emit an error. 
18122
18123         (TypeContainer.DefineMembers): If both the defined member and the
18124         parent name match are methods, then do not emit any warnings: let
18125         the Method.Define routine take care of flagging warnings.  But if
18126         there is a mismatch (method overrides something else, or method is
18127         overriwritten by something, then emit warning).
18128
18129         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18130         set to null, this means `do not check for the return type on the
18131         signature'. 
18132
18133         (Method.Define): set the return type for the method signature to
18134         null, so that we get methods with the same name and parameters and
18135         different return types.  This is used to flag warning 114 (you are
18136         hiding a method, and you probably want to use the new/override
18137         keywords instead).
18138
18139         * typemanager.cs (MemberLookup): Implemented proper access
18140         control, closing a long standing set of bug reports.  The problem
18141         was that the Framework only has two bits: Public and NonPublic,
18142         and NonPublic includes private and protected methods, but we need
18143         to enforce the FamANDAssem, FamOrAssem and Family. 
18144
18145 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
18146
18147         * statement.cs (GotoCase): Return true: Ammounts to giving up
18148         knowledge on whether we return or not, and letting the other case
18149         be responsible for it.
18150
18151 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
18152
18153         * driver.cs: Do not load directories for each file processed, only
18154         do it if there is a pattern.
18155
18156         * ecore.cs: Report readonly assigns here as well, as we might have
18157         been resolved only by MemberAccess.
18158
18159         (SimpleName.SimpleNameResolve): Also be useful for LValue
18160         resolution.   We need this to propagate assign to local readonly variables
18161
18162         * typemanager.cs: Use a ptrhashtable for the criteria, because we
18163         do not want to reuse potential criteria memory.
18164
18165         * class.cs (MyEventBuilder): Set reflected_type;
18166
18167         * ecore.cs (Constantify): Added support for constifying bools.
18168
18169         (RootContext.LookupType): Added a cache for values looked up in
18170         the declaration space.
18171
18172         * typemanager.cs (FindMembers): Now is a front-end to
18173         RealFindMembers, and provides a two-level hashtable-based cache to
18174         the request.  
18175
18176         15% performance improvement: from 22.5 to 19.2 seconds.
18177
18178         * expression.cs (IsParamsMethodApplicable): use foreach.
18179         (Invocation.DoResolve): ditto.
18180         (New.DoResolve): ditto.
18181         (ArrayCreation.DoResolve): ditto.
18182
18183         * ecore.cs (FindMostEncompassingType): use foreach.
18184
18185         * delegate.cs (NewDelegate.DoResolve): Use foreach
18186
18187         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18188         (RemoveMethods): use foreach.
18189
18190         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18191         nested foreach statements instead of for, and also break out of
18192         the inner loop once a match is found.
18193
18194         (Invocation.OverloadResolve): Use foreach, simplify the code. 
18195
18196 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
18197
18198         * cfold.cs (BinaryFold): During an enumeration evaluation context,
18199         we actually unwrap the expression to allow for extra information
18200         to be extracted. 
18201
18202         * expression.cs: Use Shr_Un on unsigned operations. 
18203
18204 2002-05-08  Ravi Pratap  <ravi@ximian.com>
18205
18206         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
18207         applicable operators was not being considered correctly. This closes
18208         the bug Miguel reported.
18209
18210 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18211
18212         * attribute.cs: check that the type derives from System.Attribute
18213         and report the correct error in that case (moved the duplicate code to
18214         its own method, too).
18215
18216 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18217
18218         * attribute.cs: lookup attribute type name as the spec says: first the
18219         bare attribute name and then name + "Attribute" (nant compiles with
18220         mcs after this fix).
18221
18222 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
18223
18224         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
18225         Because of the way we parse things, we should try to see if a
18226         UIntConstant can fit in an integer.
18227
18228 2002-05-07  Ravi Pratap  <ravi@ximian.com>
18229
18230         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18231         when we are in an explicit context.
18232
18233         (ConvertReferenceExplicit): When converting from Iface type S to Class
18234         T make sure the rules are implemented as an OR.
18235
18236         * parameter.cs (ParameterType): Make it a property for now although the
18237         purpose really isn't anything immediate.
18238
18239         * expression.cs (Is*Applicable): Do better checking on the parameter type
18240         of a ref/out parameter. The ones from the system assemblies are already 
18241         marked with the correct type so we don't need to do any correction.
18242
18243         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
18244         the object type is standard too so include that.
18245
18246 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18247
18248         * ecore.cs (StandardConversionExists): Augment with missing code:
18249         deal with IntConstant, LongConstants and Enumerations.
18250
18251         * assign.cs: Report the error, instead of failing silently
18252
18253         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18254         typecontainer that they are declared, because the
18255         typecontainer/namespace will have the list of using clauses that
18256         need to be applied.
18257
18258         Assembly Attributes were escaping the normal registration
18259         mechanism. 
18260
18261         (EmitCode): Apply attributes within an EmitContext that represents
18262         the container they were declared on.
18263
18264         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
18265
18266 2002-05-06  Ravi Pratap  <ravi@ximian.com>
18267
18268         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18269         Revamp completely - make much cleaner as we now operate only
18270         on a set of Types.
18271
18272         (FindMostSpecificSource, FindMostSpecificTarget): New methods
18273         to implement the logic detailed in the spec more correctly.
18274
18275         (UserDefinedConversion): Update accordingly.
18276
18277 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18278
18279         * statement.cs: Return flow analysis information up.
18280
18281         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18282         and the default.
18283
18284         (token): Do not consume an extra character before calling
18285         decimal_digits.
18286
18287 2002-05-06  Piers Haken <piersh@friskit.com>
18288
18289         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18290
18291 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18292
18293         * class.cs (Constructor.Emit): Set the IsStatic flag in the
18294         EmitContext during the instance constructor initializer
18295         resolution, to stop access to instance variables.
18296
18297         This is mandated by the spec, last paragraph of the `constructor
18298         initializers' section. 
18299
18300 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
18301
18302         * cs-parser.jay, class.cs (Accessor): new class used to represent
18303         an accessor (get or set).  In the past we used `null' to represent
18304         a missing accessor.  But this is ambiguous because there was no
18305         way to tell in abstract indexers/properties if one of them was
18306         specified.
18307
18308         Now there is a way of addressing that.
18309
18310         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18311         instead of FindMembers.
18312
18313         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18314         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
18315
18316         * attribute.cs: Treat indexers and properties as the same in terms
18317         of applying attributes
18318
18319         * ecore.cs (FindMostEncompassedType): Use statically initialized
18320         EmptyExpressions()s like we do elsewhere to avoid creating useless
18321         objects (and we take this out of the tight loop).
18322
18323         (GetConversionOperators): Move the code to extract the actual
18324         operators to a separate routine to clean things up.
18325
18326 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
18327
18328         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
18329         events are always registered FieldBuilders.
18330
18331         * class.cs (FieldBase): New class shared by Fields 
18332
18333         * delegate.cs: If we are a toplevel delegate, use our full name.
18334         If we are a nested delegate, then only use our tail name.
18335
18336 2002-05-02  Ravi Pratap  <ravi@ximian.com>
18337
18338         * expression.cs (IsApplicable): Ensure that we add the "&" to
18339         ref/out types before comparing it with the type of the argument.
18340
18341         (IsParamsMethodApplicable): Ditto.
18342
18343         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
18344         silly me ;-)
18345
18346         * delegate.cs : Handle the case when we have more than one applicable
18347         method. Flag an error only when we finish checking all.
18348
18349 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
18350
18351         * expression.cs: Add support for boolean static initializers.
18352
18353 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
18354
18355         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
18356
18357         * parameter.cs (ComputeParameterTypes,
18358         ComputeAndDefineParameterTypes): Better error handling: now we
18359         clear the `types' cache if we fail during any of the type lookups.
18360         We also return the status code correctly to our caller
18361
18362         * delegate.cs: If we fail to define a delegate, abort the extra
18363         steps. 
18364
18365         * expression.cs (Binary.ResolveOperator): for
18366         operator==(object,object) and operator !=(object, object) we also
18367         have to verify that there is an implicit conversion from one to
18368         the other.
18369
18370         (ArrayAccess.DoResolve): Array Access can operate on
18371         non-variables. 
18372
18373 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
18374
18375         * assign.cs (CompoundAssign): A new class used as a "flag" that
18376         the assignment actually is happening as part of a compound
18377         assignment operator.
18378
18379         During compound assignment, a few new rules exist to enable things
18380         like:
18381
18382         byte b |= 1 + 2
18383
18384         From the spec:
18385
18386         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
18387         to the type of x) if y is implicitly convertible to the type of x,
18388         and the operator is a builtin operator and the return type of the
18389         operator is explicitly convertible to the type of x. 
18390
18391         * rootcontext.cs: Reset warning level to 2.  4 catches various
18392         "interesting" features in mcs, we must clean this up at some
18393         point, but currently am trying to kill other bugs ;-)
18394
18395         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
18396         in container classes as well.  
18397
18398         * expression.cs (Binary.ResolveOperator): Handle string case
18399         before anything else (as operator overloading does emit an error
18400         before doing anything else).
18401
18402         This code could go away when we move to a table driven model, but
18403         i could not come up with a good plan last night.
18404
18405 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
18406
18407         * typemanager.cs (CSharpName): reimplementation using regex.
18408         * class.cs: added null check for fields in Emit
18409         * rootcontext.cs: set warninglevel to 4
18410
18411 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
18412
18413         * typemanager.cs (CSharpName): reimplemented with Lupus
18414         suggestion.
18415
18416 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
18417
18418         * statement.cs (If): correclty implement Resolve, because we were
18419         not catching sem errors in there.  The same process is needed
18420         everywhere else. 
18421         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
18422
18423
18424         (Statement.Warning_DeadCodeFound): Factorize code.
18425         (While): Report dead code here too.
18426
18427         (Statement): Added Resolve virtual method to allow
18428         for resolution split from the emit code.
18429
18430 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
18431
18432         * statement.cs (EmitBoolExpression): No longer try to resolve the
18433         expression here.    
18434         (MakeBoolean): New utility function that resolve, implicitly
18435         converts to boolean and tags the expression. 
18436
18437
18438         (If, Do): Implement dead code elimination.
18439         (While): Implement loop inversion
18440
18441         (Do, While, For, If): Resolve the expression prior to calling our
18442         code generation.
18443
18444 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
18445
18446         * class.cs:
18447           - added method Report28 (warning: program has more than one entry point)
18448           - added method IsEntryPoint, implements paragraph 10.1 of the spec
18449           - modified method Method.Define, the part at the end of the method
18450
18451         * rootcontext.cs: added static public Location EntryPointLocation;
18452           
18453         * ../errors/cs0028.cs : Add test case for the above warning.              
18454
18455         * typemanager.cs:
18456           - modified method CSharpName to allow arrays of primitive type to
18457             be printed nicely (e.g. instead of System.Int32[][] it now prints
18458             int[][])
18459           - added method CSharpSignature: returns the signature of a method
18460             in string format to be used in reporting errors, warnings, etc.
18461
18462         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
18463         with String.Empty.
18464
18465 2002-04-26  Ravi Pratap  <ravi@ximian.com>
18466
18467         * delegate.cs (Define): Fix extremely silly bug where I was
18468         setting the type of the 'object' parameter of the BeginInvoke
18469         method to System.IAsyncResult instead of System.Object ;-)
18470
18471 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
18472
18473         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
18474         here. 
18475
18476         (Constructor.Emit): return if we fail to initialize the
18477         constructor.  Another door closed!  
18478
18479         * expression.cs (New.DoResolve): Improve error message (from -6 to
18480         1501).  Use DeclaredOnly lookup to find the exact constructor.
18481
18482         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
18483         loop.  This is useful.
18484
18485         * cs-parser.jay: Adjust the default parameters so that destructors
18486         have the proper signature.
18487
18488 2002-04-26  Martin Baulig  <martin@gnome.org>
18489
18490         * driver.cs (LoadAssembly): If `assembly' contains any characters
18491         which are only valid in path names and not in assembly names
18492         (currently slash, backslash and point), use Assembly.LoadFrom ()
18493         instead of Assembly.Load () on the `assembly' (before iteration
18494         over the link_paths).
18495
18496 2002-04-26  Martin Baulig  <martin@gnome.org>
18497
18498         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
18499
18500 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
18501
18502         * class.cs (Property): use the new typemanager.MemberLookup
18503
18504         (TypeContainer.MemberLookup): Implement using the
18505         TypeManager.MemberLookup now. 
18506
18507         * typemanager.cs: Make MemberLookup a function of the TypeManager,
18508         and return MemberInfos, so that these can be used without an
18509         EmitContext (what we had before).
18510
18511 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
18512
18513         * expression.cs: Fix the case where the argument to params if the
18514         type of the params.  I omitted handling this before.   Fixed
18515
18516 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
18517
18518         * driver.cs: Call BootCorlib_PopulateCoreType
18519
18520         * class.cs (Property.CheckBase): Check for properties only, not
18521         for all members. 
18522
18523         * interface.cs: Temporary hack: try/catch around the
18524         CustomAttributeBuilder, because I am getting an exception that I
18525         do not understand.
18526
18527         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
18528         types whose definitions are required to be there (attributes are
18529         defined before standard types).
18530
18531         Compute definitions as we boot the various types, as they are used
18532         immediately (value_type class will need object_type, but if we do
18533         not initialize object_type, we will pass a null, which will let
18534         the runtime pick the System.Object from the existing corlib, which
18535         is not what we want).
18536
18537 2002-04-22  Patrik Torstensson <totte@labs2.com>
18538
18539         * cs-tokenizer.cs: fixed a number of trim() issues.
18540
18541 2002-04-22  Ravi Pratap  <ravi@ximian.com>
18542
18543         * expression.cs (Argument.Type): Ensure that we return the correct
18544         type when we have out or ref parameters [in which case we 
18545         append a "&"].
18546
18547 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
18548
18549         * class.cs (Property, Indexer): Allow extern modifier in there. 
18550
18551         * typemanager.cs (InitBaseTypes): Initializes object_type and
18552         value_type, since those will be used early on during the bootstrap
18553         process to compile corlib.
18554
18555         (InitCoreTypes): Move code from here to InitBaseTypes.
18556
18557 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
18558
18559         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
18560         single-dimension arrays as using the ldlen opcode.  
18561
18562         Daniel Lewis discovered this optimization.  
18563
18564         * typemanager.cs: Add signature for System.Array::get_Length
18565
18566 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18567
18568         * statement.cs: report the error when the foreach does not apply to an
18569         array nor a collection.
18570
18571 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
18572
18573         * expression.cs: Add implicit conversions to the operator ~.
18574
18575         * constant.cs (DecimalConstant.Emit): Emit decimal value.
18576
18577         * typemanager.cs: Locate the decimal constructor.
18578
18579 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18580
18581         * attribute.cs: use the new property of TypeOf.
18582         * expression.cs: added 'get' property around typearg.
18583
18584         These changes fix a build breaker reported by NickD. Is this the
18585         correct way to fix?  If not, please, revert my changes and make it
18586         work :-).
18587
18588 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
18589
18590         * attribute.cs: Add support for typeof in attribute invocations.
18591         I am not sure that this is right though.
18592
18593 2002-04-14  Duncan Mak  <duncan@ximian.com>
18594
18595         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
18596         Binary.Operator.Division case.
18597
18598 2002-04-13  Ravi Pratap  <ravi@ximian.com>
18599
18600         * class.cs (DefineType): Ensure that we do a proper check on
18601         attribute types and also register it with the TypeManager.
18602
18603         (TypeContainer.Targets): The default for attribute types is
18604         AttributeTargets.All.
18605
18606         * attribute.cs (ApplyAttributes): Registering the attribute type
18607         is done elsewhere, not when we discover we have a Usage attribute.
18608
18609 2002-04-12  Ravi Pratap  <ravi@ximian.com>
18610
18611         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
18612         and get rid of is_delegate parameter.
18613
18614         * everywhere : update.
18615
18616 2002-04-12  Ravi Pratap  <ravi@ximian.com>
18617
18618         * cs-parser.jay (compilation_unit): Revamp completely to use
18619         some new ideas that I got from Rhys' grammar to solve the problems
18620         with assembly level attributes.
18621
18622         (outer_declaration): New grammar production.
18623
18624         (attribute_sections): Add.
18625
18626         (opt_attributes): Base on attribute_sections
18627
18628         (namespace_declaration): Allow opt_attributes to tackle the case
18629         when we have assembly level attributes - we are clever in this
18630         regard now ;-)
18631
18632         * attribute.cs (ApplyAttributes): Do not worry about assembly 
18633         attributes in the non-global context.
18634
18635         * rootcontext.cs (AddGlobalAttributes): Go back to using this
18636         instead of SetGlobalAttributes.
18637
18638         * class.cs, rootcontext.cs : Ensure we define and generate 
18639         attribute types before anything else.
18640
18641         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
18642         and flag the new error -20 for the case when the attribute type
18643         does not have valid targets specified. csc does not catch this.
18644
18645         * ../errors/errors.txt : update for error # -20
18646
18647 2002-04-11  Ravi Pratap  <ravi@ximian.com>
18648
18649         * support.cs (InternalParameters.ParameterModifier): Do some null
18650         checking and return sane values.
18651
18652         * class.cs (Method.Define): If we are a PInvoke method, ensure
18653         that we are static and extern. Report error # 601
18654
18655         * ../errors/cs0601.cs : Add test case for the above error.
18656
18657 2002-04-07  Ravi Pratap  <ravi@ximian.com>
18658
18659         * rootcontext.cs (attribute_types): We need to keep type of
18660         all attribute types separately and emit code for them first.
18661
18662         (RegisterAttribute) : Implement.
18663
18664         * class.cs (DefineType): Check if the current Type is a custom
18665         attribute type and register it accordingly.
18666
18667         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
18668         adding the first attribute twice and rename to
18669
18670         (SetGlobalAttributes): this.
18671
18672         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
18673         lookups.
18674
18675         * attribute.cs (ApplyAttributes): Take an additional argument telling us
18676         if we are processing global arguments. Hmm, I am unsure of this.
18677
18678 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18679
18680         * expression.cs: added static array of strings to avoid calling
18681         Enum.ToString () for Operator in Binary. Significant recover of
18682         performance.
18683
18684 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
18685
18686         * class.cs (FindMembers): Allow the Builders of the various
18687         members to be null.  If they are skip them.  This only happens
18688         during the PInvoke declaration.
18689
18690 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
18691
18692         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
18693         failure, so we do not keep going afterwards.
18694
18695         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
18696         wanted to pass `false' as the `is_delegate' argument.  If this is
18697         the case, why not use delegate_type == null to mean `is_delegate =
18698         false' and anything else as is_delegate = true.
18699
18700 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
18701
18702         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
18703         code for the section, not the beginning of the tests.
18704
18705 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
18706
18707         * cfold.cs: Handle operator + (Enum x, Underlying x) 
18708
18709         * expression.cs (Binary): same.  Warn about errors where we have
18710         Enum/Enum in operator + as well.
18711
18712 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
18713
18714         * statement.cs:
18715                 - added support for switch(bool)
18716                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
18717                 - add TableSwitchEmit() to handle table-based switch statements
18718
18719 2002-04-05  Ravi Pratap  <ravi@ximian.com>
18720
18721         * expression.cs (Invocation.OverloadResolve): Factor out code which
18722         does parameter compatibility checking with arguments so that we can 
18723         re-use the code even from Delegate.VerifyApplicability
18724
18725         (VerifyArgumentsCompat): Move above code here.
18726
18727         * delegate.cs (VerifyApplicability): Get rid of duplicate code
18728         and instead make a call to the above method.
18729
18730 2002-03-31  Ravi Pratap  <ravi@ximian.com>
18731
18732         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
18733         We use it to keep track of classes which are attribute types.
18734
18735 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
18736
18737         * delegate.cs (Delegate.Define): Correctly define the types in the
18738         presence of fixed and array parameters.
18739
18740         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
18741         doing FindMembers.
18742
18743         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
18744         include NonPublic after the first iteration.
18745
18746         * class.cs (Indexer.CheckBase): Only check if both parents are
18747         non-null. 
18748
18749         * cs-parser.jay (accessor_body): If empty, set to null.
18750
18751         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
18752         same code path here to resolve constants names that we did have in
18753         MemberAccess.DoResolve.  There is too much code duplicated here.
18754
18755 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
18756
18757         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
18758
18759         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
18760         to MakeUnionSet.
18761
18762         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
18763         tokens, numbers and strings.
18764
18765         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
18766         parenthesis.
18767
18768         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
18769         asyncronous parameters and the regular parameters.  
18770
18771         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
18772         specify the target directory.
18773
18774         * expression.cs: (This.DoResolve): Simplify
18775         (As.Emit): Optimize, do not generate IsInst if the expression is
18776         always of the given type.
18777
18778         (Is.DoResolve): Bug fix, we were reporting both always/never for
18779         the is expression.
18780
18781         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
18782         creating too many unnecessary arrays.
18783
18784 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
18785
18786         * class.cs (EmitFieldInitializer): Use Assign expression to assign
18787         fields instead of rolling our own initializer.   Takes care of all
18788         implicit conversions, and drops unnecessary static checks/argument.
18789
18790 2002-03-31  Dick Porter  <dick@ximian.com>
18791
18792         * driver.cs: use the GetDirectories() return values properly, and
18793         use "/" as path separator.
18794
18795 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
18796
18797         * expression.cs (Unary): Optimize - - expr into expr.
18798         (Binary): Optimize a + (-b) into a -b.
18799
18800         * codegen.cs (CodeGen): Made all methods static.
18801
18802 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
18803
18804         * rootcontext.cs: 
18805
18806         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
18807         TypeBuilder property.
18808
18809         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
18810         instead. 
18811
18812         * tree.cs: Removed the various RecordXXXX, and replaced with a
18813         single RecordDecl.  Removed all the accessor methods, and just
18814         left a single access point Type 
18815
18816         * enum.cs: Rename DefineEnum to DefineType.
18817
18818         * decl.cs: New abstract method `DefineType' used to unify the
18819         Defines for Enumerations, Interfaces, TypeContainers and
18820         Delegates.
18821
18822         (FindType): Moved LookupInterfaceOrClass here.  Moved the
18823         LookupBaseClasses method that used to live in class.cs and
18824         interface.cs here, and renamed to FindType.
18825
18826         * delegate.cs: Implement DefineType.  Take advantage of the
18827         refactored pattern for locating the parent builder without taking
18828         the parent_builder argument (which we know does not work if we are
18829         nested, and triggering a toplevel definition).
18830
18831 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18832
18833         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
18834         accessibility of a member has changed during override and report
18835         an error if so.
18836
18837         * class.cs (Method.Define, Property.Define): Only complain on
18838         overrides if the method is private, any other accessibility is
18839         fine (and since we just checked the permission is the same, we are
18840         good to go).
18841
18842         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
18843         and elif are processed always.  The other pre-processing
18844         directives are only processed if we are "taking" the path
18845
18846 2002-03-29  Martin Baulig  <martin@gnome.org>
18847
18848         * class.cs (Method.Emit): Only emit symbolic debugging info if the
18849         current location is not Null.
18850
18851         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
18852         a separate method so we can profile it.
18853
18854         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
18855         `span.Seconds' are just seconds, but no minutes or hours.
18856         (MainDriver): Profile the CodeGen.SaveSymbols calls.
18857
18858 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18859
18860         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
18861         Remove the gratuitous set of Final:
18862
18863                                 // If an interface implementation, then we can set Final.
18864                                 if (((flags & MethodAttributes.Abstract) == 0) &&
18865                                     implementing.DeclaringType.IsInterface)
18866                                         flags |= MethodAttributes.Final;
18867
18868         I do not know what I was smoking when I used that.
18869
18870
18871         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
18872         step into fixing the name resolution issues for delegates and
18873         unifying the toplevel name resolution.
18874
18875 2002-03-28  Martin Baulig  <martin@gnome.org>
18876
18877         * class.cs (Method.Emit): If we have a symbol writer, call its
18878         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
18879         tell it about the current method.
18880
18881         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
18882         writer that we're going to emit the first byte of IL code for a new
18883         statement (a new source line).
18884         (EmitContext.EmitTopBlock): If we have a symbol writer, call
18885         EmitContext.Mark() before emitting any code.
18886
18887         * location.cs (SymbolDocument): Return null when we're Null.
18888
18889         * statement.cs (Statement): Moved the `Location loc' variable here.
18890         (Statement.EmitBoolExpression): If we have a symbol writer, call
18891         ec.Mark() before emitting any code to tell it that we're at the
18892         beginning of a new statement.
18893         (StatementExpression): Added `Location' argument to the constructor.
18894         (Block): Added public readonly variable `StartLocation' and public
18895         variable `EndLocation'.  The latter is to be set using SetEndLocation().
18896         (Block): Added constructor which takes a start and end location.
18897         (Block.SetEndLocation): New method. This sets the end location.
18898         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
18899         local variables we create.
18900         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
18901         each statement and do also mark the begin and end of the block.
18902
18903         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
18904         tell it the current lexer.Location, use Location.Null for the end of the
18905         block.
18906         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
18907         current block, set its end location using SetEndLocation().
18908         (statement_expression): StatementExpression constructor now takes the
18909         lexer.Location as additional argument.
18910         (for_statement, declare_local_variables): Likewise.
18911         (declare_local_variables): When creating a new implicit block, use the
18912         new Block constructor and pass it the lexer.Location.
18913
18914 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18915
18916         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
18917         members also on the parent interfaces recursively.
18918
18919 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
18920
18921         * report.cs: Use new formats, since Gonzalo finished the missing
18922         bits. 
18923
18924         * expression.cs (Binary.ResolveOperator): added missing operator|
18925         operator& and operator^ for bool/bool.
18926
18927         * cs-parser.jay: CheckDef now takes a Location argument that is
18928         used to report errors more precisly (instead of reporting the end
18929         of a definition, we try to track something which is a lot closer
18930         to the source of the problem).
18931
18932         * cs-tokenizer.cs: Track global token use, so we can properly flag
18933         the use of #define/#undef after the first token has been seen.
18934
18935         Also, rename the reportXXXX to Error_DescriptiveName
18936
18937         * decl.cs (DeclSpace.IsTopLevel): Move property here from
18938         TypeContainer, so that Enum and Interface can use this too.
18939
18940         * class.cs (TypeContainer.LookupInterfaceOrClass,
18941         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
18942         `builder' argument.  Typically this was used to pass the parent
18943         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
18944         the definition).  
18945
18946         The problem is that a nested class could trigger the definition of
18947         a toplevel class, and the builder would be obviously wrong in that
18948         case. 
18949
18950         So we drop this argument, and we compute dynamically the
18951         TypeBuilder/ModuleBuilder (the correct information was available
18952         to us anyways from DeclSpace.Parent)
18953
18954         * interface.cs (Interface.DefineInterface): Drop builder
18955         parameter cleanup like class.cs
18956
18957         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
18958         like class.cs
18959
18960         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
18961         values. 
18962
18963         (Try.Emit): Propagate the returns value from the statement.
18964
18965         (Return.Emit): Even if we are leavning 
18966
18967         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
18968
18969         * modifiers.cs: Fix the computation of MethodAttributes flags.
18970
18971 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
18972
18973         * driver.cs: allow compilation of files that start with '/'.
18974         Add a default case when checking the argument of --target.
18975
18976 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
18977
18978         * interface.cs: Implement the same search algorithm for types in
18979         the interface code.
18980
18981         * delegate.cs: Do not allow multiple definition.
18982
18983         * Recovered ChangeLog that got accidentally amputated
18984
18985         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
18986
18987         * rootcontext.cs: Load manually enum to allow core classes to
18988         contain enumerations.
18989
18990         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
18991         Update to new static methods in TypeManager.
18992
18993         * typemanager.cs (GetMethod, GetConstructor): Use our
18994         implementation of FindMembers to find the members, since during
18995         corlib compilation, the types are TypeBuilders and GetMethod and
18996         GetConstructor do not work.
18997
18998         Make all methods in TypeManager static.
18999
19000         (InitCodeHelpers): Split the functionality from
19001         the InitCodeTypes function.
19002
19003         * driver.cs: Call InitCodeHelpers after we have populated the
19004         types. 
19005
19006         * cs-parser.jay (delegate_declaration): we did not used to compute
19007         the delegate name correctly for void delegates.
19008
19009 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
19010
19011         * rootcontext.cs (RootContext): Init the interface_resolve_order
19012         and type_container_resolve_order always.
19013
19014         (ResolveCore, BootstrapCorlib_ResolveClass,
19015         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19016         compiler when compiling with --nostdlib
19017
19018         * class.cs (TypeContainer.DefineType): Check that our parent is
19019         not null.  This test is most important when we are bootstraping
19020         the core types.
19021
19022         * codegen.cs: Split out the symbol writing code.
19023
19024 2002-03-25  Martin Baulig  <martin@gnome.org>
19025
19026         * driver.cs (-g): Made -g an alias for --debug.
19027
19028 2002-03-24  Martin Baulig  <martin@gnome.org>
19029
19030         * codegen.cs (SymbolWriter): New public variable. Returns the
19031         current symbol writer.
19032         (CodeGen): Added `bool want_debugging_support' argument to the
19033          constructor. If true, tell the ModuleBuild that we want debugging
19034         support and ask it for the ISymbolWriter.
19035         (Save): If we have a symbol writer, call it's Close() method after
19036         saving the assembly.
19037
19038         * driver.c (--debug): New command line argument to create a
19039         debugger information file.
19040
19041         * location.cs (SymbolDocument): New public property. Returns an
19042         ISymbolDocumentWriter object for the current source file or null
19043         if we don't have a symbol writer.
19044
19045 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
19046
19047         * driver.cs (LoadAssembly): Correctly return when all the paths
19048         have been tried and not before.
19049
19050         * statement.cs (Switch.Emit): return the actual coverage for this
19051         statement (returns/not-returns)
19052
19053         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19054         switch of the statement if we are the last switch section.  That
19055         kills two problems: try/catch problems (we used to emit an empty
19056         nop at the end) and switch statements where all branches would
19057         return. 
19058
19059 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
19060
19061         * driver.cs: Add default assemblies (the equivalent to the
19062         Microsoft CSC.RSP file)
19063
19064         * cs-tokenizer.cs: When updating `cols and setting it to zero,
19065         also update tokens_seen and set it to false.
19066
19067         * driver.cs: Implement --recurse for Mike.
19068
19069         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19070         correctly splitting out the paths.
19071
19072 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
19073
19074         * interface.cs (Interface.PopulateProperty): Instead of using
19075         `parent' as the declaration space for the set parameters, use
19076         `this' 
19077
19078         * support.cs (InternalParameters): InternalParameters constructor
19079         takes a DeclSpace instead of a TypeContainer.
19080
19081         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
19082         types are being initialized, load the address of it before calling
19083         the function.  
19084
19085         (New): Provide a mechanism to disable the generation of local
19086         value type temporaries when the caller will be providing us with
19087         an address to store it.
19088
19089         (ArrayCreation.EmitDynamicInitializers): Use it.
19090
19091 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
19092
19093         * expression.cs (Invocation.EmitArguments): Only probe for array
19094         property if there is more than one argument.  Sorry about that.
19095
19096         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19097         empty param arrays.
19098
19099         * class.cs (Method.LabelParameters): Fix incorrect code path that
19100         prevented the `ParamArrayAttribute' from being applied to the
19101         params attribute.
19102
19103 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
19104
19105         * support.cs (ReflectionParameters): Correctly compute whether the
19106         last argument is a params array.  Fixes the problem with
19107         string.Split ('a')
19108
19109         * typemanager.cs: Make the assemblies array always be non-null
19110         (empty, but non-null)
19111
19112         * tree.cs (RecordDecl): New function that abstracts the recording
19113         of names.  This reports error 101, and provides a pointer to the
19114         previous declaration.  Fixes a crash in the compiler.
19115
19116         * cs-parser.jay (constructor_declaration): Update to new grammar,
19117         and provide a constructor_body that can be empty.
19118
19119 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
19120
19121         * driver.cs: Add support for --resources.
19122
19123         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19124         Make all types for the various array helper methods be integer.
19125
19126         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19127         CheckState to ConvCast.
19128
19129         (ConvCast): Now it takes a `checked' state argument, to avoid
19130         depending on the emit context for the conversion, and just using
19131         the resolve time setting.
19132
19133         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19134         instead of Invocation.EmitArguments.  We do not emit the original
19135         arguments, instead we emit those which have been converted to
19136         unsigned int expressions.
19137
19138         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19139
19140         * codegen.cs: ditto.
19141
19142         * expression.cs (LocalVariableReference): Drop the use of the
19143         Store function that depended on the variable index.
19144
19145         * statement.cs (VariableInfo): Drop the `Idx' property from this
19146         class, as this is not taking into account the indexes for
19147         temporaries tat we generate during the execution, getting the
19148         indexes wrong.
19149
19150         * class.cs: First emit class initializers, then call the parent
19151         constructor. 
19152
19153         * expression.cs (Binary): Fix opcode emision.
19154         (UnaryMutator.EmitCode): Support checked code generation
19155
19156         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19157         matches for events for both the Static and Instance scans,
19158         pointing to the same element.   Fix that.
19159
19160 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
19161
19162         * rootcontext.cs (ResolveTree): Always set the
19163         interface_resolve_order, because nested interfaces will be calling
19164         into us.
19165
19166         * class.cs (GetInterfaceOrClass): Track the same resolution
19167         process used by TypeManager.LookupType.  This fixes the nested
19168         type lookups in class declarations (separate path from
19169         LookupType). 
19170
19171         (TypeContainer.DefineType): Also define nested interfaces.
19172         (TypeContainer.RegisterOrder): New public function used to
19173         register the order in which child interfaces need to be closed.
19174
19175         Nested interfaces need to be closed after their parents have been
19176         created. 
19177
19178         * interface.cs (InterfaceAttr): Put all the logic for computing
19179         the interface attribute here. 
19180
19181         (DefineInterface): Register our interface order with the
19182         RootContext or with the TypeContainer depending on the case.
19183
19184 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19185
19186         * cs-parser.jay: rework foreach statement to work with the new
19187         changes to the policy on SimpleNames.
19188
19189         * report.cs: support Stacktrace on warnings as well.
19190
19191         * makefile: drop --unsafe and /unsafe from the compile.
19192
19193 2002-03-13  Ravi Pratap  <ravi@ximian.com>
19194
19195         * ecore.cs (StandardConversionExists): Modify to take an Expression
19196         as the first parameter. Ensure we do null -> reference type conversion
19197         checking.
19198
19199         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19200         temporary Expression objects.
19201
19202 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19203
19204         * interface.cs: workaround bug in method overloading resolution
19205         (there is already a bugzilla bug for it).
19206
19207 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19208
19209         We could also solve this problem by having a separate path for
19210         performing type lookups, instead of DoResolve, we could have a
19211         ResolveType entry point, and only participating pieces of the
19212         production (simplename, deref, array) would implement this. 
19213
19214         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19215         signal SimpleName to only resolve type names and not attempt to
19216         resolve anything else.
19217
19218         * expression.cs (Cast): Set the flag.
19219
19220         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19221
19222         * class.cs: Only report 108 if there is no `new' modifier.
19223
19224         * cs-parser.jay: rework foreach statement to work with the new
19225         changes to the policy on SimpleNames.
19226         
19227         * report.cs: support Stacktrace on warnings as well.
19228
19229         * makefile: drop --unsafe and /unsafe from the compile.
19230
19231 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
19232
19233         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19234         lookups here, instead of doing that at parse time.  This means
19235         that our grammar will not introduce `LocalVariableReferences' as
19236         expressions at this point.  That solves the problem of code like
19237         this:
19238
19239         class X {
19240            static void Main ()
19241            { int X = 1;
19242             { X x = null }}}
19243
19244         This is only half the fix.  The full fix requires parameters to
19245         also be handled in this way.
19246
19247         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19248         makes the use more obvious of the DeclSpace.  The
19249         ec.TypeContainer.TypeBuilder is now only used to pull the
19250         TypeBuilder for it.
19251
19252         My theory is that I can get rid of the TypeBuilder completely from
19253         the EmitContext, and have typecasts where it is used (from
19254         DeclSpace to where it matters).  
19255
19256         The only pending problem is that the code that implements Aliases
19257         is on TypeContainer, and probably should go in DeclSpace.
19258
19259         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19260         lookups here, instead of doing that at parse time.  This means
19261         that our grammar will not introduce `LocalVariableReferences' as
19262         expressions at this point.  That solves the problem of code like
19263         this:
19264
19265         class X {
19266            static void Main ()
19267            { int X = 1;
19268             { X x = null }}}
19269
19270         This is only half the fix.  The full fix requires parameters to
19271         also be handled in this way.
19272
19273         * class.cs (Property.DefineMethod): When implementing an interface
19274         method, set newslot, when implementing an abstract method, do not
19275         set the flag (before we tried never setting it, or always setting
19276         it, which is the difference).
19277         (Indexer.DefineMethod): same.
19278         (Method.DefineMethod): same.
19279
19280         * ecore.cs: Only set the status used flag if we get back a Field.
19281
19282         * attribute.cs: Temporary hack, so Paolo can keep working.
19283
19284 2002-03-08  Ravi Pratap  <ravi@ximian.com>
19285
19286         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19287         the unmanaged type in the case we have a MarshalAs attribute.
19288
19289         (Resolve): Handle the case when we are parsing the special MarshalAs
19290         attribute [we need to store the unmanaged type to use later]
19291
19292         * typemanager.cs (marshal_as_attr_type): Built in type for the 
19293         MarshalAs Attribute.
19294
19295         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
19296         on parameters and accordingly set the marshalling info.
19297
19298 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
19299
19300         * class.cs: Optimizing slightly by removing redundant code after
19301         we switched to the `NoTypes' return value.
19302         (Property.DefineMethod): use NoTypes here too.
19303
19304         This fixes the bug I introduced in my last batch of changes.
19305
19306 2002-03-05  Ravi Pratap  <ravi@ximian.com>
19307
19308         * tree.cs (RecordEnum): Add. We now keep track of enums too.
19309
19310         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19311         Enums since those are types too. 
19312
19313         * cs-parser.jay (enum_declaration): Record enums as we parse them.
19314
19315         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
19316         thanks to a call during the lookup process.
19317
19318 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
19319
19320         * statement.cs (Foreach): Lots of work to accomodate a particular
19321         kind of foreach statement that I had not kept in mind.  It is
19322         possible to have foreachs on classes that provide a GetEnumerator
19323         method that return objects that implement the "pattern" for using
19324         a foreach, there is no need to support GetEnumerator
19325         specifically. 
19326
19327         This is needed to compile nant.
19328
19329         * decl.cs: Only report 114 if the member is not `Finalize' and if
19330         the warning level is at least 2.
19331
19332         * class.cs: Moved the compare function from Method to
19333         MethodSignature. 
19334
19335         (MethodSignature.InheritableMemberSignatureCompare): Add new
19336         filter function that is used to extract inheritable methods from a
19337         class. 
19338
19339         (Method.Define): Use the new `inheritable_method_signature_filter'
19340         delegate
19341
19342         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
19343         command. 
19344
19345 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
19346
19347         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
19348
19349         * cs-parser.jay: Add opt_semicolon to the interface declaration.
19350
19351         * expression.cs: Pass location information to
19352         ConvertImplicitStandard. 
19353
19354         * class.cs: Added debugging code to track return values from
19355         interfaces. 
19356
19357 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
19358
19359         * expression.cs (Is.DoResolve): If either side of the `is' is an
19360         interface, do not flag the warning.
19361
19362         * ecore.cs (ImplicitReferenceConversion): We need a separate test
19363         for interfaces
19364
19365         * report.cs: Allow for --fatal to be used with --probe.
19366
19367         * typemanager.cs (NoTypes): Move the definition for the empty Type
19368         array here. 
19369
19370         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
19371         properties. 
19372         (TypeContainer.DefineProxy): New function used to proxy to parent
19373         implementations when implementing interfaces.
19374         (TypeContainer.ParentImplements): used to lookup if our parent
19375         implements a public function that is required by an interface.
19376         (TypeContainer.VerifyPendingMethods): Hook this up.
19377
19378         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
19379         `modules' and `assemblies' arraylists into arrays.  We only grow
19380         these are the very early start up of the program, so this improves
19381         the speedof LookupType (nicely measured).
19382
19383         * expression.cs (MakeByteBlob): Replaced unsafe code with
19384         BitConverter, as suggested by Paolo.
19385
19386         * cfold.cs (ConstantFold.Binary): Special case: perform constant
19387         folding of string concatenation, but if either side is a string,
19388         and the other is not, then return null, and let the runtime use
19389         the concatenation on the string plus the object (using
19390         `Object.ToString'). 
19391
19392 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
19393
19394         Constant Folding has been implemented now.
19395
19396         * expression.cs (Unary.Reduce): Do not throw an exception, catch
19397         the error instead on types that are not supported in one's
19398         complement. 
19399
19400         * constant.cs (Constant and all children): New set of functions to
19401         perform implict and explicit conversions.
19402
19403         * ecore.cs (EnumConstant): Implement the new functions to perform
19404         conversion by proxying to the child expression.
19405
19406         * codegen.cs: (ConstantCheckState): Constant evaluation has its
19407         own separate setting that can not be turned off from the command
19408         line using --unchecked or --checked and is only controlled using
19409         the checked/unchecked statements and expressions.  This setting is
19410         used by the constant folder to flag errors.
19411
19412         * expression.cs (CheckedExpr, UncheckedExpr): Set the
19413         ConstantCheckState as well.   
19414
19415         During Resolve, they also have to flag the state, because the
19416         constant folder runs completely in the Resolve phase.
19417
19418         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
19419         well.
19420
19421 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
19422
19423         * cfold.cs: New file, this file contains the constant folder.
19424
19425         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
19426         argument to track whether we are using the resulting address to
19427         load or store a value and provide better error messages. 
19428
19429         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
19430         new AddressOf arguments.
19431
19432         * statement.cs (Foreach.EmitCollectionForeach): Update
19433
19434         * expression.cs (Argument.Emit): Call AddressOf with proper
19435         arguments to track usage.
19436
19437         (New.DoEmit): Call AddressOf with new arguments.
19438
19439         (Unary.Emit): Adjust AddressOf call.
19440
19441 2002-03-01  Ravi Pratap  <ravi@ximian.com>
19442
19443         * cs-parser.jay (member_access): Change the case for pre-defined types
19444         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
19445         this suggestion.
19446
19447         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
19448         a method body.
19449
19450         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
19451         essentially like methods and apply attributes like MethodImplOptions to them too.
19452
19453         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
19454         not being null.
19455
19456         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
19457         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
19458         is the DeclSpace.
19459
19460         * Update code everywhere accordingly.
19461
19462         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
19463
19464         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
19465
19466 2002-02-28  Ravi Pratap  <ravi@ximian.com>
19467
19468         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
19469         try performing lookups against those instead of jumping straight into using
19470         the 'using' clauses.
19471
19472         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
19473
19474         (LookupType): Perform lookups in implicit parents too.
19475
19476         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
19477         sequence as RootContext.LookupType. 
19478
19479         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
19480         the various cases of namespace lookups into this method.
19481
19482 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
19483
19484         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
19485         in positional arguments)
19486
19487         * class.cs (Operator): Update the AllowedModifiers to contain
19488         extern. 
19489
19490         * cs-parser.jay: Update operator declaration to allow for the
19491         operator body to be empty.
19492
19493         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
19494         values. 
19495
19496 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
19497
19498         * class.cs (Method.Emit): Label parameters.
19499
19500         * driver.cs: Return 1 or 0 as the program exit code.
19501
19502 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
19503
19504         * expression.cs: Special case the `null' object when trying to
19505         auto-compute the type, as anything can be explicitly converted to
19506         that. 
19507
19508         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
19509         spotting this Paolo.
19510
19511         (Expression.ImplicitNumericConversion): Perform comparissions of
19512         the type using the underlying type in the case of an enumeration
19513         rather than using the enumeration type for the compare.
19514
19515         Cope with the underlying == type case, which is not possible to
19516         catch before. 
19517
19518         (Expression.ConvertNumericExplicit): Perform comparissions of
19519         the type using the underlying type in the case of an enumeration
19520         rather than using the enumeration type for the compare.
19521
19522         * driver.cs: If the user does not supply an extension, assume .exe
19523
19524         * cs-parser.jay (if_statement): Rewrote so that we can track the
19525         location for the if statement.
19526
19527         * expression.cs (Binary.ConstantFold): Only concat strings when
19528         the operation is "+", not everything ;-)
19529
19530         * statement.cs (Statement.EmitBoolExpression): Take a location
19531         argument. 
19532         (If, While, Do): Track location.
19533
19534         * expression.cs (Binary.ResolveOperator): In the object + string
19535         case, I was missing a call to ConvertImplicit
19536
19537 2002-02-25  Ravi Pratap  <ravi@ximian.com>
19538
19539         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
19540         Location arguments. Ensure we use RootContext.LookupType to do our work
19541         and not try to do a direct Type.GetType and ModuleBuilder.GetType
19542
19543         * interface.cs (PopulateMethod): Handle the type of the parameter being
19544         null gracefully.
19545
19546         * expression.cs (Invocation.BetterFunction): Handle the case when we 
19547         have a params method with no fixed arguments and a call is made with no
19548         arguments.
19549
19550 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
19551
19552         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
19553         the verbatim-string-literal
19554
19555         * support.cs (InternalParameters.ParameterModifier): handle null
19556         fixed parameters.
19557         (InternalParameters.ParameterType): ditto.
19558
19559         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
19560         duplicating the name of the variable parameter.
19561         (GetParameterByName): Fix bug where we were not looking up array
19562         paramters if they were the only present (thanks Paolo!).
19563         (GetParameterInfo): We only have an empty set of types if both
19564         fixed and array are set to null.
19565         (GetParameterInfo-idx): Handle FixedParameter == null
19566
19567         * cs-parser.jay: Handle the case where there is no catch
19568         statements (missing null test).
19569
19570 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
19571
19572         * driver.cs (MainDriver): Be conservative on our command line
19573         handling.
19574
19575         Catch DirectoryNotFoundException when calling GetFiles.
19576
19577         (SplitPathAndPattern): Used to split the input specification into
19578         a path and a pattern that we can feed to Directory.GetFiles.
19579
19580 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
19581
19582         * statement.cs (Fixed): Implement the last case of the Fixed
19583         statement (string handling).
19584
19585         * expression.cs (StringPtr): New class used to return a char * to
19586         a string;  Used by the Fixed statement.
19587
19588         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
19589
19590         * expression.cs (Binary.ResolveOperator): Remove redundant
19591         MemberLookup pn parent type.
19592         Optimize union call, we do not need a union if the types are the same.
19593         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
19594         type.
19595
19596         Specialize the use of MemberLookup everywhere, instead of using
19597         the default settings. 
19598
19599         (StackAlloc): Implement stackalloc keyword.
19600
19601         * cs-parser.jay: Add rule to parse stackalloc.
19602
19603         * driver.cs: Handle /h, /help, /?
19604
19605         * expression.cs (MakeByteBlob): Removed the hacks we had in place
19606         before we supported unsafe code.
19607
19608         * makefile: add --unsafe to the self compilation of mcs.
19609
19610 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
19611
19612         * expression.cs (PointerArithmetic): New class that is used to
19613         perform pointer arithmetic.
19614         (Binary.Resolve): Handle pointer arithmetic
19615         Handle pointer comparission.
19616         (ArrayPtr): Utility expression class that is used to take the
19617         address of an array.
19618
19619         (ElementAccess): Implement array access for pointers
19620
19621         * statement.cs (Fixed): Implement fixed statement for arrays, we
19622         are missing one more case before we are done.
19623
19624         * expression.cs (Indirection): Implement EmitAssign and set the
19625         ExprClass to Variable.  This allows pointer dereferences to be
19626         treated as variables, and to have values assigned to them.
19627
19628         * ecore.cs (Expression.StoreFromPtr): New utility function to
19629         store values dereferencing.
19630
19631 2002-02-20  Ravi Pratap  <ravi@ximian.com>
19632
19633         * expression.cs (Binary.ResolveOperator): Ensure that we are
19634         not trying to operate on a void type - this fixes the reported
19635         bug.
19636
19637         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
19638         the parent implementation is sealed.
19639
19640         * ../errors/cs0239.cs : Add.
19641
19642         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
19643
19644         * typemanager.cs (unverifiable_code_type): Corresponds to 
19645         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
19646         which have unsafe code in them.
19647
19648         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
19649         unsafe context.
19650
19651 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
19652
19653         * cs-tokenizer.cs: Add support for @"litreal strings"
19654
19655         Make tokenizer accept pre-processor directives
19656         on any column (remove the old C-like limitation). 
19657
19658         * rootcontext.cs (EmitCode): Emit any global attributes.
19659         (AddGlobalAttributes): Used to keep track of assembly attributes. 
19660
19661         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
19662
19663         * cs-parser.jay: Add support for global attributes.  
19664
19665 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
19666
19667         * expression.cs (Indirection): New helper class.  Unary will
19668         create Indirection classes to be able to implement the
19669         IMemoryLocation interface on it.
19670
19671 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
19672
19673         * cs-parser.jay (fixed_statement): reference the right statement.
19674
19675         * statement.cs (Fixed.Emit): Finish implementing the fixed
19676         statement for the &x case.
19677
19678 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
19679
19680         * class.cs (Property.Define, Method.Define): Remove newslot when
19681         `implementing'.  
19682
19683         * modifiers.cs: My use of NewSlot when `Abstract' was set was
19684         wrong.  NewSlot should only be used if the `new' keyword is present.
19685
19686         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
19687         locating our system dir.  Sorry about this.
19688
19689 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
19690
19691         * driver.cs (GetSystemDir): Compute correctly the location of our
19692         system assemblies.  I was using the compiler directory instead of
19693         the library directory.
19694
19695 2002-02-13  Ravi Pratap  <ravi@ximian.com>
19696
19697         * expression.cs (BetterFunction): Put back in what Miguel commented out
19698         since it is the correct fix. The problem is elsewhere ;-)
19699
19700         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
19701         parameters of the parms method are themselves compatible or not !
19702
19703         (StandardConversionExists): Fix very dangerous bug where we were forgetting
19704         to check that a class implements an interface before saying that an implicit
19705         conversion was allowed. Use ImplementsInterface to do the checking.
19706
19707 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
19708
19709         * class.cs (Method.Define): Track whether we are an explicit
19710         implementation or not.  And only call DefineMethodOverride if we
19711         are an explicit implementation.
19712
19713         (Property.DefineMethod): Ditto.
19714
19715 2002-02-11  Ravi Pratap  <ravi@ximian.com>
19716
19717         * expression.cs (BetterFunction): Catch hideous bug which was
19718          preventing us from detecting ambiguous calls due to implicit casts i.e
19719         cs0121.
19720
19721 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
19722
19723         * support.cs (Pair): Remove un-needed method.  I figured why I was
19724         getting the error in cs-parser.jay, the variable in a foreach loop
19725         is readonly, and the compiler does not really treat this as a variable.
19726
19727         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
19728         instead of EQUALS in grammar.  
19729
19730         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
19731
19732         * expression.cs (Unary.DoResolve): Check whether the argument is
19733         managed or not.
19734
19735 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
19736
19737         * support.cs: Api for Pair to set a value.  Despite the fact that
19738         the variables are public the MS C# compiler refuses to compile
19739         code that accesses the field if the variable is part of a foreach
19740         statement. 
19741
19742         * statement.cs (Fixed): Begin implementation of the fixed
19743         statement.
19744
19745         (Block.AddVariable): Return the VariableInfo on success and null
19746         on failure instead of true/false. 
19747
19748         * cs-parser.jay (foreach): Catch errors on variables already
19749         defined (we were ignoring this value before) and properly unwind
19750         the block hierarchy
19751
19752         (fixed_statement): grammar for the fixed statement.
19753
19754 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
19755
19756         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
19757         pointer types to be incretemented.
19758
19759         (SizeOf): Implement.
19760
19761         * cs-parser.jay (pointer_member_access): Implement
19762         expr->IDENTIFIER production.
19763
19764         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
19765         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
19766         on safe contexts.
19767
19768         (Unary): Implement indirection.
19769
19770         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
19771         use in non-unsafe context).
19772
19773         (SimpleName.DoResolve): Check for pointers in field access on safe
19774         contexts. 
19775
19776         (Expression.LoadFromPtr): Factor the load-indirect code in this
19777         function.  This was duplicated in UnboxCast and ParameterReference
19778
19779 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
19780
19781         * expression.cs (ComposedCast): report an error if a pointer cast
19782         is used in a safe region.
19783
19784         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
19785         pointer type casts in unsafe context.
19786
19787         * codegen.cs (EmitContext): Set up IsUnsafe.
19788
19789         * cs-parser.jay (non_expression_type): Add productions for pointer
19790         casts. 
19791
19792         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
19793         code.  We should not use force into static mode if the method is
19794         not virtual.  Fixes bug in MIS
19795
19796         * statement.cs (Do.Emit, While.Emit, For.Emit,
19797         Statement.EmitBoolExpression): Add support to Do and While to
19798         propagate infinite loop as `I do return' semantics.
19799
19800         Improve the For case to also test for boolean constants.
19801
19802         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
19803         to the list of attributes we can add.
19804
19805         Remove `EmitContext' argument.
19806
19807         * class.cs (Method.Define): Apply parameter attributes.
19808         (Constructor.Define): Apply parameter attributes.
19809         (MethodCore.LabelParameters): Move here the core of labeling
19810         parameters. 
19811
19812         * support.cs (ReflectionParameters.ParameterModifier,
19813         InternalParameters.ParameterModifier): Use IsByRef on the type and
19814         only return the OUT bit for these parameters instead of in/out/ref
19815         flags.
19816
19817         This is because I miss-understood things.  The ParameterInfo.IsIn
19818         and IsOut represent whether the parameter has the [In] and [Out]
19819         attributes set.  
19820
19821 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
19822
19823         * ecore.cs (FieldExpr.Emit): Release temporaries.
19824
19825         * assign.cs (LocalTemporary.Release): new function.
19826
19827         * codegen.cs (EmitContext.GetTemporaryStorage,
19828         EmitContext.FreeTemporaryStorage): Rework the way we deal with
19829         temporary storage.  Now we can "put back" localbuilders when we
19830         are done with them
19831
19832 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
19833
19834         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
19835         need to make a copy of the variable to generate verifiable code.
19836
19837 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
19838
19839         * driver.cs: Compute dynamically the system directory.
19840
19841         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
19842         Slower, but more generally useful.  Used by the abstract
19843         registering implementation. 
19844
19845         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
19846         the rules for the special rule on Type/instances.  First check if
19847         we have the same name, and if so, try that special static path
19848         rather than the instance path.
19849
19850 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
19851
19852         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
19853         for, while and if.
19854
19855         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
19856         Enum, ValueType, Delegate or Array for non-corlib compiles.
19857
19858         * cs-tokenizer.cs: Catch long identifiers (645)
19859
19860         * typemanager.cs (IndexerPropetyName): Ravi never tested this
19861         piece of code.
19862
19863         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
19864         fix, we were returning too early, so we were not registering
19865         pending methods from abstract classes.
19866
19867         Do not register pending methods if the class is abstract.
19868
19869         * expression.cs (Conditional.DoResolve): Report circular implicit
19870         conversions when we neecd to compute it for conditional
19871         expressions. 
19872
19873         (Is.DoResolve): If the expression is always of the provided type,
19874         flag warning 183.  If the expression can not ever be of the
19875         provided type flag warning 184.
19876
19877         * class.cs: Catch 169 as well.
19878
19879         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
19880         read. 
19881
19882 2002-01-18  Nick Drochak  <ndrochak@gol.com>
19883
19884         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
19885
19886 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
19887
19888         * interface.cs: (PopulateMethod): Check for pointers being defined
19889         only if the unsafe context is active.
19890         (PopulateProperty): ditto.
19891         (PopulateIndexer): ditto.
19892
19893         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
19894         specified.  If pointers are present, make sure that they are
19895         present in an unsafe context.
19896         (Constructor, Constructor.Define): ditto.
19897         (Field, Field.Define): ditto.
19898         (Property, Property.Define): ditto.
19899         (Event, Event.Define): ditto.
19900
19901         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
19902         hashtable if there are classes or structs defined.
19903
19904         * expression.cs (LocalVariableReference.DoResolve): Simplify this
19905         code, as the constant resolution moved.
19906
19907         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
19908         the metadata, so we can flag error 133. 
19909
19910         * decl.cs (MemberCore.UnsafeOK): New function to test that a
19911         pointer is being declared in an unsafe context.
19912
19913 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
19914
19915         * modifiers.cs (Modifiers.Check): Require a Location argument.
19916         Report error 227 for Unsafe use.
19917
19918         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
19919
19920         * statement.cs (For.Emit): If the test is null, then report that
19921         we do `return', as we wont reach anything afterwards.
19922
19923         (Switch.SwitchGoverningType): Track the expression that matched
19924         the conversion.
19925
19926         * driver.cs: Allow negative numbers as an error code to flag.
19927
19928         * cs-parser.jay: Handle 1551.
19929
19930         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
19931
19932 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
19933
19934         * cs-parser.jay: Report 1518 (type declaration can only contain
19935         class, struct, interface, enum or delegate)
19936
19937         (switch_label): Report 1523 (keywords `case' or `default' must
19938         preced code)
19939
19940         (opt_switch_sections): Report 1522 (empty switch)
19941
19942         * driver.cs: Report 1515 (response file specified multiple times)
19943         Report 1516 (Source file specified multiple times).
19944
19945         * expression.cs (Argument.Resolve): Signal 1510
19946
19947         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
19948         access not allowed in static code)
19949
19950 2002-01-11  Ravi Pratap  <ravi@ximian.com>
19951
19952         * typemanager.cs (IsPointerType): Utility method which we are going
19953         to need a lot.
19954
19955         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
19956         the object type, so we take care of that.
19957
19958         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
19959
19960         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
19961         added to non-params parameters :-)
19962
19963         * typemanager.cs (CSharpName): Include 'void' type too. 
19964
19965         (void_ptr_type): Include in the set of core types.
19966
19967         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
19968         duplicating code.
19969
19970         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
19971         an unsafe context.
19972
19973         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
19974         completely forgotten about it.
19975
19976 2002-01-10  Ravi Pratap  <ravi@ximian.com>
19977
19978         * cs-parser.jay (pointer_type): Add. This begins our implementation
19979         of parsing rules for unsafe code.
19980
19981         (unsafe_statement): Implement.
19982
19983         (embedded_statement): Modify to include the above.
19984
19985         * statement.cs (Unsafe): Implement new class for unsafe blocks.
19986
19987         * codegen.cs (EmitContext.InUnsafe): Add. This determines
19988         if the current context is an unsafe one.
19989
19990         * cs-parser.jay (local_variable_pointer_type): Since local variable types
19991         are handled differently, we need separate rules for them.
19992
19993         (local_variable_declaration): Update to use local_variable_pointer_type
19994         to allow variable declarations of unmanaged pointer types.
19995
19996         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
19997         in unsafe contexts.
19998
19999         * ../errors/cs0214.cs : Add.
20000
20001 2002-01-16  Nick Drochak  <ndrochak@gol.com>
20002
20003         * makefile: remove 'response' file when cleaning.
20004
20005 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20006
20007         * cs-parser.jay: Report 1524.
20008
20009 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
20010
20011         * typemanager.cs (RegisterMethod): drop checking if we have
20012         registered this from here
20013
20014 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
20015
20016         * class.cs (Method.EmitDestructor): Implement calling our base
20017         destructor. 
20018
20019         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20020         value of InFinally.
20021
20022         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20023         this routine and will wrap the call in a try/catch block.  Deal
20024         with the case.
20025
20026 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
20027
20028         * ecore.cs (Expression.MemberLookup): instead of taking a
20029         parameter `same_type' that was used to tell whether we could
20030         access private members we compute our containing type from the
20031         EmitContext.
20032
20033         (FieldExpr): Added partial support for volatile fields.  This does
20034         not work for volatile fields exposed from assemblies, as I can not
20035         figure out how to extract the modreq from it.
20036
20037         Updated all the source files to use this.
20038
20039         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20040         because it is referenced by MemberLookup very often. 
20041
20042 2002-01-09  Ravi Pratap  <ravi@ximian.com>
20043
20044         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20045         TypeBuilder.GetCustomAttributes to retrieve what we need.
20046
20047         Get rid of redundant default_member_attr_type as this is the same as
20048         default_member_type which already exists.
20049
20050         * interface.cs, attribute.cs : Update accordingly.
20051
20052 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
20053
20054         * typemanager.cs: Enable IndexerPropertyName again.  It does not
20055         work for TYpeBuilders though.  Ravi, can you please fix this?
20056
20057         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20058
20059         * expression.cs (Argument.Emit): Handle the case of ref objects
20060         being passed to ref functions;  
20061
20062         (ParameterReference.EmitLoad): Loads the content of the pointer
20063         without dereferencing.
20064
20065 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20066
20067         * cs-tokenizer.cs: Implemented the pre-processing expressions.
20068
20069 2002-01-08  Ravi Pratap  <ravi@ximian.com>
20070
20071         * class.cs (Indexer.DefineMethod): Incorporate the interface
20072         type in the name of the method if we are doing explicit interface
20073         implementation.
20074
20075         * expression.cs (ConversionExists): Remove as it is completely obsolete.
20076
20077         (BetterConversion): Fix extremely trivial bug where we were referring to
20078         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
20079         again !
20080
20081         * ../errors/bug16.cs : Add although we have fixed it.
20082
20083 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20084
20085         * expression.cs (BaseIndexer): Begin implementation.
20086
20087         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
20088
20089         * cs-parser.jay (indexer_declarator): Use qualified_identifier
20090         production directly to remove a shift/reduce, and implement
20091         explicit interface implementation.
20092
20093         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
20094         after a floating point suffix.
20095
20096         * expression.cs (DoNumericPromotions): Improved the conversion for
20097         uint/uint.  If we have a constant, we avoid doing a typecast to a
20098         larger type.
20099
20100         * class.cs (Indexer): Implement explicit interface implementation
20101         for indexers.
20102
20103 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20104
20105         * class.cs: make the default instance constructor public and hidebysig.
20106
20107 2001-01-03  Ravi Pratap  <ravi@ximian.com>
20108
20109         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20110         so we can call it from elsewhere.
20111
20112         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20113         we emit it internally if the class has a defined indexer; otherwise the user
20114         emits it by decorating the class definition with the DefaultMemberAttribute.
20115
20116         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20117         attribute is not used on a type which defines an indexer.
20118
20119         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20120         character when we skip whitespace.
20121
20122         * ../errors/cs0646.cs : Add.
20123
20124 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
20125
20126         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20127         again. 
20128
20129         * makefile: Add practical target `mcs3.exe' which builds the third
20130         generation compiler. 
20131
20132         * expression.cs (New): Fix structures constructor calling.
20133
20134         * class.cs (Property, Method, Indexer): Emit Final flag on the
20135         method if we are an interface implementation and we are not
20136         abstract. 
20137
20138         * ecore.cs (PropertyExpr): New public field `IsBase', tells
20139         whether this property is referencing a `base' method.
20140
20141         * expression.cs (Invocation.EmitCall): take an extra argument:
20142         is_base, this is used to determine whether the `call' or
20143         `callvirt' opcode should be used.
20144
20145
20146         * delegate.cs: update EmitCall.
20147
20148         * class.cs (Method.Define): Set NewSlot for the cases where we are
20149         not implementing an interface method.
20150
20151         (Property.Define): ditto.
20152
20153 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
20154
20155         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20156         'r'.  Allows mcs to parse itself fully.
20157
20158 2002-01-02  Ravi Pratap  <ravi@ximian.com>
20159
20160         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20161         of the number of initializers that require the InitializeArray method.
20162
20163         (CheckIndices): Store the Expression in all cases - not the plain value. Also
20164         update the above field where necessary.
20165
20166         (MakeByteBlob): Update accordingly.
20167
20168         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
20169         greater than 2.
20170
20171         (EmitDynamicInitializers): Update in accordance with the new optimization.
20172
20173         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20174         same OpCode applies.
20175
20176         * cs-parser.jay : Fix some glaring errors I introduced.
20177
20178 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
20179
20180         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20181         so that we can check for name clashes there too.
20182
20183         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20184         for interface indexers.
20185
20186         * interfaces.cs (Define): Emit the default member attribute.
20187
20188         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20189         variable was being referred to while setting the value ;-)
20190
20191 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
20192
20193         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20194         byte-by-byte information when we know the data is zero.
20195
20196         Make the block always a multiple of 4, because
20197         DefineInitializedData has a bug.
20198
20199         * assign.cs: Fix, we should assign from the temporary, not from
20200         the source. 
20201
20202         * expression.cs (MakeByteBlob): Fix my incorrect code.
20203
20204 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
20205
20206         * typemanager.cs (EnumToUnderlying): This function is used to get
20207         the underlying type from an enumeration, because it does not
20208         always work. 
20209
20210         * constant.cs: Use the I4_S form for values between -128 and 127.
20211
20212         * statement.cs (Block.LookupLabel): Looks up a label.
20213         (Block): Drop support for labeled blocks.
20214
20215         (LabeledStatement): New kind of statement that represents a label
20216         only.
20217
20218         (Goto): Finally implement this bad boy.
20219
20220         * cs-parser.jay: Update to reflect new mechanism to implement
20221         labels.
20222
20223 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
20224
20225         * codegen.cs (EmitContext.This): a codegen property that keeps the
20226         a single instance of this instead of creating many different this
20227         instances. 
20228
20229         * delegate.cs (Delegate.DoResolve): Update to use the property;
20230
20231         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
20232
20233         * expression.cs (BaseAccess.DoResolve): Ditto.
20234
20235 2001-12-29  Ravi Pratap  <ravi@ximian.com>
20236
20237         * typemanager.cs (methodimpl_attr_type): Add to hold the type
20238         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20239
20240         (InitCoreTypes): Update accordingly.
20241
20242         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20243         so we can quickly store the state.
20244
20245         (ApplyAttributes): Set the correct implementation flags
20246         for InternalCall methods.
20247
20248 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
20249
20250         * expression.cs (EmitCall): if a method is not virtual, then do
20251         not use callvirt on it.
20252
20253         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20254         user defined stuff) requires the use of stobj, which takes an
20255         address on the stack instead of an array and an index.  So emit
20256         the Ldelema operation for it.
20257
20258         (EmitStoreOpcode): Use stobj for valuetypes.
20259
20260         (UnaryMutator.EmitCode): Use the right 1 value depending on
20261         whether we are dealing with int64/uint64, float or doubles.
20262
20263         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20264         constructors that I implemented last night.
20265
20266         (Constructor.IsDefault): Fix to work properly for static
20267         constructors.
20268
20269         * cs-parser.jay (CheckDef): report method signature errors.
20270         Update error number 103 to be 132.
20271
20272         * decl.cs: New AdditionResult enumeration value: MethodExists.
20273         Although we do this check for methods later on in the semantic
20274         analysis, catching repeated default constructors is so easy that
20275         we catch these here. 
20276
20277         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20278         promotions code.
20279
20280         (ParameterReference.EmitAssign, Emit): handle
20281         bools as bytes.
20282
20283         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20284         (ArrayAccess.EmitStoreOpcode): ditto.
20285
20286         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20287
20288         * expression.cs (MakeByteBlob): Complete all the missing types
20289         (uint, short, ushort, byte, sbyte)
20290
20291         * class.cs: Only init instance field initializers on instance
20292         constructors. 
20293
20294         Rename `constructors' to instance_constructors. 
20295
20296         (TypeContainer.AddConstructor): Only add constructors to the list
20297         if it is not static.
20298
20299         Make sure that we handle default_static_constructor independently
20300         everywhere where we handle instance_constructors
20301
20302 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
20303
20304         * class.cs: Do not lookup or create a base initializer for a
20305         static constructor.
20306
20307         (ConstructorInitializer.Resolve): use the proper type to lookup
20308         for constructors.
20309
20310         * cs-parser.jay: Report error 1585 (modifiers between type and name).
20311
20312         * enum.cs, interface.cs: Remove CloseType, this is taken care by
20313         in DeclSpace. 
20314
20315         * decl.cs: CloseType is now an virtual method, the default
20316         implementation just closes this type.
20317
20318 2001-12-28  Ravi Pratap  <ravi@ximian.com>
20319
20320         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
20321         to PreserveSig by default. Also emit HideBySig on such methods.
20322
20323         Basically, set the defaults to standard values.
20324
20325         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
20326         argument, if candidate is better, it can't be worse than the best !
20327
20328         (Invocation): Re-write bits to differentiate between methods being
20329         applicable in their expanded form and their normal form - for params
20330         methods of course.
20331
20332         Get rid of use_standard everywhere as only standard conversions are allowed
20333         in overload resolution. 
20334
20335         More spec conformance.
20336
20337 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20338
20339         * driver.cs: Add --timestamp, to see where the compiler spends
20340         most of its time.
20341
20342         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
20343         `this' in static code.
20344
20345         (SimpleName.DoResolve): Implement in terms of a helper function
20346         that allows static-references to be passed upstream to
20347         MemberAccess.
20348
20349         (Expression.ResolveWithSimpleName): Resolve specially simple
20350         names when called by MemberAccess to implement the special
20351         semantics. 
20352
20353         (Expression.ImplicitReferenceConversion): Handle conversions from
20354         Null to reference types before others, as Null's type is
20355         System.Object. 
20356
20357         * expression.cs (Invocation.EmitCall): Handle the special case of
20358         calling methods declared on a reference type from a ValueType
20359         (Base classes System.Object and System.Enum)
20360
20361         (MemberAccess.Resolve): Only perform lookups on Enumerations if
20362         the left hand side is a TypeExpr, not on every enumeration. 
20363
20364         (Binary.Resolve): If types are reference types, then do a cast to
20365         object on operators != and == of both arguments.
20366
20367         * typemanager.cs (FindMembers): Extract instance and static
20368         members if requested.
20369
20370         * interface.cs (PopulateProperty): Use void_type instead of null
20371         as the return type for the setter method.
20372
20373         (PopulateIndexer): ditto.
20374
20375 2001-12-27  Ravi Pratap  <ravi@ximian.com>
20376
20377         * support.cs (ReflectionParameters): Fix minor bug where we
20378         were examining the wrong parameter for the ParamArray attribute.
20379
20380         Cope with requests for the type of the parameter at position
20381         greater than the params parameter's. We now return the element
20382         type of the params array as that makes more sense.
20383
20384         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
20385         accordingly as we no longer have to extract the element type
20386         ourselves.
20387
20388         (Invocation.OverloadResolve): Update.
20389
20390 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20391
20392         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
20393         against IEnumerator, test whether the return value is a descendant
20394         of the IEnumerator interface.
20395
20396         * class.cs (Indexer.Define): Use an auxiliary method to implement
20397         the other bits of the method definition.  Begin support for
20398         explicit interface implementation.
20399
20400         (Property.DefineMethod): Use TypeManager.void_type instead of null
20401         for an empty return value.
20402
20403 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
20404
20405         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
20406         dealing with a FieldExpr which is composed of a FieldBuilder, in
20407         the code path we did extract the constant, but we should have
20408         obtained the underlying value to be able to cast it (otherwise we
20409         end up in an infinite loop, this is what Ravi was running into).
20410
20411         (ArrayCreation.UpdateIndices): Arrays might be empty.
20412
20413         (MemberAccess.ResolveMemberAccess): Add support for section
20414         14.5.4.1 that deals with the special case of E.I when E is a type
20415         and something else, that I can be a reference to a static member.
20416
20417         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
20418         handle a particular array type to create byte blobs, it is just
20419         something we dont generate byteblobs for.
20420
20421         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
20422         arguments. 
20423
20424         * location.cs (Push): remove the key from the hashtable that we
20425         are about to add.   This happens for empty files.
20426
20427         * driver.cs: Dispose files after we have parsed them.
20428
20429         (tokenize): new function that only runs the tokenizer on its
20430         input, for speed testing.
20431
20432 2001-12-26  Ravi Pratap  <ravi@ximian.com>
20433
20434         * class.cs (Event.Define): Define the private field only if there
20435         are no accessors defined.
20436
20437         * expression.cs (ResolveMemberAccess): If there is no associated
20438         field with the event, that means we have an event defined with its
20439         own accessors and we should flag error cs0070 since transforming
20440         ourselves into a field is not valid in that case.
20441
20442         * ecore.cs (SimpleName.DoResolve): Same as above.
20443
20444         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
20445         and charset to sane values.
20446
20447 2001-12-25  Ravi Pratap  <ravi@ximian.com>
20448
20449         * assign.cs (DoResolve): Perform check on events only if they 
20450         are being accessed outside the declaring type.
20451
20452         * cs-parser.jay (event_declarations): Update rules to correctly
20453         set the type of the implicit parameter etc.
20454
20455         (add_accessor, remove_accessor): Set current local parameters.
20456
20457         * expression.cs (Binary): For delegate addition and subtraction,
20458         cast the return value from the method into the appropriate delegate
20459         type.
20460
20461 2001-12-24  Ravi Pratap  <ravi@ximian.com>
20462
20463         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
20464         of these as the workaround is unnecessary.
20465
20466         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
20467         delegate data - none of that is needed at all.
20468
20469         Re-write bits to extract the instance expression and the delegate method
20470         correctly.
20471
20472         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
20473         on delegates too.
20474
20475         * attribute.cs (ApplyAttributes): New method to take care of common tasks
20476         of attaching attributes instead of duplicating code everywhere.
20477
20478         * everywhere : Update code to do attribute emission using the above method.
20479
20480 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
20481
20482         * expression.cs (IsParamsMethodApplicable): if there are not
20483         parameters, return immediately.
20484
20485         * ecore.cs: The 0 literal can be implicity converted to an enum
20486         type. 
20487
20488         (SimpleName.DoResolve): First lookup the type, then lookup the
20489         members. 
20490
20491         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
20492         want to get its address.  If the InstanceExpression is not
20493         addressable, store the result in a temporary variable, then get
20494         the address of it.
20495
20496         * codegen.cs: Only display 219 errors on warning level or above. 
20497
20498         * expression.cs (ArrayAccess): Make it implement the
20499         IMemoryLocation interface.
20500
20501         (Binary.DoResolve): handle the operator == (object a, object b)
20502         and operator != (object a, object b) without incurring into a
20503         BoxedCast (because 5 != o should never be performed).
20504
20505         Handle binary enumerator operators.
20506
20507         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
20508         value type, otherwise use Ldelem_ref.
20509
20510         Use precomputed names;
20511
20512         (AddressOf): Implement address of
20513
20514         * cs-parser.jay (labeled_statement): Fix recursive block
20515         addition by reworking the production.
20516
20517         * expression.cs (New.DoEmit): New has a special case:
20518                 
20519                  If we are dealing with a ValueType, we have a few
20520                  situations to deal with:
20521                 
20522                     * The target of New is a ValueType variable, that is
20523                       easy, we just pass this as the variable reference
20524                 
20525                     * The target of New is being passed as an argument,
20526                       to a boxing operation or a function that takes a
20527                       ValueType.
20528                 
20529                       In this case, we need to create a temporary variable
20530                       that is the argument of New.
20531
20532
20533 2001-12-23  Ravi Pratap  <ravi@ximian.com>
20534
20535         * rootcontext.cs (LookupType): Check that current_type is not null before
20536         going about looking at nested types.
20537
20538         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
20539         not implement the IAssignMethod interface any more.
20540
20541         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
20542         where we tranform them into FieldExprs if they are being resolved from within
20543         the declaring type.
20544
20545         * ecore.cs (SimpleName.DoResolve): Do the same here.
20546
20547         * assign.cs (DoResolve, Emit): Clean up code considerably. 
20548
20549         * ../errors/bug10.cs : Add.
20550
20551         * ../errors/cs0070.cs : Add.
20552
20553         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
20554
20555         * assign.cs : Get rid of EventIsLocal everywhere.
20556
20557 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
20558
20559         * ecore.cs (ConvertIntLiteral): finished the implementation.
20560
20561         * statement.cs (SwitchLabel): Convert the value we are using as a
20562         key before looking up the table.
20563
20564 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
20565
20566         * codegen.cs (EmitTopBlock): Require a Location argument now.
20567
20568         * cs-parser.jay (constructor_declarator): We need to setup
20569         current_local_parameters before we parse the
20570         opt_constructor_initializer, to allow the variables to be bound
20571         to the constructor arguments.
20572
20573         * rootcontext.cs (LookupType): First lookup nested classes in our
20574         class and our parents before we go looking outside our class.
20575
20576         * expression.cs (ConstantFold): Extract/debox the values at the
20577         beginnning. 
20578
20579         * rootcontext.cs (EmitCode): Resolve the constants first before we
20580         resolve the types.  This is not really needed, but it helps debugging.
20581
20582         * statement.cs: report location.
20583
20584         * cs-parser.jay: pass location to throw statement.
20585
20586         * driver.cs: Small bug fix.
20587
20588         * report.cs: Updated format to be 4-zero filled digits.
20589
20590 2001-12-22  Ravi Pratap  <ravi@ximian.com>
20591
20592         * expression.cs (CheckIndices): Fix minor bug where the wrong
20593         variable was being referred to ;-)
20594
20595         (DoEmit): Do not call EmitStaticInitializers when the 
20596         underlying type is System.Object.
20597
20598 2001-12-21  Ravi Pratap  <ravi@ximian.com>
20599
20600         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
20601         and do the usual workaround for SRE.
20602
20603         * class.cs (MyEventBuilder.EventType): New member to get at the type
20604         of the event, quickly.
20605
20606         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
20607
20608         * assign.cs (Assign.DoResolve): Handle the case when the target
20609         is an EventExpr and perform the necessary checks.
20610
20611         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
20612         interface.
20613
20614         (SimpleName.MemberStaticCheck): Include check for EventExpr.
20615
20616         (EventExpr): Set the type in the constructor itself since we 
20617         are meant to be born fully resolved.
20618
20619         (EventExpr.Define): Revert code I wrote earlier.
20620                 
20621         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
20622         instance expression is null. The instance expression is a This in that case
20623         or a null, depending on whether it is a static method or not.
20624
20625         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
20626         refers to more than one method.
20627
20628         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
20629         and accordingly flag errors.
20630
20631 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
20632
20633         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
20634
20635 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
20636
20637         * location.cs (ToString): Provide useful rutine.
20638
20639 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
20640
20641         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
20642         objects, return the actual integral boxed.
20643
20644         * statement.cs (SwitchLabel): define an ILLabel for each
20645         SwitchLabel. 
20646
20647         (Switch.CheckSwitch): If the value is a Literal, extract
20648         the underlying literal.
20649
20650         Also in the unused hashtable we had, add the SwitchLabel so we can
20651         quickly look this value up.
20652
20653         * constant.cs: Implement a bunch of new constants.  Rewrite
20654         Literal based on this.  Made changes everywhere to adapt to this.
20655
20656         * expression.cs (Expression.MakeByteBlob): Optimize routine by
20657         dereferencing array only once, and also copes with enumrations.
20658
20659         bytes are two bytes wide, not one.
20660
20661         (Cast): Perform constant conversions.
20662
20663         * ecore.cs (TryImplicitIntConversion): Return literals instead of
20664         wrappers to the literals here.
20665
20666         * expression.cs (DoNumericPromotions): long literals can converted
20667         to ulong implicity (this is taken care of elsewhere, but I was
20668         missing this spot).
20669
20670         * ecore.cs (Expression.Literalize): Make the return type Literal,
20671         to improve type checking.
20672
20673         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
20674
20675 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
20676
20677         * literal.cs: Revert code from ravi that checked the bounds.  The
20678         bounds are sane by the definition of the type itself. 
20679
20680         * typemanager.cs: Fix implementation of ImplementsInterface.  We
20681         need to actually look up in our parent hierarchy for interfaces
20682         implemented. 
20683
20684         * const.cs: Use the underlying type for enumerations
20685
20686         * delegate.cs: Compute the basename for the delegate creation,
20687         that should fix the delegate test case, and restore the correct
20688         Type Lookup semantics in rootcontext
20689
20690         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
20691         referencing a nested type with the Reflection API is using the "+"
20692         sign. 
20693
20694         * cs-parser.jay: Do not require EOF token at the end.
20695
20696 2001-12-20  Ravi Pratap  <ravi@ximian.com>
20697
20698         * rootcontext.cs (LookupType): Concatenate type names with
20699         a '.' instead of a '+' The test suite passes again.
20700
20701         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
20702         field of the enumeration.
20703
20704         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
20705         the case when the member is an EventExpr.
20706
20707         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
20708         static has an associated instance expression.
20709
20710         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
20711
20712         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
20713
20714         * class.cs (Event.Define): Register event and perform appropriate checks
20715         for error #111.
20716
20717         We define the Add and Remove methods even if the use provides none because
20718         in that case, we provide default implementations ourselves.
20719
20720         Define a private field of the type of the event. This is done by the CSC compiler
20721         and we should be doing it too ;-)
20722
20723         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
20724         More methods we use in code we generate.
20725
20726         (multicast_delegate_type, delegate_type): Two separate types since the distinction
20727         is important.
20728
20729         (InitCoreTypes): Update accordingly for the above.
20730
20731         * class.cs (Event.Emit): Generate code for default accessors that we provide
20732
20733         (EmitDefaultMethod): Do the job in the above.
20734
20735         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
20736         appropriate place.
20737
20738 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
20739
20740         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
20741         builders even if we were missing one.
20742
20743         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
20744         pass the Basename as our class name instead of the Name.  The
20745         basename will be correctly composed for us.
20746
20747         * parameter.cs (Paramters): Now takes a Location argument.
20748
20749         * decl.cs (DeclSpace.LookupType): Removed convenience function and
20750         make all the code call directly LookupType in RootContext and take
20751         this chance to pass the Location information everywhere.
20752
20753         * Everywhere: pass Location information.
20754
20755 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
20756
20757         * class.cs (Constructor.Define): Updated way of detecting the
20758         length of the parameters.
20759
20760         (TypeContainer.DefineType): Use basename as the type name for
20761         nested types.
20762
20763         (TypeContainer.Define): Do not recursively define types here, as
20764         definition is taken care in order by the RootContext.
20765
20766         * tree.cs: Keep track of namespaces in a per-file basis.
20767
20768         * parameter.cs (Parameter.ComputeSignature): Update to use
20769         DeclSpace. 
20770
20771         (Parameters.GetSignature): ditto.
20772
20773         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
20774         instead of a TypeContainer.
20775
20776         (Interface.SemanticAnalysis): Use `this' instead of our parent to
20777         resolve names.  Because we need to be resolve in our context, not
20778         our parents.
20779
20780         * driver.cs: Implement response files.
20781
20782         * class.cs (TypeContainer.DefineType): If we are defined, do not
20783         redefine ourselves.
20784
20785         (Event.Emit): Emit the code for add/remove handlers.
20786         (Event.Define): Save the MethodBuilders for add/remove.
20787
20788         * typemanager.cs: Use pair here too.
20789
20790         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
20791         DictionaryEntry requires the first argument to be non-null.  
20792
20793         (enum_declaration): Compute full name for registering the
20794         enumeration.
20795
20796         (delegate_declaration): Instead of using
20797         formal_parameter_list, use opt_formal_parameter_list as the list
20798         can be empty.
20799
20800         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
20801         (EventParsing): New property that controls whether `add' and
20802         `remove' are returned as tokens or identifiers (for events);
20803
20804 2001-12-19  Ravi Pratap  <ravi@ximian.com>
20805
20806         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
20807         use MyEventBuilder only and let it wrap the real builder for us.
20808
20809         (MyEventBuilder): Revamp constructor etc.
20810
20811         Implement all operations that we perform on EventBuilder in precisely the same
20812         way here too.
20813
20814         (FindMembers): Update to use the EventBuilder member.
20815
20816         (Event.Emit): Update accordingly.
20817
20818 2001-12-18  Ravi Pratap  <ravi@ximian.com>
20819
20820         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
20821         by calling the appropriate methods.
20822
20823         (GetCustomAttributes): Make stubs as they cannot possibly do anything
20824         useful.
20825
20826         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
20827
20828 2001-12-17  Ravi Pratap  <ravi@ximian.com>
20829
20830         * delegate.cs (Delegate.Populate): Check that the return type
20831         and various parameters types are indeed accessible.
20832
20833         * class.cs (Constructor.Define): Same here.
20834
20835         (Field.Define): Ditto.
20836
20837         (Event.Define): Ditto.
20838
20839         (Operator.Define): Check that the underlying Method defined itself
20840         correctly - so it's MethodBuilder should not be null.
20841
20842         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
20843         expression happens to be null.
20844
20845         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
20846         members but as of now we don't seem to be able to do anything really useful with it.
20847
20848         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
20849         not the EventBuilder.
20850
20851 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
20852
20853         * cs-tokenizer.cs: Add support for defines.
20854         Add support for #if, #elif, #else, #endif
20855
20856         (eval_var): evaluates a variable.
20857         (eval): stubbed for evaluating functions.
20858
20859         * cs-parser.jay: Pass the defines information
20860
20861         * driver.cs: Add --define command line option.
20862
20863         * decl.cs: Move MemberCore here.
20864
20865         Make it the base class for DeclSpace.  This allows us to catch and
20866         report 108 and 109 for everything now.
20867
20868         * class.cs (TypeContainer.Define): Extract all the members
20869         before populating and emit the warning 108 (new keyword required
20870         to override) instead of having each member implement this.
20871
20872         (MemberCore.Define): New abstract method, we will be using this in
20873         the warning reporting engine in Populate.
20874
20875         (Operator.Define): Adjust to new MemberCore protocol. 
20876
20877         * const.cs (Const): This does not derive from Expression, it is a
20878         temporary object we use to create fields, it is a MemberCore. 
20879
20880         * class.cs (Method.Define): Allow the entry point to be in a
20881         specific class.
20882
20883         * driver.cs: Rewrite the argument handler to clean it up a bit.
20884
20885         * rootcontext.cs: Made it just an auxiliary namespace feature by
20886         making everything static.
20887
20888         * driver.cs: Adapt code to use RootContext type name instead of
20889         instance variable.
20890
20891         * delegate.cs: Remove RootContext argument.
20892
20893         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
20894         argument. 
20895
20896         * class.cs (Event.Define): The lookup can fail.
20897
20898         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
20899
20900         * expression.cs: Resolve the this instance before invoking the code.
20901
20902 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
20903
20904         * cs-parser.jay: Add a production in element_access that allows
20905         the thing to become a "type" reference.  This way we can parse
20906         things like "(string [])" as a type.
20907
20908         Note that this still does not handle the more complex rules of
20909         casts. 
20910
20911
20912         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
20913
20914         * ecore.cs: (CopyNewMethods): new utility function used to
20915         assemble the list of methods from running FindMembers.
20916
20917         (MemberLookup): Rework FindMembers so that 
20918
20919 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
20920
20921         * class.cs (TypeContainer): Remove Delegates who fail to be
20922         defined.
20923
20924         * delegate.cs (Populate): Verify that we dont get null return
20925         values.   TODO: Check for AsAccessible.
20926
20927         * cs-parser.jay: Use basename to emit error 574 (destructor should
20928         have the same name as container class), not the full name.
20929
20930         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
20931         possible representation.  
20932
20933         Also implements integer type suffixes U and L.
20934
20935 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
20936
20937         * expression.cs (ArrayCreation.DoResolve): We need to do the
20938         argument resolution *always*.
20939
20940         * decl.cs: Make this hold the namespace.  Hold the root context as
20941         well.
20942         (LookupType): Move here.
20943
20944         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
20945
20946         * location.cs (Row, Name): Fixed the code, it was always returning
20947         references to the first file.
20948
20949         * interface.cs: Register properties defined through interfaces.
20950
20951         * driver.cs: Add support for globbing on the command line
20952
20953         * class.cs (Field): Make it derive from MemberCore as well.
20954         (Event): ditto.
20955
20956 2001-12-15  Ravi Pratap  <ravi@ximian.com>
20957
20958         * class.cs (Event::Define): Check that the type of the event is a delegate
20959         type else flag error #66.
20960
20961         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
20962         same.
20963
20964         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
20965         values of EntryPoint, CharSet etc etc.
20966
20967         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
20968
20969         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
20970         be null and we should ignore this. I am not sure if this is really clean. Apparently,
20971         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
20972         which needs this to do its work.
20973
20974         * ../errors/cs0066.cs : Add.
20975
20976 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
20977
20978         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
20979         helper functions.
20980
20981         * class.cs: (MethodSignature.MethodSignature): Removed hack that
20982         clears out the parameters field.
20983         (MemberSignatureCompare): Cleanup
20984
20985         (MemberCore): New base class used to share code between MethodCore
20986         and Property.
20987
20988         (RegisterRequiredImplementations) BindingFlags.Public requires
20989         either BindingFlags.Instace or Static.  Use instance here.
20990
20991         (Property): Refactored code to cope better with the full spec.
20992
20993         * parameter.cs (GetParameterInfo): Return an empty array instead
20994         of null on error.
20995
20996         * class.cs (Property): Abstract or extern properties have no bodies.
20997
20998         * parameter.cs (GetParameterInfo): return a zero-sized array.
20999
21000         * class.cs (TypeContainer.MethodModifiersValid): Move all the
21001         method modifier validation to the typecontainer so we can reuse
21002         this on properties.
21003
21004         (MethodCore.ParameterTypes): return an empty sized array of types.
21005
21006         (Property.Define): Test property modifier validity.
21007
21008         Add tests for sealed/override too.
21009
21010         (Method.Emit): abstract or extern methods have no bodies.
21011
21012 2001-12-14  Ravi Pratap  <ravi@ximian.com>
21013
21014         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21015         thing.
21016
21017         (Method::Define, ::Emit): Modify accordingly.
21018
21019         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21020
21021         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21022
21023         * makefile: Pass in /unsafe.
21024
21025 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
21026
21027         * class.cs (MakeKey): Kill routine.
21028
21029         * class.cs (TypeContainer.Define): Correctly define explicit
21030         method implementations (they require the full interface name plus
21031         the method name).
21032
21033         * typemanager.cs: Deply the PtrHashtable here and stop using the
21034         lame keys.  Things work so much better.
21035
21036         This of course broke everyone who depended on `RegisterMethod' to
21037         do the `test for existance' test.  This has to be done elsewhere.
21038
21039         * support.cs (PtrHashtable): A hashtable that avoid comparing with
21040         the object stupid Equals method (because, that like fails all over
21041         the place).  We still do not use it.
21042
21043         * class.cs (TypeContainer.SetRequiredInterface,
21044         TypeContainer.RequireMethods): Killed these two routines and moved
21045         all the functionality to RegisterRequiredImplementations.
21046
21047         (TypeContainer.RegisterRequiredImplementations): This routine now
21048         registers all the implementations required in an array for the
21049         interfaces and abstract methods.  We use an array of structures
21050         which can be computed ahead of time to reduce memory usage and we
21051         also assume that lookups are cheap as most classes will not
21052         implement too many interfaces.
21053
21054         We also avoid creating too many MethodSignatures.
21055
21056         (TypeContainer.IsInterfaceMethod): Update and optionally does not
21057         clear the "pending" bit if we find that there are problems with
21058         the declaration.
21059
21060         (TypeContainer.VerifyPendingMethods): Update to report errors of
21061         methods that look like implementations but are not.
21062
21063         (TypeContainer.Define): Add support for explicit interface method
21064         implementation. 
21065
21066 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
21067
21068         * typemanager.cs: Keep track of the parameters here instead of
21069         being a feature of the TypeContainer.
21070
21071         * class.cs: Drop the registration of parameters here, as
21072         InterfaceMethods are also interface declarations.
21073
21074         * delegate.cs: Register methods with the TypeManager not only with
21075         the TypeContainer.  This code was buggy.
21076
21077         * interface.cs: Full registation here.
21078
21079 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
21080
21081         * expression.cs: Remove reducer for binary expressions, it can not
21082         be done this way.
21083
21084         * const.cs: Put here the code that used to go into constant.cs
21085
21086         * constant.cs: Put here the code for constants, this is a new base
21087         class for Literals.
21088
21089         * literal.cs: Make Literal derive from Constant.
21090
21091 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
21092
21093         * statement.cs (Return.Emit): Report error 157 if the user
21094         attempts to return from a finally block.
21095
21096         (Return.Emit): Instead of emitting a return, jump to the end of
21097         the function.
21098
21099         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21100         LocalBuilder to store the result of the function.  ReturnLabel is
21101         the target where we jump.
21102
21103
21104 2001-12-09  Radek Doulik  <rodo@ximian.com>
21105
21106         * cs-parser.jay: remember alias in current namespace
21107
21108         * ecore.cs (SimpleName::DoResolve): use aliases for types or
21109         namespaces
21110
21111         * class.cs (LookupAlias): lookup alias in my_namespace
21112
21113         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21114         aliases hashtable
21115         (LookupAlias): lookup alias in this and if needed in parent
21116         namespaces
21117
21118 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
21119
21120         * support.cs: 
21121
21122         * rootcontext.cs: (ModuleBuilder) Made static, first step into
21123         making things static.  I need this to avoid passing the
21124         TypeContainer when calling ParameterType.
21125
21126         * support.cs (InternalParameters.ParameterType): Remove ugly hack
21127         that did string manipulation to compute the type and then call
21128         GetType.  Use Parameter.ParameterType instead.
21129
21130         * cs-tokenizer.cs: Consume the suffix for floating values.
21131
21132         * expression.cs (ParameterReference): figure out whether this is a
21133         reference parameter or not.  Kill an extra variable by computing
21134         the arg_idx during emission.
21135
21136         * parameter.cs (Parameters.GetParameterInfo): New overloaded
21137         function that returns whether a parameter is an out/ref value or not.
21138
21139         (Parameter.ParameterType): The type of the parameter (base,
21140         without ref/out applied).
21141
21142         (Parameter.Resolve): Perform resolution here.
21143         (Parameter.ExternalType): The full type (with ref/out applied).
21144
21145         * statement.cs (Using.Emit, Using.EmitExpression): Implement
21146         support for expressions on the using statement.
21147
21148 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
21149
21150         * statement.cs (Using.EmitLocalVariableDecls): Split the
21151         localvariable handling of the using statement.
21152
21153         (Block.EmitMeta): Keep track of variable count across blocks.  We
21154         were reusing slots on separate branches of blocks.
21155
21156         (Try.Emit): Emit the general code block, we were not emitting it. 
21157
21158         Check the type of the declaration to be an IDisposable or
21159         something that can be implicity converted to it. 
21160
21161         Emit conversions if required.
21162
21163         * ecore.cs (EmptyExpression): New utility class.
21164         (Expression.ImplicitConversionExists): New utility function.
21165
21166 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
21167
21168         * statement.cs (Using): Implement.
21169
21170         * expression.cs (LocalVariableReference): Support read only variables.
21171
21172         * statement.cs: Remove the explicit emit for the Leave opcode.
21173         (VariableInfo): Add a readonly field.
21174
21175 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
21176
21177         * ecore.cs (ConvCast): new class used to encapsulate the various
21178         explicit integer conversions that works in both checked and
21179         unchecked contexts.
21180
21181         (Expression.ConvertNumericExplicit): Use new ConvCast class to
21182         properly generate the overflow opcodes.
21183
21184 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21185
21186         * statement.cs: The correct type for the EmptyExpression is the
21187         element_type, not the variable type.  Ravi pointed this out.
21188
21189 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21190
21191         * class.cs (Method::Define): Handle PInvoke methods specially
21192         by using DefinePInvokeMethod instead of the usual one.
21193
21194         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21195         above to do the task of extracting information and defining the method.
21196
21197 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21198
21199         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21200         of the condition for string type.
21201
21202         (Emit): Move that here. 
21203
21204         (ArrayCreation::CheckIndices): Keep string literals in their expression
21205         form.
21206
21207         (EmitDynamicInitializers): Handle strings appropriately.
21208
21209 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21210
21211         * codegen.cs (EmitContext): Replace multiple variables with a
21212         single pointer to the current Switch statement.
21213
21214         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21215         EmitContext.
21216
21217 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21218
21219         * statement.cs 
21220
21221         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21222         default'.
21223
21224         (Foreach.Emit): Foreach on arrays was not setting
21225         up the loop variables (for break/continue).
21226
21227         (GotoCase): Semi-implented.
21228
21229 2001-12-03  Ravi Pratap  <ravi@ximian.com>
21230
21231         * attribute.cs (CheckAttribute): Handle system attributes by using
21232         Attribute.GetAttributes to examine information we need.
21233
21234         (GetValidPlaces): Same here.
21235
21236         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21237
21238         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21239
21240         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21241
21242         (Method::Define): Set appropriate flags if we have a DllImport attribute.
21243
21244         (Method::Emit): Handle the case when we are a PInvoke method.
21245
21246 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21247
21248         * expression.cs: Use ResolveWithSimpleName on compound names.
21249
21250 2001-12-02  Ravi Pratap  <ravi@ximian.com>
21251
21252         * constant.cs (EmitConstant): Make sure we resolve the associated expression
21253         before trying to reduce it.
21254
21255         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21256
21257         * constant.cs (LookupConstantValue): Implement.
21258
21259         (EmitConstant): Use the above in emitting the constant.
21260
21261         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21262         that are user-defined by doing a LookupConstantValue on them.
21263
21264         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21265         too, like above.
21266
21267 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
21268
21269         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21270
21271         (BaseAccess.DoResolve): Implement.
21272
21273         (MemberAccess.DoResolve): Split this routine into a
21274         ResolveMemberAccess routine that can be used independently
21275
21276 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
21277
21278         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21279         As that share bits of the implementation.  Is returns a boolean,
21280         while As returns the Type that is being probed.
21281
21282 2001-12-01  Ravi Pratap  <ravi@ximian.com>
21283
21284         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21285         instead of a Literal - much easier.
21286
21287         (EnumInTransit): Remove - utterly useless :-)
21288
21289         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21290
21291         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21292
21293         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21294         chain when we have no associated expression.
21295
21296 2001-11-30  Ravi Pratap  <ravi@ximian.com>
21297
21298         * constant.cs (Define): Use Location while reporting the errror.
21299
21300         Also emit a warning when 'new' is used and there is no inherited
21301         member to hide.
21302
21303         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
21304         populated.
21305
21306         (LookupEnumValue): Implement to lookup an enum member's value and define it
21307         if necessary.
21308
21309         (Populate): Re-write accordingly to use the above routine.
21310
21311 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
21312
21313         * expression.cs (This): Fix prototype for DoResolveLValue to
21314         override the base class DoResolveLValue.
21315
21316         * cs-parser.cs: Report errors cs574 and cs575 (destructor
21317         declarations) 
21318
21319         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
21320         (we need to load the address of the field here).  This fixes
21321         test-22. 
21322
21323         (FieldExpr.DoResolveLValue): Call the DoResolve
21324         function to initialize the Instance expression.
21325
21326         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
21327         correctly the GetEnumerator operation on a value type.
21328
21329         * cs-parser.jay: Add more simple parsing error catches.
21330
21331         * statement.cs (Switch): Add support for string switches.
21332         Handle null specially.
21333
21334         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
21335
21336 2001-11-28  Ravi Pratap  <ravi@ximian.com>
21337
21338         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
21339
21340         (declare_local_constant): New helper function.
21341
21342         * statement.cs (AddConstant): Keep a separate record of constants
21343
21344         (IsConstant): Implement to determine if a variable is a constant.
21345
21346         (GetConstantExpression): Implement.
21347
21348         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
21349
21350         * statement.cs (IsVariableDefined): Re-write.
21351
21352 2001-11-27  Ravi Pratap  <ravi@ximian.com>
21353
21354         * class.cs (TypeContainer::FindMembers): Look for constants
21355         in the case when we are looking for MemberTypes.Field
21356
21357         * expression.cs (MemberAccess::DoResolve): Check that in the
21358         case we are a FieldExpr and a Literal, we are not being accessed
21359         by an instance reference.
21360
21361         * cs-parser.jay (local_constant_declaration): Implement.
21362
21363         (declaration_statement): Implement for constant declarations.
21364
21365 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
21366
21367         * statement.cs (Switch): Catch double defaults.
21368
21369         (Switch): More work on the switch() statement
21370         implementation.  It works for integral values now, need to finish
21371         string support.
21372
21373
21374 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21375
21376         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
21377         integer literals into other integer literals.  To be used by
21378         switch. 
21379
21380 2001-11-24  Ravi Pratap  <ravi@ximian.com>
21381
21382         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
21383         some memory.
21384
21385         (EmitDynamicInitializers): Cope with the above since we extract data
21386         directly from ArrayData now.
21387
21388         (ExpectInitializers): Keep track of whether initializers are mandatory
21389         or not.
21390
21391         (Bounds): Make it a hashtable to prevent the same dimension being 
21392         recorded for every element in that dimension.
21393
21394         (EmitDynamicInitializers): Fix bug which prevented the Set array method
21395         from being found.
21396
21397         Also fix bug which was causing the indices to be emitted in the reverse
21398         order.
21399
21400 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21401
21402         * expression.cs (ArrayCreation): Implement the bits that Ravi left
21403         unfinished.  They do not work, because the underlying code is
21404         sloppy.
21405
21406 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21407
21408         * cs-parser.jay: Remove bogus fixme.
21409
21410         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
21411         on Switch statement.
21412
21413 2001-11-23  Ravi Pratap  <ravi@ximian.com>
21414
21415         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
21416         the same. 
21417
21418         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
21419         parameter. Apparently, any expression is allowed. 
21420
21421         (ValidateInitializers): Update accordingly.
21422
21423         (CheckIndices): Fix some tricky bugs thanks to recursion.
21424
21425         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
21426         I was being completely brain-dead.
21427
21428         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
21429         and re-write acordingly.
21430
21431         (DelegateInvocation): Re-write accordingly.
21432
21433         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
21434
21435         (MakeByteBlob): Handle types more correctly.
21436
21437         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
21438         initialization from expressions but it is incomplete because I am a complete
21439         Dodo :-|
21440
21441 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21442
21443         * statement.cs (If.Emit): Fix a bug that generated incorrect code
21444         on If.  Basically, we have to return `true' (ie, we do return to
21445         our caller) only if both branches of the if return.
21446
21447         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
21448         short-circuit operators, handle them as short circuit operators. 
21449
21450         (Cast.DoResolve): Resolve type.
21451         (Cast.Cast): Take an expression as the target type.
21452
21453         * cs-parser.jay (cast_expression): Remove old hack that only
21454         allowed a limited set of types to be handled.  Now we take a
21455         unary_expression and we resolve to a type during semantic
21456         analysis.
21457
21458         Use the grammar productions from Rhys to handle casts (this is
21459         not complete like Rhys syntax yet, we fail to handle that corner
21460         case that C# has regarding (-x), but we will get there.
21461
21462 2001-11-22  Ravi Pratap  <ravi@ximian.com>
21463
21464         * class.cs (EmitFieldInitializer): Take care of the case when we have a
21465         field which is an array type.
21466
21467         * cs-parser.jay (declare_local_variables): Support array initialization too.
21468
21469         * typemanager.cs (MakeKey): Implement.
21470
21471         (everywhere): Use the above appropriately.
21472
21473         * cs-parser.jay (for_statement): Update for array initialization while
21474         declaring variables.
21475
21476         * ecore.cs : The error message was correct, it's the variable's names that
21477         were misleading ;-) Make the code more readable.
21478
21479         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
21480         the correct type etc.
21481
21482         (ConvertExplicit): Handle Enum types by examining the underlying type.
21483
21484 2001-11-21  Ravi Pratap  <ravi@ximian.com>
21485
21486         * parameter.cs (GetCallingConvention): Always return
21487         CallingConventions.Standard for now.
21488
21489 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21490
21491         * expression.cs (Binary.ResolveOperator): Update the values of `l'
21492         and `r' after calling DoNumericPromotions.
21493
21494         * ecore.cs: Fix error message (the types were in the wrong order).
21495
21496         * statement.cs (Foreach.ProbeCollectionType): Need to pass
21497         BindingFlags.Instance as well 
21498
21499         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
21500         implicit int literal conversion in an empty cast so that we
21501         propagate the right type upstream.
21502
21503         (UnboxCast): new class used to unbox value types.
21504         (Expression.ConvertExplicit): Add explicit type conversions done
21505         by unboxing.
21506
21507         (Expression.ImplicitNumericConversion): Oops, forgot to test for
21508         the target type before applying the implicit LongLiterals to ULong
21509         literal cast.
21510
21511 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
21512
21513         * cs-parser.jay (for_statement): Reworked the way For works: now
21514         we declare manually any variables that are introduced in
21515         for_initializer to solve the problem of having out-of-band code
21516         emition (that is what got for broken).
21517
21518         (declaration_statement): Perform the actual variable declaration
21519         that used to be done in local_variable_declaration here.
21520
21521         (local_variable_declaration): Do not declare anything, just pass
21522         the information on a DictionaryEntry
21523
21524 2001-11-20  Ravi Pratap  <ravi@ximian.com>
21525
21526         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
21527         re-write of the logic to now make it recursive.
21528
21529         (UpdateIndices): Re-write accordingly.
21530
21531         Store element data in a separate ArrayData list in the above methods.
21532
21533         (MakeByteBlob): Implement to dump the array data into a byte array.
21534
21535 2001-11-19  Ravi Pratap  <ravi@ximian.com>
21536
21537         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
21538         into CheckIndices.
21539
21540         * constant.cs (Define): Implement.
21541
21542         (EmitConstant): Re-write fully.
21543
21544         Pass in location info.
21545
21546         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
21547         respectively.
21548
21549         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
21550         DictionaryEntry since we need location info too.
21551
21552         (constant_declaration): Update accordingly.
21553
21554         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
21555         code into another method : UpdateIndices.
21556
21557 2001-11-18  Ravi Pratap  <ravi@ximian.com>
21558
21559         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
21560         some type checking etc.
21561
21562 2001-11-17  Ravi Pratap  <ravi@ximian.com>
21563
21564         * expression.cs (ArrayCreation::ValidateInitializers): Implement
21565         bits to provide dimension info if the user skips doing that.
21566
21567         Update second constructor to store the rank correctly.
21568
21569 2001-11-16  Ravi Pratap  <ravi@ximian.com>
21570
21571         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
21572         and try to implement.
21573
21574         * ../errors/cs0150.cs : Add.
21575
21576         * ../errors/cs0178.cs : Add.
21577
21578 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
21579
21580         * statement.cs: Implement foreach on multi-dimensional arrays. 
21581
21582         * parameter.cs (Parameters.GetParameterByName): Also lookup the
21583         name of the params argument.
21584
21585         * expression.cs: Use EmitStoreOpcode to get the right opcode while
21586         initializing the array.
21587
21588         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
21589         we can use this elsewhere.
21590
21591         * statement.cs: Finish implementation of foreach for single
21592         dimension arrays.
21593
21594         * cs-parser.jay: Use an out-of-band stack to pass information
21595         around, I wonder why I need this.
21596
21597         foreach_block: Make the new foreach_block the current_block.
21598
21599         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
21600         function used to return a static Parameters structure.  Used for
21601         empty parameters, as those are created very frequently.
21602
21603         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
21604
21605 2001-11-15  Ravi Pratap  <ravi@ximian.com>
21606
21607         * interface.cs : Default modifier is private, not public. The
21608         make verify test passes again.
21609
21610 2001-11-15  Ravi Pratap  <ravi@ximian.com>
21611
21612         * support.cs (ReflectionParameters): Fix logic to determine
21613         whether the last parameter is a params one. Test 9 passes again.
21614
21615         * delegate.cs (Populate): Register the builders we define with
21616         RegisterParameterForBuilder. Test 19 passes again.
21617
21618         * cs-parser.jay (property_declaration): Reference $6 instead
21619         of $$ to get at the location.
21620
21621         (indexer_declaration): Similar stuff.
21622
21623         (attribute): Ditto.
21624
21625         * class.cs (Property): Register parameters for the Get and Set methods
21626         if they exist. Test 23 passes again.
21627
21628         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
21629         call to EmitArguments as we are sure there aren't any params arguments. 
21630         Test 32 passes again.
21631
21632         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
21633         IndexOutOfRangeException. 
21634
21635         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
21636         Test 33 now passes again.
21637
21638 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
21639
21640         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
21641         broke a bunch of things.  Will have to come up with a better way
21642         of tracking locations.
21643
21644         * statement.cs: Implemented foreach for single dimension arrays.
21645
21646 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
21647
21648         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
21649         an error.  This removes the lookup from the critical path.
21650
21651         * cs-parser.jay: Removed use of temporary_loc, which is completely
21652         broken. 
21653
21654 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
21655
21656         * support.cs (ReflectionParameters.ParameterModifier): Report
21657         whether the argument is a PARAMS argument or not.
21658
21659         * class.cs: Set the attribute `ParamArrayAttribute' on the
21660         parameter argument.
21661
21662         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
21663         and cons_param_array_attribute (ConstructorInfo for
21664         ParamArrayAttribute)., 
21665
21666         * codegen.cs: Emit the return using the `Return' statement, that
21667         way we can report the error correctly for missing return values. 
21668
21669         * class.cs (Method.Emit): Clean up.
21670
21671         * expression.cs (Argument.Resolve): Take another argument: the
21672         location where this argument is used.  Notice that this is not
21673         part of the "Argument" class as to reduce the size of the
21674         structure (we know the approximate location anyways).
21675
21676         Test if the argument is a variable-reference, if not, then
21677         complain with a 206.
21678
21679         (Argument.Emit): Emit addresses of variables.
21680
21681         (Argument.FullDesc): Simplify.
21682
21683         (Invocation.DoResolve): Update for Argument.Resolve.
21684
21685         (ElementAccess.DoResolve): ditto.
21686
21687         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
21688         method should be virtual, as this method is always virtual.
21689
21690         (NewDelegate.DoResolve): Update for Argument.Resolve.
21691
21692         * class.cs (ConstructorInitializer.DoResolve): ditto.
21693
21694         * attribute.cs (Attribute.Resolve): ditto.
21695
21696 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
21697
21698         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
21699
21700         * expression.cs (ParameterReference): Drop IStackStorage and implement
21701         IAssignMethod instead. 
21702
21703         (LocalVariableReference): ditto.
21704
21705         * ecore.cs (FieldExpr): Drop IStackStorage and implement
21706         IAssignMethod instead. 
21707
21708 2001-11-13  Miguel de Icaza <miguel@ximian.com>
21709
21710         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
21711         enumerations that are used in heavily used structures derive from
21712         byte in a laughable and pathetic attempt to reduce memory usage.
21713         This is the kind of pre-optimzations that you should not do at
21714         home without adult supervision.
21715
21716         * expression.cs (UnaryMutator): New class, used to handle ++ and
21717         -- separatedly from the other unary operators.  Cleans up the
21718         code, and kills the ExpressionStatement dependency in Unary.
21719
21720         (Unary): Removed `method' and `Arguments' from this class, making
21721         it smaller, and moving it all to SimpleCall, so I can reuse this
21722         code in other locations and avoid creating a lot of transient data
21723         strucutres when not required.
21724
21725         * cs-parser.jay: Adjust for new changes.
21726
21727 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
21728
21729         * enum.cs (Enum.Populate): If there is a failure during
21730         definition, return
21731
21732         * cs-parser.jay (opt_enum_base): we used to catch type errors
21733         here, but this is really incorrect.  The type error should be
21734         catched during semantic analysis.
21735
21736 2001-12-11  Ravi Pratap  <ravi@ximian.com>
21737
21738         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
21739         current_local_parameters as expected since I, in my stupidity, had forgotten
21740         to do this :-)
21741
21742         * attribute.cs (GetValidPlaces): Fix stupid bug.
21743
21744         * class.cs (Method::Emit): Perform check on applicability of attributes.
21745
21746         (Constructor::Emit): Ditto.
21747
21748         (Field::Emit): Ditto.
21749
21750         (Field.Location): Store location information.
21751
21752         (Property, Event, Indexer, Operator): Ditto.
21753
21754         * cs-parser.jay (field_declaration): Pass in location for each field.
21755
21756         * ../errors/cs0592.cs : Add.
21757
21758 2001-11-12  Ravi Pratap  <ravi@ximian.com>
21759
21760         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
21761
21762         (InitCoreTypes): Update accordingly.
21763
21764         (RegisterAttrType, LookupAttr): Implement.
21765
21766         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
21767         info about the same.
21768
21769         (Resolve): Update to populate the above as necessary.
21770
21771         (Error592): Helper.
21772
21773         (GetValidPlaces): Helper to the above.
21774
21775         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
21776
21777         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
21778
21779 2001-11-12  Ravi Pratap  <ravi@ximian.com>
21780
21781         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
21782
21783         * ../errors/cs0617.cs : Add.
21784
21785 2001-11-11  Ravi Pratap  <ravi@ximian.com>
21786
21787         * enum.cs (Emit): Rename to Populate to be more consistent with what
21788         we expect it to do and when exactly it is called.
21789
21790         * class.cs, rootcontext.cs : Update accordingly.
21791
21792         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
21793         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
21794
21795         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
21796
21797         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
21798         of a fieldinfo using the above, when dealing with a FieldBuilder.
21799
21800 2001-11-10  Ravi Pratap  <ravi@ximian.com>
21801
21802         * ../errors/cs0031.cs : Add.
21803
21804         * ../errors/cs1008.cs : Add.
21805
21806         * ../errrors/cs0543.cs : Add.
21807
21808         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
21809         enum type.
21810
21811         (FindMembers): Implement.
21812
21813         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
21814         enums and delegates too.
21815
21816         (enum_types): Rename to builder_to_enum.
21817
21818         (delegate_types): Rename to builder_to_delegate.
21819
21820         * delegate.cs (FindMembers): Implement.
21821
21822 2001-11-09  Ravi Pratap  <ravi@ximian.com>
21823
21824         * typemanager.cs (IsEnumType): Implement.
21825
21826         * enum.cs (Emit): Re-write parts to account for the underlying type
21827         better and perform checking etc.
21828
21829         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
21830         of the underlying type.
21831
21832         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
21833         value
21834
21835         * enum.cs (error31): Helper to report error #31.
21836
21837         * cs-parser.jay (enum_declaration): Store location of each member too.
21838
21839         * enum.cs (member_to_location): New hashtable. 
21840
21841         (AddEnumMember): Update location hashtable.
21842
21843         (Emit): Use the location of each member while reporting errors.
21844
21845 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
21846
21847         * cs-parser.jay: A for_initializer if is a
21848         local_variable_declaration really ammount to have an implicit
21849         block with the variable declaration and no initializer for for.
21850
21851         * statement.cs (For.Emit): Cope with null initializers.
21852
21853         This fixes the infinite loop on for initializers.
21854
21855 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
21856
21857         * enum.cs: More cleanup.
21858
21859         * ecore.cs: Remove dead code.
21860
21861         * class.cs (Property.Emit): More simplification.
21862         (Event.Emit): ditto.
21863
21864         Reworked to have less levels of indentation.
21865
21866 2001-11-08  Ravi Pratap  <ravi@ximian.com>
21867
21868         * class.cs (Property): Emit attributes.
21869
21870         (Field): Ditto.
21871
21872         (Event): Ditto.
21873
21874         (Indexer): Ditto.
21875
21876         (Operator): Ditto.
21877
21878         * enum.cs (Emit): Ditto.
21879
21880         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
21881         Enums too.
21882
21883         * class.cs (Field, Event, etc.): Move attribute generation into the
21884         Emit method everywhere.
21885
21886         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
21887         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
21888         as we had no way of defining nested enums !
21889
21890         * rootcontext.cs : Adjust code accordingly.
21891
21892         * typemanager.cs (AddEnumType): To keep track of enum types separately.
21893
21894 2001-11-07  Ravi Pratap  <ravi@ximian.com>
21895
21896         * expression.cs (EvalConstantExpression): Move into ecore.cs
21897
21898         * enum.cs (Enum): Rename some members and make them public and readonly
21899         according to our convention.
21900
21901         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
21902         nothing else.
21903
21904         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
21905
21906         (Enum::Emit): Write a simple version for now which doesn't try to compute
21907         expressions. I shall modify this to be more robust in just a while.
21908
21909         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
21910
21911         (TypeContainer::CloseType): Create the Enum types too.
21912
21913         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
21914
21915         * expression.cs (EvalConstantExpression): Get rid of completely.
21916
21917         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
21918         user-defined values and other cases.
21919
21920         (IsValidEnumLiteral): Helper function.
21921
21922         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
21923         out there in the case we had a literal FieldExpr.
21924
21925         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
21926
21927         (Literalize): Revamp a bit to take two arguments.
21928
21929         (EnumLiteral): New class which derives from Literal to wrap enum literals.
21930
21931 2001-11-06  Ravi Pratap  <ravi@ximian.com>
21932
21933         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
21934
21935         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
21936
21937         (Resolve): Use the above to ensure we have proper initializers.
21938
21939 2001-11-05  Ravi Pratap  <ravi@ximian.com>
21940
21941         * expression.cs (Expression::EvalConstantExpression): New method to 
21942         evaluate constant expressions.
21943
21944         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
21945
21946 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
21947
21948         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
21949         in an array.
21950
21951         (Binary.ResolveOperator): Handle operator != (object a, object b)
21952         and operator == (object a, object b);
21953
21954         (Binary.DoNumericPromotions): Indicate whether the numeric
21955         promotion was possible.
21956
21957         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
21958         Implement.  
21959
21960         Made the ArrayAccess implement interface IAssignMethod instead of
21961         IStackStore as the order in which arguments are passed reflects
21962         this.
21963
21964         * assign.cs: Instead of using expr.ExprClass to select the way of
21965         assinging, probe for the IStackStore/IAssignMethod interfaces.
21966
21967         * typemanager.cs: Load InitializeArray definition.
21968
21969         * rootcontext.cs (RootContext.MakeStaticData): Used to define
21970         static data that can be used to initialize arrays. 
21971
21972 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
21973
21974         * expression.cs: Handle operator== and operator!= for booleans.
21975
21976         (Conditioal.Reduce): Implement reducer for the ?: operator.
21977
21978         (Conditional.Resolve): Implement dead code elimination.
21979
21980         (Binary.Resolve): Catch string literals and return a new
21981         concatenated string.
21982
21983         (Unary.Reduce): Implement reduction of unary expressions.
21984
21985         * ecore.cs: Split out the expression core handling here.
21986
21987         (Expression.Reduce): New method used to perform constant folding
21988         and CSE.  This is needed to support constant-expressions. 
21989
21990         * statement.cs (Statement.EmitBoolExpression): Pass true and false
21991         targets, and optimize for !x.
21992
21993 2001-11-04  Ravi Pratap  <ravi@ximian.com>
21994
21995         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
21996         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
21997         set custom atttributes.
21998
21999         * literal.cs (Literal::GetValue): New abstract method to return the actual
22000         value of the literal, cast as an object.
22001
22002         (*Literal): Implement GetValue method.
22003
22004         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22005         expressions to the arraylist but objects of type Argument.
22006
22007         * class.cs (TypeContainer::Emit): Emit our attributes too.
22008
22009         (Method::Emit, Constructor::Emit): Ditto.
22010
22011         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
22012         to be ignoring earlier.
22013
22014 2001-11-03  Ravi Pratap  <ravi@ximian.com>
22015
22016         * attribute.cs (AttributeSection::Define): Implement to do the business
22017         of constructing a CustomAttributeBuilder.
22018
22019         (Attribute): New trivial class. Increases readability of code.  
22020
22021         * cs-parser.jay : Update accordingly.
22022
22023         (positional_argument_list, named_argument_list, named_argument): New rules
22024
22025         (attribute_arguments): Use the above so that we are more correct.
22026
22027 2001-11-02  Ravi Pratap  <ravi@ximian.com>
22028
22029         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22030         to perform all checks for a method with a params parameter.
22031
22032         (Invocation::OverloadResolve): Update to use the above method and therefore
22033         cope correctly with params method invocations.
22034
22035         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
22036         params too.
22037
22038         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22039         constructors in our parent too because we can't afford to miss out on 
22040         protected ones ;-)
22041
22042         * attribute.cs (AttributeSection): New name for the class Attribute
22043
22044         Other trivial changes to improve readability.
22045
22046         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22047         use the new class names.
22048
22049 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22050
22051         * class.cs (Method::Define): Complete definition for params types too
22052
22053         (Indexer::Define): Ditto.
22054
22055         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22056         Cope everywhere with a request for info about the array parameter.
22057
22058 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22059
22060         * tree.cs (RecordNamespace): Fix up to check for the correct key.
22061
22062         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
22063         local_variable_type to extract the string corresponding to the type.
22064
22065         (local_variable_type): Fixup the action to use the new helper method.
22066
22067         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
22068         go.
22069
22070         * expression.cs : Clean out code which uses the above.
22071
22072 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22073
22074         * typemanager.cs (RegisterMethod): Check if we already have an existing key
22075         and bale out if necessary by returning a false.
22076
22077         (RegisterProperty): Ditto.
22078
22079         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
22080         and print out appropriate error messages.
22081
22082         * interface.cs (everywhere): Ditto.
22083
22084         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
22085         location to constructor.
22086
22087         * class.cs (Property, Event, Indexer): Update accordingly.
22088
22089         * ../errors/cs111.cs : Added.
22090
22091         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
22092         of a method, as laid down by the spec.
22093
22094         (Invocation::OverloadResolve): Use the above method.
22095
22096 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22097
22098         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22099         now take a TypeContainer and a Parameters object.
22100
22101         (ParameterData): Modify return type of ParameterModifier method to be 
22102         Parameter.Modifier and not a string.
22103
22104         (ReflectionParameters, InternalParameters): Update accordingly.
22105
22106         * expression.cs (Argument::GetParameterModifier): Same here.
22107
22108         * support.cs (InternalParameters::ParameterType): Find a better way of determining
22109         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22110         symbol in it at all so maybe this is only for now.
22111
22112 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22113
22114         * support.cs (InternalParameters): Constructor now takes an extra argument 
22115         which is the actual Parameters class.
22116
22117         (ParameterDesc): Update to provide info on ref/out modifiers.
22118
22119         * class.cs (everywhere): Update call to InternalParameters to pass in
22120         the second argument too.
22121
22122         * support.cs (ParameterData): Add ParameterModifier, which is a method 
22123         to return the modifier info [ref/out etc]
22124
22125         (InternalParameters, ReflectionParameters): Implement the above.
22126
22127         * expression.cs (Argument::ParameterModifier): Similar function to return
22128         info about the argument's modifiers.
22129
22130         (Invocation::OverloadResolve): Update to take into account matching modifiers 
22131         too.
22132
22133         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22134         a new SetFormalParameters object which we pass to InternalParameters.
22135
22136 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22137
22138         * expression.cs (NewArray): Merge into the ArrayCreation class.
22139
22140 2001-10-29  Ravi Pratap  <ravi@ximian.com>
22141
22142         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
22143         NewUserdefinedArray into one as there wasn't much of a use in having
22144         two separate ones.
22145
22146         * expression.cs (Argument): Change field's name to ArgType from Type.
22147
22148         (Type): New readonly property which returns the proper type, taking into 
22149         account ref/out modifiers.
22150
22151         (everywhere): Adjust code accordingly for the above.
22152
22153         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22154         whether we are emitting for a ref or out parameter.
22155
22156         * expression.cs (Argument::Emit): Use the above field to set the state.
22157
22158         (LocalVariableReference::Emit): Update to honour the flag and emit the
22159         right stuff.
22160
22161         * parameter.cs (Attributes): Set the correct flags for ref parameters.
22162
22163         * expression.cs (Argument::FullDesc): New function to provide a full desc.
22164
22165         * support.cs (ParameterData): Add method ParameterDesc to the interface.
22166
22167         (ReflectionParameters, InternalParameters): Implement the above method.
22168
22169         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22170         reporting errors.
22171
22172         (Invocation::FullMethodDesc): Ditto. 
22173
22174 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
22175
22176         * cs-parser.jay: Add extra production for the second form of array
22177         creation. 
22178
22179         * expression.cs (ArrayCreation): Update to reflect the above
22180         change. 
22181
22182         * Small changes to prepare for Array initialization.
22183
22184 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
22185
22186         * typemanager.cs (ImplementsInterface): interface might be null;
22187         Deal with this problem;
22188
22189         Also, we do store negative hits on the cache (null values), so use
22190         this instead of calling t.GetInterfaces on the type everytime.
22191
22192 2001-10-28  Ravi Pratap  <ravi@ximian.com>
22193
22194         * typemanager.cs (IsBuiltinType): New method to help determine the same.
22195
22196         * expression.cs (New::DoResolve): Get rid of array creation code and instead
22197         split functionality out into different classes.
22198
22199         (New::FormArrayType): Move into NewBuiltinArray.
22200
22201         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22202         quite useless.
22203
22204         (NewBuiltinArray): New class to handle creation of built-in arrays.
22205
22206         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22207         account creation of one-dimensional arrays.
22208
22209         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22210
22211         (NewUserdefinedArray::DoResolve): Implement.
22212
22213         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22214
22215         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22216         we maintain inside the TypeManager. This is necessary to perform lookups on the
22217         module builder.
22218
22219         (LookupType): Update to perform GetType on the module builders too.     
22220
22221         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22222
22223         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22224
22225 2001-10-23  Ravi Pratap  <ravi@ximian.com>
22226
22227         * expression.cs (New::DoResolve): Implement guts of array creation.
22228
22229         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22230
22231 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
22232
22233         * expression.cs: Fix bug I introduced lsat night that broke
22234         Delegates. 
22235
22236         (Expression.Resolve): Report a 246 error (can not resolve name)
22237         if we find a SimpleName in the stream.
22238
22239         (Expression.ResolveLValue): Ditto.
22240
22241         (Expression.ResolveWithSimpleName): This function is a variant of
22242         ResolveName, this one allows SimpleNames to be returned without a
22243         warning.  The only consumer of SimpleNames is MemberAccess
22244
22245 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
22246
22247         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22248         might arrive here.  I have my doubts that this is correct.
22249
22250         * statement.cs (Lock): Implement lock statement.
22251
22252         * cs-parser.jay: Small fixes to support `lock' and `using'
22253
22254         * cs-tokenizer.cs: Remove extra space
22255
22256         * driver.cs: New flag --checked, allows to turn on integer math
22257         checking. 
22258
22259         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22260         Threading.Monitor.Exit 
22261
22262 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
22263
22264         * expression.cs (IndexerAccess::DoResolveLValue): Set the
22265         Expression Class to be IndexerAccess.
22266
22267         Notice that Indexer::DoResolve sets the eclass to Value.
22268
22269 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
22270
22271         * class.cs (TypeContainer::Emit): Emit code for indexers.
22272
22273         * assign.cs (IAssignMethod): New interface implemented by Indexers
22274         and Properties for handling assignment.
22275
22276         (Assign::Emit): Simplify and reuse code. 
22277
22278         * expression.cs (IndexerAccess, PropertyExpr): Implement
22279         IAssignMethod, clean up old code. 
22280
22281 2001-10-22  Ravi Pratap  <ravi@ximian.com>
22282
22283         * typemanager.cs (ImplementsInterface): New method to determine if a type
22284         implements a given interface. Provides a nice cache too.
22285
22286         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22287         method.
22288
22289         (ConvertReferenceExplicit): Ditto.
22290
22291         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
22292         various methods, with correct names etc.
22293
22294         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
22295         Operator.UnaryNegation.
22296
22297         * cs-parser.jay (operator_declarator): Be a little clever in the case where
22298         we have a unary plus or minus operator.
22299
22300         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
22301         UnaryMinus.
22302
22303         * everywhere : update accordingly.
22304
22305         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22306         respectively.
22307
22308         * class.cs (Method::Define): For the case where we are implementing a method
22309         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
22310         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22311
22312 2001-10-21  Ravi Pratap  <ravi@ximian.com>
22313
22314         * interface.cs (FindMembers): Implement to work around S.R.E
22315         lameness.
22316
22317         * typemanager.cs (IsInterfaceType): Implement.
22318
22319         (FindMembers): Update to handle interface types too.
22320
22321         * expression.cs (ImplicitReferenceConversion): Re-write bits which
22322         use IsAssignableFrom as that is not correct - it doesn't work.
22323
22324         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
22325         and accordingly override EmitStatement.
22326
22327         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
22328         using the correct logic :-)
22329
22330 2001-10-19  Ravi Pratap  <ravi@ximian.com>
22331
22332         * ../errors/cs-11.cs : Add to demonstrate error -11 
22333
22334 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
22335
22336         * assign.cs (Assign::Resolve): Resolve right hand side first, and
22337         then pass this as a hint to ResolveLValue.
22338
22339         * expression.cs (FieldExpr): Add Location information
22340
22341         (FieldExpr::LValueResolve): Report assignment to readonly
22342         variable. 
22343
22344         (Expression::ExprClassFromMemberInfo): Pass location information.
22345
22346         (Expression::ResolveLValue): Add new method that resolves an
22347         LValue. 
22348
22349         (Expression::DoResolveLValue): Default invocation calls
22350         DoResolve. 
22351
22352         (Indexers): New class used to keep track of indexers in a given
22353         Type. 
22354
22355         (IStackStore): Renamed from LValue, as it did not really describe
22356         what this did.  Also ResolveLValue is gone from this interface and
22357         now is part of Expression.
22358
22359         (ElementAccess): Depending on the element access type
22360
22361         * typemanager.cs: Add `indexer_name_type' as a Core type
22362         (System.Runtime.CompilerServices.IndexerNameAttribute)
22363
22364         * statement.cs (Goto): Take a location.
22365
22366 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22367
22368         * delegate.cs (Delegate::VerifyDelegate): New method to verify
22369         if two delegates are compatible.
22370
22371         (NewDelegate::DoResolve): Update to take care of the case when
22372         we instantiate a delegate from another delegate.
22373
22374         * typemanager.cs (FindMembers): Don't even try to look up members
22375         of Delegate types for now.
22376
22377 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22378
22379         * delegate.cs (NewDelegate): New class to take care of delegate
22380         instantiation.
22381
22382         * expression.cs (New): Split the delegate related code out into 
22383         the NewDelegate class.
22384
22385         * delegate.cs (DelegateInvocation): New class to handle delegate 
22386         invocation.
22387
22388         * expression.cs (Invocation): Split out delegate related code into
22389         the DelegateInvocation class.
22390
22391 2001-10-17  Ravi Pratap  <ravi@ximian.com>
22392
22393         * expression.cs (New::DoResolve): Implement delegate creation fully
22394         and according to the spec.
22395
22396         (New::DoEmit): Update to handle delegates differently.
22397
22398         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
22399         because of which we were printing out arguments in reverse order !
22400
22401         * delegate.cs (VerifyMethod): Implement to check if the given method
22402         matches the delegate.
22403
22404         (FullDelegateDesc): Implement.
22405
22406         (VerifyApplicability): Implement.
22407
22408         * expression.cs (Invocation::DoResolve): Update to accordingly handle
22409         delegate invocations too.
22410
22411         (Invocation::Emit): Ditto.
22412
22413         * ../errors/cs1593.cs : Added.
22414
22415         * ../errors/cs1594.cs : Added.
22416
22417         * delegate.cs (InstanceExpression, TargetMethod): New properties.
22418
22419 2001-10-16  Ravi Pratap  <ravi@ximian.com>
22420
22421         * typemanager.cs (intptr_type): Core type for System.IntPtr
22422
22423         (InitCoreTypes): Update for the same.
22424
22425         (iasyncresult_type, asynccallback_type): Ditto.
22426
22427         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
22428         correct.
22429
22430         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
22431         too.
22432
22433         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
22434         the builders for the 4 members of a delegate type :-)
22435
22436         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
22437         type.
22438
22439         * expression.cs (New::DoResolve): Implement guts for delegate creation.
22440
22441         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
22442
22443 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
22444
22445         * statement.cs (Break::Emit): Implement.   
22446         (Continue::Emit): Implement.
22447
22448         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22449         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22450         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22451         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
22452         end loop
22453
22454         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
22455         properties that track the label for the current loop (begin of the
22456         loop and end of the loop).
22457
22458 2001-10-15  Ravi Pratap  <ravi@ximian.com>
22459
22460         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
22461         use of emitting anything at all.
22462
22463         * class.cs, rootcontext.cs : Get rid of calls to the same.
22464
22465         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
22466
22467         (Populate): Define the constructor correctly and set the implementation
22468         attributes.
22469
22470         * typemanager.cs (delegate_types): New hashtable to hold delegates that
22471         have been defined.
22472
22473         (AddDelegateType): Implement.
22474
22475         (IsDelegateType): Implement helper method.
22476
22477         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
22478
22479         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
22480         and accordingly handle it.
22481
22482         * delegate.cs (Populate): Take TypeContainer argument.
22483         Implement bits to define the Invoke method. However, I still haven't figured out
22484         how to take care of the native int bit :-(
22485
22486         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
22487         Qualify the name of the delegate, not its return type !
22488
22489         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
22490         conversion.
22491
22492         (StandardConversionExists): Checking for array types turns out to be recursive.
22493
22494         (ConvertReferenceExplicit): Implement array conversion.
22495
22496         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
22497
22498 2001-10-12  Ravi Pratap  <ravi@ximian.com>
22499
22500         * cs-parser.jay (delegate_declaration): Store the fully qualified
22501         name as it is a type declaration.
22502
22503         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
22504         readonly.
22505
22506         (DefineDelegate): Renamed from Define. Does the same thing essentially,
22507         as TypeContainer::DefineType.
22508
22509         (Populate): Method in which all the definition of the various methods (Invoke)
22510         etc is done.
22511
22512         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
22513         see.
22514
22515         (CloseDelegate): Finally creates the delegate.
22516
22517         * class.cs (TypeContainer::DefineType): Update to define delegates.
22518         (Populate, Emit and CloseType): Do the same thing here too.
22519
22520         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
22521         delegates in all these operations.
22522
22523 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
22524
22525         * expression.cs: LocalTemporary: a new expression used to
22526         reference a temporary that has been created.
22527
22528         * assign.cs: Handle PropertyAccess back here, so that we can
22529         provide the proper semantic access to properties.
22530
22531         * expression.cs (Expression::ConvertReferenceExplicit): Implement
22532         a few more explicit conversions. 
22533
22534         * modifiers.cs: `NEW' modifier maps to HideBySig.
22535
22536         * expression.cs (PropertyExpr): Make this into an
22537         ExpressionStatement, and support the EmitStatement code path. 
22538
22539         Perform get/set error checking, clean up the interface.
22540
22541         * assign.cs: recognize PropertyExprs as targets, and if so, turn
22542         them into toplevel access objects.
22543
22544 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
22545
22546         * expression.cs: PropertyExpr::PropertyExpr: use work around the
22547         SRE.
22548
22549         * typemanager.cs: Keep track here of our PropertyBuilders again to
22550         work around lameness in SRE.
22551
22552 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
22553
22554         * expression.cs (LValue::LValueResolve): New method in the
22555         interface, used to perform a second resolution pass for LValues. 
22556
22557         (This::DoResolve): Catch the use of this in static methods.
22558
22559         (This::LValueResolve): Implement.
22560
22561         (This::Store): Remove warning, assigning to `this' in structures
22562         is 
22563
22564         (Invocation::Emit): Deal with invocation of
22565         methods on value types.  We need to pass the address to structure
22566         methods rather than the object itself.  (The equivalent code to
22567         emit "this" for structures leaves the entire structure on the
22568         stack instead of a pointer to it). 
22569
22570         (ParameterReference::DoResolve): Compute the real index for the
22571         argument based on whether the method takes or not a `this' pointer
22572         (ie, the method is static).
22573
22574         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
22575         value types returned from functions when we need to invoke a
22576         method on the sturcture.
22577
22578
22579 2001-10-11  Ravi Pratap  <ravi@ximian.com>
22580
22581         * class.cs (TypeContainer::DefineType): Method to actually do the business of
22582         defining the type in the Modulebuilder or Typebuilder. This is to take
22583         care of nested types which need to be defined on the TypeBuilder using
22584         DefineNestedMethod.
22585
22586         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
22587         methods in RootContext, only ported to be part of TypeContainer.
22588
22589         (TypeContainer::GetInterfaceOrClass): Ditto.
22590
22591         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
22592
22593         * interface.cs (Interface::DefineInterface): New method. Does exactly
22594         what RootContext.CreateInterface did earlier, only it takes care of nested types 
22595         too.
22596
22597         (Interface::GetInterfaces): Move from RootContext here and port.
22598
22599         (Interface::GetInterfaceByName): Same here.
22600
22601         * rootcontext.cs (ResolveTree): Re-write.
22602
22603         (PopulateTypes): Re-write.
22604
22605         * class.cs (TypeContainer::Populate): Populate nested types too.
22606         (TypeContainer::Emit): Emit nested members too.
22607
22608         * typemanager.cs (AddUserType): Do not make use of the FullName property,
22609         instead just use the name argument passed in as it is already fully
22610         qualified.
22611
22612         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
22613         to TypeContainer mapping to see if a type is user-defined.
22614
22615         * class.cs (TypeContainer::CloseType): Implement. 
22616
22617         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
22618         the default constructor.
22619
22620         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
22621         twice.
22622
22623         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
22624
22625         * interface.cs (CloseType): Create the type here.
22626
22627         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
22628         the hierarchy.
22629
22630         Remove all the methods which are now in TypeContainer.
22631
22632 2001-10-10  Ravi Pratap  <ravi@ximian.com>
22633
22634         * delegate.cs (Define): Re-write bits to define the delegate
22635         correctly.
22636
22637 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
22638
22639         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
22640
22641         * expression.cs (ImplicitReferenceConversion): handle null as well
22642         as a source to convert to any reference type.
22643
22644         * statement.cs (Return): Perform any implicit conversions to
22645         expected return type.  
22646
22647         Validate use of return statement.  
22648
22649         * codegen.cs (EmitContext): Pass the expected return type here.
22650
22651         * class.cs (Method, Constructor, Property): Pass expected return
22652         type to EmitContext.
22653
22654 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
22655
22656         * expression.cs: Make DoResolve take an EmitContext instead of a
22657         TypeContainer.
22658
22659         Replaced `l' and `location' for `loc', for consistency.
22660
22661         (Error, Warning): Remove unneeded Tc argument.
22662
22663         * assign.cs, literal.cs, constant.cs: Update to new calling
22664         convention. 
22665
22666         * codegen.cs: EmitContext now contains a flag indicating whether
22667         code is being generated in a static method or not.
22668
22669         * cs-parser.jay: DecomposeQI, new function that replaces the old
22670         QualifiedIdentifier.  Now we always decompose the assembled
22671         strings from qualified_identifier productions into a group of
22672         memberaccesses.
22673
22674 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
22675
22676         * rootcontext.cs: Deal with field-less struct types correctly now
22677         by passing the size option to Define Type.
22678
22679         * class.cs: Removed hack that created one static field. 
22680
22681 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
22682
22683         * statement.cs: Moved most of the code generation here. 
22684
22685 2001-10-09  Ravi Pratap  <ravi@ximian.com>
22686
22687         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
22688         seem very right.
22689
22690         (ElementAccess): Remove useless bits for now - keep checks as the spec
22691         says.
22692
22693 2001-10-08  Ravi Pratap  <ravi@ximian.com>
22694
22695         * expression.cs (ElementAccess::DoResolve): Remove my crap code
22696         and start performing checks according to the spec.
22697
22698 2001-10-07  Ravi Pratap  <ravi@ximian.com>
22699
22700         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
22701         rank_specifiers instead.
22702
22703         (rank_specifiers): Change the order in which the rank specifiers are stored
22704
22705         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
22706
22707         * expression.cs (ElementAccess): Implement the LValue interface too.
22708
22709 2001-10-06  Ravi Pratap  <ravi@ximian.com>
22710
22711         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
22712         except that user defined conversions are not included.
22713
22714         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
22715         perform the conversion of the return type, if necessary.
22716
22717         (New::DoResolve): Check whether we are creating an array or an object
22718         and accordingly do the needful.
22719
22720         (New::Emit): Same here.
22721
22722         (New::DoResolve): Implement guts of array creation.
22723
22724         (New::FormLookupType): Helper function.
22725
22726 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
22727
22728         * codegen.cs: Removed most of the code generation here, and move the
22729         corresponding code generation bits to the statement classes. 
22730
22731         Added support for try/catch/finalize and throw.
22732
22733         * cs-parser.jay: Added support for try/catch/finalize.
22734
22735         * class.cs: Catch static methods having the flags override,
22736         virtual or abstract.
22737
22738         * expression.cs (UserCast): This user cast was not really doing
22739         what it was supposed to do.  Which is to be born in fully resolved
22740         state.  Parts of the resolution were being performed at Emit time! 
22741
22742         Fixed this code.
22743
22744 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
22745
22746         * expression.cs: Implicity convert the result from UserCast.
22747
22748 2001-10-05  Ravi Pratap  <ravi@ximian.com>
22749
22750         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
22751         prevented it from working correctly. 
22752
22753         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
22754         merely ConvertImplicit.
22755
22756 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
22757
22758         * typemanager.cs: Make the LookupTypeContainer function static,
22759         and not per-instance.  
22760
22761         * class.cs: Make static FindMembers (the one that takes a Type
22762         argument). 
22763
22764         * codegen.cs: Add EmitForeach here.
22765
22766         * cs-parser.jay: Make foreach a toplevel object instead of the
22767         inline expansion, as we need to perform semantic analysis on it. 
22768
22769 2001-10-05  Ravi Pratap  <ravi@ximian.com>
22770
22771         * expression.cs (Expression::ImplicitUserConversion): Rename to
22772         UserDefinedConversion.
22773
22774         (Expression::UserDefinedConversion): Take an extra argument specifying 
22775         whether we look for explicit user conversions too.
22776
22777         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
22778
22779         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
22780
22781         (ExplicitUserConversion): Make it a call to UserDefinedConversion
22782         with the appropriate arguments.
22783
22784         * cs-parser.jay (cast_expression): Record location too.
22785
22786         * expression.cs (Cast): Record location info.
22787
22788         (Expression::ConvertExplicit): Take location argument.
22789
22790         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
22791         to determine if we are doing explicit conversions.
22792
22793         (UserCast::Emit): Update accordingly.
22794
22795         (Expression::ConvertExplicit): Report an error if everything fails.
22796
22797         * ../errors/cs0030.cs : Add.
22798
22799 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
22800
22801         * modifiers.cs: If the ABSTRACT keyword is present, also set the
22802         virtual and newslot bits. 
22803
22804         * class.cs (TypeContainer::RegisterRequiredImplementations):
22805         Record methods we need.
22806
22807         (TypeContainer::MakeKey): Helper function to make keys for
22808         MethodBases, since the Methodbase key is useless.
22809
22810         (TypeContainer::Populate): Call RegisterRequiredImplementations
22811         before defining the methods.   
22812
22813         Create a mapping for method_builders_to_methods ahead of time
22814         instead of inside a tight loop.
22815
22816         (::RequireMethods):  Accept an object as the data to set into the
22817         hashtable so we can report interface vs abstract method mismatch.
22818
22819 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
22820
22821         * report.cs: Make all of it static.
22822
22823         * rootcontext.cs: Drop object_type and value_type computations, as
22824         we have those in the TypeManager anyways.
22825
22826         Drop report instance variable too, now it is a global.
22827
22828         * driver.cs: Use try/catch on command line handling.
22829
22830         Add --probe option to debug the error reporting system with a test
22831         suite. 
22832
22833         * report.cs: Add support for exiting program when a probe
22834         condition is reached.
22835
22836 2001-10-03  Ravi Pratap  <ravi@ximian.com>
22837
22838         * expression.cs (Binary::DoNumericPromotions): Fix the case when
22839         we do a forcible conversion regardless of type, to check if 
22840         ForceConversion returns a null.
22841
22842         (Binary::error19): Use location to report error.
22843
22844         (Unary::error23): Use location here too.
22845
22846         * ../errors/cs0019.cs : Check in.
22847
22848         * ../errors/cs0023.cs : Check in.
22849
22850         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
22851         case of a non-null MethodInfo object with a length of 0 !
22852
22853         (Binary::ResolveOperator): Flag error if overload resolution fails to find
22854         an applicable member - according to the spec :-)
22855         Also fix logic to find members in base types.
22856
22857         (Unary::ResolveOperator): Same here.
22858
22859         (Unary::report23): Change name to error23 and make first argument a TypeContainer
22860         as I was getting thoroughly confused between this and error19 :-)
22861
22862         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
22863         (::FindMostEncompassedType): Implement.
22864         (::FindMostEncompassingType): Implement.
22865         (::StandardConversionExists): Implement.
22866
22867         (UserImplicitCast): Re-vamp. We now need info about most specific
22868         source and target types so that we can do the necessary conversions.
22869
22870         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
22871         mathematical union with no duplicates.
22872
22873 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
22874
22875         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
22876         in order from base classes to child classes, so that we can in
22877         child classes look up in our parent for method names and
22878         attributes (required for handling abstract, virtual, new, override
22879         constructs: we need to instrospect our base class, and if we dont
22880         populate the classes in order, the introspection might be
22881         incorrect.  For example, a method could query its parent before
22882         the parent has any methods and would determine that the parent has
22883         no abstract methods (while it could have had them)).
22884
22885         (RootContext::CreateType): Record the order in which we define the
22886         classes.
22887
22888 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
22889
22890         * class.cs (TypeContainer::Populate): Also method definitions can
22891         fail now, keep track of this.
22892
22893         (TypeContainer::FindMembers): Implement support for
22894         DeclaredOnly/noDeclaredOnly flag.
22895
22896         (Constructor::Emit) Return the ConstructorBuilder.
22897
22898         (Method::Emit) Return the MethodBuilder. 
22899         Check for abstract or virtual methods to be public.
22900
22901         * rootcontext.cs (RootContext::CreateType): Register all the
22902         abstract methods required for the class to be complete and the
22903         interface methods that must be implemented. 
22904
22905         * cs-parser.jay: Report error 501 (method requires body if it is
22906         not marked abstract or extern).
22907
22908         * expression.cs (TypeOf::Emit): Implement.
22909
22910         * typemanager.cs: runtime_handle_type, new global type.
22911
22912         * class.cs (Property::Emit): Generate code for properties.
22913
22914 2001-10-02  Ravi Pratap  <ravi@ximian.com>
22915
22916         * expression.cs (Unary::ResolveOperator): Find operators on base type
22917         too - we now conform exactly to the spec.
22918
22919         (Binary::ResolveOperator): Same here.
22920
22921         * class.cs (Operator::Define): Fix minor quirk in the tests.
22922
22923         * ../errors/cs0215.cs : Added.
22924
22925         * ../errors/cs0556.cs : Added.
22926
22927         * ../errors/cs0555.cs : Added.
22928
22929 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
22930
22931         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
22932         single integer which is really efficient
22933
22934 2001-10-01  Ravi Pratap  <ravi@ximian.com>
22935
22936         *  expression.cs (Expression::ImplicitUserConversion): Use location
22937         even in the case when we are examining True operators.
22938  
22939         * class.cs (Operator::Define): Perform extensive checks to conform
22940         with the rules for operator overloading in the spec.
22941
22942         * expression.cs (Expression::ImplicitReferenceConversion): Implement
22943         some of the other conversions mentioned in the spec.
22944
22945         * typemanager.cs (array_type): New static member for the System.Array built-in
22946         type.
22947
22948         (cloneable_interface): For System.ICloneable interface.
22949
22950         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
22951         we start resolving the tree and populating types.
22952
22953         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
22954  
22955 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
22956
22957         * expression.cs (Expression::ExprClassFromMemberInfo,
22958         Expression::Literalize): Create literal expressions from
22959         FieldInfos which are literals.
22960
22961         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
22962         type casts, because they were wrong.  The test suite in tests
22963         caught these ones.
22964
22965         (ImplicitNumericConversion): ushort to ulong requires a widening
22966         cast. 
22967
22968         Int32 constant to long requires widening cast as well.
22969
22970         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
22971         for integers because the type on the stack is not i4.
22972
22973 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
22974
22975         * expression.cs (report118): require location argument. 
22976
22977         * parameter.cs: Do not dereference potential null value.
22978
22979         * class.cs: Catch methods that lack the `new' keyword when
22980         overriding a name.  Report warnings when `new' is used without
22981         anything being there to override.
22982
22983         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
22984
22985         * class.cs: Only add constructor to hashtable if it is non-null
22986         (as now constructors can fail on define).
22987
22988         (TypeManager, Class, Struct): Take location arguments.
22989
22990         Catch field instance initialization in structs as errors.
22991
22992         accepting_filter: a new filter for FindMembers that is static so
22993         that we dont create an instance per invocation.
22994
22995         (Constructor::Define): Catch errors where a struct constructor is
22996         parameterless 
22997
22998         * cs-parser.jay: Pass location information for various new
22999         constructs. 
23000
23001         * delegate.cs (Delegate): take a location argument.
23002
23003         * driver.cs: Do not call EmitCode if there were problesm in the
23004         Definition of the types, as many Builders wont be there. 
23005
23006         * decl.cs (Decl::Decl): Require a location argument.
23007
23008         * cs-tokenizer.cs: Handle properly hex constants that can not fit
23009         into integers, and find the most appropiate integer for it.
23010
23011         * literal.cs: Implement ULongLiteral.
23012
23013         * rootcontext.cs: Provide better information about the location of
23014         failure when CreateType fails.
23015
23016 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
23017
23018         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23019         as well.
23020
23021         * expression.cs (Binary::CheckShiftArguments): Add missing type
23022         computation.
23023         (Binary::ResolveOperator): Add type to the logical and and logical
23024         or, Bitwise And/Or and Exclusive Or code paths, it was missing
23025         before.
23026
23027         (Binary::DoNumericPromotions): In the case where either argument
23028         is ulong (and most signed types combined with ulong cause an
23029         error) perform implicit integer constant conversions as well.
23030
23031 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23032
23033         * expression.cs (UserImplicitCast): Method should always be
23034         non-null. 
23035         (Invocation::BetterConversion): Simplified test for IntLiteral.
23036
23037         (Expression::ImplicitNumericConversion): Split this routine out.
23038         Put the code that performs implicit constant integer conversions
23039         here. 
23040
23041         (Expression::Resolve): Become a wrapper around DoResolve so we can
23042         check eclass and type being set after resolve.
23043
23044         (Invocation::Badness): Remove this dead function
23045
23046         (Binary::ResolveOperator): Do not compute the expensive argumnets
23047         unless we have a union for it.
23048
23049         (Probe::Emit): Is needs to do an isinst and then
23050         compare against null.
23051
23052         (::CanConvert): Added Location argument.  If the Location argument
23053         is null (Location.Null), then we do not report errors.  This is
23054         used by the `probe' mechanism of the Explicit conversion.  We do
23055         not want to generate an error for something that the user
23056         explicitly requested to be casted.  But the pipeline for an
23057         explicit cast first tests for potential implicit casts.
23058
23059         So for now, if the Location is null, it means `Probe only' to
23060         avoid adding another argument.   Might have to revise this
23061         strategy later.
23062
23063         (ClassCast): New class used to type cast objects into arbitrary
23064         classes (used in Explicit Reference Conversions).
23065
23066         Implement `as' as well.
23067
23068         Reverted all the patches from Ravi below: they were broken:
23069
23070                 * The use of `level' as a mechanism to stop recursive
23071                   invocations is wrong.  That was there just to catch the
23072                   bug with a strack trace but not as a way of addressing
23073                   the problem.
23074
23075                   To fix the problem we have to *understand* what is going
23076                   on and the interactions and come up with a plan, not
23077                   just get things going.
23078
23079                 * The use of the type conversion cache that I proposed
23080                   last night had an open topic: How does this work across
23081                   protection domains.  A user defined conversion might not
23082                   be public in the location where we are applying the
23083                   conversion, a different conversion might be selected
23084                   (ie, private A->B (better) but public B->A (worse),
23085                   inside A, A->B applies, but outside it, B->A will
23086                   apply).
23087
23088                 * On top of that (ie, even if the above is solved),
23089                   conversions in a cache need to be abstract.  Ie, `To
23090                   convert from an Int to a Short use an OpcodeCast', not
23091                   `To convert from an Int to a Short use the OpcodeCast on
23092                   the variable 5' (which is what this patch was doing).
23093
23094 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23095
23096         * expression.cs (Invocation::ConversionExists): Re-write to use
23097         the conversion cache
23098
23099         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23100         cache all conversions done, not just user-defined ones.
23101
23102         (Invocation::BetterConversion): The real culprit. Use ConversionExists
23103         to determine if a conversion exists instead of acutually trying to 
23104         perform the conversion. It's faster too.
23105
23106         (Expression::ConvertExplicit): Modify to use ConversionExists to check
23107         and only then attempt the implicit conversion.
23108
23109 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23110
23111         * expression.cs (ConvertImplicit): Use a cache for conversions
23112         already found. Check level of recursion and bail out if necessary.
23113
23114 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23115
23116         * typemanager.cs (string_concat_string_string, string_concat_object_object):
23117         Export standard methods that we expect for string operations.
23118
23119         * statement.cs (Block::UsageWarning): Track usage of variables and
23120         report the errors for not used variables.
23121
23122         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23123         operator. 
23124
23125 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23126
23127         * codegen.cs: remove unnneded code 
23128
23129         * expression.cs: Removed BuiltinTypeAccess class
23130
23131         Fix the order in which implicit conversions are
23132         done.  
23133
23134         The previous fixed dropped support for boxed conversions (adding a
23135         test to the test suite now)
23136
23137         (UserImplicitCast::CanConvert): Remove test for source being null,
23138         that code is broken.  We should not feed a null to begin with, if
23139         we do, then we should track the bug where the problem originates
23140         and not try to cover it up here.
23141
23142         Return a resolved expression of type UserImplicitCast on success
23143         rather than true/false.  Ravi: this is what I was talking about,
23144         the pattern is to use a static method as a "constructor" for
23145         objects. 
23146
23147         Also, do not create arguments until the very last minute,
23148         otherwise we always create the arguments even for lookups that
23149         will never be performed. 
23150
23151         (UserImplicitCast::Resolve): Eliminate, objects of type
23152         UserImplicitCast are born in a fully resolved state. 
23153
23154         * typemanager.cs (InitCoreTypes): Init also value_type
23155         (System.ValueType). 
23156
23157         * expression.cs (Cast::Resolve): First resolve the child expression.
23158
23159         (LValue): Add new method AddressOf to be used by
23160         the `&' operator.  
23161
23162         Change the argument of Store to take an EmitContext instead of an
23163         ILGenerator, because things like FieldExpr need to be able to call
23164         their children expression to generate the instance code. 
23165
23166         (Expression::Error, Expression::Warning): Sugar functions for
23167         reporting errors.
23168
23169         (Expression::MemberLookup): Accept a TypeContainer instead of a
23170         Report as the first argument.
23171
23172         (Expression::ResolvePrimary): Killed.  I still want to improve
23173         this as currently the code is just not right.
23174
23175         (Expression::ResolveMemberAccess): Simplify, but it is still
23176         wrong. 
23177
23178         (Unary::Resolve): Catch errors in AddressOf operators.
23179
23180         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23181         index to a byte for the short-version, or the compiler will choose
23182         the wrong Emit call, which generates the wrong data.
23183
23184         (ParameterReference::Emit, ::Store): same.
23185
23186         (FieldExpr::AddressOf): Implement.
23187
23188         * typemanager.cs: TypeManager: made public variable instead of
23189         property.
23190
23191         * driver.cs: document --fatal.
23192
23193         * report.cs (ErrorMessage, WarningMessage): new names for the old
23194         Error and Warning classes.
23195
23196         * cs-parser.jay (member_access): Turn built-in access to types
23197         into a normal simplename
23198
23199 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23200
23201         * expression.cs (Invocation::BetterConversion): Fix to cope
23202         with q being null, since this was introducing a bug.
23203
23204         * expression.cs (ConvertImplicit): Do built-in conversions first.
23205
23206 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23207
23208         * expression.cs (UserImplicitCast::Resolve): Fix bug.
23209
23210 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23211
23212         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23213         I had introduced long ago (what's new ?).
23214
23215         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
23216         the work of all the checking. 
23217         (ConvertImplicit): Call CanConvert and only then create object if necessary.
23218         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23219
23220         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23221         that is the right way. 
23222
23223         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
23224         overloading resolution. Use everywhere instead of cutting and pasting code.
23225
23226         (Binary::ResolveOperator): Use MakeUnionSet.
23227
23228         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
23229         we have to convert to bool types. Not complete yet.
23230
23231 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23232
23233         * typemanager.cs (TypeManager::CSharpName): support ushort.
23234
23235         * expression.cs (Expression::TryImplicitIntConversion): Attempts
23236         to provide an expression that performsn an implicit constant int
23237         conversion (section 6.1.6).
23238         (Expression::ConvertImplicitRequired): Reworked to include
23239         implicit constant expression conversions.
23240
23241         (Expression::ConvertNumericExplicit): Finished.
23242
23243         (Invocation::Emit): If InstanceExpression is null, then it means
23244         that we perform a call on this.
23245
23246 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23247
23248         * expression.cs (Unary::Emit): Remove some dead code.
23249         (Probe): Implement Resolve and Emit for `is'.
23250         (Expression::ConvertImplicitRequired): Attempt to do constant
23251         expression conversions here.  Maybe should be moved to
23252         ConvertImplicit, but I am not sure.
23253         (Expression::ImplicitLongConstantConversionPossible,
23254         Expression::ImplicitIntConstantConversionPossible): New functions
23255         that tell whether is it possible to apply an implicit constant
23256         expression conversion.
23257
23258         (ConvertNumericExplicit): Started work on explicit numeric
23259         conversions.
23260
23261         * cs-parser.jay: Update operator constants.
23262
23263         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23264         (Parameters::GetSignature): Hook up VerifyArgs here.
23265         (Parameters::VerifyArgs): Verifies that no two arguments have the
23266         same name. 
23267
23268         * class.cs (Operator): Update the operator names to reflect the
23269         ones that the spec expects (as we are just stringizing the
23270         operator names).
23271
23272         * expression.cs (Unary::ResolveOperator): Fix bug: Use
23273         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23274         previous usage did only work for our methods.
23275         (Expression::ConvertImplicit): Handle decimal implicit numeric
23276         conversions as well.
23277         (Expression::InternalTypeConstructor): Used to invoke constructors
23278         on internal types for default promotions.
23279
23280         (Unary::Emit): Implement special handling for the pre/post
23281         increment/decrement for overloaded operators, as they need to have
23282         the same semantics as the other operators.
23283
23284         (Binary::ResolveOperator): ditto.
23285         (Invocation::ConversionExists): ditto.
23286         (UserImplicitCast::Resolve): ditto.
23287
23288 2001-09-26  Ravi Pratap  <ravi@ximian.com>
23289
23290         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23291         operator, return after emitting body. Regression tests pass again !
23292
23293         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23294         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23295         (Invocation::OverloadResolve): Ditto.
23296         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23297
23298         * everywhere : update calls to the above methods accordingly.
23299
23300 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23301
23302         * assign.cs (Assign): Make it inherit from ExpressionStatement.
23303
23304         * expression.cs (ExpressionStatement): New base class used for
23305         expressions that can appear in statements, so that we can provide
23306         an alternate path to generate expression that do not leave a value
23307         on the stack.
23308
23309         (Expression::Emit, and all the derivatives): We no longer return
23310         whether a value is left on the stack or not.  Every expression
23311         after being emitted leaves a single value on the stack.
23312
23313         * codegen.cs (EmitContext::EmitStatementExpression): Use the
23314         facilties of ExpressionStatement if possible.
23315
23316         * cs-parser.jay: Update statement_expression.
23317
23318 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
23319
23320         * driver.cs: Change the wording of message
23321
23322 2001-09-25  Ravi Pratap  <ravi@ximian.com>
23323
23324         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
23325         the type of the expression to the return type of the method if
23326         we have an overloaded operator match ! The regression tests pass again !
23327         (Unary::ResolveOperator): Ditto.
23328
23329         * expression.cs (Invocation::ConversionExists): Correct the member lookup
23330         to find "op_Implicit", not "implicit" ;-)
23331         (UserImplicitCast): New class to take care of user-defined implicit conversions.
23332         (ConvertImplicit, ForceConversion): Take TypeContainer argument
23333
23334         * everywhere : Correct calls to the above accordingly.
23335
23336         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
23337         (ConvertImplicit): Do user-defined conversion if it exists.
23338
23339 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
23340
23341         * assign.cs: track location.
23342         (Resolve): Use implicit conversions on assignment.
23343
23344         * literal.cs: Oops.  Not good, Emit of short access values should
23345         pass (Bytes) or the wrong argument will be selected.
23346
23347         * expression.cs (Unary::Emit): Emit code for -expr.
23348
23349         (Unary::ResolveOperator): Handle `Substract' for non-constants
23350         (substract from zero from the non-constants).
23351         Deal with Doubles as well. 
23352
23353         (Expression::ConvertImplicitRequired): New routine that reports an
23354         error if no implicit conversion exists. 
23355
23356         (Invocation::OverloadResolve): Store the converted implicit
23357         expressions if we make them
23358
23359 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23360
23361         * class.cs (ConstructorInitializer): Take a Location argument.
23362         (ConstructorBaseInitializer): Same here.
23363         (ConstructorThisInitializer): Same here.
23364
23365         * cs-parser.jay : Update all calls accordingly.
23366
23367         * expression.cs (Unary, Binary, New): Take location argument.
23368         Update accordingly everywhere.
23369
23370         * cs-parser.jay : Update all calls to the above to take a location
23371         argument.
23372
23373         * class.cs : Ditto.
23374
23375 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23376
23377         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
23378         (Invocation::BetterConversion): Same here
23379         (Invocation::ConversionExists): Ditto.
23380
23381         (Invocation::ConversionExists): Implement.
23382
23383 2001-09-22  Ravi Pratap  <ravi@ximian.com>
23384
23385         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
23386         Also take an additional TypeContainer argument.
23387
23388         * All over : Pass in TypeContainer as argument to OverloadResolve.
23389
23390         * typemanager.cs (CSharpName): Update to check for the string type and return
23391         that too.
23392
23393         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
23394         a given method.
23395
23396 2001-09-21  Ravi Pratap  <ravi@ximian.com>
23397
23398         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
23399         (Invocation::BetterFunction): Implement.
23400         (Invocation::BetterConversion): Implement.
23401         (Invocation::ConversionExists): Skeleton, no implementation yet.
23402
23403         Okay, things work fine !
23404
23405 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
23406
23407         * typemanager.cs: declare and load enum_type, delegate_type and
23408         void_type. 
23409
23410         * expression.cs (Expression::Emit): Now emit returns a value that
23411         tells whether a value is left on the stack or not.  This strategy
23412         might be reveted tomorrow with a mechanism that would address
23413         multiple assignments.
23414         (Expression::report118): Utility routine to report mismatches on
23415         the ExprClass.
23416
23417         (Unary::Report23): Report impossible type/operator combination
23418         utility function.
23419
23420         (Unary::IsIncrementableNumber): Whether the type can be
23421         incremented or decremented with add.
23422         (Unary::ResolveOperator): Also allow enumerations to be bitwise
23423         complemented. 
23424         (Unary::ResolveOperator): Implement ++, !, ~,
23425
23426         (Invocation::Emit): Deal with new Emit convetion.
23427
23428         * All Expression derivatives: Updated their Emit method to return
23429         whether they leave values on the stack or not.
23430
23431         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
23432         stack for expressions that are statements. 
23433
23434 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
23435
23436         * expression.cs (LValue): New interface.  Must be implemented by
23437         LValue objects.
23438         (LocalVariableReference, ParameterReference, FieldExpr): Implement
23439         LValue interface.
23440
23441         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
23442         interface for generating code, simplifies the code.
23443
23444 2001-09-20  Ravi Pratap  <ravi@ximian.com>
23445
23446         * expression.cs (everywhere): Comment out return statements in ::Resolve
23447         methods to avoid the warnings.
23448
23449 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
23450
23451         * driver.cs (parse): Report error 2001 if we can not open the
23452         source file.
23453
23454         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
23455         not resolve it.
23456
23457         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
23458         object. 
23459
23460         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
23461         otherwise nested blocks end up with the same index.
23462
23463         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
23464
23465         * expression.cs:  Instead of having FIXMEs in the Resolve
23466         functions, throw exceptions so it is obvious that we are facing a
23467         bug. 
23468
23469         * cs-parser.jay (invocation_expression): Pass Location information.
23470
23471         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
23472         Use a basename for those routines because .NET does not like paths
23473         on them. 
23474
23475         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
23476         already defined.
23477
23478 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
23479
23480         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
23481         are loading the correct data types (throws an exception if not).
23482         (TypeManager::InitCoreTypes): Use CoreLookupType
23483
23484         * expression.cs (Unary::ResolveOperator): return the child
23485         expression for expressions which are just +expr.
23486         (Unary::ResolveOperator): Return negative literals for -LITERAL
23487         expressions (otherwise they are Unary {Literal}).
23488         (Invocation::Badness): Take into account `Implicit constant
23489         expression conversions'.
23490
23491         * literal.cs (LongLiteral): Implement long literal class.
23492         (IntLiteral): export the `Value' of the intliteral. 
23493
23494 2001-09-19  Ravi Pratap  <ravi@ximian.com>
23495
23496         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
23497
23498         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
23499         instead of 'Operator'
23500
23501         * expression.cs (Binary::ResolveOperator): Update accordingly.
23502         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
23503         and 'Minus'
23504
23505         * cs-parser.jay (unary_expression): Update to use the new names.
23506
23507         * gen-treedump.cs (GetUnary): Same here.
23508
23509         * expression.cs (Unary::Resolve): Implement.
23510         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
23511         operators are found instead of making noise ;-)
23512         (Unary::ResolveOperator): New method to do precisely the same thing which
23513         Binary::ResolveOperator does for Binary expressions.
23514         (Unary.method, .Arguments): Add.
23515         (Unary::OperName): Implement.   
23516         (Unary::ForceConversion): Copy and Paste !
23517
23518         * class.cs (Operator::Define): Fix a small bug for the case when we have 
23519         a unary operator.
23520
23521         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
23522         for the inbuilt operators. Only overloading works for now ;-)
23523
23524 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
23525
23526         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
23527         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
23528
23529         * expression.cs (This::Emit): Implement. 
23530         (This::Resolve): Implement.
23531         (TypeOf:Resolve): Implement.
23532         (Expression::ResolveSimpleName): Add an implicit this to instance
23533         field references. 
23534         (MemberAccess::Resolve): Deal with Parameters and Fields. 
23535         Bind instance variable to Field expressions.
23536         (FieldExpr::Instance): New field used to track the expression that
23537         represents the object instance.
23538         (FieldExpr::Resolve): Track potential errors from MemberLookup not
23539         binding 
23540         (FieldExpr::Emit): Implement.
23541
23542         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
23543         the last instruction contains a return opcode to avoid generating
23544         the last `ret' instruction (this generates correct code, and it is
23545         nice to pass the peverify output).
23546
23547         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
23548         initializer for static and instance variables.
23549         (Constructor::Emit): Allow initializer to be null in the case of
23550         static constructors.  Only emit initializer for instance
23551         constructors. 
23552
23553         (TypeContainer::FindMembers): Return a null array if there are no
23554         matches.
23555
23556         Also fix the code for the MemberTypes.Method branch, as it was not
23557         scanning that for operators (or tried to access null variables before).
23558
23559         * assign.cs (Assign::Emit): Handle instance and static fields. 
23560
23561         * TODO: Updated.
23562
23563         * driver.cs: Stop compilation if there are parse errors.
23564
23565         * cs-parser.jay (constructor_declaration): Provide default base
23566         initializer for non-static constructors.
23567         (constructor_declarator): Do not provide a default base
23568         initializers if none was specified.
23569         Catch the fact that constructors should not have parameters.
23570
23571         * class.cs: Do not emit parent class initializers for static
23572         constructors, that should be flagged as an error.
23573
23574 2001-09-18  Ravi Pratap  <ravi@ximian.com>
23575
23576         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
23577         Move back code into TypeContainer::Populate.
23578
23579 2001-09-18  Ravi Pratap  <ravi@ximian.com>
23580
23581         * class.cs (TypeContainer::AddConstructor): Fix the check to
23582         compare against Name, not Basename. 
23583         (Operator::OpType): Change Plus and Minus to Add and Subtract.
23584
23585         * cs-parser.jay : Update accordingly.
23586
23587         * class.cs (TypeContainer::FindMembers): For the case where we are searching
23588         for methods, don't forget to look into the operators too.
23589         (RegisterMethodBuilder): Helper method to take care of this for
23590         methods, constructors and operators.
23591         (Operator::Define): Completely revamp.
23592         (Operator.OperatorMethod, MethodName): New fields.
23593         (TypeContainer::Populate): Move the registering of builders into
23594         RegisterMethodBuilder.
23595         (Operator::Emit): Re-write.
23596
23597         * expression.cs (Binary::Emit): Comment out code path to emit method
23598         invocation stuff for the case when we have a user defined operator. I am
23599         just not able to get it right !
23600
23601 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
23602
23603         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
23604         argument. 
23605
23606         (Expression::MemberLookup): Provide a version that allows to
23607         specify the MemberTypes and BindingFlags. 
23608
23609         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
23610         so it was not fetching variable information from outer blocks.
23611
23612         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
23613         Beforefieldinit as it was buggy.
23614
23615         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
23616         that Ravi put here.  
23617
23618         * class.cs (Constructor::Emit): Only emit if block is not null.
23619         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
23620         deal with this by semantically definining it as if the user had
23621         done it.
23622
23623         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
23624         constructors as we now "emit" them at a higher level.
23625
23626         (TypeContainer::DefineDefaultConstructor): Used to define the
23627         default constructors if none was provided.
23628
23629         (ConstructorInitializer): Add methods Resolve and Emit. 
23630
23631         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
23632
23633 2001-09-17  Ravi Pratap  <ravi@ximian.com>
23634
23635         * class.cs (TypeContainer::EmitDefaultConstructor): Register
23636         the default constructor builder with our hashtable for methodbuilders
23637         to methodcores.
23638
23639         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
23640         and argument_count is 0 in which case we have a match.
23641         (Binary::ResolveOperator): More null checking and miscellaneous coding
23642         style cleanup.
23643
23644 2001-09-17  Ravi Pratap  <ravi@ximian.com>
23645
23646         * rootcontext.cs (IsNameSpace): Compare against null.
23647
23648         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
23649
23650         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
23651         and Unary::Operator.
23652
23653         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
23654         accordingly.
23655
23656         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
23657         we have overloaded operators.
23658         (Binary::ResolveOperator): Implement the part which does the operator overload
23659         resolution.
23660
23661         * class.cs (Operator::Emit): Implement.
23662         (TypeContainer::Emit): Emit the operators we have too.
23663
23664         * expression.cs (Binary::Emit): Update to emit the appropriate code for
23665         the case when we have a user-defined operator.
23666
23667 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
23668
23669         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
23670
23671 2001-09-16  Ravi Pratap  <ravi@ximian.com>
23672
23673         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
23674         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
23675         (Constructor::Emit): Implement.
23676         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
23677         if we have no work to do. 
23678         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
23679         Emit method.
23680
23681         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
23682         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
23683
23684         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
23685         of parent.parent.
23686
23687 2001-09-15  Ravi Pratap  <ravi@ximian.com>
23688
23689         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
23690         in the source.
23691         (Tree::RecordNamespace): Method to do what the name says ;-)
23692         (Tree::Namespaces): Property to get at the namespaces hashtable.
23693
23694         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
23695         keep track.
23696
23697         * rootcontext.cs (IsNamespace): Fixed it :-)
23698
23699 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
23700
23701         * class.cs (TypeContainer::FindMembers): Add support for
23702         constructors. 
23703         (MethodCore): New class that encapsulates both the shared aspects
23704         of a Constructor and a Method.  
23705         (Method, Constructor): Factored pieces into MethodCore.
23706
23707         * driver.cs: Added --fatal which makes errors throw exceptions.
23708         Load System assembly as well as part of the standard library.
23709
23710         * report.cs: Allow throwing exceptions on errors for debugging.
23711
23712         * modifiers.cs: Do not use `parent', instead use the real type
23713         container to evaluate permission settings.
23714
23715         * class.cs: Put Ravi's patch back in.  He is right, and we will
23716         have to cope with the
23717
23718 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23719
23720         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
23721         FamORAssem, not FamANDAssem.
23722
23723 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
23724
23725         * driver.cs: Added --parse option that only parses its input files
23726         and terminates.
23727
23728         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
23729         incorrect.  IsTopLevel is not used to tell whether an object is
23730         root_types or not (that can be achieved by testing this ==
23731         root_types).  But to see if this is a top-level *class* (not
23732         necessarly our "toplevel" container). 
23733
23734 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23735
23736         * enum.cs (Enum::Define): Modify to call the Lookup method on the
23737         parent instead of a direct call to GetType.
23738
23739 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23740
23741         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
23742         Modifiers.TypeAttr. This should just be a call to that method.
23743
23744         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
23745         object so that we can determine if we are top-level or not.
23746
23747         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
23748         TypeContainer too.
23749
23750         * enum.cs (Enum::Define): Ditto.
23751
23752         * modifiers.cs (FieldAttr): Re-write.
23753
23754         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
23755         (TypeContainer::HaveStaticConstructor): New property to provide access
23756         to precisely that info.
23757
23758         * modifiers.cs (MethodAttr): Re-write.
23759         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
23760
23761         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
23762         of top-level types as claimed.
23763
23764 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
23765
23766         * expression.cs (MemberLookup): Fruitless attempt to lookup
23767         constructors.  Maybe I need to emit default constructors?  That
23768         might be it (currently .NET emits this for me automatically).
23769         (Invocation::OverloadResolve): Cope with Arguments == null.
23770         (Invocation::EmitArguments): new function, shared by the new
23771         constructor and us.
23772         (Invocation::Emit): Handle static and instance methods.  Emit
23773         proper call instruction for virtual or non-virtual invocations.
23774         (New::Emit): Implement.
23775         (New::Resolve): Implement.
23776         (MemberAccess:Resolve): Implement.
23777         (MethodGroupExpr::InstanceExpression): used conforming to the spec
23778         to track instances.
23779         (FieldExpr::Resolve): Set type.
23780
23781         * support.cs: Handle empty arguments.
23782                 
23783         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
23784         SimpleLookup): Auxiliary routines to help parse a qualifier
23785         identifier.  
23786
23787         Update qualifier_identifier rule.
23788
23789         * codegen.cs: Removed debugging messages.
23790
23791         * class.cs: Make this a global thing, this acts just as a "key" to
23792         objects that we might have around.
23793
23794         (Populate): Only initialize method_builders_to_methods once.
23795
23796         * expression.cs (PropertyExpr): Initialize type from the
23797         PropertyType. 
23798
23799         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
23800         Resolve pattern.  Attempt to implicitly convert value to boolean.
23801         Emit code.
23802
23803         * expression.cs: Set the type for the int32/int32 argument case.
23804         (Binary::ResolveOperator): Set the return type to boolean for
23805         comparission operators
23806
23807         * typemanager.cs: Remove debugging print code.
23808
23809         (Invocation::Resolve): resolve type.
23810
23811         * class.cs: Allocate a MemberInfo of the correct size, as the code
23812         elsewhere depends on the test to reflect the correct contents.
23813
23814         (Method::) Keep track of parameters, due to System.Reflection holes
23815
23816         (TypeContainer::Populate): Keep track of MethodBuilders to Method
23817         mapping here.
23818
23819         (TypeContainer::FindMembers): Use ArrayList and then copy an array
23820         of the exact size and return that.
23821
23822         (Class::LookupMethodByBuilder): New function that maps
23823         MethodBuilders to its methods.  Required to locate the information
23824         on methods because System.Reflection bit us again.
23825
23826         * support.cs: New file, contains an interface ParameterData and
23827         two implementations: ReflectionParameters and InternalParameters
23828         used to access Parameter information.  We will need to grow this
23829         as required.
23830
23831         * expression.cs (Invocation::GetParameterData): implement a cache
23832         and a wrapper around the ParameterData creation for methods. 
23833         (Invocation::OverloadResolve): Use new code.
23834
23835 2001-09-13  Ravi Pratap  <ravi@ximian.com>
23836
23837         * class.cs (TypeContainer::EmitField): Remove and move into 
23838         (Field::Define): here and modify accordingly.
23839         (Field.FieldBuilder): New member.
23840         (TypeContainer::Populate): Update accordingly.
23841         (TypeContainer::FindMembers): Implement.
23842
23843 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
23844
23845         * statement.cs: (VariableInfo::VariableType): New field to be
23846         initialized with the full type once it is resolved. 
23847
23848 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
23849
23850         * parameter.cs (GetParameterInfo): Use a type cache to compute
23851         things only once, and to reuse this information
23852
23853         * expression.cs (LocalVariableReference::Emit): Implement.
23854         (OpcodeCast::Emit): fix.
23855
23856         (ParameterReference::Resolve): Implement.
23857         (ParameterReference::Emit): Implement.
23858
23859         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
23860         that are expressions need to stay as Expressions.
23861
23862         * typemanager.cs (CSharpName): Returns the C# name of a type if
23863         possible. 
23864
23865         * expression.cs (Expression::ConvertImplicit): New function that
23866         implements implicit type conversions.
23867
23868         (Expression::ImplicitReferenceConversion): Implements implicit
23869         reference conversions.
23870
23871         (EmptyCast): New type for transparent casts.
23872
23873         (OpcodeCast): New type for casts of types that are performed with
23874         a sequence of bytecodes.
23875
23876         (BoxedCast): New type used for casting value types into reference
23877         types.  Emits a box opcode.
23878
23879         (Binary::DoNumericPromotions): Implements numeric promotions of
23880         and computation of the Binary::Type.
23881
23882         (Binary::EmitBranchable): Optimization.
23883
23884         (Binary::Emit): Implement code emission for expressions.
23885
23886         * typemanager.cs (TypeManager): Added two new core types: sbyte
23887         and byte.
23888
23889 2001-09-12  Ravi Pratap  <ravi@ximian.com>
23890
23891         * class.cs (TypeContainer::FindMembers): Method which does exactly
23892         what Type.FindMembers does, only we don't have to use reflection. No
23893         implementation yet.
23894
23895         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
23896         typecontainer objects as we need to get at them.
23897         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
23898
23899         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
23900         typecontainer object.
23901
23902         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
23903         of just a Report object.
23904
23905 2001-09-11  Ravi Pratap  <ravi@ximian.com>
23906
23907         * class.cs (Event::Define): Go back to using the prefixes "add_" and
23908         "remove_"
23909         (TypeContainer::Populate): Now define the delegates of the type too.
23910         (TypeContainer.Delegates): Property to access the list of delegates defined
23911         in the type.
23912
23913         * delegates.cs (Delegate::Define): Implement partially.
23914
23915         * modifiers.cs (TypeAttr): Handle more flags.
23916
23917 2001-09-11  Ravi Pratap  <ravi@ximian.com>
23918
23919         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
23920         and not <=
23921         (Operator::Define): Re-write logic to get types by using the LookupType method
23922         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
23923         (Indexer::Define): Ditto.
23924         (Event::Define): Ditto.
23925         (Property::Define): Ditto.
23926
23927 2001-09-10  Ravi Pratap  <ravi@ximian.com>
23928
23929         * class.cs (TypeContainer::Populate): Now define operators too. 
23930         (TypeContainer.Operators): New property to access the list of operators
23931         in a type.
23932         (Operator.OperatorMethodBuilder): New member to hold the method builder
23933         for the operator we are defining.
23934         (Operator::Define): Implement.
23935
23936 2001-09-10  Ravi Pratap  <ravi@ximian.com>
23937
23938         * class.cs (Event::Define): Make the prefixes of the accessor methods
23939         addOn_ and removeOn_ 
23940
23941         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
23942         of the location being passed in too. Ideally, this should go later since all
23943         error reporting should be done through the Report object.
23944
23945         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
23946         (Populate): Iterate thru the indexers we have and define them too.
23947         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
23948         for the get and set accessors.
23949         (Indexer::Define): Implement.
23950
23951 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
23952
23953         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
23954         my previous implementation, did not work.
23955
23956         * typemanager.cs: Add a couple of missing types (the longs).
23957
23958         * literal.cs: Use TypeManager.bool_type instead of getting it.
23959
23960         * expression.cs (EventExpr): New kind of expressions.
23961         (Expressio::ExprClassFromMemberInfo): finish
23962
23963 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
23964
23965         * assign.cs: Emit stores to static fields differently.
23966
23967 2001-09-08  Ravi Pratap  <ravi@ximian.com>
23968
23969         * Merge in changes and adjust code to tackle conflicts. Backed out my
23970         code in Assign::Resolve ;-) 
23971
23972 2001-09-08  Ravi Pratap  <ravi@ximian.com>
23973
23974         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
23975         instead Report.Error and also pass in the location.
23976         (CSharpParser::Lexer): New readonly property to return the reference
23977         to the Tokenizer object.
23978         (declare_local_variables): Use Report.Error with location instead of plain 
23979         old error.
23980         (CheckDef): Ditto.
23981
23982         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
23983         (Operator.CheckBinaryOperator): Ditto.
23984
23985         * cs-parser.jay (operator_declarator): Update accordingly.
23986
23987         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
23988         (CheckBinaryOperator): Same here.
23989
23990         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
23991         on the name without any prefixes of namespace names etc. This is because we
23992         already might have something already fully qualified like 
23993         'System.Console.WriteLine'
23994
23995         * assign.cs (Resolve): Begin implementation. Stuck ;-)
23996
23997 2001-09-07  Ravi Pratap  <ravi@ximian.com>
23998
23999         * cs-tokenizer.cs (location): Return a string which also contains
24000         the file name.
24001
24002         * expression.cs (ElementAccess): New class for expressions of the
24003         type 'element access.'
24004         (BaseAccess): New class for expressions of the type 'base access.'
24005         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
24006         respectively.
24007
24008         * cs-parser.jay (element_access): Implement action.
24009         (base_access): Implement actions.
24010         (checked_expression, unchecked_expression): Implement.
24011
24012         * cs-parser.jay (local_variable_type): Correct and implement.
24013         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24014
24015         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24016
24017         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24018         name and the specifiers.
24019
24020         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24021
24022         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
24023         making them all public ;-)
24024
24025         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24026         class anyways.
24027
24028 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
24029
24030         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24031         PropertyExprs.
24032         (FieldExpr, PropertyExprs): New resolved expressions.
24033         (SimpleName::MemberStaticCheck): Perform static checks for access
24034         to non-static fields on static methods. Maybe this should be
24035         generalized for MemberAccesses. 
24036         (SimpleName::ResolveSimpleName): More work on simple name
24037         resolution. 
24038
24039         * cs-parser.jay (primary_expression/qualified_identifier): track
24040         the parameter index.
24041
24042         * codegen.cs (CodeGen::Save): Catch save exception, report error.
24043         (EmitContext::EmitBoolExpression): Chain to expression generation
24044         instead of temporary hack.
24045         (::EmitStatementExpression): Put generic expression code generation.
24046
24047         * assign.cs (Assign::Emit): Implement variable assignments to
24048         local variables, parameters and fields.
24049
24050 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
24051
24052         * statement.cs (Block::GetVariableInfo): New method, returns the
24053         VariableInfo for a variable name in a block.
24054         (Block::GetVariableType): Implement in terms of GetVariableInfo
24055
24056         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24057         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24058
24059 2001-09-06  Ravi Pratap  <ravi@ximian.com>
24060
24061         * cs-parser.jay (operator_declaration): Continue on my quest : update
24062         to take attributes argument.
24063         (event_declaration): Ditto.
24064         (enum_declaration): Ditto.
24065         (indexer_declaration): Ditto.
24066
24067         * class.cs (Operator::Operator): Update constructor accordingly.
24068         (Event::Event): Ditto.
24069
24070         * delegate.cs (Delegate::Delegate): Same here.
24071
24072         * enum.cs (Enum::Enum): Same here.
24073
24074 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24075
24076         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
24077
24078         * ../tests/cs0658.cs : New file to demonstrate error 0658.
24079
24080         * attribute.cs (Attributes): New class to encapsulate all attributes which were
24081         being passed around as an arraylist.
24082         (Attributes::AddAttribute): Method to add attribute sections.
24083
24084         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
24085         (struct_declaration): Update accordingly.
24086         (constant_declaration): Update.
24087         (field_declaration): Update.
24088         (method_header): Update.
24089         (fixed_parameter): Update.
24090         (parameter_array): Ditto.
24091         (property_declaration): Ditto.
24092         (destructor_declaration): Ditto.
24093
24094         * class.cs (Struct::Struct): Update constructors accordingly.
24095         (Class::Class): Ditto.
24096         (Field::Field): Ditto.
24097         (Method::Method): Ditto.
24098         (Property::Property): Ditto.
24099         (TypeContainer::OptAttribute): update property's return type.
24100
24101         * interface.cs (Interface.opt_attributes): New member.
24102         (Interface::Interface): Update to take the extra Attributes argument.
24103
24104         * parameter.cs (Parameter::Parameter): Ditto.
24105
24106         * constant.cs (Constant::Constant): Ditto.
24107
24108         * interface.cs (InterfaceMemberBase): New OptAttributes field.
24109         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
24110         the attributes as a parameter.
24111         (InterfaceProperty): Update constructor call.
24112         (InterfaceEvent): Ditto.
24113         (InterfaceMethod): Ditto.
24114         (InterfaceIndexer): Ditto.
24115
24116         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
24117         pass the attributes too.
24118         (interface_event_declaration): Ditto.
24119         (interface_property_declaration): Ditto.
24120         (interface_method_declaration): Ditto.
24121         (interface_declaration): Ditto.
24122
24123 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
24124
24125         * class.cs (Method::Define): Track the "static Main" definition to
24126         create an entry point. 
24127
24128         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24129         EntryPoint if we find it. 
24130
24131         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24132         (EmitContext::ig): Make this variable public.
24133
24134         * driver.cs: Make the default output file be the first file name
24135         with the .exe extension.  
24136
24137         Detect empty compilations
24138
24139         Handle various kinds of output targets.  Handle --target and
24140         rename -t to --dumper.
24141
24142         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24143         methods inherited from Expression return now an Expression.  This
24144         will is used during the tree rewriting as we resolve them during
24145         semantic analysis.
24146
24147         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24148         the spec.  Missing entirely is the information about
24149         accessability of elements of it.
24150
24151         (Expression::ExprClassFromMemberInfo): New constructor for
24152         Expressions that creates a fully initialized Expression based on
24153         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24154         a Type.
24155
24156         (Invocation::Resolve): Begin implementing resolution of invocations.
24157
24158         * literal.cs (StringLiteral):  Implement Emit.
24159
24160 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24161
24162         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24163         member.
24164
24165 2001-09-04  Ravi Pratap  <ravi@ximian.com>
24166
24167         * cs-parser.jay (attribute_arguments): Implement actions.
24168         (attribute): Fix bug in production. Implement action.
24169         (attribute_list): Implement.
24170         (attribute_target): Implement.
24171         (attribute_target_specifier, opt_target_specifier): Implement
24172         (CheckAttributeTarget): New method to check if the attribute target
24173         is valid.
24174         (attribute_section): Implement.
24175         (opt_attributes): Implement.
24176
24177         * attribute.cs : New file to handle attributes.
24178         (Attribute): Class to hold attribute info.
24179
24180         * cs-parser.jay (opt_attribute_target_specifier): Remove production
24181         (attribute_section): Modify production to use 2 different rules to 
24182         achieve the same thing. 1 s/r conflict down !
24183         Clean out commented, useless, non-reducing dimension_separator rules.
24184
24185         * class.cs (TypeContainer.attributes): New member to hold list
24186         of attributes for a type.
24187         (Struct::Struct): Modify to take one more argument, the attribute list.
24188         (Class::Class): Ditto.
24189         (Field::Field): Ditto.
24190         (Method::Method): Ditto.
24191         (Property::Property): Ditto.
24192
24193         * cs-parser.jay (struct_declaration): Update constructor call to
24194         pass in the attributes too.
24195         (class_declaration): Ditto.
24196         (constant_declaration): Ditto.
24197         (field_declaration): Ditto.
24198         (method_header): Ditto.
24199         (fixed_parameter): Ditto.
24200         (parameter_array): Ditto.
24201         (property_declaration): Ditto.
24202
24203         * constant.cs (Constant::Constant): Update constructor similarly.
24204         Use System.Collections.
24205
24206         * parameter.cs (Parameter::Parameter): Update as above.
24207
24208 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24209
24210         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24211         (TypeContainer.delegates): New member to hold list of delegates.
24212
24213         * cs-parser.jay (delegate_declaration): Implement the action correctly 
24214         this time as I seem to be on crack ;-)
24215
24216 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
24217
24218         * rootcontext.cs (RootContext::IsNamespace): new function, used to
24219         tell whether an identifier represents a namespace.
24220
24221         * expression.cs (NamespaceExpr): A namespace expression, used only
24222         temporarly during expression resolution.
24223         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24224         utility functions to resolve names on expressions.
24225
24226 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
24227
24228         * codegen.cs: Add hook for StatementExpressions. 
24229
24230         * class.cs: Fix inverted test for static flag in methods.
24231
24232 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24233
24234         * class.cs (Operator::CheckUnaryOperator): Correct error number used
24235         to make it coincide with MS' number.
24236         (Operator::CheckBinaryOperator): Ditto.
24237
24238         * ../errors/errors.txt : Remove error numbers added earlier.
24239
24240         * ../errors/cs1019.cs : Test case for error # 1019
24241
24242         * ../errros/cs1020.cs : Test case for error # 1020
24243
24244         * cs-parser.jay : Clean out commented cruft.
24245         (dimension_separators, dimension_separator): Comment out. Ostensibly not
24246         used anywhere - non-reducing rule.
24247         (namespace_declarations): Non-reducing rule - comment out.
24248
24249         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24250         with TypeContainer::AddEnum.
24251
24252         * delegate.cs : New file for delegate handling classes.
24253         (Delegate): Class for declaring delegates.
24254
24255         * makefile : Update.
24256
24257         * cs-parser.jay (delegate_declaration): Implement.
24258
24259 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
24260
24261         * class.cs (Event::Define): Implement.
24262         (Event.EventBuilder): New member.
24263
24264         * class.cs (TypeContainer::Populate): Update to define all enums and events
24265         we have.
24266         (Events): New property for the events arraylist we hold. Shouldn't we move to using
24267         readonly fields for all these cases ?
24268
24269 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24270
24271         * class.cs (Property): Revamp to use the convention of making fields readonly.
24272         Accordingly modify code elsewhere.
24273
24274         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24275         the Define method of the Property class.
24276
24277         * class.cs : Clean up applied patch and update references to variables etc. Fix 
24278         trivial bug.
24279         (TypeContainer::Populate): Update to define all the properties we have. Also
24280         define all enumerations.
24281
24282         * enum.cs (Define): Implement.
24283
24284 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24285
24286         * cs-parser.jay (overloadable_operator): The semantic value is an
24287         enum of the Operator class.
24288         (operator_declarator): Implement actions.
24289         (operator_declaration): Implement.
24290
24291         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24292         validity of definitions.
24293         (Operator::CheckBinaryOperator): Static method to check for binary operators
24294         (TypeContainer::AddOperator): New method to add an operator to a type.
24295
24296         * cs-parser.jay (indexer_declaration): Added line to actually call the
24297         AddIndexer method so it gets added ;-)
24298
24299         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
24300         already taken care of by the MS compiler ?  
24301
24302 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24303
24304         * class.cs (Operator): New class for operator declarations.
24305         (Operator::OpType): Enum for the various operators.
24306
24307 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24308
24309         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24310         ostensibly handle this in semantic analysis.
24311
24312         * cs-parser.jay (general_catch_clause): Comment out
24313         (specific_catch_clauses, specific_catch_clause): Ditto.
24314         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24315         (catch_args, opt_catch_args): New productions.
24316         (catch_clause): Rewrite to use the new productions above
24317         (catch_clauses): Modify accordingly.
24318         (opt_catch_clauses): New production to use in try_statement
24319         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
24320         and re-write the code in the actions to extract the specific and
24321         general catch clauses by being a little smart ;-)
24322
24323         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
24324         Hooray, try and catch statements parse fine !
24325
24326 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24327
24328         * statement.cs (Block::GetVariableType): Fix logic to extract the type
24329         string from the hashtable of variables.
24330
24331         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
24332         I end up making that mistake ;-)
24333         (catch_clauses): Fixed gross error which made Key and Value of the 
24334         DictionaryEntry the same : $1 !!
24335
24336 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24337
24338         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
24339
24340         * cs-parser.jay (event_declaration): Correct to remove the semicolon
24341         when the add and remove accessors are specified. 
24342
24343 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24344
24345         * cs-parser.jay (IndexerDeclaration): New helper class to hold
24346         information about indexer_declarator.
24347         (indexer_declarator): Implement actions.
24348         (parsing_indexer): New local boolean used to keep track of whether
24349         we are parsing indexers or properties. This is necessary because 
24350         implicit_parameters come into picture even for the get accessor in the 
24351         case of an indexer.
24352         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
24353
24354         * class.cs (Indexer): New class for indexer declarations.
24355         (TypeContainer::AddIndexer): New method to add an indexer to a type.
24356         (TypeContainer::indexers): New member to hold list of indexers for the
24357         type.
24358
24359 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24360
24361         * cs-parser.jay (add_accessor_declaration): Implement action.
24362         (remove_accessor_declaration): Implement action.
24363         (event_accessors_declaration): Implement
24364         (variable_declarators): swap statements for first rule - trivial.
24365
24366         * class.cs (Event): New class to hold information about event
24367         declarations.
24368         (TypeContainer::AddEvent): New method to add an event to a type
24369         (TypeContainer::events): New member to hold list of events.
24370
24371         * cs-parser.jay (event_declaration): Implement actions.
24372
24373 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24374
24375         * cs-parser.jay (dim_separators): Implement. Make it a string
24376         concatenating all the commas together, just as they appear.
24377         (opt_dim_separators): Modify accordingly
24378         (rank_specifiers): Update accordingly. Basically do the same
24379         thing - instead, collect the brackets here.
24380         (opt_rank_sepcifiers): Modify accordingly.
24381         (array_type): Modify to actually return the complete type string
24382         instead of ignoring the rank_specifiers.
24383         (expression_list): Implement to collect the expressions
24384         (variable_initializer): Implement. We make it a list of expressions
24385         essentially so that we can handle the array_initializer case neatly too.
24386         (variable_initializer_list): Implement.
24387         (array_initializer): Make it a list of variable_initializers
24388         (opt_array_initializer): Modify accordingly.
24389
24390         * expression.cs (New::NType): Add enumeration to help us
24391         keep track of whether we have an object/delegate creation
24392         or an array creation.
24393         (New:NewType, New::Rank, New::Indices, New::Initializers): New
24394         members to hold data about array creation.
24395         (New:New): Modify to update NewType
24396         (New:New): New Overloaded contructor for the array creation
24397         case.
24398
24399         * cs-parser.jay (array_creation_expression): Implement to call
24400         the overloaded New constructor.
24401
24402 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
24403
24404         * class.cs (TypeContainer::Constructors): Return member
24405         constructors instead of returning null.
24406
24407 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
24408
24409         * typemanager.cs (InitCoreTypes): Initialize the various core
24410         types after we have populated the type manager with the user
24411         defined types (this distinction will be important later while
24412         compiling corlib.dll)
24413
24414         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
24415         on Expression Classification.  Now all expressions have a method
24416         `Resolve' and a method `Emit'.
24417
24418         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
24419         generation from working.     Also add some temporary debugging
24420         code. 
24421
24422 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
24423
24424         * codegen.cs: Lots of code generation pieces.  This is only the
24425         beginning, will continue tomorrow with more touches of polish.  We
24426         handle the fundamentals of if, while, do, for, return.  Others are
24427         trickier and I need to start working on invocations soon.
24428
24429         * gen-treedump.cs: Bug fix, use s.Increment here instead of
24430         s.InitStatement. 
24431
24432         * codegen.cs (EmitContext): New struct, used during code
24433         emission to keep a context.   Most of the code generation will be
24434         here. 
24435
24436         * cs-parser.jay: Add embedded blocks to the list of statements of
24437         this block.  So code generation proceeds in a top down fashion.
24438
24439 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
24440
24441         * statement.cs: Add support for multiple child blocks.
24442
24443 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
24444
24445         * codegen.cs (EmitCode): New function, will emit the code for a
24446         Block of code given a TypeContainer and its ILGenerator. 
24447
24448         * statement.cs (Block): Standard public readonly optimization.
24449         (Block::Block constructors): Link children. 
24450         (Block::Child): Child Linker.
24451         (Block::EmitVariables): Emits IL variable declarations.
24452
24453         * class.cs: Drop support for MethodGroups here, delay until
24454         Semantic Analysis.
24455         (Method::): Applied the same simplification that I did before, and
24456         move from Properties to public readonly fields.
24457         (Method::ParameterTypes): Returns the parameter types for the
24458         function, and implements a cache that will be useful later when I
24459         do error checking and the semantic analysis on the methods is
24460         performed.
24461         (Constructor::GetCallingConvention): Renamed from CallingConvetion
24462         and made a method, optional argument tells whether this is a class
24463         or a structure to apply the `has-this' bit.
24464         (Method::GetCallingConvention): Implement, returns the calling
24465         convention. 
24466         (Method::Define): Defines the type, a second pass is performed
24467         later to populate the methods.
24468
24469         (Constructor::ParameterTypes): implement a cache similar to the
24470         one on Method::ParameterTypes, useful later when we do semantic
24471         analysis. 
24472
24473         (TypeContainer::EmitMethod):  New method.  Emits methods.
24474
24475         * expression.cs: Removed MethodGroup class from here.
24476
24477         * parameter.cs (Parameters::GetCallingConvention): new method.
24478
24479 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
24480
24481         * class.cs (TypeContainer::Populate): Drop RootContext from the
24482         argument. 
24483
24484         (Constructor::CallingConvention): Returns the calling convention.
24485         (Constructor::ParameterTypes): Returns the constructor parameter
24486         types. 
24487
24488         (TypeContainer::AddConstructor): Keep track of default constructor
24489         and the default static constructor.
24490
24491         (Constructor::) Another class that starts using `public readonly'
24492         instead of properties. 
24493
24494         (Constructor::IsDefault): Whether this is a default constructor. 
24495
24496         (Field::) use readonly public fields instead of properties also.
24497
24498         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
24499         track of static constructors;  If none is used, turn on
24500         BeforeFieldInit in the TypeAttributes. 
24501
24502         * cs-parser.jay (opt_argument_list): now the return can be null
24503         for the cases where there are no arguments. 
24504
24505         (constructor_declarator): If there is no implicit `base' or
24506         `this', then invoke the default parent constructor. 
24507
24508         * modifiers.cs (MethodAttr): New static function maps a set of
24509         modifiers flags into a MethodAttributes enum
24510         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
24511         MethodAttr, TypeAttr to represent the various mappings where the
24512         modifiers are used.
24513         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
24514
24515 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
24516
24517         * parameter.cs (GetParameterInfo): Fix bug where there would be no
24518         method arguments.
24519
24520         * interface.cs (PopulateIndexer): Implemented the code generator
24521         for interface indexers.
24522
24523 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
24524
24525         * interface.cs (InterfaceMemberBase): Now we track the new status
24526         here.  
24527
24528         (PopulateProperty): Implement property population.  Woohoo!  Got
24529         Methods and Properties going today. 
24530
24531         Removed all the properties for interfaces, and replaced them with
24532         `public readonly' fields. 
24533
24534 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
24535
24536         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
24537         initialize their hashtables/arraylists only when they are needed
24538         instead of doing this always.
24539
24540         * parameter.cs: Handle refs and out parameters.
24541
24542         * cs-parser.jay: Use an ArrayList to construct the arguments
24543         instead of the ParameterCollection, and then cast that to a
24544         Parameter[] array.
24545
24546         * parameter.cs: Drop the use of ParameterCollection and use
24547         instead arrays of Parameters.
24548
24549         (GetParameterInfo): Use the Type, not the Name when resolving
24550         types. 
24551
24552 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
24553
24554         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
24555         and instead use public readonly fields.
24556
24557         * class.cs: Put back walking code for type containers.
24558
24559 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
24560
24561         * class.cs (MakeConstant): Code to define constants.
24562
24563         * rootcontext.cs (LookupType): New function.  Used to locate types 
24564
24565
24566 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
24567
24568         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
24569         this System.Reflection code is.  Kudos to Microsoft
24570
24571         * typemanager.cs: Implement a type cache and avoid loading all
24572         types at boot time.  Wrap in LookupType the internals.  This made
24573         the compiler so much faster.  Wow.  I rule!
24574
24575         * driver.cs: Make sure we always load mscorlib first (for
24576         debugging purposes, nothing really important).
24577
24578         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
24579         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
24580
24581         * rootcontext.cs: Lookup types on their namespace;  Lookup types
24582         on namespaces that have been imported using the `using' keyword.
24583
24584         * class.cs (TypeContainer::TypeAttr): Virtualize.
24585         (Class::TypeAttr): Return attributes suitable for this bad boy.
24586         (Struct::TypeAttr): ditto.
24587         Handle nested classes.
24588         (TypeContainer::) Remove all the type visiting code, it is now
24589         replaced with the rootcontext.cs code
24590
24591         * rootcontext.cs (GetClassBases): Added support for structs. 
24592
24593 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
24594
24595         * interface.cs, statement.cs, class.cs, parameter.cs,
24596         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
24597         Drop use of TypeRefs, and use strings instead.
24598
24599 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
24600
24601         * rootcontext.cs: 
24602
24603         * class.cs (Struct::Struct): set the SEALED flags after
24604         checking the modifiers.
24605         (TypeContainer::TypeAttr): new property, returns the
24606         TypeAttributes for a class.  
24607
24608         * cs-parser.jay (type_list): Oops, list production was creating a
24609         new list of base types.
24610
24611         * rootcontext.cs (StdLib): New property.
24612         (GetInterfaceTypeByName): returns an interface by type name, and
24613         encapsulates error handling here.
24614         (GetInterfaces): simplified.
24615         (ResolveTree): Encapsulated all the tree resolution here.
24616         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
24617         types. 
24618
24619         * driver.cs: Add support for --nostdlib, to avoid loading the
24620         default assemblies.
24621         (Main): Do not put tree resolution here. 
24622
24623         * rootcontext.cs: Beginning of the class resolution.
24624
24625 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
24626
24627         * rootcontext.cs: Provide better error reporting. 
24628
24629         * cs-parser.jay (interface_base): set our $$ to be interfaces.
24630
24631         * rootcontext.cs (CreateInterface): Handle the case where there
24632         are no parent interfaces.
24633
24634         (CloseTypes): Routine to flush types at the end.
24635         (CreateInterface): Track types.
24636         (GetInterfaces): Returns an array of Types from the list of
24637         defined interfaces.
24638
24639         * typemanager.c (AddUserType): Mechanism to track user types (puts
24640         the type on the global type hash, and allows us to close it at the
24641         end). 
24642
24643 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
24644
24645         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
24646         RecordInterface instead.
24647
24648         * cs-parser.jay: Updated to reflect changes above.
24649
24650         * decl.cs (Definition): Keep track of the TypeBuilder type that
24651         represents this type here.  Not sure we will use it in the long
24652         run, but wont hurt for now.
24653
24654         * driver.cs: Smaller changes to accomodate the new code.
24655
24656         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
24657         when done. 
24658
24659         * rootcontext.cs (CreateInterface):  New method, used to create
24660         the System.TypeBuilder type for interfaces.
24661         (ResolveInterfaces): new entry point to resolve the interface
24662         hierarchy. 
24663         (CodeGen): Property, used to keep track of the code generator.
24664
24665 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
24666
24667         * cs-parser.jay: Add a second production for delegate_declaration
24668         with `VOID'.
24669
24670         (enum_body): Put an opt_comma here instead of putting it on
24671         enum_body or enum_member_declarations so we can handle trailing
24672         commas on enumeration members.  Gets rid of a shift/reduce.
24673
24674         (type_list): Need a COMMA in the middle.
24675
24676         (indexer_declaration): Tell tokenizer to recognize get/set
24677
24678         * Remove old targets.
24679
24680         * Re-add the parser target.
24681
24682 2001-07-13  Simon Cozens <simon@simon-cozens.org>
24683
24684         * cs-parser.jay: Add precendence rules for a number of operators
24685         ot reduce the number of shift/reduce conflicts in the grammar.
24686
24687 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
24688
24689         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
24690         and put it here.
24691
24692         Get rid of old crufty code.
24693
24694         * rootcontext.cs: Use this to keep track of the parsed
24695         representation and the defined types available to the program. 
24696
24697         * gen-treedump.cs: adjust for new convention.
24698
24699         * type.cs: Split out the type manager, and the assembly builder
24700         from here. 
24701
24702         * typemanager.cs: the type manager will live here now.
24703
24704         * cil-codegen.cs: And the code generator here. 
24705
24706 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
24707
24708         * makefile: Fixed up for easy making.
24709
24710 2001-07-13  Simon Cozens <simon@simon-cozens.org>
24711
24712         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
24713         the 
24714
24715         (unary_expression): Expand pre_increment_expression and
24716         post_decrement_expression to reduce a shift/reduce.
24717
24718 2001-07-11  Simon Cozens
24719
24720         * cs-tokenizer.cs: Hex numbers should begin with a 0.
24721
24722         Improve allow_keyword_as_indent name.
24723
24724 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
24725
24726         * Adjustments for Beta2. 
24727
24728 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
24729
24730         * decl.cs: Added `Define' abstract method.
24731         (InTransit): new property, used to catch recursive definitions. 
24732
24733         * interface.cs: Implement `Define'. 
24734
24735         * modifiers.cs: Map Modifiers.constants to
24736         System.Reflection.TypeAttribute flags.
24737
24738         * class.cs: Keep track of types and user-defined types.
24739         (BuilderInit): New method for creating an assembly
24740         (ResolveType): New function to launch the resolution process, only
24741         used by interfaces for now.
24742
24743         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
24744         that are inserted into the name space. 
24745
24746 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
24747
24748         * ARGH.  I have screwed up my tree so many times due to the use of
24749         rsync rather than using CVS.  Going to fix this at once. 
24750
24751         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
24752         load types.
24753
24754 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
24755
24756         * Experiment successful: Use System.Type rather that our own
24757         version of Type.  
24758
24759 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
24760
24761         * cs-parser.jay: Removed nsAliases from here.
24762
24763         Use new namespaces, handle `using XXX;' 
24764
24765         * namespace.cs: Reimplemented namespace handling, use a recursive
24766         definition of the class.  Now we can keep track of using clauses
24767         and catch invalid using clauses.
24768
24769 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
24770
24771         * gen-treedump.cs: Adapted for all the renaming.
24772
24773         * expression.cs (Expression): this class now has a Type property
24774         which returns an expression Type.
24775
24776         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
24777         `Type', as this has a different meaning now in the base
24778
24779 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
24780
24781         * interface.cs, class.cs: Removed from all the sources the
24782         references to signature computation, as we can not do method
24783         signature computation during the parsing time, as we are not
24784         trying to solve at that point distinguishing:
24785
24786         class X {
24787                 void a (Blah x) {}
24788                 void a (NS.Blah x) {}
24789         }
24790
24791         Which depending on the context might be valid or not, as we do not
24792         know if Blah is the same thing as NS.Blah at that point.
24793
24794         * Redid everything so the code uses TypeRefs now instead of
24795         Types.  TypeRefs are just temporary type placeholders, that need
24796         to be resolved.  They initially have a pointer to a string and the
24797         current scope in which they are used.  This is used later by the
24798         compiler to resolve the reference to an actual Type. 
24799
24800         * DeclSpace is no longer a CIR.Type, and neither are
24801         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
24802         are all DeclSpaces, but no Types. 
24803
24804         * type.cs (TypeRefManager): This implements the TypeRef manager,
24805         which keeps track of all the types that need to be resolved after
24806         the parsing has finished. 
24807
24808 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
24809
24810         * ARGH.  We are going to have to store `foreach' as a class rather
24811         than resolving it, as we need to verify error 1579 after name
24812         resolution.   *OR* we could keep a flag that says `This request to
24813         IEnumerator comes from a foreach statement' which we can then use
24814         to generate the error.
24815
24816 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
24817
24818         * class.cs (TypeContainer.AddMethod): we now add methods to the
24819         MethodGroup instead of the method hashtable.  
24820
24821         * expression.cs: Add MethodGroup abstraction, which gets us one
24822         step closer to the specification in the way we handle method
24823         declarations.  
24824
24825         * cs-parser.jay (primary_expression): qualified_identifier now
24826         tried to match up an identifier to a local variable reference or
24827         to a parameter reference.
24828
24829         current_local_parameters is now a parser global variable that
24830         points to the current parameters for the block, used during name
24831         lookup.
24832
24833         (property_declaration): Now creates an implicit `value' argument to
24834         the set accessor.
24835
24836 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
24837
24838         * parameter.cs: Do not use `param' arguments as part of the
24839         signature, per the spec.
24840
24841 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
24842
24843         * decl.cs: Base class for classes, structs and interfaces.  This
24844         is the "Declaration Space" 
24845
24846         * cs-parser.jay: Use CheckDef for checking declaration errors
24847         instead of having one on each function.
24848
24849         * class.cs: Factor out some code for handling error handling in
24850         accordance to the "Declarations" section in the "Basic Concepts"
24851         chapter in the ECMA C# spec.
24852
24853         * interface.cs: Make all interface member classes derive from
24854         InterfaceMemberBase.
24855
24856 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
24857
24858         * Many things: all interfaces are parsed and generated in
24859         gen-treedump.  Support for member variables, constructors,
24860         destructors, properties, constants is there.
24861
24862         Beginning of the IL backend, but very little done, just there for
24863         testing purposes. 
24864
24865 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
24866
24867         * cs-parser.jay: Fix labeled statement.
24868
24869         * cs-tokenizer.cs (escape): Escape " and ' always.
24870         ref_line, ref_name: keep track of the line/filename as instructed
24871         by #line by the compiler.
24872         Parse #line.
24873
24874 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
24875
24876         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
24877         to match the values in System.CodeDOM.
24878
24879         Divid renamed to Divide.
24880
24881         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
24882         statements. 
24883         (Statements.set): remove.
24884
24885         * System.CodeDOM/CodeCatchClause.cs: always have a valid
24886         statements. 
24887
24888         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
24889         falseStatements always have valid values. 
24890
24891         * cs-parser.jay: Use System.CodeDOM now.
24892